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 |
|---|---|---|---|---|---|---|---|
from pattern.circuit import Control
import weakref, gobject
import os.path, posixpath, urllib
import BaseHTTPServer, SimpleHTTPServer
class HTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def notify(self, method):
s = self.server
if s is not None and hasattr(s, 'notify'):
... | ajibawa-2023/Python-Code-Large/train/row_97817 | 43 | 60 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97817:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0167, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97817:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97817:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97817:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97817:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod... |
class entry(object):
VERBS = ["Edit Content"]
def __init__(self):
self.page = ""
def realize(self, event):
self.realized = event
if hasattr(event.shape, 'value'):
self.page = event.shape.value
def please(self, event):
return self.page
... | ajibawa-2023/Python-Code-Large/train/row_97818 | 27 | 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_97818:ClassDef_L2_C0", "label": "entry", "type": "class", "loc": [2, 35], "level": 0, "parent": null, "vector": [3, 0, 0.5286, 0.9714, 0, 0.66, 0.0, 812, 0, 5, 0, 0, 186, 0, 16], "semantic": {"name": "entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97818:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97818:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97818:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97818:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from pattern.circuit import Control
class entry(Control):
def incoming(self, event):
page = self.collect(event)
event.trail.send_response(200)
event.trail.send_header("Content-type", "text/html")
event.trail.send_header("Content-length", str(len(page)))
event.trail.end_... | ajibawa-2023/Python-Code-Large/train/row_97819 | 14 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97819:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0556, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97819:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97819:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97819:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97819:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
import gtk
class entry(object):
def incoming(self, event):
area, = event.data
gc = area.window.new_gc()
x = getattr(event.shape, "x", 10)
y = getattr(event.shape, "y", 10)
area.window.draw_rectangle(gc, False, x, y, 20, 20) | ajibawa-2023/Python-Code-Large/train/row_97820 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97820:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97820:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97820:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97820:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97820:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
from pattern.circuit import Control
class entry(Control):
VERBS = ["Clear"]
def realize(self, event):
self.realized = event
if not hasattr(event.shape, 'store'):
event.shape.store = { }
self.updated(event)
def incoming(self, event):
request, = even... | ajibawa-2023/Python-Code-Large/train/row_97821 | 24 | 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_97821:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97821:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97821:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97821:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97821:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
import gtk
import pango
class FoolishEditorWindow(object):
KEY_TAB = 65289
KEY_ENTER = 65293
KEY_S = 115
TAB_WIDTH = 4
def __init__(self):
self.window = gtk.Window()
self.window.set_title("Code Window")
self.sw = gtk.ScrolledWindow()
self.textbu... | ajibawa-2023/Python-Code-Large/train/row_97822 | 84 | 110 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97822:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0091, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97822:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97822:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97822:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97822:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import os,sys
import wx
import wx.html
class exHtmlWindow(wx.html.HtmlWindow):
def __init__(self, parent, id, frame):
wx.html.HtmlWindow.__init__(self,parent,id)
class exHtmlPanel(wx.Panel):
def __init__(self, parent, id, frame):
wx.Panel.__init__(self,parent,-1)
self.html = exHtmlWindow(sel... | ajibawa-2023/Python-Code-Large/train/row_97823 | 34 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97823:Import_L2_C0", "label": "os import os, sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0213, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97823:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97823:FunctionDef_L7_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97823:FunctionDef_L7_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_97823:Expr_L8_C6"}, {"f": "ajibawa-2023/Python-Code-L... |
import os
import sys
import signal
import select
import pickle
import new
import traceback
import gobject
if __name__ == "__main__":
Control = object
else:
import pattern
from pattern.circuit import Control
from pattern.serialization import picklers
class entry(Control):
def realize(self, event)... | ajibawa-2023/Python-Code-Large/train/row_97824 | 86 | 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_97824:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0087, 0.0087, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97824:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97824:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97824:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97824:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import sys
class entry(object):
def incoming(self, event):
print "Will talk back to parent process -", event.data
print >> sys.pout, "This is me", event.data
sys.pout.flush()
| ajibawa-2023/Python-Code-Large/train/row_97825 | 5 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97825:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 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_97825:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97825:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97825:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97825:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
import weakref
import pattern.crossref
from pattern.circuit import Control, Event
from pattern.crossref import CrossReference
from pattern.serialization.picklers import ShapesPickler
class entry(Control):
def incoming(self, event):
if event.point.tag == "from_remote":
(msg, hook_index, data),... | ajibawa-2023/Python-Code-Large/train/row_97826 | 100 | 127 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97826:Import_L1_C0", "label": "weakref import weakref", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0079, 0, 0.66, 0.0, 708, 0, 1, 0, 0, 708, 0, 0], "semantic": {"name": "weakref", "arg_names": [], "import_names": ["weakref"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97826:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97826:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97826:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97826:If_L11_C8"}, {"f": "ajibawa-2023/Python-Code-... |
from pattern.circuit import Control
class entry(Control):
def realize(self, event):
self.title = "Worker"
def incoming(self, event):
print self.title, event.data
bridge = self.acquireInterface(event, "bottom:50%")
if bridge is not None:
bridge.push(*(("nex... | ajibawa-2023/Python-Code-Large/train/row_97827 | 9 | 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_97827:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97827:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97827:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97827:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97827:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
import gtk
from pattern.circuit import Control
class entry(Control):
VERBS = ["Create"]
def realize(self, event):
# Create window
self.window = gtk.Window()
self.window.show()
self.widget = None
def incoming(self, event):
self.clean()
... | ajibawa-2023/Python-Code-Large/train/row_97828 | 38 | 52 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97828:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.0192, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97828:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97828:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97828:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97828:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
import gtk
from pattern.circuit import Control
class entry(Control):
VERBS = ["Refresh"]
def realize(self, event):
self.area = gtk.DrawingArea()
self.area.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("navajowhite"))
self.area.connect("expose-event", self.area_expose_cb)
... | ajibawa-2023/Python-Code-Large/train/row_97829 | 23 | 31 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97829:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97829:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97829:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97829:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97829:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
import gtk
class entry:
def realize(self, event):
self.treeview = gtk.TreeView()
self.treeview.show()
def incoming(self, event):
if "creating" in event.frame.on:
event.frame.on["creating"](event, self.treeview) | ajibawa-2023/Python-Code-Large/train/row_97830 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97830:Import_L1_C0", "label": "gtk import gtk", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 166, 0, 1, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97830:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97830:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97830:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97830:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
from pattern.circuit import Control
from algonquin.circuit import CircuitGeometry
class InnerCircuit(object):
def __init__(self, parent_circuit, container_shape):
self.parent = parent_circuit
self.shape = container_shape
def __getattr__(self, nm):
return getattr(self.parent, ... | ajibawa-2023/Python-Code-Large/train/row_97831 | 46 | 70 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97831:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0143, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97831:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97831:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97831:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97831:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from pattern.circuit import Control
class entry(Control):
def incoming(self, event):
bridge = self.acquireInterface(event, "out")
if bridge is not None:
bridge.push(event.shape.value)
| ajibawa-2023/Python-Code-Large/train/row_97833 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97833:ImportFrom_L1_C0", "label": "from pattern.circuit import Control", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 53, 0, 1, 0, 0, 53, 0, 0], "semantic": {"name": "pattern.circuit", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97833:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97833:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97833:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97833:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
import weakref
import pattern.circuit
class CircuitOperability(object):
"""
Represents the aspect in which a circuit operates the logical controls
contained in it.
"""
def emit(self, e4shape, cb, **kwargs):
container = self.get_container(e4shape)
if container is not None:
... | ajibawa-2023/Python-Code-Large/train/row_97835 | 86 | 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_97835:Import_L1_C0", "label": "weakref import weakref", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0078, 0, 0.66, 0.0, 708, 0, 1, 0, 0, 708, 0, 0], "semantic": {"name": "weakref", "arg_names": [], "import_names": ["weakref"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97835:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97835:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97835:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97835:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/env python
#
# Repeats a command for each demo and reports the status.
# The command is executed from the root directory of the demo.
#
# Example:
# python demos.py "ant install"
# python demos.py "android update project -p ."
#
import os
import sys
def demos(command):
tools_directory, script = os.path.s... | ajibawa-2023/Python-Code-Large/train/row_97836 | 28 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97836:Import_L11_C0", "label": "os import os", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2558, 0.0233, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97836:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97836:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97836:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97836:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
#
# Updates the JARs in the demo libs/ directories
# with the current build output found in bin/.
#
import os
import shutil
import sys
def listdir(path):
"""List files at the specified path excluding hidden files"""
return filter(lambda x: not x.startswith('.'), os.listdir(path))
def libs()... | ajibawa-2023/Python-Code-Large/train/row_97837 | 25 | 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_97837:Import_L7_C0", "label": "os import os", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1892, 0.027, 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_97837:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97837:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97837:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97837:Return_L13_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
#
# Builds archives for SDK releases.
#
# Usage:
# python tools/sdk.py <version>
#
import os
import shutil
import sys
import tempfile
def execute(command):
status = os.system(command)
if status != 0:
raise Exception('unexpected result: %d' % status)
def sdk(version, output):
# Find th... | ajibawa-2023/Python-Code-Large/train/row_97838 | 36 | 68 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97838:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1324, 0.0147, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97838:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97838:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97838:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97838:If_L16_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
from algaefw import *
@get('/(?P<name>\w+)')
def hello(request, name=', world'):
return render('inform.html',{'data':name})
@get('/.*')
def test(request):
return render('inform.html',{'data':"In the test page"})
if __name__ == '__main__': main()
| ajibawa-2023/Python-Code-Large/train/row_97839 | 7 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97839:ImportFrom_L3_C0", "label": "from algaefw import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0769, 0, 0.66, 0.0, 119, 0, 1, 0, 0, 119, 0, 0], "semantic": {"name": "algaefw", "arg_names": [], "import_names": ["*"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97839:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97839:Return_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97839:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97839:Return_L11_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
from algaefw import *
@get('/(?P<name>\w+)')
def hello(request, name=', world'):
return render('inform.html',{'data':name})
@get('/.*')
def test(request):
return render('inform.html',{'data':"In the test page"})
if __name__ == '__main__': main()
| ajibawa-2023/Python-Code-Large/train/row_97840 | 7 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97840:ImportFrom_L3_C0", "label": "from algaefw import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0769, 0, 0.66, 0.0, 119, 0, 1, 0, 0, 119, 0, 0], "semantic": {"name": "algaefw", "arg_names": [], "import_names": ["*"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97840:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97840:Return_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97840:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97840:Return_L11_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_97842 | 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_97842: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_97842:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97842:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97842:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97842: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_97843 | 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_97843: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_97843:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97843:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97843:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97843: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_97844 | 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_97844: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_97844:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97844:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97844:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97844:Assign_L26_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_97845 | 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_97845: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_97845:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97845:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97845:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97845:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code... |
# encoding: utf8
"""
Django settings for alfredo_imoveis project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.pa... | ajibawa-2023/Python-Code-Large/train/row_97846 | 26 | 122 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97846:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0492, 0.0738, 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_97846:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97846:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97846:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97846:Assign_L76_C4"}] |
# encoding: utf8
"""
Django settings for alfredo_imoveis project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.pa... | ajibawa-2023/Python-Code-Large/train/row_97847 | 26 | 120 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97847:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 10], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.075, 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_97847:If_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97847:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97847:If_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97847:Assign_L74_C4"}] |
# encoding:utf-8
from django.conf.urls import patterns, include, url
import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns =\
patterns('alfredo_imoveis.views', url(r'^$', 'home', name='main_home'),
url(r'^grappelli/', include('grappelli.urls')),
url(r'^clientes... | ajibawa-2023/Python-Code-Large/train/row_97848 | 6 | 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_97848:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, include, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0238, 0, 0.66, 0.0, 528, 0, 3, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "ar... | [] |
"""
WSGI config for alfredo_imoveis project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "alfredo_imoveis.settings")
fr... | ajibawa-2023/Python-Code-Large/train/row_97849 | 5 | 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_97849:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.3214, 0.5714, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
# encoding: utf8
__author__ = 'gpzim98'
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from funcionarios.models import Funcionario
from parametros.models import ParametrosGerais
template_home = 'index.html'
template_dashboard = 'dashboard.html'
def home(reques... | ajibawa-2023/Python-Code-Large/train/row_97850 | 30 | 49 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97850:Assign_L2_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0408, 0.0204, 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_97850:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97850:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97850:If_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97850:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# encoding: utf8
from django.db import models
from enderecos.models import Endereco
from django.contrib.auth.admin import User
from clientes.models import Cliente
from empresas.models import Empresa
from funcoes import today
TIPO_CONTRATO = (
('C', 'COMERCIAL'),
('R', 'RESIDENCIAL'),
)
LOCAL_CHAVES = (
('P... | ajibawa-2023/Python-Code-Large/train/row_97851 | 128 | 257 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97851:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0039, 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_97851:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97851:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97851:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97851:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
__author__ = 'gpzim98'
from django import forms
from models import Imovel, ContratoLocacao
from django.forms import ModelForm
from imoveis.models import ContratoAdministrativo, LaudoVistoria
class ImovelForm(forms.ModelForm):
descricao = forms.CharField(widget=forms.Textarea)
class Meta:
model = Imov... | ajibawa-2023/Python-Code-Large/train/row_97852 | 21 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97852:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0333, 0.0333, 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_97852:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97852:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97852:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97852:ClassDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from django.test import TestCase
# Create your tests here.
| ajibawa-2023/Python-Code-Large/train/row_97853 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97853:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [] |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'imoveis.views',
url(r'^$', 'home', name='app_imoveis_home'),
url(r'^adiciona$', 'adiciona', name='app_imoveis_add'),
url(r'^filtrar/$', 'filtrar', name='app_imoveis_filtrar'),
url(r'^detalhe/(?P<id>\d+)/$', 'detalhe', name='app_im... | ajibawa-2023/Python-Code-Large/train/row_97854 | 2 | 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_97854:ImportFrom_L1_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names":... | [] |
# encoding: utf-8
from django.shortcuts import render, get_object_or_404, redirect
from imoveis.models import Imovel, RescisaoContrato
from enderecos.forms import EnderecoForm
from forms import ImovelForm, ContratoLocacaoForm,\
ContratoAdministrativoForm, LaudoVistoriaForm
from funcionarios.models import Funcionari... | ajibawa-2023/Python-Code-Large/train/row_97855 | 309 | 524 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97855:ImportFrom_L2_C0", "label": "from django.shortcuts import render, get_object_or_404, redirect", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0019, 0, 0.66, 0.0, 852, 0, 3, 0, 0, 852, 0, 0], "semantic": {"name": "django.sh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97855:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97855:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97855:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97855:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.contrib import admin
from imoveis.models import Imovel, ContratoLocacao,\
ContratoAdministrativo, RescisaoContrato
# Register your models here.
admin.site.register(Imovel)
admin.site.register(ContratoLocacao)
admin.site.register(ContratoAdministrativo)
admin.site.register(RescisaoContrato)
| ajibawa-2023/Python-Code-Large/train/row_97856 | 6 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97856:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [] |
# encoding:utf8
from django.db import models
from django.contrib.auth.models import User
from financeiro.models.conta_caixa import ContaCaixa
class ParametrosGerais(models.Model):
taxa_juros = models.DecimalField(max_digits=4, decimal_places=2)
multa = models.DecimalField(max_digits=5, decimal_places=2, defau... | ajibawa-2023/Python-Code-Large/train/row_97857 | 14 | 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_97857:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0476, 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_97857:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97857:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97857:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97857:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from django import forms
from models import ParametrosGerais
class FormParametrosGerais(forms.ModelForm):
class Meta:
model = ParametrosGerais
| ajibawa-2023/Python-Code-Large/train/row_97858 | 5 | 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_97858:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97858:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97858:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97858:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97858:Assign_L7_C8"}] |
from django.test import TestCase
# Create your tests here.
| ajibawa-2023/Python-Code-Large/train/row_97859 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97859:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [] |
# encoding:utf-8
from django.conf.urls import patterns, url
urlpatterns = patterns(
'parametros.views',
url(r'^$', 'home', name='app_parametros_home'),
url(r'^editar/(?P<id>\d+)/$', 'editar', name='app_parametros_editar'),
url(r'^salvar/(?P<id>\d+)/$', 'salvar', name='app_parametros_salvar'),
)
| ajibawa-2023/Python-Code-Large/train/row_97860 | 2 | 9 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97860:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.1111, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names":... | [] |
# encoding:utf8
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from forms import FormParametrosGerais
from models import ParametrosGerais
# Create your views here.
template_parametros = 'parametros/home.html'
@login_required
def home2(request):
dados = {}
if req... | ajibawa-2023/Python-Code-Large/train/row_97861 | 59 | 76 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97861:ImportFrom_L2_C0", "label": "from django.shortcuts import render", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0132, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97861:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97861:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97861:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97861:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
from django.contrib import admin
from models import ParametrosGerais
# Register your models here.
admin.site.register(ParametrosGerais)
| ajibawa-2023/Python-Code-Large/train/row_97862 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97862:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_names... | [] |
# coding:utf8
from datetime import *
from dateutil.relativedelta import *
import calendar
today = date.today()
def month_between(d1, d2):
dif = 0
d1 = datetime.strptime(d1.__str__(), "%Y-%m-%d")
d2 = datetime.strptime(d2.__str__(), "%Y-%m-%d")
if d2.year > d1.year:
dif = (d2.year - d1.year) ... | ajibawa-2023/Python-Code-Large/train/row_97863 | 24 | 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_97863:ImportFrom_L2_C0", "label": "from datetime import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0222, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["*"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97863:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97863:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97863:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97863:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code... |
# encoding:utf-8
from django.db import models
from enderecos.models import Endereco
class Empresa(models.Model):
nome = models.CharField(
max_length=150, null=False,
blank=False, verbose_name=u"Nome da Empresa")
cnpj = models.CharField(
max_length=150, null=False, blank=False,
... | ajibawa-2023/Python-Code-Large/train/row_97864 | 12 | 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_97864:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97864:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97864:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97864:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97864:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from django.test import TestCase
# Create your tests here.
| ajibawa-2023/Python-Code-Large/train/row_97865 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97865:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [] |
from django.shortcuts import render
# Create your views here.
| ajibawa-2023/Python-Code-Large/train/row_97866 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97866:ImportFrom_L1_C0", "label": "from django.shortcuts import render", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_names": [], "i... | [] |
from django.contrib import admin
from models import Empresa
# Register your models here.
admin.site.register(Empresa)
| ajibawa-2023/Python-Code-Large/train/row_97867 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97867:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_names... | [] |
from alfredo_imoveis.enderecos import tests
__all__ = ['tests']
| ajibawa-2023/Python-Code-Large/train/row_97868 | 2 | 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_97868:ImportFrom_L1_C0", "label": "from alfredo_imoveis.enderecos import tests", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 812, 0, 1, 0, 0, 812, 0, 0], "semantic": {"name": "alfredo_imoveis.enderecos", "arg_nam... | [] |
# -*- coding: utf-8 -*-
# Autor: Fabiano Weimar dos Santos (xiru)
# Correcao em 20080407: Gustavo Henrique Cervi (100:"cento") => (1:"cento')
# Correção em 20100311: Luiz Fernando B. Vital adicionado {0:""} ao ext[0], pois dava KeyError: 0 em números como 200, 1200, 300, etc.
# Alteração em 20120123: Marcelo Araújo Po... | ajibawa-2023/Python-Code-Large/train/row_97869 | 32 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97869:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 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_97869:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97869:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97869:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97869:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# encoding:utf-8
from django.db import models
from enderecos.models import Endereco, Cidade
from empresas.models import Empresa
TIPO_CLIENTES = (
('L', 'LOCADOR'),
('T', 'LOCATARIO'),
('F', 'FIADOR'),
('C', 'CONJUGE'),
)
TIPO_PESSOA = (
('F', u'FÍSICA'),
('J', u'JURÍDICA'),
)
ESTATO_CIVIL = (... | ajibawa-2023/Python-Code-Large/train/row_97870 | 42 | 74 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97870:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.0135, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97870:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97870:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97870:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97870:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from django import forms
from models import Cliente
class ClienteForm(forms.ModelForm):
class Meta:
model = Cliente
exclude = ['endereco', 'endereco_comercial']
read_only = ['data_cadastro']
class ClienteFormVisualizar(forms.ModelForm):
class Meta:
model = Cliente
exc... | ajibawa-2023/Python-Code-Large/train/row_97871 | 12 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97871:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97871:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97871:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97871:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97871:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django.test import TestCase
from models import Cliente
from datetime import date
class ClienteTestCase(TestCase):
def setUp(self):
Cliente.objects.create(
nome="lion", naturalidade_id=1, endereco_id=1,
nome_pai='Pai teste', nome_mae='Mae teste', telefone_fixo='65468',
... | ajibawa-2023/Python-Code-Large/train/row_97872 | 10 | 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_97872:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97872:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97872:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97872:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97872:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'clientes.views',
url(r'^$', 'home', name='app_clientes_home'),
url(r'^novo$', 'novo', name='app_clientes_novo'),
url(r'^novo_locador$', 'novo_locador', name='app_clientes_novo_locador'),
url(r'^novo_locatario$', 'novo_locatario',
... | ajibawa-2023/Python-Code-Large/train/row_97873 | 2 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97873:ImportFrom_L1_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names": [... | [] |
# encoding: utf8
from django.shortcuts import render, get_object_or_404
from models import Cliente
from forms import ClienteForm
from enderecos.forms import EnderecoForm
from datetime import datetime, date
from imoveis.models import Imovel
from funcionarios.models import Funcionario
from alfredo_imoveis.views import bu... | ajibawa-2023/Python-Code-Large/train/row_97874 | 160 | 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_97874:ImportFrom_L2_C0", "label": "from django.shortcuts import render, get_object_or_404", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0041, 0, 0.66, 0.0, 852, 0, 2, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97874:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97874:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97874:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97874:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.contrib import admin
from models import Cliente
# Register your models here.
admin.site.register(Cliente)
| ajibawa-2023/Python-Code-Large/train/row_97875 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97875:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_nam... | [] |
# encoding:utf:8
__author__ = 'gpzim98'
from django import forms
from financeiro.models.titulo import Titulo
#Read only somente após editar uma vez MUITO BOM
def _get_cleaner(form, field):
def clean_field():
return getattr(form.instance, field, None)
return clean_field
class ROFormMixin(forms.BaseFo... | ajibawa-2023/Python-Code-Large/train/row_97876 | 20 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97876:Assign_L2_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0556, 0.0278, 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_97876:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97876:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97876:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97876:Return_L10_C8"}, {"f": "ajibawa-2023/Python-... |
from financeiro.forms.conta_caixa import ContaCaixaForm
from financeiro.forms.titulo import TituloForm
__all__ = ['ContaCaixaForm', 'TituloForm']
| ajibawa-2023/Python-Code-Large/train/row_97877 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97877:ImportFrom_L1_C0", "label": "from financeiro.forms.conta_caixa import ContaCaixaForm", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "financeiro.forms.conta... | [] |
__author__ = 'gpzim98'
from django import forms
from financeiro.models.conta_caixa import ContaCaixa
class ContaCaixaForm(forms.ModelForm):
class Meta:
model = ContaCaixa
| ajibawa-2023/Python-Code-Large/train/row_97878 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97878:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1, 0.1, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97878:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97878:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97878:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97878:Assign_L7_C8"}] |
# encoding:utf-8
from django.conf.urls import patterns, url
urlpatterns = patterns(
'financeiro.views.caixa',
url(r'^$', 'home', name='app_financeiro_caixa'),
url(r'^filtra_titulos/$', 'filtra_titulos',
name='app_financeiro_caixa_filtra_titulos'),
)
| ajibawa-2023/Python-Code-Large/train/row_97879 | 2 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97879:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names": [], "... | [] |
# encoding:utf-8
from django.conf.urls import patterns, url
urlpatterns = patterns(
'financeiro.views.titulo',
url(r'^$', 'home', name='app_financeiro_titulo_home'),
url(r'^detalhe/(?P<id>\d+)/$', 'detalhe',
name='app_financeiro_titulo_detalhe'),
url(r'^editar/(?P<id>\d+)/$', 'editar',
... | ajibawa-2023/Python-Code-Large/train/row_97880 | 2 | 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_97880:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.027, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names": ... | [] |
from financeiro.urls.conta_caixa import *
__all__ = ['*'] | ajibawa-2023/Python-Code-Large/train/row_97881 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97881:ImportFrom_L1_C0", "label": "from financeiro.urls.conta_caixa import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "financeiro.urls.conta_caixa", "a... | [] |
# encoding:utf-8
from django.conf.urls import patterns, url
urlpatterns = patterns(
'financeiro.views.conta_caixa',
url(r'^$', 'home', name='app_financeiro_conta_caixa_home'),
url(r'^detalhe/(?P<id>\d+)/$',
'detalhe', name='app_financeiro_conta_caixa_detalhe'),
url(r'^editar/(?P<id>\d+)/$', 'e... | ajibawa-2023/Python-Code-Large/train/row_97882 | 2 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97882:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0556, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names":... | [] |
# encoding:utf-8
from django.conf.urls import patterns, include, url
urlpatterns = patterns('financeiro.views.views_principal',
url(r'^$', 'home', name='app_financeiro_home'),
url(r'^conta_caixa/', include('financeiro.urls.conta_caixa')),
url(r'^titulos/', include('financeiro.urls.titulo')),
url(r'^cai... | ajibawa-2023/Python-Code-Large/train/row_97883 | 2 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97883:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, include, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 528, 0, 3, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_name... | [] |
from django.shortcuts import render
template_home = 'financeiro/home.html'
# Create your views here.
def home(request):
dados = {}
return render(request, template_home, dados)
| ajibawa-2023/Python-Code-Large/train/row_97884 | 5 | 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_97884:ImportFrom_L1_C0", "label": "from django.shortcuts import render", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97884:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97884:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97884:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97884:Return_L8_C4"}] |
# encoding: utf8
from django.shortcuts import render
from financeiro.models.titulo import Titulo, ContaCaixa
from datetime import datetime, date
from django.db.models import Sum
today = date.today()
template_home = 'financeiro/caixa/home.html'
template_relatorio = 'financeiro/caixa/relatorio.html'
def contabiliza_t... | ajibawa-2023/Python-Code-Large/train/row_97885 | 44 | 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_97885:ImportFrom_L2_C0", "label": "from django.shortcuts import render", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.029, 0.0145, 0, 0.66, 0.0, 852, 0, 1, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97885:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97885:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97885:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97885:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Co... |
# encoding: utf8
__author__ = 'gpzim98'
from django.shortcuts import render, get_object_or_404
from financeiro.models.titulo import Titulo, Recibo
from financeiro.models.conta_caixa import ContaCaixa
from funcionarios.models import Funcionario
from financeiro.forms.titulo import TituloForm
from parametros.models import... | ajibawa-2023/Python-Code-Large/train/row_97886 | 173 | 251 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97886:Assign_L2_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.008, 0.004, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97886:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97886:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97886:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97886:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Co... |
from financeiro.views import *
__all__ = ['*'] | ajibawa-2023/Python-Code-Large/train/row_97887 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97887:ImportFrom_L1_C0", "label": "from financeiro.views import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 331, 0, 1, 0, 0, 331, 0, 0], "semantic": {"name": "financeiro.views", "arg_names": [], "import... | [] |
# encoding: utf8
from django.shortcuts import render, get_object_or_404
from financeiro.models.conta_caixa import ContaCaixa
from funcionarios.models import Funcionario
from financeiro.forms.conta_caixa import ContaCaixaForm
from datetime import date
today = date.today()
template_home = 'financeiro/conta_caixa/home.h... | ajibawa-2023/Python-Code-Large/train/row_97888 | 63 | 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_97888:ImportFrom_L2_C0", "label": "from django.shortcuts import render, get_object_or_404", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0106, 0, 0.66, 0.0, 852, 0, 2, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97888:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97888:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97888:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97888:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.test import TestCase
# Create your tests here.
| ajibawa-2023/Python-Code-Large/train/row_97889 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97889:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [] |
from django.contrib import admin
from financeiro.models.titulo import Titulo, Recibo
# Register your models here.
class TituloAdmin(admin.ModelAdmin):
readonly_fields = ['usuario_cadastrou']
def save_model(self,request, obj, form, change):
obj.usuario_cadastrou = request.user
obj.save()
admin.... | ajibawa-2023/Python-Code-Large/train/row_97890 | 9 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97890:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97890:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97890:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97890:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97890:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from financeiro.admin.conta_caixa import ContaCaixaAdmin
from financeiro.admin.titulo import Titulo
__all__ = ['ContaCaixaAdmin', 'Titulo']
| ajibawa-2023/Python-Code-Large/train/row_97891 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97891:ImportFrom_L1_C0", "label": "from financeiro.admin.conta_caixa import ContaCaixaAdmin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 195, 0, 1, 0, 0, 195, 0, 0], "semantic": {"name": "financeiro.admin.cont... | [] |
from django.contrib import admin
from financeiro.models.conta_caixa import ContaCaixa
# Register your models here.
class ContaCaixaAdmin(admin.ModelAdmin):
pass
admin.site.register(ContaCaixa, ContaCaixaAdmin)
| ajibawa-2023/Python-Code-Large/train/row_97892 | 4 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97892:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [] |
n1 = input('Digite um numero')
n2 = input('Digite outro numero')
print(int(n1) + int(n2))
| ajibawa-2023/Python-Code-Large/train/row_97893 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97893:Assign_L1_C0", "label": "n1 = input()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 884, 3, 1, 0, 0, 930, 10, 1], "semantic": {"name": "n1", "arg_names": [], "import_names": [], "rhs_call_name... | [] |
# encoding: utf-8
__author__ = 'gpzim98'
from django.db import models
from parametros.models import ParametrosGerais
from empresas.models import Empresa
from financeiro.models.conta_caixa import ContaCaixa
from django.contrib.auth.admin import User
from clientes.models import Cliente
from imoveis.models import Contrat... | ajibawa-2023/Python-Code-Large/train/row_97894 | 140 | 252 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97894:Assign_L2_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0079, 0.004, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97894:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97894:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97894:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97894:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
from financeiro.models.conta_caixa import ContaCaixa
from financeiro.models.titulo import Titulo, Recibo
__all__ = ['ContaCaixa', 'Titulo', 'Recibo'] | ajibawa-2023/Python-Code-Large/train/row_97895 | 3 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97895:ImportFrom_L1_C0", "label": "from financeiro.models.conta_caixa import ContaCaixa", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "financeiro.models.conta_cai... | [] |
#encoding: utf-8
__author__ = 'gpzim98'
from django.db import models
from empresas.models import Empresa
class ContaCaixa(models.Model):
descricao = models.CharField(max_length=500, null=False, blank=False)
conta_caixa_superior = models.ForeignKey('self', null=True, blank=True)
empresa = models.ForeignKey... | ajibawa-2023/Python-Code-Large/train/row_97896 | 12 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97896:Assign_L2_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.1176, 0.0588, 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_97896:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97896:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97896:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97896:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# encoding: utf8
from django.db import models
from django.contrib.auth.admin import User
from enderecos.models import Endereco
from empresas.models import Empresa
# Create your models here.
class Funcionario(models.Model):
nome = models.CharField('Nome do funcionário', max_length=100)
rg = models.CharField(ve... | ajibawa-2023/Python-Code-Large/train/row_97897 | 21 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97897:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.037, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["m... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97897:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97897:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97897:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97897:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
__author__ = 'gpzim98'
from django import forms
from models import Funcionario
class FuncionarioForm(forms.ModelForm):
class Meta:
model = Funcionario
exclude = ['endereco',]
| ajibawa-2023/Python-Code-Large/train/row_97898 | 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_97898:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.125, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97898:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97898:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97898:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97898:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django.test import TestCase
# Create your tests here.
| ajibawa-2023/Python-Code-Large/train/row_97899 | 1 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97899:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [] |
# encoding:utf-8
from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'funcionarios.views',
url(r'^$', 'home', name='app_funcionarios_home'),
url(r'^funcionario_adiciona/$', 'adiciona', name='app_funcionario_add'),
url(r'^delete(?P<id... | ajibawa-2023/Python-Code-Large/train/row_97900 | 4 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97900:ImportFrom_L2_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0625, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names": ... | [] |
# encoding:utf8
from django.shortcuts import render, get_object_or_404
from models import Funcionario
from forms import FuncionarioForm
from enderecos.forms import EnderecoForm
template_home = 'funcionarios/home.html'
template_add = 'funcionarios/funcionario_add.html'
template_detalhe = 'funcionarios/funcionario_detal... | ajibawa-2023/Python-Code-Large/train/row_97901 | 72 | 99 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97901:ImportFrom_L2_C0", "label": "from django.shortcuts import render, get_object_or_404", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0101, 0, 0.66, 0.0, 852, 0, 2, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97901:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97901:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97901:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97901:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.contrib import admin
from models import Funcionario
# Register your models here.
admin.site.register(Funcionario) | ajibawa-2023/Python-Code-Large/train/row_97902 | 3 | 5 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97902:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_names... | [] |
# encoding:utf-8
from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
class Cidade(models.Model):
nome = models.CharField(
max_length=150, null=False, blank=False, verbose_name='Cidade')
uf = models.CharField(max_length=2, null=False, blank=False)
pa... | ajibawa-2023/Python-Code-Large/train/row_97903 | 38 | 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_97903:ImportFrom_L2_C0", "label": "from django.db import models", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0308, 0.0154, 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_97903:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97903:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97903:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97903:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
__author__ = 'gpzim98'
from django import forms
from models import Endereco, Bairro, Cidade
class EnderecoForm(forms.ModelForm):
class Meta:
model = Endereco
class BairroForm(forms.ModelForm):
class Meta:
model = Bairro
fields = ['nome', 'cidade']
readonly = ('codigo',)
cla... | ajibawa-2023/Python-Code-Large/train/row_97904 | 14 | 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_97904:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.05, 0.05, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97904:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97904:ClassDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97904:ClassDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97904:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django.test import TestCase
from models import Cidade
# Create your tests here.
class CidadeTestCase(TestCase):
def setUp(self):
Cidade.objects.create(nome="Buritizeiro")
def test_animals_can_speak(self):
"""Cliente that can speak are correctly identified"""
cidade = Cidade.objec... | ajibawa-2023/Python-Code-Large/train/row_97905 | 9 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97905:ImportFrom_L1_C0", "label": "from django.test import TestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97905:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97905:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97905:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97905:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
from django.conf.urls import patterns, url
from enderecos.views import CidadeList, CidadeCreate,\
CidadeUpdate, CidadeDelete, BairroDelete
urlpatterns = patterns(
'enderecos.views',
url(r'^bairro_home/$',
'bairro_home', name='app_enderecos_bairro_home'),
url(r'^bairro_detalhe/(?P<id>\d+)/$',
... | ajibawa-2023/Python-Code-Large/train/row_97906 | 3 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97906:ImportFrom_L1_C0", "label": "from django.conf.urls import patterns, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 528, 0, 2, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "arg_names":... | [] |
from enderecos.tests import *
__all__ = ['*']
| ajibawa-2023/Python-Code-Large/train/row_97907 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97907:ImportFrom_L1_C0", "label": "from enderecos.tests import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 946, 0, 1, 0, 0, 946, 0, 0], "semantic": {"name": "enderecos.tests", "arg_names": [], "import_n... | [] |
# encoding: utf-8
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from django.contrib import messages
from alfredo_imoveis.views import busca_config... | ajibawa-2023/Python-Code-Large/train/row_97908 | 89 | 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_97908:ImportFrom_L2_C0", "label": "from django.shortcuts import render, get_object_or_404", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0155, 0.0078, 0, 0.66, 0.0, 852, 0, 2, 0, 0, 852, 0, 0], "semantic": {"name": "django.shortcuts", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97908:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97908:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97908:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97908:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co... |
from django.contrib import admin
from models import Endereco, Bairro, Cidade
admin.site.register(Cidade)
admin.site.register(Endereco)
admin.site.register(Bairro)
| ajibawa-2023/Python-Code-Large/train/row_97909 | 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_97909:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [] |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "alfredo_imoveis.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ajibawa-2023/Python-Code-Large/train/row_97910 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97910:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "ann... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97910:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97910:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97910:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97910:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/usr/bin/env python
import codecs
import re
import jinja2
import markdown
def process_slides():
with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
md = codecs.open('slides.md', encoding='utf8').read()
md_slides = md.split('\n---\n')
print 'Compiled %s slides.' % len(m... | ajibawa-2023/Python-Code-Large/train/row_97911 | 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_97911:Import_L3_C0", "label": "codecs import codecs", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0175, 0, 0.66, 0.0, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97911:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97911:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97911:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97911:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding:utf-8 -*-
import numpy as np
import time
#==================================================#
# Question 1 : #
#==================================================#
def householder_U_factor(X, Y):
""" Retourne le facteur U de la matrice de householder de X vers Y,... | ajibawa-2023/Python-Code-Large/train/row_97912 | 36 | 73 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97912:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0411, 0.0137, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97912:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97912:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97912:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97912:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as mp
import partie1 as p1
import random
#==================================================#
# Génération aléatoire de matrices bidiagonales : #
#==================================================#
def generate_bidiagonal_matrix(N):
"""Construi... | ajibawa-2023/Python-Code-Large/train/row_97913 | 107 | 152 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97913:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0197, 0.0066, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97913:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97913:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97913:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97913:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code... |
# Partie 2
import numpy as np
import partie1 as p1
def bidiagonalisation (A):
"""Retourne la factorisation QR de A en utilisant la methode de Housholder"""
n = A.shape[0]
Qleft = np.eye(n, n)
Qright = np.eye(n, n)
BD = A
for i in np.arange(0,n):
Yv = np.zeros([n, 1])#Vecteur image
... | ajibawa-2023/Python-Code-Large/train/row_97914 | 29 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97914:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97914:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97914:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97914:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97914:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as mp
import partie1 as p1
import partie3 as p3
import random
#-----------------------------------------------------------------------------#
# Test de la décomposition QR pour une matrice bidiagonale inférieur: #
#---------------------------... | ajibawa-2023/Python-Code-Large/train/row_97915 | 79 | 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_97915:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0087, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97915:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97915:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97915:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97915:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding:utf-8 -*-
#Partie 4 - Tests
import numpy as np
import matplotlib.pyplot as mp
import partie2 as p2
import partie3 as p3
import partie4 as p4
import Image
import time
#--------------------------------------#
# Test de la conservation de l'image : #
#--------------------------------------#
RGB = p4.ima... | ajibawa-2023/Python-Code-Large/train/row_97916 | 25 | 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_97916:Import_L6_C0", "label": "numpy import np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0175, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [] |
# -*- coding:utf-8 -*-
#Partie 4
import numpy as np
import matplotlib.pyplot as mp
import partie2 as p2
import partie3 as p3
import Image
import time
#--------------------------------------------#
# Traitements de l'image : #
#--------------------------------------------#
def image_get_RGB(img_na... | ajibawa-2023/Python-Code-Large/train/row_97917 | 82 | 146 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97917:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0342, 0.0068, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97917:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97917:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97917:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97917:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding:utf-8 -*-
import numpy as np
import time
import partie1 as p1
#-------------------------------#
# Tests question 1 : #
#-------------------------------#
print "\n--------------- Question 1 ---------------"
print "\nTest sur l'exemple du sujet, calcul de la matrice Householder :\n"
X = np.ma... | ajibawa-2023/Python-Code-Large/train/row_97918 | 52 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97918:Import_L2_C0", "label": "numpy import np", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0102, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [] |
# -*- coding:utf-8 -*-
import partie2 as p2
import numpy as np
print "#---Tests de la partie 2---#"
print
print "#---Test avec une matrice predefinie---#"
print
A = np.matrix([[1., 2., 3.], [4., 5., 6.], [7., 8., 9.]])
(Qleft, BD, Qright) = p2.bidiagonalisation(A)
print "A = "
print A
print
print "Qleft = "
print Q... | ajibawa-2023/Python-Code-Large/train/row_97919 | 2 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97919:Import_L1_C0", "label": "partie2 import p2", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "partie2", "arg_names": [], "import_names": ["p2"], "rhs_call_n... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.