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 |
|---|---|---|---|---|---|---|---|
# package aksy
import logging, logging.config, logging.handlers, time, os.path, sys
from aksy.config import get_config
# initialize logging
logger = logging.getLogger('aksy')
level = getattr(logging, get_config().get('logging', 'level'))
logger.setLevel(level)
logdir = os.path.expanduser('~/.aksy/logs')
if not os.p... | ajibawa-2023/Python-Code-Large/train/row_78544 | 13 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78544:Import_L2_C0", "label": "logging import logging, logging.config, logging.handlers\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.05, 0, 0.66, 0.0, 715, 0, 6, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78544:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78544:Expr_L13_C4"}] |
import re
RE_MULTI = re.compile("\.akm$", re.IGNORECASE)
RE_PROGRAM = re.compile("\.(akp|pgm)$", re.IGNORECASE)
RE_SAMPLE = re.compile("\.(wav|aiff?)$", re.IGNORECASE)
RE_SONG = re.compile("\.mid$", re.IGNORECASE)
# the entire printable ascii range
RE_WORD = re.compile("[ -~]+$", re.IGNORECASE)
RE_FILE = re.compile("\... | ajibawa-2023/Python-Code-Large/train/row_78545 | 26 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78545:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78545:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78545:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78545:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78545:If_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from optparse import OptionParser
def create_option_parser():
usage = "%prog"
parser = OptionParser(usage=usage)
parser.add_option("-p", type="int", dest="port",
help="Port number", default=6575)
parser.add_option("-a", dest="address",
help="Local address to bind/connect to", def... | ajibawa-2023/Python-Code-Large/train/row_78548 | 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_78548:ImportFrom_L1_C0", "label": "from optparse import OptionParser", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78548:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78548:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78548:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78548:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
import asyncore, socket, time
from aksyosc.handler import SamplerCallbackManager
from aksyosc.oscoptions import create_option_parser
class Envelope:
def __init__(self, address, message):
self.address = address
self.message = message
def get_message(self):
return self.... | ajibawa-2023/Python-Code-Large/train/row_78549 | 40 | 51 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78549:Import_L2_C0", "label": "asyncore import asyncore, socket, time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0196, 0, 0.66, 0.0, 563, 0, 3, 0, 0, 563, 0, 0], "semantic": {"name": "asyncore", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78549:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78549:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78549:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78549:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from aksyosc.osc import OSCMessage, decodeOSC
import socket, logging
LOG = logging.getLogger("aksy.osc.connector")
class OSCConnector:
""" Execute commands using OSC
"""
def __init__(self, host, port, timeout=10.0):
socket.setdefaulttimeout(timeout)
self.host = host
self.port = po... | ajibawa-2023/Python-Code-Large/train/row_78550 | 57 | 82 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78550:ImportFrom_L1_C0", "label": "from aksyosc.osc import OSCMessage, decodeOSC", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0122, 0, 0.66, 0.0, 290, 0, 2, 0, 0, 290, 0, 0], "semantic": {"name": "aksyosc.osc", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78550:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78550:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78550:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78550:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# package
| ajibawa-2023/Python-Code-Large/train/row_78552 | 0 | 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"] | [] | [] |
# inspired by the frequent offers of great sounds by Steve of Hollow Sun, this
# script will allow you to download, unpack and audition a new addition in no time!
# usage: checkout.py <url to zip file>
# checkout.py <file path>
import sys, urllib, zipfile, os, os.path
from aksy.device import Devices
def check... | ajibawa-2023/Python-Code-Large/train/row_78553 | 37 | 57 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78553:Import_L7_C0", "label": "sys import sys, urllib, zipfile\u2026", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1228, 0.0175, 0, 0.66, 0.0, 509, 0, 5, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78553:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78553:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78553:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78553:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
import os
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates'),
) | ajibawa-2023/Python-Code-Large/train/row_78554 | 4 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78554:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [] |
import urllib
from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import os
from google.appengine.ext.webapp import template
class Greeting(db.Model):
"""Models an individual Guestbook entry w... | ajibawa-2023/Python-Code-Large/train/row_78555 | 42 | 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_78555:Import_L1_C0", "label": "urllib import urllib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.013, 0, 0.66, 0.0, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78555:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78555:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78555:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78555:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import csv, codecs
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
def __iter__(self):
return self
def next(self): #@ReservedAssignment
return... | ajibawa-2023/Python-Code-Large/train/row_78556 | 19 | 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_78556:Import_L1_C0", "label": "csv import csv, codecs", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 312, 0, 2, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv", "codecs"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78556:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78556:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78556:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78556:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
import os
class MvcTemplateLoader(BaseLoader):
"A custom template loader for the MVCEngine framework."
is_usable = True
__view_paths = Non... | ajibawa-2023/Python-Code-Large/train/row_78557 | 37 | 68 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78557:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78557:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78557:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78557:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78557:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def lower(value):
return value.lower() | ajibawa-2023/Python-Code-Large/train/row_78558 | 5 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78558:ImportFrom_L1_C0", "label": "from django import template", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["te... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78558:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78558:Return_L9_C4"}] |
from app.models.artist import Artist
from google.appengine.ext import db
class Song(db.Model):
"""Models a Song."""
artist = db.ReferenceProperty(Artist)
name = db.StringProperty()
song = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)
author = db.UserProperty()
... | ajibawa-2023/Python-Code-Large/train/row_78559 | 11 | 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_78559:ImportFrom_L1_C0", "label": "from app.models.artist import Artist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 902, 0, 1, 0, 0, 902, 0, 0], "semantic": {"name": "app.models.artist", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78559:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78559:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78559:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78559:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from google.appengine.ext import db
class Artist(db.Model):
"""Models an Artist."""
code = db.IntegerProperty()
name = db.StringProperty()
description = db.TextProperty()
image = db.StringProperty()
date = db.DateTimeProperty(auto_now_add=True)
@staticmethod
def get_by_code(artist_... | ajibawa-2023/Python-Code-Large/train/row_78560 | 10 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78560:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 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_78560:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78560:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78560:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78560:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from app.models.song import Song
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
import logging
import os
class AddSongPage(webapp.RequestHandler):
def get(self, *args):
loginUrl = users.create_login_url(self.request.uri)
... | ajibawa-2023/Python-Code-Large/train/row_78561 | 27 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78561:ImportFrom_L1_C0", "label": "from app.models.song import Song", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 929, 0, 1, 0, 0, 929, 0, 0], "semantic": {"name": "app.models.song", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78561:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78561:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78561:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78561:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
from app.models.song import Song
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
import os
class AllSongsPage(webapp.RequestHandler):
def get(self):
songs = Song.all()
template_values = {
'songs': songs,
}
path = os.path.... | ajibawa-2023/Python-Code-Large/train/row_78562 | 10 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78562:ImportFrom_L1_C0", "label": "from app.models.song import Song", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 929, 0, 1, 0, 0, 929, 0, 0], "semantic": {"name": "app.models.song", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78562:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78562:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78562:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78562:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from app.models.song import Song
from google.appengine.ext import webapp
import os
from google.appengine.ext.webapp import template
class SongPage(webapp.RequestHandler):
def get(self, bandname, songname):
songs = Song.all()
if ''.join([bandname, songname]).count("/") > 0... | ajibawa-2023/Python-Code-Large/train/row_78563 | 13 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78563:ImportFrom_L1_C0", "label": "from app.models.song import Song", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 929, 0, 1, 0, 0, 929, 0, 0], "semantic": {"name": "app.models.song", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78563:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78563:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78563:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78563:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from google.appengine.ext import webapp
import os
import logging
from google.appengine.ext.webapp import template
class ErrorPage(webapp.RequestHandler):
def get(self):
logging.error("url" + self.request.remote_addr + "invoked");
path = os.path.join(os.path.dirname(__file__), '../views/erro... | ajibawa-2023/Python-Code-Large/train/row_78564 | 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_78564:ImportFrom_L1_C0", "label": "from google.appengine.ext import webapp", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 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_78564:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78564:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78564:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78564:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from app.helpers.csv_import import UnicodeReader
from app.models.artist import Artist
from app.models.song import Song
from google.appengine.ext import webapp
import datetime
import logging
class ImportDataPage(webapp.RequestHandler):
def get(self, *args):
reader = UnicodeReader(open("/home/marjan/workspa... | ajibawa-2023/Python-Code-Large/train/row_78565 | 34 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78565:ImportFrom_L1_C0", "label": "from app.helpers.csv_import import UnicodeReader", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 613, 0, 1, 0, 0, 613, 0, 0], "semantic": {"name": "app.helpers.csv_import", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78565:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78565:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78565:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78565:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
from app.models.artist import Artist
from google.appengine.ext import webapp
import os
from google.appengine.ext.webapp import template
class AllArtistsPage(webapp.RequestHandler):
def get(self):
artists = Artist.all()
template_values = {
'artists': artists,
}
p... | ajibawa-2023/Python-Code-Large/train/row_78566 | 10 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78566:ImportFrom_L1_C0", "label": "from app.models.artist import Artist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 902, 0, 1, 0, 0, 902, 0, 0], "semantic": {"name": "app.models.artist", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78566:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78566:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78566:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78566:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from app.models.artist import Artist
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
import os
import logging
class ArtistPage(webapp.RequestHandler):
def get(self, artist_code, *args):
artist = Artist.get_by_code(int(artist_code))
template_values = {
... | ajibawa-2023/Python-Code-Large/train/row_78567 | 11 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78567:ImportFrom_L1_C0", "label": "from app.models.artist import Artist", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 902, 0, 1, 0, 0, 902, 0, 0], "semantic": {"name": "app.models.artist", "arg_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78567:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78567:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78567:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78567:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from app.controllers.artist.all_artist_controller import AllArtistsPage
from app.controllers.artist.artist_controller import ArtistPage
from app.controllers.error_controller import ErrorPage
from app.controllers.import_data_controller import ImportDataPage
from app.controllers.song.add_song_controller import AddSongPag... | ajibawa-2023/Python-Code-Large/train/row_78568 | 17 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78568:ImportFrom_L1_C0", "label": "from app.controllers.artist.all_artist_controller import AllArtistsPage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "ap... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78568:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78568:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78568:If_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78568:Expr_L32_C4"}] |
import os
from google.appengine.dist import use_library
use_library('django', '1.2')
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_settings'
from django.conf import settings
views_path = os.path.join(os.path.dirname(__file__), 'app', 'views', 'layouts')
settings.TEMPLATE_LOADERS = (('app.helpers.django_loader.MvcTem... | ajibawa-2023/Python-Code-Large/train/row_78569 | 7 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78569:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", ... | [] |
import sys
import os
args = sys.argv[1:]
if len(args) != 1:
raise SystemExit('usage: %s <output html path>' % sys.argv[0])
path = args[0]
OUTPUT = os.path.join(path, 'index.html')
PYSPADES_LIST_FILE = os.path.join(path, 'list')
sys.path.append('..')
from twisted.internet import reactor
from twis... | ajibawa-2023/Python-Code-Large/train/row_78570 | 48 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78570:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0109, 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_78570:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78570:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78570:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78570:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78571 | 72 | 167 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78571:Import_L18_C0", "label": "pyglet import pyglet", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1078, 0.006, 0, 0.66, 0.0, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "pyglet", "arg_names": [], "import_names": ["pyglet"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78571:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78571:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78571:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78571:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import sys
sys.path.append('..')
import os
import shutil
def copy(src, dst):
if os.path.isfile(src):
shutil.copyfile(src, dst)
else:
shutil.copytree(src, dst)
SERVER_FILES = ['maps', 'config.txt', 'scripts']
from pyspades.common import crc32
version = crc32(open('../data/client.exe', 'rb').r... | ajibawa-2023/Python-Code-Large/train/row_78572 | 15 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78572:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 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_78572:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78572:If_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78572:If_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78572:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
from distutils.core import setup
import py2exe
# just so we always get commands.py first, not the stdlib commands.py
import sys
sys.path.insert(0, '../feature_server')
sys.path.append('..')
setup(
console = ['../feature_server/run.py'],
zipfile = None,
options = {
'py2exe' : {
'compres... | ajibawa-2023/Python-Code-Large/train/row_78573 | 6 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78573:ImportFrom_L1_C0", "label": "from distutils.core import setup", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "import_nam... | [] |
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
ext_modules = []
names = [
'pyspades.compression',
'pyspades.load',
'pyspades.compressedvxl',
'pyspades.bytes',
'pyspades.pac... | ajibawa-2023/Python-Code-Large/train/row_78574 | 10 | 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_78574:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0345, 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_78574:For_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78574:Expr_L23_C4"}] |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78575 | 17 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78575:ImportFrom_L18_C0", "label": "from twisted.cred import portal, checkers", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.4865, 0.027, 0, 0.66, 0.0, 847, 0, 2, 0, 0, 847, 0, 0], "semantic": {"name": "twisted.cred", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78575:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78575:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78575:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78575:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Pyth... |
import array
import random
import math
import sys
sys.path.append('..')
from pyspades.load import VXLData
"""NOTES:
filling an entire z column(index 0-63) with set_point() caused corruption,
but only after I filled a 2x2 x/y area. Is this expected behavior?
For now my policy is to set 1-63 for sets, 1-... | ajibawa-2023/Python-Code-Large/train/row_78576 | 349 | 433 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78576:Import_L1_C0", "label": "array import array", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["array"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78576:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78576:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78576:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78576:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-... |
# Copyright (c) James W. Hofmann 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | ajibawa-2023/Python-Code-Large/train/row_78577 | 27 | 49 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78577:ImportFrom_L18_C0", "label": "from twisted.internet import reactor", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3673, 0.0204, 0, 0.66, 0.0, 937, 0, 1, 0, 0, 937, 0, 0], "semantic": {"name": "twisted.internet", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78577:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78577:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78577:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78577:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-... |
from pyspades.server import grenade_packet
from pyspades.collision import distance_3d_vector
from twisted.internet import reactor
from random import choice
from commands import add, admin, name, get_player
@admin
def relink(connection):
connection.protocol.drop_all_links()
connection.protocol.send_cha... | ajibawa-2023/Python-Code-Large/train/row_78578 | 101 | 136 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78578:ImportFrom_L1_C0", "label": "from pyspades.server import grenade_packet", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 254, 0, 1, 0, 0, 254, 0, 0], "semantic": {"name": "pyspades.server", "arg_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78578:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78578:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78578:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78578:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from commands import add, admin
from pyspades.common import coordinates
@admin
def protect(connection, value = None):
if value is None:
connection.protocol.protected = None
connection.protocol.send_chat('All areas unprotected.', irc = True)
else:
if connection.protocol.protecte... | ajibawa-2023/Python-Code-Large/train/row_78579 | 31 | 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_78579:ImportFrom_L1_C0", "label": "from commands import add, admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 760, 0, 2, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78579:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78579:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78579:If_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78579:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
from twisted.internet import reactor
import re
deuce_name_pattern = re.compile("Deuce\d?\d?$")
chat_pattern = re.compile(".*how.*(set|change|choo?se|make|pick).*(name|nick)",
re.IGNORECASE)
def deuce_howto_match(player, msg):
return chat_pattern.match(msg) is not None
def apply_script(protocol, con... | ajibawa-2023/Python-Code-Large/train/row_78580 | 16 | 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_78580:ImportFrom_L1_C0", "label": "from twisted.internet import reactor", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 937, 0, 1, 0, 0, 937, 0, 0], "semantic": {"name": "twisted.internet", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78580:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78580:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78580:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78580:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python... |
from pyspades.server import block_action
from pyspades.constants import *
def apply_script(protocol, connection, config):
def try_add_node(map, x, y, z, list):
if x < 0 or x >= 512 or y < 0 or y >= 512 or z < 0 or z >= 62:
return
if map.get_solid(x, y, z):
return
... | ajibawa-2023/Python-Code-Large/train/row_78581 | 41 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78581:ImportFrom_L1_C0", "label": "from pyspades.server import block_action", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 254, 0, 1, 0, 0, 254, 0, 0], "semantic": {"name": "pyspades.server", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78581:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78581:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78581:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78581:If_L6_C8"}, {"f": "ajibawa-2023/Python-Code-... |
from pyspades.server import orientation_data, grenade_packet
from pyspades.serverloaders import PositionData
from pyspades.common import coordinates, Vertex3
from pyspades.collision import distance_3d_vector
from pyspades.world import Grenade
from twisted.internet import reactor
import random
import commands
... | ajibawa-2023/Python-Code-Large/train/row_78582 | 117 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78582:ImportFrom_L1_C0", "label": "from pyspades.server import orientation_data, grenade_packet", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 254, 0, 2, 0, 0, 254, 0, 0], "semantic": {"name": "pyspades.serv... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78582:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78582:Return_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78582:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78582:ClassDef_L16_C4"}, {"f": "ajibawa-2023/Python-... |
from commands import add, admin, get_player
@admin
def trust(connection, player):
player = get_player(connection.protocol, player)
player.trusted = True
player.speedhack_detect = False
player.send_chat("You're now a trusted user")
return '%s is now trusted' % player.name
add(trust)
de... | ajibawa-2023/Python-Code-Large/train/row_78583 | 24 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78583:ImportFrom_L1_C0", "label": "from commands import add, admin, get_player", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 760, 0, 3, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78583:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78583:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78583:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78583:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from pyspades.server import hit_packet
import types
def apply_script(protocol, connection, config):
class MapExtensionConnection(connection):
def on_position_update(self):
extensions = self.protocol.map_info.extensions
if (extensions.has_key('water_damage') and
... | ajibawa-2023/Python-Code-Large/train/row_78584 | 21 | 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_78584:ImportFrom_L1_C0", "label": "from pyspades.server import hit_packet", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 254, 0, 1, 0, 0, 254, 0, 0], "semantic": {"name": "pyspades.server", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78584:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78584:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78584:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78584:FunctionDef_L7_C8"}, {"f": "ajibawa-2023/Python-Co... |
from commands import add, admin
from pyspades.server import block_action, set_color
from pyspades.common import make_color
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from pyspades.constants import *
@admin
def platform(connection, *args):
if connection.building_mode... | ajibawa-2023/Python-Code-Large/train/row_78585 | 290 | 357 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78585:ImportFrom_L1_C0", "label": "from commands import add, admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0028, 0, 0.66, 0.0, 760, 0, 2, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78585:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78585:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78585:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78585:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from pyspades.load import VXLData
from pyspades.common import coordinates
from pyspades.serverloaders import BlockAction, SetColor
from pyspades.constants import *
from twisted.internet.task import LoopingCall
from map import Map
from commands import add, admin
import time
import operator
@admin
def rollmap... | ajibawa-2023/Python-Code-Large/train/row_78586 | 158 | 206 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78586:ImportFrom_L1_C0", "label": "from pyspades.load import VXLData", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 0, 0.66, 0.0, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "pyspades.load", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78586:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78586:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78586:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78586:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from pyspades.collision import vector_collision
from pyspades.constants import PICKAXE_TOOL
from twisted.internet.task import LoopingCall
import random
MELEE_DISTANCE = 2.0
UPDATE_FPS = 10
def apply_script(protocol, connection, config):
melee_damage = config.get('melee_damage', 20)
class MeleeProtoc... | ajibawa-2023/Python-Code-Large/train/row_78587 | 40 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78587:ImportFrom_L1_C0", "label": "from pyspades.collision import vector_collision", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 869, 0, 1, 0, 0, 869, 0, 0], "semantic": {"name": "pyspades.collision", "arg_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78587:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78587:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78587:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78587:ClassDef_L11_C4"}, {"f": "ajibawa-2023/Python-Co... |
from pyspades.collision import distance_3d_vector
from pyspades.common import prettify_timespan
from commands import add, admin, name, get_player
from twisted.internet import reactor
@name('griefcheck')
@admin
def grief_check(connection, player, time = None):
player = get_player(connection.protocol, player... | ajibawa-2023/Python-Code-Large/train/row_78588 | 56 | 88 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78588:ImportFrom_L1_C0", "label": "from pyspades.collision import distance_3d_vector", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0114, 0, 0.66, 0.0, 869, 0, 1, 0, 0, 869, 0, 0], "semantic": {"name": "pyspades.collision", "ar... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78588:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78588:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78588:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78588:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
def apply_script(protocol, connection, config):
welcomes = config.get('welcomes', {})
class EnterConnection(connection):
def on_login(self, name):
if name in welcomes:
self.protocol.send_chat(welcomes[name])
connection.on_login(self, name)
return protocol, Ent... | ajibawa-2023/Python-Code-Large/train/row_78589 | 8 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78589:FunctionDef_L1_C0", "label": "apply_script", "type": "function", "loc": [1, 8], "level": 0, "parent": null, "vector": [2, 0, 0.5625, 1.0, 0, 0.66, 0.0, 415, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "apply_script", "arg_names": ["protocol", "connection", "config"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78589:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78589:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78589:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78589:ClassDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code... |
from pyspades.server import player_data, chat_message
from pyspades.server import create_player, position_data, kill_action
from commands import add, rights, admin, name, get_player
import commands
@admin
def god(connection, value = None):
if value is None and connection.spectator:
return "You're s... | ajibawa-2023/Python-Code-Large/train/row_78590 | 118 | 148 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78590:ImportFrom_L1_C0", "label": "from pyspades.server import player_data, chat_message", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 254, 0, 2, 0, 0, 254, 0, 0], "semantic": {"name": "pyspades.server", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78590:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78590:If_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78590:If_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78590:Return_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
def apply_script(protocol, connection, config):
class MatchConnection(connection):
def on_flag_take(self):
self.protocol.irc_say("%s took %s's flag!" %
(self.printable_name, self.team.other.name.lower()))
return connection.on_flag_take(self)
de... | ajibawa-2023/Python-Code-Large/train/row_78591 | 17 | 25 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78591:FunctionDef_L1_C0", "label": "apply_script", "type": "function", "loc": [1, 25], "level": 0, "parent": null, "vector": [2, 0, 0.52, 1.0, 0, 0.66, 0.0, 415, 0, 3, 1, 0, 0, 0, 11], "semantic": {"name": "apply_script", "arg_names": ["protocol", "connection", "config"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78591:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78591:ClassDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78591:ClassDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78591:FunctionDef_L3_C8"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78594 | 483 | 753 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78594:ClassDef_L18_C0", "label": "InvalidPlayer", "type": "class", "loc": [18, 19], "level": 0, "parent": null, "vector": [3, 0, 0.0246, 0.0027, 0, 0.66, 0.0, 751, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "InvalidPlayer", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78594:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78594:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78594:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78594:Return_L26_C8"}, {"f": "ajibawa-2023/Pyth... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78595 | 41 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78595:ImportFrom_L18_C0", "label": "from pyspades.load import VXLData", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0139, 0, 0.66, 0.0, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "pyspades.load", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78595:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78595:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78595:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78595:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Copyright (c) junk/someonesomewhere 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | ajibawa-2023/Python-Code-Large/train/row_78596 | 26 | 68 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78596:ImportFrom_L18_C0", "label": "from twisted.internet import reactor", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2647, 0.0147, 0, 0.66, 0.0, 937, 0, 1, 0, 0, 937, 0, 0], "semantic": {"name": "twisted.internet", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78596:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78596:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78596:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78596:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78597 | 266 | 359 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78597:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0529, 0.0084, 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_78597:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78597:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78597:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78597:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78598 | 14 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78598:ImportFrom_L18_C0", "label": "from pyspades.load import VXLData", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.4865, 0.027, 0, 0.66, 0.0, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "pyspades.load", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78598:For_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78598:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78598:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78598:For_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_785... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78599 | 4 | 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_78599:ImportFrom_L18_C0", "label": "from pyspades.load import VXLData", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.8182, 0.0455, 0, 0.66, 0.0, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "pyspades.load", "arg_names": [], "impor... | [] |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78600 | 10 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78600:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 22], "level": 0, "parent": null, "vector": [8, 0, 0.5263, 0.1316, 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_78600:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78600:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78600:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78600:Expr_L32_C4"}] |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78601 | 30 | 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_78601:Import_L18_C0", "label": "struct import struct", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0185, 0, 0.66, 0.0, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78601:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78601:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78601:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78601:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78602 | 17 | 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_78602:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 20], "level": 0, "parent": null, "vector": [8, 0, 0.38, 0.06, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78602:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78602:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78602:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78602:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78603 | 12 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78603:Import_L18_C0", "label": "math import math", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.5294, 0.0294, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78603:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78603:Return_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78603:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78603:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78604 | 99 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78604:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 20], "level": 0, "parent": null, "vector": [8, 0, 0.1242, 0.0196, 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_78604:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78604:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78604:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78604:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78605 | 39 | 70 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78605:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2714, 0.0429, 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_78605:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78605:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78605:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78605:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78606 | 34 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78606:ClassDef_L18_C0", "label": "DictItem", "type": "class", "loc": [18, 30], "level": 0, "parent": null, "vector": [3, 0, 0.3934, 0.2131, 0, 0.66, 0.0, 172, 0, 3, 0, 0, 186, 0, 2], "semantic": {"name": "DictItem", "arg_names": [], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78606:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78606:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78606:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78606:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78607 | 15 | 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_78607:Assign_L18_C0", "label": "CONNECTIONLESS =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.36, 0.02, 0, 0.66, 0.0, 86, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CONNECTIONLESS", "arg_names": [], "import_names": [],... | [] |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78608 | 191 | 257 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78608:ImportFrom_L18_C0", "label": "from twisted.internet.protocol import DatagramProtocol", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.07, 0.0039, 0, 0.66, 0.0, 959, 0, 1, 0, 0, 959, 0, 0], "semantic": {"name": "twisted.internet.p... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78608:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78608:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78608:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78608:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... | ajibawa-2023/Python-Code-Large/train/row_78609 | 825 | 1,063 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78609:ImportFrom_L18_C0", "label": "from twisted.internet.protocol import DatagramProtocol", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0009, 0, 0.66, 0.0, 959, 0, 1, 0, 0, 959, 0, 0], "semantic": {"name": "twisted.internet... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78609:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78609:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78609:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78609:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from twisted.web.client import getPage
from twisted.internet.defer import Deferred
from collections import namedtuple
from pyspades.tools import get_server_ip
SERVER_LIST = 'http://ace-spades.com/?page_id=5'
START_IDENTIFIER = '<pre>#/MAX PING NAME (Click to Join)\n'
END_IDENTIFIER = '</pre>'
ServerEntry =... | ajibawa-2023/Python-Code-Large/train/row_78610 | 28 | 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_78610:ImportFrom_L1_C0", "label": "from twisted.web.client import getPage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 0, 0.66, 0.0, 462, 0, 1, 0, 0, 462, 0, 0], "semantic": {"name": "twisted.web.client", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78610:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78610:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78610:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78610:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78611 | 98 | 146 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78611:ImportFrom_L18_C0", "label": "from pyspades.loaders import Loader", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1233, 0.0068, 0, 0.66, 0.0, 185, 0, 1, 0, 0, 185, 0, 0], "semantic": {"name": "pyspades.loaders", "arg_names": [],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78611:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78611:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78611:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78611:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Copyright (c) Mathias Kaerlev 2011.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | ajibawa-2023/Python-Code-Large/train/row_78612 | 7 | 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_78612:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 20], "level": 0, "parent": null, "vector": [8, 0, 0.6333, 0.1, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_78613 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78613:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78613:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78613:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78613:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78613:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78614 | 15 | 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_78614:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.4186, 0.0698, 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_78614:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78614:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78614:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78614:For_L24_C1"}, {"f": "ajibawa-2023/Python-Code-... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78615 | 45 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78615:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1957, 0.0326, 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_78615:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78615:If_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78615:If_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78615:Return_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78616 | 100 | 224 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78616:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0804, 0.0134, 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_78616:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78616:Expr_L84_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78616:FunctionDef_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78616:Assign_L87_C1"}, {"f": "ajibawa-2023/Python-Code... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78617 | 24 | 62 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78617:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.2903, 0.0484, 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_78617:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78617:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78617:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78617:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78618 | 149 | 298 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78618:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0604, 0.0101, 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_78618:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78618:Expr_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78618:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78618:FunctionDef_L40_C1"}, {"f": "ajibawa-2023/Python-Code-... |
# bdflib, a library for working with BDF font files
# Copyright (C) 2009, Timothy Alle
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ajibawa-2023/Python-Code-Large/train/row_78619 | 64 | 117 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78619:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1538, 0.0256, 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_78619:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78619:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78619:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78619:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
"""
bdf2inc.py - tool for converting BDF files into a format accepted by
aki-ledsuite
Copyright (C) 2009 Free Software Initiative of Japan
Written by Wiktor Langowski <jolkaczad@gmail.com>
Distributed under GNU General Public License version 3 (or later)
This script utilises the BDFlib librar... | ajibawa-2023/Python-Code-Large/train/row_78620 | 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_78620:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
import time
db=DAL()
db.define_table('a',Field('b'))
while True:
t0=time.time()
id=db.a.insert(b='x'*512)
db.commit()
print id, time.time()-t0
| ajibawa-2023/Python-Code-Large/train/row_78621 | 8 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78621:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 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_78621:While_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78621:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78621:While_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78621:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import sys, os, re, time, datetime
ticker=sys.argv[1]
print sys.argv
productid=db.product(name=ticker).id
filename=os.path.join('applications',request.application,'modules',ticker+'.log')
filenameidx=os.path.join('applications',request.application,'modules',ticker+'.idx')
re_match=re.compile('(?P<t>\d+(\.\d+)?)\: ma... | ajibawa-2023/Python-Code-Large/train/row_78622 | 37 | 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_78622:Import_L1_C0", "label": "sys import sys, os, re\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 509, 0, 5, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "o... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78622:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78622:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78622:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78622:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import random, hmac, urllib, time, optparse
def robot_order(price,owner='1,2'):
owners=str(owner).split(',')
owner=owners[random.randint(0,len(owners)-1)]
i=random.randint(0,3)
p=price
if i is 1:
p=p-abs(random.gauss(0,10)) # dollars
if p<=20: p=20+abs(random.gauss(0,20))
... | ajibawa-2023/Python-Code-Large/train/row_78623 | 46 | 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_78623:Import_L1_C0", "label": "random import random, hmac, urllib\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0156, 0, 0.66, 0.0, 715, 0, 5, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78623:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78623:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78623:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78623:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
# example based on http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
hmac_key = 'secret'
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import hmac
import re
import time
import sys
import optparse
import simplejson
(TYPE,QUANTITY,PRICE,STOP,OID... | ajibawa-2023/Python-Code-Large/train/row_78624 | 154 | 263 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78624:Assign_L4_C0", "label": "hmac_key =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0152, 0.0038, 0, 0.66, 0.0, 3, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "hmac_key", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78624:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78624:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78624:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78624:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-... |
response.title = settings.title
response.subtitle = settings.subtitle
response.meta.author = '%s <%s>' % (settings.author, settings.author_email)
response.meta.keywords = settings.keywords
response.meta.description = settings.description
response.menu = [
(T('Index'),URL('index').xml()==URL().xml(),URL('index'),[])... | ajibawa-2023/Python-Code-Large/train/row_78625 | 6 | 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_78625:Assign_L1_C0", "label": "response.title =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1, 0.1, 0, 0.66, 0.0, 547, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "response.title", "arg_names": [], "import_names": [], "rh... | [] |
from gluon.storage import Storage
settings = Storage()
settings.migrate = True
settings.title = '[E]xchange [M]atching and [T]trading [E]ngine'
settings.subtitle = 'full-stack exchange and trading plaform (fast, scalable, secure)'
settings.author = 'mdipierro'
settings.author_email = 'mdipierro@cs.depaul.edu'
settings... | ajibawa-2023/Python-Code-Large/train/row_78626 | 18 | 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_78626:ImportFrom_L1_C0", "label": "from gluon.storage import Storage", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "gluon.storage", "arg_names": [], "import... | [] |
# -*- coding: utf-8 -*-
db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB
from gluon.tools import *
mail = Mail() # mailer
auth = Auth(globals(),db) # authentication/authorization
crud = Crud(globals(),db) # for CRUD ... | ajibawa-2023/Python-Code-Large/train/row_78627 | 27 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78627:Assign_L3_C0", "label": "db = DAL()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0417, 0.0139, 0, 0.66, 0.0, 761, 3, 1, 0, 0, 18, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78627:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78627:Assign_L72_C25"}] |
### we prepend t_ to tablenames and f_ to fieldnames for disambiguity
########################################
db.define_table('product',
Field('name', type='string',label=T('Name'),requires=[IS_MATCH('[_a-z]+'),IS_NOT_IN_DB(db,'product.name')]),
Field('description', typ... | ajibawa-2023/Python-Code-Large/train/row_78628 | 3 | 44 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78628:Expr_L4_C0", "label": "define_table()", "type": "expression", "loc": [4, 23], "level": 0, "parent": null, "vector": [8, 0, 0.3068, 0.4545, 0, 0.66, 0.0, 874, 3, 14, 0, 0, 0, 0, 22], "semantic": {"name": "define_table", "arg_names": [], "import_names": [], "rhs_cal... | [] |
# -*- coding: utf-8 -*-
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call():
session.forget()
return service()
### end requires
def index():
return dict()
def error():
return dict()
@auth.requires_login()
def products():
... | ajibawa-2023/Python-Code-Large/train/row_78630 | 80 | 118 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78630:FunctionDef_L3_C0", "label": "user", "type": "function", "loc": [3, 3], "level": 0, "parent": null, "vector": [2, 0, 0.0254, 0.0085, 0, 0.66, 0.0, 503, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "user", "arg_names": [], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78630:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78630:Return_L3_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78630:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78630:Return_L4_C16"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: utf-8 -*-
""" Define the menu structure used by the Pentacle applications """
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
["Exercised", ""],
["Uncalled", ""],
... | ajibawa-2023/Python-Code-Large/train/row_78631 | 2 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78631:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1154, 0.0385, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import ctypes, os, unittest
import XiteWin
class TestSimple(unittest.TestCase):
def setUp(self):
self.xite = XiteWin.xiteFrame
self.ed = self.xite.ed
self.ed.ClearAll()
self.ed.EmptyUndoBuffer()
def testLength(self):
self.a... | ajibawa-2023/Python-Code-Large/train/row_78632 | 1,114 | 1,313 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78632:ImportFrom_L3_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0008, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78632:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78632:FunctionDef_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78632:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78632:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-C... |
# List many windows message numbers
msgs = {
"WM_ACTIVATE":6,
"WM_ACTIVATEAPP":28,
"WM_CAPTURECHANGED":533,
"WM_CHAR":258,
"WM_CLOSE":16,
"WM_CREATE":1,
"WM_COMMAND":273,
"WM_DESTROY":2,
"WM_ENTERSIZEMOVE":561,
"WM_ERASEBKGND":20,
"WM_EXITSIZEMOVE":562,
"WM_GETMINMAXINFO":36,
"WM_GETTEXT":13,
"WM_IME_S... | ajibawa-2023/Python-Code-Large/train/row_78633 | 4 | 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_78633:Assign_L3_C0", "label": "msgs =", "type": "assigned_variable", "loc": [3, 58], "level": 0, "parent": null, "vector": [14, 0, 0.4841, 0.8889, 0, 0.66, 0.0, 211, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "msgs", "arg_names": [], "import_names": [], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78633:For_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78633:Assign_L62_C1"}] |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os, sys, unittest
import ctypes
from ctypes import wintypes
from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort
user32=ctypes.windll.user32
gdi32=ctypes.windll.gdi32
kernel32=ctypes.windll.kernel32
from MessageNumbers impor... | ajibawa-2023/Python-Code-Large/train/row_78634 | 472 | 653 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78634:ImportFrom_L3_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0015, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78634:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78634:Assign_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78634:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78634:FunctionDef_L75_C1"}, {"f": "ajibawa-2023/Python-Cod... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import io
import os
import unittest
import XiteWin
keywordsHTML = [
b"b body content head href html link meta "
b"name rel script strong title type xmlns",
b"function",
b"sub"
]
class TestLexers(unittest.TestCase):
def setUp(self):... | ajibawa-2023/Python-Code-Large/train/row_78635 | 78 | 113 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78635:ImportFrom_L3_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0088, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78635:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78635:FunctionDef_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78635:FunctionDef_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78635:Assign_L21_C2"}, {"f": "ajibawa-2023/Python-... |
# Convert all punctuation characters except '_', '*', and '.' into spaces.
def depunctuate(s):
'''A docstring'''
"""Docstring 2"""
d = ""
for ch in s:
if ch in 'abcde':
d = d + ch
else:
d = d + " "
return d
| ajibawa-2023/Python-Code-Large/train/row_78636 | 9 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78636:FunctionDef_L2_C0", "label": "depunctuate", "type": "function", "loc": [2, 11], "level": 0, "parent": null, "vector": [2, 0, 0.5909, 0.9091, 0, 0.66, 0.0, 193, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "depunctuate", "arg_names": ["s"], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78636:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78636:Expr_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78636:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78636:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: utf-8 -*-
import XiteWin
if __name__ == "__main__":
XiteWin.main("")
| ajibawa-2023/Python-Code-Large/train/row_78637 | 3 | 6 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78637:Import_L3_C0", "label": "XiteWin import XiteWin", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.1667, 0, 0.66, 0.0, 911, 0, 1, 0, 0, 911, 0, 0], "semantic": {"name": "XiteWin", "arg_names": [], "import_names": ["XiteWin"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78637:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78637:Expr_L6_C1"}] |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os, string, time, unittest
import XiteWin
class TestPerformance(unittest.TestCase):
def setUp(self):
self.xite = XiteWin.xiteFrame
self.ed = self.xite.ed
self.ed.ClearAll()
self.ed.EmptyUndoBuffer()
def testAddLine(self... | ajibawa-2023/Python-Code-Large/train/row_78638 | 71 | 83 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78638:ImportFrom_L3_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0361, 0.012, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78638:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78638:FunctionDef_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78638:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78638:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/env python
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla and SciTE source files that list
# all the lexers and all the properties files.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.4 or later
#... | ajibawa-2023/Python-Code-Large/train/row_78639 | 194 | 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_78639:Import_L20_C0", "label": "string import string", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.066, 0.0033, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78639:If_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78639:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78639:If_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78639:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
# Module for reading and parsing Scintilla.iface file
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
line = line.strip()
return line
def decodeFunction(featureVal):
retType, rest = featureVal.split(" ", 1)
nameIdent, params = ... | ajibawa-2023/Python-Code-Large/train/row_78640 | 78 | 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_78640:FunctionDef_L3_C0", "label": "sanitiseLine", "type": "function", "loc": [3, 8], "level": 0, "parent": null, "vector": [2, 0, 0.05, 0.0545, 0, 0.66, 0.0, 374, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "sanitiseLine", "arg_names": ["line"], "import_names": [], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78640:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78640:If_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78640:If_L4_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78640:Assign_L4_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python3
# CheckMentioned.py
# Find all the symbols in scintilla/include/Scintilla.h and check if they
# are mentioned in scintilla/doc/ScintillaDoc.html.
import string
uninteresting = {"SCINTILLA_H", "SCI_START", "SCI_LEXER_START", "SCI_OPTIONAL_START"}
srcRoot = "../.."
incFileName = srcRoot ... | ajibawa-2023/Python-Code-Large/train/row_78641 | 33 | 46 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78641:Import_L6_C0", "label": "string import string", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0217, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78641:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78641:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78641:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78641:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#! /usr/bin/env python
# Produces a .api file for SciTE's identifier completion and calltip features.
# invoke as
# python tags2api.py tags >x.api
# before running this program, create a tags file with
# ctags --excmd=number --c-types=pcdgstu <header files>
import fileinput
import time
# Definitions th... | ajibawa-2023/Python-Code-Large/train/row_78642 | 89 | 134 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78642:Import_L9_C0", "label": "fileinput import fileinput", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0672, 0.0075, 0, 0.66, 0.0, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["file... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78642:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78642:Expr_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78642:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78642:FunctionDef_L29_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
# CheckMentioned.py
# Find all the properties used in SciTE source files and check if they
# are mentioned in scite/doc/SciTEDoc.html.
import os
import string
import stat
srcRoot = "../../scite"
srcDir = os.path.join(srcRoot, "src")
docFileName = os.path.join(srcRoot, "doc", "SciTEDoc... | ajibawa-2023/Python-Code-Large/train/row_78643 | 176 | 246 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78643:Import_L6_C0", "label": "os import os", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0041, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78643:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78643:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78643:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78643:Assign_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
# makerpms.py
# Copy files all over the place build RPMs and copy to top level directory
import os
import shutil
srcRoot = "../../"
rpmRoot = "/usr/src/redhat/SOURCES/"
rpmBin = "/usr/src/redhat/RPMS/i386/"
rpmSource = "/usr/src/redhat/SRPMS/"
verFileName = srcRoot + "scintilla/versio... | ajibawa-2023/Python-Code-Large/train/row_78644 | 28 | 49 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78644:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0204, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78644:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78644:Expr_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78644:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78644:Expr_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_786... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os, sys
scintillaDirectory = os.path.join("..", "..", "scintilla", "include")
sys.path.append(scintillaDirectory)
import Face
def cell(s):
return "<td>%s</td>" % s
def faceFeatures(out):
out.write("<h2>Scint... | ajibawa-2023/Python-Code-Large/train/row_78645 | 44 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78645:ImportFrom_L4_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0139, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78645:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78645:Return_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78645:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78645:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code... |
#! /usr/bin/env python
# Produces a .api file for SciTE's identifier completion and calltip features.
# invoke as
# python tags2api.py tags >x.api
# before running this program, create a tags file with
# ctags --excmd=number --c-types=pcdgstu <header files>
import fileinput
import string
import time
#... | ajibawa-2023/Python-Code-Large/train/row_78646 | 88 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78646:Import_L9_C0", "label": "fileinput import fileinput", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0677, 0.0075, 0, 0.66, 0.0, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["file... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78646:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78646:Expr_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78646:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78646:FunctionDef_L30_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | ajibawa-2023/Python-Code-Large/train/row_78648 | 133 | 305 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78648:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0033, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78648:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78648:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78648:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78648:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | ajibawa-2023/Python-Code-Large/train/row_78649 | 218 | 605 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78649:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0281, 0.0017, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78649:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78649:Expr_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78649:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78649:Return_L54_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | ajibawa-2023/Python-Code-Large/train/row_78651 | 51 | 187 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78651:Expr_L32_C0", "label": "expression", "type": "expression", "loc": [32, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1818, 0.0267, 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_78651:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78651:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78651:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78651:Expr_L46_C2"}, {"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.