code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | ajibawa-2023/Python-Code-Large/train/row_990 | 20 | 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_990:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 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_990:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_990:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_990:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_990:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_990:Fo... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | ajibawa-2023/Python-Code-Large/train/row_991 | 75 | 130 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_991:Import_L3_C0", "label": "sys import sys, os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0077, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_991:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_991:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_991:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_991:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | ajibawa-2023/Python-Code-Large/train/row_992 | 75 | 130 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_992:Import_L3_C0", "label": "sys import sys, os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0077, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_992:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_992:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_992:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_992:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | ajibawa-2023/Python-Code-Large/train/row_993 | 38 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_993:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 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_993:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_993:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_993:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_993:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
Data format classes ("responders") that can be plugged
into model_resource.ModelResource and determine how
the objects of a ModelResource instance are rendered
(e.g. serialized to XML, rendered by templates, ...).
"""
from django.core import serializers
from django.core.handlers.wsgi import STATUS_CODE_TEXT
from d... | ajibawa-2023/Python-Code-Large/train/row_994 | 179 | 299 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_994:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0117, 0.0201, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_994:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_994:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_994:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_994:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
"""
Generic resource class.
"""
from django.utils.translation import ugettext as _
from authentication import NoAuthentication
from django.core.urlresolvers import reverse as _reverse
from django.http import Http404, HttpResponse, HttpResponseNotAllowed
def load_put_and_files(request):
"""
Populates request.PU... | ajibawa-2023/Python-Code-Large/train/row_995 | 72 | 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_995:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0135, 0.0203, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_995:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_995:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_995:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_995:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
"""
Data format classes that can be plugged into
model_resource.ModelResource and determine how submissions
of model data need to look like (e.g. form submission MIME types,
XML, JSON, ...).
"""
from django.core import serializers
from django.forms import model_to_dict
class InvalidFormData(Exception):
"""
Ra... | ajibawa-2023/Python-Code-Large/train/row_996 | 34 | 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_996:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0486, 0.0833, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_996:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_996:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_996:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_996:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
"""
Model-bound resource class.
"""
from django import forms
from django.conf.urls.defaults import patterns
from django.http import *
from django.forms import ModelForm, models
from django.forms.util import ErrorDict
from django.utils.functional import curry
from django.utils.translation.trans_null import _
from resour... | ajibawa-2023/Python-Code-Large/train/row_997 | 112 | 243 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_997:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0082, 0.0123, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_997:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_997:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_997:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_997:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
VERSION = (1, 1)
| ajibawa-2023/Python-Code-Large/train/row_998 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_998:Assign_L1_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 557, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "VERSION", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
from django.http import HttpResponse
from django.utils.translation import ugettext as _
import hashlib, time, random
def djangouser_auth(username, password):
"""
Check username and password against
django.contrib.auth.models.User
"""
from django.contrib.auth.models import User
try:
user... | ajibawa-2023/Python-Code-Large/train/row_999 | 103 | 211 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_999:ImportFrom_L1_C0", "label": "from django.http import HttpResponse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0047, 0, 0.66, 0.0, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_999:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_999:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_999:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_999:ImportFrom_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from distutils.core import setup
version = '%s.%s' % __import__('django_restapi').VERSION[:2]
setup(name='django-rest',
version=version,
packages=['django_restapi'],
author='Andriy Drozdyuk',
author_email='drozzy@gmail.com',
)
| ajibawa-2023/Python-Code-Large/train/row_1000 | 3 | 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_1000:ImportFrom_L1_C0", "label": "from distutils.core import setup", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "import_names"... | [] |
from os.path import realpath
DEBUG = True
TEMPLATE_DEBUG = True
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.sites',
'django_restapi_tests.polls',
'django_restapi_tests.people'
)
SITE_ID=1
ROOT_U... | ajibawa-2023/Python-Code-Large/train/row_1001 | 10 | 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_1001:ImportFrom_L1_C0", "label": "from os.path import realpath", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["realp... | [] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | ajibawa-2023/Python-Code-Large/train/row_1002 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1002:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1002:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1002:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1002:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1002:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1002:... |
from datetime import datetime
from django.db import models
from django.utils.translation import gettext_lazy as _
class Poll(models.Model):
question = models.CharField(max_length=200)
password = models.CharField(max_length=200)
pub_date = models.DateTimeField(_('date published'), default=datetime.now)
... | ajibawa-2023/Python-Code-Large/train/row_1003 | 25 | 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_1003:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1003:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1003:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1003:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1003:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from binascii import b2a_base64
from datetime import datetime
from django.core import serializers
from django.test import TestCase
from django.utils.functional import curry
from django_restapi.authentication import HttpDigestAuthentication
from django_restapi_tests.examples.authentication import digest_authfunc
from dj... | ajibawa-2023/Python-Code-Large/train/row_1004 | 186 | 333 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1004:ImportFrom_L1_C0", "label": "from binascii import b2a_base64", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.003, 0, 0.66, 0.0, 984, 0, 1, 0, 0, 984, 0, 0], "semantic": {"name": "binascii", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1004:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1004:If_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1004:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1004:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
from django.conf.urls.defaults import *
from django.contrib import admin
urlpatterns = patterns('',
url(r'', include('django_restapi_tests.examples.simple')),
url(r'', include('django_restapi_tests.examples.basic')),
url(r'', include('django_restapi_tests.examples.template')),
url(r'', include('django_rest... | ajibawa-2023/Python-Code-Large/train/row_1005 | 3 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1005:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi.receiver import *
from django_restapi_tests.polls.models import Poll
fullxml_poll_resource = Collection(
queryset = Poll.objects.all(),
permitted_methods = ('... | ajibawa-2023/Python-Code-Large/train/row_1006 | 8 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1006:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi_tests.polls.models import Poll, Choice
xml_poll_resource = Collection(
queryset = Poll.objects.all(),
permitted_methods = ('GET', 'POST', 'PUT', 'DELETE'),
... | ajibawa-2023/Python-Code-Large/train/row_1007 | 7 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1007:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
from django.conf.urls.defaults import *
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django_restapi.resource import Resource
from django_restapi_tests.people.models import *
# Urls for a resource that does not map 1:1
# to Django models.
class FriendshipCollection... | ajibawa-2023/Python-Code-Large/train/row_1008 | 20 | 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_1008:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0345, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1008:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1008:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1008:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1008:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code... |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection, Entry, reverse
from django_restapi.responder import *
from django_restapi_tests.polls.models import Poll, Choice
# JSON Test API URLs
#
# Polls are available at /json/polls/ and
# /json/polls/[poll_id]/.
#
# Different (manua... | ajibawa-2023/Python-Code-Large/train/row_1009 | 23 | 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_1009:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0175, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1009:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1009:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1009:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1009:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code... |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi_tests.polls.models import Poll, Choice
template_poll_resource = Collection(
queryset = Poll.objects.all(),
permitted_methods = ('GET', 'POST', 'PUT', 'DELETE')... | ajibawa-2023/Python-Code-Large/train/row_1010 | 7 | 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_1010:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi_tests.polls.models import Poll, Choice
simple_poll_resource = Collection(
queryset = Poll.objects.all(),
responder = XMLResponder(),
)
simple_choice_resource ... | ajibawa-2023/Python-Code-Large/train/row_1011 | 7 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1011:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi_tests.polls.models import Poll, Choice
fixedend_poll_resource = Collection(
queryset = Poll.objects.all(),
responder = XMLResponder(),
)
fixedend_choice_resou... | ajibawa-2023/Python-Code-Large/train/row_1012 | 7 | 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_1012:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names"... | [] |
from django.conf.urls.defaults import *
from django_restapi.model_resource import Collection
from django_restapi.responder import *
from django_restapi.authentication import *
from django_restapi_tests.polls.models import Poll
# HTTP Basic
#
# No auth function specified
# -> django.contrib.auth.models.User is used.
# ... | ajibawa-2023/Python-Code-Large/train/row_1013 | 12 | 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_1013:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1013:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1013:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1013:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1013:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.db import models
from django.http import Http404
class Person(models.Model):
name = models.CharField(max_length=20)
friends = models.ManyToManyField('self')
idols = models.ManyToManyField('self', symmetrical=False, related_name='stalkers')
def __unicode__(self):
return self.name
d... | ajibawa-2023/Python-Code-Large/train/row_1014 | 26 | 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_1014:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1014:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1014:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1014:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1014:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from django.test import TestCase
from django.utils.functional import curry
class GenericTest(TestCase):
fixtures = ['initial_data.json']
def setUp(self):
self.client.put = curry(self.client.post, REQUEST_METHOD='PUT')
self.client.delete = curry(self.client.get, REQUEST_METHOD='DELETE'... | ajibawa-2023/Python-Code-Large/train/row_1015 | 28 | 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_1015:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1015:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1015:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1015:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1015:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from django.db import models
# Create your models here.
| ajibawa-2023/Python-Code-Large/train/row_1016 | 1 | 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_1016:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [] |
# Create your views here.
| ajibawa-2023/Python-Code-Large/train/row_1017 | 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"] | [] | [] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | ajibawa-2023/Python-Code-Large/train/row_1018 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1018:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1018:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1018:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1018:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1018:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1018:... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | ajibawa-2023/Python-Code-Large/train/row_1019 | 19 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1019:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.2329, 0.0137, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1019:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1019:Return_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1019:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1019:Return_L56_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | ajibawa-2023/Python-Code-Large/train/row_1020 | 53 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1020:Import_L18_C0", "label": "os import os", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0111, 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_1020:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1020:ImportFrom_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1020:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1020:ImportFrom_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | ajibawa-2023/Python-Code-Large/train/row_1021 | 230 | 434 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1021:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0046, 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_1021:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1021:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1021:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1021:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | ajibawa-2023/Python-Code-Large/train/row_1023 | 41 | 316 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1023:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 99], "level": 0, "parent": null, "vector": [8, 0, 0.1582, 0.3133, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1023:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1023:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1023:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1023:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | ajibawa-2023/Python-Code-Large/train/row_1025 | 48 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1025:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0231, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1025:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1025:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1025:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1025:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1... |
#!/usr/bin/python2.4
'''Post a message to twitter'''
__author__ = 'dewitt@google.com'
import ConfigParser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h --help : print this help
--consumer-key : the twit... | ajibawa-2023/Python-Code-Large/train/row_1027 | 82 | 141 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1027:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0213, 0.0071, 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_1027:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1027:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1027:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1027:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | ajibawa-2023/Python-Code-Large/train/row_1028 | 16 | 71 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1028:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2606, 0.0563, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1028:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1028:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1028:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1028:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from astm.version import __version__
try:
from setuptools import setup, find_... | ajibawa-2023/Python-Code-Large/train/row_1031 | 20 | 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_1031:ImportFrom_L11_C0", "label": "from astm.version import __version__", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1618, 0.0147, 0, 0.66, 0.0, 390, 0, 1, 0, 0, 390, 0, 0], "semantic": {"name": "astm.version", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1031:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1031:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1031:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1031:ImportFrom_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Author: Sam Rushing <rushing@nightmare.com>
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
"""
.. module:: astm.asynclib
:synopsis: Forked vers... | ajibawa-2023/Python-Code-Large/train/row_1032 | 482 | 941 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1032:Expr_L12_C0", "label": "expression", "type": "expression", "loc": [12, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0165, 0.0085, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1032:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1032:Try_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1032:Try_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1032:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from collections import Iterable
from .compat import unicode
from .constants import (
STX, ETX, ETB... | ajibawa-2023/Python-Code-Large/train/row_1033 | 138 | 335 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1033:ImportFrom_L10_C0", "label": "from collections import Iterable", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0299, 0.003, 0, 0.66, 0.0, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1033:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1033:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1033:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1033:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import logging
import socket
from .asynclib import Dispatcher, loop
from .codec import decode_message, ... | ajibawa-2023/Python-Code-Large/train/row_1034 | 129 | 256 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1034:Import_L10_C0", "label": "logging import logging", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0391, 0.0039, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1034:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1034:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1034:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1034:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import logging
from .asynclib import AsyncChat, call_later
from .records import HeaderRecord, Terminato... | ajibawa-2023/Python-Code-Large/train/row_1035 | 69 | 107 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1035:Import_L10_C0", "label": "logging import logging", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0935, 0.0093, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1035:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1035:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1035:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1035:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class BaseASTMError(Exception):
"""Base ASTM error."""
class InvalidState(BaseASTMError):
"""... | ajibawa-2023/Python-Code-Large/train/row_1036 | 8 | 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_1036:ClassDef_L10_C0", "label": "BaseASTMError", "type": "class", "loc": [10, 11], "level": 0, "parent": null, "vector": [3, 0, 0.4038, 0.0769, 0, 0.66, 0.0, 305, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "BaseASTMError", "arg_names": [], "import_names": [], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1036:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1036:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1036:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1036:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import logging
import socket
from .asynclib import loop
from .codec import encode
from .constants impor... | ajibawa-2023/Python-Code-Large/train/row_1037 | 132 | 343 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1037:Import_L10_C0", "label": "logging import logging", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0292, 0.0029, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1037:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1037:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1037:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1037:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import datetime
import decimal
import inspect
import time
import warnings
from operator import itemgett... | ajibawa-2023/Python-Code-Large/train/row_1038 | 347 | 523 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1038:Import_L10_C0", "label": "datetime import datetime", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0191, 0.0019, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datet... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1038:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1038:ImportFrom_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1038:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1038:ImportFrom_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.jo... | ajibawa-2023/Python-Code-Large/train/row_1039 | 2 | 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_1039:Assign_L10_C0", "label": "__version_info__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.0667, 0, 0.66, 0.0, 218, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__version_info__", "arg_names": [], "import_nam... | [] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DummyMixIn(object):
_input_buffer = ''
addr = ('localhost', 15200)
def flush(self):... | ajibawa-2023/Python-Code-Large/train/row_1040 | 14 | 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_1040:ClassDef_L11_C0", "label": "DummyMixIn", "type": "class", "loc": [11, 19], "level": 0, "parent": null, "vector": [3, 0, 0.4412, 0.2647, 0, 0.66, 0.0, 587, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "DummyMixIn", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1040:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1040:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1040:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1040:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import os
import sys
import unittest
def suite():
suite = unittest.TestSuite()
for root, dirs,... | ajibawa-2023/Python-Code-Large/train/row_1041 | 19 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1041:Import_L10_C0", "label": "os import os", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.303, 0.0303, 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_1041:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1041:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1041:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1041:For_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
"""Common ASTM records structure.
This module contains base ASTM records mappings with only defined c... | ajibawa-2023/Python-Code-Large/train/row_1042 | 12 | 445 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1042:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 17], "level": 0, "parent": null, "vector": [8, 0, 0.0303, 0.018, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
#: ASTM specification base encoding.
ENCODING = 'latin-1'
#: Message start token.
STX = b'\x02'
#: Mes... | ajibawa-2023/Python-Code-Large/train/row_1043 | 16 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1043:Assign_L11_C0", "label": "ENCODING =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2683, 0.0244, 0, 0.66, 0.0, 1, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ENCODING", "arg_names": [], "import_names": [], "rhs_call... | [] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
"""
``astm.omnilab.server`` - LabOnline server implementation
----------------------------------------... | ajibawa-2023/Python-Code-Large/train/row_1044 | 40 | 385 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1044:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0325, 0.0156, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1044:ClassDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1044:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1044:ClassDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1044:Assign_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
"""
``astm.omnilab.client`` - LabOnline client implementation
----------------------------------------... | ajibawa-2023/Python-Code-Large/train/row_1045 | 27 | 381 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1045:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0328, 0.0157, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1045:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1045:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1045:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1045:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from . import client
from . import server
| ajibawa-2023/Python-Code-Large/train/row_1046 | 2 | 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_1046:ImportFrom_L10_C0", "label": "from import client", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.9091, 0.0909, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": ["client"], "rhs_cal... | [] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from astm import __version__
from astm.mapping import (
Component, ConstantField, ComponentField, D... | ajibawa-2023/Python-Code-Large/train/row_1047 | 33 | 248 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1047:ImportFrom_L10_C0", "label": "from astm import __version__", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0403, 0.004, 0, 0.66, 0.0, 367, 0, 1, 0, 0, 367, 0, 0], "semantic": {"name": "astm", "arg_names": [], "import_names": ["__... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1047:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1047:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1047:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1047:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from .version import __version__, __version_info__
from .exceptions import BaseASTMError, NotAccepted, ... | ajibawa-2023/Python-Code-Large/train/row_1048 | 13 | 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_1048:ImportFrom_L10_C0", "label": "from version import __version__, __version_info__", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.303, 0.0303, 0, 0.66, 0.0, 623, 0, 2, 0, 0, 623, 0, 0], "semantic": {"name": "version", "arg_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1048:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1048:FunctionDef_L30_C4"}] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import sys
version = '.'.join(map(str, sys.version_info[:2]))
if version >= '3.0':
basestring = (... | ajibawa-2023/Python-Code-Large/train/row_1049 | 22 | 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_1049:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0286, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1049:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1049:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1049:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1049:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_104... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | ajibawa-2023/Python-Code-Large/train/row_1050 | 38 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1050:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 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_1050:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1050:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1050:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1050:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | ajibawa-2023/Python-Code-Large/train/row_1051 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1051:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1051:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1051:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1051:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1051:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1051:... |
import os
import sys
import logging
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
# Google App Engine imports.
from google.appengine.ext.webapp import util
# Force Django to reload its settings.
from django.conf import settings
settings._target = None... | ajibawa-2023/Python-Code-Large/train/row_1052 | 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_1052:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 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_1052:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1052:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1052:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1052:Expr_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | ajibawa-2023/Python-Code-Large/train/row_1053 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1053:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1053:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1053:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1053:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1053:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1053:... |
from django.conf.urls.defaults import *
urlpatterns = patterns('',
# Example:
# (r'^16x16/', include('16x16.foo.urls')),
# Uncomment this for admin:
(r'^send/', 'favicon.views.receiver'),
(r'^contrib/', 'favicon.views.contrib'),
(r'^toggler/', 'favicon.views.toggler'),
(r'^update/', 'favicon.views... | ajibawa-2023/Python-Code-Large/train/row_1054 | 2 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1054:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_na... | [] |
#from django.db import models
from google.appengine.ext import db
class Favicon(db.Model):
mimetype = db.StringProperty(required=True)
favicon_bytes = db.BlobProperty(required=True)
active = db.BooleanProperty(default=True)
accesses = db.IntegerProperty(default=0)
created_at = db.DateTimeProperty(auto_now_ad... | ajibawa-2023/Python-Code-Large/train/row_1055 | 35 | 44 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1055:ImportFrom_L2_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0227, 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_1055:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1055:Assign_L5_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1055:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1055:Assign_L6_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from google.appengine.ext import db
from google.appengine.ext.db import djangoforms
import django
from django import http
from django import shortcuts
from django.core import serializers
from favicon.models import Favicon, FaviconURI, Client, Access
# as soon as we have an imagine library......
| ajibawa-2023/Python-Code-Large/train/row_1056 | 7 | 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_1056:ImportFrom_L1_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [],... | [] |
from favicon.models import Favicon, FaviconURI, Client, Access, CountStat, DateCountStat
from datetime import datetime
def inc_total_favicons():
total_favicons = CountStat.get_or_insert("total_favicons")
total_favicons.count += 1
total_favicons.put()
def get_total_favicons():
total_favicons = CountStat.get_by... | ajibawa-2023/Python-Code-Large/train/row_1057 | 54 | 78 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1057:ImportFrom_L1_C0", "label": "from favicon.models import Favicon, FaviconURI, Client\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 211, 0, 6, 0, 0, 211, 0, 0], "semantic": {"name": "favicon.models... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1057:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1057:Assign_L5_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1057:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1057:Expr_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import logging
import sys
from google.appengine.ext import db
from google.appengine.ext.db import djangoforms
import django
from django import http
from django import shortcuts
from datetime import datetime
from urllib import quote
from favicon.models import Favicon, FaviconURI, Client, Access, CountStat, DateCountS... | ajibawa-2023/Python-Code-Large/train/row_1058 | 99 | 137 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1058:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0073, 0.0073, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1058:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1058:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1058:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1058:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Zdenko Podobný
# Author: Zdenko Podobný
#
# 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/LIC... | ajibawa-2023/Python-Code-Large/train/row_1060 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1060:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "an... | [] |
'''
Created on Oct 16, 2012
Refactored on Jul 4, 2013
@author: Nils Amiet
'''
import time
import math
from contextlib import contextmanager
@contextmanager
def timer():
'''Context manager used to wrap some code with a timer and print the execution time at the end'''
timer = Timer()
timer.start()
yiel... | ajibawa-2023/Python-Code-Large/train/row_1061 | 35 | 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_1061:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0565, 0.0968, 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_1061:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1061:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1061:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1061:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
'''
Created on 11 juin 2013
@author: Nils Amiet
'''
from subprocess import Popen, PIPE
import os
class SentiStrength():
'''Wrapper class for SentiStrength java version'''
RUN_COMMAND = "java -jar"
SENTISTRENGTH_PATH = os.path.join(os.path.dirname(__file__), "SentiStrengthCom.jar")
DATA_PATH = os... | ajibawa-2023/Python-Code-Large/train/row_1062 | 25 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1062:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0732, 0.122, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1062:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1062:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1062:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1062:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
#admin.autodiscover()
urlpatterns = patterns('ITInfluence.views',
# Examples:
# url(r'^$', 'InfrarougeTwitterInfluence.views.home', name='home'),
# url(r'^InfrarougeTwi... | ajibawa-2023/Python-Code-Large/train/row_1063 | 2 | 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_1063:ImportFrom_L1_C0", "label": "from django.conf.urls import patterns, include, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 0, 0.66, 0.0, 528, 0, 3, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg... | [] |
# Django settings for InfrarougeTwitterInfluence project.
import os
PROJECT_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'infrarouge': { # SQLite ... | ajibawa-2023/Python-Code-Large/train/row_1064 | 29 | 175 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1064:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0057, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "",... | [] |
"""
WSGI config for InfrarougeTwitterInfluence project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``... | ajibawa-2023/Python-Code-Large/train/row_1065 | 5 | 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_1065:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 15], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.4688, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [] |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "InfrarougeTwitterInfluence.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ajibawa-2023/Python-Code-Large/train/row_1066 | 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_1066:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1066:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1066:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1066:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1066:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1066:... |
'''
Created on 8 juin 2013
@author: Nils Amiet
'''
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import networkx as nx
import math
import random
from django.http.response import HttpResponse
class GraphPlotter():
'''Class used to plot networkx graphs with matplotlib'''
def __in... | ajibawa-2023/Python-Code-Large/train/row_1067 | 137 | 196 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1067:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0153, 0.0255, 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_1067:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1067:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1067:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1067:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# coding: utf-8
'''
Created on 18 juin 2013
@author: Nils Amiet
'''
import nltk
def isEnglishTweet(text):
'''
Checks that the ratio of unknown words in the given text does not exceed a threshold.
Words are checked against an English dictionary of 235k words provided by NLTK
'''
filterList = ["#",... | ajibawa-2023/Python-Code-Large/train/row_1068 | 16 | 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_1068:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1068:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1068:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1068:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1068:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django.db import models
import django.db.models.options as options
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('isTwitterModel',)
# Create your models here.
'''Twitter models'''
class Tweet(models.Model):
class Meta():
isTwitterModel = True
id = models.DecimalField(primary_key=True,... | ajibawa-2023/Python-Code-Large/train/row_1069 | 68 | 89 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1069:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0112, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1069:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1069:ClassDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1069:ClassDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1069:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
# coding: utf-8
'''
Created on 4 jul 2013
@author: Nils Amiet
'''
import unittest
import os, sys
''' Required for running the script from anywhere outside eclipse'''
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append('..')
from SentiStrength.sentistrength import SentiStrength
from Tools.Timer i... | ajibawa-2023/Python-Code-Large/train/row_1070 | 64 | 119 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1070:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0336, 0.042, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1070:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1070:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1070:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1070:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
'''
Created on 13 juin 2013
@author: Nils Amiet
'''
from ITInfluence.models import Tweet
def getAllHashtags():
tweets = Tweet.objects.all().exclude(hashtags="")
hashtags = {}
for tweet in tweets:
currentTweetHashtags = tweet.hashtags.split(" ")
for tag in currentTweetHashtags:
... | ajibawa-2023/Python-Code-Large/train/row_1071 | 24 | 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_1071:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.119, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1071:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1071:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1071:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1071:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
'''
Created on 10 juin 2013
@author: Nils Amiet
'''
import threading
from ITInfluence.models import User, Friendship
from ITInfluence.twitter import TwitterREST
rest = TwitterREST()
def collectRequest(query):
userRequestPerMinute = 1
followersPerRequest = 5000
val = User.objects.raw(query, [follow... | ajibawa-2023/Python-Code-Large/train/row_1072 | 69 | 108 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1072:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0278, 0.0463, 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_1072:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1072:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1072:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1072:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Created on 18 juin 2013
@author: Nils Amiet
'''
from ITInfluence.models import Tweet, User, Friendship
import networkx as nx
import math
class TwitterFollowersGraphBuilder():
'''
Builds the followers graph
'''
def __init__(self):
self.graph = nx.DiGraph()
self.nodeSizes = []
... | ajibawa-2023/Python-Code-Large/train/row_1073 | 83 | 145 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1073:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0207, 0.0345, 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_1073:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1073:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1073:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1073:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# coding: utf-8
'''
Created on 23 mai 2013
@author: Nils Amiet
'''
class PolarityCounter:
polarityCounts = {}
RECEIVED = "recv"
SENT = "sent"
AVERAGE = "avg"
NDI = -1 # network disagreement index
def __init__(self, replies):
'''
Replies: a list of replies with the att... | ajibawa-2023/Python-Code-Large/train/row_1074 | 81 | 127 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1074:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0315, 0.0394, 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_1074:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1074:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1074:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1074:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
'''
Created on 14 juin 2013
@author: Nils Amiet
'''
# coding: utf-8
import networkx as nx
import sqlite3
class InfrarougeGraphBuilder():
userRepliesCounts = {}
graph1 = nx.DiGraph()
userParticipations = []
graph2 = nx.Graph()
def __init__(self, databasePath):
self.infra... | ajibawa-2023/Python-Code-Large/train/row_1075 | 47 | 79 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1075:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.038, 0.0633, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1075:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1075:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1075:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1075:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
'''
Created on 11 juin 2013
@author: Nils Amiet
'''
from ITInfluence.polarity import PolarityCounter
from ITInfluence.models import Tweet, User, Friendship
from ITInfluence.hashtags import getAllHashtags
from InfrarougeTwitterInfluence import settings
import sqlite3
import math
infrarougeDatabasePath = settings.DATA... | ajibawa-2023/Python-Code-Large/train/row_1076 | 178 | 338 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1076:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0089, 0.0148, 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_1076:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1076:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1076:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1076:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Created on 7 juin 2013
@author: Nils Amiet
'''
import threading
import time
import math
from twython import TwythonStreamer, Twython, TwythonRateLimitError
from twython.exceptions import TwythonError
from requests.exceptions import ConnectionError
from django.db import DatabaseError
from ITInfluence.models im... | ajibawa-2023/Python-Code-Large/train/row_1077 | 259 | 435 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1077:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0069, 0.0115, 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_1077:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1077:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1077:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1077:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# Create your views here.
import math
import networkx as nx
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db import connection
from ITInfluence.models import Tweet, User
from ITI... | ajibawa-2023/Python-Code-Large/train/row_1078 | 232 | 412 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1078:Import_L2_C0", "label": "math import math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0024, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1078:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1078:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1078:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1078:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Created on 12 juin 2013
@author: Nils Amiet
'''
# Database routers are used to know which model should be used with which database.
# This is useful in our case because we have multiple databases.
class TwitterRouter():
def db_for_read(self, model, **hints):
if hasattr(model._meta, "isTwitterModel"):... | ajibawa-2023/Python-Code-Large/train/row_1079 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1079:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1071, 0.1786, 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_1079:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1079:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1079:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_1079:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
'''
Created on 23 mars 2013
@author: Nils Amiet
'''
# coding: utf-8
'''
Graph 1:
Replies graph
Weighted directed graph
Weight of edge from A to B = number of replies from user A to user B
Graph 2:
User-Discussion graph
Bipartite graph
Edge from User A to discussion D => user A participates in discussion D
'''
impo... | ajibawa-2023/Python-Code-Large/train/row_1080 | 93 | 200 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1080:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.015, 0.025, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1080:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1080:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1080:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1080:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Created on 23 mai 2013
@author: Nils Amiet
'''
# coding: utf-8
class PolarityCounter:
polarityCounts = {}
RECEIVED = "recv"
SENT = "sent"
AVERAGE = "avg"
NDI = -1 # network disagreement index
def __init__(self, replies):
'''
Replies: a list of replies with the at... | ajibawa-2023/Python-Code-Large/train/row_1081 | 93 | 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_1081:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0205, 0.0342, 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_1081:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1081:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1081:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1081:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
'''
Created on 4 avr. 2013
@author: Nils Amiet
'''
# coding: utf-8
graph1Path = "graph1.gml"
graph2Path = "graph2.gml"
rankingsFile = "rankings.html"
import networkx as nx
import networkx.readwrite.gml as gml
import operator
import math
import copy
import os
import sys
import sqlite3
''' Required for running the ... | ajibawa-2023/Python-Code-Large/train/row_1082 | 319 | 522 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1082:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0057, 0.0096, 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_1082:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1082:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1082:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1082:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Created on 8 avr. 2013
@author: Nils Amiet
'''
# coding: utf-8
class HTMLTableGenerator:
infrarougeUserURL = "http://www.infrarouge.ch/ir/member-"
tableBorder = 1
def __init__(self, th=[], rows=[], title="Untitled page", users=None):
self.th = th
self.rows = rows
sel... | ajibawa-2023/Python-Code-Large/train/row_1083 | 38 | 114 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1083:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0263, 0.0439, 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_1083:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1083:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1083:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1083:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | ajibawa-2023/Python-Code-Large/train/row_1084 | 38 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1084:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0532, 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_1084:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1084:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1084:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1084:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | ajibawa-2023/Python-Code-Large/train/row_1085 | 65 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1085:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0304, 0.0522, 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_1085:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1085:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1085:FunctionDef_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_1085:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | ajibawa-2023/Python-Code-Large/train/row_1086 | 58 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1086:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0521, 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_1086:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1086:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1086:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1086:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | ajibawa-2023/Python-Code-Large/train/row_1087 | 25 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1087:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.1111, 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_1087:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1087:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1087:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1087:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | ajibawa-2023/Python-Code-Large/train/row_1088 | 54 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1088:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0261, 0.0435, 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_1088:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1088:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1088:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1088:FunctionDef_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Larg... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | ajibawa-2023/Python-Code-Large/train/row_1089 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1089:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1905, 0.3333, 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_1089:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1089:Expr_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1089:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1089:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/... |
#!/usr/bin/env python
# Copyright 2010 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 la... | ajibawa-2023/Python-Code-Large/train/row_1090 | 52 | 97 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1090:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1753, 0.0103, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1090:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1090:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1090:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1090:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# Copyright 2010 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 la... | ajibawa-2023/Python-Code-Large/train/row_1091 | 22 | 48 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1091:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3542, 0.0208, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1091:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1091:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1091:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1091:Expr_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
# Copyright 2010 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 la... | ajibawa-2023/Python-Code-Large/train/row_1092 | 26 | 59 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1092:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2881, 0.0169, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1092:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1092:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1092:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1092:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# Copyright 2010 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 la... | ajibawa-2023/Python-Code-Large/train/row_1093 | 11 | 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_1093:Import_L17_C0", "label": "base64 import base64", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0294, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1093:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1093:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1093:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1093:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: UTF-8 -*-
from google.appengine.ext import deferred
from notifiy import email
from notifiy import model
from notifiy import phone
from notifiy import templates
def notify_created(wavelet, blip, modified_by):
"""Sends a created notification to all participants except the modified_by"""
for par... | ajibawa-2023/Python-Code-Large/train/row_1095 | 37 | 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_1095:ImportFrom_L3_C0", "label": "from google.appengine.ext import deferred", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0469, 0.0156, 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_1095:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1095:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1095:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1095:For_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
# -*- coding: UTF-8 -*-
from google.appengine.ext import db
from google.appengine.ext import deferred
from notifiy import email
from notifiy import gadget
from notifiy import preferences
from notifiy import templates
from notifiy import model
def wavelet_init(wavelet, modified_by):
"""Initialize the wavelet"""
... | ajibawa-2023/Python-Code-Large/train/row_1096 | 47 | 75 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_1096:ImportFrom_L3_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0133, 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_1096:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1096:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1096:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1096:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.