code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
#!/usr/bin/python
import os, sys, re
import xbmc, xbmcplugin
try:
import xbmcaddon
__has_addons__ = True
except:
__has_addons__ = False
pass
__plugin_handle__ = int(sys.argv[1])
if __has_addons__:
__addon__ = xbmcaddon.Addon('plugin.video.hulu')
def get_os():
try: xbmc_os = os.environ.get('O... | ajibawa-2023/Python-Code-Large/train/row_78070 | 42 | 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_78070:Import_L3_C0", "label": "os import os, sys, re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0517, 0.0172, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys", "re"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78070:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78070:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78070:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78070:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
# Dummy file to make this directory a package.
| ajibawa-2023/Python-Code-Large/train/row_78076 | 0 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
#!/usr/bin/python
import os, sys, re
import xbmc, xbmcplugin
try:
import xbmcaddon
__has_addons__ = True
except:
__has_addons__ = False
pass
__plugin_handle__ = int(sys.argv[1])
if __has_addons__:
__addon__ = xbmcaddon.Addon('plugin.video.hulu')
def get_os():
try: xbmc_os = os.environ.get('O... | ajibawa-2023/Python-Code-Large/train/row_78078 | 42 | 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_78078:Import_L3_C0", "label": "os import os, sys, re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0517, 0.0172, 0, 0.66, 0.0, 688, 0, 3, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys", "re"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78078:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78078:Import_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78078:Try_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78078:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
"""
Plugin for streaming media from Hulu.com
"""
#main imports
import sys
import os
import urllib
import xbmc
import xbmcgui
import xbmcplugin
import resources.lib.common as common
print sys.argv
#plugin constants
__plugin__ = "Hulu"
__authors__ = "XBMC"
__credits__ = "Media Center"
#temp#
print "\n\n\n\n\... | ajibawa-2023/Python-Code-Large/train/row_78079 | 41 | 57 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78079:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0351, 0.0526, 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_78079:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78079:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78079:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_78079:Import_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
import sys
gParamDict = {}
gQSParsed = False
def EmptyQS():
qs = sys.argv[2][1:]
return ( qs == '' )
def Params( *args ):
values = []
for name in args:
values.append( Param(name) )
return values
def Param( name ):
dict = _GetParamDict()
if ( name in dict ):
return dict[name]
else: ret... | ajibawa-2023/Python-Code-Large/train/row_78080 | 79 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78080:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0098, 0.0098, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78080:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78080:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78080:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78080:Return_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | ajibawa-2023/Python-Code-Large/train/row_78081 | 212 | 439 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78081:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 31], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0706, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78081:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78081:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78081:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78081:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code... |
#/bin/python
import os
import time
import socks
import xbmc,xbmcaddon
import urllib2,socket,gzip,StringIO
gCacheDir = ""
gCacheSize = 20
__PluginName__ = 'plugin.video.demand5'
__addon__ = xbmcaddon.Addon(__PluginName__)
#=============================================================================... | ajibawa-2023/Python-Code-Large/train/row_78082 | 98 | 187 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78082:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.0053, 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_78082:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78082:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78082:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78082:Assign_L20_C1"}, {"f": "ajibawa-2023/Python-Co... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF0 implementation.
C{AMF0} supports the basic data types used for the NetConnection, NetStream,
LocalConnection, SharedObjects and other classes in the Adobe Flash Player.
@since: 0.1
@see: U{Official AMF0 Specification in English (external)
... | ajibawa-2023/Python-Code-Large/train/row_78083 | 355 | 749 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78083:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 17], "level": 0, "parent": null, "vector": [8, 0, 0.014, 0.0187, 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_78083:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78083:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78083:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78083:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF0 Remoting support.
@since: 0.1.0
"""
import traceback
import sys
from pyamf import remoting
from pyamf.remoting import gateway
class RequestProcessor(object):
def __init__(self, gateway):
self.gateway = gateway
def authenti... | ajibawa-2023/Python-Code-Large/train/row_78084 | 55 | 135 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78084:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0444, 0.037, 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_78084:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78084:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78084:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78084:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF3 RemoteObject support.
@see: U{RemoteObject on LiveDocs
<http://livedocs.adobe.com/flex/3/langref/mx/rpc/remoting/RemoteObject.html>}
@since: 0.1.0
"""
import calendar
import time
import uuid
import sys
import pyamf.python
from pyamf import ... | ajibawa-2023/Python-Code-Large/train/row_78085 | 89 | 191 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78085:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0393, 0.0419, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78085:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78085:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78085:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78085:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF Remoting support.
A Remoting request from the client consists of a short preamble, headers, and
bodies. The preamble contains basic information about the nature of the
request. Headers can be used to request debugging information, send
... | ajibawa-2023/Python-Code-Large/train/row_78086 | 300 | 688 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78086:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 27], "level": 0, "parent": null, "vector": [8, 0, 0.0225, 0.0349, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78086:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78086:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78086:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78086:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Class alias base functionality.
@since: 0.6
"""
import inspect
import pyamf
from pyamf import python, util
class UnknownClassAlias(Exception):
"""
Raised if the AMF stream specifies an Actionscript class that does not
have a Python ... | ajibawa-2023/Python-Code-Large/train/row_78087 | 301 | 546 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78087:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.011, 0.0092, 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_78087:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78087:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78087:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78087:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF3 implementation.
C{AMF3} is the default serialization for
U{ActionScript<http://en.wikipedia.org/wiki/ActionScript>} 3.0 and provides
various advantages over L{AMF0<pyamf.amf0>}, which is used for ActionScript 1.0
and 2.0. It adds support for s... | ajibawa-2023/Python-Code-Large/train/row_78088 | 679 | 1,595 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78088:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 22], "level": 0, "parent": null, "vector": [8, 0, 0.0082, 0.0119, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78088:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78088:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78088:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78088:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Python compatibility values and helpers.
"""
try:
import __builtin__ as builtins
except ImportError:
import builtins
import types
func_types = (
types.BuiltinFunctionType, types.BuiltinMethodType, types.CodeType,
types.FunctionTy... | ajibawa-2023/Python-Code-Large/train/row_78089 | 35 | 78 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78089:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0641, 0.0385, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78089:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78089:Import_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78089:Try_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78089:Import_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Because there is disparity between Python packaging (and it is being sorted
out ...) we currently provide our own way to get the string of a version tuple.
@since: 0.6
"""
class Version(tuple):
_version = None
def __new__(cls, *args):
... | ajibawa-2023/Python-Code-Large/train/row_78090 | 18 | 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_78090:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1625, 0.15, 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_78090:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78090:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78090:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78090:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Cod... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Useful helpers for adapters.
@since: 0.4
"""
import __builtin__
if not hasattr(__builtin__, 'set'):
from sets import Set as set
def to_list(obj, encoder):
"""
Converts an arbitrary object C{obj} to a C{list}.
"""
return list... | ajibawa-2023/Python-Code-Large/train/row_78091 | 19 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78091:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.12, 0.1, 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_78091:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78091:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78091:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78091:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
The adapter package provides additional functionality for other Python
packages. This includes registering classes, setting up type maps etc.
@since: 0.1.0
"""
import os.path
import glob
from pyamf.util import imports
adapters_registered = Fals... | ajibawa-2023/Python-Code-Large/train/row_78092 | 36 | 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_78092:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.0659, 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_78092:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78092:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78092:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78092:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Provides XML support.
@since: 0.6
"""
#: list of supported third party packages that support the C{etree}
#: interface. At least enough for our needs anyway.
ETREE_MODULES = [
'lxml.etree',
'xml.etree.cElementTree',
'cElementTree',
... | ajibawa-2023/Python-Code-Large/train/row_78093 | 63 | 168 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78093:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0357, 0.0298, 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_78093:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78093:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78093:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78093:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
U{PyAMF<http://pyamf.org>} provides Action Message Format (U{AMF
<http://en.wikipedia.org/wiki/Action_Message_Format>}) support for Python that
is compatible with the Adobe U{Flash Player
<http://en.wikipedia.org/wiki/Flash_Player>}.
@sinc... | ajibawa-2023/Python-Code-Large/train/row_78094 | 313 | 848 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78094:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0094, 0.0106, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78094:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78094:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78094:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78094:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-... |
# -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Provides the pure Python versions of L{BufferedByteStream}.
Do not reference directly, use L{pyamf.util.BufferedByteStream} instead.
@since: 0.6
"""
import struct
try:
from cStringIO import StringIO
except ImportErr... | ajibawa-2023/Python-Code-Large/train/row_78095 | 295 | 700 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78095:Expr_L6_C0", "label": "expression", "type": "expression", "loc": [6, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0129, 0.01, 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_78095:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78095:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78095:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78095:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
AMF Utilities.
@since: 0.1.0
"""
import calendar
import datetime
import inspect
import pyamf
from pyamf import python
try:
from cpyamf.util import BufferedByteStream
except ImportError:
from pyamf.util.pure import BufferedByteStream
#:... | ajibawa-2023/Python-Code-Large/train/row_78096 | 87 | 197 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78096:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0305, 0.0254, 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_78096:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78096:ImportFrom_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78096:Try_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78096:ImportFrom_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tools for doing dynamic imports.
@since: 0.3
"""
import sys
__all__ = ['when_imported']
def when_imported(name, *hooks):
"""
Call C{hook(module)} when module named C{name} is first imported. C{name}
must be a fully qualified (i.e. ... | ajibawa-2023/Python-Code-Large/train/row_78097 | 52 | 137 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78097:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0438, 0.0365, 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_78097:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78097:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78097:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78097:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Provides basic functionality for all pyamf.amf?.[De|E]ncoder classes.
"""
import types
import datetime
import pyamf
from pyamf import util, python, xml
__all__ = [
'IndexedCollection',
'Context',
'Decoder',
'Encoder'
]
try:
u... | ajibawa-2023/Python-Code-Large/train/row_78098 | 239 | 521 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78098:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0096, 0.0058, 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_78098:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78098:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78098:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78098:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
import xbmc, xbmcaddon, xbmcgui, xbmcplugin
import os
import re
ADDON = xbmcaddon.Addon(id='plugin.video.FilmOn')
def res():
quality = ADDON.getSetting('res')
if quality == '0':
return ''
elif quality == '1':
return '360p'
elif quality == '2':
return '480p'
| ajibawa-2023/Python-Code-Large/train/row_78099 | 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_78099:Import_L1_C0", "label": "xbmc import xbmc, xbmcaddon, xbmcgui\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 877, 0, 4, 0, 0, 877, 0, 0], "semantic": {"name": "xbmc", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78099:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78099:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78099:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78099:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
import urllib,urllib2,sys,re,xbmcplugin,xbmcgui,xbmcaddon,xbmc,base64,datetime,os
import settings
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon
net = Net()
ADDON = xbmcaddon.Addon(id='plugin.video.FilmOn')
#Global Constants
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0... | ajibawa-2023/Python-Code-Large/train/row_78100 | 330 | 384 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78100:Import_L1_C0", "label": "urllib import urllib, urllib2, sys\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0026, 0, 0.66, 0.0, 614, 0, 11, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78100:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78100:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78100:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78100:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
from django.db.models.sql import compiler
import re
# query_class returns the base class to use for Django queries.
# The custom 'SqlServerQuery' class derives from django.db.models.sql.query.Query
# which is passed in as "QueryClass" by Django itself.
#
# SqlServerQuery overrides:
# ...insert queries to add "... | ajibawa-2023/Python-Code-Large/train/row_78101 | 118 | 233 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78101:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 0, 0.66, 0.0, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "django.db.models.sql", "arg_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78101:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78101:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78101:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78101:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code... |
"""This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, BigIntegerField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
__all__ = (
'BigAutoField',
'BigForeignKey',
'BigIntegerField... | ajibawa-2023/Python-Code-Large/train/row_78102 | 24 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78102:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.027, 0.027, 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_78102:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78102:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78102:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78102:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.db.backends import BaseDatabaseIntrospection
import ado_consts
class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_table_list(self, cursor):
"Return a list of table and view names in the current database."
cursor.execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLE... | ajibawa-2023/Python-Code-Large/train/row_78105 | 47 | 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_78105:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backend... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78105:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78105:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78105:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78105:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Launches SQL Server Management Studio (on Windows)."
requires_model_validation = False
def handle_noargs(self, **options):
from django.conf import settings
import os
args = ['-n... | ajibawa-2023/Python-Code-Large/train/row_78106 | 13 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78106:ImportFrom_L1_C0", "label": "from django.core.management.base import NoArgsCommand", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "django.core.manageme... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78106:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78106:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78106:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78106:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# ADO enumerated constants documented on MSDN:
# http://msdn.microsoft.com/en-us/library/ms678353(VS.85).aspx
# IsolationLevelEnum
adXactUnspecified = -1
adXactBrowse = 0x100
adXactChaos = 0x10
adXactCursorStability = 0x1000
adXactIsolated = 0x100000
adXactReadCommitted = 0x100... | ajibawa-2023/Python-Code-Large/train/row_78107 | 86 | 216 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78107:Assign_L5_C0", "label": "adXactUnspecified =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0231, 0.0046, 0, 0.66, 0.0, 470, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "adXactUnspecified", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78107:FunctionDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78107:Return_L152_C4"}] |
"""Microsoft SQL Server database backend for Django."""
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseValidation, BaseDatabaseClient
from django.db.backends.signals import connection_created
from django.core.exceptions import ImproperlyConfigured
import dbapi as Database
... | ajibawa-2023/Python-Code-Large/train/row_78109 | 80 | 144 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78109:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0069, 0.0069, 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_78109:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78109:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78109:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78109:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-... |
from django.db import connection
from django.db.models.fields import *
from south.db import generic
class DatabaseOperations(generic.DatabaseOperations):
"""
django-mssql (sql_server.mssql) implementation of database operations.
"""
add_column_string = 'ALTER TABLE %s ADD %s;'
alter_... | ajibawa-2023/Python-Code-Large/train/row_78110 | 24 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78110:ImportFrom_L1_C0", "label": "from django.db import connection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78110:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78110:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78110:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78110:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
import os.path
VERSION = (1, 0, 0, 'dev')
def get_version():
"""
Return the version as a string. If this is flagged as a development
release and mercurial can be loaded the specifics about the changeset
will be appended to the version string.
"""
if 'dev' in VERSION:
try:... | ajibawa-2023/Python-Code-Large/train/row_78111 | 14 | 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_78111:Import_L1_C0", "label": "os.path import os.path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78111:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78111:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78111:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78111:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
"""An example of using the internal DB-API module without any Django."""
# Adds the relative path for the MS SQL Server backend to Python's import path.
# We do this so we can run this module from a checkout for demo purposes
# without having to install it.
def _hack_backend_path():
import os, sys
backend_pat... | ajibawa-2023/Python-Code-Large/train/row_78112 | 39 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78112:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0189, 0.0189, 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_78112:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78112:Import_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78112:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78112:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
from setuptools import setup, find_packages
version = __import__('sqlserver_ado').get_version()
setup(
name='django-mssql',
version=version.replace(' ', '-'),
maintainer='Michael Manfre',
maintainer_email='mmanfre@gmail.com',
url='http://django-mssql.googlecode.com/',
description="Dj... | ajibawa-2023/Python-Code-Large/train/row_78113 | 3 | 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_78113:ImportFrom_L1_C0", "label": "from setuptools import setup, find_packages", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "setuptools", "arg_names": [], ... | [] |
# Common database settings for all test projects
# plus a path hack to find the backend module.
import os
# use old style settings for non-django dbapi tests
DATABASE_NAME = 'django_test_backend'
DATABASE_HOST = os.environ['COMPUTERNAME'] + '\\' + os.environ.get('SQLINSTANCE', 'ss2008')
DATABASE_USER = ''
DA... | ajibawa-2023/Python-Code-Large/train/row_78114 | 28 | 69 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78114:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.058, 0.0145, 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_78114:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78114:Import_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78114:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78114:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_78115 | 22 | 48 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78115:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3542, 0.0208, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78115:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78115:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78115:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78115:Expr_L27_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_78116 | 11 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78116:Import_L17_C0", "label": "base64 import base64", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0294, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78116:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78116:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78116:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78116:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_78117 | 52 | 97 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78117:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1753, 0.0103, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78117:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78117:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78117:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78117:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | ajibawa-2023/Python-Code-Large/train/row_78118 | 26 | 59 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78118:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2881, 0.0169, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78118:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78118:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78118:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78118:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Co... |
dataTypes = ["CPUndefinedDataType", "CPIntegerDataType", "CPUnsignedIntegerDataType", "CPFloatingPointDataType", "CPComplexFloatingPointDataType", "CPDecimalDataType"]
types = { "CPUndefinedDataType" : [],
"CPIntegerDataType" : ["int8_t", "int16_t", "int32_t", "int64_t"],
"CPUnsignedIntegerDataType" : ... | ajibawa-2023/Python-Code-Large/train/row_78119 | 90 | 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_78119:Assign_L1_C0", "label": "dataTypes =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 302, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dataTypes", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78119:For_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78119:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78119:For_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78119:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_781... |
#!/usr/bin/env python
from os import mkdir, makedirs, environ, chdir, getcwd, system, listdir
from os.path import join
from shutil import copy, copytree, move, rmtree
# Usage
def Usage():
return 'Usage: createversion.py <version>'
# Run Xcode
def RunXcode(project, target):
system('/usr/bin/xcodebuild -projec... | ajibawa-2023/Python-Code-Large/train/row_78120 | 52 | 84 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78120:ImportFrom_L3_C0", "label": "from os import mkdir, makedirs, environ\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0119, 0, 0.66, 0.0, 688, 0, 7, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "impor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78120:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78120:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78120:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78120:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
__author__ = """
NAME: Abhijeet Rastogi (shadyabhi)
Profile: http://www.google.com/profiles/abhijeet.1989
"""
import cookielib
import urllib2
from getpass import getpass
import sys
from urllib import urlencode
from getopt import getopt
username = None
passwd = None
message = None
number = None
def... | ajibawa-2023/Python-Code-Large/train/row_78121 | 61 | 84 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78121:Assign_L3_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [3, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0536, 0.0476, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78121:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78121:Expr_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78121:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78121:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
from distutils.core import setup
import os
def get_build():
path = "./.build"
if os.path.exists(path):
fp = open(path, "r")
build = eval(fp.read())
if os.path.exists("./.increase_build"):
build += 1
fp.close()
else:
build = 1
fp = open(path, "w")
fp.write(str(build))
fp.cl... | ajibawa-2023/Python-Code-Large/train/row_78122 | 15 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78122:ImportFrom_L3_C0", "label": "from distutils.core import setup", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0312, 0, 0.66, 0.0, 152, 0, 1, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78122:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78122:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78122:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78122:If_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large... |
# -*- coding: utf-8 -*-
#
# pylast - A Python interface to Last.fm (and other API compatible social networks)
#
# Copyright 2008-2010 Amr Hassan
#
# 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 a... | ajibawa-2023/Python-Code-Large/train/row_78123 | 2,012 | 3,812 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78123:Assign_L21_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0055, 0.0003, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78123:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78123:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78123:If_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78123:ImportFrom_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
'''
Created on 21-03-2011
@author: maciek
'''
def formatString(format, **kwargs):
'''
'''
if not format: return ''
for arg in kwargs.keys():
format = format.replace("{" + arg + "}", "##" + arg + "##")
format = format.replace ("{", "{{")
format = format.replace("}", "}}")
for... | ajibawa-2023/Python-Code-Large/train/row_78124 | 15 | 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_78124:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1304, 0.2174, 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_78124:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78124:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78124:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78124:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
'''
Created on 21-03-2011
@author: maciek
'''
from IndexGenerator import IndexGenerator
from optparse import OptionParser
import os
import tempfile
import shutil
import logging
logging.basicConfig(level = logging.DEBUG)
parser = OptionParser()
parser.add_option('-n', '--app-name', action='store', dest='appName', hel... | ajibawa-2023/Python-Code-Large/train/row_78125 | 69 | 88 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78125:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0341, 0.0568, 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_78125:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78125:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78125:If_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78125:If_L28_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78125... |
'''
Created on 21-03-2011
@author: maciek
'''
from formater import formatString
import os
class IndexGenerator(object):
'''
Generates Index.html for iOS app OTA distribution
'''
basePath = os.path.dirname(__file__)
templateFile = os.path.join(basePath,"templates/index.tmpl")
releaseUrls = ""
... | ajibawa-2023/Python-Code-Large/train/row_78126 | 31 | 57 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78126:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0526, 0.0877, 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_78126:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78126:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78126:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78126:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
'''
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_78127 | 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_78127: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78127:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78127:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78127:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78127:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/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_78128 | 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_78128: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78128:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78128:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78128:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78128:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
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_78129 | 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_78129: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78129:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78129:Expr_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78129:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78129:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-La... |
'''
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_78130 | 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_78130: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78130:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78130:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78130:FunctionDef_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_78130:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Co... |
'''
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_78131 | 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_78131: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78131:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78131:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78131:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78131:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code... |
'''
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_78132 | 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_78132: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": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78132:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78132:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78132:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78132:FunctionDef_L19_C2"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
__version__ = "0.3"
__date__ = "2005-12-01"
__author__ = "David Lynch (kemayo AT Google's mail service DOT com)"
__copyright__ = "Copyright 2005, David Lynch"
__license__ = "New BSD"
__history__ = """
0.3 - 20051205 - Cleaned up __post.
0.2 - 20051201 - Added documentation, and tweaked the circumst... | ajibawa-2023/Python-Code-Large/train/row_78133 | 50 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78133:Assign_L3_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0098, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78133:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78133:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78133:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78133:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
__version__ = "0.3"
__date__ = "2005-12-01"
__author__ = "David Lynch (kemayo AT Google's mail service DOT com)"
__copyright__ = "Copyright 2005, David Lynch"
__license__ = "New BSD"
__history__ = """
0.3 - 20051205 - Cleaned up __post.
0.2 - 20051201 - Added documentation, and tweaked the circumst... | ajibawa-2023/Python-Code-Large/train/row_78134 | 50 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78134:Assign_L3_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0098, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78134:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78134:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78134:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78134:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-... |
import akismet
akismet.USERAGENT = "MyApplication/MyVersion"
my_api_key = "SOMETHING"
try:
real_key = akismet.verify_key(my_api_key,"http://www.example.com")
if real_key:
is_spam = akismet.comment_check(my_api_key,"http://www.example.com",
"127.0.0.1", "Mozilla/5.0 (...) Gecko/2... | ajibawa-2023/Python-Code-Large/train/row_78135 | 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_78135:Import_L1_C0", "label": "akismet import akismet", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "akismet", "arg_names": [], "import_names": ["akismet"], "rhs_... | [] |
#!/usr/bin/env python2.5
"""
The server places user reports into the database, allows
admins to process the database for statistics and displays
the results of previously processed statistics.
We don't need strong consistency guarantees, so we
don't do anything special with ancestor queries or parent keys.
"""
# magi... | ajibawa-2023/Python-Code-Large/train/row_78136 | 162 | 260 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78136:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0212, 0.0308, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78136:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78136:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78136:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78136:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/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_78137 | 77 | 224 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78137:Expr_L46_C0", "label": "expression", "type": "expression", "loc": [46, 47], "level": 0, "parent": null, "vector": [8, 0, 0.2076, 0.0089, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78137:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78137:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78137:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78137:If_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import re
# Refreshes the iUI HTML documentation (iui_docs.html), regenerating it from the
# code comments in iui.js
def refresh():
# read in the comments from iui.js
iui_source = open('web-app/iui/iui.js')
comments_list = get_multiline_comments(iui_source.read())
comments_list = [convert_to_html(comment) f... | ajibawa-2023/Python-Code-Large/train/row_78138 | 74 | 107 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78138:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78138:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78138:Assign_L8_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78138:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78138:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
import time
import RPi.GPIO as GPIO
GND_PIN = 6 # not used by program but needs to be connected!
LED_PIN = 12
SWITCH_PIN = 18
def test_output():
print('OUTPUT test')
for i in range(10):
time.sleep(0.1)
GPIO.output(LED_PIN, GPIO.HIGH)
if GPIO.input(LED_PIN) != GPIO.HIGH:
... | ajibawa-2023/Python-Code-Large/train/row_78139 | 187 | 241 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78139:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.0041, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78139:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78139:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78139:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78139:For_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
import asyncore
import socket
import select
import RPi.GPIO as GPIO
#Initial GPIO-setup
#GPIO.setwarnings(False)
#GPIO.cleanup()
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BCM)
# For LED1 we use pin 4 according BCM pin count
# (see https://projects.drogon.net/raspberry-pi/wiringpi/pins/)
LED1 = 4
GPI... | ajibawa-2023/Python-Code-Large/train/row_78140 | 93 | 129 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78140:Import_L1_C0", "label": "asyncore import asyncore", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0078, 0, 0.66, 0.0, 563, 0, 1, 0, 0, 563, 0, 0], "semantic": {"name": "asyncore", "arg_names": [], "import_names": ["asyncor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78140:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78140:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78140:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78140:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Co... |
from distutils.core import setup, Extension
classifiers = ['Development Status :: 5 - Production/Stable',
'Operating System :: POSIX :: Linux',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.6... | ajibawa-2023/Python-Code-Large/train/row_78141 | 3 | 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_78141:ImportFrom_L1_C0", "label": "from distutils.core import setup, Extension", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 152, 0, 2, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], ... | [] |
# Servo Control
import time
def set(property, value):
try:
f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w')
f.write(value)
f.close()
except:
print("Error writing to: " + property + " value: " + value)
def setServo(angle):
set("servo", str(angle))
set("delayed", "0")
set("mode", "servo")
set("serv... | ajibawa-2023/Python-Code-Large/train/row_78142 | 21 | 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_78142:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0345, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78142:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78142:Try_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78142:Try_L4_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_78142:Assign_L5_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import time
import RPi.GPIO as GPIO
LED_PIN = 12
SWITCH_PIN = 18
def test_output():
print('OUTPUT test')
for i in range(10):
time.sleep(0.1)
GPIO.output(LED_PIN, GPIO.HIGH)
if GPIO.input(LED_PIN) != GPIO.HIGH:
print('Read back of output failed.')
... | ajibawa-2023/Python-Code-Large/train/row_78143 | 158 | 192 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78143:Import_L1_C0", "label": "time import time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78143:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78143:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78143:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78143:For_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
#!/usr/bin/python
# Echo server program
import socket
import RPi.GPIO as GPIO
import time
#####################################################################
#### SETUP IOs ######################################################
#####################################################################
# to use ... | ajibawa-2023/Python-Code-Large/train/row_78144 | 3 | 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_78144:Import_L1_C0", "label": "socket import socket", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [] |
# coding=utf-8
import SocketServer
import os
import RPi.GPIO as GPIO
import time
#Initial GPIO-setup
GPIO.setwarnings(False)
GPIO.cleanup()
GPIO.setmode(GPIO.BOARD)
#GPIO OUT configurations
#Lights indoors
GPIO.setup(3, GPIO.OUT) #Garagedoor
GPIO.setup(5, GPIO.OUT) #Garage roof light
GPIO.setup(7, GPIO.OUT) #Workshop ... | ajibawa-2023/Python-Code-Large/train/row_78145 | 145 | 202 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78145:Import_L2_C0", "label": "SocketServer import SocketServer", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 0.005, 0, 0.66, 0.0, 646, 0, 1, 0, 0, 646, 0, 0], "semantic": {"name": "SocketServer", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78145:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78145:Expr_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78145:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78145:FunctionDef_L39_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# Echo server program
import socket
import RPi.GPIO as GPIO
import time
#####################################################################
#### SETUP IOs ######################################################
#####################################################################
# to use ... | ajibawa-2023/Python-Code-Large/train/row_78146 | 3 | 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_78146:Import_L1_C0", "label": "socket import socket", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [] |
#!/usr/bin/python
# Echo server program
import socket
import RPi.GPIO as GPIO
import time
#####################################################################
#### SETUP IOs ######################################################
#####################################################################
# to use ... | ajibawa-2023/Python-Code-Large/train/row_78147 | 3 | 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_78147:Import_L1_C0", "label": "socket import socket", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [] |
#!/usr/bin/python
# Echo server program
import socket
import RPi.GPIO as GPIO
import time
#####################################################################
#### SETUP IOs ######################################################
#####################################################################
# to use ... | ajibawa-2023/Python-Code-Large/train/row_78148 | 3 | 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_78148:Import_L1_C0", "label": "socket import socket", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [] |
from distutils.core import setup, Extension
classifiers = ['Development Status :: 3 - Alpha',
'Operating System :: POSIX :: Linux',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.6',
... | ajibawa-2023/Python-Code-Large/train/row_78150 | 3 | 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_78150:ImportFrom_L1_C0", "label": "from distutils.core import setup, Extension", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.04, 0, 0.66, 0.0, 152, 0, 2, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": [], ... | [] |
#!/usr/bin/python
# Echo server program
import socket
import RPi.GPIO as GPIO
#####################################################################
#### SETUP IOs ######################################################
#####################################################################
# to use Raspberry P... | ajibawa-2023/Python-Code-Large/train/row_78151 | 37 | 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_78151:Import_L4_C0", "label": "socket import socket", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0615, 0.0154, 0, 0.66, 0.0, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78151:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78151:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78151:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78151:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/python
import time
from Adafruit_I2C import Adafruit_I2C
# ===========================================================================
# BMP085 Class
# ===========================================================================
class BMP085 :
i2c = None
# Operating Modes
__BMP085_ULTRALOWPOWER ... | ajibawa-2023/Python-Code-Large/train/row_78152 | 211 | 259 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78152:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0039, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78152:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78152:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78152:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78152:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
from Adafruit_BMP085 import BMP085
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the BMP085 and use STANDARD mode (default value)
# bmp = BMP085(0x77, debug=True... | ajibawa-2023/Python-Code-Large/train/row_78153 | 8 | 35 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78153:ImportFrom_L3_C0", "label": "from Adafruit_BMP085 import BMP085", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0286, 0, 0.66, 0.0, 872, 0, 1, 0, 0, 872, 0, 0], "semantic": {"name": "Adafruit_BMP085", "arg_names": [], "imp... | [] |
#!/usr/bin/python
import MySQLdb
import datetime
conn = MySQLdb.connect(host= "localhost",
user="root",
passwd="02oben10",
db="evsicaklik")
x = conn.cursor()
dosyapressure = open("/root/akilliev/log/pressure.txt", "r")
icerikpressure = dosyapressure.read()
iceri... | ajibawa-2023/Python-Code-Large/train/row_78155 | 27 | 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_78155:Import_L4_C0", "label": "MySQLdb import MySQLdb", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 838, 0, 1, 0, 0, 838, 0, 0], "semantic": {"name": "MySQLdb", "arg_names": [], "import_names": ["MySQLdb"],... | [] |
#!/usr/bin/python
import paramiko
from commands import getstatusoutput
DIR = '/path/to/your/temperature/scripts'
#generate graphs
getstatusoutput(DIR + '/create_graph.sh')
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('your_sftp_server', port=your_sftp_port, user... | ajibawa-2023/Python-Code-Large/train/row_78156 | 13 | 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_78156:Import_L2_C0", "label": "paramiko import paramiko", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0526, 0, 0.66, 0.0, 582, 0, 1, 0, 0, 582, 0, 0], "semantic": {"name": "paramiko", "arg_names": [], "import_names": ["paramik... | [] |
import asyncore
import socket
import select
import RPi.GPIO as GPIO
#Initial GPIO-setup
GPIO.setwarnings(False)
GPIO.cleanup()
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BCM)
# For LED1 we use pin 4 according BCM pin count
# (see https://projects.drogon.net/raspberry-pi/wiringpi/pins/)
LED1 = 4
GPIO.... | ajibawa-2023/Python-Code-Large/train/row_78157 | 95 | 129 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78157:Import_L1_C0", "label": "asyncore import asyncore", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0078, 0, 0.66, 0.0, 563, 0, 1, 0, 0, 563, 0, 0], "semantic": {"name": "asyncore", "arg_names": [], "import_names": ["asyncor... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78157:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78157:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78157:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_78157:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
import time
time = time.strftime("%H:%M")
file1 = open("/root/akilliev/log/temphum.txt","r")
cihazsicd = file1.read()
cihazsicd = cihazsicd.split(' ')
cihazsic = cihazsicd[0]
cihazsic = cihazsic.strip()
cihazsich = cihazsicd[1]
cihazsich = cihazsich.strip()
file1.close
file2 = open("/root/akill... | ajibawa-2023/Python-Code-Large/train/row_78158 | 50 | 81 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78158:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0247, 0.0123, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [] |
from i2clibraries import i2c_lcd
from time import *
# Configuration parameters
# I2C Address, Port, Enable pin, RW pin, RS pin, Data 4 pin, Data 5 pin, Data 6 pin, Data 7 pin, Backlight pin (optional)
lcd = i2c_lcd.i2c_lcd(0x27,0, 2, 1, 0, 4, 5, 6, 7, 3)
# If you want to disable the cursor, uncomment the following l... | ajibawa-2023/Python-Code-Large/train/row_78159 | 7 | 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_78159:ImportFrom_L1_C0", "label": "from i2clibraries import i2c_lcd", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 384, 0, 1, 0, 0, 384, 0, 0], "semantic": {"name": "i2clibraries", "arg_names": [], "import_n... | [] |
#!/usr/bin/python
# demo.py - CMD Args Demo By nixCraft
import sys
# Get the total number of args passed to the demo.py
total = len(sys.argv)
# Get the arguments list
cmdargs = str(sys.argv)
# Print it
print ("The total numbers of args passed to the script: %d " % total)
print ("Args list: %s " % cmdargs)
| ajibawa-2023/Python-Code-Large/train/row_78160 | 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_78160:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0769, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [] |
import lcddriver
from time import *
lcd = lcddriver.lcd()
lcd.lcd_display_string("REBOOT REBOOT", 1)
lcd.lcd_display_string("REBOOT REBOOT", 2)
| ajibawa-2023/Python-Code-Large/train/row_78161 | 5 | 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_78161:Import_L1_C0", "label": "lcddriver import lcddriver", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 406, 0, 1, 0, 0, 406, 0, 0], "semantic": {"name": "lcddriver", "arg_names": [], "import_names": ["lcdd... | [] |
import lcddriver
from time import *
#import sys
import shutil
shutil.copy ('/root/akilliev/lcd.txt','/var/www/lcd.txt')
file = open("/root/akilliev/lcd.txt","r")
lines = file.readlines()
x = lines[0]
y = lines[1]
file.close
lcd = lcddriver.lcd()
#para = str(sys.argv[1])
lcd.lcd_display_string(x, 1)
lcd.lcd_displa... | ajibawa-2023/Python-Code-Large/train/row_78162 | 12 | 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_78162:Import_L1_C0", "label": "lcddriver import lcddriver", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.05, 0, 0.66, 0.0, 406, 0, 1, 0, 0, 406, 0, 0], "semantic": {"name": "lcddriver", "arg_names": [], "import_names": ["lcddrive... | [] |
import smbus
from time import *
class i2c_device:
def __init__(self, addr, port=1):
self.addr = addr
self.bus = smbus.SMBus(port)
# Write a single command
def write_cmd(self, cmd):
self.bus.write_byte(self.addr, cmd)
sleep(0.0001)
# Write a command and argument
def write_cmd_arg(self... | ajibawa-2023/Python-Code-Large/train/row_78163 | 21 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78163:Import_L1_C0", "label": "smbus import smbus", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 936, 0, 1, 0, 0, 936, 0, 0], "semantic": {"name": "smbus", "arg_names": [], "import_names": ["smbus"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78163:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78163:FunctionDef_L5_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78163:FunctionDef_L5_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_78163:Assign_L6_C6"}, {"f": "ajibawa-2023/Python-Code... |
import lcddriver
from time import *
import sys
lcd = lcddriver.lcd()
para = str(sys.argv[1])
para2 = sys.argv[2]
lcd.lcd_display_string(para, int(para2))
| ajibawa-2023/Python-Code-Large/train/row_78164 | 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_78164:Import_L1_C0", "label": "lcddriver import lcddriver", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 406, 0, 1, 0, 0, 406, 0, 0], "semantic": {"name": "lcddriver", "arg_names": [], "import_names": ["lcddri... | [] |
#!/usr/bin/env python
import time
import shutil
time = time.strftime("%H:%M")
file1 = open("/root/akilliev/log/temphum.txt","r")
cihazsicd = file1.read()
cihazsicd = cihazsicd.split(' ')
cihazsic = cihazsicd[0]
cihazsic = cihazsic.strip()
cihazsich = cihazsicd[1]
cihazsich = cihazsich.strip()
file1.close
file2 = op... | ajibawa-2023/Python-Code-Large/train/row_78165 | 52 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78165:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0215, 0.0108, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [] |
#!/usr/bin/env python
import time
from lcd import lcddriver
from i2clibraries import i2c_lcd_smbus
lcd1 = lcddriver.lcd()
lcd2 = i2c_lcd_smbus.i2c_lcd(0x27,1, 2, 1, 0, 4, 5, 6, 7, 3)
lcd2.command(lcd2.CMD_Display_Control | lcd2.OPT_Enable_Display)
lcd2.backLightOn()
def writeLcd1(message):
lcd1.lcd_display_... | ajibawa-2023/Python-Code-Large/train/row_78166 | 23 | 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_78166:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0222, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78166:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78166:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78166:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78166:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import i2c_lib
from time import *
# LCD Address
ADDRESS = 0x27
# commands
LCD_CLEARDISPLAY = 0x01
LCD_RETURNHOME = 0x02
LCD_ENTRYMODESET = 0x04
LCD_DISPLAYCONTROL = 0x08
LCD_CURSORSHIFT = 0x10
LCD_FUNCTIONSET = 0x20
LCD_SETCGRAMADDR = 0x40
LCD_SETDDRAMADDR = 0x80
# flags for display entry mode
LCD_ENTRYRIGHT = 0x00
... | ajibawa-2023/Python-Code-Large/train/row_78167 | 73 | 102 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78167:Import_L1_C0", "label": "i2c_lib import i2c_lib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0098, 0.0098, 0, 0.66, 0.0, 214, 0, 1, 0, 0, 214, 0, 0], "semantic": {"name": "i2c_lib", "arg_names": [], "import_names": ["i2c_lib"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78167:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78167:FunctionDef_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78167:FunctionDef_L55_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_78167:Assign_L56_C6"}, {"f": "ajibawa-2023/Python-... |
import smbus
import time
bus = smbus.SMBus(1)
address = 0x27
def bearing255():
bear = bus.read_byte_data(address, 1)
return bear
def bearing3599():
bear1 = bus.read_byte_data(address, 2)
bear2 = bus.read_byte_data(address, 3)
bear = (bear1 << 8) + bear2
bear = bear/10.0... | ajibawa-2023/Python-Code-Large/train/row_78168 | 19 | 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_78168:Import_L1_C0", "label": "smbus import smbus", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 936, 0, 1, 0, 0, 936, 0, 0], "semantic": {"name": "smbus", "arg_names": [], "import_names": ["smbus"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78168:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78168:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78168:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78168:Return_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
# remember to change the GPIO values below to match your sensors
# GPIO output = the pin that's connected to "Trig" on the sensor
# GPIO input = the pin that's connected to "Echo" on the sensor
def reading(sensor):
import time
import RPi.GPIO as GPIO
# Disable any warning message su... | ajibawa-2023/Python-Code-Large/train/row_78169 | 23 | 89 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78169:FunctionDef_L7_C0", "label": "reading", "type": "function", "loc": [7, 86], "level": 0, "parent": null, "vector": [2, 0, 0.5225, 0.8989, 0, 0.66, 0.0, 549, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "reading", "arg_names": ["sensor"], "import_names": [], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78169:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78169:Import_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78169:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78169:Import_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import dhtreader
DHT11 = 11
DHT22 = 22
AM2302 = 22
dhtreader.init()
if len(sys.argv) != 3:
print("usage: {0} [11|22|2302] GPIOpin#".format(sys.argv[0]))
print("example: {0} 2302 Read from an AM2302 connected to GPIO #4".format(sys.argv[0]))
sys.ex... | ajibawa-2023/Python-Code-Large/train/row_78170 | 28 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78170:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.025, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78170:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78170:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78170:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78170:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_781... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from distutils.core import setup, Extension
dht_mod = Extension('dhtreader',
include_dirs = ['.'],
libraries = ['bcm2835'],
sources = ['dhtreader.c'])
setup (name = 'dhtreader',
version = '1.0',
des... | ajibawa-2023/Python-Code-Large/train/row_78171 | 3 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78171:ImportFrom_L4_C0", "label": "from distutils.core import setup, Extension", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0714, 0, 0.66, 0.0, 152, 0, 2, 0, 0, 152, 0, 0], "semantic": {"name": "distutils.core", "arg_names": ... | [] |
#!/usr/bin/env python
# just some bitbang code for testing both channels
import RPi.GPIO as GPIO, time, os
DEBUG = 1
GPIO.setmode(GPIO.BCM)
# this function is not used, its for future reference!
def slowspiwrite(clockpin, datapin, byteout):
GPIO.setup(clockpin, GPIO.OUT)
GPIO.setup(datapin, GPIO.OUT)
for i in ra... | ajibawa-2023/Python-Code-Large/train/row_78173 | 58 | 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_78173:Import_L5_C0", "label": "RPi.GPIO import GPIO, time, os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0532, 0.0106, 0, 0.66, 0.0, 453, 0, 3, 0, 0, 453, 0, 0], "semantic": {"name": "RPi.GPIO", "arg_names": [], "import_names": ["G... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78173:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78173:Expr_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78173:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78173:Expr_L13_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
import subprocess
import re
import sys
import time
import datetime
import gspread
# ===========================================================================
# Google Account Details
# ===========================================================================
# Account details for google docs
em... | ajibawa-2023/Python-Code-Large/train/row_78175 | 6 | 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_78175:Import_L1_C0", "label": "subprocess import subprocess", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["s... | [] |
#!/usr/bin/python
from time import sleep
from Adafruit_TCS34725 import TCS34725
# ===========================================================================
# Example Code
# ===========================================================================
# Initialize the TCS34725 and use default integration time and gain... | ajibawa-2023/Python-Code-Large/train/row_78176 | 14 | 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_78176:ImportFrom_L2_C0", "label": "from time import sleep", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["sleep"], "... | [] |
#!/usr/bin/python
import time
from Adafruit_I2C import Adafruit_I2C
# ===========================================================================
# TCS3472 Class
# ===========================================================================
class TCS34725:
i2c = None
__TCS34725_ADDRESS = 0x29
_... | ajibawa-2023/Python-Code-Large/train/row_78178 | 140 | 220 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78178:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0136, 0.0045, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78178:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78178:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78178:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78178:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
from time import sleep
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate
# Initialize the LCD plate. Should auto-detect correct I2C bus. If not,
# pass '0' for early 256 MB Model B boards or '1' for all later versions
lcd = Adafruit_CharLCDPlate()
# Clear display and show greeting, pause 1 ... | ajibawa-2023/Python-Code-Large/train/row_78179 | 20 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78179:ImportFrom_L3_C0", "label": "from time import sleep", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.027, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["sleep"], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78179:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78179:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78179:For_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78179:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
#!/usr/bin/python
# Copyright 2012 Daniel Berlin (with some changes by Adafruit Industries/Limor Fried)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal MCP230XX_GPIO(1, 0xin
# the Software without restrict... | ajibawa-2023/Python-Code-Large/train/row_78181 | 124 | 204 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78181:ImportFrom_L23_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1127, 0.0049, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78181:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78181:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78181:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78181:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# Python library for Adafruit RGB-backlit LCD plate for Raspberry Pi.
# Written by Adafruit Industries. MIT license.
# This is essentially a complete rewrite, but the calling syntax
# and constants are based on code from lrvick and LiquidCrystal.
# lrvic - https://github.com/lrvick/raspi-hd44780/bl... | ajibawa-2023/Python-Code-Large/train/row_78182 | 219 | 479 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78182:ImportFrom_L11_C0", "label": "from Adafruit_I2C import Adafruit_I2C", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.023, 0.0021, 0, 0.66, 0.0, 617, 0, 1, 0, 0, 617, 0, 0], "semantic": {"name": "Adafruit_I2C", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78182:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78182:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78182:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78182:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
import time
import datetime
from Adafruit_8x8 import EightByEight
# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = EightByEight(address=0x70)
print "Press CTRL+Z to ... | ajibawa-2023/Python-Code-Large/train/row_78183 | 13 | 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_78183:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1364, 0.0455, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78183:While_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78183:For_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78183:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_78183:For_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_7... |
#!/usr/bin/python
import time
from copy import copy
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# LEDBackpack Class
# ============================================================================
class LEDBackpack:
i2c = None
# Registers
... | ajibawa-2023/Python-Code-Large/train/row_78184 | 55 | 87 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_78184:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0115, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_78184:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78184:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_78184:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_78184:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.