code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
__author__="Sergey Karakovskiy, sergey at idsia fullstop ch"
__date__ ="$May 2, 2009 7:54:12 PM$"
class MarioAgent:
# class MarioAgent(Agent):
""" An agent is an entity capable of producing actions, based on previous observations.
Generally it will also learn from experience. It can interact directly wi... | [
[
14,
0,
0.0263,
0.0263,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0526,
0.0263,
0,
0.66,
0.5,
763,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.5263,
0.8684,
0,
0.66,... | [
"__author__=\"Sergey Karakovskiy, sergey at idsia fullstop ch\"",
"__date__ =\"$May 2, 2009 7:54:12 PM$\"",
"class MarioAgent:\n# class MarioAgent(Agent):\n \"\"\" An agent is an entity capable of producing actions, based on previous observations.\n Generally it will also learn from experience. It ... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colombianCrush.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [
[
1,
0,
0.2,
0.1,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.75,
0.6,
0,
0.66,
1,
0,
... | [
"import os",
"import sys",
"if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"colombianCrush.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)",
" os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \... |
"""
Django settings for prueba project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | [
[
8,
0,
0.0532,
0.0957,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1277,
0.0106,
0,
0.66,
0.0476,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1383,
0.0106,
0,
0.6... | [
"\"\"\"\nDjango settings for prueba project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.6/ref/settings/",
"import os",
"BASE_DIR = os.path.dirname(os.path.dirname(__... |
'''
Created on 2/12/2013
@author: Juanpa y Yami
'''
from colombianCrush.core import *
class Figura(object):
"""Clase que representa a una figura que se puede ver en pantalla"""
def __init__(self, imagen):
self.id = imagen
self.imagen = Generador.cargarImagen(imagen)
def dibujar(s... | [
[
8,
0,
0.0103,
0.0172,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0206,
0.0034,
0,
0.66,
0.25,
328,
0,
1,
0,
0,
328,
0,
0
],
[
3,
0,
0.0481,
0.0447,
0,
0.66,
... | [
"'''\nCreated on 2/12/2013\n\n@author: Juanpa y Yami\n'''",
"from colombianCrush.core import *",
"class Figura(object):\n \"\"\"Clase que representa a una figura que se puede ver en pantalla\"\"\"\n\n def __init__(self, imagen):\n self.id = imagen\n self.imagen = Generador.cargarImagen(image... |
from elementos import Figura, Controlador | [
[
1,
0,
1,
1,
0,
0.66,
0,
711,
0,
2,
0,
0,
711,
0,
0
]
] | [
"from elementos import Figura, Controlador"
] |
from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('colombianCrush.views',
# Examples:
# url(r'^$', 'prueba.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
# url(r'^admin/', include(admin.site.urls)),
url(r'^$'... | [
[
1,
0,
0.0714,
0.0714,
0,
0.66,
0,
528,
0,
2,
0,
0,
528,
0,
0
],
[
1,
0,
0.2143,
0.0714,
0,
0.66,
0.3333,
302,
0,
1,
0,
0,
302,
0,
0
],
[
8,
0,
0.2857,
0.0714,
0,
... | [
"from django.conf.urls import patterns, url",
"from django.contrib import admin",
"admin.autodiscover()",
"urlpatterns = patterns('colombianCrush.views',\n # Examples:\n # url(r'^$', 'prueba.views.home', name='home'),\n # url(r'^blog/', include('blog.urls')),\n # url(r'^admin/', include(admin.site... |
import os
from pyswip import Prolog
from random import randint
from django.conf import settings
#CONSTANTES DE IDENTIFICACION DE LOS ESTADOS DEL JUEGO
PASIVO = 0
#Estado en el que el jugador puede hacer su movimiento
ACTIVO = 1
#Estado en el que se reacomodan las fichas
DESTRUCCION = 2
#Estado en el que se consul... | [
[
1,
0,
0.0063,
0.0063,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0125,
0.0063,
0,
0.66,
0.0147,
570,
0,
1,
0,
0,
570,
0,
0
],
[
1,
0,
0.0187,
0.0063,
0,
... | [
"import os",
"from pyswip import Prolog",
"from random import randint",
"from django.conf import settings",
"PASIVO = 0",
"ACTIVO = 1",
"DESTRUCCION = 2",
"INACTIVO = 3",
"BOMBA_COLOR = 500",
"VERDE_NORMAL = 501",
"NARANJA_NORMAL = 502",
"AMARILLO_NORMAL = 503",
"MORADO_NORMAL = 504",
"ROJ... |
from constantes import *
del(Prolog)
del(os)
del(randint)
del(settings) | [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
59,
0,
1,
0,
0,
59,
0,
0
]
] | [
"from constantes import *"
] |
"""
WSGI config for prueba project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colombianCrush.settings")
from django.... | [
[
8,
0,
0.3214,
0.5714,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7143,
0.0714,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.7857,
0.0714,
0,
0.66,
... | [
"\"\"\"\nWSGI config for prueba project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/\n\"\"\"",
"import os",
"os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"colombian... |
'''
Created on 23/11/2013
@author: Juanpa y Yami
'''
from django.template import Context, RequestContext
from django.template.loader import get_template
from django.http import HttpResponse, HttpResponseRedirect
from colombianCrush.crush import Controlador, Figura
from django.views.decorators.csrf import csrf_protect
... | [
[
8,
0,
0.0658,
0.1053,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1316,
0.0263,
0,
0.66,
0.1111,
213,
0,
2,
0,
0,
213,
0,
0
],
[
1,
0,
0.1579,
0.0263,
0,
0.66... | [
"'''\nCreated on 23/11/2013\n@author: Juanpa y Yami\n'''",
"from django.template import Context, RequestContext",
"from django.template.loader import get_template",
"from django.http import HttpResponse, HttpResponseRedirect",
"from colombianCrush.crush import Controlador, Figura",
"from django.views.deco... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colombianCrush.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [
[
1,
0,
0.2,
0.1,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.75,
0.6,
0,
0.66,
1,
0,
... | [
"import os",
"import sys",
"if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"colombianCrush.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)",
" os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \... |
import sys
import numpy as np
import tree
import node
import cplex
#from cplex.exceptions import CplexError
def branchbound(c):
c.parameters.output.writelevel.set(0)
c.parameters.simplex.display.set(0)
rt = node.root(c)
tr = tree.tree(rt)
#tr.setup()
iter = 0
while True:
#-- ... | [
[
1,
0,
0.0069,
0.0069,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0138,
0.0069,
0,
0.66,
0.1429,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0207,
0.0069,
0,
... | [
"import sys",
"import numpy as np",
"import tree",
"import node",
"import cplex",
"def branchbound(c):\n c.parameters.output.writelevel.set(0)\n c.parameters.simplex.display.set(0)\n\n rt = node.root(c) \n tr = tree.tree(rt)\n #tr.setup()\n iter = 0",
" c.parameters.output.writeleve... |
#This example shows how to formulate the wyndor glass co. problem
#The way that we model this problem can be altered to use modeling language
#But We still need to be clear about the model to be able to manipulate it
import cplex
from cplex.exceptions import CplexError
import sys
import numpy as np
c = cplex.Cplex()
... | [
[
1,
0,
0.0962,
0.0192,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.1154,
0.0192,
0,
0.66,
0.0714,
201,
0,
1,
0,
0,
201,
0,
0
],
[
1,
0,
0.1346,
0.0192,
0,
... | [
"import cplex",
"from cplex.exceptions import CplexError",
"import sys",
"import numpy as np",
"c = cplex.Cplex()",
"c.objective.set_sense(c.objective.sense.maximize)",
"c.variables.add(names=[\"x1\",\"x2\"],\n lb = [0,0],\n ub = [cplex.infinity, cplex.infinity],\n ... |
#This example shows how to formulate the wyndor glass co. problem
#The way that we model this problem can be altered to use modeling language
#But We still need to be clear about the model to be able to manipulate it
import cplex
from cplex.exceptions import CplexError
import sys
import numpy as np
c = cplex.Cplex()
... | [
[
1,
0,
0.0962,
0.0192,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.1154,
0.0192,
0,
0.66,
0.0714,
201,
0,
1,
0,
0,
201,
0,
0
],
[
1,
0,
0.1346,
0.0192,
0,
... | [
"import cplex",
"from cplex.exceptions import CplexError",
"import sys",
"import numpy as np",
"c = cplex.Cplex()",
"c.objective.set_sense(c.objective.sense.maximize)",
"c.variables.add(names=[\"x1\",\"x2\"],\n lb = [0,0],\n ub = [cplex.infinity, cplex.infinity],\n ... |
import cplex
import sys
def cpxsol(c):
c.parameters.mip.display.set(0)
c.parameters.preprocessing.presolve.set(0)
c.solve()
return c.solution.get_objective_value()
#cpxsol(c)
| [
[
1,
0,
0.0833,
0.0833,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.1667,
0.0833,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.4167,
0,
0.66,
... | [
"import cplex",
"import sys",
"def cpxsol(c):\n c.parameters.mip.display.set(0)\n c.parameters.preprocessing.presolve.set(0)\n c.solve()\n return c.solution.get_objective_value()",
" c.parameters.mip.display.set(0)",
" c.parameters.preprocessing.presolve.set(0)",
" c.solve()",
" ... |
import heapq
import cplex
import node
class tree:
def __init__(self, root):
self.global_up_bnd = 0
self.global_z = 0
# store the nodes in a priority queue
self.nodeq = []
heapq.heappush(self.nodeq, root)
def pop(self):
# pop the node with least priority... | [
[
1,
0,
0.0303,
0.0303,
0,
0.66,
0,
251,
0,
1,
0,
0,
251,
0,
0
],
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0.3333,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0909,
0.0303,
0,
... | [
"import heapq",
"import cplex",
"import node",
"class tree:\n def __init__(self, root):\n self.global_up_bnd = 0\n self.global_z = 0\n \n # store the nodes in a priority queue\n self.nodeq = []\n heapq.heappush(self.nodeq, root)",
" def __init__(self, root):\n... |
import sys
import numpy as np
import heapq
from copy import copy, deepcopy
from math import ceil, floor
import cplex
class root:
def __init__(self, mip = None):
#need to organize the attributes
self.lp = mip
self.rootlp = cplex.Cplex( mip )
# convert the mip problem to lp... | [
[
1,
0,
0.0041,
0.0041,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0082,
0.0041,
0,
0.66,
0.1429,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0123,
0.0041,
0,
... | [
"import sys",
"import numpy as np",
"import heapq",
"from copy import copy, deepcopy",
"from math import ceil, floor",
"import cplex",
"class root:\n def __init__(self, mip = None):\n \n #need to organize the attributes \n self.lp = mip\n self.rootlp = cplex.Cplex( mip )\n... |
import sys
import cplex
import numpy as np
from cplex.exceptions import CplexError
# c.variables.set_lower_bounds to fix values at 0 or 1
# c.solution.get_status() to know the status for logical control
# 1. optimal
# 2. unbounded
# 3. infeasible
# This function is going to be called over again
#--
def backtrack... | [
[
1,
0,
0.0041,
0.0041,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0082,
0.0041,
0,
0.66,
0.2,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0123,
0.0041,
0,
0.6... | [
"import sys",
"import cplex",
"import numpy as np",
"from cplex.exceptions import CplexError",
"def backtrack(c, P, S, V, lb, ub):\n #print 'Starting backtrack'\n #print 'P', P, 'S', S, 'V', V\n idx = 0\n\n if len(P) == 0:\n # print 'Already at the root'\n return []",
" idx = ... |
import sys
import cplex
import numpy as np
from cplex.exceptions import CplexError
ca = cplex.Cplex()
ca.read(sys.argv[1])
#ca.read("bell5.mps")
#copy ca to c for self processing
c = cplex.Cplex(ca)
# change the type from MILP into LP (0:LP, 1:MILP)
c.set_problem_type(type=0)
# c.solve()
# d.solve()
# three vector... | [
[
1,
0,
0.0061,
0.0061,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0121,
0.0061,
0,
0.66,
0.0667,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0182,
0.0061,
0,
... | [
"import sys",
"import cplex",
"import numpy as np",
"from cplex.exceptions import CplexError",
"ca = cplex.Cplex()",
"ca.read(sys.argv[1])",
"c = cplex.Cplex(ca)",
"c.set_problem_type(type=0)",
"P = []",
"S = []",
"s = 0",
"z_global = -10000000",
"z_node = 0",
"def backtrack(c, P, S):\n ... |
import sys
import cplex
import numpy as np
from cplex.exceptions import CplexError
ca = cplex.Cplex()
ca.read(sys.argv[1])
#copy ca to c for self processing
c = cplex.Cplex(ca)
c.parameters.output.writelevel.set(0)
# record index of binary variables
int_var_idx = []
con_var_idx = []
for i in range(c.variables.get_... | [
[
1,
0,
0.0185,
0.0185,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.037,
0.0185,
0,
0.66,
0.25,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0556,
0.0185,
0,
0.6... | [
"import sys",
"import cplex",
"import numpy as np",
"from cplex.exceptions import CplexError",
"def backtrack(c, P, S, V, lb, ub):\n print('Starting backtrack')\n print('P', P, 'S', S, 'V', V)\n idx = 0\n\n if len(P) == 0:\n print('Already at the root')\n return []",
" print('... |
from numpy import *
import randgraph
#
n = 200
rho = 0.6
adj_mat = randgraph.randgraph(n, rho)
adj_mat_new = zeros([n,n])
for i in range(n-1):
adj_mat_new[i+1, 0:i+1] = adj_mat[0:i+1, i]
adj_mat_new[0:i+1, i+1] = adj_mat[0:i+1, i]
print adj_mat
print adj_mat_new
nodes = [[i] for i in range(n)]
S = []
S_b... | [
[
1,
0,
0.009,
0.009,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.027,
0.009,
0,
0.66,
0.0455,
641,
0,
1,
0,
0,
641,
0,
0
],
[
14,
0,
0.0541,
0.009,
0,
0.66... | [
"from numpy import *",
"import randgraph",
"n = 200",
"rho = 0.6",
"adj_mat = randgraph.randgraph(n, rho)",
"adj_mat_new = zeros([n,n])",
"for i in range(n-1):\n adj_mat_new[i+1, 0:i+1] = adj_mat[0:i+1, i]\n adj_mat_new[0:i+1, i+1] = adj_mat[0:i+1, i]",
" adj_mat_new[i+1, 0:i+1] = adj_mat[0:i... |
from numpy import *
from random import choice
import itertools
import sys
n = 50
rho = 0.4
def randgraph(n, rho):
int_lb = 1
int_ub = 10
adj_mat = zeros( (n-1, n-1) )
# Start from i to j+1
up_tri_ind = [(i,j) for j in range(n-1) for i in range(j+1)]
# Init the list of degrees at each node
... | [
[
1,
0,
0.0156,
0.0156,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0312,
0.0156,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0469,
0.0156,
0,
... | [
"from numpy import *",
"from random import choice",
"import itertools",
"import sys",
"n = 50",
"rho = 0.4",
"def randgraph(n, rho):\n int_lb = 1\n int_ub = 10\n\n adj_mat = zeros( (n-1, n-1) )\n\n # Start from i to j+1\n up_tri_ind = [(i,j) for j in range(n-1) for i in range(j+1)]",
" ... |
#This module is for applying subgradient algorithm
#input: tolerance
#output: the list of primal solution, dual solution
#it internally calls the solvelr function with different lambda values
#to get primal and dual solutions
import sys
from lagrange import *
#print getidx(1,2,5)
iter = 0
N = 10
b = 40
t = 1
#report =... | [
[
1,
0,
0.0408,
0.0068,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0476,
0.0068,
0,
0.66,
0.0213,
377,
0,
1,
0,
0,
377,
0,
0
],
[
14,
0,
0.068,
0.0068,
0,
... | [
"import sys",
"from lagrange import *",
"iter = 0",
"N = 10",
"b = 40",
"t = 1",
"report = True",
"seed = int(sys.argv[1])",
"dual_rows = [\"u\" + str(i+1) for i in range(N)] + [\"v\" + str(i+1) for i in range(N)]",
"l = np.zeros( len(dual_rows) )",
"rho = 0.9",
"eps = 1",
"print(\"solve the... |
from lagrange import *
bat_dual_rows = []
#for i in bat_dual_row_names:
#do subgradient for each case
iter = 0
N = 20
b = 100
#t = 1
#report = True
#rho = 0.8
eps = 1
def subgrad(prob, dual_rows):
A, b, sen, c = initlr(prob, dual_rows)
# set initial value of l
l = 0 * np.ones( len(dual_rows) )
z ... | [
[
1,
0,
0.0071,
0.0071,
0,
0.66,
0,
377,
0,
1,
0,
0,
377,
0,
0
],
[
14,
0,
0.0214,
0.0071,
0,
0.66,
0.0556,
635,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.05,
0.0071,
0,
0.... | [
"from lagrange import *",
"bat_dual_rows = []",
"iter = 0",
"N = 20",
"b = 100",
"eps = 1",
"def subgrad(prob, dual_rows):\n\n A, b, sen, c = initlr(prob, dual_rows)\n\n # set initial value of l\n l = 0 * np.ones( len(dual_rows) )\n\n z = 0",
" A, b, sen, c = initlr(prob, dual_rows)",
... |
import cplex
import random
import numpy as np
from cplex.exceptions import CplexError
#The ideal case is that
# createld(prob, rownames)
# solveld (prob, lambda, A, b)
def getidx(i,j,N):
return j*N + i + 1
def initip(seed=10, N=20, b=100):
random.seed(seed)
prob = cplex.Cplex()
prob.objective.se... | [
[
1,
0,
0.0063,
0.0063,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0126,
0.0063,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0189,
0.0063,
0,
... | [
"import cplex",
"import random",
"import numpy as np",
"from cplex.exceptions import CplexError",
"def getidx(i,j,N):\n return j*N + i + 1",
" return j*N + i + 1",
"def initip(seed=10, N=20, b=100):\n random.seed(seed)\n\n prob = cplex.Cplex()\n\n prob.objective.set_sense(prob.objective.s... |
#read uflp problem as MIP
import sys
def get_words(line):
"""Return a list of the tokens in line."""
line = line.replace("\t", " ")
line = line.replace("\v", " ")
line = line.replace("\r", " ")
line = line.replace("\n", " ")
while line.count(" "):
line = line.replace(" ", " ")
lin... | [
[
1,
0,
0.0351,
0.0175,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.1491,
0.1754,
0,
0.66,
0.25,
917,
0,
1,
1,
0,
0,
0,
8
],
[
8,
1,
0.0877,
0.0175,
1,
0.43... | [
"import sys",
"def get_words(line):\n \"\"\"Return a list of the tokens in line.\"\"\"\n line = line.replace(\"\\t\", \" \")\n line = line.replace(\"\\v\", \" \")\n line = line.replace(\"\\r\", \" \")\n line = line.replace(\"\\n\", \" \")\n while line.count(\" \"):\n line = line.replace(... |
import cplex
import readuflp
import sys
import os
def get_ind(i,j,N):
return j*N + i + 1
#stub
def gen_uflp(filename):
prob = cplex.Cplex()
num_fac, num_cty, fx_cost, cn_cost = readuflp.read_uflp(filename)
# add x_ij variables
for j in range(num_cty):
varnames = ["x" + str( get_ind(i,j, ... | [
[
1,
0,
0.0156,
0.0156,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0312,
0.0156,
0,
0.66,
0.1429,
495,
0,
1,
0,
0,
495,
0,
0
],
[
1,
0,
0.0469,
0.0156,
0,
... | [
"import cplex",
"import readuflp",
"import sys",
"import os",
"def get_ind(i,j,N):\n return j*N + i + 1",
" return j*N + i + 1",
"def gen_uflp(filename):\n prob = cplex.Cplex()\n num_fac, num_cty, fx_cost, cn_cost = readuflp.read_uflp(filename)\n\n # add x_ij variables\n for j in range... |
#This is a file that generate a gap instances solved by cplex
import cplex
import random
import readgap
import os
def getidx(i,j,N):
return j*N + i + 1
def gengap(filename):
prob = cplex.Cplex()
nr, nj, c, a, b = readgap.readgap(filename)
print nr, nj, b
prob.objective.set_sense(prob.objective.se... | [
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0833,
0.0208,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
... | [
"import cplex",
"import random",
"import readgap",
"import os",
"def getidx(i,j,N):\n return j*N + i + 1",
" return j*N + i + 1",
"def gengap(filename):\n prob = cplex.Cplex()\n nr, nj, c, a, b = readgap.readgap(filename)\n print(nr, nj, b)\n prob.objective.set_sense(prob.objective.sen... |
def get_words(line):
"""Return a list of the tokens in line."""
line = line.replace("\t", " ")
line = line.replace("\v", " ")
line = line.replace("\r", " ")
line = line.replace("\n", " ")
while line.count(" "):
line = line.replace(" ", " ")
line = line.strip()
return [word + " ... | [
[
2,
0,
0.1078,
0.1961,
0,
0.66,
0,
917,
0,
1,
1,
0,
0,
0,
8
],
[
8,
1,
0.0392,
0.0196,
1,
0.45,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.0588,
0.0196,
1,
0.45,
... | [
"def get_words(line):\n \"\"\"Return a list of the tokens in line.\"\"\"\n line = line.replace(\"\\t\", \" \")\n line = line.replace(\"\\v\", \" \")\n line = line.replace(\"\\r\", \" \")\n line = line.replace(\"\\n\", \" \")\n while line.count(\" \"):\n line = line.replace(\" \", \" \")",... |
#This is a file that generate a random instance of knapsack problem
import cplex
import random
# Thinking of design the covers and cover classes
# covers(A, b)
# covers.set_inequalities(prob)
# covers.update_inequalities(prob)
# construct the min_covers from A and b
# cover.ind
# cover.val
# cover.max_val
# cover.ism... | [
[
1,
0,
0.0145,
0.0048,
0,
0.66,
0,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0193,
0.0048,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
2,
0,
0.1014,
0.0242,
0,
... | [
"import cplex",
"import random",
"def powerset(lst):\n ind = range(len(lst))\n P = reduce(lambda result, x: result + [subset + [x] for subset in result], lst, [[]])\n I = reduce(lambda result, x: result + [subset + [x] for subset in result], ind, [[]])\n return zip(I, P)",
" ind = range(len(lst... |
'''
Created on 11/07/2014
@author: Juanpa y Yami
'''
from cx_Freeze import setup, Executable
#includes = ["atexit", "PyQt4.QtGui", "numpy", "PIL", "pyfftw.builders"]
packages = ["GUI", "core"]
setup(
options={"build_exe":{"packages":packages, "excludes":["Tkinter"]}},
name="Transformada de Fourier",
... | [
[
8,
0,
0.1765,
0.2941,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4118,
0.0588,
0,
0.66,
0.3333,
353,
0,
2,
0,
0,
353,
0,
0
],
[
14,
0,
0.5882,
0.0588,
0,
0.6... | [
"'''\nCreated on 11/07/2014\n\n@author: Juanpa y Yami\n'''",
"from cx_Freeze import setup, Executable",
"packages = [\"GUI\", \"core\"]",
"setup(\n options={\"build_exe\":{\"packages\":packages, \"excludes\":[\"Tkinter\"]}}, \n name=\"Transformada de Fourier\",\n version=\"0.5\",\n descrip... |
'''
Created on 1/05/2014
@author: Juan Pablo Moreno - 20111020059
'''
import sys
from PyQt4.QtGui import QApplication
from GUI import VentanaMenu
def main():
app = QApplication(sys.argv)
ventana = VentanaMenu()
sys.exit(app.exec_())
if __name__ == '__main__':
main() | [
[
8,
0,
0.1562,
0.25,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.375,
0.0625,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4375,
0.0625,
0,
0.66,
... | [
"'''\nCreated on 1/05/2014\n@author: Juan Pablo Moreno - 20111020059\n'''",
"import sys",
"from PyQt4.QtGui import QApplication",
"from GUI import VentanaMenu",
"def main():\n app = QApplication(sys.argv)\n ventana = VentanaMenu()\n sys.exit(app.exec_())",
" app = QApplication(sys.argv)",
" ... |
'''
Created on 3/06/2014
@author: Juan Pablo Moreno - 20111020059
@author:
@author:
@author:
'''
from __future__ import print_function
import os
from PIL import Image
import numpy as np
import pyfftw as pFT
_FORMATOS = ['PNG', 'JPEG', 'GIF', 'BMP']
def _abrirImagen(_ruta):
imagenes = []
if isinstance(_ru... | [
[
8,
0,
0.0286,
0.05,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0571,
0.0071,
0,
0.66,
0.0769,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0643,
0.0071,
0,
0.66,
... | [
"'''\nCreated on 3/06/2014\n@author: Juan Pablo Moreno - 20111020059\n@author:\n@author:\n@author:\n'''",
"from __future__ import print_function",
"import os",
"from PIL import Image",
"import numpy as np",
"import pyfftw as pFT",
"_FORMATOS = ['PNG', 'JPEG', 'GIF', 'BMP']",
"def _abrirImagen(_ruta):\... |
from implementacion import transformar, filtrar, invertir, NoCorrespondenError | [
[
1,
0,
1,
1,
0,
0.66,
0,
253,
0,
4,
0,
0,
253,
0,
0
]
] | [
"from implementacion import transformar, filtrar, invertir, NoCorrespondenError"
] |
'''
Created on 3/06/2014
@author: Juan Pablo Moreno - 20111020059
@author:
@author:
@author:
'''
from PyQt4.QtGui import QMainWindow, QDialog, QFileDialog, QSizePolicy
from PyQt4.QtGui import QComboBox, QPushButton, QMessageBox, QLabel
class VentanaMenu(QMainWindow):
def __init__(self):
super(VentanaMenu, ... | [
[
8,
0,
0.0278,
0.0486,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0556,
0.0069,
0,
0.66,
0.2,
552,
0,
4,
0,
0,
552,
0,
0
],
[
1,
0,
0.0625,
0.0069,
0,
0.66,
... | [
"'''\nCreated on 3/06/2014\n@author: Juan Pablo Moreno - 20111020059\n@author:\n@author:\n@author:\n'''",
"from PyQt4.QtGui import QMainWindow, QDialog, QFileDialog, QSizePolicy",
"from PyQt4.QtGui import QComboBox, QPushButton, QMessageBox, QLabel",
"class VentanaMenu(QMainWindow):\n def __init__(self):\n... |
from interfaz import VentanaMenu | [
[
1,
0,
1,
1,
0,
0.66,
0,
206,
0,
1,
0,
0,
206,
0,
0
]
] | [
"from interfaz import VentanaMenu"
] |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/python
from bottle import route,run,get,post,response,static_file,request
import cv2,cv
import thread
import base64
#import carcontrol module
from controlServer import *
cam=cv2.VideoCapture(0)
if(cam.isOpened()==False):
print("cant open cam")
exit()
cam.set(cv.CV_CAP_PROP_FRAME_WIDTH,320)
cam.set(cv.CV_C... | [
[
1,
0,
0.0392,
0.0196,
0,
0.66,
0,
591,
0,
7,
0,
0,
591,
0,
0
],
[
1,
0,
0.0588,
0.0196,
0,
0.66,
0.0667,
896,
0,
2,
0,
0,
896,
0,
0
],
[
1,
0,
0.0784,
0.0196,
0,
... | [
"from bottle import route,run,get,post,response,static_file,request",
"import cv2,cv",
"import thread",
"import base64",
"from controlServer import *",
"cam=cv2.VideoCapture(0)",
"if(cam.isOpened()==False):\n\tprint(\"cant open cam\")\n\texit()",
"\tprint(\"cant open cam\")",
"\texit()",
"cam.set(... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 05 14:51:22 2014
@author: JuanMed
"""
lectura = 0
inp = raw_input("Ingrese la conversion ADC obtenida (de 0 a 4096): ")
lectura = int(inp)
lectura = (lectura*2.5)/4096
print "Voltaje en ADC: ",lectura
lectura = (lectura * 2)
print "Voltaje en Paneles (a ... | [
[
8,
0,
0.1026,
0.1282,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2051,
0.0256,
0,
0.66,
0.1429,
314,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2564,
0.0256,
0,
0.66... | [
"\"\"\"\nCreated on Mon May 05 14:51:22 2014\n\n@author: JuanMed\n\"\"\"",
"lectura = 0",
"inp = raw_input(\"Ingrese la conversion ADC obtenida (de 0 a 4096): \")",
"lectura = int(inp)",
"lectura = (lectura*2.5)/4096",
"print(\"Voltaje en ADC: \",lectura)",
"lectura = (lectura * 2)",
"print(\"Voltaje ... |
#!/usr/bin/python3
#coding=utf-8
import os
#读取文件列表
f=open('etc/list')
clist=[]
for line in f:
if len(line.strip('\n').strip('\r'))>0:
clist.append(line.strip('\n').strip('\r'))
#生成文档
docCommand='java -jar lib/jsdoc/jsrun.jar lib/jsdoc/app/run.js \
-a -v -p -t=lib/jsdoc/templates/CodeView -D="title:Castle API" -D... | [
[
1,
0,
0.0769,
0.0256,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1795,
0.0256,
0,
0.66,
0.0667,
899,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2051,
0.0256,
0,
... | [
"import os",
"f=open('etc/list')",
"clist=[]",
"for line in f:\n\tif len(line.strip('\\n').strip('\\r'))>0:\n\t\tclist.append(line.strip('\\n').strip('\\r'))",
"\tif len(line.strip('\\n').strip('\\r'))>0:\n\t\tclist.append(line.strip('\\n').strip('\\r'))",
"\t\tclist.append(line.strip('\\n').strip('\\r'))... |
#!/usr/bin/python3
#coding=utf-8
import os
#读取文件列表
f=open('etc/list')
clist=[]
for line in f:
if len(line.strip('\n').strip('\r'))>0:
clist.append(line.strip('\n').strip('\r'))
#生成文档
docCommand='java -jar lib/jsdoc/jsrun.jar lib/jsdoc/app/run.js \
-a -v -p -t=lib/jsdoc/templates/CodeView -D="title:Castle API" -D... | [
[
1,
0,
0.0769,
0.0256,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1795,
0.0256,
0,
0.66,
0.0667,
899,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2051,
0.0256,
0,
... | [
"import os",
"f=open('etc/list')",
"clist=[]",
"for line in f:\n\tif len(line.strip('\\n').strip('\\r'))>0:\n\t\tclist.append(line.strip('\\n').strip('\\r'))",
"\tif len(line.strip('\\n').strip('\\r'))>0:\n\t\tclist.append(line.strip('\\n').strip('\\r'))",
"\t\tclist.append(line.strip('\\n').strip('\\r'))... |
__version__ = '1.3.0'
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, OptionProperty, ObjectProperty
from kivy.graphics import Color, BorderImage
from kivy.clock import Clock
from kivy.vector import Vector
from kivy.metrics import dp
from kivy.animation import A... | [
[
14,
0,
0.0021,
0.0021,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0062,
0.0021,
0,
0.66,
0.0476,
548,
0,
1,
0,
0,
548,
0,
0
],
[
1,
0,
0.0082,
0.0021,
0,
0... | [
"__version__ = '1.3.0'",
"from kivy.app import App",
"from kivy.uix.widget import Widget",
"from kivy.properties import NumericProperty, OptionProperty, ObjectProperty",
"from kivy.graphics import Color, BorderImage",
"from kivy.clock import Clock",
"from kivy.vector import Vector",
"from kivy.metrics... |
# Game services for Android
from jnius import autoclass, PythonJavaClass, java_method
from android.runnable import run_on_ui_thread
import android
import android.activity
PythonActivity = autoclass('org.renpy.android.PythonActivity')
GameHelper = autoclass('com.google.example.games.basegameutils.GameHelper')
Games = au... | [
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0,
497,
0,
3,
0,
0,
497,
0,
0
],
[
1,
0,
0.0395,
0.0132,
0,
0.66,
0.0556,
787,
0,
1,
0,
0,
787,
0,
0
],
[
1,
0,
0.0526,
0.0132,
0,
... | [
"from jnius import autoclass, PythonJavaClass, java_method",
"from android.runnable import run_on_ui_thread",
"import android",
"import android.activity",
"PythonActivity = autoclass('org.renpy.android.PythonActivity')",
"GameHelper = autoclass('com.google.example.games.basegameutils.GameHelper')",
"Gam... |
__version__ = '1.3.0'
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, OptionProperty, ObjectProperty
from kivy.graphics import Color, BorderImage
from kivy.clock import Clock
from kivy.vector import Vector
from kivy.metrics import dp
from kivy.animation import A... | [
[
14,
0,
0.0021,
0.0021,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0062,
0.0021,
0,
0.66,
0.0476,
548,
0,
1,
0,
0,
548,
0,
0
],
[
1,
0,
0.0082,
0.0021,
0,
0... | [
"__version__ = '1.3.0'",
"from kivy.app import App",
"from kivy.uix.widget import Widget",
"from kivy.properties import NumericProperty, OptionProperty, ObjectProperty",
"from kivy.graphics import Color, BorderImage",
"from kivy.clock import Clock",
"from kivy.vector import Vector",
"from kivy.metrics... |
# Game services for Android
from jnius import autoclass, PythonJavaClass, java_method
from android.runnable import run_on_ui_thread
import android
import android.activity
PythonActivity = autoclass('org.renpy.android.PythonActivity')
GameHelper = autoclass('com.google.example.games.basegameutils.GameHelper')
Games = au... | [
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0,
497,
0,
3,
0,
0,
497,
0,
0
],
[
1,
0,
0.0395,
0.0132,
0,
0.66,
0.0556,
787,
0,
1,
0,
0,
787,
0,
0
],
[
1,
0,
0.0526,
0.0132,
0,
... | [
"from jnius import autoclass, PythonJavaClass, java_method",
"from android.runnable import run_on_ui_thread",
"import android",
"import android.activity",
"PythonActivity = autoclass('org.renpy.android.PythonActivity')",
"GameHelper = autoclass('com.google.example.games.basegameutils.GameHelper')",
"Gam... |
import sqlite3
#import time
#conn = sqlite3.connect("mydatabase.db")
#cursor=conn.cursor()
#cursor.execute('CREATE TABLE mytable (Id INTEGER PRIMARY KEY, Date TEXT, Entry TEXT)')
#today="monday"
#cursor.execute('INSERT INTO mytable VALUES(null, ?, ?)', (today, "This entry could be the first item on a To-Do List... | [
[
1,
0,
0.0125,
0.0125,
0,
0.66,
0,
790,
0,
1,
0,
0,
790,
0,
0
],
[
3,
0,
0.6,
0.7375,
0,
0.66,
0.3333,
768,
0,
7,
0,
0,
0,
0,
38
],
[
2,
1,
0.2875,
0.0625,
1,
0.09... | [
"import sqlite3",
"class dataBase:\n \n def createTable(self):\n conn = sqlite3.connect(\"mydatabase.db\")\n cursor=conn.cursor() \n cursor.execute('CREATE TABLE mytable (Id INTEGER PRIMARY KEY, cageName TEXT, CageDescription TEXT, numDoors TEXT, doorsOpen TEXT, humanIn... |
class Cage():
def __init__(self, cageName, cageDescription, numDoors = 2, doorsOpen = False):
self.cageName = cageName
self.cageDescription = cageDescription
self.numDoors = numDoors
self.doorsOpen = doorsOpen
def openDoor(self):
print("hello")
... | [
[
3,
0,
0.4583,
0.8333,
0,
0.66,
0,
616,
0,
2,
0,
0,
0,
0,
1
],
[
2,
1,
0.375,
0.5,
1,
0.05,
0,
555,
0,
5,
0,
0,
0,
0,
0
],
[
14,
2,
0.3333,
0.0833,
2,
0.72,
0,... | [
"class Cage():\n def __init__(self, cageName, cageDescription, numDoors = 2, doorsOpen = False):\n \n self.cageName = cageName\n self.cageDescription = cageDescription\n self.numDoors = numDoors\n self.doorsOpen = doorsOpen",
" def __init__(self, cageName, cageDescription,... |
class Cage():
cageID = ""
doorNumber = 1
cageMaxPopCap = 1
currentCap = 1
doorStatus = True
numberOfDoors = 1
cageDescription = ""
exhibitOccupied = True
cageSize = ""
def main():
lionCage = Cage("Lion", True, 21, 10, "A real environment", 2, True)
lionCage.clo... | [
[
3,
0,
0.443,
0.8772,
0,
0.66,
0,
616,
0,
18,
0,
0,
0,
0,
6
],
[
14,
1,
0.0175,
0.0088,
1,
0.14,
0,
407,
1,
0,
0,
0,
0,
3,
0
],
[
14,
1,
0.0263,
0.0088,
1,
0.14,
... | [
"class Cage():\n cageID = \"\"\n doorNumber = 1\n cageMaxPopCap = 1\n currentCap = 1\n doorStatus = True\n numberOfDoors = 1\n cageDescription = \"\"",
" cageID = \"\"",
" doorNumber = 1",
" cageMaxPopCap = 1",
" currentCap = 1",
" doorStatus = True",
" numberOfDoo... |
import unittest
import zooMonitoring
import zoo
class CageTests(unittest.TestCase):
def testNoCagesPresent(self):
zoo1 = zoo.Zoo()
#Test to check no cages are initially present
self.assertEqual(zoo1.getNumCages(), 1)
print zoo1.cages
def testAddPresent(sel... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0.25,
867,
0,
1,
0,
0,
867,
0,
0
],
[
1,
0,
0.125,
0.0417,
0,
0.66,... | [
"import unittest",
"import zooMonitoring",
"import zoo",
"class CageTests(unittest.TestCase):\n \n \n def testNoCagesPresent(self):\n zoo1 = zoo.Zoo()\n #Test to check no cages are initially present\n self.assertEqual(zoo1.getNumCages(), 1)\n print(zoo1.cages)",
" de... |
import zoo
import cage
class ZooMonitoring():
def __init__(self):
jcu = zoo.Zoo()
jcu.addCage("lion", "the lion lives here")
jcu.addCage("tim", "timmy lives here")
print jcu.getNumCages()
jcu.cages[0].openDoor()
def main():
pri... | [
[
1,
0,
0.0556,
0.0556,
0,
0.66,
0,
270,
0,
1,
0,
0,
270,
0,
0
],
[
1,
0,
0.1111,
0.0556,
0,
0.66,
0.3333,
275,
0,
1,
0,
0,
275,
0,
0
],
[
3,
0,
0.5556,
0.7222,
0,
... | [
"import zoo",
"import cage",
"class ZooMonitoring():\n \n def __init__(self):\n jcu = zoo.Zoo()\n \n jcu.addCage(\"lion\", \"the lion lives here\")\n jcu.addCage(\"tim\", \"timmy lives here\")\n print(jcu.getNumCages())",
" def __init__(self):\n jcu = zoo.Zoo... |
from turtle import *
import forest
import os
f = forest()
x = 1
t = Turtle()
t.write("home =", True, align="center")
t.showturtle()
speed("fastest")
while x < 100:
pd()
sety(121)
setx(66)
c = ["red","green","yellow","blue","purple","cyan","pink"]
color(c[x%7])
forward(45)
rig... | [
[
1,
0,
0.0149,
0.0149,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0299,
0.0149,
0,
0.66,
0.1,
453,
0,
1,
0,
0,
453,
0,
0
],
[
1,
0,
0.0448,
0.0149,
0,
0.6... | [
"from turtle import *",
"import forest",
"import os",
"f = forest()",
"x = 1",
"t = Turtle()",
"t.write(\"home =\", True, align=\"center\")",
"t.showturtle()",
"speed(\"fastest\")",
"while x < 100:\n pd()\n sety(121)\n setx(66)\n c = [\"red\",\"green\",\"yellow\",\"blue\",\"purple\",\"... |
import zooMonitoring
import database
import zoo
if __name__ == '__main__':
z = zoo.Zoo()
db = database.dataBase()
choice = None
menuNotChosen = True
choice = raw_input("Please Choose Option \ncage \nadmin\n Choose: ")
while choice:
if choice == "cage":
... | [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
867,
0,
1,
0,
0,
867,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.5,
329,
0,
1,
0,
0,
329,
0,
0
],
[
1,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"import zooMonitoring",
"import database",
"import zoo"
] |
import sqlite3
#import time
#conn = sqlite3.connect("mydatabase.db")
#cursor=conn.cursor()
#cursor.execute('CREATE TABLE mytable (Id INTEGER PRIMARY KEY, Date TEXT, Entry TEXT)')
#today="monday"
#cursor.execute('INSERT INTO mytable VALUES(null, ?, ?)', (today, "This entry could be the first item on a To-Do List, or it... | [
[
1,
0,
0.0055,
0.0055,
0,
0.66,
0,
790,
0,
1,
0,
0,
790,
0,
0
],
[
1,
0,
0.1044,
0.0055,
0,
0.66,
0.5,
275,
0,
1,
0,
0,
275,
0,
0
],
[
3,
0,
0.5495,
0.8846,
0,
0.6... | [
"import sqlite3",
"import cage",
"class dataBase:\n \n def createTable(self):\n conn = sqlite3.connect(\"mydatabase.db\")\n cursor=conn.cursor() \n cursor.execute('CREATE TABLE mytable (Id INTEGER PRIMARY KEY, cageName TEXT, CageDescription TEXT, numDoors TEXT, doorsO... |
class Cage():
def __init__(self, cageName, cageDescription, numDoors = 2, doorsOpen = False, humanInside = False):
self.cageName = cageName
self.cageDescription = cageDescription
self.numDoors = numDoors
self.doorsOpen = doorsOpen
self.humanInside = humanInside
... | [
[
3,
0,
0.4722,
0.8889,
0,
0.66,
0,
616,
0,
3,
0,
0,
0,
0,
0
],
[
2,
1,
0.2778,
0.3889,
1,
0.3,
0,
555,
0,
6,
0,
0,
0,
0,
0
],
[
14,
2,
0.2222,
0.0556,
2,
0.8,
... | [
"class Cage():\n def __init__(self, cageName, cageDescription, numDoors = 2, doorsOpen = False, humanInside = False):\n \n self.cageName = cageName\n self.cageDescription = cageDescription\n self.numDoors = numDoors\n self.doorsOpen = doorsOpen\n self.humanInside = human... |
import cage
import database
class Zoo:
def __init__(self):
self.cages = []
print self.cages
#dont USE!!
def addCage(self, cageName, cageDescription):
cageName = cage.Cage(cageName, cageDescription)
self.cages.append(cageName)
def addCag... | [
[
1,
0,
0.009,
0.009,
0,
0.66,
0,
275,
0,
1,
0,
0,
275,
0,
0
],
[
1,
0,
0.018,
0.009,
0,
0.66,
0.1429,
329,
0,
1,
0,
0,
329,
0,
0
],
[
3,
0,
0.491,
0.9189,
0,
0.66,... | [
"import cage",
"import database",
"class Zoo:\n\n def __init__(self):\n self.cages = []\n print(self.cages)\n \n \n #dont USE!!",
" def __init__(self):\n self.cages = []\n print(self.cages)",
" self.cages = []",
" print(self.cages)",
... |
def tree(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5):
# benutzt Liste von turtles und Liste von Zweiglisten,
# fuer jede turtle eine!
if level > 0:
lst = []
brs = []
for t, branchlist in list(zip(tlist,branchlists)):
t.pensize( size * wi... | [
[
2,
0,
0.5227,
1,
0,
0.66,
0,
613,
0,
7,
0,
0,
0,
0,
15
],
[
4,
1,
0.5909,
0.8636,
1,
0.83,
0,
0,
0,
0,
0,
0,
0,
0,
15
],
[
14,
2,
0.2273,
0.0455,
2,
0.31,
0,
... | [
"def tree(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5):\n # benutzt Liste von turtles und Liste von Zweiglisten,\n # fuer jede turtle eine!\n if level > 0:\n lst = []\n brs = []\n for t, branchlist in list(zip(tlist,branchlists)):\n t.pensize( size... |
import unittest
#import zooMonitoring
import zoo
class CageTests(unittest.TestCase):
def testNoCagesPresent(self):
emptyZoo = zoo.Zoo()
#emptyZoo.cages = []
#Test to check no cages are initially present
#emptyZoo.addCage("Monkey", "Chimpanzee lives here")
self.assertEqu... | [
[
1,
0,
0.0109,
0.0109,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0326,
0.0109,
0,
0.66,
0.3333,
270,
0,
1,
0,
0,
270,
0,
0
],
[
3,
0,
0.5054,
0.913,
0,
0.6... | [
"import unittest",
"import zoo",
"class CageTests(unittest.TestCase):\n \n def testNoCagesPresent(self):\n emptyZoo = zoo.Zoo()\n #emptyZoo.cages = []\n #Test to check no cages are initially present\n #emptyZoo.addCage(\"Monkey\", \"Chimpanzee lives here\")\n self.assert... |
from turtle import *
from random import randrange
from time import clock
def writeZoo():
width(10)
color("blue")
penup()
setx(-300)
sety(300)
pendown()
pendown()
forward(75)
right(135)
forward(100)
left(135)
forward(75)
penup()
setx(-180... | [
[
1,
0,
0.007,
0.007,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0141,
0.007,
0,
0.66,
0.0769,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0211,
0.007,
0,
0.66... | [
"from turtle import *",
"from random import randrange",
"from time import clock",
"def writeZoo():\n \n width(10)\n color(\"blue\")\n penup()\n setx(-300)\n sety(300)\n pendown()",
" width(10)",
" color(\"blue\")",
" penup()",
" setx(-300)",
" sety(300)",
" p... |
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
#c.execute('''CREATE TABLE cages
# (cageName, cageDescription, numDoors, doorsOpen)''')
# Insert a row of data
c.execute("INSERT INTO cages VALUES ('bear','this is the bears houese','2','False')")
# Save (co... | [
[
1,
0,
0.0455,
0.0455,
0,
0.66,
0,
790,
0,
1,
0,
0,
790,
0,
0
],
[
14,
0,
0.0909,
0.0455,
0,
0.66,
0.1429,
345,
3,
1,
0,
0,
242,
10,
1
],
[
14,
0,
0.1818,
0.0455,
0,
... | [
"import sqlite3",
"conn = sqlite3.connect('example.db')",
"c = conn.cursor()",
"c.execute(\"INSERT INTO cages VALUES ('bear','this is the bears houese','2','False')\")",
"conn.commit()",
"c.execute('delete from cages')",
"for row in c.execute('SELECT * FROM cages ORDER BY cageName'):\n print(row)... |
import zoo
import cage
class ZooMonitoring:
def __init__(self):
jcu = zoo.Zoo()
#jcu.addCageList("lion", "1")
#jcu.addCageList("moose", "2")
#jcu.addCageList("panda", "3")
#jcu.addCageList("bird", "4")
# print jcu.getNumCages()
# print jcu... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
270,
0,
1,
0,
0,
270,
0,
0
],
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0.3333,
275,
0,
1,
0,
0,
275,
0,
0
],
[
3,
0,
0.5417,
0.7917,
0,
... | [
"import zoo",
"import cage",
"class ZooMonitoring:\n \n def __init__(self):\n jcu = zoo.Zoo()\n \n #jcu.addCageList(\"lion\", \"1\")\n #jcu.addCageList(\"moose\", \"2\")\n #jcu.addCageList(\"panda\", \"3\")",
" def __init__(self):\n jcu = zoo.Zoo()",
" ... |
#-*- coding: utf-8 -*-
#! /usr/bin/python
#######################################################################################
# #
# File: online_keeper.py #
# Pa... | [
[
1,
0,
0.057,
0.0015,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0586,
0.0015,
0,
0.66,
0.0233,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0616,
0.0015,
0,
0... | [
"import time",
"import re",
"from PyQt4.QtCore import *",
"from PyQt4.QtGui import *",
"import urllib",
"import urllib2",
"import socket",
"from browser_bogus import Browser",
"from com_lib import *",
"account_list = {\"\":\"\"}",
"cycle = 1",
"delay = 3610 * 22",
"try:\n _fromUtf8 = QStr... |
#This contains global definition of Browser class and other useful thing
#######################################################################################
# #
# File: browser_bogus.py ... | [
[
1,
0,
0.7442,
0.0233,
0,
0.66,
0,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.7674,
0.0233,
0,
0.66,
0.5,
591,
0,
1,
0,
0,
591,
0,
0
],
[
3,
0,
0.907,
0.2093,
0,
0.66... | [
"import urllib2",
"import cookielib",
"class Browser():\n def __init__(self, user, passwd, user_agent=\"Python-urllib/2.7\"):\n self.username = user\n self.password = passwd\n self.user_agent = user_agent\n self.cookie = cookielib.CookieJar()\n self.urlOpener = urllib2.buil... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import main
from glob import glob
data_files = [("Microsoft.VC100.CRT",
glob(r'E:\important\应用软件\开发工具\python\开发代码\Microsoft.VC100.CRT\*.*'))]
setup(
options = {"py2exe": {"optimize": 2,
... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.2069,
0.0345,
0,
0.66,
0.2,
768,
0,
1,
0,
0,
768,
0,
0
],
[
1,
0,
0.2414,
0.0345,
0,
0.6... | [
"from distutils.core import setup",
"import py2exe",
"import main",
"from glob import glob",
"data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'E:\\important\\应用软件\\开发工具\\python\\开发代码\\Microsoft.VC100.CRT\\*.*'))]",
"setup(\n options = {\"py2exe\": {\"optimize\": 2,\n ... |
#!/usr/bin/python
from socket import *
import struct,os,time,sys
from ntp_server_lib import get_random_ntp_server
# print get_random_ntp_server()
# Script to set Linux hardware clock (/usr/sbin/hwclock) from an NTP
# time server. Run as "setclock.py" to simply print the time from
# the NTP ... | [
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0.25,
399,
0,
4,
0,
0,
399,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.... | [
"from socket import *",
"import struct,os,time,sys",
"from ntp_server_lib import get_random_ntp_server",
"time_server = (get_random_ntp_server(), 123)",
"def get_ntp_time():\n client = socket( AF_INET, SOCK_DGRAM ) \n data = '\\x1b' + 47 * '\\0' \n client.sendto(data, time_server) \n data, ad... |
#-*- coding: utf-8 -*-
#! /usr/bin/python
import urllib
import urllib2
import time
import socket
from browser_bogus import Browser
def logd(content,fname = "sysrun.log",dolog = True):
if dolog:
try:
if fname == None:
fname = "sysrun.log"
fp = open(fnam... | [
[
1,
0,
0.0541,
0.0135,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0676,
0.0135,
0,
0.66,
0.1429,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.0811,
0.0135,
0,
... | [
"import urllib",
"import urllib2",
"import time",
"import socket",
"from browser_bogus import Browser",
"def logd(content,fname = \"sysrun.log\",dolog = True):\n if dolog:\n try:\n if fname == None:\n fname = \"sysrun.log\"\n fp = open(fname, \"a\")\n ... |
import random
NS_NTP = ["132.163.4.101",
"132.163.4.102",
"132.163.4.103",
"128.138.140.44",
"69.25.96.13",
"64.236.96.53"]
#print len(UA_MSIE10)
#print len(UA_MSIE9)
#print len(UA_MSIE8)
#print len(UA_MSIE7)
#print len(UA_MSIE6)
def get_random_ntp_server():
random.seed()
i = random.randra... | [
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.2708,
0.25,
0,
0.66,
0.3333,
91,
0,
0,
0,
0,
0,
5,
0
],
[
2,
0,
0.7708,
0.1667,
0,
0.66... | [
"import random",
"NS_NTP = [\"132.163.4.101\",\n\"132.163.4.102\",\n\"132.163.4.103\",\n\"128.138.140.44\",\n\"69.25.96.13\",\n\"64.236.96.53\"]",
"def get_random_ntp_server():\n random.seed()\n i = random.randrange(0, len(NS_NTP) - 1)\n return NS_NTP[i]",
" random.seed()",
" i = random.randr... |
#######################################################################################
#
# File: user_agent_lib
# Part of pcbeta-cheater
# Home: http://pcbeta-cheater.googlecode.com
#
# ... | [
[
8,
0,
0.0082,
0.0012,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.009,
0.0002,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.01,
0.0012,
0,
0.66,
... | [
"'''\nCreated on May 29, 2011\n\n@author: flyxian\n'''",
"import random",
"UA_MSIE10 = [\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)\",\n\"Mo... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import main
from glob import glob
data_files = [("Microsoft.VC100.CRT",
glob(r'E:\important\应用软件\开发工具\python\开发代码\Microsoft.VC100.CRT\*.*'))]
setup(
options = {"py2exe": {"optimize": 2,
... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.2069,
0.0345,
0,
0.66,
0.2,
768,
0,
1,
0,
0,
768,
0,
0
],
[
1,
0,
0.2414,
0.0345,
0,
0.6... | [
"from distutils.core import setup",
"import py2exe",
"import main",
"from glob import glob",
"data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'E:\\important\\应用软件\\开发工具\\python\\开发代码\\Microsoft.VC100.CRT\\*.*'))]",
"setup(\n options = {\"py2exe\": {\"optimize\": 2,\n ... |
#!/usr/bin/python
from socket import *
import struct,os,time,sys
from ntp_server_lib import get_random_ntp_server
# print get_random_ntp_server()
# Script to set Linux hardware clock (/usr/sbin/hwclock) from an NTP
# time server. Run as "setclock.py" to simply print the time from
# the NTP ... | [
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0.25,
399,
0,
4,
0,
0,
399,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.... | [
"from socket import *",
"import struct,os,time,sys",
"from ntp_server_lib import get_random_ntp_server",
"time_server = (get_random_ntp_server(), 123)",
"def get_ntp_time():\n client = socket( AF_INET, SOCK_DGRAM ) \n data = '\\x1b' + 47 * '\\0' \n client.sendto(data, time_server) \n data, ad... |
# -*- coding: utf-8 -*-
#######################################################################################
# #
# File: Core.py #
# Part of stage1st_cheater ... | [
[
8,
0,
0.0699,
0.0106,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0763,
0.0021,
0,
0.66,
0.125,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.0805,
0.0021,
0,
0.66,... | [
"'''\nCreated on May 22, 2011\n\n@author: flyxian\n'''",
"import operator",
"from PyQt4.QtCore import *",
"from PyQt4.QtGui import *",
"from MainDialog import *",
"try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s",
" _fromUtf8 = QtCore.QString.fromUtf... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainDialog.ui'
#
# Created: Mon Feb 17 23:47:19 2014
# by: PyQt4 UI code generator 4.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... | [
[
1,
0,
0.0463,
0.0046,
0,
0.66,
0,
154,
0,
2,
0,
0,
154,
0,
0
],
[
7,
0,
0.0648,
0.0231,
0,
0.66,
0.3333,
0,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.0602,
0.0046,
1,
0.1... | [
"from PyQt4 import QtCore, QtGui",
"try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s",
" _fromUtf8 = QtCore.QString.fromUtf8",
" def _fromUtf8(s):\n return s",
" return s",
"try:\n _encoding = QtGui.QApplication.UnicodeUT... |
#This contains global definition of Browser class and other useful thing
#######################################################################################
# #
# File: browser_bogus.py ... | [
[
1,
0,
0.7442,
0.0233,
0,
0.66,
0,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.7674,
0.0233,
0,
0.66,
0.5,
591,
0,
1,
0,
0,
591,
0,
0
],
[
3,
0,
0.907,
0.2093,
0,
0.66... | [
"import urllib2",
"import cookielib",
"class Browser():\n def __init__(self, user, passwd, user_agent=\"Python-urllib/2.7\"):\n self.username = user\n self.password = passwd\n self.user_agent = user_agent\n self.cookie = cookielib.CookieJar()\n self.urlOpener = urllib2.buil... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import main
from glob import glob
data_files = [("Microsoft.VC100.CRT",
glob(r'E:\important\应用软件\开发工具\python\开发代码\Microsoft.VC100.CRT\*.*'))]
setup(
options = {"py2exe": {"optimize": 2,
... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.2069,
0.0345,
0,
0.66,
0.2,
768,
0,
1,
0,
0,
768,
0,
0
],
[
1,
0,
0.2414,
0.0345,
0,
0.6... | [
"from distutils.core import setup",
"import py2exe",
"import main",
"from glob import glob",
"data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'E:\\important\\应用软件\\开发工具\\python\\开发代码\\Microsoft.VC100.CRT\\*.*'))]",
"setup(\n options = {\"py2exe\": {\"optimize\": 2,\n ... |
#!/usr/bin/python
from socket import *
import struct,os,time,sys
from ntp_server_lib import get_random_ntp_server
print get_random_ntp_server()
# Script to set Linux hardware clock (/usr/sbin/hwclock) from an NTP
# time server. Run as "setclock.py" to simply print the time from
# the NTP se... | [
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0.2,
399,
0,
4,
0,
0,
399,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.6... | [
"from socket import *",
"import struct,os,time,sys",
"from ntp_server_lib import get_random_ntp_server",
"print(get_random_ntp_server())",
"time_server = (get_random_ntp_server(), 123)",
"def get_ntp_time():\n client = socket( AF_INET, SOCK_DGRAM ) \n data = '\\x1b' + 47 * '\\0' \n client.sendt... |
import random
NS_NTP = ["132.163.4.101",
"132.163.4.102",
"132.163.4.103",
"128.138.140.44",
"69.25.96.13",
"64.236.96.53"]
#print len(UA_MSIE10)
#print len(UA_MSIE9)
#print len(UA_MSIE8)
#print len(UA_MSIE7)
#print len(UA_MSIE6)
def get_random_ntp_server():
random.seed()
i = random.randra... | [
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.2708,
0.25,
0,
0.66,
0.3333,
91,
0,
0,
0,
0,
0,
5,
0
],
[
2,
0,
0.7708,
0.1667,
0,
0.66... | [
"import random",
"NS_NTP = [\"132.163.4.101\",\n\"132.163.4.102\",\n\"132.163.4.103\",\n\"128.138.140.44\",\n\"69.25.96.13\",\n\"64.236.96.53\"]",
"def get_random_ntp_server():\n random.seed()\n i = random.randrange(0, len(NS_NTP) - 1)\n return NS_NTP[i]",
" random.seed()",
" i = random.randr... |
#######################################################################################
#
# File: user_agent_lib
# Part of pcbeta-cheater
# Home: http://pcbeta-cheater.googlecode.com
#
# ... | [
[
8,
0,
0.0082,
0.0012,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.009,
0.0002,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.01,
0.0012,
0,
0.66,
... | [
"'''\nCreated on May 29, 2011\n\n@author: flyxian\n'''",
"import random",
"UA_MSIE10 = [\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)\",\n\"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)\",\n\"Mo... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import main
from glob import glob
data_files = [("Microsoft.VC100.CRT",
glob(r'E:\important\应用软件\开发工具\python\开发代码\Microsoft.VC100.CRT\*.*'))]
setup(
options = {"py2exe": {"optimize": 2,
... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.2069,
0.0345,
0,
0.66,
0.2,
768,
0,
1,
0,
0,
768,
0,
0
],
[
1,
0,
0.2414,
0.0345,
0,
0.6... | [
"from distutils.core import setup",
"import py2exe",
"import main",
"from glob import glob",
"data_files = [(\"Microsoft.VC100.CRT\", \n glob(r'E:\\important\\应用软件\\开发工具\\python\\开发代码\\Microsoft.VC100.CRT\\*.*'))]",
"setup(\n options = {\"py2exe\": {\"optimize\": 2,\n ... |
#!/usr/bin/python
from socket import *
import struct,os,time,sys
from ntp_server_lib import get_random_ntp_server
print get_random_ntp_server()
# Script to set Linux hardware clock (/usr/sbin/hwclock) from an NTP
# time server. Run as "setclock.py" to simply print the time from
# the NTP se... | [
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0.2,
399,
0,
4,
0,
0,
399,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.6... | [
"from socket import *",
"import struct,os,time,sys",
"from ntp_server_lib import get_random_ntp_server",
"print(get_random_ntp_server())",
"time_server = (get_random_ntp_server(), 123)",
"def get_ntp_time():\n client = socket( AF_INET, SOCK_DGRAM ) \n data = '\\x1b' + 47 * '\\0' \n client.sendt... |
# -*- coding: utf-8 -*-
#######################################################################################
# #
# File: Core.py #
# Part of stage1st_cheater ... | [
[
8,
0,
0.1209,
0.0183,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1319,
0.0037,
0,
0.66,
0.125,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.1392,
0.0037,
0,
0.66,... | [
"'''\nCreated on May 22, 2011\n\n@author: flyxian\n'''",
"import operator",
"from PyQt4.QtCore import *",
"from PyQt4.QtGui import *",
"from MainDialog import *",
"try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s",
" _fromUtf8 = QtCore.QString.fromUtf... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainDialog.ui'
#
# Created: Sun May 29 21:22:32 2011
# by: PyQt4 UI code generator 4.8.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8... | [
[
1,
0,
0.0855,
0.0085,
0,
0.66,
0,
154,
0,
2,
0,
0,
154,
0,
0
],
[
7,
0,
0.1154,
0.0342,
0,
0.66,
0.5,
0,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.1111,
0.0085,
1,
0.84,
... | [
"from PyQt4 import QtCore, QtGui",
"try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s",
" _fromUtf8 = QtCore.QString.fromUtf8",
" _fromUtf8 = lambda s: s",
"class Ui_MainDialog(object):\n def setupUi(self, MainDialog):\n MainDialog.setObjectNa... |
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/license... | [
[
8,
0,
0.0719,
0.1375,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.15,
0.0063,
0,
0.66,
0.1667,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.1562,
0.0063,
0,
0.66,
... | [
"\"\"\"\nFCKeditor - The text editor for Internet - http://www.fckeditor.net\nCopyright (C) 2003-2008 Frederico Caldeira Knabben\n\n== BEGIN LICENSE ==\n\nLicensed under the terms of any of the following licenses at your\nchoice:",
"import cgi",
"import os",
"import re",
"import string",
"def escape(text,... |
import pygame, sys, math
class Glass():
def __init__(self, speed = [2,2], size = [100,100], pos = (0,0)):
"""
self.images = []
for image in images:
newimage = pygame.image.load(image)
newimage = pygame.transform.scale(newimage, size)
self.images += [newim... | [
[
1,
0,
0.0087,
0.0087,
0,
0.66,
0,
87,
0,
3,
0,
0,
87,
0,
0
],
[
3,
0,
0.4913,
0.9391,
0,
0.66,
1,
586,
0,
10,
0,
0,
0,
0,
13
],
[
2,
1,
0.1478,
0.2348,
1,
0.29,
... | [
"import pygame, sys, math",
"class Glass():\n def __init__(self, speed = [2,2], size = [100,100], pos = (0,0)):\n \"\"\"\n self.images = []\n for image in images:\n newimage = pygame.image.load(image)\n newimage = pygame.transform.scale(newimage, size)\n se... |
import pygame, sys, math
class Enlarge():
def __init__(self, speed = [2,2], pos = (0,0)):
self.type = "Enlarge"
self.image = pygame.image.load("Resources/Cow/U.png")
self.rect = self.image.get_rect()
self.radius = self.rect.width/2
self.place(pos)
self.speedx = speed... | [
[
1,
0,
0.0312,
0.0312,
0,
0.66,
0,
87,
0,
3,
0,
0,
87,
0,
0
],
[
3,
0,
0.5469,
0.9375,
0,
0.66,
1,
146,
0,
5,
0,
0,
0,
0,
5
],
[
2,
1,
0.2656,
0.3125,
1,
0.94,
... | [
"import pygame, sys, math",
"class Enlarge():\n def __init__(self, speed = [2,2], pos = (0,0)):\n self.type = \"Enlarge\"\n self.image = pygame.image.load(\"Resources/Cow/U.png\")\n self.rect = self.image.get_rect()\n self.radius = self.rect.width/2\n self.place(pos)\n ... |
import pygame, sys, math
class Ball():
def __init__(self, image, speed = [2,2], size = [100,100], pos = (0,0)):
self.image = pygame.image.load(image)
self.image = pygame.transform.scale(self.image, size)
self.rect = self.image.get_rect()
self.speedx = speed[0]
self.speedy = ... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
87,
0,
3,
0,
0,
87,
0,
0
],
[
3,
0,
0.5159,
0.9524,
0,
0.66,
1,
34,
0,
7,
0,
0,
0,
0,
8
],
[
2,
1,
0.1349,
0.1587,
1,
0.46,
... | [
"import pygame, sys, math",
"class Ball():\n def __init__(self, image, speed = [2,2], size = [100,100], pos = (0,0)):\n self.image = pygame.image.load(image)\n self.image = pygame.transform.scale(self.image, size)\n self.rect = self.image.get_rect()\n self.speedx = speed[0]\n ... |
import pygame, sys, math, random
pygame.init()
from Ball import Ball
from PlayerBall import PlayerBall
clock = pygame.time.Clock()
width = 640
height = 480
size = width, height
screen = pygame.display.set_mode(size)
bgImage = pygame.image.load("rsc/bg/startbg.png")
bgRect = bgImage.get_rect()
bgColor = r,g,b = 0... | [
[
1,
0,
0.0092,
0.0092,
0,
0.66,
0,
87,
0,
4,
0,
0,
87,
0,
0
],
[
8,
0,
0.0275,
0.0092,
0,
0.66,
0.0625,
319,
3,
0,
0,
0,
0,
0,
1
],
[
1,
0,
0.0459,
0.0092,
0,
0.66... | [
"import pygame, sys, math, random",
"pygame.init()",
"from Ball import Ball",
"from PlayerBall import PlayerBall",
"clock = pygame.time.Clock()",
"width = 640",
"height = 480",
"size = width, height",
"screen = pygame.display.set_mode(size)",
"bgImage = pygame.image.load(\"rsc/bg/startbg.png\")",
... |
import pygame, sys, math
class PlayerBall():
def __init__(self, images, speed = [2,2], size = [100,100], pos = (0,0)):
self.images = []
for image in images:
newimage = pygame.image.load(image)
newimage = pygame.transform.scale(newimage, size)
self.images += [newi... | [
[
1,
0,
0.0105,
0.0105,
0,
0.66,
0,
87,
0,
3,
0,
0,
87,
0,
0
],
[
3,
0,
0.5105,
0.9684,
0,
0.66,
1,
316,
0,
9,
0,
0,
0,
0,
10
],
[
2,
1,
0.1368,
0.2,
1,
0.27,
0... | [
"import pygame, sys, math",
"class PlayerBall():\n def __init__(self, images, speed = [2,2], size = [100,100], pos = (0,0)):\n self.images = []\n for image in images:\n newimage = pygame.image.load(image)\n newimage = pygame.transform.scale(newimage, size)\n self.... |
import pygame, sys, math
class Milk():
def __init__(self, speed = [2,2], size = [100,100], pos = (0,0)):
self.image = pygame.image.load("Resources/Milk/MILK3.png")
self.image = pygame.transform.scale(self.image, size)
self.rect = self.image.get_rect()
self.speedx = speed[0]
... | [
[
1,
0,
0.0217,
0.0217,
0,
0.66,
0,
87,
0,
3,
0,
0,
87,
0,
0
],
[
3,
0,
0.5,
0.8478,
0,
0.66,
1,
492,
0,
6,
0,
0,
0,
0,
7
],
[
2,
1,
0.2065,
0.2174,
1,
0.17,
0,... | [
"import pygame, sys, math",
"class Milk():\n def __init__(self, speed = [2,2], size = [100,100], pos = (0,0)):\n self.image = pygame.image.load(\"Resources/Milk/MILK3.png\")\n self.image = pygame.transform.scale(self.image, size)\n self.rect = self.image.get_rect()\n self.speedx = s... |
import pygame, sys, math, random
pygame.init()
from Ball import Ball
from PlayerBall import PlayerBall
clock = pygame.time.Clock()
width = 640
height = 480
size = width, height
screen = pygame.display.set_mode(size)
bgImage = pygame.image.load("rsc/bg/startbg.png")
bgRect = bgImage.get_rect()
bgColor = r,g,b = 0... | [
[
1,
0,
0.0092,
0.0092,
0,
0.66,
0,
87,
0,
4,
0,
0,
87,
0,
0
],
[
8,
0,
0.0275,
0.0092,
0,
0.66,
0.0625,
319,
3,
0,
0,
0,
0,
0,
1
],
[
1,
0,
0.0459,
0.0092,
0,
0.66... | [
"import pygame, sys, math, random",
"pygame.init()",
"from Ball import Ball",
"from PlayerBall import PlayerBall",
"clock = pygame.time.Clock()",
"width = 640",
"height = 480",
"size = width, height",
"screen = pygame.display.set_mode(size)",
"bgImage = pygame.image.load(\"rsc/bg/startbg.png\")",
... |
import pygame, os, sys, math
from pygame.locals import *
pygame.init()
#From https://code.google.com/p/pong-drew-liam-nate/source/browse/Scoreboard.py
class ScoreBoard():
def __init__(self, pos = (0,0)):
self.baseimage = pygame.image.load("Resources/scoreboard.png")
self.image = self.baseimage.cop... | [
[
1,
0,
0.0217,
0.0217,
0,
0.66,
0,
87,
0,
4,
0,
0,
87,
0,
0
],
[
1,
0,
0.0435,
0.0217,
0,
0.66,
0.3333,
515,
0,
1,
0,
0,
515,
0,
0
],
[
8,
0,
0.0652,
0.0217,
0,
0.... | [
"import pygame, os, sys, math",
"from pygame.locals import *",
"pygame.init()",
"class ScoreBoard():\n def __init__(self, pos = (0,0)):\n self.baseimage = pygame.image.load(\"Resources/scoreboard.png\")\n self.image = self.baseimage.copy()\n self.rect = self.image.get_rect()\n s... |
import pygame, sys, math, random
pygame.init()
pygame.joystick.init()
joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]
for joystick in joysticks:
joystick.init()
print joystick.get_name()
from Milk import Milk
from Glass import Glass
from ScoreBoard import ScoreBoard
fro... | [
[
1,
0,
0.0078,
0.0078,
0,
0.66,
0,
87,
0,
4,
0,
0,
87,
0,
0
],
[
8,
0,
0.0234,
0.0078,
0,
0.66,
0.04,
319,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.0312,
0.0078,
0,
0.66,
... | [
"import pygame, sys, math, random",
"pygame.init()",
"pygame.joystick.init()",
"joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]",
"for joystick in joysticks:\n joystick.init()\n print(joystick.get_name())",
" joystick.init()",
" print(joystick.get_name()... |
__author__ = 'Binary_Ninja'
from tkinter import *
import tkinter.messagebox
import Board
from BoardSquare import *
class GUI(Frame):
def __init__(self, master=NONE):
Frame.__init__(self, master)
self.__init_color_dict()
self.board = Board.Board()
self.create_labels()
... | [
[
14,
0,
0.0122,
0.0122,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0366,
0.0122,
0,
0.66,
0.1667,
562,
0,
1,
0,
0,
562,
0,
0
],
[
1,
0,
0.0488,
0.0122,
0,
0... | [
"__author__ = 'Binary_Ninja'",
"from tkinter import *",
"import tkinter.messagebox",
"import Board",
"from BoardSquare import *",
"class GUI(Frame):\n def __init__(self, master=NONE):\n Frame.__init__(self, master)\n self.__init_color_dict()\n self.board = Board.Board()\n se... |
__author__ = 'Binary Ninja'
from BoardSquare import *
import random
class Board:
size = 4
def __init__(self):
self.__squares = self.__generate_board_squares()
self.__set_empty_square()
self.game_over = False
def __generate_board_squares(self):
squares = []
... | [
[
14,
0,
0.0097,
0.0097,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0194,
0.0097,
0,
0.66,
0.3333,
29,
0,
1,
0,
0,
29,
0,
0
],
[
1,
0,
0.0291,
0.0097,
0,
0.6... | [
"__author__ = 'Binary Ninja'",
"from BoardSquare import *",
"import random",
"class Board:\n size = 4\n\n def __init__(self):\n self.__squares = self.__generate_board_squares()\n self.__set_empty_square()\n self.game_over = False",
" size = 4",
" def __init__(self):\n ... |
__author__ = 'Binary Ninja'
class BoardSquare:
empty_value = -1
def __init__(self, x, y, value):
assert isinstance(value, int)
assert isinstance(x, int)
assert isinstance(y, int)
self.value = value
self.x = x
self.y = y
def get_coordinates(se... | [
[
14,
0,
0.0435,
0.0435,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.587,
0.8696,
0,
0.66,
1,
29,
0,
4,
0,
0,
0,
0,
7
],
[
14,
1,
0.2174,
0.0435,
1,
0.85,
... | [
"__author__ = 'Binary Ninja'",
"class BoardSquare:\n empty_value = -1\n\n def __init__(self, x, y, value):\n assert isinstance(value, int)\n assert isinstance(x, int)\n assert isinstance(y, int)\n self.value = value",
" empty_value = -1",
" def __init__(self, x, y, valu... |
# -*- coding: UTF-8 -*-
# MISSING-DOCSTRING: pylint: disable=C0111
"""
Based on ``behave tutorial``
Feature: Fight or Flight (Natural Language)
In order to increase the ninja survival rate, #< Business goal
As a ninja commander #< Role
I want my ninjas to decide whether to take... | [
[
8,
0,
0.129,
0.2043,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.4247,
0.2366,
0,
0.66,
0.125,
271,
0,
2,
0,
0,
186,
0,
0
],
[
8,
1,
0.3333,
0.0323,
1,
0.96,
... | [
"\"\"\"\nBased on ``behave tutorial``\n\nFeature: Fight or Flight (Natural Language)\n In order to increase the ninja survival rate, #< Business goal\n As a ninja commander #< Role\n I want my ninjas to decide whether to take on an opponent #< Benefit\n based on their ... |
"""
This is the "example" module.
The example module supplies one function, factorial(). For example,
>>> factorial(5)
120
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
If the result is small enough to fit in an int, return an int.
Else return a long.
>>> [factorial(n... | [
[
8,
0,
0.0726,
0.129,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.5484,
0.7581,
0,
0.66,
0.5,
117,
0,
1,
1,
0,
0,
0,
4
],
[
8,
1,
0.4435,
0.5161,
1,
0.42,
... | [
"\"\"\"\nThis is the \"example\" module.\n\nThe example module supplies one function, factorial(). For example,\n\n>>> factorial(5)\n120\n\"\"\"",
"def factorial(n):\n \"\"\"Return the factorial of n, an exact integer >= 0.\n\n If the result is small enough to fit in an int, return an int.\n Else return... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.