code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97597 | 125 | 230 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97597:ImportFrom_L4_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0174, 0.0043, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97597:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97597:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97597:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97597:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | ajibawa-2023/Python-Code-Large/train/row_97598 | 79 | 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_97598:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0833, 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_97598:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97598:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97598:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97598:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: cp1252 -*-
from HeuristicaDeLaMediana import *
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodosMayorGrado import *
from HeuristicaInsercionNodosMenorGrado import *
from HeuristicaInsercionNodosPrimero import *
from HeuristicaInsercionNodosRandom import *
#import psyco
#psyco.ful... | ajibawa-2023/Python-Code-Large/train/row_97599 | 84 | 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_97599:ImportFrom_L2_C0", "label": "from HeuristicaDeLaMediana import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0101, 0, 0.66, 0.0, 580, 0, 1, 0, 0, 580, 0, 0], "semantic": {"name": "HeuristicaDeLaMediana", "arg_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97599:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97599:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97599:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97599:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Co... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
from SolucionBasicaPoda import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaMediana2 (ResolvedorConstructivo):
def calcularMediana(self,each,indicesV2,e... | ajibawa-2023/Python-Code-Large/train/row_97601 | 132 | 192 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97601:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97601:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97601:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97601:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97601:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaInsercionEjes (ResolvedorConstructivo):
# establece el rango en el cual se puede insertar un nodo
#... | ajibawa-2023/Python-Code-Large/train/row_97602 | 100 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97602:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97602:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97602:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97602:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97602:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97603 | 48 | 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_97603:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0132, 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_97603:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97603:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97603:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97603:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
class HeuristicaInsercionNodosPrimero(ResolvedorConstructivo):
def resolv... | ajibawa-2023/Python-Code-Large/train/row_97604 | 69 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97604:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0215, 0.0108, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97604:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97604:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97604:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97604:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from GrafoBipartito import GrafoBipartito, Dibujo
from Dibujador import DibujadorGrafoBipartito
from sets import Set
# Parsea un archivo .in con una sola instancia y produce
# el dibujo asociado.
class ParserDibujoIn:
def __init__(self, archivo="Tp3.in"):
f = open(archivo, 'r')
nf1 = int(... | ajibawa-2023/Python-Code-Large/train/row_97605 | 72 | 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_97605:ImportFrom_L1_C0", "label": "from GrafoBipartito import GrafoBipartito, Dibujo", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97605:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97605:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97605:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97605:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
import random
from HeuristicaInsercionEjes import *
import psyco
from psyco import *
class BusquedaLocalReInsercion(BusquedaLocal):
def _rango(self,x,pi,marcados):
if x not in marcados:
return range(len(pi)+1)
else:
posxMarcado = marcados.index(x)
... | ajibawa-2023/Python-Code-Large/train/row_97606 | 107 | 121 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97606:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97606:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97606:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97606:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97606:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | ajibawa-2023/Python-Code-Large/train/row_97607 | 63 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97607:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0089, 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_97607:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97607:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97607:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97607:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
import random
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodosMayorGrado import *
import psyco
psyco.full()
class BusquedaLocalIntercambioGreedy(BusquedaLocal):
def swapValido(self,i,j,l,marcados):
if i in marcados:
if j in marcados:
return Fal... | ajibawa-2023/Python-Code-Large/train/row_97609 | 96 | 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_97609:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0082, 0.0082, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97609:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97609:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97609:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97609:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97610 | 58 | 101 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97610:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0099, 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_97610:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97610:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97610:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97610:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
from GrafoBipartito import *
from HeuristicaInsercionEjes import HeuristicaInsercionEjes
from BusquedaLocalReInsercion import *
from BusquedaLocalMix import *
from HeuristicaDeLaMediana import HeuristicaDeLaMediana
from BusquedaLocalMediana import BusquedaLocalMediana
from HeuristicaInsercionNodos import *
from ... | ajibawa-2023/Python-Code-Large/train/row_97611 | 49 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97611:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97611:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97611:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97611:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97611:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | ajibawa-2023/Python-Code-Large/train/row_97612 | 85 | 128 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97612:ImportFrom_L4_C0", "label": "from sets import Set", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0078, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "sets", "arg_names": [], "import_names": ["Set"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97612:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97612:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97612:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97612:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | ajibawa-2023/Python-Code-Large/train/row_97613 | 55 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97613:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0111, 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_97613:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97613:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97613:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97613:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97616 | 58 | 101 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97616:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0099, 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_97616:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97616:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97616:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97616:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | ajibawa-2023/Python-Code-Large/train/row_97617 | 63 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97617:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0089, 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_97617:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97617:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97617:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97617:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | ajibawa-2023/Python-Code-Large/train/row_97618 | 77 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97618:ImportFrom_L4_C0", "label": "from GrafoBipartito import Dibujo, ResolvedorConstructivo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97618:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97618:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97618:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97618:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97619 | 125 | 230 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97619:ImportFrom_L4_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0174, 0.0043, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97619:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97619:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97619:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97619:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | ajibawa-2023/Python-Code-Large/train/row_97620 | 186 | 368 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97620:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0027, 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_97620:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97620:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97620:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97620:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | ajibawa-2023/Python-Code-Large/train/row_97621 | 147 | 310 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97621:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0129, 0.0032, 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_97621:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97621:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97621:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97621:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97624 | 48 | 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_97624:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0132, 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_97624:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97624:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97624:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97624:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | ajibawa-2023/Python-Code-Large/train/row_97625 | 79 | 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_97625:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0833, 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_97625:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97625:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97625:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97625:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
#! /usr/bin/env python2.4
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# See profile.doc for more information
"""Class for profiling Python code."""
# Copyright 1994, by InfoSeek Corporation, all righ... | ajibawa-2023/Python-Code-Large/train/row_97626 | 288 | 612 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97626:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0163, 0.0016, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97626:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97626:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97626:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97626:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code... |
#! /usr/bin/env python2.4
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# See profile.doc for more information
"""Class for profiling Python code."""
# Copyright 1994, by InfoSeek Corporation, all righ... | ajibawa-2023/Python-Code-Large/train/row_97628 | 288 | 612 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97628:Expr_L10_C0", "label": "expression", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0163, 0.0016, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97628:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97628:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97628:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97628:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
from SolucionBasicaPoda import *
from HeuristicaInsercionEjes import *
import random
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaDeLaMediana (ResolvedorCons... | ajibawa-2023/Python-Code-Large/train/row_97629 | 163 | 198 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97629:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97629:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97629:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97629:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97629:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | ajibawa-2023/Python-Code-Large/train/row_97630 | 55 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97630:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0111, 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_97630:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97630:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97630:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97630:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
from BusquedaLocalIntercambioGreedy import *
from BusquedaLocalReInsercion import *
from HeuristicaInsercionEjes import *
class BusquedaLocalMix(BusquedaLocal):
def hallarMinimoLocal(self,dibujo,marcados1,marcados2,losEjesDe):
crucesInicial = contadorDeCruces(dibujo.l1,dibujo.l2,losEjesDe)
c... | ajibawa-2023/Python-Code-Large/train/row_97631 | 40 | 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_97631:ImportFrom_L1_C0", "label": "from BusquedaLocalIntercambioGreedy import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0222, 0, 0.66, 0.0, 170, 0, 1, 0, 0, 170, 0, 0], "semantic": {"name": "BusquedaLocalIntercambioGreed... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97631:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97631:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97631:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97631:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | ajibawa-2023/Python-Code-Large/train/row_97633 | 77 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97633:ImportFrom_L4_C0", "label": "from GrafoBipartito import Dibujo, ResolvedorConstructivo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97633:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97633:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97633:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97633:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
import random
from HeuristicaDeLaMediana import *
import psyco
psyco.full()
class BusquedaLocalMediana(BusquedaLocal):
def calcularMediana(self,each,indicesi,losEjesDe):
med = []
for each1 in losEjesDe[each]:
med.append(indicesi[each1])
med.sort()
if med == []... | ajibawa-2023/Python-Code-Large/train/row_97634 | 138 | 155 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97634:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97634:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97634:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97634:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97634:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | ajibawa-2023/Python-Code-Large/train/row_97636 | 85 | 128 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97636:ImportFrom_L4_C0", "label": "from sets import Set", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0078, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "sets", "arg_names": [], "import_names": ["Set"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97636:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97636:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97636:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97636:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMenorGrado(Re... | ajibawa-2023/Python-Code-Large/train/row_97637 | 81 | 111 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97637:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.018, 0.009, 0, 0.66, 0.0, 16, 0, 3, 0, 0, 16, 0, 0], "semantic": {"name": "Graf... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97637:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97637:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97637:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97637:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaRemocion (ResolvedorConstructivo):
def contarCrucesAcumTree(p1,p2,ejes):
if len(p1) < len(p2):
... | ajibawa-2023/Python-Code-Large/train/row_97638 | 171 | 206 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97638:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97638:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97638:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97638:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97638:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | ajibawa-2023/Python-Code-Large/train/row_97639 | 147 | 310 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97639:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0129, 0.0032, 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_97639:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97639:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97639:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97639:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMayorGrado(R... | ajibawa-2023/Python-Code-Large/train/row_97640 | 80 | 109 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97640:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0092, 0, 0.66, 0.0, 16, 0, 3, 0, 0, 16, 0, 0], "semantic": {"name": "Gr... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97640:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97640:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97640:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97640:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
import random
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodos import *
from HeuristicaDeLaMediana import *
from SolucionSwapperTablaPoda import *
import psyco
from psyco import *
class Tp3:
def limpiarDibujo(self,d,losEjesDe):
g = d.g
marcados1 = d.l1
marcado... | ajibawa-2023/Python-Code-Large/train/row_97641 | 121 | 147 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97641:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97641:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97641:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97641:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97641:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | ajibawa-2023/Python-Code-Large/train/row_97642 | 186 | 368 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97642:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0027, 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_97642:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97642:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97642:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97642:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodosRandom(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97643 | 70 | 95 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97643:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0105, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97643:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97643:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97643:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97643:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97644 | 125 | 230 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97644:ImportFrom_L4_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0174, 0.0043, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97644:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97644:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97644:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97644:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
import random
moda=5
for i in range(1,1000):
x=[0]*i
y = random.sample( range(i), i/2+1)
for j in range(i):
if j in y:
x[j] = moda
else:
x[j] = random.randint(0,10)
print i
for each in range(i):
print x[each]," ",
print ""
print 0
| ajibawa-2023/Python-Code-Large/train/row_97645 | 14 | 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_97645:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97645:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97645:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97645:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97645:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import random
for n in range(1,30):
print "Caso"
print n," ",
print 200
x=[[0,0] for i in range(n)]
for i in range(n-1):
x[i][0] = 1
x[i][1] = 1
print x[i][0], " ", x[i][1]
print 200," ",200
print "Fin"
| ajibawa-2023/Python-Code-Large/train/row_97646 | 11 | 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_97646:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97646:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97646:Expr_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97646:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97646:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97646... |
for i in range(10000000):
print i+2
print 0
| ajibawa-2023/Python-Code-Large/train/row_97647 | 3 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97647:For_L1_C0", "label": "for i", "type": "for", "loc": [1, 2], "level": 0, "parent": null, "vector": [6, 0, 0.5, 0.6667, 0, 0.66, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "s... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97647:For_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97647:Expr_L2_C4"}] |
from math import ceil, sqrt
class FabricaPrimos:
def __init__(self):
self.fab = FabricaCandidatos()
self.primosHastaAhora = []
def _esPrimo(self, n):
s = sqrt(n)
for each in self.primosHastaAhora:
if each > s:
return True
if n % each == 0... | ajibawa-2023/Python-Code-Large/train/row_97648 | 87 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97648:ImportFrom_L1_C0", "label": "from math import ceil, sqrt", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0075, 0.0075, 0, 0.66, 0.0, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["ceil... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97648:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97648:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97648:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97648:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code... |
class Cosa:
def __init__(self, costo, valor):
self.costo = costo
self.valor = valor
def __repr__(self):
return "<Cosa de valor %s y peso %s>" % (self.valor, self.costo)
class Mochila:
def __init__(self, cosas, capacidad):
self.cosas = cosas
se... | ajibawa-2023/Python-Code-Large/train/row_97649 | 41 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97649:ClassDef_L1_C0", "label": "Cosa", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.0556, 0.0972, 0, 0.66, 0.0, 435, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "Cosa", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97649:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97649:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97649:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97649:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
#PROCEDURE KESIMO3(VAR A:VECTOR;PRIM,ULT,K:CARDINAL):INTEGER;
#VAR I,D:CARDINAL; PM:INTEGER; (* PSEUDO_MEDIANA *)
#BEGIN
#IF PRIM<ULT THEN
#PM:=CASIMEDIANA(A,PRIM,ULT);
#PIVOTE2(A,PM,PRIM,ULT,I,D);
#IF (PRIM+K-1)<I THEN RETURN KESIMO3(A,PRIM,I-1,K) END;
#IF D<=(PRIM+K-1) THEN RETURN KESIMO3(A,D,ULT,K-D+PRIM) END... | ajibawa-2023/Python-Code-Large/train/row_97650 | 68 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97650:FunctionDef_L16_C0", "label": "kesimo", "type": "function", "loc": [16, 28], "level": 0, "parent": null, "vector": [2, 0, 0.1438, 0.085, 0, 0.66, 0.0, 393, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "kesimo", "arg_names": ["a", "prim", "ult", "k"], "import_names":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97650:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97650:If_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97650:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_97650:Assign_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.
"""
import unittest
class UnionFindSet:
def __init__(self, n):
self.n = self.n
self.parent = [x for x in xrnage(n)]
self.rank = [0] * n
s... | ajibawa-2023/Python-Code-Large/train/row_97651 | 85 | 132 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97651:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0189, 0.0303, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97651:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97651:FunctionDef_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97651:FunctionDef_L9_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97651:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Cod... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for HuffmanCode.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of HuffmanCode.
"""
import unittest
from heapq import *
class HuffmanCodeNode:
def __init__(self, code, weight):
self.code = code
self.weight = weight
self.leftChi... | ajibawa-2023/Python-Code-Large/train/row_97652 | 48 | 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_97652:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0362, 0.058, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97652:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97652:FunctionDef_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97652:FunctionDef_L10_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97652:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-C... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.
"""
import unittest
"""
General Segment Tree for interval statistics.
"""
class SegmentTreeNode:
def __init__(self, begin, end):
self.begin = begin
... | ajibawa-2023/Python-Code-Large/train/row_97653 | 94 | 131 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97653:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0191, 0.0305, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97653:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97653:FunctionDef_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97653:FunctionDef_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97653:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for BST.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of BST.
"""
import unittest
"""
Binary search tree without using recursion
"""
class BST:
class Node:
def __init__(self, key, parent=None, left=None, right=None):
self.key =... | ajibawa-2023/Python-Code-Large/train/row_97654 | 134 | 190 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97654:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0132, 0.0211, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97654:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97654:ClassDef_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97654:ClassDef_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97654:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-C... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for DFS.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of DFS.
"""
import unittest
"""
A general back tracking search
"""
def backTracking(problem, candidate=None):
if candidate is None:
candidate = problem.getRoot()
if problem.acce... | ajibawa-2023/Python-Code-Large/train/row_97655 | 58 | 89 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97655:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0281, 0.0449, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97655:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97655:If_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97655:If_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97655:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for knapsack.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of knapsack.
"""
import unittest
"""
A dynamic programing to solve 0/1 knapsack problem
dp[itemIndex][capability] =
if itemIndex == n:
values[itemIndex] | 0 (capability > w... | ajibawa-2023/Python-Code-Large/train/row_97656 | 103 | 164 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97656:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0152, 0.0244, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97656:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97656:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97656:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97656:Assign_L22_C2"}, {"f": "ajibawa-2023/Python-Co... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for search.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of search.
"""
import unittest
from heapq import heappop, heappush
"""
Genernal Breath first search
"""
def BFS(startState, terminateState):
if startState == terminateState:
re... | ajibawa-2023/Python-Code-Large/train/row_97657 | 144 | 210 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97657:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0119, 0.019, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97657:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97657:If_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97657:If_L13_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97657:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
"""
Common function use in combinatics
"""
import unittest
import math
def P(n, k):
result = 1
for i in xrange(n - k + 1, n + 1):
result = result * i;
return result
def C(n, k):
if k < 0:
return 0
if k == 0:
return 1
result = 1
if k > n - k:
k = n - k
for i in xrange(n - k + 1, n + 1... | ajibawa-2023/Python-Code-Large/train/row_97658 | 41 | 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_97658:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.05, 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_97658:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97658:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97658:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97658:For_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for kth.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of kth.
"""
import unittest
def swap(array, x, y):
array[x], array[y] = array[y], array[x]
def partition(array, start, end):
I = start + 1
J = I
pivot = start
while I < end:
... | ajibawa-2023/Python-Code-Large/train/row_97659 | 37 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97659:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0472, 0.0755, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97659:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97659:Assign_L8_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97659:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97659:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code... |
# Kadane's algorithm consists
def max_subarray(A):
max_ending_here = max_so_far = 0
for x in A:
max_ending_here = max(0, max_ending_here + x)
max_so_far = max(max_so_far, max_ending_here)
return max_so_far
#
# A variation of the problem that does not allow zero-length
#subarrays to be returned in the ca... | ajibawa-2023/Python-Code-Large/train/row_97660 | 12 | 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_97660:FunctionDef_L3_C0", "label": "max_subarray", "type": "function", "loc": [3, 8], "level": 0, "parent": null, "vector": [2, 0, 0.2895, 0.3158, 0, 0.66, 0.0, 90, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "max_subarray", "arg_names": ["A"], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97660:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97660:Assign_L4_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97660:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97660:For_L5_C2"}, {"f": "ajibawa-2023/Python-Code-Larg... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for shortest_path.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of shortest_path.
"""
import unittest
from heapq import heappush, heappop
"""
Dijkstra algorithm using a binary heap
O(nlogn)
"""
def dijkstraShortestPath(array2D, source):
... | ajibawa-2023/Python-Code-Large/train/row_97661 | 56 | 88 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97661:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0284, 0.0455, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97661:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97661:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97661:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97661:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Co... |
"""
Common function use in graph
"""
import unittest
import math
"""
For sparse graph
"""
class Graph:
"""
Create a graph with n node [0, n)
"""
def __init__(self, n):
self.n = n
self.adjacents = [list() for x in xrange(n)]
"""
Insert a edit x->y
"""
def insert(self, x, y):
self.adjacents[... | ajibawa-2023/Python-Code-Large/train/row_97662 | 139 | 224 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97662:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0089, 0.0134, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97662:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97662:Expr_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97662:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97662:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for MST.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of MST.
"""
import unittest
import heapq
"""
For sparse graph
"""
class WeightGraph:
"""
Create a graph with n node [0, n)
"""
def __init__(self, n):
self.n = n
self.adj... | ajibawa-2023/Python-Code-Large/train/row_97663 | 100 | 160 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97663:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0156, 0.025, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97663:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97663:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97663:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97663:FunctionDef_L16_C2"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
from random import randint
a = raw_input("Cantidad de nodos :")
b = raw_input("cantidad de ramas :")
f = open("p1.in", "w")
f.write(str(a)+" ")
cantcepa = int(a)-1
f.write(str(cantcepa)+"\n")
"""
for m in range(0,int(a)):
izq = 2*m+1
der = 2*m+2
if izq<int(a):
f.write( str(m)+" "+str(i... | ajibawa-2023/Python-Code-Large/train/row_97664 | 16 | 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_97664:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0303, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97664:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97664:If_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97664:If_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_97664:For_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97664... |
#!/usr/bin/env python
from random import randint
a = raw_input("Cantidad de nodos :")
b = raw_input("cantidad de ramas :")
f = open("p1.in", "w")
f.write(str(a)+" ")
cantcepa = int(a)-1
f.write(str(cantcepa)+"\n")
"""
for m in range(0,int(a)):
izq = 2*m+1
der = 2*m+2
if izq<int(a):
f.write( str(m)+" "+str(i... | ajibawa-2023/Python-Code-Large/train/row_97665 | 16 | 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_97665:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0303, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97665:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97665:If_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97665:If_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_97665:For_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97665... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
fin2=open('time_err_n3.dat')
todo=fin.read().split('\n')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yer... | ajibawa-2023/Python-Code-Large/train/row_97666 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97666:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $cw$")
xlabel("Cantidad de Perso... | ajibawa-2023/Python-Code-Large/train/row_97667 | 15 | 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_97667:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
fin2=open('time_err_n3.dat')
todo=fin.read().split('\n')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yer... | ajibawa-2023/Python-Code-Large/train/row_97668 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97668:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $cw$")
xlabel("Cantidad de Personas")
ylabel("Cantidad de operaciones")
plot(xs,... | ajibawa-2023/Python-Code-Large/train/row_97669 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97669:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tamani... | ajibawa-2023/Python-Code-Large/train/row_97670 | 22 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97670:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97670:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97670:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97670:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97670:For_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw_n3"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tam... | ajibawa-2023/Python-Code-Large/train/row_97671 | 22 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97671:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97671:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97671:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97671:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97671:For_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin2=open('time_err_n3.dat')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo2 if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yerr2=[float(x.split()[2]) for x in todo2 if x]
title("Tiempo de ejecución de algoritmo cubico de $... | ajibawa-2023/Python-Code-Large/train/row_97672 | 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_97672:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin2=open('time_err_n3.dat')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo2 if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yerr2=[float(x.split()[2]) for x in todo2 if x]
title("Tiempo de ejecución de algoritmo cubico de $... | ajibawa-2023/Python-Code-Large/train/row_97673 | 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_97673:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tamani... | ajibawa-2023/Python-Code-Large/train/row_97674 | 22 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97674:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97674:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97674:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97674:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97674:For_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $cw$")
xlabel("Cantidad de Perso... | ajibawa-2023/Python-Code-Large/train/row_97675 | 15 | 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_97675:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $cw$")
xlabel("Cantidad de Personas")
ylabel("Cantidad de operaciones")
plot(xs,... | ajibawa-2023/Python-Code-Large/train/row_97676 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97676:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $matching$")
xlabel("Tamano de e... | ajibawa-2023/Python-Code-Large/train/row_97677 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97677:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $matching$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(... | ajibawa-2023/Python-Code-Large/train/row_97678 | 13 | 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_97678:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="matching"
tamanios_entrada=sorted(range(3,300)[::5])
def prueba(tamanio_entrada):
return str(tamanio_entrada)+' '+' '.j... | ajibawa-2023/Python-Code-Large/train/row_97679 | 19 | 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_97679:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97679:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97679:Return_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97679:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97679:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="matching"
tamanios_entrada=sorted(range(3,300)[::5])
def prueba(tamanio_entrada):
return str(tamanio_entrada)+' '+' '.j... | ajibawa-2023/Python-Code-Large/train/row_97680 | 19 | 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_97680:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97680:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97680:Return_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97680:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97680:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $matching$")
xlabel("Tamano de e... | ajibawa-2023/Python-Code-Large/train/row_97681 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97681:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $matching$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(... | ajibawa-2023/Python-Code-Large/train/row_97682 | 13 | 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_97682:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
from Tkinter import *
from random import *
from math import sqrt
import subprocess
def prueba(tamanio_entrada):
cant=int(random()*tamanio_entrada)
w=randint(3,int(2*sqrt(tamanio_entrada)))
h=tamanio_entrada/w
vs=[]
for v in range(cant):
orient=choice(['-','|'])
if orient=='|':
l=rand... | ajibawa-2023/Python-Code-Large/train/row_97683 | 59 | 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_97683:ImportFrom_L3_C0", "label": "from Tkinter import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0405, 0.0135, 0, 0.66, 0.0, 368, 0, 1, 0, 0, 368, 0, 0], "semantic": {"name": "Tkinter", "arg_names": [], "import_names": ["*"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97683:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97683:Assign_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97683:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97683:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $flood$")
xlabel("Tamano de entr... | ajibawa-2023/Python-Code-Large/train/row_97684 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97684:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $flood$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(xs,... | ajibawa-2023/Python-Code-Large/train/row_97685 | 13 | 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_97685:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed,choice
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="flood"
tamanios_entrada=sorted(range(100,5000)[::35])
def prueba(tamanio_entrada):
cant=int(random()*tamanio_en... | ajibawa-2023/Python-Code-Large/train/row_97686 | 41 | 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_97686:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97686:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97686:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97686:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97686:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed,choice
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="flood"
tamanios_entrada=sorted(range(100,5000)[::35])
def prueba(tamanio_entrada):
cant=int(random()*tamanio_en... | ajibawa-2023/Python-Code-Large/train/row_97687 | 41 | 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_97687:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97687:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97687:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97687:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97687:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $flood$")
xlabel("Tamano de entr... | ajibawa-2023/Python-Code-Large/train/row_97688 | 14 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97688:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
from Tkinter import *
from random import *
from math import sqrt
import subprocess
def prueba(tamanio_entrada):
cant=int(random()*tamanio_entrada)
w=randint(3,int(2*sqrt(tamanio_entrada)))
h=tamanio_entrada/w
vs=[]
for v in range(cant):
orient=choice(['-','|'])
if orient=='|':
l=rand... | ajibawa-2023/Python-Code-Large/train/row_97689 | 59 | 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_97689:ImportFrom_L3_C0", "label": "from Tkinter import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0405, 0.0135, 0, 0.66, 0.0, 368, 0, 1, 0, 0, 368, 0, 0], "semantic": {"name": "Tkinter", "arg_names": [], "import_names": ["*"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97689:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97689:Assign_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97689:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97689:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $flood$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(xs,... | ajibawa-2023/Python-Code-Large/train/row_97690 | 13 | 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_97690:ImportFrom_L3_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
def agPalindr(s):
n=len(s)
m=[[0 for x in range(n+1)] for y in range(n+1)]
for ini in range(2,n+1):
j,i=ini,0
while j<=n:
if s[i]==s[j-1]: m[i][j]=m[i+1][j-1]
else: m[i][j]=min(m[i][j-1],m[i+1][j])+1
j+=1
i+=1
print '\n'.join(map(lambda x:' '.join(map(str,x)),m))
return m[0][n]
f=open('palindromo.... | ajibawa-2023/Python-Code-Large/train/row_97691 | 14 | 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_97691:FunctionDef_L1_C0", "label": "agPalindr", "type": "function", "loc": [1, 12], "level": 0, "parent": null, "vector": [2, 0, 0.4062, 0.75, 0, 0.66, 0.0, 553, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "agPalindr", "arg_names": ["s"], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97691:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97691:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97691:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97691:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
def pr(h):
print "-",' '.join(map(str,h[0]))
print "-",' '.join(map(str,h[1]))
print "-",' '.join(map(str,h[2]))
print
def solve(h,s,d,n):
if n==1:
h[d].append(h[s].pop())
#print "move el ",h[d][len(h[d])-1]," de ",s+1," a ",d+1
pr(h)
else:
solve(h,s,3-s-d,n-1)
h[d].append(h[s].pop())
#print "move el... | ajibawa-2023/Python-Code-Large/train/row_97692 | 14 | 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_97692:FunctionDef_L1_C0", "label": "pr", "type": "function", "loc": [1, 14], "level": 0, "parent": null, "vector": [2, 0, 0.3947, 0.7368, 0, 0.66, 0.0, 37, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "pr", "arg_names": ["h"], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97692:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97692:Expr_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97692:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97692:Expr_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large... |
def mochila(C,k):
M=[True]+[False]*k
for i in range(len(C)):
for j in reversed(range(k+1)):
M[j]=M[j] or M[j-C[i]]
print ''.join([x and '#' or '_' for x in M])
if M[k]: return True
return M[k]
print mochila([1,2,3,4,5,6],7)
| ajibawa-2023/Python-Code-Large/train/row_97693 | 10 | 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_97693:FunctionDef_L1_C0", "label": "mochila", "type": "function", "loc": [1, 8], "level": 0, "parent": null, "vector": [2, 0, 0.45, 0.8, 0, 0.66, 0.0, 797, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "mochila", "arg_names": ["C", "k"], "import_names": [], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97693:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97693:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97693:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97693:For_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
def pasos(u,v):
n,m=len(u),len(v)
M1=range(m+1)
M2=[1]*(m+1)
for i in range(1,n+1):
M2[0]=i
for j in range(1,m+1):
M2[j]=min(M2[j-1]+1, M1[j]+1, M1[j-1]+(u[i-1]!=v[j-1] and 1 or 0))
M1=M2[:]
print ''.join([str(x) for x in M1])
return M1[m]
print pasos('abc','abx')
| ajibawa-2023/Python-Code-Large/train/row_97694 | 12 | 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_97694:FunctionDef_L1_C0", "label": "pasos", "type": "function", "loc": [1, 11], "level": 0, "parent": null, "vector": [2, 0, 0.4615, 0.8462, 0, 0.66, 0.0, 617, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "pasos", "arg_names": ["u", "v"], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97694:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97694:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97694:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97694:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
from random import random,randint
from math import sqrt
def dist(a,b):
return sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)
def sumx(C):
return reduce(lambda x,y:x+y,C,0)
def mind(C):
if len(C)==2: return dist(C[0],C[1])
elif len(C)<2: return float("Inf")
C.sort(key=lambda x:x[0])
r=C[len(C)/2][0]
d1=mind(C[:len(C)/2... | ajibawa-2023/Python-Code-Large/train/row_97695 | 23 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97695:ImportFrom_L1_C0", "label": "from random import random, randint", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97695:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97695:Return_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97695:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97695:Return_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('instance80_24/data.dat')
todo=fin.read().strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split()[0]) for x in todo if x]
constru=[int(x.split()[1]) for x in todo if x]
local=[int(x.split()[2]) for x in todo if x]
tabu=[int(x.sp... | ajibawa-2023/Python-Code-Large/train/row_97696 | 16 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97696:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0455, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/usr/bin/env python
from matplotlib.pyplot import *
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])
todo=data.strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split(... | ajibawa-2023/Python-Code-Large/train/row_97697 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97697:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /usr/bin/python
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| ajibawa-2023/Python-Code-Large/train/row_97698 | 2 | 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_97698:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/usr/bin/env python
from matplotlib.pyplot import *
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])
todo=data.strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split(... | ajibawa-2023/Python-Code-Large/train/row_97699 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97699:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /usr/bin/python
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| ajibawa-2023/Python-Code-Large/train/row_97700 | 2 | 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_97700:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.out"]
f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| ajibawa-2023/Python-Code-Large/train/row_97701 | 2 | 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_97701:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('data_big.dat')
tam=open('hard_big_tamanios')
todo=fin.read().strip().split('\n')
#xs=tam.read().split()
constru=[int(x.split()[0]) for x in todo if x]
local=[int(x.split()[1]) for x in todo if x]
xs=tabu=[int(x.split()[2]) for x in todo if x]
title("Comp... | ajibawa-2023/Python-Code-Large/train/row_97702 | 17 | 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_97702:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.out"]
f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| ajibawa-2023/Python-Code-Large/train/row_97703 | 2 | 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_97703:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('data_big.dat')
tam=open('hard_big_tamanios')
todo=fin.read().strip().split('\n')
#xs=tam.read().split()
constru=[int(x.split()[0]) for x in todo if x]
local=[int(x.split()[1]) for x in todo if x]
xs=tabu=[int(x.split()[2]) for x in todo if x]
title("Comp... | ajibawa-2023/Python-Code-Large/train/row_97704 | 17 | 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_97704:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /usr/bin/python
from random import randint
from random import choice
INSTANCIAS = 70
MAX_CLAUS = 300
MAX_VARS = 40
MAX_VARS_POR_CLAUS = 10
f = open("hard_big.in",'w')
clausulas=open("hard_big_tamanios",'w')
for i in xrange(INSTANCIAS):
c = randint(1,MAX_CLAUS)
clausulas.write(str(c)+"\n")
v = randint(1,MAX_VA... | ajibawa-2023/Python-Code-Large/train/row_97705 | 23 | 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_97705:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97705:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97705:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97705:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97705:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.