text
stringlengths
0
1.05M
meta
dict
from dbfUtils import * from struct import unpack from math import * from random import uniform, random def load_shape(shapefile): global records global record_dict record_dict = {} records = open(shapefile, mode='rb') #unpack the header header1 = unpack('>7i', records.read(28)) header2 = unpack('<2i', recor...
{ "repo_name": "stahlba2/Python-Shapefile-Reader", "path": "shpread.py", "copies": "1", "size": "26026", "license": "mit", "hash": -6025971606697499000, "line_mean": 32.0698856417, "line_max": 222, "alpha_frac": 0.6272957811, "autogenerated": false, "ratio": 2.5051496775435558, "config_test": fa...
__author__ = 'brunocatao' from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required from django.views.generic.simple import dire...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/files/views.py", "copies": "1", "size": "2219", "license": "bsd-3-clause", "hash": -2240706787319636700, "line_mean": 31.6470588235, "line_max": 102, "alpha_frac": 0.7016674178, "autogenerated": false, "ratio": 3.754653130287648, ...
__author__ = 'brunocatao' from django import forms from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from django.utils.translation import ugettext_lazy as _ from portal.messages.models import Message, Attachment class MessageForm(forms.Form): content_type ...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/messages/forms.py", "copies": "1", "size": "1919", "license": "bsd-3-clause", "hash": 212428114262167700, "line_mean": 39, "line_max": 159, "alpha_frac": 0.6399166232, "autogenerated": false, "ratio": 4.006263048016701, "config_te...
__author__ = 'brunocatao' from django import forms from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from portal.models import UserInfo class RegisterUserForm(forms.Form): email = forms.EmailField(label=_('Email'), required=True, max_length=100) passwor...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/accounts/forms.py", "copies": "1", "size": "1471", "license": "bsd-3-clause", "hash": -3688378505504465000, "line_mean": 35.8, "line_max": 132, "alpha_frac": 0.6498980286, "autogenerated": false, "ratio": 4.0974930362116995, "conf...
__author__ = 'brunocatao' from django import forms from django.utils.translation import ugettext as _ from portal.models import Institution from portal.constants import STATES_CHOICES class InstitutionForm(forms.ModelForm): name = forms.CharField(label=_('Name'), required=True, max_length=100) acrony...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/institutions/forms.py", "copies": "1", "size": "1436", "license": "bsd-3-clause", "hash": -1120634822723354100, "line_mean": 50.3214285714, "line_max": 105, "alpha_frac": 0.680362117, "autogenerated": false, "ratio": 3.8810810810810...
__author__ = 'brunocatao' from django.test import TestCase from google.appengine.ext import db from google.appengine.api import images import logging from portal.models import Picture class PictureTestCase(TestCase): PICTURE_FILE_NAME = '/Users/brunocatao/Pictures/foto.jpg' def setUp(self): logging.i...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/tests.py", "copies": "1", "size": "2328", "license": "bsd-3-clause", "hash": -5928493114983545000, "line_mean": 34.2878787879, "line_max": 88, "alpha_frac": 0.6842783505, "autogenerated": false, "ratio": 3.8543046357615895, "confi...
__author__ = 'brunocatao' import datetime from django.contrib.auth.models import User from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from django.utils.translation import ugettext as ...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/files/models.py", "copies": "1", "size": "1737", "license": "bsd-3-clause", "hash": 3967593584850374700, "line_mean": 43.5641025641, "line_max": 130, "alpha_frac": 0.7023603915, "autogenerated": false, "ratio": 3.868596881959911, ...
__author__ = 'brunocatao' import datetime from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ from django.contrib.auth.models import Use...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/updates/models.py", "copies": "1", "size": "5156", "license": "bsd-3-clause", "hash": 1362164682577250300, "line_mean": 36.6423357664, "line_max": 130, "alpha_frac": 0.5812645462, "autogenerated": false, "ratio": 4.174898785425102, ...
__author__ = 'brunocatao' import random import datetime from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ from portal.models import P...
{ "repo_name": "brunogamacatao/portalsaladeaula", "path": "portal/album/models.py", "copies": "1", "size": "3361", "license": "bsd-3-clause", "hash": 5031773764010853000, "line_mean": 39.5060240964, "line_max": 130, "alpha_frac": 0.6902707528, "autogenerated": false, "ratio": 3.742761692650334, ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" __all__ = [ "call_external", ] import Queue as queue import multiprocessing import cargo class CallProcess(multiprocessing.Process): def __init__(self, method, to_master): self._method = method self._to_master = to_master def run(...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/concurrent.py", "copies": "1", "size": "1539", "license": "mit", "hash": -3794571331515227000, "line_mean": 23.8225806452, "line_max": 66, "alpha_frac": 0.5964912281, "autogenerated": false, "ratio": 3.7813267813267815, "config_test"...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" from __future__ import absolute_import import os import sys import time import zlib import socket import signal import random import traceback import subprocess import collections import multiprocessing import cPickle as pickle import numpy import cargo logger = ...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/labor2.py", "copies": "1", "size": "13097", "license": "mit", "hash": 181364940394797380, "line_mean": 26.3423799582, "line_max": 100, "alpha_frac": 0.5674581965, "autogenerated": false, "ratio": 4.331018518518518, "config_test": fal...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" from __future__ import absolute_import import plac import os.path import imp import uuid import borg.log logger = borg.log.get_logger(__name__, default_level = "INFO") named_domains = {} def do(*args, **kwargs): import condor return condor.do(*args, **k...
{ "repo_name": "borg-project/borg", "path": "borg/__init__.py", "copies": "1", "size": "2668", "license": "mit", "hash": -6010911084151923000, "line_mean": 21.8034188034, "line_max": 75, "alpha_frac": 0.6604197901, "autogenerated": false, "ratio": 3.6348773841961854, "config_test": false, "has...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import contextlib import borg from . import instance from . import solvers from . import features from . import test logger = borg.get_logger(__name__, default_level = "INFO") class MAX_SAT_Task(object): def __init__(self, path): self.path = path ...
{ "repo_name": "borg-project/borg", "path": "borg/domains/max_sat/__init__.py", "copies": "1", "size": "1359", "license": "mit", "hash": -3087217322101146600, "line_mean": 21.2786885246, "line_max": 58, "alpha_frac": 0.5783664459, "autogenerated": false, "ratio": 3.7960893854748603, "config_test...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import contextlib import numpy import borg logger = borg.get_logger(__name__, default_level = "DETAIL") class FakeSolverProcess(object): """Provide a solver interface to stored run data.""" def __init__(self, run): """Initialize.""" self...
{ "repo_name": "borg-project/borg", "path": "borg/fake.py", "copies": "1", "size": "3592", "license": "mit", "hash": 306313750521106100, "line_mean": 23.9444444444, "line_max": 105, "alpha_frac": 0.5815701559, "autogenerated": false, "ratio": 4.091116173120729, "config_test": false, "has_no_ke...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import cStringIO as StringIO import nose import nose.tools import borg input_text_plain = \ """* foo!@#$ -1 x1 +23 x2 = +0; -1 x1 +23 x2 >= -0; -1 x1 +23 x2 >= -1; * foo!@#$ +1 x1 >= 42 ; * foo!@#$ * foo!@#$ """ input_text_nlc = \ """* foo!@#$ -1 x1 x2 +23 x2...
{ "repo_name": "borg-project/borg", "path": "borg/domains/pb/test/test_opb.py", "copies": "1", "size": "2191", "license": "mit", "hash": -5614035782577130000, "line_mean": 27.8289473684, "line_max": 75, "alpha_frac": 0.5600182565, "autogenerated": false, "ratio": 2.5655737704918034, "config_test...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import csv import itertools import numpy import condor import borg logger = borg.get_logger(__name__, default_level = "INFO") def run_experiment(run_data, planner_name, B): if planner_name == "knapsack": planner = borg.planners.KnapsackPlanner() e...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/solved_vs_b.py", "copies": "1", "size": "2358", "license": "mit", "hash": 7348667106510926000, "line_mean": 33.1739130435, "line_max": 95, "alpha_frac": 0.6217133164, "autogenerated": false, "ratio": 3.3637660485021397, "config_test":...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import csv import itertools import numpy import sklearn import condor import borg logger = borg.get_logger(__name__, default_level = "INFO") def evaluate_features(model, testing, feature_names): # use features if len(feature_names) > 0: # train th...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/ll_vs_features.py", "copies": "1", "size": "3462", "license": "mit", "hash": -2297985817542835500, "line_mean": 37.043956044, "line_max": 108, "alpha_frac": 0.6013864818, "autogenerated": false, "ratio": 3.934090909090909, "config_tes...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import csv import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") def plan_to_start_end(category, planner_name, solver_names, plan): t = 0 for (s, d) in plan: yield map(str, [category, planner_name, solver_names[s], t...
{ "repo_name": "borg-project/borg", "path": "borg/tools/plan.py", "copies": "1", "size": "3363", "license": "mit", "hash": -2255981617776169500, "line_mean": 31.0285714286, "line_max": 90, "alpha_frac": 0.5783526613, "autogenerated": false, "ratio": 3.319842053307009, "config_test": false, "ha...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import itertools import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") class RandomPortfolio(object): """Random portfolio.""" def __call__(self, task, suite, budget): """Run the portfolio.""" solvers = suite...
{ "repo_name": "borg-project/borg", "path": "borg/portfolios.py", "copies": "1", "size": "7542", "license": "mit", "hash": 5398657686775485000, "line_mean": 33.5963302752, "line_max": 136, "alpha_frac": 0.5604614161, "autogenerated": false, "ratio": 3.9383812010443866, "config_test": false, "h...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import numpy import sklearn.svm import sklearn.pipeline import sklearn.linear_model import sklearn.decomposition import sklearn.kernel_approximation import borg logger = borg.get_logger(__name__, default_level = "INFO") class MultiClassifier(object): def __in...
{ "repo_name": "borg-project/borg", "path": "borg/regression.py", "copies": "1", "size": "4929", "license": "mit", "hash": 5764227892007821000, "line_mean": 30.3949044586, "line_max": 104, "alpha_frac": 0.5719212822, "autogenerated": false, "ratio": 3.6484085862324203, "config_test": false, "h...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import json import tempfile import contextlib import borg logger = borg.get_logger(__name__) def parse_clasp_json_output(stdout): """Parse the output from clasp.""" try: output = json.loads(stdout) except ValueError: return ...
{ "repo_name": "borg-project/borg", "path": "borg/domains/asp/solvers.py", "copies": "1", "size": "3716", "license": "mit", "hash": 7917138542038157000, "line_mean": 28.4920634921, "line_max": 99, "alpha_frac": 0.5503229279, "autogenerated": false, "ratio": 3.8789144050104385, "config_test": fal...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import os.path import csv import borg logger = borg.get_logger(__name__, default_level = "INFO") @borg.annotations( bundle_path = ("path to new bundle",), root_path = ("instances root directory",), runs_extension = ("runs files extension",),...
{ "repo_name": "borg-project/borg", "path": "borg/tools/bundle_run_data.py", "copies": "1", "size": "2756", "license": "mit", "hash": -2323594235230234000, "line_mean": 31.8095238095, "line_max": 97, "alpha_frac": 0.5845428157, "autogenerated": false, "ratio": 3.7142857142857144, "config_test": ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import os.path import tempfile import contextlib import borg from . import instance from . import solvers from . import features from . import test logger = borg.get_logger(__name__, default_level = "INFO") class PseudoBooleanTask(object): """A pse...
{ "repo_name": "borg-project/borg", "path": "borg/domains/pb/__init__.py", "copies": "1", "size": "3514", "license": "mit", "hash": 4327076310073746000, "line_mean": 28.5294117647, "line_max": 110, "alpha_frac": 0.594479226, "autogenerated": false, "ratio": 3.811279826464208, "config_test": fals...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import pty import subprocess import borg log = borg.get_logger(__name__) def _child_preexec(environment): """Run in the child code prior to execution.""" # update the environment for (key, value) in environment.iteritems(): os.puten...
{ "repo_name": "borg-project/borg", "path": "borg/unix/sessions.py", "copies": "1", "size": "2375", "license": "mit", "hash": 2704219688012391000, "line_mean": 25.3888888889, "line_max": 82, "alpha_frac": 0.5608421053, "autogenerated": false, "ratio": 3.9451827242524917, "config_test": false, ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import pty import sys import functools import subprocess from cargo.log import get_logger from cargo.unix.proc import ProcessStat from cargo.errors import Raised log = get_logger(__name__) def _child_preexec(environment): """ Run in th...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/unix/sessions.py", "copies": "1", "size": "2445", "license": "mit", "hash": 8399013479811368000, "line_mean": 24.7368421053, "line_max": 82, "alpha_frac": 0.5676891616, "autogenerated": false, "ratio": 3.9563106796116503, "config_tes...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import re import datetime class ProcFileParseError(RuntimeError): """A file in /proc could not be parsed.""" class ProcessStat(object): """ Information about a specific process. Merely a crude wrapper around the information in the /proc...
{ "repo_name": "borg-project/borg", "path": "borg/unix/proc.py", "copies": "1", "size": "8351", "license": "mit", "hash": -6076569407519470000, "line_mean": 48.1235294118, "line_max": 94, "alpha_frac": 0.5462818824, "autogenerated": false, "ratio": 3.612024221453287, "config_test": false, "has...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import re import tempfile import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") def parse_competition(stdout): """Parse output from a standard competition solver.""" match = re.search(r"^s +([a-zA-Z ]+) *\r?$", std...
{ "repo_name": "borg-project/borg", "path": "borg/domains/pb/solvers.py", "copies": "1", "size": "7636", "license": "mit", "hash": 3490355400830166000, "line_mean": 32.0562770563, "line_max": 105, "alpha_frac": 0.5449188057, "autogenerated": false, "ratio": 3.512419503219871, "config_test": fals...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import signal import multiprocessing import condor logger = condor.log.get_logger(__name__) class LocalWorkerProcess(multiprocessing.Process): """Work in a subprocess.""" def __init__(self, stm_queue): """Initialize.""" multipr...
{ "repo_name": "borg-project/utcondor", "path": "condor/managers/parallel.py", "copies": "1", "size": "3455", "license": "mit", "hash": -292769262950733400, "line_mean": 28.5299145299, "line_max": 104, "alpha_frac": 0.5496382055, "autogenerated": false, "ratio": 4.5520421607378125, "config_test"...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import socket import condor class Message(object): """Message from a worker.""" def __init__(self, sender): self.sender = sender self.host = socket.gethostname() self.pid = os.getpid() def make_summary(self, text): ...
{ "repo_name": "borg-project/utcondor", "path": "condor/messages.py", "copies": "1", "size": "2326", "license": "mit", "hash": -1273110466965169000, "line_mean": 25.7356321839, "line_max": 95, "alpha_frac": 0.5915735168, "autogenerated": false, "ratio": 3.7335473515248796, "config_test": false, ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import borg logger = borg.get_logger(__name__, default_level = "INFO") @borg.annotations( suite_path = ("path to the solvers suite", "positional", None, os.path.abspath), solver_name = ("name of solver to run", "positional"), instance_p...
{ "repo_name": "borg-project/borg", "path": "borg/tools/run_for_paramils.py", "copies": "1", "size": "1609", "license": "mit", "hash": -5852073763036611000, "line_mean": 28.7962962963, "line_max": 89, "alpha_frac": 0.6041019267, "autogenerated": false, "ratio": 3.4527896995708156, "config_test":...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import bz2 import sys import pwd import gzip import shutil import tempfile import json import traceback import contextlib import subprocess import numpy def files_under(path, extensions = None): """Iterate over paths in the specified directory t...
{ "repo_name": "borg-project/borg", "path": "borg/util.py", "copies": "1", "size": "5302", "license": "mit", "hash": -5290050649040553000, "line_mean": 24.1279620853, "line_max": 95, "alpha_frac": 0.5976989815, "autogenerated": false, "ratio": 4.094208494208495, "config_test": false, "has_no_k...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import cStringIO as StringIO import nose.tools import borg def path_to(name): return os.path.join(os.path.dirname(__file__), name) def test_cnf_parse_simple(): """Test simple CNF input.""" with open(path_to("example.simple.cnf")) as cn...
{ "repo_name": "borg-project/borg", "path": "borg/domains/sat/test/test_instance.py", "copies": "1", "size": "1060", "license": "mit", "hash": 2714098951448984600, "line_mean": 25.5, "line_max": 77, "alpha_frac": 0.6509433962, "autogenerated": false, "ratio": 3.0547550432276656, "config_test": f...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import copy import numpy import condor import borg logger = borg.get_logger(__name__, default_level = "INFO") def infer_distributions(run_data, model_name, instance, exclude): """Compute model predictions on every instance.""" #...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/apply_models.py", "copies": "1", "size": "2899", "license": "mit", "hash": 3924936828884834000, "line_mean": 32.7093023256, "line_max": 93, "alpha_frac": 0.5998620214, "autogenerated": false, "ratio": 3.614713216957606, "config_test":...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import itertools import collections import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") class RunRecord(object): """Record of a solver run.""" def __init__(self, solver, budget, cost, success): ...
{ "repo_name": "borg-project/borg", "path": "borg/storage.py", "copies": "1", "size": "13946", "license": "mit", "hash": 7673057979373106000, "line_mean": 29.0560344828, "line_max": 93, "alpha_frac": 0.5539222716, "autogenerated": false, "ratio": 3.961931818181818, "config_test": false, "has_n...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") @borg.annotations( out_root = ("results output path"), bundle = ("path to pre-recorded runs", "positional", None, os.path.abspath), ) def mai...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/latent_classes.py", "copies": "1", "size": "2156", "license": "mit", "hash": 6005821073727157000, "line_mean": 27.7466666667, "line_max": 81, "alpha_frac": 0.6108534323, "autogenerated": false, "ratio": 3.389937106918239, "config_test...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import numpy import sklearn import condor import borg import borg.experiments.simulate_runs logger = borg.get_logger(__name__, default_level = "INFO") def simulate_run(run, maker, all_data, train_mask, test_mask, instances, independent, ...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/simulate_iid.py", "copies": "1", "size": "4571", "license": "mit", "hash": 6725562996317923000, "line_mean": 32.6102941176, "line_max": 124, "alpha_frac": 0.5491139794, "autogenerated": false, "ratio": 3.900170648464164, "config_test"...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import uuid import numpy import sklearn import condor import borg logger = borg.get_logger(__name__, default_level = "INFO") def evaluate_split(run_data, alpha, split, train_mask, test_mask): """Evaluate a model on a train/test split...
{ "repo_name": "borg-project/borg", "path": "borg/experiments/mul_over_alpha.py", "copies": "1", "size": "1991", "license": "mit", "hash": -2289466634146313500, "line_mean": 30.6031746032, "line_max": 87, "alpha_frac": 0.6228026118, "autogenerated": false, "ratio": 3.4686411149825784, "config_te...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import socket import condor logger = condor.log.get_logger(__name__, default_level = "INFO") class DistributedManager(object): """Manage remotely-distributed work.""" def __init__(self, tasks, workers): """Initialize.""" s...
{ "repo_name": "borg-project/utcondor", "path": "condor/managers/distributed.py", "copies": "1", "size": "2430", "license": "mit", "hash": -8957896402820144000, "line_mean": 26.3033707865, "line_max": 100, "alpha_frac": 0.566255144, "autogenerated": false, "ratio": 4.016528925619835, "config_tes...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import sys import csv import zlib import base64 import cPickle as pickle import numpy import borg import borg.distributors logger = borg.get_logger(__name__, default_level = "INFO") def run_solver_on(suite_path, solver_name, task_path, budget, sto...
{ "repo_name": "borg-project/borg", "path": "borg/tools/run_solvers.py", "copies": "1", "size": "4217", "license": "mit", "hash": 2119797261524817400, "line_mean": 29.1214285714, "line_max": 107, "alpha_frac": 0.5926013754, "autogenerated": false, "ratio": 3.699122807017544, "config_test": false...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import tempfile import resource import subprocess import borg logger = borg.get_logger(__name__, default_level = "INFO") def normalized_claspre_names(raw_names): """Convert names from claspre to "absolute" names.""" parent = None names...
{ "repo_name": "borg-project/borg", "path": "borg/domains/asp/features.py", "copies": "1", "size": "4121", "license": "mit", "hash": -2385762256279919000, "line_mean": 29.984962406, "line_max": 98, "alpha_frac": 0.6115020626, "autogenerated": false, "ratio": 3.2862838915470496, "config_test": fa...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import uuid import subprocess import condor import borg logger = borg.get_logger(__name__, default_level = "DEBUG") def ground_instance(asp_path, gringo_path, domain_path, ignore_errors, compat): """Ground an ASP instance using Gringo.""" ...
{ "repo_name": "borg-project/borg", "path": "borg/tools/ground.py", "copies": "1", "size": "3329", "license": "mit", "hash": 6305234570006554000, "line_mean": 29.5412844037, "line_max": 96, "alpha_frac": 0.5719435266, "autogenerated": false, "ratio": 3.5264830508474576, "config_test": false, "...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import uuid import time import shutil import signal import select import random import tempfile import datetime import multiprocessing import numpy import borg logger = borg.get_logger(__name__, default_level = "INFO") def random_seed(): """Ret...
{ "repo_name": "borg-project/borg", "path": "borg/solver_io.py", "copies": "1", "size": "7800", "license": "mit", "hash": -7232422010866268000, "line_mean": 26.4647887324, "line_max": 101, "alpha_frac": 0.5553846154, "autogenerated": false, "ratio": 4.109589041095891, "config_test": false, "ha...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac import condor.work if __name__ == "__main__": plac.call(condor.work.main) import sys import imp import traceback import zmq import condor logger = condor.log.get_logger(__name__, default_level = "NOTSET") def work_once(condor_id, req_socket, tas...
{ "repo_name": "borg-project/utcondor", "path": "condor/work.py", "copies": "1", "size": "3413", "license": "mit", "hash": 712505623287191200, "line_mean": 25.0534351145, "line_max": 77, "alpha_frac": 0.6120714914, "autogenerated": false, "ratio": 3.7505494505494505, "config_test": false, "has...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac import cPickle as pickle import borg logger = borg.get_logger(__name__, default_level = "INFO") @plac.annotations( out_path = ("path to store solver"), portfolio_name = ("name of the portfolio to train"), solvers_path = ("path to the solve...
{ "repo_name": "borg-project/borg", "path": "borg/tools/train.py", "copies": "1", "size": "1151", "license": "mit", "hash": 7766794975929679000, "line_mean": 29.2894736842, "line_max": 96, "alpha_frac": 0.6629018245, "autogenerated": false, "ratio": 3.2792022792022792, "config_test": false, "h...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac import sys import logging import cPickle as pickle import borg logger = borg.get_logger(__name__, default_level = "INFO") class CompetitionFormatter(logging.Formatter): """A concise log formatter for output during competition.""" def __init__...
{ "repo_name": "borg-project/borg", "path": "borg/tools/solve.py", "copies": "1", "size": "2758", "license": "mit", "hash": 8659637850224930000, "line_mean": 26.3069306931, "line_max": 87, "alpha_frac": 0.6069615664, "autogenerated": false, "ratio": 3.6289473684210525, "config_test": false, "h...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac if __name__ == "__main__": from borg_explorer.tools.view_fit import main plac.call(main) import os.path import json import cPickle as pickle import tarfile import cStringIO as StringIO import numpy import rpy2.robjects import rpy2.robjects.pa...
{ "repo_name": "borg-project/borg-explorer", "path": "src/python/borg_explorer/tools/view_fit.py", "copies": "1", "size": "5498", "license": "mit", "hash": -4274125806278486500, "line_mean": 29.5444444444, "line_max": 116, "alpha_frac": 0.5383775919, "autogenerated": false, "ratio": 3.802213001383...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac if __name__ == "__main__": from borg_explorer.tools.view_write import main plac.call(main) import os.path import csv import json import cPickle as pickle import distutils.dir_util import numpy import jinja2 import cargo import borg import bor...
{ "repo_name": "borg-project/borg-explorer", "path": "src/python/borg_explorer/tools/view_write.py", "copies": "1", "size": "3699", "license": "mit", "hash": 12901482045695892, "line_mean": 30.6153846154, "line_max": 89, "alpha_frac": 0.6526088132, "autogenerated": false, "ratio": 3.31748878923766...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac if __name__ == "__main__": from borg.tools.armada import main plac.call(main) import sys import random import logging import cPickle as pickle import numpy import cargo import borg logger = cargo.get_logger(__name__, default_level = "INFO") ...
{ "repo_name": "borg-project/borg", "path": "borg/tools/armada.py", "copies": "1", "size": "1148", "license": "mit", "hash": -3209167832984324600, "line_mean": 25.0909090909, "line_max": 81, "alpha_frac": 0.631533101, "autogenerated": false, "ratio": 3.162534435261708, "config_test": false, "h...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac if __name__ == "__main__": from cargo.tools.labor.work2 import main plac.call(main) import numpy import random import traceback import zmq import cargo logger = cargo.get_logger(__name__, level = "NOTSET") def work_once(condor_id, req_socke...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/tools/labor/work2.py", "copies": "1", "size": "2831", "license": "mit", "hash": 5725056930277920000, "line_mean": 22.3966942149, "line_max": 74, "alpha_frac": 0.5990815966, "autogenerated": false, "ratio": 3.6718547341115433, "config...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import plac if __name__ == "__main__": from cargo.tools.triggered import main plac.call(main) import subprocess import pyinotify import cargo logger = cargo.get_logger(__name__, level = "NOTSET") class TriggerHandler(pyinotify.ProcessEvent): """ ...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/tools/triggered.py", "copies": "1", "size": "2975", "license": "mit", "hash": 8037923821020988000, "line_mean": 26.8037383178, "line_max": 101, "alpha_frac": 0.5613445378, "autogenerated": false, "ratio": 4.075342465753424, "config_t...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import random import cPickle as pickle import condor from . import log logger = condor.log.get_logger(__name__, level = "INFO") from . import defaults from . import raw from . import cache from . import managers from . import messages try: import snappy exc...
{ "repo_name": "borg-project/utcondor", "path": "condor/__init__.py", "copies": "1", "size": "1962", "license": "mit", "hash": 7856821494570038000, "line_mean": 24.8157894737, "line_max": 101, "alpha_frac": 0.6712538226, "autogenerated": false, "ratio": 3.908366533864542, "config_test": false, ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import re import borg logger = borg.get_logger(__name__) def parse_sat_output(stdout): """Parse a solver's standard competition-format output.""" match = re.search(r"^s +(.+)$", stdout, re.M) if match: (answer_type,) = map(str.upper, match.g...
{ "repo_name": "borg-project/borg", "path": "borg/domains/sat/solvers.py", "copies": "1", "size": "1254", "license": "mit", "hash": -3326308309528993300, "line_mean": 25.125, "line_max": 69, "alpha_frac": 0.5183413078, "autogenerated": false, "ratio": 3.710059171597633, "config_test": false, "...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import re import os import os.path import sys import pipes import datetime import cStringIO as StringIO import subprocess import condor logger = condor.log.get_logger(__name__, level = "INFO") def call_capturing(arguments, input = None, preexec_fn = None): ""...
{ "repo_name": "borg-project/utcondor", "path": "condor/raw.py", "copies": "1", "size": "8568", "license": "mit", "hash": 8850002276834373000, "line_mean": 25.1219512195, "line_max": 95, "alpha_frac": 0.5704948646, "autogenerated": false, "ratio": 3.9814126394052045, "config_test": false, "has...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import re import os import os.path import sys import time import datetime import subprocess import cargo import cStringIO as StringIO logger = cargo.get_logger(__name__, level = "INFO") class CondorSubmission(object): """Stream output to a Condor submission f...
{ "repo_name": "borg-project/cargo", "path": "src/python/cargo/condor.py", "copies": "1", "size": "6173", "license": "mit", "hash": -2925866236527615000, "line_mean": 25.156779661, "line_max": 97, "alpha_frac": 0.56423133, "autogenerated": false, "ratio": 3.848503740648379, "config_test": false,...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import re import os.path import borg logger = borg.get_logger(__name__) def parse_max_sat_competition(stdout): """Parse output from a standard competition solver.""" optima = map(int, re.findall(r"^o +([0-9]+) *\r?$", stdout, re.M)) if len(optima) >...
{ "repo_name": "borg-project/borg", "path": "borg/domains/max_sat/solvers.py", "copies": "1", "size": "2888", "license": "mit", "hash": 1393598621557451800, "line_mean": 27.88, "line_max": 85, "alpha_frac": 0.5162742382, "autogenerated": false, "ratio": 3.6883780332056193, "config_test": false, ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import sys import time import random import collections import condor logger = condor.log.get_logger(__name__, default_level = "INFO") from .distributed import DistributedManager from .parallel import ParallelManager from .serial import SerialManager from .http_s...
{ "repo_name": "borg-project/utcondor", "path": "condor/managers/__init__.py", "copies": "1", "size": "5445", "license": "mit", "hash": -4141308458064184300, "line_mean": 25.432038835, "line_max": 77, "alpha_frac": 0.5687786961, "autogenerated": false, "ratio": 4.247269890795632, "config_test": ...
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import time import operator import resource import contextlib import borg class Cost(object): """Resources.""" def __init__(self, cpu_seconds = None, wall_seconds = None): self.cpu_seconds = None if cpu_seconds is None else float(cpu_seconds) ...
{ "repo_name": "borg-project/borg", "path": "borg/expenses.py", "copies": "1", "size": "3847", "license": "mit", "hash": -7306897675532324000, "line_mean": 25.7152777778, "line_max": 114, "alpha_frac": 0.5812321289, "autogenerated": false, "ratio": 3.7901477832512316, "config_test": false, "ha...
__author__ = 'brycedcarter' filename = "sampleData/data_test.dat" packetStream = [] # this will contain the final list of packet objects # this is the preamble and address that should be used for matching a valid packet preambleAndAddress = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0,...
{ "repo_name": "ProjectKarman/comm-sys-protocol-implementation", "path": "bitStreamProcssor.py", "copies": "1", "size": "3471", "license": "mit", "hash": -1261023049258103000, "line_mean": 43.5, "line_max": 208, "alpha_frac": 0.6277729761, "autogenerated": false, "ratio": 4.022016222479722, "con...
__author__ = 'bs' # Debugging parameters WRITE_LEFT_IMAGE = True WRITE_LOCATION = "/home/bs/Desktop/out.jpg" # Input video INPUT_VIDEOS = '/home/bs/itu/graphics_and_image_analysis_SIGB/code/Stereo-Vision-System/bergar/Videos/' VIDEO_LEFT_1 = INPUT_VIDEOS + "cameraLeft.mov" VIDEO_...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Stereo-Vision-System/bergar/com.simonsen.stereovision/Settings/Constant.py", "copies": "1", "size": "1753", "license": "apache-2.0", "hash": -3348677096725438500, "line_mean": 46.3783783784, "line_max": 127, "alpha_frac": 0.5698802054, "...
__author__ = 'bs' from SIGBTools import * from Tracker import * import numpy as np import cv as cv # ----------------------------- # Global variables # ----------------------------- files = [ "eye1.avi", "eye2.avi", "eye3.avi", "eye4.avi", "eye5.avi", "eye6.avi", "eye7.avi", "eye8.avi...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Eye-Tracking-System/bergar/com.bergar.simonsen.eyetracker/Main.py", "copies": "1", "size": "7998", "license": "apache-2.0", "hash": 8514558339414949000, "line_mean": 31.7827868852, "line_max": 147, "alpha_frac": 0.6029007252, "autogenera...
__author__ = 'bs' import cv2 from matplotlib import * from tools import IO import numpy as np from matplotlib.pyplot import * from config.Const import * from tools import Utils from tools import Calc import personMapLocation as pml import textureMapping as tm def texturemapObjectSequence(): """ Poor implementati...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/main.py", "copies": "1", "size": "2384", "license": "apache-2.0", "hash": -2883631979372783600, "line_mean": 22.1553398058, "line_max": 78, "alpha_frac": 0.5952181208, "autogenera...
__author__ = 'bs' import cv2 from matplotlib.pyplot import * from tools import Utils from tools import IO from tools import Calc from config.Const import * from pylab import * def showFloorTrackingData(): #Load videodata map = cv2.imread(ITU_MAP) fn = GROUND_FLOOR_VIDEO cap = cv2.VideoCapture(fn) ...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/personMapLocation.py", "copies": "1", "size": "2759", "license": "apache-2.0", "hash": -7008032015193684000, "line_mean": 28.3617021277, "line_max": 140, "alpha_frac": 0.5871692642,...
__author__ = 'bs' import cv2 from SIGBTools import * import pylab import numpy as np import sys from scipy.cluster.vq import * from scipy.misc import imresize from matplotlib.pyplot import * from matplotlib import pyplot as plt from Filter import * def FilterPupilGlint(pupils,glints): ''' Given a list of pupil ca...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Eye-Tracking-System/bergar/com.bergar.simonsen.eyetracker/Tracker.py", "copies": "1", "size": "8907", "license": "apache-2.0", "hash": -2601893713989755000, "line_mean": 35.805785124, "line_max": 145, "alpha_frac": 0.6165936904, "autogen...
__author__ = 'bs' import cv2 import numpy as np from config.Const import * from tools import Utils from matplotlib.pyplot import figure def simpleTextureMap(): I1 = cv2.imread(ITU_LOGO) I2 = cv2.imread(ITU_MAP) #Print Help H,Points = Utils.getHomographyFromMouse(I1,I2,4) h, w,d = I2.shape o...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/textureMapping.py", "copies": "1", "size": "2441", "license": "apache-2.0", "hash": 8030232565652007000, "line_mean": 25.2580645161, "line_max": 94, "alpha_frac": 0.589922163, "au...
__author__ = 'bs' import cv2 import numpy as np import pylab from pylab import * import matplotlib as mpl import math from scipy import linalg import os.path ''' This module contains sets of functions useful for basic image analysis and should be useful in the SIGB course. Written and Assembled (2012,2013) by Dan Wi...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/tools/Utils.py", "copies": "1", "size": "25106", "license": "apache-2.0", "hash": -7882189912306916000, "line_mean": 31.5207253886, "line_max": 162, "alpha_frac": 0.5548872779, "a...
__author__ = 'bs' import cv2 import numpy as np import pylab from pylab import * import matplotlib as mpl import math ''' This module contains sets of functions useful for basic image analysis and should be useful in the SIGB course. Written and Assembled (2012,2013) by Dan Witzner Hansen, IT University. ''' def ge...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Eye-Tracking-System/bergar/com.bergar.simonsen.eyetracker/SIGBTools.py", "copies": "1", "size": "17102", "license": "apache-2.0", "hash": -3763092544119162000, "line_mean": 33.9020408163, "line_max": 162, "alpha_frac": 0.5687054146, "aut...
__author__ = 'bs' import numpy as np from tools import Utils import cv2 from tools.Utils import Camera def calibrationExample(): camNum =0 # The number of the camera to calibrate nPoints = 5 # number of images used for the calibration (space presses) patternSize=(9,6) #size of the calib...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/tools/calibrationExample.py", "copies": "1", "size": "1340", "license": "apache-2.0", "hash": 7650915450502721000, "line_mean": 34.2631578947, "line_max": 106, "alpha_frac": 0.62313...
__author__ = 'bs' import numpy as np import cv2 def getRectangleLowerCenter(pt1, pt2): deltax = abs(pt2[0] - pt1[0]) centerx = pt1[0] + deltax / 2 return centerx, pt2[1] def angle_cos(p0, p1, p2): d1, d2 = p0-p1, p2-p1 return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) ) def ...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/tools/Calc.py", "copies": "1", "size": "1640", "license": "apache-2.0", "hash": -8069965697174358000, "line_mean": 33.1875, "line_max": 122, "alpha_frac": 0.6036585366, "autogener...
__author__ = 'bs' # Sequence & image files PREFIX = "../" BOOK = PREFIX + "BOOK/" GRID_VIDEOS = PREFIX + "GridVideos/" GROUND_FLOOR_DATA = PREFIX + "GroundFloorData/" IMAGES = PREFIX + "Images/" # Book files BOOK_1 = BOOK + "Seq1_scene.mp4" BOOK_2 ...
{ "repo_name": "tonybeltramelli/Graphics-And-Vision", "path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/config/Const.py", "copies": "1", "size": "1525", "license": "apache-2.0", "hash": 5504885270041008000, "line_mean": 28.3269230769, "line_max": 60, "alpha_frac": 0.5436065574, "aut...
__author__ = 'bsoer' from crypto.algorithms.algorithminterface import AlgorithmInterface from tools.argparcer import ArgParcer import tools.rsatools as RSATools import math import sys class PureRSA(AlgorithmInterface): n = None totient = None e = None d = None publicKey = None privateKey = N...
{ "repo_name": "bensoer/pychat", "path": "crypto/algorithms/purersa.py", "copies": "1", "size": "6730", "license": "mit", "hash": 7783865099114733000, "line_mean": 40.0365853659, "line_max": 116, "alpha_frac": 0.6494799406, "autogenerated": false, "ratio": 3.9449003516998826, "config_test": fals...
__author__ = 'buckbaskin' from graphics import * from mathiz import locate, size, dist_sort from math import sin, cos from random import uniform from visualization.NetViz import * from leap_motion.location_sim import * from leap_motion.simple_motion import * def main(): win = GraphWin("My 3D view", 1920, 1080) ...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "visualization/graphClass3D.py", "copies": "1", "size": "2122", "license": "mit", "hash": -7192740826703281000, "line_mean": 25.5375, "line_max": 120, "alpha_frac": 0.5815268615, "autogenerated": false, "ratio": 3.066473988439306, "config_test":...
__author__ = 'buckbaskin' from graphics import * from mathiz import locate, size, dist_sort from math import sin, cos from random import uniform import copy ### UTILS ### def rand_location_gen( stopper ): return uniform(-stopper/2,stopper/2) class ViewNode(object): def __init__(self, x, y, z, radius, viewer)...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "visualization/NetViz.py", "copies": "1", "size": "2382", "license": "mit", "hash": -6835856739101909000, "line_mean": 33.0428571429, "line_max": 129, "alpha_frac": 0.6015952981, "autogenerated": false, "ratio": 3.2016129032258065, "config_test"...
__author__ = 'buckbaskin' from graphics import * from mathiz import locate, size, dist_sort from math import sin, cos from random import uniform def main(): win = GraphWin("My 3D view", 1920, 1080) stopper = 8 points = [None]*50 for i in range(0,len(points),1): points[i] = tuple([uniform(-stop...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "visualization/graph3D.py", "copies": "1", "size": "2287", "license": "mit", "hash": -7222961931492593000, "line_mean": 30.7777777778, "line_max": 118, "alpha_frac": 0.6003498032, "autogenerated": false, "ratio": 2.905972045743329, "config_test"...
__author__ = 'buckbaskin' from twitter import * import os class TheTwitter(object): def __init__(self,smile_file): self.consumer_key = smile_file.readline()[:-1] self.consumer_secret = smile_file.readline() if (os.path.isfile('..\\simile2.smile'))==True: print 'use shifted fi...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "data_collection/Twitter.py", "copies": "1", "size": "3775", "license": "mit", "hash": -5018149402096177000, "line_mean": 33.962962963, "line_max": 138, "alpha_frac": 0.5864900662, "autogenerated": false, "ratio": 3.704612365063788, "config_test...
__author__ = 'buckbaskin' import os, sys, inspect, thread, time import datetime import math from math import cos, sin, tan, atan2 src_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) arch_dir = '../lib/x64' sys.path.insert(0, os.path.abspath(os.path.join(src_dir, arch_dir))) import Leap class LeapSimul...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "leap_motion/location_sim.py", "copies": "1", "size": "4719", "license": "mit", "hash": -4329353356843871700, "line_mean": 34.7575757576, "line_max": 137, "alpha_frac": 0.5308328036, "autogenerated": false, "ratio": 3.1251655629139075, "config_t...
__author__ = 'buckbaskin' import os, sys, inspect, thread, time src_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) arch_dir = '../lib/x64' sys.path.insert(0, os.path.abspath(os.path.join(src_dir, arch_dir))) import Leap class SampleListener(Leap.Listener): def on_connect(self, controller): ...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "leap_motion/simple_motion.py", "copies": "1", "size": "1140", "license": "mit", "hash": -1579335045437132500, "line_mean": 27.525, "line_max": 96, "alpha_frac": 0.6561403509, "autogenerated": false, "ratio": 3.7012987012987013, "config_test": f...
__author__ = 'buckbaskin' import time import twitter from data_collection.Twitter import TheTwitter from data_representation.Network import Network def testBFS(network, length, user_id): network.add_local_blocking(user_id, length) def testLive(network, length): network.add_stream_blocking(length) if __name...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "tests/search_test.py", "copies": "1", "size": "1062", "license": "mit", "hash": -8918694805675430000, "line_mean": 27.7027027027, "line_max": 87, "alpha_frac": 0.6563088512, "autogenerated": false, "ratio": 3.1607142857142856, "config_test": fa...
__author__ = 'buckbaskin' import twitter from data_collection.Twitter import TheTwitter import threading import os class Network(object): def __init__(self, twitter): self.nodes = dict()# list of nodes (id , Node object) self.connections = dict() # list of connections (id , connection weight)) ...
{ "repo_name": "buckbaskin/CWRUHacks2015", "path": "data_representation/Network.py", "copies": "1", "size": "6442", "license": "mit", "hash": 1426743462984351200, "line_mean": 36.6783625731, "line_max": 111, "alpha_frac": 0.5577460416, "autogenerated": false, "ratio": 3.974090067859346, "config_...
__author__ = 'buddha' from . import app import models from BeautifulSoup import BeautifulStoneSoup from pprint import pprint # import simplejson import urllib, urllib2 from flask import render_template, flash, redirect, url_for class TMError(Exception): pass @app.route('/') @app.route('/index') def index(): ...
{ "repo_name": "buddha314/mizmetroweb", "path": "app/views.py", "copies": "1", "size": "1160", "license": "apache-2.0", "hash": -4279567766473183700, "line_mean": 23.6808510638, "line_max": 60, "alpha_frac": 0.6336206897, "autogenerated": false, "ratio": 3.411764705882353, "config_test": false, ...
__author__ = 'buec' import modgrammar import sys from pyspeechgrammar import model class JavaIdentifier(modgrammar.Grammar): grammar_whitespace_mode = 'explicit' grammar = (modgrammar.WORD("A-Za-z$", "A-Za-z0-9_$")) def grammar_elem_init(self, session_data): self.value = self[0].string class ...
{ "repo_name": "ynop/pyspeechgrammar", "path": "pyspeechgrammar/jsgf/grammars.py", "copies": "1", "size": "12226", "license": "mit", "hash": -1061808625851100900, "line_mean": 32.3133514986, "line_max": 121, "alpha_frac": 0.5956976934, "autogenerated": false, "ratio": 3.9160794362588085, "config...
__author__ = 'buec' import re from pyspeechgrammar import parser from pyspeechgrammar.jsgf import grammars class JSGFParser(parser.BaseParser): def parse_string(self, data): p = grammars.Grammar.parser() # remove newlines after alternative separator (performance issue) jsgf_string = sel...
{ "repo_name": "ynop/pyspeechgrammar", "path": "pyspeechgrammar/jsgf/__init__.py", "copies": "1", "size": "1193", "license": "mit", "hash": -192487786456882700, "line_mean": 30.4210526316, "line_max": 79, "alpha_frac": 0.6253143336, "autogenerated": false, "ratio": 3.5191740412979353, "config_te...
__author__ = 'buec' import xml.etree.ElementTree as et from pyspeechgrammar import model class SRGSXMLSerializer: def create_grammar_element(self, grammar): grammar_element = et.Element('grammar') for rule in grammar.rules: rule_element = self.create_rule_element(rule) ...
{ "repo_name": "ynop/pyspeechgrammar", "path": "pyspeechgrammar/srgs_xml/serialize.py", "copies": "1", "size": "4614", "license": "mit", "hash": -5587511030674739000, "line_mean": 39.1304347826, "line_max": 105, "alpha_frac": 0.6497615951, "autogenerated": false, "ratio": 3.7000801924619084, "co...
__author__ = 'buec' class Grammar: def __init__(self, name="", language="en-US", encoding=""): self.name = name self.language = language self.encoding = encoding self.rules = [] self.root_rule = None def add_rule(self, rule): if self.contains_rule_with_name(rul...
{ "repo_name": "ynop/pyspeechgrammar", "path": "pyspeechgrammar/model.py", "copies": "1", "size": "4095", "license": "mit", "hash": 7675188225440731000, "line_mean": 30.0227272727, "line_max": 140, "alpha_frac": 0.6161172161, "autogenerated": false, "ratio": 3.6271036315323295, "config_test": fa...
__author__ = 'bug85' #!python # coding=utf-8 import os, sys, subprocess, hashlib, re, tempfile, binascii, base64 import rsa, requests import tea def fromhex(s): # Python 3: bytes.fromhex return bytes(bytearray.fromhex(s)) pubKey=rsa.PublicKey(int( 'F20CE00BAE5361F8FA3AE9CEFA495362' 'FF7DA1BA628F64A347F0A8C012BF0...
{ "repo_name": "azber/QQLib-python", "path": "qq_lib.py", "copies": "1", "size": "2572", "license": "apache-2.0", "hash": 4017790604384419000, "line_mean": 31.5696202532, "line_max": 102, "alpha_frac": 0.5754276827, "autogenerated": false, "ratio": 2.454198473282443, "config_test": false, "has...
__author__ = 'bukun@osgeo.cn' import tornado.web from pycate.model.catalog_model import MCatalog from pycate.module import imgslide_module from pycate.module import refreshinfo_module from pycate.module import showjianli_module ImgSlide = imgslide_module.ImgSlide RefreshInfo = refreshinfo_module.RefreshInfo ShowJian...
{ "repo_name": "jiaxiaolei/pycate", "path": "core/modules.py", "copies": "1", "size": "2642", "license": "mit", "hash": 33791322681051800, "line_mean": 28.4719101124, "line_max": 90, "alpha_frac": 0.6003051106, "autogenerated": false, "ratio": 3.229064039408867, "config_test": false, "has_no_k...
__author__ = 'bukun' # __all__ = ['get_uid', 'md5','get_timestamp', 'get_time_str', 'markit'] import uuid import hashlib import time def get_uid(): return( str(uuid.uuid1())) def md5(instr): # if type(instr) is bytes: m = hashlib.md5() m.update(instr.encode('utf-8')) return m.hexdig...
{ "repo_name": "jiaxiaolei/pycate", "path": "libs/tool.py", "copies": "1", "size": "2096", "license": "mit", "hash": -8400251608777745000, "line_mean": 31.5806451613, "line_max": 118, "alpha_frac": 0.5067307692, "autogenerated": false, "ratio": 3.2, "config_test": false, "has_no_keywords": fal...
__author__ = 'bukun' from torlite.model.mpost import MPost def get_dic(): out_arr = [] with open('./keywords_dic.txt') as fi: uu = fi.readlines() for u in uu: u = u.strip() if len(u) > 0: tt = u.split() out_arr.append(tt) ...
{ "repo_name": "Geoion/TorCMS", "path": "update_keywords.py", "copies": "3", "size": "1112", "license": "mit", "hash": -6203769971211191000, "line_mean": 22.6818181818, "line_max": 76, "alpha_frac": 0.4659300184, "autogenerated": false, "ratio": 2.865435356200528, "config_test": false, "has_no...
__author__ = 'bukun' import pickle class cNode(object): def __init__(self): self.children = None # The encode of word is UTF-8 # The encode of message is UTF-8 class cDfa(object): def __init__(self): # self.pklfile = 'sdaf.pkl' self.root=cNode() # The encode of w...
{ "repo_name": "jiaxiaolei/pycate", "path": "libs/dfa.py", "copies": "1", "size": "2827", "license": "mit", "hash": 7184112677823788000, "line_mean": 26.4545454545, "line_max": 74, "alpha_frac": 0.4437344693, "autogenerated": false, "ratio": 3.6727509778357237, "config_test": false, "has_no_ke...
__author__ = 'buyvich' from pprint import pprint import logging import functools import json import sqlalchemy from tornado.web import RequestHandler from weekly_training.settings import TemplateEngine, get_session from weekly_training.models import * LOG = logging.getLogger() def auth(f): @functools.wraps(...
{ "repo_name": "gh0st-dog/weekly-tng", "path": "weekly_training/handlers.py", "copies": "1", "size": "2774", "license": "mit", "hash": -2235702650978240300, "line_mean": 24.6944444444, "line_max": 73, "alpha_frac": 0.5937274694, "autogenerated": false, "ratio": 4.002886002886003, "config_test": ...
__author__ = 'bwagner' import os from ConfigParser import SafeConfigParser from ScriptLog import log, log2, closeLog, error, warning, info, debug, entry, exit, lopen, handleException try: config = SafeConfigParser() config.read( './Configuration/base.cfg' ) logFileDir = str( config.get( "base", "logDir" ) ...
{ "repo_name": "wags007/BIND_DHCP_to_dnsmasq", "path": "dhcpTodnsmasq.py", "copies": "1", "size": "4491", "license": "apache-2.0", "hash": 3655429254421607000, "line_mean": 47.8152173913, "line_max": 112, "alpha_frac": 0.5315074594, "autogenerated": false, "ratio": 4.411591355599215, "config_tes...
__author__ = 'bwagner' import sys, argparse import json #from fabric.api import * try: import requests from requests.auth import HTTPBasicAuth # if int(requests.__version__.split('.')[1]) < 12: # print "You may have to upgrade your python requests version!" except: print "Please install pytho...
{ "repo_name": "wags007/podcastMaster", "path": "AuphonicsProcessing/processHangout.py", "copies": "1", "size": "2423", "license": "apache-2.0", "hash": -3741447997403820000, "line_mean": 36.859375, "line_max": 126, "alpha_frac": 0.6108130417, "autogenerated": false, "ratio": 4.058626465661642, ...
__author__ = 'bwall' import json import os import time import ExtractHosts import base64 def create_command_to_run(pbot, output_folder=None, proxy=None): if proxy is None: proxy = "" else: proxy = "--proxy {0}".format(proxy) password = "" if 'pass' in pbot['information']: password = "-p '{0}'".format(pbot[...
{ "repo_name": "bwall/ircsnapshot", "path": "ircsnapshot/run_from_json.py", "copies": "1", "size": "1196", "license": "mit", "hash": -7179033803488863000, "line_mean": 22.4705882353, "line_max": 104, "alpha_frac": 0.6588628763, "autogenerated": false, "ratio": 2.9029126213592233, "config_test": ...
__author__ = 'bwall' import markovobfuscate.obfuscation as obf import logging import re import random if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) # Regular expression to split our training files on split_regex = r'\n' # File/book to read for training the Markov model (will be ...
{ "repo_name": "bwall/markovobfuscate", "path": "testing.py", "copies": "1", "size": "1182", "license": "mit", "hash": 2767963912356903400, "line_mean": 30.972972973, "line_max": 105, "alpha_frac": 0.641285956, "autogenerated": false, "ratio": 3.592705167173252, "config_test": false, "has_no_k...
__author__ = 'byt3smith' # # Generates a dir for carbonblack feeds # Can also stand up a SimpleHTTPServer to host the feeds # #stdlib from os import chdir, listdir, mkdir, getcwd, path import http.server import socketserver from re import sub, search from json import dump, loads from socket import gethostname #pypi fr...
{ "repo_name": "byt3smith/Forager", "path": "forager/cb_tools.py", "copies": "1", "size": "7841", "license": "mit", "hash": -5407950016755085000, "line_mean": 29.62890625, "line_max": 128, "alpha_frac": 0.544700931, "autogenerated": false, "ratio": 3.6217090069284064, "config_test": false, "ha...
__author__ = 'byt3smith' # # Generates a dir for carbonblack feeds # Can also stand up a SimpleHTTPServer to host the feeds # #stdlib from os import chdir, listdir, mkdir, getcwd, path import SimpleHTTPServer import SocketServer from re import sub, search from json import dump, loads from socket import gethostname #py...
{ "repo_name": "sberrydavis/Forager", "path": "bin/cb_tools.py", "copies": "1", "size": "7370", "license": "mit", "hash": -5996535434025156000, "line_mean": 29.2049180328, "line_max": 128, "alpha_frac": 0.5598371777, "autogenerated": false, "ratio": 3.6074400391581007, "config_test": false, "h...
__author__ = 'byt3smith' # # Purpose: Import module for pulling and formatting # all necessary intelligence feeds # from tools import * from re import search ip_addr = regex('ip') hostname = regex('domain') class FeedModules(): ## Malc0de def malc0de_update(self): iocs = gather('http://malc0...
{ "repo_name": "sberrydavis/Forager", "path": "bin/feeds.py", "copies": "1", "size": "5061", "license": "mit", "hash": -8740538772429036000, "line_mean": 31.6516129032, "line_max": 110, "alpha_frac": 0.6342620036, "autogenerated": false, "ratio": 3.050632911392405, "config_test": false, "has_n...
__author__ = 'byt3smith' # # Purpose: Import module for pulling and formatting # all necessary intelligence feeds # from .tools import * from re import search ip_addr = regex('ip') hostname = regex('domain') class FeedModules(): ## Malc0de def malc0de_update(self): iocs = gather('http://malc...
{ "repo_name": "byt3smith/Forager", "path": "forager/feeds.py", "copies": "1", "size": "5266", "license": "mit", "hash": -2307119241185062000, "line_mean": 31.5061728395, "line_max": 110, "alpha_frac": 0.6355867831, "autogenerated": false, "ratio": 3.0474537037037037, "config_test": false, "ha...
__author__ = 'byt3smith' # # Purpose: Tools for gathering IP addresses, domain names, URL's, etc.. # from time import sleep from os import chdir, path from xlrd import open_workbook, sheet import re import sys import urllib2 import pdfConverter import unicodedata from colorama import Fore, Back, Style, init init(auto...
{ "repo_name": "sberrydavis/Forager", "path": "bin/tools.py", "copies": "1", "size": "7402", "license": "mit", "hash": -6466015792744461000, "line_mean": 28.967611336, "line_max": 206, "alpha_frac": 0.4970278303, "autogenerated": false, "ratio": 3.03734099302421, "config_test": false, "has_no_...
__author__ = 'byt3smith' # # When called, will search through Intel directory for each # indicator in provided CSV or New-line formatted file. # from . import tools import sys import re import os from time import sleep def search_file(ioc): os.chdir('../') patt = tools.regex('ip') if ioc[-3:] == 'csv': ...
{ "repo_name": "byt3smith/Forager", "path": "forager/hunt.py", "copies": "1", "size": "2380", "license": "mit", "hash": -1021396705119809000, "line_mean": 23.7916666667, "line_max": 96, "alpha_frac": 0.5163865546, "autogenerated": false, "ratio": 3.689922480620155, "config_test": false, "has_n...
__author__ = 'byt3smith' # # When called, will search through Intel directory for each # indicator in provided CSV or New-line formatted file. # import tools import sys import re import os from time import sleep def search_file(ioc): os.chdir('../') patt = tools.regex('ip') if ioc[-3:] == 'csv': ...
{ "repo_name": "sberrydavis/Forager", "path": "bin/hunt.py", "copies": "1", "size": "2380", "license": "mit", "hash": -6957330248932108000, "line_mean": 23.0404040404, "line_max": 96, "alpha_frac": 0.5168067227, "autogenerated": false, "ratio": 3.707165109034268, "config_test": false, "has_no_...