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 |
|---|---|---|---|---|---|---|---|
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
from racy.renv import constants
from racy.renv.options import get_option
f... | ajibawa-2023/Python-Code-Large/train/row_80427 | 53 | 125 | 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_80427:ImportFrom_L9_C0", "label": "from racy.renv import constants", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.072, 0.008, 0, 0.66, 0.0, 73, 0, 1, 0, 0, 73, 0, 0], "semantic": {"name": "racy.renv", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80427:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80427:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80427:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80427:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import re
import os
import racy
from racy.renv import constants
from racy.renv... | ajibawa-2023/Python-Code-Large/train/row_80429 | 90 | 159 | 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_80429:Import_L9_C0", "label": "re import re", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0566, 0.0063, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80429:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80429:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80429:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80429:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
def get_tool(name):
import sys
__import__(name, globals(), locals(), [])
... | ajibawa-2023/Python-Code-Large/train/row_80430 | 4 | 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_80430:FunctionDef_L9_C0", "label": "get_tool", "type": "function", "loc": [9, 12], "level": 0, "parent": null, "vector": [2, 0, 0.8077, 0.3077, 0, 0.66, 0.0, 276, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_tool", "arg_names": ["name"], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80430:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80430:Import_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80430:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80430:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import string
from racy.rutils import is_true, uniq
class Flags(object):
"""... | ajibawa-2023/Python-Code-Large/train/row_80431 | 115 | 197 | 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_80431:Import_L9_C0", "label": "string import string", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0457, 0.0051, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80431:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80431:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80431:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80431:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
from os.path import join as opjoin
import racy
import racy.rutils as ... | ajibawa-2023/Python-Code-Large/train/row_80432 | 97 | 191 | 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_80432:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0471, 0.0052, 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_80432:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80432:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80432:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80432:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from cppunitproject import CppUnitProject
KEYWORD = CppU... | ajibawa-2023/Python-Code-Large/train/row_80433 | 23 | 54 | 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_80433:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0185, 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_80433:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80433:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80433:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80433:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from racy.rproject import ConstructibleRacyProject, LibNam... | ajibawa-2023/Python-Code-Large/train/row_80434 | 38 | 70 | 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_80434:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1286, 0.0143, 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_80434:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80434:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80434:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80434:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from dependenciesproject import DepedenciesProject
KEYWO... | ajibawa-2023/Python-Code-Large/train/row_80435 | 18 | 39 | 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_80435:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0256, 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_80435:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80435:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80435:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80435:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
from os.path import join as opjoin
import racy
from racy.renv im... | ajibawa-2023/Python-Code-Large/train/row_80436 | 84 | 179 | 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_80436:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0503, 0.0056, 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_80436:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80436:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80436:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80436:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from doxygenproject import DoxygenProject
KEYWORD = Doxy... | ajibawa-2023/Python-Code-Large/train/row_80437 | 17 | 39 | 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_80437:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0256, 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_80437:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80437:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80437:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80437:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
"""SCons.Tool.qt
Tool-specific initialization for Qt.
There normally shouldn't be any need to import th... | ajibawa-2023/Python-Code-Large/train/row_80438 | 225 | 534 | 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_80438:Expr_L8_C0", "label": "expression", "type": "expression", "loc": [8, 17], "level": 0, "parent": null, "vector": [8, 0, 0.0234, 0.0187, 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_80438:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80438:Return_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80438:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80438:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
import os
import shutil
import string
from os.path import join as opjoin
import racy
import racy.rutils as rutils
from racy.renv import constants
from racy.rproject import ConstructibleRacyProject, LibName
from racy.rutils import cached_property, memoize, run_once
from global_dico import *
from templating impo... | ajibawa-2023/Python-Code-Large/train/row_80440 | 85 | 184 | 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_80440:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0054, 0.0054, 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_80440:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80440:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80440:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80440:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import os
import shutil
import string
from os.path import join as opjoin
import racy
import racy.rutils as rutils
from racy.renv import constants
from racy.rproject import ConstructibleRacyProject, LibName
from racy.rutils import cached_property, memoize, run_once, symlink
from global_dico import *
from templa... | ajibawa-2023/Python-Code-Large/train/row_80441 | 79 | 148 | 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_80441:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0135, 0.0068, 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_80441:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80441:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80441:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80441:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Cod... |
import os
import os.path
from mako.template import Template
from mako import exceptions
from mako.exceptions import RichTraceback
import racy.rutils as rutils
from mako.lookup import TemplateLookup
def apply_template( string, dico):
temp = Template(string)
res =''
try:
res = temp.render(**dico)
... | ajibawa-2023/Python-Code-Large/train/row_80442 | 51 | 75 | 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_80442:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0133, 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_80442:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80442:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80442:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80442:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
from __future__ import print_function
import functools
import multiprocessing
import subprocess
import sys
def light_the_candle(prj, light_opts=[]):
candle_arch = {
'32':'x86',
'64':'x64',
}
candle = ['candle.exe', '-arch' , candle_arch['${ARCH}'], prj+'... | ajibawa-2023/Python-Code-Large/train/row_80443 | 33 | 54 | 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_80443:ImportFrom_L1_C0", "label": "from __future__ import print_function", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80443:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80443:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80443:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80443:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code... |
import os
import sys
import shutil
import string
from os.path import join as opjoin
import racy
import racy.rutils as rutils
from racy.renv import constants
from racy.rproject import ConstructibleRacyProject, LibName
from racy.rutils import cached_property, memoize, run_once
from templating import *
from glo... | ajibawa-2023/Python-Code-Large/train/row_80444 | 63 | 125 | 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_80444:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.008, 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_80444:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80444:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80444:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80444:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-... |
import os
import uuid
import functools
from os.path import join as opjoin
import racy
import glob
import os.path
from racy.rproject import ConstructibleRacyProject, LibName
from racy.rutils import memoize, run_once
from global_dico import *
from templating import *
class WixProjectError(racy.RacyProjectError)... | ajibawa-2023/Python-Code-Large/train/row_80445 | 105 | 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_80445:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 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_80445:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80445:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80445:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80445:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import racy
import racy.renv
import os
import os.path
from os.path import join as opjoin
# this dictionary contains all varibles for templates
dico_g = {
'RACY_INSTALL_DIR': racy.renv.dirs.install,
'RACY_SRC_DIR' : racy.renv.dirs.code,
'IDE_INSTALL_DIR' : opjoin(racy.renv.dirs.install, 'ide'),
'W... | ajibawa-2023/Python-Code-Large/train/row_80446 | 20 | 513 | 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_80446:Import_L1_C0", "label": "racy import racy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "racy", "arg_names": [], "import_names": ["racy"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80446:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80446:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80446:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80446:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from racy import renv
from generategraph import generate_... | ajibawa-2023/Python-Code-Large/train/row_80448 | 35 | 73 | 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_80448:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1233, 0.0137, 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_80448:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80448:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80448:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80448:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import racy
from collections import defaultdict
from itertools im... | ajibawa-2023/Python-Code-Large/train/row_80449 | 59 | 95 | 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_80449:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0947, 0.0105, 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_80449:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80449:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80449:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80449:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
ENABLE_COLORACY_KEYWORD = 'COLORACY'
COLORACY_PATTERN_HELP = """Defines colors an... | ajibawa-2023/Python-Code-Large/train/row_80450 | 20 | 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_80450:Assign_L9_C0", "label": "ENABLE_COLORACY_KEYWORD =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.1169, 0.013, 0, 0.66, 0.0, 495, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ENABLE_COLORACY_KEYWORD", "arg_names": [], ... | [] |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
"""
Colors text in console mode application (win32).
Uses ctypes and Win32 methods... | ajibawa-2023/Python-Code-Large/train/row_80451 | 73 | 136 | 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_80451:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0919, 0.0588, 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_80451:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80451:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80451:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80451:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
__all__ = ["BaseColorText"]
import sys
class BaseColorText(object):
cons = ... | ajibawa-2023/Python-Code-Large/train/row_80452 | 12 | 27 | 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_80452:Assign_L9_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.037, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80452:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80452:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80452:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80452:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
from base import BaseColorText
__all__ = ["Console", "ColorText"]
class Console(... | ajibawa-2023/Python-Code-Large/train/row_80453 | 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_80453:ImportFrom_L9_C0", "label": "from base import BaseColorText", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1216, 0.0135, 0, 0.66, 0.0, 47, 0, 1, 0, 0, 47, 0, 0], "semantic": {"name": "base", "arg_names": [], "import_names": ["Bas... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80453:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80453:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80453:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80453:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
__all__ = ["ColorText"]
import platform
import os
is_win = platform.system() =... | ajibawa-2023/Python-Code-Large/train/row_80454 | 22 | 39 | 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_80454:Assign_L10_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2564, 0.0256, 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_80454:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80454:ImportFrom_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80454:If_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80454:ImportFrom_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import re
from colorconsole import ColorText
from colorizer import Colorizer
clas... | ajibawa-2023/Python-Code-Large/train/row_80455 | 15 | 31 | 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_80455:Import_L8_C0", "label": "re import re", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2581, 0.0323, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80455:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80455:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80455:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80455:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import platform
import sys
import racy
from racy.renv.options import ge... | ajibawa-2023/Python-Code-Large/train/row_80456 | 28 | 70 | 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_80456:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1286, 0.0143, 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_80456:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80456:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80456:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80456:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
__all__ = ['Colorizer']
import re
from sys import stdout
from os import linesep
f... | ajibawa-2023/Python-Code-Large/train/row_80457 | 44 | 70 | 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_80457:Assign_L8_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1143, 0.0143, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80457:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80457:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80457:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80457:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import time
import SCons.Defaults
import SCons.Node
from os.path impor... | ajibawa-2023/Python-Code-Large/train/row_80458 | 346 | 581 | 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_80458:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0155, 0.0017, 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_80458:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80458:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80458:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80458:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: UTF8 -*-
import os
import subprocess
import SCons
from racy.rutils import is_iterable, put_file_content
###############################################################################
class CommandNotFound(SCons.Warnings.Warning):
pass
#############################################################... | ajibawa-2023/Python-Code-Large/train/row_80460 | 23 | 60 | 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_80460:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0167, 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_80460:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80460:If_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80460:If_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80460:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
# -*- coding: UTF8 -*-
import os
import SCons.Node
from racy.rutils import is_iterable
def UnZipEmitter(target, source, env):
assert len(target) <= 1 # Until multiple target is managed
for node in target:
env.Clean(node, node)
return target, source
def UnZip(target, source, env):
import z... | ajibawa-2023/Python-Code-Large/train/row_80461 | 22 | 41 | 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_80461:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0732, 0.0244, 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_80461:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80461:For_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80461:For_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80461:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
# -*- coding: UTF8 -*-
import os
import SCons.Node
import shutil
import utils
def DeleteArgs(target, source, env):
args = []
args.extend(env.get('ARGS',[]))
return env.subst(args)
@utils.marker_decorator
def Delete(target, source, env):
files = DeleteArgs(target, source, env)
not_found = [ f f... | ajibawa-2023/Python-Code-Large/train/row_80462 | 24 | 44 | 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_80462:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0682, 0.0227, 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_80462:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80462:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80462:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80462:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# -*- coding: UTF8 -*-
import os
import SCons
import command
class ConfigureNotFound(SCons.Warnings.Warning):
pass
def find_configure_path(_dir):
path = None
for root, dirs, files in os.walk(_dir):
if "configure" in files:
path = root
break
return path
def Configure... | ajibawa-2023/Python-Code-Large/train/row_80464 | 21 | 50 | 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_80464:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.02, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80464:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80464:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80464:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80464:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# -*- coding: UTF8 -*-
import os
import SCons
import command
def Patch(target, source, env):
assert len(source) == 1
patch_pwd = os.path.abspath(source[0].get_abspath())
return command.Command( target, source, env,
pwd = patch_pwd,
command = env[... | ajibawa-2023/Python-Code-Large/train/row_80466 | 13 | 36 | 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_80466:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0278, 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_80466:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80466:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80466:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80466:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: UTF8 -*-
import os
import SCons.Node
def UnTarEmitter(target, source, env):
assert len(target) <= 1 # Until multiple target is managed
for node in target:
env.Clean(node, node)
return target, source
def UnTar(target, source, env):
import tarfile
for s in source:
s... | ajibawa-2023/Python-Code-Large/train/row_80467 | 21 | 39 | 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_80467:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0256, 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_80467:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80467:For_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80467:For_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80467:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
# -*- coding: UTF8 -*-
import os
import SCons
import command
def find_make_path(env, _dir):
path = None
makefile = env['MAKEFILE']
for root, dirs, files in os.walk(_dir):
if makefile in files:
path = root
break
return path
def guess_make_cmd():
import racy.renv a... | ajibawa-2023/Python-Code-Large/train/row_80468 | 27 | 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_80468:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0164, 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_80468:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80468:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80468:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80468:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: UTF8 -*-
import os
import SCons.Node
import utils
def WriteArgs(target, source, env):
files = []
files.extend(env.get('FILES',[]))
files = map(env.subst, files)
contents = []
contents.extend(env.get('CONTENTS',[]))
contents = map(env.subst, contents)
return files, contents
... | ajibawa-2023/Python-Code-Large/train/row_80469 | 26 | 44 | 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_80469:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0682, 0.0227, 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_80469:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80469:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80469:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80469:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# -*- coding: UTF8 -*-
import os
import SCons.Node
import shutil
import utils
def CopyArgs(target, source, env):
args = []
args.extend(env.get('ARGS',[]))
args = map(env.subst, args)
return args[:-1], args[-1]
@utils.marker_decorator
def Copy(target, source, env):
src, dst = CopyArgs(target, s... | ajibawa-2023/Python-Code-Large/train/row_80470 | 25 | 45 | 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_80470:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0222, 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_80470:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80470:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80470:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80470:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# -*- coding: UTF8 -*-
| ajibawa-2023/Python-Code-Large/train/row_80471 | 0 | 2 | 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"] | [] | [] |
# -*- coding: UTF8 -*-
import os
import SCons.Node
import utils
def MkdirArgs(target, source, env):
args = []
args.extend(env.get('ARGS',[]))
args = map(env.subst, args)
return args
@utils.marker_decorator
def Mkdir(target, source, env):
for d in MkdirArgs(target, source, env):
env.Exe... | ajibawa-2023/Python-Code-Large/train/row_80472 | 20 | 36 | 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_80472:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0278, 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_80472:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80472:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80472:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80472:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
import SCons
import pprint
import os
from hashlib import md5
def write(content, filename):
with open(filename, 'w') as f:
f.write(content)
###############################################################################
markers = {}
def marker(command, prj, options):
res = '{dir}/{file}'
... | ajibawa-2023/Python-Code-Large/train/row_80473 | 47 | 89 | 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_80473:Import_L2_C0", "label": "SCons import SCons", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0112, 0, 0.66, 0.0, 188, 0, 1, 0, 0, 188, 0, 0], "semantic": {"name": "SCons", "arg_names": [], "import_names": ["SCons"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80473:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80473:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80473:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80473:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: UTF8 -*-
import os
import SCons
import utils
from subprocessbuilder import SubProcessBuilder, SubProcessString
def CommandArgs(target, source, env, command=None):
args = []
command = env.get('COMMAND', command)
if command:
args.append(command)
args.extend(env.get('ARGS',[]))
... | ajibawa-2023/Python-Code-Large/train/row_80474 | 38 | 75 | 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_80474:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0133, 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_80474:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80474:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80474:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80474:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: UTF8 -*-
# imported for disponibility in builder's expressions
import re
import os
import SCons.Node
import StringIO
import functools
import textwrap
import difflib
import utils
def apply_expression(expr, source, target, mode='eval'):
# inspired from http://code.activestate.com/recipes/437932/
... | ajibawa-2023/Python-Code-Large/train/row_80475 | 68 | 110 | 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_80475:Import_L4_C0", "label": "re import re", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0364, 0.0091, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80475:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80475:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80475:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80475:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import racy
class LibextError(racy.RacyProjectError):
"Linext exception class"... | ajibawa-2023/Python-Code-Large/train/row_80476 | 3 | 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_80476:Import_L8_C0", "label": "racy import racy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.7273, 0.0909, 0, 0.66, 0.0, 171, 0, 1, 0, 0, 171, 0, 0], "semantic": {"name": "racy", "arg_names": [], "import_names": ["racy"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80476:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80476:Expr_L11_C4"}] |
import os
import os.path
import sys
def main():
# racy tricks
racy_bin = sys.argv[0]
racy_bin_dir = os.path.split(racy_bin)[0]
racy_root_dir = os.path.split(racy_bin_dir)[0]
racy_config_dir = os.path.join(racy_root_dir,'Config')
racy_python_dir = os.path.join(racy_root_dir,'Python')
#r... | ajibawa-2023/Python-Code-Large/train/row_80479 | 27 | 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_80479:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0179, 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_80479:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80479:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80479:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80479:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import subprocess
def symlink(src, dest):
try:
from win32file import C... | ajibawa-2023/Python-Code-Large/train/row_80485 | 11 | 25 | 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_80485:Import_L8_C0", "label": "subprocess import subprocess", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.32, 0.04, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subpr... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80485:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80485:Try_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80485:Try_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80485:ImportFrom_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
from __future__ import print_function
import os
#-------------------------------... | ajibawa-2023/Python-Code-Large/train/row_80486 | 137 | 237 | 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_80486:ImportFrom_L1_C0", "label": "from __future__ import print_function", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0042, 0.0042, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80486:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80486:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80486:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80486:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
class InfoLogger(object):
def __init__(self):
self.info = {}
... | ajibawa-2023/Python-Code-Large/train/row_80487 | 27 | 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_80487:ClassDef_L10_C0", "label": "InfoLogger", "type": "class", "loc": [10, 41], "level": 0, "parent": null, "vector": [3, 0, 0.593, 0.7442, 0, 0.66, 0.0, 726, 0, 5, 0, 0, 186, 0, 17], "semantic": {"name": "InfoLogger", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80487:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80487:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80487:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80487:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-... |
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
#!/usr/bin/env python
# -*- coding: UTF8 -*-
import pstats
import sys
p = pstats.Stats(sys.argv[1])
#p.... | ajibawa-2023/Python-Code-Large/train/row_80489 | 5 | 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_80489:Import_L11_C0", "label": "pstats import pstats", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.6111, 0.0556, 0, 0.66, 0.0, 936, 0, 1, 0, 0, 936, 0, 0], "semantic": {"name": "pstats", "arg_names": [], "import_names": ["pstats"], ... | [] |
# -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.
# ****** END LICENSE BLOCK ******
import os
import textwrap
licence = {}
comments = {}
comments['.cpp'] = {
... | ajibawa-2023/Python-Code-Large/train/row_80490 | 78 | 138 | 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_80490:Import_L7_C0", "label": "os import os", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0507, 0.0072, 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_80490:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80490:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80490:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80490:Expr_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/env python
import urllib2
import shutil
import os
from os.path import join, exists, dirname, abspath
from glob import glob
from subprocess import call
from zipfile import ZipFile
JASMINE_REPORTER_URL='https://github.com/larrymyers/jasmine-reporters/zipball/0.2.1'
BASE = abspath(dirname(__file__))
REPORT_DI... | ajibawa-2023/Python-Code-Large/train/row_80493 | 39 | 52 | 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_80493:Import_L2_C0", "label": "urllib2 import urllib2", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0192, 0, 0.66, 0.0, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "urllib2", "arg_names": [], "import_names": ["urllib2"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80493:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80493:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80493:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80493:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code... |
import os
THIS_PATH = os.path.dirname(__file__)
GOLDEN_OUTPUT = os.path.join(THIS_PATH, 'golden_suite', 'output.xml')
GOLDEN_OUTPUT2 = os.path.join(THIS_PATH, 'golden_suite', 'output2.xml')
GOLDEN_JS = os.path.join(THIS_PATH, 'golden_suite', 'expected.js')
| ajibawa-2023/Python-Code-Large/train/row_80494 | 5 | 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_80494:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [] |
__author__ = 'janne'
| ajibawa-2023/Python-Code-Large/train/row_80495 | 1 | 1 | 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_80495:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_n... | [] |
#!/usr/bin/env python
import fileinput
from os.path import join, dirname, abspath
import sys
import os
BASEDIR = dirname(abspath(__file__))
OUTPUT = join(BASEDIR, 'output.xml')
sys.path.insert(0, join(BASEDIR, '..', '..', '..', '..', 'src'))
import robot
from robot.conf.settings import RebotSettings
from robot.repo... | ajibawa-2023/Python-Code-Large/train/row_80496 | 41 | 57 | 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_80496:Import_L3_C0", "label": "fileinput import fileinput", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0175, 0, 0.66, 0.0, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["file... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80496:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80496:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80496:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80496:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
import sys
import os
from os.path import join, dirname
from distutils.core import setup
execfile(join(dirname(__file__), 'src', 'robot', 'version.py'))
# Maximum width in Windows installer seems to be 70 characters -------|
DESCRIPTION = """
Robot Framework is a generic test automation framewor... | ajibawa-2023/Python-Code-Large/train/row_80498 | 4 | 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_80498:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", ... | [] |
#!/usr/bin/env python
"""A script for running Robot Framework's acceptance tests.
Usage: run_atests.py interpreter [options] datasource(s)
Data sources are paths to directories or files under `robot` folder.
Available options are the same that can be used with Robot Framework.
See its help (e.g. `pybot --help`) fo... | ajibawa-2023/Python-Code-Large/train/row_80499 | 44 | 111 | 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_80499:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1081, 0.1712, 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_80499:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80499:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80499:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80499:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import subprocess
import os
import signal
import ctypes
import time
class ProcessManager(object):
def __init__(self):
self._process = None
self._stdout = ''
self._stderr = ''
def start_process(self, *args):
args = args[0].split() + list(args[1:])
self._process = subpr... | ajibawa-2023/Python-Code-Large/train/row_80500 | 52 | 73 | 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_80500:Import_L1_C0", "label": "subprocess import subprocess", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0137, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["s... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80500:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80500:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80500:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80500:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
from __future__ import with_statement
import os
from os.path import abspath, dirname, join
from subprocess import call, STDOUT
import tempfile
from robot.utils.asserts import assert_equals
ROBOT_SRC = join(dirname(abspath(__file__)), '..', '..', '..', 'src')
class TidyLib(object):
def __init__(self, interpret... | ajibawa-2023/Python-Code-Large/train/row_80501 | 43 | 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_80501:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80501:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80501:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80501:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80501:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-... |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | ajibawa-2023/Python-Code-Large/train/row_80502 | 28 | 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_80502:ImportFrom_L15_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2542, 0.0169, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80502:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80502:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80502:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80502:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import tempfile
from os.path import join, dirname, abspath
from subprocess import call, STDOUT
from robot.api import logger
from robot.utils import decode_output
ROBOT_SRC = join(dirname(abspath(__file__)), '..', '..', '..', 'src')
class LibDocLib(object):
def __init__(self, interpreter):
self... | ajibawa-2023/Python-Code-Large/train/row_80503 | 21 | 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_80503:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 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_80503:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80503:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80503:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80503:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
from __future__ import with_statement
import os
from robot.utils import utf8open
def output_should_have_correct_line_separators(path):
with utf8open(path) as infile:
content = infile.read()
content = content.replace(os.linesep, '')
incorrect = content.count('\n')
if incorrect:
err = A... | ajibawa-2023/Python-Code-Large/train/row_80504 | 10 | 16 | 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_80504:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80504:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80504:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80504:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80504:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from __future__ import with_statement
from robot.api import logger
class WrongStat(AssertionError):
ROBOT_CONTINUE_ON_FAILURE = True
def get_total_stats(path):
return get_all_stats(path)[0]
def get_tag_stats(path):
return get_all_stats(path)[1]
def get_suite_stats(path):
return get_all_stats(path)... | ajibawa-2023/Python-Code-Large/train/row_80505 | 28 | 41 | 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_80505:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80505:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80505:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80505:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80505:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from robot.libraries.BuiltIn import BuiltIn
BIN = BuiltIn()
def start_keyword(*args):
if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':
BIN.set_test_variable('${SET BY LISTENER}', 'quux')
| ajibawa-2023/Python-Code-Large/train/row_80506 | 5 | 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_80506:ImportFrom_L1_C0", "label": "from robot.libraries.BuiltIn import BuiltIn", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "robot.libraries.BuiltIn", "arg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80506:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80506:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80506:If_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80506:Expr_L8_C8"}] |
from __future__ import with_statement
from os.path import abspath, dirname, join
from fnmatch import fnmatchcase
from operator import eq
from robot.api import logger
CURDIR = dirname(abspath(__file__))
def verify_output(actual, expected):
actual = _read_file(actual, 'Actual')
expected = _read_file(join(CURD... | ajibawa-2023/Python-Code-Large/train/row_80507 | 17 | 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_80507:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80507:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80507:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80507:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80507:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Co... |
import os
import tempfile
import time
class ListenAll:
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self, *path):
if not path:
path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def sta... | ajibawa-2023/Python-Code-Large/train/row_80508 | 54 | 82 | 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_80508:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0122, 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_80508:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80508:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80508:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80508:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import tempfile
class OldListenAll:
def __init__(self, *path):
if not path:
path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def start_suite(self, name, doc):
self.outfile... | ajibawa-2023/Python-Code-Large/train/row_80509 | 37 | 55 | 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_80509:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0182, 0.0182, 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_80509:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80509:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80509:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80509:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import os
import tempfile
outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')
OUTFILE = open(outpath, 'w')
ROBOT_LISTENER_API_VERSION = 2
def start_suite(name, attrs):
metastr = ' '.join('%s: %s' % (k, v) for k, v in attrs['metadata'].items())
OUTFILE.write("SUITE START: %s '%s' [%s]\n"
... | ajibawa-2023/Python-Code-Large/train/row_80510 | 43 | 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_80510:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0156, 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_80510:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80510:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80510:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80510:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import tempfile
class ListenSome:
def __init__(self):
outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')
self.outfile = open(outpath, 'w')
def startTest(self, name, doc, tags):
self.outfile.write(name + '\n')
def endSuite(self, stat, msg):
... | ajibawa-2023/Python-Code-Large/train/row_80511 | 21 | 36 | 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_80511:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0278, 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_80511:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80511:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80511:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80511:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
import os
import tempfile
import logging
from robot.libraries.BuiltIn import BuiltIn
from robot.api import logger
class ListenSome:
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self):
outpath = os.path.join(tempfile.gettempdir(), 'listen_some.txt')
self.outfile = open(outpath, 'w')
def... | ajibawa-2023/Python-Code-Large/train/row_80512 | 66 | 118 | 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_80512:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0085, 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_80512:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80512:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80512:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80512:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-... |
import os
import tempfile
outpath = os.path.join(tempfile.gettempdir(), 'listen_by_module.txt')
OUTFILE = open(outpath, 'w')
def start_suite(name, doc):
OUTFILE.write("SUITE START: %s '%s'\n" % (name, doc))
def start_test(name, doc, tags):
tags = [ str(tag) for tag in tags ]
OUTFILE.write("TEST START: %... | ajibawa-2023/Python-Code-Large/train/row_80513 | 33 | 49 | 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_80513:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0204, 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_80513:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80513:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80513:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80513:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import tempfile
ROBOT_LISTENER_API_VERSION = '2'
OUTFILE = open(os.path.join(tempfile.gettempdir(), 'listener_attrs.txt'), 'w')
START_ATTRS = 'doc starttime '
END_ATTRS = START_ATTRS + 'endtime elapsedtime status '
EXPECTED_TYPES = {'elapsedtime': (int, long), 'tags': list, 'args': list,
'... | ajibawa-2023/Python-Code-Large/train/row_80514 | 34 | 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_80514:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 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_80514:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80514:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80514:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80514:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
def get_variables(*args):
return { 'PPATH_VARFILE_2' : ' '.join(args),
'LIST__PPATH_VARFILE_2' : args }
| ajibawa-2023/Python-Code-Large/train/row_80515 | 2 | 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_80515:FunctionDef_L1_C0", "label": "get_variables", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 461, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_variables", "arg_names": ["args"], "import_names": [], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80515:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80515:Return_L2_C4"}] |
PPATH_VARFILE = "Variable from variable file in PYTHONPATH" | ajibawa-2023/Python-Code-Large/train/row_80516 | 1 | 1 | 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_80516:Assign_L1_C0", "label": "PPATH_VARFILE =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 799, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PPATH_VARFILE", "arg_names": [], "import_names": [], "rhs_... | [] |
list1 = [1, 2, 3, 4, 'foo', 'bar']
dictionary1 = {'a': 1}
dictionary2 = {'a': 1, 'b': 2}
| ajibawa-2023/Python-Code-Large/train/row_80517 | 3 | 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_80517:Assign_L1_C0", "label": "list1 =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 150, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "list1", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
class TraceLogArgsLibrary(object):
def only_mandatory(self, mand1, mand2):
pass
def mandatory_and_default(self, mand, default="default value"):
pass
def multiple_default_values(self, a=1, a2=2, a3=3, a4=4):
pass
def mandatory_and_varargs(self, mand, *varargs):
pass
... | ajibawa-2023/Python-Code-Large/train/row_80518 | 15 | 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_80518:ClassDef_L1_C0", "label": "TraceLogArgsLibrary", "type": "class", "loc": [1, 19], "level": 0, "parent": null, "vector": [3, 0, 0.3333, 0.6333, 0, 0.66, 0.0, 552, 0, 6, 0, 0, 186, 0, 2], "semantic": {"name": "TraceLogArgsLibrary", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80518:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80518:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80518:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80518:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Co... |
class FailUntilSucceeds:
ROBOT_LIBRARY_SCOPE = 'TESTCASE'
def __init__(self, times_to_fail=0):
self.times_to_fail = int(times_to_fail)
def fail_until_retried_often_enough(self, message="Hello"):
self.times_to_fail -= 1
if self.times_to_fail >= 0:
raise Exce... | ajibawa-2023/Python-Code-Large/train/row_80519 | 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_80519:ClassDef_L1_C0", "label": "FailUntilSucceeds", "type": "class", "loc": [1, 12], "level": 0, "parent": null, "vector": [3, 0, 0.5417, 1.0, 0, 0.66, 0.0, 243, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "FailUntilSucceeds", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80519:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80519:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80519:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80519:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
import exceptions
class ObjectToReturn:
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
def exception(self, name, msg=""):
exception = getattr(exceptions, name)
raise exception, msg
| ajibawa-2023/Python-Code-Large/train/row_80520 | 8 | 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_80520:Import_L1_C0", "label": "exceptions import exceptions", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 63, 0, 1, 0, 0, 63, 0, 0], "semantic": {"name": "exceptions", "arg_names": [], "import_names": ["exc... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80520:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80520:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80520:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80520:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
class SameNamesAsInBuiltIn:
def noop(self):
"""Using this keyword without libname causes an error""" | ajibawa-2023/Python-Code-Large/train/row_80521 | 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_80521:ClassDef_L1_C0", "label": "SameNamesAsInBuiltIn", "type": "class", "loc": [1, 4], "level": 0, "parent": null, "vector": [3, 0, 0.625, 1.0, 0, 0.66, 0.0, 82, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "SameNamesAsInBuiltIn", "arg_names": [], "import_names": [], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80521:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80521:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80521:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80521:Expr_L4_C8"}] |
from robot.libraries.BuiltIn import BuiltIn
class NamespaceUsingLibrary(object):
def __init__(self):
self._importing_suite = BuiltIn().get_variable_value('${SUITE NAME}')
self._easter = BuiltIn().get_library_instance('Easter')
def get_importing_suite(self):
return self._importing_suit... | ajibawa-2023/Python-Code-Large/train/row_80522 | 9 | 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_80522:ImportFrom_L1_C0", "label": "from robot.libraries.BuiltIn import BuiltIn", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "robot.libraries.BuiltIn", "arg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80522:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80522:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80522:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80522:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
class ZipLib:
def kw_from_zip(self, arg):
print '*INFO*', arg
return arg * 2
| ajibawa-2023/Python-Code-Large/train/row_80523 | 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_80523:ClassDef_L1_C0", "label": "ZipLib", "type": "class", "loc": [1, 5], "level": 0, "parent": null, "vector": [3, 0, 0.4286, 0.7143, 0, 0.66, 0.0, 240, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ZipLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80523:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80523:FunctionDef_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80523:FunctionDef_L3_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_80523:Expr_L4_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
class PythonVarArgsConstructor:
def __init__(self, mandatory, *varargs):
self.mandatory = mandatory
self.varargs = varargs
def get_args(self):
return self.mandatory, ' '.join(self.varargs)
| ajibawa-2023/Python-Code-Large/train/row_80524 | 6 | 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_80524:ClassDef_L1_C0", "label": "PythonVarArgsConstructor", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.8889, 0, 0.66, 0.0, 282, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "PythonVarArgsConstructor", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80524:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80524:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80524:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80524:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
import ExampleJavaLibrary
import DefaultArgs
class ExtendJavaLib(ExampleJavaLibrary):
def kw_in_java_extender(self, arg):
return arg*2
def javaSleep(self, secs):
raise Exception('Overridden kw executed!')
def using_method_from_java_parent(self):
self.divByZero()
class ExtendJa... | ajibawa-2023/Python-Code-Large/train/row_80526 | 21 | 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_80526:Import_L1_C0", "label": "ExampleJavaLibrary import ExampleJavaLibrary", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "ExampleJavaLibrary", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80526:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80526:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80526:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80526:Return_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
class ArgumentsPython:
# method docs are used in unit tests as expected min and max args
def a_0(self):
"""(0,0)"""
return 'a_0'
def a_1(self, arg):
"""(1,1)"""
return 'a_1: ' + arg
def a_3(self, arg1, arg2, arg3):
"""(3,3)"""
return ' ... | ajibawa-2023/Python-Code-Large/train/row_80528 | 25 | 36 | 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_80528:ClassDef_L1_C0", "label": "ArgumentsPython", "type": "class", "loc": [1, 35], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.9722, 0, 0.66, 0.0, 360, 0, 8, 0, 0, 0, 0, 8], "semantic": {"name": "ArgumentsPython", "arg_names": [], "import_names": [], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80528:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80528:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80528:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80528:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from robot import utils
class RunKeywordLibrary:
ROBOT_LIBRARY_SCOPE = 'TESTCASE'
def __init__(self):
self.kw_names = ['Run Keyword That Passes', 'Run Keyword That Fails']
def get_keyword_names(self):
return self.kw_names
def run_keyword(self, name, args):
try:
m... | ajibawa-2023/Python-Code-Large/train/row_80529 | 24 | 41 | 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_80529:ImportFrom_L1_C0", "label": "from robot import utils", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80529:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80529:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80529:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80529:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
def keyword_from_deeper_submodule():
return 'hi again'
class Sub:
def keyword_from_class_in_deeper_submodule(self):
return 'bye'
| ajibawa-2023/Python-Code-Large/train/row_80530 | 5 | 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_80530:FunctionDef_L1_C0", "label": "keyword_from_deeper_submodule", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.2222, 0, 0.66, 0.0, 11, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "keyword_from_deeper_submodule", "arg_names":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80530:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80530:Return_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80530:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80530:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code... |
attribute = 42
| ajibawa-2023/Python-Code-Large/train/row_80531 | 1 | 1 | 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_80531:Assign_L1_C0", "label": "attribute =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 355, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "attribute", "arg_names": [], "import_names": [], "rhs_call_nam... | [] |
library = "It should be OK to have an attribute with same name as the module"
def keyword_from_submodule(arg='World'):
return "Hello, %s!" % arg
| ajibawa-2023/Python-Code-Large/train/row_80532 | 3 | 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_80532:Assign_L1_C0", "label": "library =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.2, 0, 0.66, 0.0, 860, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "library", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80532:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80532:Return_L5_C4"}] |
some_string = 'Hello, World!'
class _SomeObject:
pass
some_object = _SomeObject() | ajibawa-2023/Python-Code-Large/train/row_80533 | 3 | 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_80533:Assign_L1_C0", "label": "some_string =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 913, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "some_string", "arg_names": [], "import_names": [], "rh... | [] |
class KwargsLibrary(object):
def __init__(self, arg1=None, arg2=None):
self.arg1 = arg1
self.arg2 = arg2
def check_init_arguments(self, exp_arg1, exp_arg2):
if self.arg1 != exp_arg1 or self.arg2 != exp_arg2:
raise AssertionError('Wrong initialization values. Got (%s, %s), e... | ajibawa-2023/Python-Code-Large/train/row_80534 | 16 | 25 | 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_80534:ClassDef_L1_C0", "label": "KwargsLibrary", "type": "class", "loc": [1, 25], "level": 0, "parent": null, "vector": [3, 0, 0.52, 1.0, 0, 0.66, 0.0, 328, 0, 7, 0, 0, 186, 0, 2], "semantic": {"name": "KwargsLibrary", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80534:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80534:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80534:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80534:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
class ParameterLibrary:
def __init__(self, host='localhost', port='8080'):
self.host = host
self.port = port
def parameters(self):
return self.host, self.port | ajibawa-2023/Python-Code-Large/train/row_80535 | 6 | 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_80535:ClassDef_L1_C0", "label": "ParameterLibrary", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.5625, 1.0, 0, 0.66, 0.0, 341, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ParameterLibrary", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80535:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80535:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80535:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80535:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
from robot import utils
def passing_handler(*args):
for arg in args:
print arg,
return ', '.join(args)
def failing_handler(*args):
if len(args) == 0:
msg = 'Failure'
else:
msg = 'Failure: %s' % ' '.join(args)
raise AssertionError(msg)
class GetKeywordNamesLibrary:
... | ajibawa-2023/Python-Code-Large/train/row_80536 | 23 | 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_80536:ImportFrom_L1_C0", "label": "from robot import utils", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80536:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80536:For_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80536:For_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80536:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
class Mandatory:
def __init__(self, mandatory1, mandatory2):
self.mandatory1 = mandatory1
self.mandatory2 = mandatory2
def get_args(self):
return self.mandatory1, self.mandatory2
class Defaults(object):
def __init__(self, mandatory, default1='value', default2=None):
self... | ajibawa-2023/Python-Code-Large/train/row_80538 | 19 | 32 | 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_80538:ClassDef_L1_C0", "label": "Mandatory", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.1406, 0.25, 0, 0.66, 0.0, 745, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "Mandatory", "arg_names": [], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80538:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80538:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80538:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80538:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
from ExampleLibrary import ExampleLibrary
class ExtendPythonLib(ExampleLibrary):
def kw_in_python_extender(self, arg):
return arg/2
def print_many(self, *msgs):
raise Exception('Overridden kw executed!')
def using_method_from_python_parent(self):
self.exception('Asser... | ajibawa-2023/Python-Code-Large/train/row_80540 | 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_80540:ImportFrom_L1_C0", "label": "from ExampleLibrary import ExampleLibrary", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 472, 0, 1, 0, 0, 472, 0, 0], "semantic": {"name": "ExampleLibrary", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80540:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80540:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80540:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80540:Return_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
__version__ = 'N/A' # This should be ignored when version is parsed
class NameLibrary:
handler_count = 10
def simple1(self):
"""Simple 1"""
def simple2___(self):
"""Simple 2"""
def underscore_name(self):
"""Underscore Name"""
def underscore_name2_(self):
"""Undersc... | ajibawa-2023/Python-Code-Large/train/row_80541 | 123 | 164 | 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_80541:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80541:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80541:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80541:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80541:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
class NewStyleClassLibrary(object):
def mirror(self, arg):
arg = list(arg)
arg.reverse()
return ''.join(arg)
def _property_getter(self):
raise SystemExit('This should not be called, ever!!!')
prop = property(_property_getter)
class NewStyleClassArgsLibrar... | ajibawa-2023/Python-Code-Large/train/row_80542 | 19 | 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_80542:ClassDef_L1_C0", "label": "NewStyleClassLibrary", "type": "class", "loc": [1, 11], "level": 0, "parent": null, "vector": [3, 0, 0.1765, 0.3235, 0, 0.66, 0.0, 12, 0, 2, 0, 0, 186, 0, 5], "semantic": {"name": "NewStyleClassLibrary", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80542:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80542:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80542:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80542:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
class LibClass1:
def verify_libclass1(self):
return 'LibClass 1 works'
class LibClass2:
def verify_libclass2(self):
return 'LibClass 2 works also'
| ajibawa-2023/Python-Code-Large/train/row_80543 | 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_80543:ClassDef_L1_C0", "label": "LibClass1", "type": "class", "loc": [1, 4], "level": 0, "parent": null, "vector": [3, 0, 0.2273, 0.3636, 0, 0.66, 0.0, 529, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "LibClass1", "arg_names": [], "import_names": [], "rhs_call_name": "",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80543:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80543:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80543:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80543:Return_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
class FatalCatastrophyException(RuntimeError):
ROBOT_EXIT_ON_FAILURE = True
class ContinuableApocalypseException(RuntimeError):
ROBOT_CONTINUE_ON_FAILURE = True
def exit_on_failure():
raise FatalCatastrophyException()
def raise_continuable_failure(msg='Can be continued'):
raise ContinuableApocalypseE... | ajibawa-2023/Python-Code-Large/train/row_80544 | 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_80544:ClassDef_L1_C0", "label": "FatalCatastrophyException", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.1364, 0.1818, 0, 0.66, 0.0, 572, 0, 0, 0, 0, 178, 0, 0], "semantic": {"name": "FatalCatastrophyException", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80544:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80544:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80544:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80544:Assign_L5_C4"}] |
class _BaseDynamicLibrary(object):
def get_keyword_names(self):
return []
def run_keyword(self, name, *args):
return None
class StaticDocsLib(_BaseDynamicLibrary):
"""This is lib intro."""
def __init__(self, some=None, args=[]):
"""Init doc."""
class DynamicDocsLib(_BaseDynam... | ajibawa-2023/Python-Code-Large/train/row_80545 | 32 | 41 | 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_80545:ClassDef_L1_C0", "label": "_BaseDynamicLibrary", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.0976, 0.1707, 0, 0.66, 0.0, 914, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "_BaseDynamicLibrary", "arg_names": [], "import_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80545:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80545:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80545:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_80545:Return_L4_C8"}, {"f": "ajibawa-2023/Python-Code... |
ROBOT_LIBRARY_SCOPE = 'Test Suite' # this should be ignored
__version__ = 'test' # this should be used as version of this library
def passing():
pass
def failing():
raise AssertionError('This is a failing keyword from module library')
def logging():
print 'Hello from module library'
print '*WARN* ... | ajibawa-2023/Python-Code-Large/train/row_80546 | 27 | 54 | 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_80546:Assign_L1_C0", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80546:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80546:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80546:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80546:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import re
from robot import utils
from robot.result.resultbuilder import ExecutionResultBuilder
from robot.result.executionresult import Result
from robot.result.testsuite import TestSuite
from robot.result.testcase import TestCase
from robot.result.keyword import Keyword
from robot.libraries.BuiltIn import ... | ajibawa-2023/Python-Code-Large/train/row_80548 | 144 | 211 | 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_80548:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0047, 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_80548:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80548:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80548:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80548:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.