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 |
|---|---|---|---|---|---|---|---|
#!/usr/bin/python
import time
import datetime
from Adafruit_7Segment import SevenSegment
# ===========================================================================
# Clock Example
# ===========================================================================
segment = SevenSegment(address=0x70)
print "Press CTRL+Z... | ajibawa-2023/Python-Code-Large/train/row_78185 | 16 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78185:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0345, 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_78185:While_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78185:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78185:While_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78185:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
#!/usr/bin/python
import time
import datetime
from Adafruit_LEDBackpack import LEDBackpack
# ===========================================================================
# 8x8 Pixel Display
# ===========================================================================
class EightByEight:
disp = None
# Constructor... | ajibawa-2023/Python-Code-Large/train/row_78186 | 45 | 75 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78186:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0133, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78186:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78186:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78186:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78186:FunctionDef_L15_C2"}, {"f": "ajibawa-2023/Python-Cod... |
#!/usr/bin/python
import time
import datetime
from Adafruit_8x8 import ColorEightByEight
# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = ColorEightByEight(address=0x70)
print "Press ... | ajibawa-2023/Python-Code-Large/train/row_78187 | 11 | 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_78187:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0435, 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_78187:While_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78187:For_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78187:For_L20_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_78187:For_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
#!/usr/bin/python
import time
import datetime
from Adafruit_LEDBackpack import LEDBackpack
# ===========================================================================
# 7-Segment Display
# ===========================================================================
# This class is meant to be used with the four-cha... | ajibawa-2023/Python-Code-Large/train/row_78189 | 27 | 52 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78189:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0192, 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_78189:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78189:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78189:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78189:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
from Adafruit_CharLCD import Adafruit_CharLCD
from subprocess import *
from time import sleep, strftime
from datetime import datetime
lcd = Adafruit_CharLCD()
cmd = "ip addr show eth0 | grep inet | awk '{print $2}' | cut -d/ -f1"
lcd.begin(16,1)
def run_cmd(cmd):
p = Popen(cmd, shell=Tru... | ajibawa-2023/Python-Code-Large/train/row_78192 | 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_78192:ImportFrom_L3_C0", "label": "from Adafruit_CharLCD import Adafruit_CharLCD", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0417, 0, 0.66, 0.0, 882, 0, 1, 0, 0, 882, 0, 0], "semantic": {"name": "Adafruit_CharLCD", "arg_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78192:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78192:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78192:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78192:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/python
# Python library for Adafruit Flora Accelerometer/Compass Sensor (LSM303).
# This is pretty much a direct port of the current Arduino library and is
# similarly incomplete (e.g. no orientation value returned from read()
# method). This does add optional high resolution mode to accelerometer
# though... | ajibawa-2023/Python-Code-Large/train/row_78194 | 47 | 122 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78194:ImportFrom_L29_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.2377, 0.0082, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78194:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78194:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78194:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78194:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# Python library for ADXL345 accelerometer.
# Copyright 2013 Adafruit Industries
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without li... | ajibawa-2023/Python-Code-Large/train/row_78195 | 54 | 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_78195:ImportFrom_L25_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2193, 0.0088, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78195:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78195:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78195:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78195:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# Copyright 2012 Daniel Berlin (with some changes by Adafruit Industries/Limor Fried)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal MCP230XX_GPIO(1, 0xin
# the Software without restrict... | ajibawa-2023/Python-Code-Large/train/row_78198 | 124 | 204 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78198:ImportFrom_L23_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1127, 0.0049, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78198:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78198:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78198:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78198:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
from Adafruit_MCP4725 import MCP4725
import time
# Set this value to 9, 8, 7, 6 or 5 to adjust the resolution
DAC_RESOLUTION = 9
# 9-Bit Lookup Table (512 values)
DACLookup_FullSine_9Bit = \
[ 2048, 2073, 2098, 2123, 2148, 2174, 2199, 2224,
2249, 2274, 2299, 2324, 2349, 2373, 2398, 2423,
244... | ajibawa-2023/Python-Code-Large/train/row_78199 | 29 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78199:ImportFrom_L3_C0", "label": "from Adafruit_MCP4725 import MCP4725", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0174, 0.0058, 0, 0.66, 0.0, 254, 0, 1, 0, 0, 254, 0, 0], "semantic": {"name": "Adafruit_MCP4725", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78199:If_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78199:Expr_L152_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78199:If_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78199:Expr_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#!/usr/bin/python
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# Adafruit MCP4725 12-Bit DAC
# ============================================================================
class MCP4725 :
i2c = None
# Registers
__REG_WRITEDAC = ... | ajibawa-2023/Python-Code-Large/train/row_78201 | 21 | 35 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78201:ImportFrom_L3_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78201:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78201:Assign_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78201:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78201:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python
import time, signal, sys
from Adafruit_ADS1x15 import ADS1x15
def signal_handler(signal, frame):
print 'You pressed Ctrl+C!'
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'
ADS1015 = 0x00 # 12-bit ADC
ADS1115 = 0x01 # 16-bit ADC
# Select the ... | ajibawa-2023/Python-Code-Large/train/row_78203 | 13 | 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_78203:Import_L3_C0", "label": "time import time, signal, sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 0, 0.66, 0.0, 654, 0, 3, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78203:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78203:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78203:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78203:Expr_L8_C8"}] |
#!/usr/bin/python
import time, signal, sys
from Adafruit_ADS1x15 import ADS1x15
def signal_handler(signal, frame):
print 'You pressed Ctrl+C!'
print adc.getLastConversionResults()/1000.0
adc.stopContinuousConversion()
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
# Print 'P... | ajibawa-2023/Python-Code-Large/train/row_78205 | 15 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78205:Import_L3_C0", "label": "time import time, signal, sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0333, 0, 0.66, 0.0, 654, 0, 3, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time", "s... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78205:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78205:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78205:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78205:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python
import time, signal, sys
from Adafruit_ADS1x15 import ADS1x15
def signal_handler(signal, frame):
#print 'You pressed Ctrl+C!'
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#print 'Press Ctrl+C to exit'
ADS1015 = 0x00 # 12-bit ADC
ADS1115 = 0x01 # 16-bit ADC
# Initialise ... | ajibawa-2023/Python-Code-Large/train/row_78206 | 12 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78206:Import_L3_C0", "label": "time import time, signal, sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 0.66, 0.0, 654, 0, 3, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78206:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78206:Expr_L8_C8"}] |
#!/usr/bin/python
from Adafruit_VCNL4000 import VCNL4000
import time
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the VNCL4000 sensor
vcnl = VCNL4000(0x13)
# Print proximity sen... | ajibawa-2023/Python-Code-Large/train/row_78208 | 6 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78208:ImportFrom_L3_C0", "label": "from Adafruit_VCNL4000 import VCNL4000", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 576, 0, 1, 0, 0, 576, 0, 0], "semantic": {"name": "Adafruit_VCNL4000", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78208:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78208:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78208:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78208:Expr_L17_C1"}] |
#!/usr/bin/python
import time
from Adafruit_I2C import Adafruit_I2C
# ===========================================================================
# VCNL4000 Class
# ===========================================================================
# Address of the sensor
VCNL4000_ADDRESS = 0x13
# Commands
VCNL4000_COMMAND... | ajibawa-2023/Python-Code-Large/train/row_78210 | 32 | 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_78210:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0185, 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_78210:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78210:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78210:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78210:FunctionDef_L37_C2"}, {"f": "ajibawa-2023/Python-Cod... |
#!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
import time
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the PWM device using the default address
# bmp = PWM(0x40, de... | ajibawa-2023/Python-Code-Large/train/row_78212 | 16 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78212:ImportFrom_L3_C0", "label": "from Adafruit_PWM_Servo_Driver import PWM", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0278, 0, 0.66, 0.0, 675, 0, 1, 0, 0, 675, 0, 0], "semantic": {"name": "Adafruit_PWM_Servo_Driver", "arg... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78212:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78212:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78212:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78212:Expr_L20_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
import time
import math
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# Adafruit PCA9685 16-Channel PWM Servo Driver
# ============================================================================
class PWM :
i2c = None
# Re... | ajibawa-2023/Python-Code-Large/train/row_78213 | 47 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78213:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0448, 0.0149, 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_78213:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78213:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78213:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78213:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
import sys
import time
import datetime
import gspread
from Adafruit_BMP085 import BMP085
# ===========================================================================
# Google Account Details
# ===========================================================================
# Account details for google ... | ajibawa-2023/Python-Code-Large/train/row_78214 | 31 | 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_78214:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 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_78214:Try_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78214:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78214:Try_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78214:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#!/usr/bin/python
import time
from Adafruit_I2C import Adafruit_I2C
# ===========================================================================
# BMP085 Class
# ===========================================================================
class BMP085 :
i2c = None
# Operating Modes
__BMP085_ULTRALOWPOWER ... | ajibawa-2023/Python-Code-Large/train/row_78215 | 211 | 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_78215:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0039, 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_78215:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78215:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78215:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78215:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
from Adafruit_BMP085 import BMP085
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the BMP085 and use STANDARD mode (default value)
# bmp = BMP085(0x77, debug=True... | ajibawa-2023/Python-Code-Large/train/row_78216 | 8 | 35 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78216:ImportFrom_L3_C0", "label": "from Adafruit_BMP085 import BMP085", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.0, 872, 0, 1, 0, 0, 872, 0, 0], "semantic": {"name": "Adafruit_BMP085", "arg_names": [], "imp... | [] |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | ajibawa-2023/Python-Code-Large/train/row_78218 | 93 | 223 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78218:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0807, 0.0045, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78218:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78218:Expr_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78218:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78218:Assign_L66_C2"}, {"f": "ajibawa-2023/Python-Code... |
# aggregate data from multiple datalog files.
# used both for orientation and distance values
#
# Example:
# transform:
# 1,1,0,0,1 #from datalog1
# 1,1,0,0,3 #from datalog2
# into:
# 1,1,0,0,4
# ...
import csv
a = -1
b = -1
c = -1
d = -1
e = -1
sumOfDensities = 0
cr = csv.reader(open("tmp.many.rawdata... | ajibawa-2023/Python-Code-Large/train/row_78219 | 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_78219:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", ... | [] |
# aggregate data from multiple datalog files.
# used both for orientation and distance values
#
# Example:
# transform:
# 1,1,0,0,1 #from datalog1
# 1,1,0,0,3 #from datalog2
# into:
# 1,1,0,0,4
# ...
import csv
import sys
a = -1
b = -1
c = -1
d = -1
e = -1
sumOfDensities = 0
#cr = csv.reader(open("tmp.... | ajibawa-2023/Python-Code-Large/train/row_78220 | 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_78220:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name"... | [] |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78221 | 273 | 401 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78221:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0449, 0.0025, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78221:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78221:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78221:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78221:For_L36_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2010 04 20 - jeanmarc.montanier(at)lri.fr
import glob
import os
import getopt
import re
import commands
import datetime
import sys
from optparse import OptionParser
from shutil import *
usage = "usage %prog [options]"
parser = OptionParser()
parser.add_option("-F","--file",dest="logFile",help=... | ajibawa-2023/Python-Code-Large/train/row_78222 | 81 | 110 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78222:Import_L5_C0", "label": "glob import glob", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0091, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78222:If_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78222:If_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78222:If_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78222:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_782... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78223 | 229 | 346 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78223:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.052, 0.0029, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78223:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78223:If_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78223:If_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78223:Assign_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_782... |
# init pos
print '{'
for y in range(15):
for x in range(15):
for orient in range(4):
print ' {' + str(x*50+50) + ' , ' + str( y*50+50 ) + ' , ' + str(orient*90) + ' } ,'
print ' {-1 , -1 , -1 },'
print '}' | ajibawa-2023/Python-Code-Large/train/row_78224 | 7 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78224:Expr_L4_C0", "label": "print()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.4, 0.1, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78224:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78224:For_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78224:For_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78224:For_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78224:F... |
# 2009 02 23 - niko(at)lri.fr
# History:
# started from my own "depouille" script (2008 01 09 -- updated 2008 11 for CEC)
#
# Syntax: simply execute the script without any command line parameters
#
# From results provided on on-line evolution with Cortex board, display global statistics
#
# assumes that:
# - all file... | ajibawa-2023/Python-Code-Large/train/row_78225 | 76 | 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_78225:Import_L22_C0", "label": "glob import glob", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1209, 0.0055, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78225:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78225:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78225:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78225:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78226 | 302 | 425 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78226:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0024, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78226:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78226:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78226:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78226:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78227 | 174 | 303 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78227:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0594, 0.0033, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78227:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78227:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78227:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78227:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78228 | 262 | 386 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78228:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0466, 0.0026, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78228:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78228:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78228:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78228:For_L36_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78229 | 213 | 346 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78229:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.052, 0.0029, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78229:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78229:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78229:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78229:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78230 | 178 | 300 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78230:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.0033, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78230:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78230:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78230:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78230:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78231 | 184 | 309 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78231:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0583, 0.0032, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78231:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78231:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78231:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78231:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78232 | 193 | 317 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78232:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0568, 0.0032, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78232:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78232:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78232:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78232:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78233 | 184 | 310 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78233:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0581, 0.0032, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78233:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78233:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78233:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78233:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78234 | 96 | 149 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78234:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1208, 0.0067, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78234:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78234:Assign_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78234:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78234:For_L35_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# 2009 02 23 - niko(at)lri.fr
# 2009 07 20 - jeanmarc.montanier(at)lri.fr
# History:
# Started from the basic log analyse script of nicolas bredeche
#
# Syntax :
# To know it type 'sortBest -h'
#
# Hint :
# All files with the ".dat" ending will be taken into account
# Don't use the .dat extension ... | ajibawa-2023/Python-Code-Large/train/row_78235 | 473 | 692 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78235:Import_L18_C0", "label": "glob import glob", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.026, 0.0014, 0, 0.66, 0.0, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78235:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78235:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78235:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78235:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-... |
# This script has been tested with python 2.7.
# The Python Imaging Library (PIL) is used: http://www.pythonware.com/products/pil/
#
# Written for development on the Mikromedia board for PIC24.
#
#
# Input:
# An image file of type supported by your installation of PIL, in RGB format.
#
#
#
# Output:
# An image file in... | ajibawa-2023/Python-Code-Large/train/row_78237 | 112 | 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_78237:Import_L30_C0", "label": "os import os, tkFileDialog, pickle", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1531, 0.0051, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78237:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78237:FunctionDef_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78237:FunctionDef_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78237:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Co... |
# Use this script to create a self-contained package for the header generator.
# The result is a program that can run without installing python or anything
# else. Running this setup script requires python 2.7, the Python Imaging
# Library (PIL), and cx_Freeze.
#
# How to use:
# PLATFORM ---- COMMAND
# Windows... | ajibawa-2023/Python-Code-Large/train/row_78238 | 5 | 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_78238:Import_L13_C0", "label": "sys import sys", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.4194, 0.0323, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [] |
# MikroPictures Image Convertor
# Author: Matt Olson
# This script has been tested with python 2.6 and 2.7.
# The Python Imaging Library (PIL) is used: http://www.pythonware.com/products/pil/
#
# Converts image files into C source files to be loaded into program memory.
# Written for development on the Mikromedia board... | ajibawa-2023/Python-Code-Large/train/row_78239 | 81 | 137 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78239:Import_L21_C0", "label": "os import os, tkFileDialog, pickle", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1533, 0.0073, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78239:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78239:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78239:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78239:Expr_L27_C2"}, {"f": "ajibawa-2023/Python-Co... |
import os
ENVIRONMENT = "unknown"
try:
if os.environ["SERVER_SOFTWARE"].lower().startswith("dev"):
ENVIRONMENT = "local"
elif os.environ["SERVER_SOFTWARE"].lower().startswith("google apphosting"):
ENVIRONMENT = "hosted"
except:
pass
DEBUG = (ENVIRONMENT == "local")
DEBUG = True... | ajibawa-2023/Python-Code-Large/train/row_78240 | 54 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78240:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0089, 0.0089, 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_78240:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78240:If_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78240:If_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78240:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78240:... |
"""
Models for Theta-Chi sample application.
We are striving to ultimately be able to generate an application like this sample
purely by interpreting the application description language.
Committee
Brother
Position
Duty
Task
Term (just use a string)
"""
from google.appengine.ext import db
import log... | ajibawa-2023/Python-Code-Large/train/row_78241 | 31 | 59 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78241:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 14], "level": 0, "parent": null, "vector": [8, 0, 0.1271, 0.2373, 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_78241:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78241:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78241:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78241:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from google.appengine.ext import db
from datetime import datetime, timedelta
import logging
import math
import reqfilter
import mixins
import calc
hrsDay = 24
hrsWeek = 7*hrsDay
hrsYear = 365*hrsDay+6
hrsMonth = hrsYear/12
# Scores are based on hours since 1/1/2000
dtBase = datetime(2000,1,1)
def... | ajibawa-2023/Python-Code-Large/train/row_78243 | 77 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78243:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0058, 0.0058, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78243:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78243:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78243:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78243:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import calc
import logging
import sys
import unittest
class TestTimeScore(unittest.TestCase):
def test_base(self):
sc = calc.Score()
self.assertEqual(sc.score, 1.0)
self.assertEqual(sc.log_score, 0.0)
self.assertEqual(sc.time_last, 0)
sc.increment(0)
se... | ajibawa-2023/Python-Code-Large/train/row_78244 | 71 | 86 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78244:Import_L1_C0", "label": "calc import calc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 553, 0, 1, 0, 0, 553, 0, 0], "semantic": {"name": "calc", "arg_names": [], "import_names": ["calc"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78244:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78244:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78244:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78244:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from datetime import datetime
import math
import logging
class Score():
"""
Base functions for calculating half-life values from a stream of scoring events.
Time units are abstract and zero-based. The default half-life is 1 time unit.
The Net score is valid at a particular time, ti... | ajibawa-2023/Python-Code-Large/train/row_78245 | 73 | 143 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78245:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.007, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78245:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78245:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78245:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78245:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from models import *
from calc import *
| ajibawa-2023/Python-Code-Large/train/row_78246 | 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_78246:ImportFrom_L1_C0", "label": "from models import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 495, 0, 1, 0, 0, 495, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": ["*"], "rhs_call_... | [] |
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.1')
import sys
import logging
import google.appengine.ext.webapp.util
import django.core.handlers.wsgi
import django.conf
# Force Django to reload its settings. TODO - reall... | ajibawa-2023/Python-Code-Large/train/row_78247 | 27 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78247:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 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_78247:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78247:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78247:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78247:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code... |
import logging
import sys
import os
import random
import unittest
import StringIO
from django.http import HttpResponse
from google.appengine.ext import db
import settings
import reqfilter
import mixins
import models
import reqfilter
import timescore
def assert_classes(test_case, instance, classes):
... | ajibawa-2023/Python-Code-Large/train/row_78248 | 147 | 212 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78248:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0047, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78248:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78248:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78248:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78248:For_L20_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
import reqfilter
import jscomposer
import views
urlpatterns = []
urlpatterns.extend(reqfilter.json_urls())
urlpatterns.extend(patterns('',
(r'^$', direct_to_template, {'template':'home.html'}),
... | ajibawa-2023/Python-Code-Large/train/row_78249 | 8 | 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_78249:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n... | [] |
"""
Implementation of JSONDecoder
"""
import re
import sys
from simplejson.scanner import Scanner, pattern
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
pass
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES... | ajibawa-2023/Python-Code-Large/train/row_78251 | 177 | 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_78251:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0058, 0.0087, 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_78251:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78251:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78251:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78251:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
Iterator based sre token scanner
"""
import re
from re import VERBOSE, MULTILINE, DOTALL
import sre_parse
import sre_compile
import sre_constants
from sre_constants import BRANCH, SUBPATTERN
__all__ = ['Scanner', 'pattern']
FLAGS = (VERBOSE | MULTILINE | DOTALL)
class Scanner(object):
def __init__(self, lexi... | ajibawa-2023/Python-Code-Large/train/row_78252 | 49 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78252:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0448, 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_78252:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78252:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78252:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78252:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-... |
import unittest
import doctest
def additional_tests():
import simplejson
import simplejson.encoder
import simplejson.decoder
suite = unittest.TestSuite()
for mod in (simplejson, simplejson.encoder, simplejson.decoder):
suite.addTest(doctest.DocTestSuite(mod))
return suite
def main():
... | ajibawa-2023/Python-Code-Large/train/row_78253 | 19 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78253:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 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_78253:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78253:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78253:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78253:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
pass
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t<]')
ESCAPE_ASCII = re.compile(r'([\\"<]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT ... | ajibawa-2023/Python-Code-Large/train/row_78254 | 205 | 390 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78254:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0051, 0.0077, 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_78254:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78254:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78254:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78254:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
"""
jscomposer - Manage JavaScript includes and composing multiple files into one.
by Mike Koss, June 2009 - released into the public domain.
Features:
- Generates <script> includes with version stamps to avoid cache conflicts.
- You can define aliases for multiple javascript files to... | ajibawa-2023/Python-Code-Large/train/row_78256 | 60 | 176 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78256:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 72], "level": 0, "parent": null, "vector": [8, 0, 0.2074, 0.4091, 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_78256:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78256:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78256:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78256:Return_L91_C4"}, {"f": "ajibawa-2023/Python-Code... |
from jscomposer import GetContext, ScriptFile, ScriptPattern | ajibawa-2023/Python-Code-Large/train/row_78257 | 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_78257:ImportFrom_L1_C0", "label": "from jscomposer import GetContext, ScriptFile, ScriptPattern", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 738, 0, 3, 0, 0, 738, 0, 0], "semantic": {"name": "jscomposer", "arg_n... | [] |
#!/usr/bin/python
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-05-22
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted,... | ajibawa-2023/Python-Code-Large/train/row_78258 | 125 | 218 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78258:ImportFrom_L33_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1514, 0.0046, 0, 0.66, 0.0, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78258:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78258:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78258:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78258:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseForbidden
from django import shortcuts
from google.appengine.ext import db
import logging
import random
import cgi
import simplejson
import util
import reqfilter
import models
def... | ajibawa-2023/Python-Code-Large/train/row_78259 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78259:ImportFrom_L2_C0", "label": "from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0588, 0, 0.66, 0.0, 779, 0, 5, 0, 0, 779, 0, 0], "semantic... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78259:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78259:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78259:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78259:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code... |
from google.appengine.ext import db
from google.appengine.api import memcache
import util
class Globals(db.Model):
"""
Global application variables (stored in the database)
Each model can store an incrementable integer or string.
TODO: Use memcache and sharded counters for performance
... | ajibawa-2023/Python-Code-Large/train/row_78260 | 29 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78260:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78260:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78260:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78260:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78260:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import loader, RequestContext
from django.shortcuts import render_to_response
from django.conf.urls.defaults import patterns
from django.utils.cache import patch_response_headers
from django.utils.http import http_date
from... | ajibawa-2023/Python-Code-Large/train/row_78261 | 275 | 441 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78261:ImportFrom_L1_C0", "label": "from django.http import HttpResponse, HttpResponseRedirect, Http404", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 779, 0, 3, 0, 0, 779, 0, 0], "semantic": {"name": "django... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78261:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78261:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78261:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78261:If_L43_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from filter import Error, HttpJSON, HttpRSS, HasRSS, \
RaiseNotFound, RaiseNYI, AddToResponse, \
JavaScriptEncoder, get_request, RenderResponse, GetContext, json_urls, ReqFilter, \
admin_only
| ajibawa-2023/Python-Code-Large/train/row_78262 | 1 | 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_78262:ImportFrom_L1_C0", "label": "from filter import Error, HttpJSON, HttpRSS\u2026", "type": "import", "loc": [1, 4], "level": 0, "parent": null, "vector": [1, 0, 0.625, 1.0, 0, 0.66, 0.0, 526, 0, 14, 0, 0, 526, 0, 0], "semantic": {"name": "filter", "arg_names": [], "... | [] |
"""
Kahnsept Schema - a simple language for specifying network data models
TODO:
- There is an argument that all properties should be "owned" - to be just like
scalar properties (we don't expect to independently edit a string, and have
all entities that use the old string value to be changed).
But how... | ajibawa-2023/Python-Code-Large/train/row_78263 | 1 | 317 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78263:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 317], "level": 0, "parent": null, "vector": [8, 0, 0.5016, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [] |
import UserDict
class DynDict(UserDict.DictMixin):
"""
Implement a dynamic dictionary object, which acts as the union of the dictionaries
from which it was created.
The first dictionary is searched first, and subsequent dictionaries are searched when no results are found.
New ele... | ajibawa-2023/Python-Code-Large/train/row_78264 | 23 | 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_78264:Import_L1_C0", "label": "UserDict import UserDict", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 351, 0, 1, 0, 0, 351, 0, 0], "semantic": {"name": "UserDict", "arg_names": [], "import_names": ["UserDic... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78264:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78264:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78264:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78264:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from kahnsept import *
from parse_date import *
import unittest
import datetime
class TestDateParse(unittest.TestCase):
def test_dates(self):
for test in ['01/01/09', '1/1/09', '1/1/2009', 'Jan 1, 09', 'Jan 1, 2009', 'January 1, 2009',
'2009-01-01', '1.1.09']:
dt... | ajibawa-2023/Python-Code-Large/train/row_78267 | 268 | 352 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78267:ImportFrom_L1_C0", "label": "from kahnsept import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 0, 0.66, 0.0, 44, 0, 1, 0, 0, 44, 0, 0], "semantic": {"name": "kahnsept", "arg_names": [], "import_names": ["*"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78267:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78267:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78267:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78267:For_L9_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'_speedups.pyd')
del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| ajibawa-2023/Python-Code-Large/train/row_78269 | 5 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78269:FunctionDef_L1_C0", "label": "__bootstrap__", "type": "function", "loc": [1, 6], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.8571, 0, 0.66, 0.0, 239, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__bootstrap__", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78269:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78269:Import_L3_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78269:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78269:Assign_L4_C3"}, {"f": "ajibawa-2023/Python-Code-L... |
"""JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | ajibawa-2023/Python-Code-Large/train/row_78271 | 48 | 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_78271:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0231, 0.0308, 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_78271:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78271:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78271:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78271:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import unittest
import doctest
def additional_tests():
import simplejson
import simplejson.encoder
import simplejson.decoder
suite = unittest.TestSuite()
for mod in (simplejson, simplejson.encoder, simplejson.decoder):
suite.addTest(doctest.DocTestSuite(mod))
suite.addTest(doctest.DocFi... | ajibawa-2023/Python-Code-Large/train/row_78272 | 20 | 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_78272:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 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_78272:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78272:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78272:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78272:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | ajibawa-2023/Python-Code-Large/train/row_78273 | 275 | 503 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78273:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.003, 0.004, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78273:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78273:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78273:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78273:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | ajibawa-2023/Python-Code-Large/train/row_78274 | 42 | 319 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78274:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 99], "level": 0, "parent": null, "vector": [8, 0, 0.1567, 0.3103, 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_78274:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78274:Expr_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78274:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78274:If_L167_C4"}, {"f": "ajibawa-2023/Python-Code... |
class Cell:
def __init__(self, xy):
self.xy = xy
self.csums = []
self.digits = [1,2,3,4,5,6,7,8,9]
class CSum:
stDirName = ["Col", "Row"]
def __init__(self, sum, xy, fRow):
self.cells = []
self.sum = sum
self.xy = xy
self.fRow = fRow
... | ajibawa-2023/Python-Code-Large/train/row_78279 | 48 | 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_78279:ClassDef_L1_C0", "label": "Cell", "type": "class", "loc": [1, 5], "level": 0, "parent": null, "vector": [3, 0, 0.0476, 0.0794, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "Cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78279:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78279:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78279:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78279:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
import sys, Tkinter as TK
root = TK.Tk()
tv = TK.StringVar()
frm = TK.Frame(root, bg="red",
width=500, height=500, padx=10, pady=10).pack()
TK.Label(frm, textvariable=tv).pack()
TK.Entry(frm, textvariable=tv).pack()
tv.set("Welcome!")
TK.Button(frm, text="Exit", command=root.quit).pack()
TK.main... | ajibawa-2023/Python-Code-Large/train/row_78280 | 10 | 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_78280:Import_L1_C0", "label": "sys import sys, TK", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "TK"], "rhs_... | [] |
"""
Huffman coding utilities.
- Tree building
- Encoding/decoding strings
Designed to allow for variable-cost and more than binary output symbols.
(c) 2010 Mike Koss
"""
import heapq
def same_weight_chars(sSyms):
return zip(list(sSyms), (1,) * len(sSyms))
""" Output sym... | ajibawa-2023/Python-Code-Large/train/row_78281 | 52 | 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_78281:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0573, 0.1042, 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_78281:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78281:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78281:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78281:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code... |
class Flipper():
'''
Flip game. Computer tries to set all bits to zero. Opponent tries to
keep him from doing that. On each move, the cursor moves to the next bit
(circular queue), and offers "1" bit moves to the computer and "0" bit
moves to the player. Each can either "Ignore" or "Flip" t... | ajibawa-2023/Python-Code-Large/train/row_78282 | 83 | 132 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78282:ClassDef_L1_C0", "label": "Flipper", "type": "class", "loc": [1, 94], "level": 0, "parent": null, "vector": [3, 0, 0.3598, 0.7121, 0, 0.66, 0.0, 713, 0, 7, 0, 0, 0, 0, 16], "semantic": {"name": "Flipper", "arg_names": [], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78282:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78282:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78282:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78282:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
import os
import re
import sys
import time
import subprocess
from optparse import OptionParser
def main():
parser = OptionParser(
usage="%prog [options]")
parser.add_option('-v', '--verbose', action='store_true',
help="run all checks with more output")
(options, args... | ajibawa-2023/Python-Code-Large/train/row_78283 | 13 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78283:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0476, 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_78283:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78283:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78283:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78283:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code... |
import cProfile
import pstats
import BaseHTTPServer
import SimpleHTTPServer
counter = 0
#handler = SimpleHTTPServer.SimpleHTTPRequestHandler;
class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_HEAD(self):
self.send_response(200)
self.send_header("Content-type", "text/plain... | ajibawa-2023/Python-Code-Large/train/row_78284 | 30 | 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_78284:Import_L1_C0", "label": "cProfile import cProfile", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 686, 0, 1, 0, 0, 686, 0, 0], "semantic": {"name": "cProfile", "arg_names": [], "import_names": ["cProfil... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78284:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78284:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78284:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78284:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod... |
sChars64 = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
class StringKey(object):
def __init__(self, sChars=sChars64, ratio=0.5):
self.aChars = [ch for ch in sChars]
self.aChars.sort()
self.base = len(self.aChars)
self.ratio = ratio
self.iMid = i... | ajibawa-2023/Python-Code-Large/train/row_78285 | 75 | 122 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78285:Assign_L1_C0", "label": "sChars64 =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0082, 0.0082, 0, 0.66, 0.0, 459, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sChars64", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78285:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78285:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78285:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78285:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code... |
"""
new_morse.py - exploring the efficiency of mores code and alternative encodings.
"""
import operator
aMorse = ['.-', '-...', '-.-.', '-..', '.', # A-E
'..-.', '--.', '....', '..', '.---', # F-J
'-.-', '..-.', '--', '-.', '---', # K-O
'.--.... | ajibawa-2023/Python-Code-Large/train/row_78287 | 45 | 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_78287:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.026, 0.039, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78287:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78287:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78287:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78287:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Co... |
import unittest
class RateLimit(object):
"""
Rate accumulator - using exponential decay over time.
At any time, we can query the "current value" of a rate of values, and test if it has exceeded
a specified threshold. In the absence of updated values, the value of the level will
drop by half e... | ajibawa-2023/Python-Code-Large/train/row_78290 | 52 | 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_78290:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 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_78290:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78290:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78290:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78290:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
class Foo(object):
def f(self):
print "Foo"
class Bar(object):
def f(self):
print "Bar"
super(Bar, self).f()
class Bazz(Bar, Foo):
def f(self):
print "Bazz"
super(Bazz, self).f()
x = Bazz()
x.f()
| ajibawa-2023/Python-Code-Large/train/row_78291 | 13 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78291:ClassDef_L1_C0", "label": "Foo", "type": "class", "loc": [1, 3], "level": 0, "parent": null, "vector": [3, 0, 0.1176, 0.1765, 0, 0.66, 0.0, 567, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "Foo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78291:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78291:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78291:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78291:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from google.appengine.ext import db
from datetime import datetime, timedelta
import logging
import math
import reqfilter
import mixins
import calc
hrsDay = 24
hrsWeek = 7*hrsDay
hrsYear = 365*hrsDay+6
hrsMonth = hrsYear/12
# Scores are based on hours since 1/1/2000
dtBase = datetime(2000,1,1)
def scorable(half_liv... | ajibawa-2023/Python-Code-Large/train/row_78293 | 77 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78293:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0058, 0.0058, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78293:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78293:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78293:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78293:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import calc
import logging
import sys
import unittest
class TestTimeScore(unittest.TestCase):
def test_base(self):
sc = calc.Score()
self.assertEqual(sc.score, 1.0)
self.assertEqual(sc.log_score, 0.0)
self.assertEqual(sc.time_last, 0)
sc.increment(0)
self.assertEqua... | ajibawa-2023/Python-Code-Large/train/row_78294 | 71 | 86 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78294:Import_L1_C0", "label": "calc import calc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 553, 0, 1, 0, 0, 553, 0, 0], "semantic": {"name": "calc", "arg_names": [], "import_names": ["calc"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78294:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78294:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78294:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78294:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from datetime import datetime
import math
import logging
class Score():
"""
Base functions for calculating half-life values from a stream of scoring events.
Time units are abstract and zero-based. The default half-life is 1 time unit.
The Net score is valid at a particular time, time_last. ... | ajibawa-2023/Python-Code-Large/train/row_78295 | 73 | 143 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78295:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.007, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78295:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78295:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78295:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78295:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from models import *
from calc import *
| ajibawa-2023/Python-Code-Large/train/row_78296 | 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_78296:ImportFrom_L1_C0", "label": "from models import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 495, 0, 1, 0, 0, 495, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": ["*"], "rhs_call_... | [] |
"""
Implementation of JSONDecoder
"""
import re
import sys
from simplejson.scanner import Scanner, pattern
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
pass
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES... | ajibawa-2023/Python-Code-Large/train/row_78298 | 177 | 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_78298:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0058, 0.0087, 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_78298:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78298:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78298:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78298:Import_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
Iterator based sre token scanner
"""
import re
from re import VERBOSE, MULTILINE, DOTALL
import sre_parse
import sre_compile
import sre_constants
from sre_constants import BRANCH, SUBPATTERN
__all__ = ['Scanner', 'pattern']
FLAGS = (VERBOSE | MULTILINE | DOTALL)
class Scanner(object):
def __init__(self, lexi... | ajibawa-2023/Python-Code-Large/train/row_78299 | 49 | 67 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78299:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0448, 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_78299:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78299:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78299:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78299:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-... |
import unittest
import doctest
def additional_tests():
import simplejson
import simplejson.encoder
import simplejson.decoder
suite = unittest.TestSuite()
for mod in (simplejson, simplejson.encoder, simplejson.decoder):
suite.addTest(doctest.DocTestSuite(mod))
return suite
def main():
... | ajibawa-2023/Python-Code-Large/train/row_78300 | 19 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78300:Import_L1_C0", "label": "unittest import unittest", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 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_78300:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78300:Import_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78300:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78300:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
pass
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t<]')
ESCAPE_ASCII = re.compile(r'([\\"<]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT ... | ajibawa-2023/Python-Code-Large/train/row_78301 | 205 | 390 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78301:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0051, 0.0077, 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_78301:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78301:ImportFrom_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78301:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78301:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from jscomposer import GetContext, ScriptFile, ScriptPattern | ajibawa-2023/Python-Code-Large/train/row_78304 | 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_78304:ImportFrom_L1_C0", "label": "from jscomposer import GetContext, ScriptFile, ScriptPattern", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 738, 0, 3, 0, 0, 738, 0, 0], "semantic": {"name": "jscomposer", "arg_n... | [] |
#!/usr/bin/python
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-05-22
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted, free of ch... | ajibawa-2023/Python-Code-Large/train/row_78305 | 125 | 218 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78305:ImportFrom_L33_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1514, 0.0046, 0, 0.66, 0.0, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78305:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78305:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78305:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78305:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Co... |
from google.appengine.ext import db
from google.appengine.api import memcache
import util
class Globals(db.Model):
"""
Global application variables (stored in the database)
Each model can store an incrementable integer or string.
TODO: Use memcache and sharded counters for performance
"""
... | ajibawa-2023/Python-Code-Large/train/row_78306 | 29 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78306:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78306:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78306:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78306:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78306:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import loader, RequestContext
from django.shortcuts import render_to_response
from django.conf.urls.defaults import patterns
from django.utils.cache import patch_response_headers
from django.utils.http import http_date
from google... | ajibawa-2023/Python-Code-Large/train/row_78307 | 277 | 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_78307:ImportFrom_L1_C0", "label": "from django.http import HttpResponse, HttpResponseRedirect, Http404", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0022, 0.0022, 0, 0.66, 0.0, 779, 0, 3, 0, 0, 779, 0, 0], "semantic": {"name": "django... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78307:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78307:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78307:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78307:If_L43_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from filter import Error, HttpJSON, HttpRSS, HasRSS, \
RaiseNotFound, RaiseNYI, AddToResponse, \
JavaScriptEncoder, get_request, RenderResponse, GetContext, json_urls, ReqFilter, \
admin_only
| ajibawa-2023/Python-Code-Large/train/row_78308 | 1 | 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_78308:ImportFrom_L1_C0", "label": "from filter import Error, HttpJSON, HttpRSS\u2026", "type": "import", "loc": [1, 4], "level": 0, "parent": null, "vector": [1, 0, 0.625, 1.0, 0, 0.66, 0.0, 526, 0, 14, 0, 0, 526, 0, 0], "semantic": {"name": "filter", "arg_names": [], "... | [] |
import sys
import random
sAlpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sAlphaLower = sAlpha.lower()
class CryptoSolver():
""" Solve crytpogram puzzles.
Class variables:
aWordList - list of words from our dictionary
maWordList - dictionary of lists of words of different lengths
msCandida... | ajibawa-2023/Python-Code-Large/train/row_78312 | 71 | 103 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78312:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 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_78312:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78312:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78312:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78312:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
import sys
import random
sAlpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
minDict = 3
def Canonical(s):
s = s.strip().upper()
a = [ch for ch in s]
a.sort()
return ''.join(a)
class WordHist():
def __init__(self, s):
self.mch = {}
for ch in s:
self.mch[ch] = self.... | ajibawa-2023/Python-Code-Large/train/row_78314 | 118 | 160 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78314:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0063, 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_78314:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78314:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78314:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78314:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
import math
import sys
DEBUG = False
class LetterSquare():
""" Place a word into the cells of a square grid such that
you can trace the letters of the word by visiting adjacent
squares. Inspired by puzzazz.com puzzles.
"""
def __init__(self, word):
self.word = word.upper()
... | ajibawa-2023/Python-Code-Large/train/row_78315 | 125 | 190 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78315:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0053, 0.0053, 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_78315:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78315:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78315:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78315:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#test change
# Django settings for jp project.
#DEBUG = False
DEBUG = True
#TEMPLATE_DEBUG = DEBUG
TEMPLATE_DEBUG = False
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
#'''
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'pos... | ajibawa-2023/Python-Code-Large/train/row_78316 | 20 | 116 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78316:Assign_L5_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0431, 0.0086, 0, 0.66, 0.0, 309, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
from django.db import models
from django.contrib import admin
from django.contrib.auth.models import User
from django import forms
# Create your models here.
class Person(models.Model):
Name = models.CharField(max_length=120)
Address = models.TextField(max_length=500)
City = models.CharField(max_length=50... | ajibawa-2023/Python-Code-Large/train/row_78317 | 22 | 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_78317:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["mo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78317:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78317:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78317:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78317:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... | ajibawa-2023/Python-Code-Large/train/row_78318 | 7 | 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_78318:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1522, 0.2609, 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_78318:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78318:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78318:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78318:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: utf-8 -*-
# Create your views here.
from django.db.models import Q
from django.shortcuts import render_to_response, redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.core.context_processors import csrf
from sms.mailinglist.models import *
from ... | ajibawa-2023/Python-Code-Large/train/row_78319 | 50 | 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_78319:ImportFrom_L4_C0", "label": "from django.db.models import Q", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0156, 0, 0.66, 0.0, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78319:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78319:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78319:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78319:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Co... |
from sms.mailinglist.models import *
from django.contrib.auth.models import User
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
class PersonAdmin(admin.ModelAdmin):
list_display = ('Name', 'Address', 'City', 'Taluka', 'District', 'PinCode', 'Phone')
ordering = ('Name',... | ajibawa-2023/Python-Code-Large/train/row_78320 | 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_78320:ImportFrom_L1_C0", "label": "from sms.mailinglist.models import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 77, 0, 1, 0, 0, 77, 0, 0], "semantic": {"name": "sms.mailinglist.models", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78320:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78320:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78320:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78320:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.