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 |
|---|---|---|---|---|---|---|---|
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_79809 | 6 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79809:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 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_79809:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79809:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79809:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79809:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
from django.conf.urls.defaults import *
urlpatterns = patterns('dashboard.views',
(r'^$', 'renderDashboard'),
)
| ajibawa-2023/Python-Code-Large/train/row_79810 | 2 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79810:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names":... | [] |
from django.shortcuts import render_to_response
from django.contrib.auth.models import User
from userattributes.models import Attribute, UserAttribute
from waivers.models import Waiver, UserWaiver
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from checkin.models im... | ajibawa-2023/Python-Code-Large/train/row_79811 | 125 | 154 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79811:ImportFrom_L1_C0", "label": "from django.shortcuts import render_to_response", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79811:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79811:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79811:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79811:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code... |
from django.db import models
from django.contrib.auth.models import User
class Waiver(models.Model):
name = models.CharField(unique=True, max_length=50, default='')
content = models.TextField()
required = models.BooleanField()
date = models.DateField(auto_now_add=True)
class UserWaiver(models.Model):... | ajibawa-2023/Python-Code-Large/train/row_79812 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79812:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79812:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79812:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79812:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79812:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_79813 | 6 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79813:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 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_79813:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79813:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79813:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79813:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
from django.conf.urls.defaults import *
urlpatterns = patterns('waivers.views',
(r'^$', 'listSelf'),
(r'^signed/(?P<user_id>\d+)$', 'listSigned'),
(r'^unsigned/(?P<user_id>\d+)$', 'listUnsigned'),
(r'^view/(?P<waiver_id>\d+)/(?P<user_id>\d+)$', 'view'),
(r'^sign/(?P<waiver_id>\d+)$', 'sign')... | ajibawa-2023/Python-Code-Large/train/row_79814 | 2 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79814:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n... | [] |
import profile
import datetime
from django.template import RequestContext
from django import forms
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django import forms
from django.core.context_processors import csrf
from django.contrib.auth.decorators import login_requir... | ajibawa-2023/Python-Code-Large/train/row_79815 | 98 | 138 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79815:Import_L1_C0", "label": "profile import profile", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0072, 0.0072, 0, 0.66, 0.0, 924, 0, 1, 0, 0, 924, 0, 0], "semantic": {"name": "profile", "arg_names": [], "import_names": ["profile"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79815:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79815:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79815:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79815:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.contrib import admin
from waivers.models import Waiver
#TODO Fix field size of contents for waivers
class WaiversAdmin(admin.ModelAdmin):
list_display = ('name', 'date')
list_filter = ['date']
date_hierarchy = 'date'
search_fields = ['name']
admin.site.register(Waiver, WaiversA... | ajibawa-2023/Python-Code-Large/train/row_79816 | 8 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79816:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79816:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79816:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79816:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79816:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django.contrib.auth.models import User
from django.db import models
SCALES = (
('H', 'Huecos'),
('Y', 'Yosemite Decimal System'),
)
VERMIN = (
('', 'Choose A Rating'),
('V0', 'V0'),
('V1', 'V1'),
('V2', 'V2'),
('V3', 'V3'),
('V4', 'V4'),
('V5', 'V5'),
('V6', 'V6'),
... | ajibawa-2023/Python-Code-Large/train/row_79817 | 39 | 106 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79817:ImportFrom_L1_C0", "label": "from django.contrib.auth.models import User", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0094, 0, 0.66, 0.0, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "django.contrib.auth.models", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79817:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79817:Assign_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79817:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79817:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_79818 | 6 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79818:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 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_79818:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79818:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79818:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79818:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
from django.conf.urls.defaults import *
urlpatterns = patterns('routes.views',
(r'^$', 'listRegions'),
(r'^listquotas/$', 'listQuotas'),
(r'^listregions/$', 'listRegions'),
(r'^editquota/(?P<region_id>\d+)/$', 'addRemoveQuotas'),
(r'^addroute/(?P<region_id>\d+)/$', 'addRoute'),
(r'^allroutes/(?P<activ... | ajibawa-2023/Python-Code-Large/train/row_79819 | 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_79819: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_n... | [] |
##TODO Rate routes, edit routes (mainly set as active/inactive), and better viewing quotas.
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
from django.contrib.auth.models import User
from django import forms
from django.template import RequestContext
from django.http im... | ajibawa-2023/Python-Code-Large/train/row_79820 | 281 | 475 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79820:ImportFrom_L3_C0", "label": "from django.shortcuts import render_to_response", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0063, 0.0021, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79820:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79820:Expr_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79820:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79820:FunctionDef_L82_C1"}, {"f": "ajibawa-2023/Python-Code-... |
from django.contrib import admin
from routes.models import Region, Setter
#TODO Fix field size of contents for waivers
class RouteRegionAdmin(admin.ModelAdmin):
list_display = ('name', 'type',)
list_filter = ['name','type']
search_fields = ['name']
class RouteSetterAdmin(admin.ModelAdmin):
... | ajibawa-2023/Python-Code-Large/train/row_79821 | 12 | 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_79821:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79821:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79821:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79821:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79821:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django.db import models
# Create your models here.
| ajibawa-2023/Python-Code-Large/train/row_79822 | 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_79822: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": ["... | [] |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_79823 | 6 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79823:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 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_79823:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79823:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79823:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79823:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
from django.conf.urls.defaults import *
urlpatterns = patterns('analytics.views',
(r'^$', 'overview'),
(r'^hourly/$', 'hourly'),
(r'^daily/$', 'daily'),
(r'^historical/$', 'historical'),
(r'^current/$', 'current_processor'),
)
| ajibawa-2023/Python-Code-Large/train/row_79824 | 2 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79824:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_n... | [] |
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from checkin.models import Event
from django.contrib.auth.models import User
from datetime import datetime
from datetime import timedelta
from django.template import RequestContext
from soci... | ajibawa-2023/Python-Code-Large/train/row_79825 | 114 | 165 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79825:ImportFrom_L1_C0", "label": "from django.http import HttpResponse", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0061, 0, 0.66, 0.0, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79825:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79825:Assign_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79825:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79825:Assign_L17_C1"}, {"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 ha... | ajibawa-2023/Python-Code-Large/train/row_79826 | 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_79826: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_79826:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79826:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79826:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79826:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_79827 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79827:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79827:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79827:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79827:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79827:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- mode:python -*-
# Copyright (C) 1998-2011 by Galerna Project, the University of
# Cantabria, Spain.
#
# This file is part of the TOPAZ network simulator, originallty developed
# at the Unviersity of Cantabria
#
# TOPAZ shares a large proportion of code with SICOSYS which was
# developed by V.Puente and J.M.Pr... | ajibawa-2023/Python-Code-Large/train/row_79828 | 113 | 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_79828:Import_L55_C0", "label": "os import os, subprocess", "type": "import", "loc": [55, 55], "level": 0, "parent": null, "vector": [1, 0, 0.3143, 0.0057, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "subp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79828:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79828:Expr_L61_C4"}] |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | ajibawa-2023/Python-Code-Large/train/row_79829 | 90 | 249 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79829:Expr_L46_C0", "label": "expression", "type": "expression", "loc": [46, 47], "level": 0, "parent": null, "vector": [8, 0, 0.1867, 0.008, 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_79829:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79829:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79829:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79829:If_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
#
# Run the script with path to the JSON file you downloaded from google.drive.
# eg. checkin.py ~/Downloads/GmailDelaySendWeb.json
#
# Script will unpack JSON and edit/updates files in git for you.
#
# REMEMBER: You still need to commit & push
import json
import os
import sys
from subprocess import c... | ajibawa-2023/Python-Code-Large/train/row_79830 | 25 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79830:Import_L9_C0", "label": "json import json", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1915, 0.0213, 0, 0.66, 0.0, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["json"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79830:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79830:If_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79830:If_L15_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_79830:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
#!/usr/bin/env python
"""
on stdin get output of a textql query result looking like this:
((1005442),['jpeg'|'jpeg'|'jpeg'|'jpeg'],'1005/442/TODERAS 038.jpg',['Della Ross'],'Della Ross',['TODERAS 038.jpg'|'TODERAS 038.thumb.jpg'|'TODERAS 038.200x200.jpg'|'TODERAS 038.520x520.jpg'],[164087|12094|24625|165652])
fileds a... | ajibawa-2023/Python-Code-Large/train/row_79831 | 41 | 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_79831:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0986, 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_79831:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79831:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79831:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79831:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
"""
Thu May 1 11:33:51 EST 2014
on stdin get date/time data extracted from "irn" file formatted like this:
30/07/2006,16:02
Convert to list of datetime objects and print most recent formatted like this:
2006/07/30 16:02
"""
import sys
from datetime import datetime
datetimes = []
for line... | ajibawa-2023/Python-Code-Large/train/row_79832 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79832:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
#!/usr/bin/env python
"""
on stdin get output of a textql query result looking like this:
((1005442),['jpeg'|'jpeg'|'jpeg'|'jpeg'],'1005/442/TODERAS 038.jpg',['Della Ross'],'Della Ross',['TODERAS 038.jpg'|'TODERAS 038.thumb.jpg'|'TODERAS 038.200x200.jpg'|'TODERAS 038.520x520.jpg'],[164087|12094|24625|165652])
fileds a... | ajibawa-2023/Python-Code-Large/train/row_79833 | 41 | 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_79833:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0986, 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_79833:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79833:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79833:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79833:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
"""
Thu May 1 11:33:51 EST 2014
on stdin get date/time data extracted from "irn" file formatted like this:
30/07/2006,16:02
Convert to list of datetime objects and print most recent formatted like this:
2006/07/30 16:02
"""
import sys
from datetime import datetime
datetimes = []
for line... | ajibawa-2023/Python-Code-Large/train/row_79834 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79834:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
#!/usr/bin/env python
"""
on stdin get output of a textql query result looking like this:
((1005442),['jpeg'|'jpeg'|'jpeg'|'jpeg'],'1005/442/TODERAS 038.jpg',['Della Ross'],'Della Ross',['TODERAS 038.jpg'|'TODERAS 038.thumb.jpg'|'TODERAS 038.200x200.jpg'|'TODERAS 038.520x520.jpg'],[164087|12094|24625|165652])
fileds a... | ajibawa-2023/Python-Code-Large/train/row_79835 | 41 | 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_79835:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0986, 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_79835:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79835:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79835:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79835:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
"""
Thu May 1 11:33:51 EST 2014
on stdin get date/time data extracted from "irn" file formatted like this:
30/07/2006,16:02
Convert to list of datetime objects and print most recent formatted like this:
2006/07/30 16:02
"""
import sys
from datetime import datetime
datetimes = []
for line... | ajibawa-2023/Python-Code-Large/train/row_79836 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79836:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
#!/usr/bin/env python
"""
on stdin get output of a textql query result looking like this:
((1005442),['jpeg'|'jpeg'|'jpeg'|'jpeg'],'1005/442/TODERAS 038.jpg',['Della Ross'],'Della Ross',['TODERAS 038.jpg'|'TODERAS 038.thumb.jpg'|'TODERAS 038.200x200.jpg'|'TODERAS 038.520x520.jpg'],[164087|12094|24625|165652])
fileds a... | ajibawa-2023/Python-Code-Large/train/row_79837 | 41 | 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_79837:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0986, 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_79837:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79837:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79837:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79837:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
"""
Thu May 1 11:33:51 EST 2014
on stdin get date/time data extracted from "irn" file formatted like this:
30/07/2006,16:02
Convert to list of datetime objects and print most recent formatted like this:
2006/07/30 16:02
"""
import sys
from datetime import datetime
datetimes = []
for line... | ajibawa-2023/Python-Code-Large/train/row_79838 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79838:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
table_name = sys.argv[1]
model = sys.argv[2]
job_num = int(sys.argv[3])
def move_masks(model):
thisdir = os.getcwd()
targetdir = thisdir.replace(model, 'masks')
if not os.path.isdir(targetdir):
os.system('mkdir '+targetdir)
os.s... | ajibawa-2023/Python-Code-Large/train/row_79839 | 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_79839:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0312, 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_79839:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79839:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79839:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79839:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
from mysql_class import *
import numpy as np
import healpy as hp
from create_healpy_map import *
dba = 'catalog'
pwd = 'visitor'
usr = 'visitor'
cursor = mysql_connect(dba, usr, pwd)
tablename = 'CAST'
NSIDE = 256
cmd = "create table %s_healpy (galcount int primary key, ra_gal float default -999, dec_gal float ... | ajibawa-2023/Python-Code-Large/train/row_79840 | 23 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79840:ImportFrom_L1_C0", "label": "from mysql_class import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "mysql_class", "arg_names": [], "import_names": ["*"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79840:For_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79840:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79840:For_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79840:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#!/usr/bin/python
import os
import itertools
import pyfits
import datetime
import sys
import string
import numpy as np
import healpy as hp
from optparse import OptionParser, OptParseError
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
from generate_table import *
from create_healpy_map i... | ajibawa-2023/Python-Code-Large/train/row_79841 | 73 | 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_79841:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0087, 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_79841:For_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79841:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79841:For_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79841:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#!/usr/bin/python
import os
import itertools
import pyfits
import datetime
import sys
import string
from optparse import OptionParser, OptParseError
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
# create table to hold matches temporarily
def create_temp_table(cursor, tablename=None):
... | ajibawa-2023/Python-Code-Large/train/row_79842 | 131 | 206 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79842:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0146, 0.0049, 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_79842:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79842:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79842:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79842:If_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import numpy as np
import healpy as hp
import itertools
def get_crossmatch(formatch, backmatch):
"""the crossmatches should have the nearest neighbor matches be equivalet in either direction, so we test this"""
matches = []
reverse = False
if len(formatch.keys())<len(backmatch.keys()):
prime_ca... | ajibawa-2023/Python-Code-Large/train/row_79843 | 110 | 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_79843:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79843:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79843:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79843:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79843:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from mysql_class import *
import os
import itertools
import pyfits
import datetime
import sys
import string
dba = 'information_schema'
pwd = 'pymorph'
usr = 'pymorph'
cursor = mysql_connect(dba, usr, pwd)
cmd = 'select table_name, TABLE_SCHEMA from tables;'
tables = cursor.get_data_dict(cmd, ['table_name','database'... | ajibawa-2023/Python-Code-Large/train/row_79844 | 18 | 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_79844:ImportFrom_L1_C0", "label": "from mysql_class import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "mysql_class", "arg_names": [], "import_names": ["*... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79844:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79844:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79844:For_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79844:Expr_L23_C4"}] |
#!/usr/bin/python
import os
import itertools
import pyfits
import datetime
import sys
import string
from optparse import OptionParser, OptParseError
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
# create table to hold matches temporarily
def create_temp_table(cursor, tablename=None):
... | ajibawa-2023/Python-Code-Large/train/row_79845 | 131 | 206 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79845:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0146, 0.0049, 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_79845:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79845:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79845:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79845:If_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
import os
import itertools
import pyfits
import datetime
import sys
import string
import numpy as np
import healpy as hp
from optparse import OptionParser, OptParseError
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
from generate_table import *
from create_healpy_map i... | ajibawa-2023/Python-Code-Large/train/row_79846 | 73 | 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_79846:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0087, 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_79846:For_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79846:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79846:For_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79846:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#!/usr/bin/python
import sys
for a in ['/home/ameert/alans-image-processing-pipeline/matching',
'/home/ameert/python/lib64/python2.6/site-packages/CosmoloPy-0.1.103-py2.6-linux-x86_64.egg',
'/home/ameert/python/lib/python2.6/site-packages/scikits.bootstrap-0.2dev-py2.6.egg',
'/home/ameert/python/lib/python2.6/site-pa... | ajibawa-2023/Python-Code-Large/train/row_79847 | 54 | 121 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79847:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.0083, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79847:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79847:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79847:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79847:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#!/usr/bin/python
import sys
for a in ['/home/ameert/alans-image-processing-pipeline/matching',
'/home/ameert/python/lib64/python2.6/site-packages/CosmoloPy-0.1.103-py2.6-linux-x86_64.egg',
'/home/ameert/python/lib/python2.6/site-packages/scikits.bootstrap-0.2dev-py2.6.egg',
'/home/ameert/python/lib/python2.6/site-pa... | ajibawa-2023/Python-Code-Large/train/row_79848 | 54 | 121 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79848:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.0083, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79848:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79848:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79848:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79848:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
table_name = sys.argv[1]
model = sys.argv[2]
job_num = int(sys.argv[3])
def move_masks(model):
thisdir = os.getcwd()
targetdir = thisdir.replace(model, 'masks')
if not os.path.isdir(targetdir):
os.system('mkdir '+targetdir)
os.s... | ajibawa-2023/Python-Code-Large/train/row_79849 | 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_79849:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0312, 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_79849:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79849:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79849:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79849:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
import subprocess as sub
import pickle
def exec_cmd(job_str):
p1=sub.Popen(job_str, shell=True, stdout = sub.PIPE)
output = p1.communicate()[0]
output = output.strip()
return output
def IsInt(s):
try:
int(s)
return True
except ValueError:
return False
def pickle_data(... | ajibawa-2023/Python-Code-Large/train/row_79850 | 26 | 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_79850:Import_L1_C0", "label": "subprocess import sub", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sub"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79850:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79850:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79850:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79850:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from grid_management.utilities.utilities import *
| ajibawa-2023/Python-Code-Large/train/row_79851 | 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_79851:ImportFrom_L1_C0", "label": "from grid_management.utilities.utilities import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 360, 0, 1, 0, 0, 360, 0, 0], "semantic": {"name": "grid_management.utilities.util... | [] |
import sys
import os
import grid_management.SGE as SGE
from grid_management.job_manager.is_complete import *
# for job submission
def sub_job(jobs, running_jobs):
key_to_pop = sorted(jobs.keys(), key=lambda job_key: int(job_key[-4:]))[0]
job_to_pop = jobs[key_to_pop]
# tranfser the data
#os.system('rs... | ajibawa-2023/Python-Code-Large/train/row_79852 | 27 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79852:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79852:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79852:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79852:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79852:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import sys
import time
import grid_management.utilities as ut
import grid_management.SGE as SGE
from grid_management.job_manager.prep_job import job_creator
from grid_management.job_manager.mon_queue import mon_queue
from grid_management.job_manager.batch_functions import *
################################... | ajibawa-2023/Python-Code-Large/train/row_79853 | 48 | 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_79853:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0104, 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_79853:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79853:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79853:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79853:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#++++++++++++++++++++++++++
#
# TITLE: settings.py
#
# PURPOSE: Holds the configuration settings
# for run_batch.py
# It is imported by run_batch.py at run-time
#
# INPUTS: NONE
#
# OUTPUTS: NONE
#
# PROGRAM CALLS: NONE
#
# BY: Alan Meert
# Department of Physics and Astronomy
# University of ... | ajibawa-2023/Python-Code-Large/train/row_79854 | 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_79854:Assign_L27_C0", "label": "username =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.6429, 0.0238, 0, 0.66, 0.0, 718, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "username", "arg_names": [], "import_names": [], "rhs_c... | [] |
import os
import sys
def clean_dir(targetdir = './', do_all = 0):
"""This function removes files typically produced by PyMorph. You can choose between most or all PyMorph files."""
to_remove = ['OEM_*.fits', 'SO_*.fits', 'R_*.html', 'seg.fits',
'SegCat.cat', 'index.html', 'restart.cat', 'P... | ajibawa-2023/Python-Code-Large/train/row_79855 | 12 | 25 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79855:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79855:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79855:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79855:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79855:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import os
import numpy as np
def loadnames(infile):
a = open(infile)
names = []
a.readline()
for line in a.readlines():
line = line.split()
names.append(line[0])
a.close()
return names
def check_done(incat, outcat, doneness= 0.05):
indat = loadnames(incat)
try:
... | ajibawa-2023/Python-Code-Large/train/row_79856 | 31 | 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_79856:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 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_79856:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79856:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79856:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79856:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#++++++++++++++++++++++++++
#
# TITLE: job_manager
#
# PURPOSE: This module contains all the scripts
# I use on the cluster. It is desgned
# to be extendable although I currently
# only use it for pymorph jobs
#
# INPUTS: NONE, BUT make sure the module is in your
# PYTHONPATH
#
# OUT... | ajibawa-2023/Python-Code-Large/train/row_79857 | 1 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79857:ImportFrom_L34_C0", "label": "from grid_management.job_manager.run_batch import *", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.9444, 0.0278, 0, 0.66, 0.0, 282, 0, 1, 0, 0, 282, 0, 0], "semantic": {"name": "grid_management.job... | [] |
import os
import sys
import time
import grid_management.utilities as ut
import grid_management.SGE as SGE
# for monitoring jobs
def mon_queue(minnumqueuedtorun, maxnumqueuedtorun, maxwaiting, username):
h_str = """qstat | grep '%s' | grep -c 'hqw'""" %username
while int(ut.exec_cmd(h_str))>0: #while ... | ajibawa-2023/Python-Code-Large/train/row_79858 | 27 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79858:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 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_79858:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79858:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79858:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79858:While_L10_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#++++++++++++++++++++++++++
#
# TITLE: prep_job.py
#
# PURPOSE: contains the job_creator class
# used to create jobs for the cluster
#
# INPUTS: NONE
#
# OUTPUTS: NONE
#
# PROGRAM CALLS: NONE
#
# BY: Alan Meert
# Department of Physics and Astronomy
# University of Pennsylvania
#
# FOR: FOLIO cluster
#... | ajibawa-2023/Python-Code-Large/train/row_79859 | 126 | 247 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79859:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.004, 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_79859:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79859:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79859:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79859:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-... |
#++++++++++++++++++++++++++
#
# TITLE: grid_management
#
# PURPOSE: This module contains all the scripts
# I use on the cluster for job management.
# It is desgned to be extendable although
# I currently only use it for pymorph jobs
#
# INPUTS: NONE, BUT make sure the module is in your
# ... | ajibawa-2023/Python-Code-Large/train/row_79860 | 3 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79860:Import_L34_C0", "label": "grid_management.job_manager import job_manager", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.8947, 0.0263, 0, 0.66, 0.0, 706, 0, 1, 0, 0, 706, 0, 0], "semantic": {"name": "grid_management.job_manager"... | [] |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
import subprocess as sub
import time
def IsInt(s):
try:
int(s)
return True
except ValueError:
return False
def getactive(username='*'):
qstatin="""qstat -u '%s'""" %(username)
p1=sub.Popen(qstatin, shell=True, st... | ajibawa-2023/Python-Code-Large/train/row_79861 | 26 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79861:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.02, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79861:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79861:Try_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79861:Try_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79861:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
import time
from grid_management.utilities import exec_cmd, IsInt
def nicecount(username):
qstatin="""qstat -u '*'"""
countsAll = {'r':0,'qw':0,'h':0,'s':0,'e':0, 'hqw':0, 'total':0}
countsMe = {'r':0,'qw':0,'h':0,'s':0,'e':0, 'hqw':0, 'tota... | ajibawa-2023/Python-Code-Large/train/row_79862 | 26 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79862:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79862:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79862:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79862:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79862:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
import subprocess as sub
import time
def IsInt(s):
try:
int(s)
return True
except ValueError:
return False
def getactive(username='*'):
qstatin="""qstat -u '%s'""" %(username)
p1=sub.Popen(qstatin, shell=True, st... | ajibawa-2023/Python-Code-Large/train/row_79863 | 26 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79863:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.02, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79863:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79863:Try_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79863:Try_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79863:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import os
import sys
import time
from grid_management.utilities import exec_cmd
def ezdel(username, conditions):
"""This function will delete anything belonging to the user in the queue satisfying the conditions passed by the user. If no conditions are present, it tries to delete every job beloging to the user.""... | ajibawa-2023/Python-Code-Large/train/row_79864 | 30 | 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_79864:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 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_79864:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79864:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79864:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79864:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
#++++++++++++++++++++++++++
#
# TITLE: SGE
#
# PURPOSE: This module contains all the scripts
# used for automated interaction with the
# queue.
#
# INPUTS: NONE, BUT make sure the module is in your
# PYTHONPATH
#
# OUTPUTS: Depends on the program being run....
# Generally, there is l... | ajibawa-2023/Python-Code-Large/train/row_79865 | 3 | 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_79865:ImportFrom_L33_C0", "label": "from grid_management.SGE.getactive import *", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.9429, 0.0286, 0, 0.66, 0.0, 815, 0, 1, 0, 0, 815, 0, 0], "semantic": {"name": "grid_management.SGE.getacti... | [] |
#!/data2/home/ameert/python/bin/python2.5
import os
import sys
import time
from grid_management.utilities import exec_cmd, IsInt
def nicecount(username):
qstatin="""qstat -u '*'"""
countsAll = {'r':0,'qw':0,'h':0,'s':0,'e':0, 'hqw':0, 'total':0}
countsMe = {'r':0,'qw':0,'h':0,'s':0,'e':0, 'hqw':0, 'tota... | ajibawa-2023/Python-Code-Large/train/row_79866 | 26 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79866:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79866:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79866:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79866:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79866:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
### First the imports ####
from download_files import *
from prepare_psf import *
from cut_images import *
import os
import sys
import numpy as np
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
### Now set the essential variables ###
### mysql info ###
table_name = 'CA... | ajibawa-2023/Python-Code-Large/train/row_79867 | 7 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79867:ImportFrom_L1_C0", "label": "from download_files import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "download_files", "arg_names": [], "import_nam... | [] |
#++++++++++++++++++++++++++
#
# TITLE: download_files
#
# PURPOSE: This program downloads data
# for galaxies from sdss in all
# bands that are selected.
#
# INPUTS: gal: dictionary containing at least these entries
# index: the index number used for naming the galaxy
# run... | ajibawa-2023/Python-Code-Large/train/row_79868 | 27 | 120 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79868:Import_L33_C0", "label": "os import os", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.275, 0.0083, 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_79868:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79868:For_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79868:For_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79868:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
import numpy as np
import pyfits
import os
def cut_images(gal, bands, data_stem, out_path, cut_size = 20.0,
pix_scale = 0.396, min_size = 80.0):
for band_char in bands:
if band_char == 'u':
band = 1
elif band_char == 'g':
band = 2
elif band_char ==... | ajibawa-2023/Python-Code-Large/train/row_79869 | 90 | 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_79869:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0079, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79869:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79869:For_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79869:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79869:If_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
from numpy import *
import pyfits as pf
import os
def prepare_psf(gal, bands, data_stem, out_path):
for band_char in bands:
if band_char == 'u':
band = 1
elif band_char == 'g':
band = 2
elif band_char == 'r':
band = 3
elif band_char == 'i':
... | ajibawa-2023/Python-Code-Large/train/row_79870 | 41 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79870:ImportFrom_L1_C0", "label": "from numpy import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["*"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79870:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79870:For_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79870:For_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79870:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
#!/usr/bin/python
### First the imports ####
from download_files import *
from prepare_psf import *
from cut_images import *
import os
import sys
import numpy as np
sys.path.append('/home/ameert/python/alan_code/')
from mysql_class import *
### Now set the essential variables ###
### mysql info ###
table_name = 'CA... | ajibawa-2023/Python-Code-Large/train/row_79871 | 7 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79871:ImportFrom_L1_C0", "label": "from download_files import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "download_files", "arg_names": [], "import_nam... | [] |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | ajibawa-2023/Python-Code-Large/train/row_79874 | 6 | 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_79874:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4545, 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":... | [] |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | ajibawa-2023/Python-Code-Large/train/row_79875 | 31 | 48 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79875:Import_L15_C0", "label": "datetime import datetime", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.3125, 0.0208, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["date... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79875:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79875:Expr_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79875:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79875:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | ajibawa-2023/Python-Code-Large/train/row_79876 | 640 | 1,152 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79876:Expr_L16_C0", "label": "expression", "type": "expression", "loc": [16, 32], "level": 0, "parent": null, "vector": [8, 0, 0.0208, 0.0148, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79876:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79876:Expr_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79876:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79876:FunctionDef_L98_C2"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | ajibawa-2023/Python-Code-Large/train/row_79877 | 172 | 294 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79877:Import_L15_C0", "label": "logging import logging, json", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.051, 0.0034, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["lo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79877:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79877:FunctionDef_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79877:FunctionDef_L27_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_79877:Assign_L29_C6"}, {"f": "ajibawa-2023/Python-... |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | ajibawa-2023/Python-Code-Large/train/row_79878 | 75 | 126 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79878:Import_L15_C0", "label": "os import os, logging", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.119, 0.0079, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "logging"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79878:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79878:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79878:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79878:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | ajibawa-2023/Python-Code-Large/train/row_79879 | 77 | 224 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79879:Expr_L46_C0", "label": "expression", "type": "expression", "loc": [46, 47], "level": 0, "parent": null, "vector": [8, 0, 0.2076, 0.0089, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79879:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79879:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79879:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79879:If_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# Python script to get both the data and resource fork from a BinHex encoded
# file.
# Author: Taro Muraoka
# Last Change: 2003 Oct 25
import sys
import binhex
input = sys.argv[1]
conv = binhex.HexBin(input)
info = conv.FInfo
out = conv.FName
out_data = out
out_rsrc = out + '.rsrcfork'
#print 'out_rsrc=' + out_rsrc
p... | ajibawa-2023/Python-Code-Large/train/row_79880 | 28 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79880:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.025, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79880:While_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79880:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79880:While_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79880:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_79881 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79881:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79881:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79881:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79881:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_79881:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-... |
#====================================================================
# 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_79883 | 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_79883: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_79883:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79883:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79883:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79883:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | ajibawa-2023/Python-Code-Large/train/row_79884 | 189 | 572 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79884:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0297, 0.0017, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79884:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79884:Expr_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79884:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79884:Return_L54_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | ajibawa-2023/Python-Code-Large/train/row_79885 | 133 | 305 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79885:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0033, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79885:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79885:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79885:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79885:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | ajibawa-2023/Python-Code-Large/train/row_79887 | 8 | 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_79887:Assign_L3_C0", "label": "manual_verstr =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 189, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "manual_verstr", "arg_names": [], "import_names": [],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79887:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79887:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79887:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79887:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | ajibawa-2023/Python-Code-Large/train/row_79888 | 9 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79888:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.3, 0.575, 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_79888:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79888:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79888:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79888:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | ajibawa-2023/Python-Code-Large/train/row_79889 | 10 | 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_79889:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.2927, 0.561, 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_79889:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79889:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79889:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79889:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | ajibawa-2023/Python-Code-Large/train/row_79891 | 155 | 366 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79891:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0451, 0.0765, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79891:Try_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79891:Import_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79891:Try_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79891:Try_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79892 | 348 | 953 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79892:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0173, 0.0042, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79892:Try_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79892:ImportFrom_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79892:Try_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79892:ImportFrom_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79893 | 38 | 92 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79893:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1848, 0.0543, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79893:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79893:Import_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79893:Try_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79893:Try_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79894 | 55 | 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_79894:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1491, 0.0439, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79894:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79894:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79894:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79894:FunctionDef_L34_C2"}, {"f": "ajibawa-2023/Python-Cod... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79895 | 214 | 544 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79895:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0303, 0.0074, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79895:Try_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79895:Import_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79895:Try_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79895:Try_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 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 ... | ajibawa-2023/Python-Code-Large/train/row_79896 | 90 | 253 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79896:Import_L18_C0", "label": "base64 import base64", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0711, 0.004, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79896:Try_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79896:Import_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79896:Try_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79896:Try_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79897 | 37 | 113 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79897:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1504, 0.0442, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79897:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79897:Import_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79897:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79897:Try_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | ajibawa-2023/Python-Code-Large/train/row_79898 | 115 | 168 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79898:Import_L1_C0", "label": "Cookie import Cookie", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 32, 0, 1, 0, 0, 32, 0, 0], "semantic": {"name": "Cookie", "arg_names": [], "import_names": ["Cookie"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79898:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79898:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79898:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_79898:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | ajibawa-2023/Python-Code-Large/train/row_79899 | 57 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79899:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0814, 0.1105, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79899:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79899:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79899:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79899:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79900 | 374 | 940 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79900:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0186, 0.0064, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79900:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79900:Expr_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79900:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79900:FunctionDef_L54_C2"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79901 | 201 | 483 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79901:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0083, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79901:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79901:ImportFrom_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79901:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79901:ImportFrom_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | ajibawa-2023/Python-Code-Large/train/row_79902 | 145 | 366 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79902:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0546, 0.0191, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79902:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79902:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79902:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79902:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79904 | 28 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79904:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.2619, 0.0635, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79904:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79904:Expr_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79904:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79904:FunctionDef_L31_C2"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79905 | 29 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79905:Import_L15_C0", "label": "apiclient import apiclient", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2679, 0.0179, 0, 0.66, 0.0, 629, 0, 1, 0, 0, 629, 0, 0], "semantic": {"name": "apiclient", "arg_names": [], "import_names": ["a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79905:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79905:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79905:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79905:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Cod... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79906 | 55 | 135 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79906:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1259, 0.037, 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_79906:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79906:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79906:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79906:Assign_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | ajibawa-2023/Python-Code-Large/train/row_79908 | 49 | 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_79908:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.0439, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79908:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79908:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79908:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79908:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79909 | 114 | 303 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79909:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 58], "level": 0, "parent": null, "vector": [8, 0, 0.1205, 0.1452, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79909:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79909:Expr_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79909:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79909:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (C) 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 law or agreed to in writ... | ajibawa-2023/Python-Code-Large/train/row_79910 | 7 | 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_79910:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5312, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79910:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79910:Import_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79910:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79910:Try_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | ajibawa-2023/Python-Code-Large/train/row_79911 | 112 | 147 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79911:Import_L3_C0", "label": "re import re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0068, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79911:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79911:If_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79911:If_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_79911:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | ajibawa-2023/Python-Code-Large/train/row_79912 | 51 | 187 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79912:Expr_L32_C0", "label": "expression", "type": "expression", "loc": [32, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1818, 0.0267, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79912:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79912:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79912:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79912:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | ajibawa-2023/Python-Code-Large/train/row_79913 | 213 | 438 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79913:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 31], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0708, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79913:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79913:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79913:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79913:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Cod... |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | ajibawa-2023/Python-Code-Large/train/row_79914 | 43 | 110 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79914:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0318, 0.0545, 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_79914:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79914:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79914:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79914:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
#
# Copyright 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | ajibawa-2023/Python-Code-Large/train/row_79918 | 112 | 238 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79918:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0042, 0.0042, 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_79918:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79918:Expr_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_79918:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79918:Return_L30_C2"}, {"f": "ajibawa-2023/Python-Code... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.