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: utf-8 -*-
#
# Copyright © 2011 Santiago Jaramillo
# based on pylintgui.py by Pierre Raybaut
#
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Profiler widget
See the official documentation on python profiling:
http://docs.python.org/library/profile.html
Quest... | ajibawa-2023/Python-Code-Large/train/row_90136 | 293 | 496 | 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_90136:Expr_L9_C0", "label": "expression", "type": "expression", "loc": [9, 17], "level": 0, "parent": null, "vector": [8, 0, 0.0262, 0.0181, 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_90136:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90136:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90136:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90136:ImportFrom_L51_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Pylint widget"""
# pylint: disable-msg=C0103
# pylint: disable-msg=R0903
# pylint: disable-msg=R0911
# pylint: disable-msg=R0201
from __future__ imp... | ajibawa-2023/Python-Code-Large/train/row_90137 | 291 | 446 | 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_90137:Expr_L7_C0", "label": "expression", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0157, 0.0022, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90137:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90137:Import_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90137:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90137:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
spyderlib.widgets
=================
Widgets defined in this module may be used in any other Qt-based application
They are also used in Spyder throug... | ajibawa-2023/Python-Code-Large/train/row_90138 | 1 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90138:Expr_L7_C0", "label": "expression", "type": "expression", "loc": [7, 15], "level": 0, "parent": null, "vector": [8, 0, 0.7333, 0.6, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [] |
#!/usr/bin/env python
from spyderlib import spyder
spyder.main()
| ajibawa-2023/Python-Code-Large/train/row_90140 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90140:ImportFrom_L2_C0", "label": "from spyderlib import spyder", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.3333, 0, 0.66, 0.0, 498, 0, 1, 0, 0, 498, 0, 0], "semantic": {"name": "spyderlib", "arg_names": [], "import_names": ... | [] |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Spyder
======
The Scientific PYthon Development EnviRonment
"""
from distutils.core import setup
from distutils.command.build import build
from s... | ajibawa-2023/Python-Code-Large/train/row_90141 | 42 | 101 | 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_90141:Expr_L7_C0", "label": "expression", "type": "expression", "loc": [7, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0941, 0.0594, 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_90141:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90141:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90141:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90141:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Cloning Spyder mercurial repository
Building source and win32 executable distribution package
"""
import os, shutil, os.path as osp
import spyderli... | ajibawa-2023/Python-Code-Large/train/row_90142 | 18 | 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_90142:Expr_L7_C0", "label": "expression", "type": "expression", "loc": [7, 10], "level": 0, "parent": null, "vector": [8, 0, 0.2297, 0.1081, 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_90142:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90142:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90142:For_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90142:Expr_L34_C4"}] |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 23 15:44:03 2011
@author: Pierre Raybaut
"""
import time, os.path as osp
import rope.base.project
import rope.base.libutils
import rope.contrib.codeassist
ROPE_PREFS = {
'ignore_syntax_errors': True,
'ignore_bad_imports': Tr... | ajibawa-2023/Python-Code-Large/train/row_90144 | 56 | 105 | 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_90144:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0381, 0.0476, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90144:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90144:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90144:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90144:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code... |
import numpy
numpy. | ajibawa-2023/Python-Code-Large/train/row_90145 | 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_90145:Import_L1_C0", "label": "numpy import numpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_call_nam... | [] |
import numpy
numpy.linspace | ajibawa-2023/Python-Code-Large/train/row_90146 | 2 | 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"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90146:Import_L1_C0", "label": "numpy import numpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["numpy"], "rhs_call_nam... | [] |
# -*- test-case-name: pyflakes -*-
# (c) 2005-2008 Divmod, Inc.
# See LICENSE file for details
import __builtin__
import os.path
from compiler import ast
from pyflakes import messages
class Binding(object):
"""
Represents the binding of a value to a name.
The checker uses this to keep track of which n... | ajibawa-2023/Python-Code-Large/train/row_90147 | 264 | 556 | 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_90147:Import_L5_C0", "label": "__builtin__ import __builtin__", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.0018, 0, 0.66, 0.0, 364, 0, 1, 0, 0, 364, 0, 0], "semantic": {"name": "__builtin__", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90147:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90147:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90147:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90147:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-... |
__version__ = '0.4.0'
| ajibawa-2023/Python-Code-Large/train/row_90148 | 1 | 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"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90148:Assign_L2_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.5, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call... | [] |
# (c) 2005 Divmod, Inc. See LICENSE file for details
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, lineno):
self.filename = filename
self.lineno = lineno
def __str__(self):
return '%s:%s: %s' % (self.filename, self.lineno, self.message % sel... | ajibawa-2023/Python-Code-Large/train/row_90149 | 64 | 94 | 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_90149:ClassDef_L3_C0", "label": "Message", "type": "class", "loc": [3, 10], "level": 0, "parent": null, "vector": [3, 0, 0.0691, 0.0851, 0, 0.66, 0.0, 6, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "Message", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90149:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90149:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90149:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90149:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Buiding instructions:
# python setup.py py2exe
from distutils.core import setup
import py2exe # Patching distutils setup
from guidata.disthelpers import (remove_build_dist, get_default_excludes,
get_default_dll_excludes, create_vs2008_... | ajibawa-2023/Python-Code-Large/train/row_90150 | 15 | 65 | 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_90150:ImportFrom_L7_C0", "label": "from distutils.core import setup", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1077, 0.0154, 0, 0.66, 0.0, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "import... | [] |
"""Script to offset by a fixed amount and expose
Instructions:
load Map.py into your TUI lib/python2.6/TUI/Scripts/TSpec/ directory
start up TUI
run script!
(to test, set sr.debug = True in __init__)
History:
2010-10-21 AGinsburg Changed from Nod.py to Map.py, a mapping script!
2008-04-23 ROwen
2008-07-24... | ajibawa-2023/Python-Code-Large/train/row_90152 | 93 | 216 | 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_90152:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0301, 0.0556, 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_90152:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90152:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90152:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90152:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Co... |
import datetime
import os
import numpy as np
try:
import astropy.io.fits as pyfits
except ImportError:
import pyfits
import glob
try:
import progressbar
widgets = [progressbar.FormatLabel('Processed: %(value)d spectra in %(elapsed)s)'), progressbar.Percentage()]
progress = progressbar.ProgressBar(w... | ajibawa-2023/Python-Code-Large/train/row_90154 | 97 | 146 | 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_90154:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90154:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90154:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90154:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90154:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import aplpy
import os
import pyfits
import matplotlib.pyplot as pl
pl.ioff()
verbose_global = False
# orion-specific
ROrion = pyfits.getdata('/Volumes/disk5/Users/adam/observations/Q4CU05/UT121105/Robberto2010Orion.fits')
UOrion = pyfits.getdata('/Volumes/disk5/Users/adam/observations/Q4CU05/UT121105/UKIDSS_Orion.fi... | ajibawa-2023/Python-Code-Large/train/row_90155 | 44 | 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_90155:Import_L1_C0", "label": "aplpy import aplpy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0156, 0, 0.66, 0.0, 96, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "aplpy", "arg_names": [], "import_names": ["aplpy"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90155:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90155:If_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90155:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90155:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
"""
TripleSpec's slit is centered at coordinates
250,416.4
REVISED:
250.11, 416.53
angle 0.66 degrees
length 89.3 pix, height 3.24 pix
in the slitviewer (proc coordinates, not raw)
Its endpoints are approximately:
207,416 # REVISED 205.6 415.7
293,417 # REVISED 294.9 416.7
"""
import numpy as np... | ajibawa-2023/Python-Code-Large/train/row_90156 | 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_90156:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 12], "level": 0, "parent": null, "vector": [8, 0, 0.1912, 0.3529, 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_90156:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90156:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90156:Try_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90156:Import_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as pl
pl.ioff()
import numpy as np
import pyfits
verbose_global=False
def plot_axy(fn,plow=1,phi=99,verbose=verbose_global):
if verbose:
print "Plotting %s" % fn
prefix = fn.replace('.fits','')
axy = pyfits.getdata(prefix+".axy")
... | ajibawa-2023/Python-Code-Large/train/row_90157 | 35 | 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_90157:Import_L1_C0", "label": "matplotlib import matplotlib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "matplotlib", "arg_names": [], "import_names": ["mat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90157:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90157:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90157:If_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90157:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import datetime
def dateobs_to_datetime(fitsstr):
"""
Converte a DATE-OBS time string to a datetime instance
string format should be like:
'2012-11-05T08:47:31.549'
"""
year = int(fitsstr[:4])
month = int(fitsstr[5:7])
day = int(fitsstr[8:10])
hour = int(fitsstr[11:13])
minute ... | ajibawa-2023/Python-Code-Large/train/row_90158 | 11 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90158:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90158:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90158:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90158:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90158:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Step 1: Grab 2MASS catalog
#
"""
import astroquery.irsa
ORION = astroquery.irsa.query_gator_box('pt_src_cat','83.808 -5.391',900)
import atpy
import astropy
T = atpy.Table()
[T.add_column(n,ORION[n]) for n in ORION.columns]
T.write('2MASS_orion_cat.fits')
T2 = atpy.Table()
T2.add_column('RA',T.ra)
T2.add_column('Dec'... | ajibawa-2023/Python-Code-Large/train/row_90159 | 115 | 262 | 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_90159:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 16], "level": 0, "parent": null, "vector": [8, 0, 0.0363, 0.0534, 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_90159:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90159:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90159:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90159:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from __future__ import with_statement
import gtk, gobject
from gtk import gdk
from pychess.System import conf
from pychess.System.glock import glock_connect
from pychess.System.prefix import addDataPrefix
from pychess.Utils.Move import toSAN, toFAN
from gtk.gdk import keyval_from_name
leftkeys = map(keyval_from_name... | ajibawa-2023/Python-Code-Large/train/row_90161 | 129 | 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_90161:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 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_90161:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90161:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90161:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90161:Assign_L21_C24"}, {"f": "ajibawa-2023/Python... |
# -*- coding: UTF-8 -*-
import gtk
import pango
import time
from pychess.System import uistuff
from pychess.System import glock
from pychess.System.Log import log
from pychess.System.prefix import addDataPrefix
from pychess.Utils.const import LOCAL, WHITE, BLACK
from pychess.widgets.ChatView import ChatView
__title... | ajibawa-2023/Python-Code-Large/train/row_90162 | 39 | 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_90162:Import_L3_C0", "label": "gtk import gtk", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0566, 0.0189, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90162:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90162:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90162:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90162:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-... |
import gtk, gobject, cairo
from pychess.System import conf
from pychess.Utils.book import getOpenings
from pychess.Utils.Move import parseSAN, toSAN, toFAN
from pychess.System.prefix import addDataPrefix
__title__ = _("Opening Book")
__icon__ = addDataPrefix("glade/panel_book.svg")
__desc__ = _("The opening book wi... | ajibawa-2023/Python-Code-Large/train/row_90163 | 143 | 206 | 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_90163:Import_L1_C0", "label": "gtk import gtk, gobject, cairo", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 0, 0.66, 0.0, 166, 0, 3, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90163:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90163:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90163:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90163:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-... |
from math import e
from random import randint
from sys import maxint
import gtk, gobject
from gobject import SIGNAL_RUN_FIRST, TYPE_NONE
from pychess.System.glock import glock_connect
from pychess.System.prefix import addDataPrefix
from pychess.Utils.const import WHITE, DRAW, RUNNING, WHITEWON, BLACKWON
from pychess... | ajibawa-2023/Python-Code-Large/train/row_90164 | 179 | 259 | 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_90164:ImportFrom_L2_C0", "label": "from math import e", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0077, 0.0039, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["e"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90164:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90164:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90164:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90164:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: UTF-8 -*-
from __future__ import with_statement
import gtk, pango
from pychess.System import uistuff
from pychess.System.prefix import addDataPrefix
from pychess.System.glock import *
from pychess.Utils.const import *
from pychess.Utils.repr import reprColor, reprPiece
from pychess.Utils.lutils.lsort im... | ajibawa-2023/Python-Code-Large/train/row_90165 | 140 | 262 | 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_90165:ImportFrom_L3_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0038, 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_90165:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90165:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90165:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90165:Assign_L25_C24"}, {"f": "ajibawa-2023/Python... |
# -*- coding: UTF-8 -*-
import datetime
import gtk
import pango
from pychess.Utils.const import *
from pychess.System import conf
from pychess.System.glock import glock_connect
from pychess.System.prefix import addDataPrefix
from pychess.Utils.Move import Move, toSAN, toFAN
from pychess.Savers.pgn import nag2symbol,... | ajibawa-2023/Python-Code-Large/train/row_90166 | 383 | 538 | 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_90166:Import_L3_C0", "label": "datetime import datetime", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0019, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90166:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90166:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90166:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90166:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: utf-8 -*-
#
# require:
# gtk-dev-2.10.11-win32-1
# py2exe-0.6.6.win32-py2.5
# pygtk-2.10.6-1.win32-py2.5
# pygobject-2.12.3-1.win32-py2.5
# pycairo-1.2.6-1.win32-py2.5
#
# run:
# python setup_win32.py py2exe
#
from distutils.core import setup
import py2exe
import glob
import sys
opts =... | ajibawa-2023/Python-Code-Large/train/row_90167 | 7 | 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_90167:ImportFrom_L14_C0", "label": "from distutils.core import setup", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2188, 0.0156, 0, 0.66, 0.0, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "imp... | [] |
#!/usr/bin/python
# PyChess startup script.
# This script is to check package requirements, and set up system/enviroment
# stuff, to make the PyChess Main class run smoothly.
###############################################################################
# Check requirements
import os, sys
if sys.version_info < (2,... | ajibawa-2023/Python-Code-Large/train/row_90168 | 51 | 100 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90168:Import_L11_C0", "label": "os import os, sys", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.11, 0.01, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90168:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90168:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90168:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90168:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_901... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from imp import load_module, find_module
pychess = load_module("pychess", *find_module("pychess",["lib"]))
from distutils.core import setup
from glob import glob
from os import listdir
from os.path import isdir, isfile
import os
import sys
# To run "setup.py register" ch... | ajibawa-2023/Python-Code-Large/train/row_90171 | 27 | 133 | 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_90171:ImportFrom_L4_C0", "label": "from imp import load_module, find_module", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.0, 201, 0, 2, 0, 0, 201, 0, 0], "semantic": {"name": "imp", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90171:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90171:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90171:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90171:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import unittest
from pychess.Utils.const import WHITE, ANALYZING, INVERSE_ANALYZING
from pychess.Utils.lutils.ldata import MATE_VALUE
from pychess.Utils.Move import listToMoves
from pychess.Utils.Cord import Cord
from pychess.Utils.Board import Board
from pychess.Players.CECPEngine import CECPEngine
from Queue import... | ajibawa-2023/Python-Code-Large/train/row_90173 | 66 | 98 | 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_90173:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0102, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90173:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90173:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90173:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90173:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod... |
import unittest
modules_to_test = (
'ficsmanagers',
"bitboard",
"draw",
"eval",
"fen",
"frc_castling",
"frc_movegen",
"move",
"movegen",
"pgn",
"zobrist",
'analysis',
)
def suite():
tests = unittest.TestSuite()
for module in map(__import__, modules_to_test)... | ajibawa-2023/Python-Code-Large/train/row_90174 | 9 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90174:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90174:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90174:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90174:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90174:For_L20_C4"}, {"f": "ajibawa-2023/Python-Code-... |
import sys
import unittest
from pychess.Utils.Board import Board
from pychess.Utils.Move import Move
from pychess.Utils.Move import parseSAN, parseFAN, toFAN
from pychess.Utils.lutils.lmovegen import genAllMoves
class MoveTestCase(unittest.TestCase):
def setUp(self):
self.board = Board()
def ... | ajibawa-2023/Python-Code-Large/train/row_90175 | 39 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90175:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90175:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90175:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90175:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90175:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
import unittest
from pychess.Utils.const import *
from pychess.Utils.Board import Board
from pychess.Utils.lutils.leval import LBoard
from pychess.Utils.lutils.lmove import parseAN
FEN = "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1"
class ZobristTestCase(unittest.TestCase):
def make_mov... | ajibawa-2023/Python-Code-Large/train/row_90176 | 72 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90176:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0104, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90176:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90176:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90176:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90176:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
import unittest
from pychess.Utils.const import *
from pychess.Utils.lutils.LBoard import LBoard
from pychess.Utils.lutils.leval import evaluateComplete
from pychess.Utils.lutils import leval
class EvalTestCase(unittest.TestCase):
def setUp (self):
self.board = LBoard(NORMALCHESS)
self.boar... | ajibawa-2023/Python-Code-Large/train/row_90177 | 36 | 48 | 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_90177:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90177:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90177:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90177:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90177:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-C... |
import sys
import unittest
from pychess.Utils.Board import Board
from pychess.Utils.lutils.LBoard import LBoard
from pychess.Savers.pgn import load, walk, movre
from pychess.Utils.const import *
class PgnTestCase(unittest.TestCase):
def test_movre(self):
"""Testing movre regexp"""
moves = "e4 fxg... | ajibawa-2023/Python-Code-Large/train/row_90178 | 44 | 69 | 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_90178:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90178:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90178:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90178:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90178:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Co... |
import unittest
import datetime
from pychess.Utils.const import WHITE
from pychess.ic import *
from pychess.ic.FICSObjects import *
from pychess.ic.FICSConnection import Connection
from pychess.ic.VerboseTelnet import PredictionsTelnet
from pychess.ic.managers.AdjournManager import AdjournManager
from pychess.ic.manag... | ajibawa-2023/Python-Code-Large/train/row_90179 | 127 | 243 | 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_90179:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90179:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90179:ClassDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90179:ClassDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90179:ClassDef_L18_C8"}, {"f": "ajibawa-2023/Python-Code... |
from __future__ import with_statement
import unittest
from pychess.Savers import pgn
from pychess.Utils.lutils import ldraw
class DrawTestCase(unittest.TestCase):
def setUp(self):
with open('gamefiles/3fold.pgn') as f1:
self.PgnFile1 = pgn.load(f1)
with open('gamefiles/bilba... | ajibawa-2023/Python-Code-Large/train/row_90180 | 35 | 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_90180:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "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_90180:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90180:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90180:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90180:Assign_L12_C12"}, {"f": "ajibawa-2023/Python-... |
import unittest
import random
import operator
from pychess.Utils.lutils.bitboard import *
class BitboardTestCase(unittest.TestCase):
def setUp (self):
self.positionSets = []
# Random positions. Ten of each length. Will also include range(64) and
# range(0)
for i in xrange(10)... | ajibawa-2023/Python-Code-Large/train/row_90182 | 44 | 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_90182:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90182:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90182:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90182:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90182:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
import unittest
from pychess.Utils.Board import Board
from pychess.Utils.lutils.LBoard import LBoard
import sys
class FenTestCase(unittest.TestCase):
def setUp(self):
self.positions = []
for line in open('gamefiles/perftsuite.epd'):
semi = line.find(" ;")
self.positio... | ajibawa-2023/Python-Code-Large/train/row_90183 | 22 | 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_90183:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90183:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90183:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90183:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90183:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
import unittest
from pychess.Utils.const import *
from pychess.Utils.lutils.leval import LBoard
from pychess.Utils.lutils.lmove import newMove, FLAG
from pychess.Utils.lutils.lmovegen import genCastles
# TODO: add more test data
data = (
("r3k2r/8/8/8/8/8/8/R3K2R w AH - 0 1", [(E1, G1, KING_CASTLE), (E1, C1, QUEEN_C... | ajibawa-2023/Python-Code-Large/train/row_90184 | 20 | 38 | 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_90184:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90184:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90184:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90184:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90184:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys, inspect, os
from os import listdir, chdir, getcwd
from os.path import isdir, join, split
docdir = getcwd()
print repr ("cd %s" % sys.argv[1])
chdir(sys.argv[1])
todir = "./"
def search (path, extension):
for file in listdir(path):
file = join (path, f... | ajibawa-2023/Python-Code-Large/train/row_90185 | 35 | 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_90185:Import_L4_C0", "label": "sys import sys, inspect, os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0227, 0, 0.66, 0.0, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "in... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90185:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90185:For_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90185:For_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90185:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import collections
#############################
# Configuration starts here #
#############################
FILENAME = 'TRANSLATORS'
POOLSIZE = 7
###########################
# Configuration ends here #
###########################
from... | ajibawa-2023/Python-Code-Large/train/row_90186 | 13 | 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_90186: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_90186:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90186:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90186:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90186:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from getpass import getpass
from smtplib import SMTP, SMTPConnectError, SMTPAuthenticationError, SMTPRecipientsRefused
from email.mime.text import MIMEText
mail = 'pychess@gmail.com'
passw = getpass('password: ')
smtp = 'smtp.gmail.com'
to = 'python-announce-lis... | ajibawa-2023/Python-Code-Large/train/row_90187 | 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_90187:ImportFrom_L1_C0", "label": "from getpass import getpass", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 784, 0, 1, 0, 0, 784, 0, 0], "semantic": {"name": "getpass", "arg_names": [], "import_names": ["getpa... | [] |
#!/usr/bin/env python
""" Which - locate a command
* adapted from proposal__ by Erik Demaine and patch__ by Brian Curtin, which adds this feature__ to shutil
__ http://bugs.python.org/file8185/find_in_path.py
__ http://bugs.python.org/file15381/shutil_which.patch
__ http://bugs.python.org/issue444582
... | ajibawa-2023/Python-Code-Large/train/row_90188 | 50 | 249 | 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_90188:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 52], "level": 0, "parent": null, "vector": [8, 0, 0.1084, 0.2048, 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_90188:If_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90188:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90188:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90188:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from array import array
class MultiArray:
def __init__ (self, oneLineData, *lengths):
self.lengths = lengths
self.data = oneLineData
def get (self, *indexes):
index = 0
for depth, i in enumerate(indexes[::-1]):
index += i*self.lengths[depth]**depth
retu... | ajibawa-2023/Python-Code-Large/train/row_90192 | 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_90192:ImportFrom_L1_C0", "label": "from array import array", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["array"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90192:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90192:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90192:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90192:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
""" This is a dictionary, that supports a max of items.
This is good for the transportation table, as some old entries might not
be useable any more, as the position has totally changed """
from UserDict import UserDict
from threading import Lock
class LimitedDict (UserDict):
def __init__ (self, maxSize):... | ajibawa-2023/Python-Code-Large/train/row_90193 | 18 | 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_90193:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.1071, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90193:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90193:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90193:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90193:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-... |
# -*- coding: UTF-8 -*-
from gobject import GObject, SIGNAL_RUN_FIRST
from pychess.System.Log import log
from pychess.System.SubProcess import SubProcess, searchPath
import re
class Pinger (GObject):
""" The recieved signal contains the time it took to get response from the
server in millisecconds. -1 mea... | ajibawa-2023/Python-Code-Large/train/row_90195 | 59 | 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_90195:ImportFrom_L3_C0", "label": "from gobject import GObject, SIGNAL_RUN_FIRST", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0337, 0.0112, 0, 0.66, 0.0, 90, 0, 2, 0, 0, 90, 0, 0], "semantic": {"name": "gobject", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90195:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90195:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90195:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90195:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
This module provides some basic functions for accessing pychess datefiles in
system or user space
"""
import os
import sys
from os import makedirs
from os.path import isdir, join, dirname, abspath
################################################################################
# Locate files in system space ... | ajibawa-2023/Python-Code-Large/train/row_90196 | 38 | 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_90196:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 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_90196:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90196:Return_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90196:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90196:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160
# Was accepted into Python 2.5, but earlier versions still have
# to do stuff manually
import threading
from Queue import Queue
def TaskQueue ():
if hasattr(Queue, "task_done"):
return Queue()
return _TaskQueue()
class _TaskQueue(Queue)... | ajibawa-2023/Python-Code-Large/train/row_90197 | 30 | 63 | 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_90197:Import_L5_C0", "label": "threading import threading", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0159, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["thread... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90197:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90197:If_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90197:If_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90197:Return_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import gconf
from os.path import normpath
GDIR = '/apps/pychess/'
c = gconf.client_get_default()
c.add_dir(GDIR[:-1], gconf.CLIENT_PRELOAD_NONE)
def notify_add (key, func):
key = normpath(GDIR+key)
return c.notify_add(key, func)
def notify_remove (conid):
c.notify_remove(conid)
def get (key):
key = ... | ajibawa-2023/Python-Code-Large/train/row_90199 | 40 | 47 | 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_90199:Import_L1_C0", "label": "gconf import gconf", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 367, 0, 1, 0, 0, 367, 0, 0], "semantic": {"name": "gconf", "arg_names": [], "import_names": ["gconf"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90199:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90199:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90199:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90199:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from ctypes import *
l=CDLL('librsvg-2-2.dll')
g=CDLL('libgobject-2.0-0.dll')
g.g_type_init()
class Props():
def __init__(self, dimension):
self.width, self.height = dimension
class rsvgHandle():
class RsvgDimensionData(Structure):
_fields_ = [("width", c_int),
("heig... | ajibawa-2023/Python-Code-Large/train/row_90204 | 30 | 47 | 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_90204:ImportFrom_L1_C0", "label": "from ctypes import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["*"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90204:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90204:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90204:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90204:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod... |
""" The task of this module is to provide easy saving/loading of configurations
It also supports gconf like connection, so you get notices when a property
has changed. """
# gconf's notify all seams to be broken
#try:
# import gconf
# import conf_gconf as confmodule
#except:
import conf_configParser as c... | ajibawa-2023/Python-Code-Large/train/row_90205 | 30 | 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_90205:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0377, 0.0566, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90205:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90205:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90205:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90205:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: UTF-8 -*-
import time
from pychess.System.ThreadPool import pool
def repeat (func, *args, **kwargs):
""" Repeats a function in a new thread until it returns False """
def run ():
while func(*args, **kwargs):
pass
pool.start(run)
def repeat_sleep (func, sleeptime, recur=F... | ajibawa-2023/Python-Code-Large/train/row_90206 | 22 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90206:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0303, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90206:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90206:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90206:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90206:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from threading import Thread
import Queue
from gobject import GObject, SIGNAL_RUN_FIRST
from ThreadPool import PooledThread
import glock
#
# IDEA: We could implement gdk prioritizing by using a global PriorityQueue
#
class Publisher (PooledThread):
""" Publisher can be used when a thread is often spitting out r... | ajibawa-2023/Python-Code-Large/train/row_90207 | 169 | 308 | 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_90207:ImportFrom_L1_C0", "label": "from threading import Thread", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0032, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90207:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90207:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90207:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90207:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import socket
import re, sre_constants
from copy import copy
from pychess.System.Log import log
class Prediction:
def __init__ (self, callback, *regexps):
self.callback = callback
self.regexps = []
self.hash = hash(callback)
for regexp in regexps:
self.hash ^= ... | ajibawa-2023/Python-Code-Large/train/row_90208 | 137 | 181 | 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_90208:Import_L1_C0", "label": "socket import socket", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90208:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90208:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90208:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90208:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from gobject import *
import threading
import re
from math import ceil
import time
from pychess.System.Log import log
titles = "(?:\([A-Z*]+\))*"
names = "([A-Za-z]+)"+titles
titlesC = re.compile(titles)
namesC = re.compile(names)
CHANNEL_SHOUT = "shout"
CHANNEL_CSHOUT = "cshout"
class ChatManager (GObject):
... | ajibawa-2023/Python-Code-Large/train/row_90210 | 188 | 307 | 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_90210:ImportFrom_L2_C0", "label": "from gobject import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0033, 0, 0.66, 0.0, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "gobject", "arg_names": [], "import_names": ["*"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90210:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90210:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90210:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90210:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Cod... |
import re
import datetime
from gobject import *
from BoardManager import BoardManager, moveListHeader1Str, names, months, dates
from pychess.ic import *
from pychess.ic.FICSObjects import FICSAdjournedGame, FICSPlayer
from pychess.Utils.const import *
from pychess.System.Log import log
class AdjournManager (GObject):... | ajibawa-2023/Python-Code-Large/train/row_90211 | 94 | 151 | 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_90211:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 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_90211:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90211:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90211:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90211:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from gobject import *
sanmove = "([a-hxOoKQRBN0-8+#=-]{2,7})"
class ErrorManager (GObject):
__gsignals__ = {
'onCommandNotFound' : (SIGNAL_RUN_FIRST, TYPE_NONE, (str,)),
'onAmbiguousMove' : (SIGNAL_RUN_FIRST, TYPE_NONE, (str,)),
'onIllegalMove' : (SIGNAL_RUN_FIRST, TYPE_NONE, (str,))... | ajibawa-2023/Python-Code-Large/train/row_90212 | 18 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90212:ImportFrom_L2_C0", "label": "from gobject import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.0, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "gobject", "arg_names": [], "import_names": ["*"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90212:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90212:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90212:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90212:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from gobject import *
class AutoLogOutManager (GObject):
__gsignals__ = {
'logOut': (SIGNAL_RUN_FIRST, None, ())
}
def __init__ (self, connection):
GObject.__init__(self)
self.connection = connection
self.connection.expect_line (self.onLogOut,
"\*\*\*... | ajibawa-2023/Python-Code-Large/train/row_90214 | 11 | 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_90214:ImportFrom_L1_C0", "label": "from gobject import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "gobject", "arg_names": [], "import_names": ["*"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90214:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90214:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90214:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90214:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from threading import RLock
from gobject import *
import re
from time import time
from pychess.ic import *
from pychess.Utils.const import *
from pychess.Utils.Rating import Rating
from pychess.System.Log import log
types = "(?:blitz|standard|lightning|wild|bughouse|crazyhouse|suicide|losers|atomic)"
rated = "(rated|u... | ajibawa-2023/Python-Code-Large/train/row_90215 | 223 | 343 | 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_90215:ImportFrom_L1_C0", "label": "from threading import RLock", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0029, 0.0029, 0, 0.66, 0.0, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["R... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90215:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90215:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90215:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90215:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-... |
import re
from gobject import *
types = "(Blitz|Lightning|Standard)"
days = "(Mon|Tue|Wed|Thu|Fri|Sat|Sun)"
months = "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"
AMOUNT_OF_NEWSITEMS = 5
FICS_SENDS = 10
class NewsManager (GObject):
__gsignals__ = {
'readingNews' : (SIGNAL_RUN_FIRST, TYPE_NONE... | ajibawa-2023/Python-Code-Large/train/row_90217 | 34 | 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_90217:Import_L2_C0", "label": "re import re", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0185, 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_90217:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90217:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90217:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90217:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from FICSConnection import FICSConnection, LogOnError
from ICLounge import ICLounge
from pychess.System import glock, uistuff
from pychess.Utils.const import *
import gtk
import gobject
import re
import socket
import webbrowser
dialog = None
def run():
global dialog
if not dialog:
dialog = ICLogon... | ajibawa-2023/Python-Code-Large/train/row_90219 | 153 | 196 | 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_90219:ImportFrom_L1_C0", "label": "from FICSConnection import FICSConnection, LogOnError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 719, 0, 2, 0, 0, 719, 0, 0], "semantic": {"name": "FICSConnection", "ar... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90219:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90219:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90219:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90219:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
from pychess.System.Log import log
from pychess.Utils.GameModel import GameModel
from pychess.Utils.Offer import Offer
from pychess.Utils.const import *
from pychess.Players.Human import Human
from pychess.ic import GAME_TYPES
class ICGameModel (GameModel):
def __init__ (self, connection, ficsgame, timemodel):
... | ajibawa-2023/Python-Code-Large/train/row_90222 | 114 | 185 | 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_90222:ImportFrom_L1_C0", "label": "from pychess.System.Log import log", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0054, 0.0054, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "pychess.System.Log", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90222:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90222:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90222:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90222:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-... |
import datetime
import gobject
from gobject import GObject, SIGNAL_RUN_FIRST
from pychess.Utils.IconLoader import load_icon
from pychess.Utils.Rating import Rating
from pychess.Utils.const import *
from pychess.ic import TYPE_BLITZ, TYPE_STANDARD, TYPE_LIGHTNING, TYPE_WILD, \
TYPE_LOSERS, TITLE_TYPE_DISPLAY_TEXTS,... | ajibawa-2023/Python-Code-Large/train/row_90223 | 458 | 688 | 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_90223:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0015, 0.0015, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetim... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90223:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90223:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90223:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90223:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Co... |
from pychess import Variants
from pychess.Utils.const import *
# RatingType
TYPE_BLITZ, TYPE_STANDARD, TYPE_LIGHTNING, TYPE_WILD, \
TYPE_BUGHOUSE, TYPE_CRAZYHOUSE, TYPE_SUICIDE, TYPE_LOSERS, TYPE_ATOMIC, \
TYPE_UNTIMED, TYPE_EXAMINED, TYPE_OTHER = range(12)
class GameType (object):
def __init__ (self, fic... | ajibawa-2023/Python-Code-Large/train/row_90225 | 73 | 183 | 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_90225:ImportFrom_L1_C0", "label": "from pychess import Variants", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0055, 0, 0.66, 0.0, 806, 0, 1, 0, 0, 806, 0, 0], "semantic": {"name": "pychess", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90225:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90225:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90225:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90225:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-C... |
from pychess.Utils.const import *
from pychess.Utils.Board import Board
KNIGHTODDSSTART = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/R1BQKBNR w KQkq - 0 1"
class KnightOddsBoard(Board):
variant = KNIGHTODDSCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=KNIGH... | ajibawa-2023/Python-Code-Large/train/row_90226 | 17 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90226:ImportFrom_L1_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90226:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90226:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90226:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90226:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Upside-down Chess
from pychess.Utils.const import *
from pychess.Utils.Board import Board
UPSIDEDOWNSTART = "RNBQKBNR/PPPPPPPP/8/8/8/8/pppppppp/rnbqkbnr w - - 0 1"
class UpsideDownBoard(Board):
variant = UPSIDEDOWNCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__... | ajibawa-2023/Python-Code-Large/train/row_90227 | 17 | 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_90227:ImportFrom_L3_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0385, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90227:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90227:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90227:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90227:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from pychess.Utils.const import *
from pychess.Utils.Board import Board
QUEENODDSSTART = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNB1KBNR w KQkq - 0 1"
class QueenOddsBoard(Board):
variant = QUEENODDSCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=QUEENODD... | ajibawa-2023/Python-Code-Large/train/row_90228 | 17 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90228:ImportFrom_L1_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90228:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90228:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90228:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90228:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Shuffle Chess
import random
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class ShuffleBoard(Board):
variant = SHUFFLECHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=self.shuffle_start())
else:
Board.__i... | ajibawa-2023/Python-Code-Large/train/row_90229 | 27 | 42 | 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_90229:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0238, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90229:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90229:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90229:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90229:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Pawns Passed Chess
from pychess.Utils.const import *
from pychess.Utils.Board import Board
PAWNSPASSEDSTART = "rnbqkbnr/8/8/PPPPPPPP/pppppppp/8/8/RNBQKBNR w - - 0 1"
class PawnsPassedBoard(Board):
variant = PAWNSPASSEDCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__i... | ajibawa-2023/Python-Code-Large/train/row_90230 | 17 | 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_90230:ImportFrom_L3_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90230:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90230:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90230:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90230:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# AsymmetricRandom Chess
import random
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class AsymmetricRandomBoard(Board):
variant = ASYMMETRICRANDOMCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=self.asymmetricrandom_start())... | ajibawa-2023/Python-Code-Large/train/row_90231 | 65 | 102 | 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_90231:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0098, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90231:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90231:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90231:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90231:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from pychess.Utils.Board import Board
class NormalChess:
__desc__ = _("Classic chess rules\n" +
"http://en.wikipedia.org/wiki/Chess")
name = _("Normal")
cecp_name = "normal"
board = Board
need_initial_board = False
standard_rules = True
| ajibawa-2023/Python-Code-Large/train/row_90232 | 8 | 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_90232:ImportFrom_L1_C0", "label": "from pychess.Utils.Board import Board", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 208, 0, 1, 0, 0, 208, 0, 0], "semantic": {"name": "pychess.Utils.Board", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90232:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90232:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90232:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90232:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Random Chess
import random
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class RandomBoard(Board):
variant = RANDOMCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=self.random_start())
else:
Board.__init_... | ajibawa-2023/Python-Code-Large/train/row_90233 | 28 | 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_90233:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0222, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90233:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90233:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90233:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90233:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Losers Chess
from pychess.Utils.const import *
from pychess.Utils.lutils.bitboard import bitLength
from pychess.Utils.Board import Board
class LosersBoard(Board):
variant = LOSERSCHESS
class LosersChess:
__desc__ = _("FICS losers: http://www.freechess.org/Help/HelpFiles/losers_chess.html")
name = _("L... | ajibawa-2023/Python-Code-Large/train/row_90234 | 16 | 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_90234:ImportFrom_L3_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0385, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90234:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90234:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90234:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90234:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# Chess960 (Fischer Random Chess)
import random
from copy import copy
from pychess.Utils.const import *
from pychess.Utils.Cord import Cord
from pychess.Utils.Board import Board
from pychess.Utils.Piece import Piece
from pychess.Utils.lutils.bitboard import *
from pychess.Utils.lutils.attack import *
from pychess.Uti... | ajibawa-2023/Python-Code-Large/train/row_90235 | 221 | 412 | 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_90235:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0073, 0.0024, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90235:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90235:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90235:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90235:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Cod... |
from pychess.Utils.const import *
from normal import NormalChess
from corner import CornerChess
from shuffle import ShuffleChess
from fischerandom import FischerRandomChess
from randomchess import RandomChess
from asymmetricrandom import AsymmetricRandomChess
from upsidedown import UpsideDownChess
from pawnspushed impo... | ajibawa-2023/Python-Code-Large/train/row_90236 | 16 | 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_90236:ImportFrom_L1_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [] |
# Pawns Pushed Chess
from pychess.Utils.const import *
from pychess.Utils.Board import Board
PAWNSPUSHEDSTART = "rnbqkbnr/8/8/pppppppp/PPPPPPPP/8/8/RNBQKBNR w - - 0 1"
class PawnsPushedBoard(Board):
variant = PAWNSPUSHEDCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__in... | ajibawa-2023/Python-Code-Large/train/row_90237 | 17 | 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_90237:ImportFrom_L3_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0385, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90237:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90237:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90237:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90237:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from pychess.Utils.const import *
from pychess.Utils.Board import Board
PAWNODDSSTART = "rnbqkbnr/ppppp1pp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
class PawnOddsBoard(Board):
variant = PAWNODDSCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=PAWNODDSSTA... | ajibawa-2023/Python-Code-Large/train/row_90238 | 17 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90238:ImportFrom_L1_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90238:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90238:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90238:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90238:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from pychess.Utils.const import *
from pychess.Utils.Board import Board
ROOKODDSSTART = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w Kkq - 0 1"
class RookOddsBoard(Board):
variant = ROOKODDSCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=ROOKODDSSTAR... | ajibawa-2023/Python-Code-Large/train/row_90239 | 17 | 23 | 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_90239:ImportFrom_L1_C0", "label": "from pychess.Utils.const import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 297, 0, 1, 0, 0, 297, 0, 0], "semantic": {"name": "pychess.Utils.const", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90239:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90239:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90239:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90239:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# Corner Chess
import random
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class CornerBoard(Board):
variant = CORNERCHESS
def __init__ (self, setup=False):
if setup is True:
Board.__init__(self, setup=self.shuffle_start())
else:
Board.__init... | ajibawa-2023/Python-Code-Large/train/row_90240 | 31 | 48 | 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_90240:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0208, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90240:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90240:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90240:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90240:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from Throbber import Throbber
from pychess.Players.engineNest import discoverer
from pychess.System import conf, uistuff
from pychess.System.glock import glock_connect
from pychess.System.prefix import addDataPrefix
import gtk.glade
import os
uistuff.cacheGladefile("discovererDialog.glade")
class DiscovererDialog... | ajibawa-2023/Python-Code-Large/train/row_90241 | 42 | 78 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90241:ImportFrom_L1_C0", "label": "from Throbber import Throbber", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 695, 0, 1, 0, 0, 695, 0, 0], "semantic": {"name": "Throbber", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90241:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90241:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90241:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90241:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-... |
import gtk, gobject
import gamewidget
firstRun = True
def run(widgets):
global firstRun
if firstRun:
initialize(widgets)
firstRun = False
widgets["player_info"].show_all()
def initialize(widgets):
def addColumns (treeview, *columns):
model = gtk.ListStore(*((str,)*len(columns)... | ajibawa-2023/Python-Code-Large/train/row_90242 | 53 | 71 | 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_90242:Import_L1_C0", "label": "gtk import gtk, gobject", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.0141, 0, 0.66, 0.0, 166, 0, 2, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk", "gobjec... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90242:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90242:If_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90242:If_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90242:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
import gamewidget
from pychess.System import glock
from pychess.Utils.const import ACTION_MENU_ITEMS
################################################################################
# Main menubar MenuItem classes to keep track of menu widget states #
########################################################... | ajibawa-2023/Python-Code-Large/train/row_90243 | 66 | 106 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90243:Import_L1_C0", "label": "gamewidget import gamewidget", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0094, 0, 0.66, 0.0, 632, 0, 1, 0, 0, 632, 0, 0], "semantic": {"name": "gamewidget", "arg_names": [], "import_names": ["g... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90243:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90243:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90243:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90243:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-C... |
import time
import gtk
import gobject
import pango
import re
from pychess.Utils.IconLoader import load_icon
from pychess.System import uistuff
from pychess.System.glock import glock_connect
from pychess.widgets.ChatView import ChatView
from pychess.widgets.pydock.PyDockTop import PyDockTop
from pychess.widgets.pydock... | ajibawa-2023/Python-Code-Large/train/row_90245 | 472 | 651 | 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_90245:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0015, 0.0015, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90245:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90245:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90245:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90245:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Co... |
import gtk
from pychess.System import uistuff
from pychess.System.prefix import addDataPrefix
from pychess.Utils.Piece import Piece,QUEEN,ROOK,BISHOP,KNIGHT
from pychess.Utils.const import WHITE,BLACK
from PieceWidget import PieceWidget
uistuff.cacheGladefile("promotion.glade")
class PromotionDialog:
def... | ajibawa-2023/Python-Code-Large/train/row_90246 | 32 | 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_90246:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90246:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90246:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90246:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90246:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: UTF-8 -*-
import os.path
import time
import codecs
import gtk, pango, gobject
from pychess.System import glock, uistuff
from pychess.System.Log import log
from pychess.System.Log import LOG_DEBUG, LOG_LOG, LOG_WARNING, LOG_ERROR
from pychess.System.prefix import addDataPrefix
def rawreplace(error):
... | ajibawa-2023/Python-Code-Large/train/row_90247 | 171 | 256 | 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_90247:Import_L3_C0", "label": "os.path import os.path", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0117, 0.0039, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90247:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90247:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90247:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90247:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: UTF-8 -*-
import gtk, gtk.gdk
from gobject import *
import threading
from pychess.System.prefix import addDataPrefix
from pychess.System.Log import log
from pychess.Utils.Cord import Cord
from pychess.Utils.Move import Move
from pychess.Utils.const import *
from pychess.Utils.logic import validate
from ... | ajibawa-2023/Python-Code-Large/train/row_90248 | 415 | 557 | 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_90248:Import_L3_C0", "label": "gtk import gtk, gtk.gdk", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0054, 0.0018, 0, 0.66, 0.0, 166, 0, 2, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk", "gtk.gd... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90248:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90248:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90248:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90248:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# -*- coding: UTF-8 -*-
import sys
from math import floor, ceil, pi
from time import time, sleep
from threading import Lock, RLock
import gtk, gtk.gdk, cairo
from gobject import *
import pango
from pychess.System import glock, conf, gstreamer
from pychess.System.glock import glock_connect, glock_connect_after
from p... | ajibawa-2023/Python-Code-Large/train/row_90249 | 841 | 1,241 | 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_90249:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0024, 0.0008, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90249:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90249:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90249:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90249:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Co... |
import pygtk
pygtk.require("2.0")
import gtk
from gobject import *
from pychess.System.Log import log
from pychess.Utils.IconLoader import load_icon
class ToggleComboBox (gtk.ToggleButton):
__gsignals__ = {'changed' : (SIGNAL_RUN_FIRST, TYPE_NONE, (TYPE_INT,))}
def __init__ (self):
gtk.ToggleButton... | ajibawa-2023/Python-Code-Large/train/row_90251 | 102 | 131 | 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_90251:Import_L1_C0", "label": "pygtk import pygtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 106, 0, 1, 0, 0, 106, 0, 0], "semantic": {"name": "pygtk", "arg_names": [], "import_names": ["pygtk"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90251:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90251:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90251:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90251:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# -*- coding: UTF-8 -*-
from math import ceil, pi, cos, sin
import cairo, gtk, pango
from gtk import gdk
from pychess.System import glock
from pychess.System.repeat import repeat_sleep
from pychess.Utils.const import WHITE, BLACK
class ChessClock (gtk.DrawingArea):
def __init__(self):
gtk.DrawingAre... | ajibawa-2023/Python-Code-Large/train/row_90252 | 142 | 182 | 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_90252:ImportFrom_L3_C0", "label": "from math import ceil, pi, cos\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0055, 0, 0.66, 0.0, 526, 0, 4, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90252:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90252:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90252:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90252:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Co... |
import gtk
import cairo
from pychess.gfx.Pieces import drawPiece
class PieceWidget (gtk.DrawingArea):
def __init__(self, piece):
gtk.DrawingArea.__init__(self)
self.connect("expose_event", self.expose)
self.piece = piece
def setPiece(self, piece):
self.piece = piece
... | ajibawa-2023/Python-Code-Large/train/row_90253 | 19 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90253:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90253:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90253:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90253:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90253:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
import cairo
import gtk
from gtk import gdk
from gobject import SIGNAL_RUN_FIRST, TYPE_NONE
from pychess.System.prefix import addDataPrefix
from pychess.System import glock
from BorderBox import BorderBox
class ChainVBox (gtk.VBox):
""" Inspired by the GIMP chainbutton widget """
__gsignals__ = {
'cli... | ajibawa-2023/Python-Code-Large/train/row_90254 | 121 | 185 | 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_90254:Import_L1_C0", "label": "cairo import cairo", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0054, 0.0054, 0, 0.66, 0.0, 747, 0, 1, 0, 0, 747, 0, 0], "semantic": {"name": "cairo", "arg_names": [], "import_names": ["cairo"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90254:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90254:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90254:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90254:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import sys, os
import gtk
from pychess.System.prefix import addDataPrefix
from pychess.System import conf, gstreamer, uistuff
from pychess.Players.engineNest import discoverer
from pychess.Utils.const import *
from pychess.Utils.IconLoader import load_icon
firstRun = True
def run(widgets):
global firstRun
if ... | ajibawa-2023/Python-Code-Large/train/row_90255 | 287 | 475 | 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_90255:Import_L1_C0", "label": "sys import sys, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90255:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90255:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90255:If_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90255:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from os import path
import gtk
import cairo
from pychess.System.prefix import addDataPrefix, addUserCachePrefix
CLEARPATH = addDataPrefix("glade/clear.png")
surface = None
def giveBackground (widget):
widget.connect("expose_event", expose)
widget.connect("style-set", newtheme)
def expose (widget, event):
... | ajibawa-2023/Python-Code-Large/train/row_90256 | 47 | 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_90256:ImportFrom_L1_C0", "label": "from os import path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["path"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90256:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90256:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90256:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90256:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import gobject
import gtk
class InfoBarMessageButton (gobject.GObject):
def __init__(self, text, response_id, sensitive=True, tooltip=""):
gobject.GObject.__init__(self)
self.text = text
self.response_id = response_id
self.sensitive = sensitive
self.tooltip = tooltip
... | ajibawa-2023/Python-Code-Large/train/row_90257 | 119 | 178 | 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_90257:Import_L1_C0", "label": "gobject import gobject", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0056, 0, 0.66, 0.0, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "gobject", "arg_names": [], "import_names": ["gobject"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90257:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90257:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90257:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90257:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
import gtk
class BorderBox (gtk.Alignment):
def __init__ (self, widget=None, top=False, right=False,
bottom=False, left=False):
gtk.Alignment.__init__(self, 0, 0, 1, 1)
self.connect("expose-event", self._onExpose)
if widget:
self.add(... | ajibawa-2023/Python-Code-Large/train/row_90258 | 61 | 88 | 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_90258:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0114, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90258:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90258:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90258:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90258:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
import gtk, gtk.gdk
from gobject import *
from math import floor
from BoardView import BoardView
from pychess.Utils.const import *
from pychess.Utils.Cord import Cord
ALL = 0
class SetupBoard (gtk.EventBox):
__gsignals__ = {
'cord_clicked' : (SIGNAL_RUN_FIRST, TYPE_NONE, (TYPE_PYOBJECT,)),
}
... | ajibawa-2023/Python-Code-Large/train/row_90259 | 65 | 87 | 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_90259:Import_L2_C0", "label": "gtk import gtk, gtk.gdk", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.023, 0.0115, 0, 0.66, 0.0, 166, 0, 2, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk", "gtk.gdk... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90259:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90259:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90259:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90259:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Cod... |
import gtk.glade, os
from pychess.System import conf
from pychess.System import uistuff
from pychess.System.prefix import addDataPrefix
from random import randrange
uistuff.cacheGladefile("tipoftheday.glade")
class TipOfTheDay:
@classmethod
def _init (cls):
cls.widgets = uistuff.GladeWidgets("tip... | ajibawa-2023/Python-Code-Large/train/row_90260 | 32 | 65 | 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_90260:Import_L1_C0", "label": "gtk.glade import gtk.glade, os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 910, 0, 2, 0, 0, 910, 0, 0], "semantic": {"name": "gtk.glade", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90260:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90260:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90260:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90260:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-C... |
import math
ceil = lambda f: int(math.ceil(f))
from gobject import *
import gtk
import cairo
import pango
line = 10
curve = 60
dotSmall = 14
dotLarge = 24
lineprc = 1/7.
hpadding = 5
vpadding = 3
class SpotGraph (gtk.EventBox):
__gsignals__ = {
'spotClicked' : (SIGNAL_RUN_FIRST, TYPE_NONE, (str,))
... | ajibawa-2023/Python-Code-Large/train/row_90261 | 311 | 469 | 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_90261:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0021, 0.0021, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90261:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90261:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90261:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90261:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Cod... |
import gtk
class ImageMenu(gtk.EventBox):
def __init__ (self, image, child):
gtk.EventBox.__init__(self)
self.add(image)
self.subwindow = gtk.Window()
self.subwindow.set_decorated(False)
self.subwindow.set_resizable(False)
self.subwindow.set_type_hint(gtk.gd... | ajibawa-2023/Python-Code-Large/train/row_90263 | 90 | 114 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90263:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_90263:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_90263:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_90263:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_90263:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.