code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
import os
import io
class TestCase(object):
pass
def calculateMatches(testCase):
firstCandidates = set(testCase.cardgrid1[testCase.row1 - 1])
secondCandidates = set(testCase.cardgrid2[testCase.row2 - 1])
return list(firstCandidates.intersection(secondCandidates))
pass
def parseInput(fileIn):
... | ajibawa-2023/Python-Code-Large/train/row_98043 | 40 | 77 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98043:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98043:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98043:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98043:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98043:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
def matrix_to_string(M, padfunc=None):
"""Return a string representation of a matrix with each row on a new line,
and padding between columns determined by the optional padfunc argument.
If provided, padfunc must accept row and column indicies as input and produce
an int output.
"""
rowstrs ... | ajibawa-2023/Python-Code-Large/train/row_98044 | 14 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98044:FunctionDef_L2_C0", "label": "matrix_to_string", "type": "function", "loc": [2, 17], "level": 0, "parent": null, "vector": [2, 0, 0.3958, 0.6667, 0, 0.66, 0.0, 810, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "matrix_to_string", "arg_names": ["M", "padfunc"], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98044:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98044:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98044:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98044:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import random
def sort(toSort):
"""Sorts all of the elements in the provided list using only three stacks, and
no additional memory."""
a = []
b = []
c = toSort[:]
# This problem appears in the ACM. We must sort the elements in the given list
# using no memory other than the three stacks... | ajibawa-2023/Python-Code-Large/train/row_98045 | 41 | 78 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98045:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98045:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98045:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98045:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98045:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import sys
import testutils
def lis(input):
"""Find and return the longest increasing subsequence (LIS) in the given
list
Note: This algorithm demonstrates the use of dynamic programming. There is,
however, a more efficient solution to the LIS problem. See:
http://en.wikipedia.org/wiki/Longest_incr... | ajibawa-2023/Python-Code-Large/train/row_98046 | 31 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98046:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98046:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98046:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98046:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98046:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
class LinkedList(object):
"""description of class"""
class LinkedListNode(object):
def __init__(self, value):
self.next = None
self.value = value
def __init__(self):
self.head = None
def add(self, value):
newNode = LinkedList.LinkedListNode(value)
... | ajibawa-2023/Python-Code-Large/train/row_98047 | 40 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98047:ClassDef_L1_C0", "label": "LinkedList", "type": "class", "loc": [1, 39], "level": 0, "parent": null, "vector": [3, 0, 0.3571, 0.6964, 0, 0.66, 0.0, 353, 0, 5, 0, 0, 186, 0, 3], "semantic": {"name": "LinkedList", "arg_names": [], "import_names": [], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98047:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98047:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98047:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98047:ClassDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
def count_substring_matches(s, w):
i = j = 0
matches = 0
while i <= len(s) - len(w) or j > 0:
if j == len(w):
matches += 1
i -= (j - 1)
j = 0
else:
if s[i] == w[j]:
i += 1
j += 1
else:
... | ajibawa-2023/Python-Code-Large/train/row_98048 | 40 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98048:FunctionDef_L2_C0", "label": "count_substring_matches", "type": "function", "loc": [2, 18], "level": 0, "parent": null, "vector": [2, 0, 0.1389, 0.2361, 0, 0.66, 0.0, 193, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "count_substring_matches", "arg_names": ["s", "w"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98048:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98048:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98048:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98048:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import random
class Subarray:
def __init__(self):
self.start = 0 # inclusive
self.end = 0 # exclusive
self.val = 0
def highest_value_subarray(arr):
best = Subarray()
bestWithK = Subarray()
if len(arr) == 0:
return best
# init base case
if arr[0] > 0:
... | ajibawa-2023/Python-Code-Large/train/row_98049 | 34 | 51 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98049:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98049:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98049:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98049:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98049:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code... |
import sys
#This file used for testing ideas
#clearly some dynamic programming is required. is it enough to track the lis
# up to the current point in the list then for the current element, add it to
# each subsequence for which it is greater than the last element? No, because
# it may be best for the lis to exclud... | ajibawa-2023/Python-Code-Large/train/row_98050 | 27 | 59 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98050:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98050:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98050:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98050:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98050:For_L28_C4"}, {"f": "ajibawa-2023/Python-Code-... |
import random
def _randomize(l):
for i in range(len(l)):
toSwap = random.randrange(i, len(l))
l[i], l[toSwap] = l[toSwap], l[i]
return l
if __name__ == "__main__":
sortedArray = list(range(100))
for _ in range(10):
print(_randomize(sortedArray)); | ajibawa-2023/Python-Code-Large/train/row_98051 | 10 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98051:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98051:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98051:For_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98051:For_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98051:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import sys
import random
def find_rank_in_union(A, B, k):
"""Given two ordered lists A and B, find the value of the element with rank
k in the ordered set A U B"""
# Error Cases
if len(A) + len(B) < k:
print("The given rank was larger than the rank of the set A U B")
return -1
... | ajibawa-2023/Python-Code-Large/train/row_98052 | 22 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98052:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98052:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98052:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98052:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98052:If_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import random
import itertools
def quicksort(input):
"""Performs an in-place quicksort."""
if len(input) <= 1:
return input
leftPivot, rightPivot = partition(input)
quicksort(itertools.islice(input, 0, leftPivot))
quicksort(itertools.islice(input, rightPivot+1, len(input)))
return input... | ajibawa-2023/Python-Code-Large/train/row_98053 | 39 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98053:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98053:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98053:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98053:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98053:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import sys
import functools
import itertools
import random
import heap
__all__ = ['Graph', 'Edge', 'Node', 'topological_sort', 'post_order_sort', 'get_reachable', 'strongly_connected_components', 'shortest_path', 'generate_rand_edges']
@functools.total_ordering
class Node:
def __init__(self, key, value=None):
... | ajibawa-2023/Python-Code-Large/train/row_98054 | 220 | 365 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98054:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0027, 0.0027, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98054:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98054:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98054:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98054:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
import random
import testutils
import bestsubarray
class Submatrix:
def __init__(self, mat):
self.mat = mat
self.start_row = 0 # inclusive
self.start_col = 0
self.end_row = 0 # exclusive
self.end_col = 0
self.val = 0
def get_copy(self):
return [row[self.... | ajibawa-2023/Python-Code-Large/train/row_98055 | 90 | 122 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98055:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0082, 0.0082, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98055:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98055:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98055:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98055:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
import sys
__all__ = ['Heap', 'PriorityQueue']
class NodeHeap(object):
"""An ordered set optimized for finding the greatest value element.
This is a binary max heap."""
class heapNode(object):
def __init__(self, value):
self.parent = None
self.left = None
... | ajibawa-2023/Python-Code-Large/train/row_98056 | 230 | 328 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98056:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98056:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98056:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98056:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98056:ClassDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
def generate_paren_combos(n):
"""Generate the set of all possible valid arrangements of n pairs
of parentheses. Note, we have to use sets to store the results
because we'll end up with duplicates otherwise.
"""
if n == 0:
return ""
curCombos = set(["()"])
for i in range(1, n):
... | ajibawa-2023/Python-Code-Large/train/row_98057 | 36 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98057:FunctionDef_L2_C0", "label": "generate_paren_combos", "type": "function", "loc": [2, 16], "level": 0, "parent": null, "vector": [2, 0, 0.1552, 0.2586, 0, 0.66, 0.0, 599, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "generate_paren_combos", "arg_names": ["n"], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98057:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98057:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98057:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98057:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
if __name__ == "__main__":
# determine the number of units of water that would be trapped in a landscape
# defined by the the waterTable array
waterTable = [ 3, 5, 0, 3, 7, 1, 4, 2, 9, 8, 7, 3, 2, 9, 1, 6, 2, 3, 5, 4, 8, 1, 4, 7, 1]
maxHeight = max(waterTable)
totalWater = 0
leftMaxIndex = -1... | ajibawa-2023/Python-Code-Large/train/row_98058 | 29 | 64 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98058:If_L2_C0", "label": "if", "type": "if", "loc": [2, 61], "level": 0, "parent": null, "vector": [4, 0, 0.4922, 0.9375, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98058:If_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98058:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98058:If_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98058:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_980... |
from partie2 import *
#====Test de la resolution de l'equation du modele de Malthus======#
gamma = 0.007
h = 0.1
t0 = 0
y0 = 30000000
N = 1000
y = malthus(gamma , h , t0 , y0 , N , step_midpoint)#Exemple credible
x=np.linspace(0,100,len(y))
#mal = mp.plot(x,y)
#mp.show()
#====Test de la resolution de l'equation du ... | ajibawa-2023/Python-Code-Large/train/row_98059 | 20 | 83 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98059:ImportFrom_L1_C0", "label": "from partie2 import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.012, 0, 0.66, 0.0, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "partie2", "arg_names": [], "import_names": ["*"], "rhs_c... | [] |
# -*coding:utf-8 -*
import numpy as np
import matplotlib.pyplot as mp
from scipy.integrate import odeint
#------------------------#
# projet 6 #
# #
# partie 1 #
#------------------------#
# Implementation des differentes methodes de resolutions
# methode d'Euler
... | ajibawa-2023/Python-Code-Large/train/row_98060 | 143 | 220 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98060:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0136, 0.0045, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98060:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98060:Return_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98060:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98060:Return_L22_C4"}, {"f": "ajibawa-2023/Python-Co... |
from partie3 import *
#=======resolution du systeme et tracage de la solution========#
I=array([1,0,0])
#y = resoudre(I, 0.1 , 0.1 , 1. , 2.)
#courbe = mp.plot(y[0],y[1])
#mp.legend(courbe ,("X","Y","Z"))
#xlabel("t")
#ylabel("y(t)")
#mp.show()
#======calcul du temps du debut de la phase periodique========#
#y = me... | ajibawa-2023/Python-Code-Large/train/row_98062 | 7 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98062:ImportFrom_L1_C0", "label": "from partie3 import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 658, 0, 1, 0, 0, 658, 0, 0], "semantic": {"name": "partie3", "arg_names": [], "import_names": ["*"], "r... | [] |
import numpy as np
import pylab as plt
from matplotlib.collections import *
import matplotlib.pyplot as mp
from mpl_toolkits.mplot3d import Axes3D
import mpl_toolkits.mplot3d as M3
from partie1 import *
from scipy.integrate import odeint
#------------------------#
# projet 6 #
# ... | ajibawa-2023/Python-Code-Large/train/row_98063 | 94 | 141 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98063:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98063:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98063:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98063:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98063:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python... |
import random
def generateRandomList(size):
'''return a list, contains 'size' of random number
'''
list=[]
while size>0:
list.append(random.randint(1,99))
size-=1
return list
def test(result, expectation,type):
'''test if the result equals expectation
'''
if result==expectation:
print type,'OK, result:',... | ajibawa-2023/Python-Code-Large/train/row_98064 | 69 | 114 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98064:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98064:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98064:Expr_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98064:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98064:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#The TSP problem
#created by logan rooper- Riverdale High School - logan.rooper@gmail.com
#Random walk
import random
import math
################################################################################################
cycles = int(input("How many iterations do you want? >")) #INCREASE THIS TO INCREASE ITERATIO... | ajibawa-2023/Python-Code-Large/train/row_98065 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98065:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [] |
#The TSP problem
#created by logan rooper- Riverdale High School - logan.rooper@gmail.com
#Random walk
import random
import math
################################################################################################
cycles = int(input("How many iterations do you want? >")) #INCREASE THIS TO INCREASE ITERATIO... | ajibawa-2023/Python-Code-Large/train/row_98066 | 78 | 141 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98066:Import_L4_C0", "label": "random import random", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0284, 0.0071, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98066:For_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98066:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98066:For_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98066:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
"""
start north rotate clockwise
0 = out, circle
1 = out, square
2 = in, circle
3 = in, square
0, 2 go together
1, 3 go together
puzzle:
0 1
2 3
"""
import random
#VARIABLE DECLARATION
pieces = [
[1,0,1,1],
[0,2,3,2],
[1,1,1,0],
[3,1,2,0],
[1,3,0,3],
[3,2,2,1],
#[0,1,0,1],
#[2,... | ajibawa-2023/Python-Code-Large/train/row_98068 | 52 | 106 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98068:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0802, 0.1509, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98068:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98068:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98068:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98068:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
import random
from time import localtime
f = open("output.txt", "w")
"""
start north rotate clockwise
0 = out, circle
1 = out, square
2 = in, circle
3 = in, square
0, 2 go together
1, 3 go together
puzzle:
0 1
2 3
"""
#VARIABLE DECLARATION
pieces = [
[1,0,1,1],
[0,2,3,2],
[3,1,2,0],
[1,3,0,3],... | ajibawa-2023/Python-Code-Large/train/row_98069 | 54 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98069:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0104, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98069:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98069:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98069:For_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98069:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
start north rotate clockwise
0 = in arrow pointing in
1 = out arrow pointing out
2 = in arrow pointing out
3 = out arrow pointing in
4 = out cross
5 = in cross
6 = out hexagon
7 = in hexagon
0, 1 go together
2, 3 go together
4, 5 go together
6, 7 go together
puzzle:
0 1 2 3
4 5 6 7
8 9 10 11
12... | ajibawa-2023/Python-Code-Large/train/row_98070 | 89 | 155 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98070:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 29], "level": 0, "parent": null, "vector": [8, 0, 0.0968, 0.1871, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98070:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98070:For_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98070:For_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98070:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
start north rotate clockwise
0 = in arrow pointing in
1 = out arrow pointing out
2 = in arrow pointing out
3 = out arrow pointing in
4 = out cross
5 = in cross
6 = out hexagon
7 = in hexagon
0, 1 go together
2, 3 go together
4, 5 go together
6, 7 go together
puzzle:
0 1 2
3 4 5
6 7 8
"""
import random... | ajibawa-2023/Python-Code-Large/train/row_98071 | 70 | 127 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98071:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 27], "level": 0, "parent": null, "vector": [8, 0, 0.1102, 0.2126, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98071:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98071:For_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98071:For_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98071:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#The TSP problem
#created by Logan Rooper/Quinn Millegan - Riverdale High School - logan.rooper@gmail.com
#Hill Climber
#JusticeForAaronSwartz
import random
import math
################################################################################################
cycles = int(input("How many iterations do you want? ... | ajibawa-2023/Python-Code-Large/train/row_98072 | 44 | 109 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98072:Import_L5_C0", "label": "random import random", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0092, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98072:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98072:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98072:While_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98072:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
# Ler um vetor de 10 nomes
nome = 10*[""]
for i in range(10):
nome[i] = input('Nome: ')
nome_a_procurar = input('Nome a pesquisar: ')
encontrado = False
for j in range(10):
if nome[j] == nome_a_procurar:
encontrado = True
if encontrado:
print('Nome encontrado.')
else:
print('Nome não encon... | ajibawa-2023/Python-Code-Large/train/row_98073 | 11 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98073:Assign_L3_C0", "label": "nome =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.15, 0.05, 0, 0.66, 0.0, 525, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nome", "arg_names": [], "import_names": [], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98073:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98073:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98073:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98073:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_980... |
'''
Fazer um programa que leia 4 notas de 5 alunos e, ao final, informe:
* A média de notas de cada um dos alunos
* A maior nota de cada um deles
* Em que mês (0, 1, 2 ou 3) os alunos obtiveram as melhores notas, na média.
'''
| ajibawa-2023/Python-Code-Large/train/row_98074 | 1 | 6 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98074:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.5833, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [] |
'''
Fazer um programa que leia 8 notas de um aluno e informe:
* maior nota
* menor nota
* média das notas
* bimestre da maior nota
'''
# Criação do vetor de notas
nota = 8*[0]
# Leitura do vetor de notas
for k in range(8):
print('Nota[', i+1,'] = ', end='')
nota[k] = int(input())
# Processamento das ... | ajibawa-2023/Python-Code-Large/train/row_98075 | 20 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98075:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.093, 0.1628, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98075:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98075:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98075:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98075:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
cont = 0
numero = 10*[0]
while cont < 10:
numero[cont] = int(input('Entre com um número: '))
cont += 1
cont = 9
while cont >= 0:
print(numero[cont])
cont -= 1
| ajibawa-2023/Python-Code-Large/train/row_98076 | 7 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98076:Assign_L1_C0", "label": "cont =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 729, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cont", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98076:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98076:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98076:While_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98076:Expr_L8_C4"}] |
# Faça um Programa que leia um vetor de 5
# números inteiros e mostre-os.
cont = 0
vetor_numeros = 5*[0]
# Ler os elementos do vetor
while cont < 5:
vetor_numeros[cont] = int(input('Entre com um número: '))
cont += 1
cont = 0
while cont < 5:
print(vetor_numeros[cont])
cont += 1
| ajibawa-2023/Python-Code-Large/train/row_98077 | 7 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98077:Assign_L4_C0", "label": "cont =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0588, 0, 0.66, 0.0, 729, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cont", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98077:While_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98077:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98077:While_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98077:Expr_L14_C4"}] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Programa que cria uma pasta para salvar os exemplos de aula de hoje
import os, time
nomePasta = time.strftime("%Y-%m-%d")
if not os.path.exists(nomePasta):
os.mkdir(nomePasta)
os.chdir(nomePasta)
os.system('/bin/bash')
| ajibawa-2023/Python-Code-Large/train/row_98078 | 6 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98078:Import_L5_C0", "label": "os import os, time", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0667, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "time"], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98078:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98078:Expr_L10_C4"}] |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import sys
import os
import http.server
import webbrowser
print('Executando o servidor Web na pasta "{}"'.format(os.getcwd()))
if webbrowser.open('http://127.0.0.1:8000'):
http.server.test(HandlerClass=http.server.CGIHTTPRequestHandler)
| ajibawa-2023/Python-Code-Large/train/row_98079 | 7 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98079:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0833, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98079:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98079:Expr_L12_C4"}] |
# Faça um programa que leia duas matrizes 2x2 e
# mostre o resultado da soma delas.
from pprint import pprint
matrizA = [[0,0],
[0, 0]]
matrizB = [[0, 0],
[0, 0]]
matrizC = [[0, 0],
[0, 0]]
# Leitura da matrizA
for i in range(2):
for j in range(2):
print('matrizA[', i, '... | ajibawa-2023/Python-Code-Large/train/row_98080 | 16 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98080:ImportFrom_L4_C0", "label": "from pprint import pprint", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0333, 0, 0.66, 0.0, 276, 0, 1, 0, 0, 276, 0, 0], "semantic": {"name": "pprint", "arg_names": [], "import_names": ["ppri... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98080:For_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98080:For_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98080:For_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98080:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
matriz = [[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]]
for i in range(3):
for j in range(4):
print(matriz[i][j], end='\t')
#print('{0:2}'.format(matriz[i][j]),
# end=' ')
print()
| ajibawa-2023/Python-Code-Large/train/row_98081 | 5 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98081:Assign_L1_C0", "label": "matriz =", "type": "assigned_variable", "loc": [1, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.2727, 0, 0.66, 0.0, 24, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "matriz", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98081:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98081:For_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98081:For_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98081:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98081:... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Faça um programa para ler e uma matriz 4x4 e exibi-la ao final.
matrizA = [4*[0] for i in range(4)]
# Leitura da matriz
for i in range(4):
for j in range(4):
print('matriz[',i,'][', j, '] = ', sep='', end='')
matrizA[i][j] = tipo(input())
fo... | ajibawa-2023/Python-Code-Large/train/row_98082 | 9 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98082:Assign_L6_C0", "label": "matrizA =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3158, 0.0526, 0, 0.66, 0.0, 496, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matrizA", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98082:For_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98082:For_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98082:For_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98082:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_980... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Faça um programa para ler duas matrizes 4x4 e mostrar sua soma.
matrizA = [4*[0] for i in range(4)]
matrizB = [4*[0] for i in range(4)]
matrizC = [4*[0] for i in range(4)]
# Leitura das matrizes
for i in range(4):
for j in range(4):
print('matrizA[',i,'][', ... | ajibawa-2023/Python-Code-Large/train/row_98083 | 18 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98083:Assign_L6_C0", "label": "matrizA =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0333, 0, 0.66, 0.0, 496, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matrizA", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98083:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98083:For_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98083:For_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98083:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Faça um programa para ler uma matriz n(x)m e mostrar o resultado de seu produto por um número real "x".
matrizA = [4*[0] for i in range(4)]
x = float(input('Entre com um número real: '))
# Leitura da matriz
for i in range(4):
for j in range(4):
print('matriz... | ajibawa-2023/Python-Code-Large/train/row_98084 | 10 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98084:Assign_L6_C0", "label": "matrizA =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.05, 0, 0.66, 0.0, 496, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matrizA", "arg_names": [], "import_names": [], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98084:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98084:For_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98084:For_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98084:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Faça um programa para ler duas matrizes 4x4 e mostrar seu produto.
matrizA = [4*[0] for i in range(4)]
matrizB = [4*[0] for i in range(4)]
matrizC = [4*[0] for i in range(4)]
# Leitura das matrizes
for i in range(4):
for j in range(4):
print('matrizA[',i,'][... | ajibawa-2023/Python-Code-Large/train/row_98085 | 19 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98085:Assign_L6_C0", "label": "matrizA =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0303, 0, 0.66, 0.0, 496, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "matrizA", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98085:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98085:For_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98085:For_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98085:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
#Criação de uma matriz:
'''
identificadorMatriz = [
num_colunas*[valorNuloTipo]
for _ in range(num_linhas)
]
Onde:
* identificadorMatriz: nome da variável que guardará matriz
* num_colunas: número de colunas da matriz
* nu... | ajibawa-2023/Python-Code-Large/train/row_98086 | 9 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98086:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 16], "level": 0, "parent": null, "vector": [8, 0, 0.2432, 0.4054, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98086:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98086:For_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98086:For_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98086:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# Faça um programa para ler uma matriz n(x)m e exibi-la ao final.
num_linhas = int(input('Número de linhas da matriz: '))
num_colunas = int(input('Número de colunas da matriz: '))
matrizA = [num_colunas*[0] for i in range(num_linhas)]
# Leitura da matriz
for i in range(n... | ajibawa-2023/Python-Code-Large/train/row_98087 | 11 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98087:Assign_L6_C0", "label": "num_linhas = int()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.05, 0, 0.66, 0.0, 109, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "num_linhas", "arg_names": [], "import_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98087:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98087:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98087:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98087:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98... |
# Série de Fibonacci exibida em ordem inversa
n = int(input('Número de elementos a exibir: '))
termo = n*[0]
# Gera os termos da sequencia
if n == 1:
termo[0] = 1
elif n >= 2:
termo[0] = 1
termo[1] = 1
for i in range(2,n):
termo[i] = termo[i-1] + termo[i-2]
# Exibe os termos em orde... | ajibawa-2023/Python-Code-Large/train/row_98088 | 12 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98088:Assign_L4_C0", "label": "n = int()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1905, 0.0476, 0, 0.66, 0.0, 773, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98088:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98088:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98088:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98088:If_L11_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98088... |
# Ler 10 números e exibi-los em ordem inversa à da leitura
numero = 10*[0]
# Leitura dos 10 números
for k in range(0, 10, 1):
numero[k] = int(input())
# Exibição em ordem inversa
for i in range(9, -1, -1):
print(numero[i])
| ajibawa-2023/Python-Code-Large/train/row_98089 | 5 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98089:Assign_L4_C0", "label": "numero =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0667, 0, 0.66, 0.0, 400, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "numero", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98089:For_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98089:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98089:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98089:Expr_L12_C4"}] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''Faça um programa que leia vários números inteiros e ao final mostre a soma dos números pares
lidos. Seu programa deverá encerrar quando o usuário entrar com o número 0.'''
print ('Entre com vaŕios números inteiros para somar os pares.')
print ('Digite o número "0" para s... | ajibawa-2023/Python-Code-Large/train/row_98090 | 9 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98090:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1731, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98090:While_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98090:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98090:While_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98090:Assign_L17_C4"}] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''Faça um programa que leia os votos para 3 candidatos.
Ao final, seu programa deverá mostrar:
* o nome do candidato eleito,
* a quantidade de votos obtidos e
* o percentual de votos obtidos.
Seu programa encerrará quando o usuário entrar com o voto 0.
Os votos vão de 1 a... | ajibawa-2023/Python-Code-Large/train/row_98091 | 23 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98091:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 13], "level": 0, "parent": null, "vector": [8, 0, 0.1466, 0.1724, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98091:While_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98091:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98091:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98091:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9809... |
import turtle
turtle.shape('turtle')
for i in range(4):
turtle.forward(100)
turtle.right(90)
turtle.done()
| ajibawa-2023/Python-Code-Large/train/row_98092 | 6 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98092:Import_L1_C0", "label": "turtle import turtle", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "turtle", "arg_names": [], "import_names": ["turtle"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98092:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98092:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98092:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98092:Expr_L5_C4"}] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Exemplo de contador
contador = 0
while contador < 3:
contador += 1
| ajibawa-2023/Python-Code-Large/train/row_98093 | 2 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98093:Assign_L6_C0", "label": "contador =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.125, 0, 0.66, 0.0, 265, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "contador", "arg_names": [], "import_names": [], "rhs_call_na... | [] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Exemplo de acumulador
contador = 0
acumulador = 0
while contador < 3:
contador += 1
num = int(input())
acumulador += num
| ajibawa-2023/Python-Code-Large/train/row_98094 | 4 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98094:Assign_L6_C0", "label": "contador =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0714, 0, 0.66, 0.0, 265, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "contador", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98094:While_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98094:Assign_L11_C4"}] |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
num = 1
soma = 0
produto = 1
while num <= 10:
if num % 2 == 0:
soma += num
else:
produto *= num
num += 1
| ajibawa-2023/Python-Code-Large/train/row_98095 | 5 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98095:Assign_L4_C0", "label": "num =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0714, 0, 0.66, 0.0, 328, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98095:While_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98095:If_L9_C4"}] |
n = int(input('Quantos cadastros você deseja fazer? '))
nome = n*['']
for i in range(n):
nome[i] = input('Nome: ')
| ajibawa-2023/Python-Code-Large/train/row_98096 | 4 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98096:Assign_L1_C0", "label": "n = int()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 773, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98096:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98096:Assign_L4_C4"}] |
cont = 0
n = 1
for letra in 'abcdefghijklmnopqrstuvwxyz':
print(letra, end=' ')
cont += 1
if (cont % n) == 0:
print()
cont = 0
n += 1
| ajibawa-2023/Python-Code-Large/train/row_98097 | 7 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98097:Assign_L1_C0", "label": "cont =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 729, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cont", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98097:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98097:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98097:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98097:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98097:I... |
'''Faça um programa que leia os dados abaixo para 10 pessoas:
* nome
* altura
* idade
'''
# Iniciar os vetores
nome = 5*['']
idade = 5*[0]
altura = 5*[0.0]
# Popular os vetores
for i in range(5):
print('Entre com os dados da ', i+1, 'ª pessoa...', sep='')
nome[i] = input('Nome: ')
idade[i] = i... | ajibawa-2023/Python-Code-Large/train/row_98098 | 9 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98098:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1765, 0.2941, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98098:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98098:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98098:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98098:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
numero = 1
while numero < 17:
print(numero, end=' ')
numero += 1
| ajibawa-2023/Python-Code-Large/train/row_98099 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98099:Assign_L1_C0", "label": "numero =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 400, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "numero", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98099:While_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98099:Expr_L3_C4"}] |
# Faça um programa em Python que mostre os números
# inteiros de 1 a 20
# Faça um programa em Python que mostre os números
# inteiros de 20 a 1
# Faça um programa que mostre a tabuada de adição do
# número 3.
# Faça um programa que mostre a tabuada de adição dos
# números de 1 a 9
| ajibawa-2023/Python-Code-Large/train/row_98100 | 0 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
# O que faz este programa?
nome = input('Nome: ')
while nome != '':
print(nome)
nome = input('Nome: ') | ajibawa-2023/Python-Code-Large/train/row_98101 | 4 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98101:Assign_L4_C0", "label": "nome = input()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.125, 0, 0.66, 0.0, 525, 3, 1, 0, 0, 930, 10, 1], "semantic": {"name": "nome", "arg_names": [], "import_names": [], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98101:While_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98101:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98101:While_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98101:Assign_L8_C4"}] |
numero = int(input('Entre com um número: '))
while numero != 0:
termo = 1
while termo <= 10:
print(numero, 'x', termo, '=', numero*termo)
termo += 1
numero = int(input('Entre com um número: '))
| ajibawa-2023/Python-Code-Large/train/row_98103 | 6 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98103:Assign_L1_C0", "label": "numero = int()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 400, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "numero", "arg_names": [], "import_names": [], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98103:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98103:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98103:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98103:While_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
# Faça um programa em Python que mostre os números
# inteiros de 1 a 20
num = 1
while num <= 20:
print(num, end=' ')
num += 1 | ajibawa-2023/Python-Code-Large/train/row_98105 | 3 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98105:Assign_L4_C0", "label": "num =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.1429, 0, 0.66, 0.0, 328, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98105:While_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98105:Expr_L6_C4"}] |
# Faça um programa que mostre a tabuada de adição dos
# números de 1 a 9
termo1 = 1
while termo1 <= 10:
print('TABUADA DE ADIÇÃO DO NÚMERO', termo1)
termo2 = 1
while termo2 <= 10:
print(' ', termo1, '+', termo2, '=', termo1+termo2)
termo2 += 1
print()
termo1 += 1
#... | ajibawa-2023/Python-Code-Large/train/row_98106 | 7 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98106:Assign_L4_C0", "label": "termo1 =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.2222, 0.0556, 0, 0.66, 0.0, 966, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "termo1", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98106:While_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98106:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98106:While_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98106:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
numero = int(input('Entre com um número: '))
termo = 1
while termo <= 10:
print(numero, 'x', termo, '=', numero*termo)
termo += 1 | ajibawa-2023/Python-Code-Large/train/row_98107 | 4 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98107:Assign_L1_C0", "label": "numero = int()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 400, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "numero", "arg_names": [], "import_names": [], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98107:While_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98107:Expr_L6_C4"}] |
def soma(a: int, b: int) -> int:
return (a+b)
def principal():
x = int(input('x: '))
y = int(input('y: '))
print('A soma de', x, 'e', y, 'dá', soma(x,y))
if __name__ == '__main__':
principal()
else:
pass
| ajibawa-2023/Python-Code-Large/train/row_98108 | 8 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98108:FunctionDef_L1_C0", "label": "soma", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1071, 0.1429, 0, 0.66, 0.0, 767, 0, 2, 2, 0, 0, 0, 0], "semantic": {"name": "soma", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98108:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98108:Return_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98108:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98108:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Faça um programa que mostre a tabuada de adição do
# número 3.
termo = 1
while termo <= 10:
print('3 +', termo, '=', 3+termo)
termo += 1 | ajibawa-2023/Python-Code-Large/train/row_98110 | 3 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98110:Assign_L4_C0", "label": "termo =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.1429, 0, 0.66, 0.0, 781, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "termo", "arg_names": [], "import_names": [], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98110:While_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98110:Expr_L6_C4"}] |
# O que faz este programa?
nome = input('Nome: ')
while nome == '':
nome = input('Nome: ') | ajibawa-2023/Python-Code-Large/train/row_98111 | 3 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98111:Assign_L4_C0", "label": "nome = input()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.1429, 0, 0.66, 0.0, 525, 3, 1, 0, 0, 930, 10, 1], "semantic": {"name": "nome", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98111:While_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98111:Assign_L7_C4"}] |
altura = 1
largura = int(input('Largura: '))
while largura*altura != 0:
altura = int(input('Altura: '))
if altura != 0:
for i in range(largura):
print('+', end='')
print()
for j in range(altura-2):
print('+', end='')
for i in range(largura-2):
... | ajibawa-2023/Python-Code-Large/train/row_98112 | 17 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98112:Assign_L1_C0", "label": "altura =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "altura", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98112:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98112:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98112:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98112:If_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
cont_pares = 0
cont_impares = 0
# inicialização da variável de controle *num*
num = int(input('Entre com um número inteiro: '))
# teste de interrupção do laço: num != 0
while 0 != num:
# bloco_enquanto
# se o número é par
if (num%2) == 0:
cont_pares = cont_pares+1
# se ele não é par, é ... | ajibawa-2023/Python-Code-Large/train/row_98113 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98113:Assign_L2_C0", "label": "cont_pares =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0952, 0.0476, 0, 0.66, 0.0, 503, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "cont_pares", "arg_names": [], "import_names": [], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98113:While_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98113:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98113:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98113:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
import cPickle;
usermod = None;
gatherEdges = 1; # by default: gather on incoming edges
scatterEdges = 2; # by default: scatter on outgoing edges
def initUserModule(name):
global usermod;
usermod = __import__(name);
global gatherEdges;
if "gatherEdges" in dir(usermod):
gatherEdges = usermod.gatherEdges;
g... | ajibawa-2023/Python-Code-Large/train/row_98115 | 48 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98115:Import_L1_C0", "label": "cPickle import cPickle", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0135, 0.0135, 0, 0.66, 0.0, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98115:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98115:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98115:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98115:If_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Lar... |
class vertexDataClass:
pr = 1.0;
prDelta = 0.0;
def __init__(self, pr_new=1.0, delta_new=0.0):
self.pr = pr_new;
self.prDelta = delta_new;
class aggregatorClass:
sum = 0.0;
def __init__(self, sum_new=0.0):
self.sum = sum_new;
def merge(self, x):
self.sum += x.sum;
def parseEdge(file, line):
s = ... | ajibawa-2023/Python-Code-Large/train/row_98116 | 30 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98116:ClassDef_L1_C0", "label": "vertexDataClass", "type": "class", "loc": [1, 6], "level": 0, "parent": null, "vector": [3, 0, 0.0875, 0.15, 0, 0.66, 0.0, 760, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "vertexDataClass", "arg_names": [], "import_names": [], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98116:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98116:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98116:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98116:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
import sys
import os
import string
import subprocess
import time
"""
Usage: rpcexec -n n_to_start -f [hostsfile] [program] [options]
To start local only: rpcexec [program] [options]
"""
def escape(s):
s = string.replace(s, '"', '\\"')
s = string.replace(s, "'", "\\'")
return s
#enddef
# gui: ... | ajibawa-2023/Python-Code-Large/train/row_98119 | 130 | 229 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98119:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0087, 0.0044, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98119:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98119:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98119:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98119:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Co... |
#! python
import cxxtest.cxxtestgen
cxxtest.cxxtestgen.main()
| ajibawa-2023/Python-Code-Large/train/row_98120 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98120:Import_L3_C0", "label": "cxxtest.cxxtestgen import cxxtest.cxxtestgen", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.6, 0.2, 0, 0.66, 0.0, 686, 0, 1, 0, 0, 686, 0, 0], "semantic": {"name": "cxxtest.cxxtestgen", "arg_names": [], "... | [] |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98121 | 153 | 242 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98121:Import_L12_C0", "label": "codecs import codecs", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0041, 0, 0.66, 0.0, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98121:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98121:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98121:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98121:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98122 | 3 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98122:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.7692, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98123 | 717 | 2,189 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98123:Import_L52_C0", "label": "os import os", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0005, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98123:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98123:ImportFrom_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98123:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98123:ImportFrom_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98124 | 9 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98124:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 22], "level": 0, "parent": null, "vector": [8, 0, 0.4848, 0.3939, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#!/usr/bin/python
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
#... | ajibawa-2023/Python-Code-Large/train/row_98125 | 7 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98125:Import_L11_C0", "label": "sys import sys", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.5789, 0.0526, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98125:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98125:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98125:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98125:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98126 | 46 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98126:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1771, 0.0104, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98126:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98126:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98126:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98126:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98127 | 325 | 480 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98127:Assign_L16_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.0333, 0.0021, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98127:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98127:ImportFrom_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98127:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98127:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
#
# Execute this script to copy the cxxtest/*.py files
# and run 2to3 to convert them to Python 3.
#
import glob
import subprocess
import os
import shutil
os.chdir('cxxtest')
for file in glob.glob('*.py'):
shutil.copyfile(file, '../python3/cxxtest/'+file)
#
os.chdir('../python3/cxxtest')
#
for file in glob.glob('... | ajibawa-2023/Python-Code-Large/train/row_98128 | 10 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98128:Import_L6_C0", "label": "glob import glob", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.3158, 0.0526, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98128:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98128:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98128:For_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98128:Expr_L18_C4"}] |
#! python
import cxxtest.cxxtestgen
cxxtest.cxxtestgen.main()
| ajibawa-2023/Python-Code-Large/train/row_98129 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98129:Import_L3_C0", "label": "cxxtest.cxxtestgen import cxxtest.cxxtestgen", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.6, 0.2, 0, 0.66, 0.0, 686, 0, 1, 0, 0, 686, 0, 0], "semantic": {"name": "cxxtest.cxxtestgen", "arg_names": [], "... | [] |
"""
Script to generate the installer for cxxtest.
"""
classifiers = """\
Development Status :: 4 - Beta
Intended Audience :: End Users/Desktop
License :: OSI Approved :: LGPL License
Natural Language :: English
Operating System :: Microsoft :: Windows
Operating System :: Unix
Programming Language :: Python
Topic :: So... | ajibawa-2023/Python-Code-Large/train/row_98130 | 14 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98130:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0377, 0.0566, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98130:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98130:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98130:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98130:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_981... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98131 | 154 | 242 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98131:ImportFrom_L10_C0", "label": "from __future__ import division", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0041, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98131:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98131:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98131:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98131:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98132 | 3 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98132:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.7692, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98133 | 718 | 2,189 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98133:ImportFrom_L50_C0", "label": "from __future__ import division", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0005, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98133:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98133:ImportFrom_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98133:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98133:ImportFrom_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98134 | 9 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98134:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 22], "level": 0, "parent": null, "vector": [8, 0, 0.4848, 0.3939, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#!/usr/bin/python
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
#... | ajibawa-2023/Python-Code-Large/train/row_98135 | 7 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98135:Import_L11_C0", "label": "sys import sys", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.5789, 0.0526, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98135:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98135:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98135:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98135:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98137 | 326 | 480 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98137:ImportFrom_L12_C0", "label": "from __future__ import division", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.0021, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98137:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98137:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98137:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98137:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98138 | 154 | 242 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98138:ImportFrom_L10_C0", "label": "from __future__ import division", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0041, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98138:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98138:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98138:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98138:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98139 | 3 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98139:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.7692, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98140 | 718 | 2,189 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98140:ImportFrom_L50_C0", "label": "from __future__ import division", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0005, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98140:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98140:ImportFrom_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98140:Try_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98140:ImportFrom_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98141 | 9 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98141:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 22], "level": 0, "parent": null, "vector": [8, 0, 0.4848, 0.3939, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
#!/usr/bin/python
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
#... | ajibawa-2023/Python-Code-Large/train/row_98142 | 7 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98142:Import_L11_C0", "label": "sys import sys", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.5789, 0.0526, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98142:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98142:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98142:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98142:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v2.1
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms o... | ajibawa-2023/Python-Code-Large/train/row_98144 | 326 | 480 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98144:ImportFrom_L12_C0", "label": "from __future__ import division", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.0021, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98144:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98144:Import_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98144:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98144:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#! /usr/bin/env python
#
# The CxxTest driver script, which uses the cxxtest Python package.
#
import sys
import os
from os.path import realpath, dirname
if sys.version_info < (3,0):
sys.path.insert(0, dirname(dirname(realpath(__file__)))+os.sep+'python')
else:
sys.path.insert(0, dirname(dirname(realpath(__fil... | ajibawa-2023/Python-Code-Large/train/row_98145 | 9 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98145:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0556, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98145:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98145:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98145:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98145:Expr_L12_C4"}] |
from Carta import Carta
class Jugador(object):
"""Clase que representa a un jugador de Corazones"""
def __init__(self, id_jugador, nombre):
"""Crea el jugador desde su id y su nombre. El id es un numero en el rango 0..3"""
self.id_jugador = id_jugador
self.nombre = nombre
self.mano = []
def obtener_id_jug... | ajibawa-2023/Python-Code-Large/train/row_98146 | 53 | 100 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98146:ImportFrom_L1_C0", "label": "from Carta import Carta", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.01, 0, 0.66, 0.0, 238, 0, 1, 0, 0, 238, 0, 0], "semantic": {"name": "Carta", "arg_names": [], "import_names": ["Carta"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98146:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98146:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98146:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98146:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
class Carta(object):
"""Representa a una carta de la baraja inglesa"""
# Constantes para los palos
CORAZONES = 0
DIAMANTES = 1
PICAS = 2
TREBOLES = 3
# Diccionarios para la impresion:
NUMEROS = ["A"] + [str(n) for n in xrange(2, 11)] + ["J", "Q", "K"]
PALOS = ['corazones', 'diamantes', 'picas', 'treboles']
... | ajibawa-2023/Python-Code-Large/train/row_98147 | 21 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98147:ClassDef_L1_C0", "label": "Carta", "type": "class", "loc": [1, 32], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.9697, 0, 0.66, 0.0, 238, 0, 5, 0, 0, 186, 0, 2], "semantic": {"name": "Carta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98147:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98147:Expr_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98147:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98147:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Carta import Carta
from Mazo import Mazo
from Jugador import Jugador
class JuegoCorazones(object):
"""Clase que representa un juego de Corazones"""
def __init__(self, jugadores):
"""Crea un juego en base a 4 jugadores"""
for jugador in jugadores:
if not isinstance(jugador,Jugador):
raise TypeErro... | ajibawa-2023/Python-Code-Large/train/row_98148 | 151 | 245 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98148:ImportFrom_L1_C0", "label": "from Carta import Carta", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 0, 0.66, 0.0, 238, 0, 1, 0, 0, 238, 0, 0], "semantic": {"name": "Carta", "arg_names": [], "import_names": ["Carta"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98148:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98148:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98148:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98148:FunctionDef_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from random import shuffle
from Carta import Carta
class Mazo(object):
"""Representa a un mazo de barajas inglesas"""
def __init__(self):
"""Inicializa un mazo con sus 52 cartas"""
self.cartas = []
for numero in xrange(1, 13 + 1):
for palo in (Carta.CORAZONES, Carta.DIAMANTES, Carta.PICAS, Carta.TREBOLES):... | ajibawa-2023/Python-Code-Large/train/row_98149 | 19 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98149:ImportFrom_L1_C0", "label": "from random import shuffle", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["shu... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98149:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98149:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98149:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98149:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from Carta import Carta
class Jugador(object):
"""Clase que representa a un jugador de Corazones"""
def __init__(self, id_jugador, nombre):
"""Crea el jugador desde su id y su nombre. El id es un numero en el rango 0..3"""
self.id_jugador = id_jugador
self.nombre = nombre
self.mano = []
def obtener_id_jug... | ajibawa-2023/Python-Code-Large/train/row_98150 | 53 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98150:ImportFrom_L1_C0", "label": "from Carta import Carta", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0109, 0, 0.66, 0.0, 238, 0, 1, 0, 0, 238, 0, 0], "semantic": {"name": "Carta", "arg_names": [], "import_names": ["Carta"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98150:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98150:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98150:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98150:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
class Carta(object):
"""Representa a una carta de la baraja inglesa"""
# Constantes para los palos
CORAZONES = 0
DIAMANTES = 1
PICAS = 2
TREBOLES = 3
# Diccionarios para la impresion:
NUMEROS = ["A"] + [str(n) for n in xrange(2, 11)] + ["J", "Q", "K"]
PALOS = ['corazones', 'diamantes', 'picas', 'treboles']
... | ajibawa-2023/Python-Code-Large/train/row_98151 | 21 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98151:ClassDef_L1_C0", "label": "Carta", "type": "class", "loc": [1, 32], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.9697, 0, 0.66, 0.0, 238, 0, 5, 0, 0, 186, 0, 2], "semantic": {"name": "Carta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98151:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98151:Expr_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98151:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98151:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Carta import Carta
from Mazo import Mazo
from Jugador import Jugador
class JuegoCorazones(object):
"""Clase que representa un juego de Corazones"""
def __init__(self, jugadores):
"""Crea un juego en base a 4 jugadores"""
for jugador in jugadores:
if not isinstance(jugador,Jugador):
raise TypeErro... | ajibawa-2023/Python-Code-Large/train/row_98152 | 151 | 245 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98152:ImportFrom_L1_C0", "label": "from Carta import Carta", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 0, 0.66, 0.0, 238, 0, 1, 0, 0, 238, 0, 0], "semantic": {"name": "Carta", "arg_names": [], "import_names": ["Carta"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98152:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98152:Expr_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98152:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98152:FunctionDef_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.