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 |
|---|---|---|---|---|---|---|---|
if False: # set to True to insert test data
store(store.product.id > 0).delete()
store(store.category.id > 0).delete()
if len(store(store.product.id > 0).select()) == 0:
fantasy_id = store.category.insert(name='Fantasy', description='Fantasy books', small_image='testdata/hp1.jpg')
hp1 = ... | ajibawa-2023/Python-Code-Large/train/row_0 | 17 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_0:If_L1_C0", "label": "if", "type": "if", "loc": [1, 20], "level": 0, "parent": null, "vector": [4, 0, 0.525, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_0:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_0:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_0:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_0:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_0:If_L1_C0", "t": "ajib... |
UNDEFINED = -1
if request.env.web2py_runtime_gae: # if running on Google App Engine
store = DAL('gae') # connect to Google BigTable
session.connect(request, response, db=store) # and store sessions and tickets there
else:
store = DAL("sqlite://store.db")
store.define... | ajibawa-2023/Python-Code-Large/train/row_1 | 38 | 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_1:Assign_L1_C0", "label": "UNDEFINED =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 67, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "UNDEFINED", "arg_names": [], "import_names": [], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_1:If_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1:If_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_1:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_1:If_L4_C0", "t": "aj... |
#
import re
# delimiter to use between words in URL
URL_DELIMITER = '-'
def pretty_url(id, name):
"""Create pretty URL from record name and ID
"""
return '%s%s%d' % (' '.join(re.sub('[^\w ]+', '', name).split()).replace(' ', URL_DELIMITER), URL_DELIMITER, id)
def pretty_id(url):
"""Extract id fr... | ajibawa-2023/Python-Code-Large/train/row_2 | 17 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_2:Import_L3_C0", "label": "re import re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1071, 0.0357, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_2:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_2:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_2:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_2:Return_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_2:... |
###########################################################
### make sure administrator is on localhost
############################################################
import os, socket, datetime,copy
import gluon.contenttype
import gluon.fileutils
### crytical --- make a copy of the environment
global_env=copy.copy(glo... | ajibawa-2023/Python-Code-Large/train/row_3 | 152 | 208 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_3:Import_L6_C0", "label": "os import os, socket, datetime\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0288, 0.0048, 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_3:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3:Assign_L14_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3:If_L18_C0",... |
if not session.cart:
# instantiate new cart
session.cart, session.balance = [], 0
session.google_merchant_id = mystore.google_merchant_id
response.menu = [
['Store Front', request.function == 'index', URL(r=request, f='index')],
['About Us', request.function == 'aboutus', URL(r=request, f='aboutus')]... | ajibawa-2023/Python-Code-Large/train/row_4 | 95 | 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_4:If_L2_C0", "label": "if", "type": "if", "loc": [2, 4], "level": 0, "parent": null, "vector": [4, 0, 0.0203, 0.0203, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4:If_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4:Functi... |
###########################################################
### make sure administrator is on localhost
############################################################
import os
from gluon.contenttype import contenttype
from gluon.fileutils import check_credentials, listdir
if not session.authorized and not request.func... | ajibawa-2023/Python-Code-Large/train/row_5 | 140 | 180 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_5:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0056, 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_5:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_5:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_5:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_5:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_5:Functio... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_6 | 19 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_6:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.2329, 0.0137, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_6:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_6:Return_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_6:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_6:Return_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_7 | 53 | 91 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_7:Import_L18_C0", "label": "os import os", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1978, 0.011, 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_7:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_7:ImportFrom_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_7:ImportFrom_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7:If_... |
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | ajibawa-2023/Python-Code-Large/train/row_8 | 230 | 434 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_8:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0046, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_8:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_8:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_8:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_8:Try_L9_C0",... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | ajibawa-2023/Python-Code-Large/train/row_10 | 41 | 316 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_10:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 99], "level": 0, "parent": null, "vector": [8, 0, 0.1582, 0.3133, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_10:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_10:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_10:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_10:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
"""JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | ajibawa-2023/Python-Code-Large/train/row_12 | 48 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_12:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0231, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_12:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_12:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_12:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_12:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_12:Functi... |
#!/usr/bin/python2.4
'''Post a message to twitter'''
__author__ = 'dewitt@google.com'
import ConfigParser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h --help : print this help
--consumer-key : the twit... | ajibawa-2023/Python-Code-Large/train/row_14 | 82 | 141 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_14:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0213, 0.0071, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_14:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_14:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_14:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_14:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_15 | 16 | 71 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_15:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2606, 0.0563, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_15:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_15:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_15:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_15:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
maxVf = 200
# Generating the header
head = """// Copyright qiuc12@gmail.com
// This file is generated autmatically by python. DONT MODIFY IT!
#pragma once
#include <OleAuto.h>
class FakeDispatcher;
HRESULT DualProcessCommand(int commandId, FakeDispatcher *disp, ...);
extern "C" void DualProcessCommandWrap()... | ajibawa-2023/Python-Code-Large/train/row_18 | 28 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_18:Assign_L1_C0", "label": "maxVf =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0172, 0, 0.66, 0.0, 302, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "maxVf", "arg_names": [], "import_names": [], "rhs_call_name": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_18:For_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_18:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_18:For_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_18:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_18:For_L52_C0... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: Error.py
# Purpose: error exception class
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 30/04/2008
#-------------------------------------------------------------... | ajibawa-2023/Python-Code-Large/train/row_19 | 22 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_19:Assign_L32_C0", "label": "__doc__ =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.4923, 0.0154, 0, 0.66, 0.0, 155, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__doc__", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_19:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_19:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_19:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_19:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: general_test.py
# Purpose: General testing program for unioc-ng
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 22/11/2008
#----------------------------------------... | ajibawa-2023/Python-Code-Large/train/row_20 | 26 | 66 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_20:Assign_L32_C0", "label": "__doc__ =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.4848, 0.0152, 0, 0.66, 0.0, 155, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__doc__", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_20:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_20:While_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_20:While_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_20:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_20... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: bootstrap.py
# Purpose: bootstrap class used to communicate with atmega
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 22/11/2008
#--------------------------------... | ajibawa-2023/Python-Code-Large/train/row_21 | 17 | 60 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_21:Assign_L32_C0", "label": "__doc__ =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.5333, 0.0167, 0, 0.66, 0.0, 155, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__doc__", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_21:Try_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_21:Import_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_21:Try_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_21:Expr_L41_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_21:ClassDe... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_25 | 90 | 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_25:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0544, 0.0068, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_25:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_25:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_25:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_25:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_28 | 90 | 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_28:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0544, 0.0068, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_28:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_28:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_28:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_28:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_29 | 26 | 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_29:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.025, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_29:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_29:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_29:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_29:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_33 | 76 | 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_33:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0091, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_33:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_33:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_33:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_33:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_34 | 76 | 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_34:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0091, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_34:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_34:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_34:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_34:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------#
#Author: Robin David
#Matriculation: 10014500
#License: Creative Commons
#-----------------------------------#
import string
from impacket import ImpactDecoder, ImpactPacket #packet manipulation module
from datetime import datet... | ajibawa-2023/Python-Code-Large/train/row_36 | 26 | 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_36:Import_L8_C0", "label": "string import string", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.025, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_36:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_36:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_36:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_36:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/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_38 | 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_38: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", "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_38:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_38:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_38:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_38:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#! /usr/bin/python
# $Id: testupnpigd.py,v 1.4 2008/10/11 10:27:20 nanard Exp $
# MiniUPnP project
# Author : Thomas Bernard
# This Sample code is public domain.
# website : http://miniupnp.tuxfamily.org/
# import the python miniupnpc module
import miniupnpc
import socket
import BaseHTTPServer
# function definition
d... | ajibawa-2023/Python-Code-Large/train/row_39 | 15 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_39:Import_L1_C0", "label": "miniupnpc import miniupnpc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 772, 0, 1, 0, 0, 772, 0, 0], "semantic": {"name": "miniupnpc", "arg_names": [], "import_names": ["miniupn... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_39:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_39:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_39:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_39:While_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
#! /usr/bin/python
# $Id: setup.py,v 1.3 2009/04/17 20:59:42 nanard Exp $
# the MiniUPnP Project (c) 2007 Thomas Bernard
# http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/
#
# python script to build the miniupnpc module under unix
#
# replace libminiupnpc.a by libminiupnpc.so for shared library usage
from dis... | ajibawa-2023/Python-Code-Large/train/row_40 | 2 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_40:ImportFrom_L9_C0", "label": "from distutils.core import setup, Extension", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.6, 0.0667, 0, 0.66, 0.0, 152, 0, 2, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "i... | [] |
#! /usr/bin/python
# $Id: setupmingw32.py,v 1.1 2007/06/12 23:04:13 nanard Exp $
# the MiniUPnP Project (c) 2007 Thomas Bernard
# http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/
#
# python script to build the miniupnpc module under unix
#
from distutils.core import setup, Extension
setup(name="miniupnpc", ve... | ajibawa-2023/Python-Code-Large/train/row_41 | 2 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_41:ImportFrom_L8_C0", "label": "from distutils.core import setup, Extension", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.5333, 0.0667, 0, 0.66, 0.0, 152, 0, 2, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [],... | [] |
#! /usr/bin/python
# MiniUPnP project
# Author : Thomas Bernard
# This Sample code is public domain.
# website : http://miniupnp.tuxfamily.org/
# import the python miniupnpc module
import miniupnpc
import sys
# create the object
u = miniupnpc.UPnP()
print 'inital(default) values :'
print ' discoverdelay', u.discoverd... | ajibawa-2023/Python-Code-Large/train/row_42 | 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_42:Import_L1_C0", "label": "miniupnpc import miniupnpc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 772, 0, 1, 0, 0, 772, 0, 0], "semantic": {"name": "miniupnpc", "arg_names": [], "import_names": ["miniupn... | [] |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_43 | 53 | 91 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_43:Import_L18_C0", "label": "os import os", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1978, 0.011, 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_43:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_43:ImportFrom_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_43:Try_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_43:ImportFrom_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_44 | 16 | 71 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_44:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2606, 0.0563, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_44:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_44:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_44:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_44:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
#!/usr/bin/python2.4
'''Post a message to twitter'''
__author__ = 'dewitt@google.com'
import ConfigParser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h --help : print this help
--consumer-key : the twit... | ajibawa-2023/Python-Code-Large/train/row_46 | 82 | 141 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_46:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0213, 0.0071, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_46:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_46:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_46:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_46:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
"""JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | ajibawa-2023/Python-Code-Large/train/row_47 | 48 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_47:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0231, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_47:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_47:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_47:Try_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_47:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_47:Functi... |
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | ajibawa-2023/Python-Code-Large/train/row_49 | 230 | 434 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_49:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0046, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_49:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_49:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_49:Try_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_49:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_49:Try_L9... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | ajibawa-2023/Python-Code-Large/train/row_50 | 41 | 316 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_50:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 99], "level": 0, "parent": null, "vector": [8, 0, 0.1582, 0.3133, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_50:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_50:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_50:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_50:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | ajibawa-2023/Python-Code-Large/train/row_52 | 19 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_52:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.2329, 0.0137, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_52:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_52:Return_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_52:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_52:Return_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | ajibawa-2023/Python-Code-Large/train/row_55 | 38 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_55:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0532, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_55:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_55:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_55:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_55:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | ajibawa-2023/Python-Code-Large/train/row_56 | 58 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_56:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0521, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_56:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_56:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_56:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_56:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | ajibawa-2023/Python-Code-Large/train/row_57 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_57:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1905, 0.3333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_57:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_57:Expr_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_57:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_57:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | ajibawa-2023/Python-Code-Large/train/row_58 | 65 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_58:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0304, 0.0522, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_58:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_58:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_58:FunctionDef_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_58:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | ajibawa-2023/Python-Code-Large/train/row_59 | 25 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_59:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_59:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_59:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_59:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_59:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | ajibawa-2023/Python-Code-Large/train/row_60 | 54 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_60:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0261, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_60:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_60:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_60:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_60:FunctionDef_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import urllib
import urllib2
import argparse
import sys
from log import Logger
from datetime import datetime, timedelta
def verify_order(postdata, sandbox):
data = 'cmd=_notify-validate&' + postdata
if sandbox:
scr = 'https://www.sandbox.paypal.com/cgi-bin/websc'
else:
scr = 'https://www.payp... | ajibawa-2023/Python-Code-Large/train/row_61 | 66 | 83 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_61:Import_L1_C0", "label": "urllib import urllib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.012, 0, 0.66, 0.0, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_61:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_61:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_61:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_61:If_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
from hgapi import *
import shutil
import os
import threading
import optparse
import traceback
import log
from datetime import datetime, timedelta
class HGDonationLog:
def __init__(self, config, logger):
self._path = config['path']
self._repo = Repo(self._path)
self._target = config['logfile'... | ajibawa-2023/Python-Code-Large/train/row_64 | 74 | 91 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_64:ImportFrom_L1_C0", "label": "from hgapi import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.011, 0, 0.66, 0.0, 757, 0, 1, 0, 0, 757, 0, 0], "semantic": {"name": "hgapi", "arg_names": [], "import_names": ["*"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_64:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_64:FunctionDef_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_64:FunctionDef_L11_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_64:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import subprocess
import tempfile
import shutil
import os
import codecs
import json
import zipfile
class Packer:
def __init__(self, input_path, outputfile):
self.input_path = os.path.abspath(input_path)
self.outputfile = os.path.abspath(outputfile)
self.tmppath = None
def pack(self):
... | ajibawa-2023/Python-Code-Large/train/row_65 | 69 | 86 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_65:Import_L1_C0", "label": "subprocess import subprocess", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_65:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_65:FunctionDef_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_65:FunctionDef_L10_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_65:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#!/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_66 | 98 | 256 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_66:Expr_L46_C0", "label": "expression", "type": "expression", "loc": [46, 47], "level": 0, "parent": null, "vector": [8, 0, 0.1816, 0.0078, 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_66:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_66:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_66:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_66:If_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
# Copyright (c) 2012 eagleonhill(qiuc12@gmail.com). All rights reserved.
# Use of this source code is governed by a Mozilla-1.1 license that can be
# found in the LICENSE file.
import googlecode_upload
import tempfile
import urllib2
import optparse
import os
extensionid = 'lgllffgicojgllpmdbemgglaponefajn'
... | ajibawa-2023/Python-Code-Large/train/row_67 | 31 | 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_67:Import_L4_C0", "label": "googlecode_upload import googlecode_upload", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.093, 0.0233, 0, 0.66, 0.0, 481, 0, 1, 0, 0, 481, 0, 0], "semantic": {"name": "googlecode_upload", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_67:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_67:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_67:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_67:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
maxVf = 200
# Generating the header
head = """// Copyright qiuc12@gmail.com
// This file is generated autmatically by python. DONT MODIFY IT!
#pragma once
#include <OleAuto.h>
class FakeDispatcher;
HRESULT DualProcessCommand(int commandId, FakeDispatcher *disp, ...);
extern "C" void DualProcessCommandWrap()... | ajibawa-2023/Python-Code-Large/train/row_68 | 28 | 58 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_68:Assign_L1_C0", "label": "maxVf =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0172, 0.0172, 0, 0.66, 0.0, 302, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "maxVf", "arg_names": [], "import_names": [], "rhs_call_name": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_68:For_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_68:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_68:For_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_68:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_68:For_L52_C0... |
import time
def yesno(question):
val = raw_input(question + " ")
return val.startswith("y") or val.startswith("Y")
use_pysqlite2 = yesno("Use pysqlite 2.0?")
use_autocommit = yesno("Use autocommit?")
use_executemany= yesno("Use executemany?")
if use_pysqlite2:
from pysqlite2 import dbapi2 as s... | ajibawa-2023/Python-Code-Large/train/row_69 | 42 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_69:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_69:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_69:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_69:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_69:Return_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import time
def yesno(question):
val = raw_input(question + " ")
return val.startswith("y") or val.startswith("Y")
use_pysqlite2 = yesno("Use pysqlite 2.0?")
if use_pysqlite2:
use_custom_types = yesno("Use custom types?")
use_dictcursor = yesno("Use dict cursor?")
use_rowcursor = yesno("... | ajibawa-2023/Python-Code-Large/train/row_70 | 71 | 97 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_70:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_70:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_70:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_70:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_70:Return_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
from pysqlite2.test import test
test()
| ajibawa-2023/Python-Code-Large/train/row_71 | 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_71:ImportFrom_L2_C0", "label": "from pysqlite2.test import test", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.3333, 0, 0.66, 0.0, 472, 0, 1, 0, 0, 472, 0, 0], "semantic": {"name": "pysqlite2.test", "arg_names": [], "import_nam... | [] |
from pysqlite2 import dbapi2 as sqlite
import os, threading
def getcon():
#con = sqlite.connect("db", isolation_level=None, timeout=5.0)
con = sqlite.connect(":memory:")
cur = con.cursor()
cur.execute("create table test(i, s)")
for i in range(10):
cur.execute("insert into test(i, s) values ... | ajibawa-2023/Python-Code-Large/train/row_72 | 56 | 80 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_72:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0125, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["s... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_72:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_72:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_72:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_72:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from __future__ import with_statement
from pysqlite2 import dbapi2 as sqlite3
from datetime import datetime, timedelta
import time
def read_modify_write():
# Open connection and create example schema and data.
# In reality, open a database file instead of an in-memory database.
con = sqlite3.connect(":memo... | ajibawa-2023/Python-Code-Large/train/row_74 | 32 | 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_74:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0091, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_74:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_74:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_74:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_74:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from pysqlite2 import dbapi2 as sqlite3
Cursor = sqlite3.Cursor
class EagerCursor(Cursor):
def __init__(self, con):
Cursor.__init__(self, con)
self.rows = []
self.pos = 0
def execute(self, *args):
sqlite3.Cursor.execute(self, *args)
self.rows = Cursor.fetchall(self)
... | ajibawa-2023/Python-Code-Large/train/row_75 | 38 | 51 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_75:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_75:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_75:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_75:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_75:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python
#
# Cross-compile and build pysqlite installers for win32 on Linux or Mac OS X.
#
# The way this works is very ugly, but hey, it *works*! And I didn't have to
# reinvent the wheel using NSIS.
import os
import sys
import urllib
import zipfile
from setup import get_amalgamation
# Cross-compiler
... | ajibawa-2023/Python-Code-Large/train/row_76 | 41 | 68 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_76:Import_L8_C0", "label": "os import os", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0147, 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_76:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_76:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_76:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_76:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_76:If_L16_C... |
# -*- coding: utf-8 -*-
#
# pysqlite documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 02:47:54 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pic... | ajibawa-2023/Python-Code-Large/train/row_77 | 14 | 132 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_77:Import_L14_C0", "label": "sys import sys", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0076, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
from pysqlite2 import dbapi2 as sqlite3
FIELD_MAX_WIDTH = 20
TABLE_NAME = 'people'
SELECT = 'select * from %s order by age, name_last' % TABLE_NAME
con = sqlite3.connect("mydb")
cur = con.cursor()
cur.execute(SELECT)
# Print a header.
for fieldDesc in cur.description:
print fieldDesc[0].ljust(FIELD_MAX_WIDTH) ,... | ajibawa-2023/Python-Code-Large/train/row_78 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["sqlite... | [] |
from pysqlite2 import dbapi2 as sqlite3
def progress():
print "Query still executing. Please wait ..."
con = sqlite3.connect(":memory:")
con.execute("create table test(x)")
# Let's create some data
con.executemany("insert into test(x) values (?)", [(x,) for x in xrange(300)])
# A progress handler, executed ever... | ajibawa-2023/Python-Code-Large/train/row_79 | 12 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_79:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0345, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_79:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_79:Expr_L4_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
SELECT = "select name_last, age from people order by age, name_last"
# 1. Iterate over the rows available from the cursor, unpacking the
# resulting sequences to yield their elements (name_last, age):
cur.execute(SELECT)
for (na... | ajibawa-2023/Python-Code-Large/train/row_80 | 10 | 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_80:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_80:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_80:For_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_80:Expr_L17_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
# Create a connection to the database file "mydb":
con = sqlite3.connect("mydb")
# Get a Cursor object that operates in the context of Connection con:
cur = con.cursor()
# Execute the SELECT statement:
cur.execute("select * from people order by age")
# Retrieve all rows as a ... | ajibawa-2023/Python-Code-Large/train/row_81 | 5 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_81:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
| ajibawa-2023/Python-Code-Large/train/row_82 | 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_82:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
class MySum:
def __init__(self):
self.count = 0
def step(self, value):
self.count += value
def finalize(self):
return self.count
con = sqlite3.connect(":memory:")
con.create_aggregate("mysum", 1, MySum)
cur = con.cursor()
cur.execute("creat... | ajibawa-2023/Python-Code-Large/train/row_83 | 15 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_83:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["sqli... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_83:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_83:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_83:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_83:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
# A minimal SQLite shell for experiments
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
con.isolation_level = None
cur = con.cursor()
buffer = ""
print "Enter your SQL commands to execute in SQLite."
print "Enter a blank line to exit."
while True:
line = raw_input()
if line == ""... | ajibawa-2023/Python-Code-Large/train/row_84 | 1 | 2 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_84:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["sqlite... | [] |
from pysqlite2 import dbapi2 as sqlite3
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
con = sqlite3.connect(":memory:")
con.row_factory = dict_factory
cur = con.cursor()
cur.execute("select 1 as a")
print cur.fetchone()["a"]
| ajibawa-2023/Python-Code-Large/train/row_85 | 11 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_85:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_85:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_85:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_85:For_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
from pysqlite2 import dbapi2 as sqlite3
import datetime
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
cur = con.cursor()
cur.execute("create table test(d date, ts timestamp)")
today = datetime.date.today()
now = datetime.datetime.now()
cur.execute("insert into test(d,... | ajibawa-2023/Python-Code-Large/train/row_86 | 16 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_86:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["sqli... | [] |
from pysqlite2 import dbapi2 as sqlite3
def authorizer_callback(action, arg1, arg2, dbname, source):
if action != sqlite3.SQLITE_SELECT:
return sqlite3.SQLITE_DENY
if arg1 == "private_table":
return sqlite3.SQLITE_DENY
return sqlite3.SQLITE_OK
con = sqlite3.connect(":memory:")
con.executes... | ajibawa-2023/Python-Code-Large/train/row_87 | 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_87:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_87:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_87:If_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_87:If_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_87:Return_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_87:Functio... |
from pysqlite2 import dbapi2 as sqlite3
# The shared cache is only available in SQLite versions 3.3.3 or later
# See the SQLite documentaton for details.
sqlite3.enable_shared_cache(True)
| ajibawa-2023/Python-Code-Large/train/row_88 | 2 | 6 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_88:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
| ajibawa-2023/Python-Code-Large/train/row_89 | 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_89:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
who = "Yeltsin"
age = 72
cur.execute("select name_last, age from people where name_last=? and age=?", (who, age))
print cur.fetchone()
| ajibawa-2023/Python-Code-Large/train/row_90 | 7 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_90:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from __future__ import with_statement
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
con.execute("create table person (id integer primary key, firstname varchar unique)")
# Successful, con.commit() is called automatically afterwards
with con:
con.execute("insert into person(firstname) v... | ajibawa-2023/Python-Code-Large/train/row_91 | 8 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_91:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_91:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_91:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_91:Expr_L17_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
import md5
def md5sum(t):
return md5.md5(t).hexdigest()
con = sqlite3.connect(":memory:")
con.create_function("md5", 1, md5sum)
cur = con.cursor()
cur.execute("select md5(?)", ("foo",))
print cur.fetchone()[0]
| ajibawa-2023/Python-Code-Large/train/row_92 | 9 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_92:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_92:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_92:Return_L5_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
con.row_factory = sqlite3.Row
cur = con.cursor()
cur.execute("select name_last, age from people")
for row in cur:
assert row[0] == row["name_last"]
assert row["name_last"] == row["nAmE_lAsT"]
assert row[1] == row["age"]
assert row[1... | ajibawa-2023/Python-Code-Large/train/row_93 | 6 | 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_93:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
class Point(object):
def __init__(self, x, y):
self.x, self.y = x, y
def adapt_point(point):
return "%f;%f" % (point.x, point.y)
sqlite3.register_adapter(Point, adapt_point)
con = sqlite3.connect(":memory:")
cur = con.cursor()
p = Point(4.0, -3.2)
cur.execute... | ajibawa-2023/Python-Code-Large/train/row_94 | 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_94:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_94:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_94:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_94:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_94:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
# Create the table
con.execute("create table person(lastname, firstname)")
AUSTRIA = u"\xd6sterreich"
# by default, rows are returned as Unicode
cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
assert row[0] == AUST... | ajibawa-2023/Python-Code-Large/train/row_95 | 18 | 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_95:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
class CountCursorsConnection(sqlite3.Connection):
def __init__(self, *args, **kwargs):
sqlite3.Connection.__init__(self, *args, **kwargs)
self.numcursors = 0
def cursor(self, *args, **kwargs):
self.numcursors += 1
return sqlite3.Connectio... | ajibawa-2023/Python-Code-Large/train/row_96 | 11 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_96:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_96:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_96:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_96:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_96:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from pysqlite2 import dbapi2 as sqlite3
def collate_reverse(string1, string2):
return -cmp(string1, string2)
con = sqlite3.connect(":memory:")
con.create_collation("reverse", collate_reverse)
cur = con.cursor()
cur.execute("create table test(x)")
cur.executemany("insert into test(x) values (?)", [("a",), ("b",)]... | ajibawa-2023/Python-Code-Large/train/row_97 | 12 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97:Return_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97:Expr_L14_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.executescript("""
create table person(
firstname,
lastname,
age
);
create table book(
title,
author,
published
);
insert into book(title, author, publis... | ajibawa-2023/Python-Code-Large/train/row_98 | 4 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect(":memory:")
# enable extension loading
con.enable_load_extension(True)
# Load the fulltext search extension
con.execute("select load_extension('./fts3.so')")
# alternatively you can load the extension using an API call:
# con.load_extension("./fts3.so")
... | ajibawa-2023/Python-Code-Large/train/row_99 | 9 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0357, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99:Expr_L26_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
persons = [
("Hugo", "Boss"),
("Calvin", "Klein")
]
con = sqlite3.connect(":memory:")
# Create the table
con.execute("create table person(firstname, lastname)")
# Fill the table
con.executemany("insert into person(firstname, lastname) values (?, ?)", persons)
# P... | ajibawa-2023/Python-Code-Large/train/row_100 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_100:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_100:For_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_100:Expr_L18_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
who = "Yeltsin"
age = 72
cur.execute("select name_last, age from people where name_last=:who and age=:age",
locals())
print cur.fetchone()
| ajibawa-2023/Python-Code-Large/train/row_101 | 7 | 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_101:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [] |
# Not referenced from the documentation, but builds the database file the other
# code snippets expect.
from pysqlite2 import dbapi2 as sqlite3
import os
DB_FILE = "mydb"
if os.path.exists(DB_FILE):
os.remove(DB_FILE)
con = sqlite3.connect(DB_FILE)
cur = con.cursor()
cur.execute("""
create table people
... | ajibawa-2023/Python-Code-Large/train/row_102 | 13 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_102:ImportFrom_L4_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0357, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_102:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_102:Expr_L10_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
who = "Yeltsin"
age = 72
cur.execute("select name_last, age from people where name_last=:who and age=:age",
{"who": who, "age": age})
print cur.fetchone()
| ajibawa-2023/Python-Code-Large/train/row_103 | 7 | 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_103:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [] |
from pysqlite2 import dbapi2 as sqlite3
import datetime
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
cur = con.cursor()
cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
dt = cur.fetchone()[0]
print dt, type(dt)
| ajibawa-2023/Python-Code-Large/train/row_104 | 7 | 8 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_104:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": ["s... | [] |
from pysqlite2 import dbapi2 as sqlite3
def char_generator():
import string
for c in string.letters[:26]:
yield (c,)
con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.execute("create table characters(c)")
cur.executemany("insert into characters(c) values (?)", char_generator())
cur.execute("s... | ajibawa-2023/Python-Code-Large/train/row_105 | 11 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_105:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_105:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_105:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_105:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_105:For_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from pysqlite2 import dbapi2 as sqlite3
con = sqlite3.connect("mydb")
cur = con.cursor()
newPeople = (
('Lebed' , 53),
('Zhirinovsky' , 57),
)
for person in newPeople:
cur.execute("insert into people (name_last, age) values (?, ?)", person)
# The changes will not be saved unless the transaction... | ajibawa-2023/Python-Code-Large/train/row_106 | 7 | 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_106:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_106:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_106:Expr_L13_C4"}] |
from pysqlite2 import dbapi2 as sqlite3
class Point(object):
def __init__(self, x, y):
self.x, self.y = x, y
def __conform__(self, protocol):
if protocol is sqlite3.PrepareProtocol:
return "%f;%f" % (self.x, self.y)
con = sqlite3.connect(":memory:")
cur = con.cursor()
p = Point(4... | ajibawa-2023/Python-Code-Large/train/row_107 | 12 | 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_107:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_107:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_107:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_107:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_107:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from pysqlite2 import dbapi2 as sqlite3
class Point(object):
def __init__(self, x, y):
self.x, self.y = x, y
def __repr__(self):
return "(%f;%f)" % (self.x, self.y)
def adapt_point(point):
return "%f;%f" % (point.x, point.y)
def convert_point(s):
x, y = map(float, s.split(";"))
r... | ajibawa-2023/Python-Code-Large/train/row_108 | 30 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_108:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0213, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_108:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_108:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_108:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_108:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from pysqlite2 import dbapi2 as sqlite3
class IterChars:
def __init__(self):
self.count = ord('a')
def __iter__(self):
return self
def next(self):
if self.count > ord('z'):
raise StopIteration
self.count += 1
return (chr(self.count - 1),) # this is a 1-... | ajibawa-2023/Python-Code-Large/train/row_109 | 16 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_109:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_109:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_109:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_109:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_109:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from pysqlite2 import dbapi2 as sqlite3
import apsw
apsw_con = apsw.Connection(":memory:")
apsw_con.createscalarfunction("times_two", lambda x: 2*x, 1)
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30
con.c... | ajibawa-2023/Python-Code-Large/train/row_110 | 7 | 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_110:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [] |
from pysqlite2 import dbapi2 as sqlite3
import datetime, time
def adapt_datetime(ts):
return time.mktime(ts.timetuple())
sqlite3.register_adapter(datetime.datetime, adapt_datetime)
con = sqlite3.connect(":memory:")
cur = con.cursor()
now = datetime.datetime.now()
cur.execute("select ?", (now,))
print cur.fetcho... | ajibawa-2023/Python-Code-Large/train/row_111 | 10 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_111:ImportFrom_L1_C0", "label": "from pysqlite2 import sqlite3", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "pysqlite2", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_111:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_111:Return_L5_C4"}] |
# Author: Paul Kippes <kippesp@gmail.com>
import unittest
from pysqlite2 import dbapi2 as sqlite
class DumpTests(unittest.TestCase):
def setUp(self):
self.cx = sqlite.connect(":memory:")
self.cu = self.cx.cursor()
def tearDown(self):
self.cx.close()
def CheckTableDump(self):
... | ajibawa-2023/Python-Code-Large/train/row_112 | 22 | 52 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_112:Import_L3_C0", "label": "unittest import unittest", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0192, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_112:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_112:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_112:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_112:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Mimic the sqlite3 console shell's .dump command
# Author: Paul Kippes <kippesp@gmail.com>
def _iterdump(connection):
"""
Returns an iterator to the dump of the database in an SQL text format.
Used to produce an SQL dump of the database. Useful to save an in-memory
database for later restoration. T... | ajibawa-2023/Python-Code-Large/train/row_113 | 24 | 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_113:FunctionDef_L4_C0", "label": "_iterdump", "type": "function", "loc": [4, 63], "level": 0, "parent": null, "vector": [2, 0, 0.5317, 0.9524, 0, 0.66, 0.0, 339, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "_iterdump", "arg_names": ["connection"], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_113:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_113:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_113:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_113:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#coding:utf8
from bottle import route, run, debug, template, request, validate, error, response, redirect
from y_common import *
from weibopy.auth import WebOAuthHandler
from weibopy import oauth
@route('/login')
def login():
redirect('/sina/login')
@route('/sina/login')
def sina_login():
auth = WebOAuthH... | ajibawa-2023/Python-Code-Large/train/row_114 | 16 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_114:ImportFrom_L2_C0", "label": "from bottle import route, run, debug\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 591, 0, 9, 0, 0, 591, 0, 0], "semantic": {"name": "bottle", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_114:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_114:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_114:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_114:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from bottle import route, run, debug, template, request, validate, error, response, redirect
@route('/apply/sent')
@route('/apply/sent/show')
def apply_sent_show():
return template('home')
@route('/apply/sent/add/:tweet_id')
def apply_sent_add(tweet_id):
return template('home')
@route('/apply/sent/exist/... | ajibawa-2023/Python-Code-Large/train/row_115 | 11 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_115:ImportFrom_L1_C0", "label": "from bottle import route, run, debug\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 591, 0, 9, 0, 0, 591, 0, 0], "semantic": {"name": "bottle", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_115:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_115:Return_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_115:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_115:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
from bottle import route, run, debug, template, request, validate, error, response, redirect
@route('/')
@route('/home')
def home():
return template('home')
#return 'Ybole - Python backend ... Coming soon!'
| ajibawa-2023/Python-Code-Large/train/row_116 | 3 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_116:ImportFrom_L1_C0", "label": "from bottle import route, run, debug\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 591, 0, 9, 0, 0, 591, 0, 0], "semantic": {"name": "bottle", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_116:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_116:Return_L6_C4"}] |
from bottle import route, run, debug, template, request, validate, error, response, redirect
@route('/admin/')
def admin():
return template("home")
@route('/admin/tag')
def admin_tag():
return template("home")
@route('/admin/tag/edit')
def admin_tag():
return template("home")
| ajibawa-2023/Python-Code-Large/train/row_117 | 7 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_117:ImportFrom_L1_C0", "label": "from bottle import route, run, debug\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 591, 0, 9, 0, 0, 591, 0, 0], "semantic": {"name": "bottle", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_117:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_117:Return_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_117:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_117:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
import re, base64, json
baseurl = "http://www.ybole.com:81"
gng_secret = "HUSTGNGisVeryGelivable"
sina_consumer_key= "961495784"
sina_consumer_secret ="47d9d806a1dc04cc758be6f7213465bc"
def htmlEncode(str):
""" Returns the HTML encoded version of the given string. This is useful to
display a plain ASCII... | ajibawa-2023/Python-Code-Large/train/row_118 | 14 | 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_118:Import_L1_C0", "label": "re import re, base64, json", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 540, 0, 3, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re", "base64", "j... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_118:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_118:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_118:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_118:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
class WeibopError(Exception):
"""Weibopy exception"""
def __init__(self, reason):
try:
self.reason = reason.encode('utf-8')
except:
self.reason = reason
def __str__(self):
return self.reason... | ajibawa-2023/Python-Code-Large/train/row_120 | 8 | 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_120:ClassDef_L5_C0", "label": "WeibopError", "type": "class", "loc": [5, 15], "level": 0, "parent": null, "vector": [3, 0, 0.625, 0.6875, 0, 0.66, 0.0, 305, 0, 2, 0, 0, 645, 0, 1], "semantic": {"name": "WeibopError", "arg_names": [], "import_names": [], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_120:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_120:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_120:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_120:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from weibopy.utils import parse_datetime, parse_html_value, parse_a_href, \
parse_search_datetime, unescape_html
class ResultSet(list):
"""A list like object that holds results from a Twitter API query."""
class Model(object):
def _... | ajibawa-2023/Python-Code-Large/train/row_121 | 242 | 355 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_121:ImportFrom_L5_C0", "label": "from weibopy.utils import parse_datetime, parse_html_value, parse_a_href\u2026", "type": "import", "loc": [5, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0155, 0.0056, 0, 0.66, 0.0, 478, 0, 5, 0, 0, 478, 0, 0], "semantic": {"name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_121:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_121:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_121:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_121:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
"""
The MIT License
Copyright (c) 2007 Leah Culver
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 rights
to use, copy, modify, merge, publis... | ajibawa-2023/Python-Code-Large/train/row_122 | 389 | 654 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_122:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0183, 0.0352, 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_122:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_122:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_122:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_122:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
"""
weibo API library
"""
__version__ = '1.5'
__author__ = 'Joshua Roesslein'
__license__ = 'MIT'
from weibopy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResult, ModelFactory, IDSModel
from weibopy.error import WeibopErr... | ajibawa-2023/Python-Code-Large/train/row_126 | 15 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_126:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 7], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_126:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_126:Import_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_126:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_126:Assign_L26_C4"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.