text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Bohdan Mushkevych'
import time
from collections import OrderedDict
from datetime import datetime
from flow.flow_constants import STEP_NAME_START, STEP_NAME_FINISH
from flow.core.execution_context import ContextDriven, get_flow_logger, valid_context
from flow.core.step_executor import StepExecutor
from f... | {
"repo_name": "mushkevych/synergy_flow",
"path": "flow/core/flow_graph.py",
"copies": "1",
"size": "8952",
"license": "bsd-3-clause",
"hash": 7261558684651905000,
"line_mean": 37.0936170213,
"line_max": 111,
"alpha_frac": 0.6079088472,
"autogenerated": false,
"ratio": 4.083941605839416,
"config... |
__author__ = 'Bohdan Mushkevych'
import time
from flow.core.abstract_action import AbstractAction
class SleepAction(AbstractAction):
def __init__(self, seconds):
super(SleepAction, self).__init__('Sleep Action')
self.seconds = seconds
def run(self, execution_cluster):
time.sleep(self... | {
"repo_name": "mushkevych/synergy_flow",
"path": "flow/core/simple_actions.py",
"copies": "1",
"size": "2455",
"license": "bsd-3-clause",
"hash": 1915457286382317300,
"line_mean": 32.6301369863,
"line_max": 83,
"alpha_frac": 0.6476578411,
"autogenerated": false,
"ratio": 4.078073089700997,
"con... |
__author__ = 'Bohdan Mushkevych'
import time
import datetime
import unittest
from db.model.raw_data import RawData
class TestRawData(unittest.TestCase):
def setUp(self):
self.obj = RawData()
def tearDown(self):
del self.obj
def test_key(self):
domain_name = 'test_name'
t... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_raw_data.py",
"copies": "1",
"size": "1719",
"license": "bsd-3-clause",
"hash": -7735843768557255000,
"line_mean": 25.4461538462,
"line_max": 76,
"alpha_frac": 0.5828970332,
"autogenerated": false,
"ratio": 3.403960396039604,
"config_te... |
__author__ = 'Bohdan Mushkevych'
import time
import googleapiclient.discovery
from flow.core.abstract_cluster import AbstractCluster, ClusterError
from flow.core.gcp_filesystem import GcpFilesystem
from flow.core.gcp_credentials import gcp_credentials
# `https://cloud.google.com/dataproc/docs/reference/rest/v1/proje... | {
"repo_name": "mushkevych/synergy_flow",
"path": "flow/core/gcp_cluster.py",
"copies": "1",
"size": "8523",
"license": "bsd-3-clause",
"hash": -7292146590968090000,
"line_mean": 39.3933649289,
"line_max": 115,
"alpha_frac": 0.5750322656,
"autogenerated": false,
"ratio": 4.029787234042553,
"conf... |
__author__ = 'Bohdan Mushkevych'
import time
import os
import psutil
from synergy.system.repeat_timer import RepeatTimer
from synergy.conf import settings
class FootprintCalculator(object):
def __init__(self):
self.pid = os.getpid()
def group(self, number):
""" method formats number and in... | {
"repo_name": "eggsandbeer/scheduler",
"path": "synergy/system/performance_tracker.py",
"copies": "1",
"size": "6404",
"license": "bsd-3-clause",
"hash": -1617929295930537700,
"line_mean": 29.7884615385,
"line_max": 109,
"alpha_frac": 0.5993129294,
"autogenerated": false,
"ratio": 3.5264317180616... |
__author__ = 'Bohdan Mushkevych'
import time
import os
import psutil
from system.repeat_timer import RepeatTimer
from settings import settings
class FootprintCalculator(object):
def __init__(self):
self.pid = os.getpid()
@property
def document(self):
ps = psutil.Process(self.pid)
... | {
"repo_name": "mushkevych/launch.py",
"path": "system/performance_tracker.py",
"copies": "1",
"size": "4223",
"license": "bsd-3-clause",
"hash": -8386667933597576000,
"line_mean": 29.381294964,
"line_max": 109,
"alpha_frac": 0.6017049491,
"autogenerated": false,
"ratio": 3.5133111480865225,
"co... |
__author__ = 'Bohdan Mushkevych'
import time
import unittest
from datetime import datetime
from system import repeat_timer
class TestRepeatTimer(unittest.TestCase):
INTERVAL = 3
def make_method_yes(self, initial_multiplication=1):
# the only way to implement nonlocal closure variables in Python 2.X... | {
"repo_name": "mushkevych/launch.py",
"path": "tests/test_repeat_timer.py",
"copies": "1",
"size": "2777",
"license": "bsd-3-clause",
"hash": 7291716159054760000,
"line_mean": 37.0410958904,
"line_max": 104,
"alpha_frac": 0.5729204177,
"autogenerated": false,
"ratio": 4.60530679933665,
"config_... |
__author__ = 'Bohdan Mushkevych'
import time
from psutil import TimeoutExpired
from synergy.db.model import unit_of_work
from synergy.workers.abstract_uow_aware_worker import AbstractUowAwareWorker
RETURN_CODE_CANCEL_UOW = 987654321
class AbstractCliWorker(AbstractUowAwareWorker):
""" Module contains common lo... | {
"repo_name": "eggsandbeer/scheduler",
"path": "workers/abstract_cli_worker.py",
"copies": "1",
"size": "2617",
"license": "bsd-3-clause",
"hash": 2670435129854330000,
"line_mean": 39.890625,
"line_max": 110,
"alpha_frac": 0.6289644631,
"autogenerated": false,
"ratio": 4.057364341085271,
"confi... |
__author__ = 'Bohdan Mushkevych'
import time
import boto3
from flow.core.abstract_cluster import AbstractCluster, ClusterError
from flow.core.s3_filesystem import S3Filesystem
# `http://boto3.readthedocs.io/en/latest/reference/services/emr.html#EMR.Client.describe_cluster`_
CLUSTER_STATE_TERMINATED_WITH_ERRORS = 'T... | {
"repo_name": "mushkevych/synergy_flow",
"path": "flow/core/emr_cluster.py",
"copies": "1",
"size": "12175",
"license": "bsd-3-clause",
"hash": -5344821238485574000,
"line_mean": 42.6379928315,
"line_max": 159,
"alpha_frac": 0.58275154,
"autogenerated": false,
"ratio": 3.879859783301466,
"confi... |
__author__ = 'Bohdan Mushkevych'
import unittest
from collections import OrderedDict
from synergy.system import time_helper
from synergy.system.timeperiod_dict import TimeperiodDict
from synergy.system.time_qualifier import *
class TestTimeperiodDict(unittest.TestCase):
def test_identity_translation(self):
... | {
"repo_name": "mushkevych/scheduler",
"path": "tests/test_timeperiod_dict.py",
"copies": "1",
"size": "6819",
"license": "bsd-3-clause",
"hash": 3351614010348240400,
"line_mean": 42.4331210191,
"line_max": 105,
"alpha_frac": 0.5264701569,
"autogenerated": false,
"ratio": 4.1202416918429,
"confi... |
__author__ = 'Bohdan Mushkevych'
import unittest
from datetime import datetime, timedelta
from synergy.system.event_clock import EventClock, EventTime, parse_time_trigger_string, format_time_trigger_string
from synergy.system.repeat_timer import RepeatTimer
class TestEventClock(unittest.TestCase):
def test_utc_... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_event_clock.py",
"copies": "1",
"size": "3847",
"license": "bsd-3-clause",
"hash": -4417862393069892000,
"line_mean": 46.4938271605,
"line_max": 115,
"alpha_frac": 0.5489992202,
"autogenerated": false,
"ratio": 3.3249783923941227,
"conf... |
__author__ = 'Bohdan Mushkevych'
import unittest
from db.model.single_session import SingleSession
class TestSingleSession(unittest.TestCase):
def setUp(self):
self.obj = SingleSession()
def tearDown(self):
del self.obj
def test_key(self):
domain_name = 'test_name'
timep... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_single_session.py",
"copies": "1",
"size": "2176",
"license": "bsd-3-clause",
"hash": 3482754946242596000,
"line_mean": 28.8082191781,
"line_max": 67,
"alpha_frac": 0.6125919118,
"autogenerated": false,
"ratio": 3.476038338658147,
"conf... |
__author__ = 'Bohdan Mushkevych'
import unittest
from settings import enable_test_mode
enable_test_mode()
from constants import PROCESS_SITE_DAILY
from db.model.raw_data import DOMAIN_NAME, TIMEPERIOD
from tests import hourly_fixtures, daily_fixtures
from tests.test_abstract_worker import AbstractWorkerUnitTest
from ... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_site_daily_aggregator.py",
"copies": "1",
"size": "1423",
"license": "bsd-3-clause",
"hash": -6099458677106691000,
"line_mean": 37.4594594595,
"line_max": 97,
"alpha_frac": 0.5952213633,
"autogenerated": false,
"ratio": 4.635179153094462,... |
__author__ = 'Bohdan Mushkevych'
import unittest
from settings import enable_test_mode
enable_test_mode()
from db.model.raw_data import DOMAIN_NAME, TIMEPERIOD
from constants import PROCESS_SITE_YEARLY
from tests import monthly_fixtures
from tests import yearly_fixtures
from tests.test_abstract_worker import Abstract... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_site_yearly_aggregator.py",
"copies": "1",
"size": "1460",
"license": "bsd-3-clause",
"hash": -4187416878064004600,
"line_mean": 37.4210526316,
"line_max": 99,
"alpha_frac": 0.6006849315,
"autogenerated": false,
"ratio": 4.740259740259741... |
__author__ = 'Bohdan Mushkevych'
import unittest
from settings import enable_test_mode
enable_test_mode()
from db.model.site_statistics import DOMAIN_NAME, TIMEPERIOD
from constants import PROCESS_SITE_HOURLY
from tests import hourly_fixtures
from tests.test_abstract_worker import AbstractWorkerUnitTest
from workers.... | {
"repo_name": "mushkevych/scheduler",
"path": "tests/test_site_hourly_aggregator.py",
"copies": "1",
"size": "1437",
"license": "bsd-3-clause",
"hash": -199694802389473440,
"line_mean": 38.9166666667,
"line_max": 99,
"alpha_frac": 0.5984690327,
"autogenerated": false,
"ratio": 4.758278145695364,
... |
__author__ = 'Bohdan Mushkevych'
import unittest
from odm import document, fields
class EmbeddedCollections(document.BaseDocument):
field_list = fields.ListField()
field_dict = fields.DictField()
field_id = fields.ObjectIdField(name='_id', null=True)
class TestDocument(unittest.TestCase):
def setU... | {
"repo_name": "mushkevych/synergy_odm",
"path": "tests/test_collection_fields.py",
"copies": "1",
"size": "1944",
"license": "bsd-3-clause",
"hash": 4793093026999238000,
"line_mean": 28.0149253731,
"line_max": 72,
"alpha_frac": 0.6193415638,
"autogenerated": false,
"ratio": 3.5801104972375692,
... |
__author__ = 'Bohdan Mushkevych'
import unittest
from synergy.conf import settings
from flow.core.ephemeral_cluster import EphemeralCluster
from flow.core.execution_context import ExecutionContext
from flow.core.step_executor import StepExecutor, ACTIONSET_COMPLETE, ACTIONSET_FAILED, ACTIONSET_PENDING
from flow.core... | {
"repo_name": "mushkevych/synergy_flow",
"path": "tests/test_step_executor.py",
"copies": "1",
"size": "2778",
"license": "bsd-3-clause",
"hash": 4109005751178824700,
"line_mean": 41.7384615385,
"line_max": 118,
"alpha_frac": 0.658387329,
"autogenerated": false,
"ratio": 3.918194640338505,
"con... |
__author__ = 'Bohdan Mushkevych'
import unittest
from synergy.system.time_qualifier import *
from context import PROCESS_SITE_HOURLY, PROCESS_SITE_DAILY, PROCESS_SITE_MONTHLY, PROCESS_SITE_YEARLY, \
PROCESS_BASH_DRIVER
from synergy.scheduler.process_hierarchy import ProcessHierarchy
class TestProcessHierarchy(u... | {
"repo_name": "eggsandbeer/scheduler",
"path": "tests/test_process_hierarchy.py",
"copies": "1",
"size": "3643",
"license": "bsd-3-clause",
"hash": -4439504434706716700,
"line_mean": 42.8915662651,
"line_max": 120,
"alpha_frac": 0.6771891298,
"autogenerated": false,
"ratio": 3.5541463414634147,
... |
__author__ = 'Bohdan Mushkevych'
import unittest
try:
import mock
except ImportError:
from unittest import mock
from settings import enable_test_mode
enable_test_mode()
from constants import PROCESS_SITE_HOURLY
from synergy.db.dao.job_dao import JobDao
from synergy.db.dao.unit_of_work_dao import UnitOfWorkDa... | {
"repo_name": "mushkevych/scheduler",
"path": "tests/test_state_machine_continuous.py",
"copies": "1",
"size": "10232",
"license": "bsd-3-clause",
"hash": -385314419994460350,
"line_mean": 50.16,
"line_max": 112,
"alpha_frac": 0.6968334636,
"autogenerated": false,
"ratio": 3.227760252365931,
"c... |
__author__ = 'Bohdan Mushkevych'
import unittest
try:
import mock
except ImportError:
from unittest import mock
from settings import enable_test_mode
enable_test_mode()
from synergy.db.dao.unit_of_work_dao import UnitOfWorkDao
from synergy.db.dao.log_recording_dao import LogRecordingDao
from synergy.system.s... | {
"repo_name": "mushkevych/scheduler",
"path": "tests/test_log_recording_handler.py",
"copies": "1",
"size": "3875",
"license": "bsd-3-clause",
"hash": 113173441170446620,
"line_mean": 36.2596153846,
"line_max": 99,
"alpha_frac": 0.6807741935,
"autogenerated": false,
"ratio": 3.558310376492195,
... |
__author__ = 'Bohdan Mushkevych'
import unittest
try:
import mock
except ImportError:
from unittest import mock
from tests import ut_flows
ut_flows.register_flows()
from synergy.conf import settings
from flow.conf import flows
from flow.core.flow_graph_node import FlowGraphNode
from flow.core.execution_conte... | {
"repo_name": "mushkevych/synergy_flow",
"path": "tests/test_flow_graph.py",
"copies": "1",
"size": "4570",
"license": "bsd-3-clause",
"hash": -3215478460911542000,
"line_mean": 40.1711711712,
"line_max": 118,
"alpha_frac": 0.6374179431,
"autogenerated": false,
"ratio": 3.5703125,
"config_test"... |
__author__ = 'Bohdan Mushkevych'
try:
from http.client import NO_CONTENT
except ImportError:
from httplib import NO_CONTENT
import json
from werkzeug.wrappers import Response
from synergy.mx.utils import render_template, expose
from flow.mx.flow_action_handler import FlowActionHandler, RUN_MODE_RUN_ONE, RUN_... | {
"repo_name": "mushkevych/synergy_flow",
"path": "flow/mx/views.py",
"copies": "1",
"size": "2351",
"license": "bsd-3-clause",
"hash": 6102536044288337000,
"line_mean": 33.0724637681,
"line_max": 94,
"alpha_frac": 0.6924712888,
"autogenerated": false,
"ratio": 3.6677067082683306,
"config_test":... |
__author__ = 'Bohdan Mushkevych'
try:
import mock
except ImportError:
from unittest import mock
from settings import enable_test_mode
enable_test_mode()
import types
import unittest
import process_starter
from six import class_types, PY2, PY3
def main_function(*args):
return args
class OldClass:
... | {
"repo_name": "mushkevych/launch.py",
"path": "tests/test_process_starter.py",
"copies": "1",
"size": "3591",
"license": "bsd-3-clause",
"hash": -8991277941250797000,
"line_mean": 32.25,
"line_max": 103,
"alpha_frac": 0.6649958229,
"autogenerated": false,
"ratio": 3.756276150627615,
"config_tes... |
__author__ = 'Bohdan'
import time
class AminisLastErrorHolder:
def __init__(self):
self.errorText = ""
self.__hasError = False
def clearError(self):
self.errorText = ""
self.__hasError = False
def setError(self, errorText):
self.errorText = errorText
se... | {
"repo_name": "dayitv89/sim-module",
"path": "lib/sim900/amsharedmini.py",
"copies": "2",
"size": "1135",
"license": "mit",
"hash": -8608614065198607000,
"line_mean": 17.9333333333,
"line_max": 40,
"alpha_frac": 0.5612334802,
"autogenerated": false,
"ratio": 3.770764119601329,
"config_test": fa... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = 'Aug 21, 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
import weakref
from functools import partial
from Queue import Queue
from threading import Lock
from collections import defaultdict
import wpf
from System import TimeSpan
from System.Wind... | {
"repo_name": "delicb/mvvm",
"path": "mvvm.py",
"copies": "1",
"size": "14540",
"license": "bsd-2-clause",
"hash": -8600873770774272000,
"line_mean": 31.0264317181,
"line_max": 99,
"alpha_frac": 0.5988308116,
"autogenerated": false,
"ratio": 4.475223145583256,
"config_test": false,
"has_no_ke... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = 'Aug 23, 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
import os
import wpf
from mvvm import ViewModel, Notifiable, command, notifiable, List
from System.Windows import Application, Window
class Person(ViewModel):
name = Notifiable()
... | {
"repo_name": "delicb/mvvm",
"path": "examples/example1.py",
"copies": "1",
"size": "1488",
"license": "bsd-2-clause",
"hash": -7874532449419773000,
"line_mean": 29.3673469388,
"line_max": 89,
"alpha_frac": 0.6552419355,
"autogenerated": false,
"ratio": 3.7293233082706765,
"config_test": false,... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = 'Aug 30, 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
import os
import wpf
import time
from threading import Thread
from mvvm import ViewModel, Notifiable, command, notifiable, List
from System.Windows import Application, Window
class MyView... | {
"repo_name": "delicb/mvvm",
"path": "examples/message_example.py",
"copies": "1",
"size": "1342",
"license": "bsd-2-clause",
"hash": -5928662593609892000,
"line_mean": 31.7317073171,
"line_max": 96,
"alpha_frac": 0.6602086438,
"autogenerated": false,
"ratio": 3.7486033519553073,
"config_test":... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = 'Sep 1, 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
import os
import wpf
from mvvm import ViewModel, Signal, Notifiable, command
from System.Windows import Window, Application
class MyViewModel(ViewModel):
text1 = Notifiable('always sho... | {
"repo_name": "delicb/mvvm",
"path": "examples/signals_example.py",
"copies": "1",
"size": "1197",
"license": "bsd-2-clause",
"hash": 8433934176326417000,
"line_mean": 27.5,
"line_max": 96,
"alpha_frac": 0.649122807,
"autogenerated": false,
"ratio": 3.7523510971786833,
"config_test": false,
"... |
__author__ = "Bojan Delic <bojan@delic.in.rs>"
__mail__ = "bojan@delic.in.rs"
try:
from PyQt4 import QtGui, QtCore
except ImportError:
from PySide import QtGui, QtCore
from main_window import Ui_MainWindow
class MainWindow(QtGui.QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow,... | {
"repo_name": "delicb/GameOfLife",
"path": "gol/main.py",
"copies": "1",
"size": "3293",
"license": "mit",
"hash": 6385673163610931000,
"line_mean": 35.1868131868,
"line_max": 91,
"alpha_frac": 0.6532037656,
"autogenerated": false,
"ratio": 3.2668650793650795,
"config_test": false,
"has_no_ke... |
__author__ = "Bojan Delic <bojan@delic.in.rs>"
__mail__ = "bojan@delic.in.rs"
try:
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt
except ImportError:
from PySide import QtGui, QtCore
from PySide.QtCore import Qt
class GOLMatrix(QtCore.QObject):
# TODO: How to merge these two signals ... | {
"repo_name": "delicb/GameOfLife",
"path": "gol/gol.py",
"copies": "1",
"size": "9519",
"license": "mit",
"hash": -2777308220168581600,
"line_mean": 34.1254612546,
"line_max": 100,
"alpha_frac": 0.5812585356,
"autogenerated": false,
"ratio": 3.547894148341409,
"config_test": false,
"has_no_ke... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = '02 January 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
from samovar.commander import BaseCommand
from ._parsing import HgStyle, HgLexer, PARSERS
class Command(BaseCommand):
'''Performs hg diff command on repositories.
N... | {
"repo_name": "alefnula/samovar",
"path": "src/samovar/commands/scm/diff.py",
"copies": "1",
"size": "2318",
"license": "bsd-3-clause",
"hash": -388216031497156700,
"line_mean": 46.2916666667,
"line_max": 114,
"alpha_frac": 0.5405522002,
"autogenerated": false,
"ratio": 3.889261744966443,
"conf... |
__author__ = 'Bojan Delic <bojan@delic.in.rs>'
__date__ = '02 January 2013'
__copyright__ = 'Copyright (c) 2013 Bojan Delic'
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from samovar.commander import BaseCommand
from tea.utils.crypto import encrypt
class Comm... | {
"repo_name": "alefnula/samovar",
"path": "src/samovar/commands/repo/credentials.py",
"copies": "1",
"size": "1588",
"license": "bsd-3-clause",
"hash": -3281368595331230000,
"line_mean": 29.137254902,
"line_max": 74,
"alpha_frac": 0.4981108312,
"autogenerated": false,
"ratio": 4.082262210796915,
... |
import collections
import sys
from astropy.coordinates import SkyCoord
from astropy import units as u
from processing_components.calibration.operations import apply_gaintable, create_gaintable_from_blockvisibility, qa_gaintable
from processing_components.visibility.base import create_visibility, copy_visibility
from... | {
"repo_name": "SKA-ScienceDataProcessor/algorithm-reference-library",
"path": "deprecated_code/ffiwrappers/src/arlwrap.py",
"copies": "1",
"size": "64539",
"license": "apache-2.0",
"hash": 5170159498931707000,
"line_mean": 46.9131403118,
"line_max": 165,
"alpha_frac": 0.7161251336,
"autogenerated":... |
import cffi
import numpy
from data_models.memory_data_models import Image, Visibility, BlockVisibility, GainTable
import pickle
ff = cffi.FFI()
def ARLDataVisSize(nvis, npol):
return (80+32*int(npol))*int(nvis)
def cARLVis(visin):
"""
Convert a const ARLVis * into the ARL Visiblity structure
"""... | {
"repo_name": "SKA-ScienceDataProcessor/algorithm-reference-library",
"path": "deprecated_code/ffiwrappers/src/arlwrap_support.py",
"copies": "1",
"size": "6364",
"license": "apache-2.0",
"hash": -703055979540557400,
"line_mean": 30.3497536946,
"line_max": 95,
"alpha_frac": 0.5691389063,
"autogener... |
__author__ = 'boris'
from scipy.stats.mstats import winsorize
import scipy.stats as stats
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from collections import defaultdict
import numpy
import math
import mod_lib
import mod_utils
import operator
import os
import uniform_colormaps
from statsmode... | {
"repo_name": "borisz264/mod_seq",
"path": "mod_plotting.py",
"copies": "1",
"size": "62033",
"license": "mit",
"hash": 5215933679536626000,
"line_mean": 55.3945454545,
"line_max": 223,
"alpha_frac": 0.6142698241,
"autogenerated": false,
"ratio": 3.548595618099651,
"config_test": false,
"has_... |
__author__ = 'boris'
"""
Based on the Rouskin DMS-seq paper:
True Positives: Bases that are unpaired in the secondary structure, and the reactive atom has a solvent accessible
surface area (to a 3A radius sphere) of greater than 2A squared.
True Negatives: are Watson-crick paired (A-U or C-G) in the sec... | {
"repo_name": "borisz264/mod_seq",
"path": "structure_ROC_curves/compute_true_positives_negative.py",
"copies": "1",
"size": "3646",
"license": "mit",
"hash": -5654917576875624000,
"line_mean": 33.4056603774,
"line_max": 118,
"alpha_frac": 0.5781678552,
"autogenerated": false,
"ratio": 3.26995515... |
__author__ = 'boris'
"""
inputs:
outfolder - where to put all the results
control_file_name - a pickled dict of [strand][chromosome][position] = background-subtracted mutations/coverage
output from normalize_to_control_make_wig.py - this is already a comparison of modifier to no modifier.
experiment... | {
"repo_name": "borisz264/mod_seq",
"path": "unused_scripts/compare_samples.py",
"copies": "1",
"size": "10227",
"license": "mit",
"hash": 992569476420671600,
"line_mean": 52.5497382199,
"line_max": 252,
"alpha_frac": 0.6650044001,
"autogenerated": false,
"ratio": 3.4055944055944054,
"config_tes... |
__author__ = 'boris'
"""
inputs:
outfolder - where to put all the results
normalization_file_name - a pickled dict of [strand][chromosome][position] = mutations/coverage
output from count_reads_and_mismatches.py - this is from a sample where no modifying reagent was added.
experimental_file_names - ... | {
"repo_name": "borisz264/mod_seq",
"path": "unused_scripts/normalize_to_control_make_wig.py",
"copies": "1",
"size": "8799",
"license": "mit",
"hash": 2589449244232951000,
"line_mean": 51.0710059172,
"line_max": 207,
"alpha_frac": 0.6693942493,
"autogenerated": false,
"ratio": 3.528067361668003,
... |
__author__ = 'boris'
"""
inputs:
outprefix
bundle 1
bundle 2
bundle 3
bundle 4
bundle 5 - the 5 pdb files from the 4v88 bundle
reactivity_values - a pickled dict of [chromosome][position] = reactivity_value or change, such as from compare_samples.py
outputs:
the 5 PDB files in the bundl... | {
"repo_name": "borisz264/mod_seq",
"path": "unused_scripts/map_onto_rRNA_structure_shapemapper.py",
"copies": "1",
"size": "5711",
"license": "mit",
"hash": -3853618376834659300,
"line_mean": 40.6934306569,
"line_max": 203,
"alpha_frac": 0.5928909123,
"autogenerated": false,
"ratio": 3.0572805139... |
__author__ = 'boris'
"""
inputs:
outprefix
bundle 1
bundle 2
bundle 3
bundle 4
bundle 5 - the 5 pdb files from the 4v88 bundle
reactivity_values - a pickled dict of [strand][chromosome][position] = reactivity_value or change, such as from compare_samples.py
outputs:
the 5 PDB files in t... | {
"repo_name": "borisz264/mod_seq",
"path": "unused_scripts/map_onto_rRNA_structure.py",
"copies": "1",
"size": "4996",
"license": "mit",
"hash": -3153490915391695400,
"line_mean": 38.976,
"line_max": 234,
"alpha_frac": 0.5880704564,
"autogenerated": false,
"ratio": 3.2547231270358306,
"config_t... |
__author__ = 'boris'
"""
I really want to use this mod-seq data to generate something resembling an x-ray exposure of a sequencing gel
inputs:
chromosome: the chromosome to plot from
start: the position to start plotting from
stop: the position to stop plotting
mutations.pkl: from parse_shapemapper_cou... | {
"repo_name": "borisz264/mod_seq",
"path": "gel_drawing/simulate_gel.py",
"copies": "1",
"size": "5018",
"license": "mit",
"hash": 2132368530738345700,
"line_mean": 47.7184466019,
"line_max": 183,
"alpha_frac": 0.702471104,
"autogenerated": false,
"ratio": 3.463077984817115,
"config_test": fals... |
__author__ = 'boris'
"""
5'e end data is a pickled dict of form srt_dict[chrom][position] = counts at position
take the 5' end data from count_reads_and_mismatches.py, as well as any number of files output by
compute_true_positive_negative.py
and compute:
1) 90% windorize the input data (All data above 95th p... | {
"repo_name": "borisz264/mod_seq",
"path": "structure_ROC_curves/roc_curves_compare_datasets_shapemapper.py",
"copies": "1",
"size": "6279",
"license": "mit",
"hash": 2117621924518922200,
"line_mean": 44.1798561151,
"line_max": 161,
"alpha_frac": 0.6582258321,
"autogenerated": false,
"ratio": 3.2... |
__author__ = 'boris'
"""
takes:
all_counts - pickled dict of mutation counts, all_counts[rRNA_name][sample_name] = counts_table
all_Depths - pickled dict of coverage counts , all_depths[rRNA_name][sample_name] = depth_table
min_mutations: if a position has less coverage than less mutations than this across... | {
"repo_name": "borisz264/mod_seq",
"path": "unused_scripts/subtract_shapemapper_counts.py",
"copies": "1",
"size": "5425",
"license": "mit",
"hash": -5226015900884519000,
"line_mean": 55.5208333333,
"line_max": 205,
"alpha_frac": 0.6849769585,
"autogenerated": false,
"ratio": 3.522727272727273,
... |
__author__ = 'boris'
"""
THIS IS AN OLD SCRIPT, use the _shapemapper.py version instead
5'e end data is a pickled dict of form srt_dict[strand][chrom][position] = counts at position
take the 5' end data from count_reads_and_mismatches.py, as well as any number of files output by
compute_true_positive_negative.py
... | {
"repo_name": "borisz264/mod_seq",
"path": "structure_ROC_curves/roc_curves_compare_datasets.py",
"copies": "1",
"size": "5936",
"license": "mit",
"hash": 419200575673032770,
"line_mean": 42.9777777778,
"line_max": 163,
"alpha_frac": 0.661893531,
"autogenerated": false,
"ratio": 3.261538461538461... |
__author__ = 'boris'
"""
THIS IS FOR TROUBLESHOOTING AND COMPARING DIFFERENT TRUE POSITIVE AND TRUE NEGATIVE ANNOTATIONS
5'e end data is a pickled dict of form srt_dict[strand][chrom][position] = counts at position
take the 5' end data from count_reads_and_mismatches.py, as well as any number of files output by
c... | {
"repo_name": "borisz264/mod_seq",
"path": "structure_ROC_curves/roc_curves_compare_annotations.py",
"copies": "1",
"size": "5995",
"license": "mit",
"hash": -4845367873214606000,
"line_mean": 42.1366906475,
"line_max": 161,
"alpha_frac": 0.657381151,
"autogenerated": false,
"ratio": 3.2024572649... |
__author__ = 'boris zinshteyn'
"""
Intended for processing of 80s monosome-seq data from defined RNA pools
Based on Alex Robertson's original RBNS pipeline, available on github
"""
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42 #leaves most text as actual text in PDFs, not outlines
import os
import a... | {
"repo_name": "borisz264/mono_seq",
"path": "mono_seq_main.py",
"copies": "1",
"size": "24383",
"license": "mit",
"hash": -6215894587800873000,
"line_mean": 54.2925170068,
"line_max": 269,
"alpha_frac": 0.5590780462,
"autogenerated": false,
"ratio": 3.8104391311142365,
"config_test": false,
"... |
__author__ = 'BoscoTsang'
import copy
import numpy
import scipy
from sklearn.cluster import KMeans
def SPLL(X1, X2, PARAM=None):
if PARAM is None:
k = 3
else:
k = PARAM
Ch = numpy.zeros(2)
ps = numpy.zeros(2)
s = numpy.zeros(2)
Ch[0], ps[0], s[0] = Log_LL(X1, X2, k)
Ch[1]... | {
"repo_name": "boscotsang/SPLL-Python",
"path": "SPLL.py",
"copies": "1",
"size": "2677",
"license": "mit",
"hash": 745278764219821700,
"line_mean": 30.4941176471,
"line_max": 111,
"alpha_frac": 0.5390362346,
"autogenerated": false,
"ratio": 2.5965082444228904,
"config_test": false,
"has_no_k... |
__author__ = "Bo Shi"
__version__ = "0.2.1"
__date__ = "10/2008"
__copyright__ = """
Copyright (c) 2007, Bo Shi
Copyright (c) 2008, Julien Demoor
All rights reserved.
"""
__license__ = """
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditi... | {
"repo_name": "SarathkumarJ/snapboard",
"path": "snapboard/__init__.py",
"copies": "5",
"size": "1671",
"license": "bsd-3-clause",
"hash": 8683229756954421000,
"line_mean": 42.9736842105,
"line_max": 77,
"alpha_frac": 0.7707959306,
"autogenerated": false,
"ratio": 4.230379746835443,
"config_tes... |
__author__ = 'Bouhm'
#Methods that access API and return dictionary/JSON files of data
#d
import requests
import json
import re
import pprint
from constants import URL_RIOT_API as API, API_VERSIONS as VER
class RiotAPIData(object):
def __init__(self, api_key, region='na'):
self.api_key = api_key
... | {
"repo_name": "Bouhm/BlackMarketDefense",
"path": "riot_API_data.py",
"copies": "1",
"size": "8596",
"license": "mit",
"hash": -1868607141843864300,
"line_mean": 37.5470852018,
"line_max": 133,
"alpha_frac": 0.5090739879,
"autogenerated": false,
"ratio": 3.825545171339564,
"config_test": false,... |
__author__ = 'Bouhm'
#Program that uses methods from RiotAPIStats for data aggregation
#For data analysis and data format for game
from riot_API_data import RiotAPIData
import keys
import pprint
import json
import random
import math
import time
import ast
def main():
api = RiotAPIData(keys.API_KEY)
pprint.ppr... | {
"repo_name": "Bouhm/BlackMarketDefense",
"path": "data_aggr.py",
"copies": "1",
"size": "12231",
"license": "mit",
"hash": 3403711875374028300,
"line_mean": 49.7510373444,
"line_max": 151,
"alpha_frac": 0.4878587196,
"autogenerated": false,
"ratio": 3.4975693451529883,
"config_test": false,
... |
__author__ = 'Bouhm'
#Program that uses methods from RiotAPIStats mainly for building database
#Database used for game
from riot_API_data import RiotAPIData
import data_aggr
import keys
import os.path
import urllib.request
import sys
import requests
import json
import random
from pprint import pprint
import time
impor... | {
"repo_name": "Bouhm/BlackMarketDefense",
"path": "db_write.py",
"copies": "1",
"size": "11494",
"license": "mit",
"hash": 1395092419006626600,
"line_mean": 40.7963636364,
"line_max": 172,
"alpha_frac": 0.5695145293,
"autogenerated": false,
"ratio": 3.309530665131011,
"config_test": false,
"h... |
__author__ = 'bouska'
from datetime import datetime, timedelta
from StringIO import StringIO
class Event(object):
def __init__(self):
self.summary = ""
self.organizer = ""
self.location = ""
self.description = ""
self.start = None
self.duration = None
class Calen... | {
"repo_name": "Psycojoker/geholparser",
"path": "src/gehol/converters/remindwriter.py",
"copies": "1",
"size": "2796",
"license": "mit",
"hash": -686036909865581600,
"line_mean": 30.4157303371,
"line_max": 146,
"alpha_frac": 0.5500715308,
"autogenerated": false,
"ratio": 3.971590909090909,
"con... |
__author__ = 'bperozzi'
import graph_tool.all as gt
import seaborn as sns
def find_color(value, maxv, minv, palette):
# XXX need to get min in there
percentage = (value - minv) / (maxv - minv)
idx = int(percentage * len(palette))
idx = min(len(palette) - 1, idx)
#print value, idx
#print palette[idx]
... | {
"repo_name": "phanein/magic-graph",
"path": "src/magicgraph/visualization.py",
"copies": "1",
"size": "3005",
"license": "bsd-3-clause",
"hash": 4217968771521474000,
"line_mean": 23.048,
"line_max": 135,
"alpha_frac": 0.6093178037,
"autogenerated": false,
"ratio": 3.159831756046267,
"config_te... |
__author__ = 'bptripp'
# CNN with support and object depth maps as input.
import numpy as np
from os.path import join
import scipy
import cPickle
from keras.models import Sequential
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dense, Dropout, Activation, Flatten
fro... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/vrep_model.py",
"copies": "1",
"size": "3319",
"license": "mit",
"hash": -8229903321220664000,
"line_mean": 30.6095238095,
"line_max": 111,
"alpha_frac": 0.6869539018,
"autogenerated": false,
"ratio": 2.841609589041096,
"config_test": false,
... |
__author__ = 'bptripp'
# Convolutional network for grasp success prediction
import numpy as np
from keras.models import Sequential
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.optimizers import Adam
import cPickle
from ... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/model.py",
"copies": "1",
"size": "3409",
"license": "mit",
"hash": -7864330088695125000,
"line_mean": 31.1603773585,
"line_max": 116,
"alpha_frac": 0.6726312702,
"autogenerated": false,
"ratio": 2.9362618432385874,
"config_test": false,
"has... |
__author__ = 'bptripp'
from cnn_stimuli import get_image_file_list
import cPickle as pickle
import time
import numpy as np
import matplotlib.pyplot as plt
from alexnet import preprocess, load_net, load_vgg
def excess_kurtosis(columns):
m = np.mean(columns, axis=0)
sd = np.std(columns, axis=0)
result = np... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/selectivity.py",
"copies": "1",
"size": "13980",
"license": "mit",
"hash": 7703437769836973000,
"line_mean": 32.3651551313,
"line_max": 100,
"alpha_frac": 0.5779685265,
"autogenerated": false,
"ratio": 3.051735428945645,
"config_test": false,
"h... |
__author__ = 'bptripp'
from os import listdir, makedirs
from os.path import join, isfile, basename, exists
import numpy as np
from scipy import misc
import string
import matplotlib
import matplotlib.pyplot as plt
def get_image_file_list(source_path, extension, with_path=False):
if with_path:
result = [jo... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/cnn_stimuli.py",
"copies": "1",
"size": "21255",
"license": "mit",
"hash": -6568319712443032000,
"line_mean": 38.9530075188,
"line_max": 174,
"alpha_frac": 0.5637261821,
"autogenerated": false,
"ratio": 3.1704952267303104,
"config_test": false,
... |
__author__ = 'bptripp'
from os import listdir
from os.path import isfile, join
import cPickle
import numpy as np
import scipy
from keras.models import Sequential
from keras.layers.core import Dense, Flatten, Dropout, Activation
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers im... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/perspective_model.py",
"copies": "1",
"size": "6118",
"license": "mit",
"hash": -4846606596169325000,
"line_mean": 34.5697674419,
"line_max": 147,
"alpha_frac": 0.6312520432,
"autogenerated": false,
"ratio": 3.292787944025834,
"config_test": fa... |
__author__ = 'bptripp'
from os import listdir
from os.path import isfile, join
import time
import numpy as np
import matplotlib.pyplot as plt
import cPickle
from PIL import Image
from scipy.optimize import bisect
from quaternion import angle_between_quaterions, to_quaternion
def get_random_points(n, radius, surface=... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/perspective.py",
"copies": "1",
"size": "30382",
"license": "mit",
"hash": -3662520170638863000,
"line_mean": 37.3127364439,
"line_max": 141,
"alpha_frac": 0.5873543546,
"autogenerated": false,
"ratio": 3.4060538116591927,
"config_test": false,... |
__author__ = 'bptripp'
from os.path import join
import cPickle
import matplotlib.pyplot as plt
import scipy.misc
import numpy as np
from perspective import get_rotation_matrix, get_random_points
def plot_correct_point_scatter():
n_points = 200
with open('../data/neuron-points.pkl', 'rb') as f:
neuron... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/perspective_analysis.py",
"copies": "1",
"size": "9936",
"license": "mit",
"hash": -8287427461598452000,
"line_mean": 30.8461538462,
"line_max": 100,
"alpha_frac": 0.5932971014,
"autogenerated": false,
"ratio": 2.913782991202346,
"config_test":... |
__author__ = 'bptripp'
from os.path import join
import matplotlib.pyplot as plt
import cPickle
import numpy as np
import scipy
from data import load_all_params
# objects, gripper_pos, gripper_orient, labels = load_all_params('../../grasp-conv/data/output_data.csv')
# f = file('../data/metrics-objects.pkl', 'rb')
# o... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/analysis.py",
"copies": "1",
"size": "9741",
"license": "mit",
"hash": -4711622697899618000,
"line_mean": 31.6879194631,
"line_max": 128,
"alpha_frac": 0.6271430038,
"autogenerated": false,
"ratio": 3.318909710391823,
"config_test": false,
"h... |
__author__ = 'bptripp'
from os.path import join
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 14
matplotlib.rcParams['ytick.labelsize'] = 14
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, load_net, load_vgg
# load IT neuron d... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/occlusion.py",
"copies": "1",
"size": "4383",
"license": "mit",
"hash": 8586947636810286000,
"line_mean": 32.4580152672,
"line_max": 103,
"alpha_frac": 0.6354095368,
"autogenerated": false,
"ratio": 2.851659076122316,
"config_test": false,
"has_... |
__author__ = 'bptripp'
import argparse
import logging
from os import listdir, rename
from os.path import isfile, join, isdir, basename, split
import cPickle as pickle
import numpy as np
import matplotlib.pyplot as plt
import time
from alexnet import preprocess, load_net
from auction import auction
"""
TODO:
- DONE lo... | {
"repo_name": "bptripp/it-cnn",
"path": "orientation.py",
"copies": "1",
"size": "8926",
"license": "mit",
"hash": -6839530519317261000,
"line_mean": 34.2806324111,
"line_max": 126,
"alpha_frac": 0.6342146538,
"autogenerated": false,
"ratio": 3.452998065764023,
"config_test": false,
"has_no_k... |
__author__ = 'bptripp'
import argparse
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as plt
from alexnet import preprocess, load_net
from orientation import find_stimuli, get_images
parser = argparse.ArgumentParser()
parser.add_argument('action', help='either save (evaluate and save tuning curv... | {
"repo_name": "bptripp/it-cnn",
"path": "orientation_analysis.py",
"copies": "1",
"size": "1404",
"license": "mit",
"hash": -7949491637300808000,
"line_mean": 26.5294117647,
"line_max": 107,
"alpha_frac": 0.6602564103,
"autogenerated": false,
"ratio": 3.334916864608076,
"config_test": false,
... |
__author__ = 'bptripp'
import cPickle as pickle
from scipy.optimize import curve_fit
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 16
matplotlib.rcParams['ytick.labelsize'] = 16
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, l... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/position.py",
"copies": "1",
"size": "11797",
"license": "mit",
"hash": -8436449798592760000,
"line_mean": 30.1266490765,
"line_max": 109,
"alpha_frac": 0.5937950326,
"autogenerated": false,
"ratio": 2.9745335350479074,
"config_test": false,
"ha... |
__author__ = 'bptripp'
import cPickle
import csv
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes3D
from data import get_prob_label, get_points
from depthmap import rot_matrix, loadOBJ
def export_overlap_results():
with open('o-predict.pkl', 'rb') as f:
outp... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/plots.py",
"copies": "1",
"size": "2538",
"license": "mit",
"hash": -2312333928488435700,
"line_mean": 30.725,
"line_max": 109,
"alpha_frac": 0.5413711584,
"autogenerated": false,
"ratio": 2.9205983889528193,
"config_test": false,
"has_no_key... |
__author__ = 'bptripp'
import csv
import time
import numpy as np
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, load_net, load_vgg
from scipy.signal import fftconvolve
def mean_corr(out):
cc = np.corrcoef(out.T)
n = cc.shape[0]
print('n: ' + st... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/orientation.py",
"copies": "1",
"size": "10458",
"license": "mit",
"hash": -499343919266384960,
"line_mean": 31.3777089783,
"line_max": 107,
"alpha_frac": 0.5720022949,
"autogenerated": false,
"ratio": 2.853478854024557,
"config_test": false,
"h... |
__author__ = 'bptripp'
import numpy as np
from os.path import join
import scipy
import cPickle
from keras.optimizers import Adam
from data import load_all_params
from keras.models import model_from_json
def get_input(object, seq_num):
image_file = object[:-4] + '-' + str(seq_num) + '-overlap.png'
X = []
... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/overlap_check.py",
"copies": "1",
"size": "1534",
"license": "mit",
"hash": -1824734868123990300,
"line_mean": 27.4074074074,
"line_max": 103,
"alpha_frac": 0.6870925684,
"autogenerated": false,
"ratio": 2.8407407407407406,
"config_test": false... |
__author__ = 'bptripp'
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten
from keras.... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/cninit.py",
"copies": "1",
"size": "7083",
"license": "mit",
"hash": 9001662641487659000,
"line_mean": 30.9054054054,
"line_max": 101,
"alpha_frac": 0.6162642948,
"autogenerated": false,
"ratio": 3.0822454308093996,
"config_test": false,
"has... |
__author__ = 'bptripp'
import numpy as np
from scipy.optimize import newton
from scipy.signal import convolve2d
import matplotlib.pyplot as plt
# Barrett hand dimensions from http://www.barrett.com/images/HandDime4.gif
# Fingers don't extend fully, max 40deg from straight. First segment .07m; second .058m
# I have es... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/heuristic.py",
"copies": "1",
"size": "9413",
"license": "mit",
"hash": -6188186780872422000,
"line_mean": 38.2208333333,
"line_max": 124,
"alpha_frac": 0.6434717943,
"autogenerated": false,
"ratio": 3.1460561497326203,
"config_test": false,
... |
__author__ = 'bptripp'
import numpy as np
import cPickle
from keras.models import Sequential
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.optimizers import Adam
im_width = 80
model = Sequential()
model.add(Convolution2... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/collision_model.py",
"copies": "1",
"size": "2567",
"license": "mit",
"hash": -644877019632732200,
"line_mean": 31.4936708861,
"line_max": 111,
"alpha_frac": 0.7051032333,
"autogenerated": false,
"ratio": 2.913734392735528,
"config_test": false... |
__author__ = 'bptripp'
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 14
matplotlib.rcParams['ytick.labelsize'] = 14
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import load_vgg, load_net, preprocess
# remove_level = 2
# use_vgg = False
#
# if... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/simplification.py",
"copies": "1",
"size": "5168",
"license": "mit",
"hash": 8056749729226095000,
"line_mean": 36.4492753623,
"line_max": 124,
"alpha_frac": 0.6557662539,
"autogenerated": false,
"ratio": 2.5647642679900744,
"config_test": false,
... |
__author__ = 'bptripp'
import numpy as np
import matplotlib.pyplot as plt
import cPickle
from quaternion import angle_between_quaterions
# def interpolate(point, angle, points, angles, values, sigma_p=.01, sigma_a=(4*np.pi/180)):
# """
# Gaussian kernel smoothing.
# """
# # q = to_quaternion(get_rotat... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/interpolate.py",
"copies": "1",
"size": "5452",
"license": "mit",
"hash": -7175818093723811000,
"line_mean": 36.0884353741,
"line_max": 129,
"alpha_frac": 0.6214233309,
"autogenerated": false,
"ratio": 3.1845794392523366,
"config_test": false,
... |
__author__ = 'bptripp'
import numpy as np
def to_quaternion(rotation_matrix):
# from Siciliano & Khatib pg. 12 and quaternion.m by Tincknell
r = rotation_matrix
# e0 = .5 * np.sqrt(1 + r[0][0] + r[1][1] + r[2][2])
e0 = .5 * np.sqrt(np.maximum(0, r[0][0] + r[1][1] + r[2][2] + 1))
if e0 == 0:
... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/quaternion.py",
"copies": "1",
"size": "5300",
"license": "mit",
"hash": 8663867377050157000,
"line_mean": 33.1935483871,
"line_max": 109,
"alpha_frac": 0.5320754717,
"autogenerated": false,
"ratio": 2.1527213647441106,
"config_test": false,
... |
__author__ = 'bptripp'
import os
import csv
import numpy as np
from itertools import islice
from depthmap import *
from PIL import Image
import scipy
import scipy.misc
from depthmap import loadOBJ, Display
from heuristic import calculate_metric_map
import cPickle
import matplotlib.pyplot as plt
# class GraspDataSour... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/data.py",
"copies": "1",
"size": "26522",
"license": "mit",
"hash": 8336879002755659000,
"line_mean": 36.4076163611,
"line_max": 132,
"alpha_frac": 0.5748058216,
"autogenerated": false,
"ratio": 2.9613666815542654,
"config_test": false,
"has_... |
__author__ = 'bptripp'
import time
import numpy as np
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 18
matplotlib.rcParams['ytick.labelsize'] = 18
import matplotlib.pyplot as plt
from cnn_stimuli import get_image_file_list
from alexnet import preprocess, load_net, load_vgg
scales = np.logspace(np.log10(.... | {
"repo_name": "bptripp/it-cnn",
"path": "tuning/size.py",
"copies": "1",
"size": "10236",
"license": "mit",
"hash": -2986005213834400300,
"line_mean": 30.4953846154,
"line_max": 99,
"alpha_frac": 0.5980851895,
"autogenerated": false,
"ratio": 3.023929098966027,
"config_test": false,
"has_no_k... |
__author__ = 'bptripp'
# Just like perspective_model, but with ray-based metrics instead of depth map-based metrics as targets.
from os import listdir
from os.path import isfile, join
import cPickle
import numpy as np
import scipy
from keras.models import Sequential
from keras.layers.core import Dense, Flatten, Dropou... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/perspective_model2.py",
"copies": "1",
"size": "5197",
"license": "mit",
"hash": -7916265495153750000,
"line_mean": 33.1907894737,
"line_max": 148,
"alpha_frac": 0.6313257649,
"autogenerated": false,
"ratio": 3.268553459119497,
"config_test": f... |
__author__ = 'bptripp'
"""
Bertsekas' Auction Algorithm. This is a nearly line-by-line port of the Matlab implementation by Florian Bernard:
http://www.mathworks.com/matlabcentral/fileexchange/48448-fast-linear-assignment-problem-using-auction-algorithm
And this is a nice introduction to the algorithm:
Bert... | {
"repo_name": "bptripp/it-cnn",
"path": "auction.py",
"copies": "1",
"size": "4988",
"license": "mit",
"hash": 1182420263333599700,
"line_mean": 36.223880597,
"line_max": 116,
"alpha_frac": 0.6595829992,
"autogenerated": false,
"ratio": 3.996794871794872,
"config_test": false,
"has_no_keyword... |
__author__ = 'bptripp'
"""
The input to this network isn't depth maps, but rather a group of hand-engineered features.
"""
import csv
import numpy as np
from os.path import join
import scipy
import cPickle
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimize... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/correlates_model.py",
"copies": "1",
"size": "1688",
"license": "mit",
"hash": 6371515681995578000,
"line_mean": 26.6721311475,
"line_max": 91,
"alpha_frac": 0.7049763033,
"autogenerated": false,
"ratio": 2.9770723104056436,
"config_test": fals... |
__author__ = 'bptripp'
"""
The input to this network isn't depth maps, but rather depth of overlap between
object / support and gripper finger trajectory.
"""
import numpy as np
from os.path import join
import scipy
import cPickle
from keras.models import Sequential
from keras.layers.convolutional import Convolution2... | {
"repo_name": "bptripp/grasp-convnet",
"path": "py/overlap_model.py",
"copies": "1",
"size": "3344",
"license": "mit",
"hash": 1837334114612783000,
"line_mean": 28.8571428571,
"line_max": 103,
"alpha_frac": 0.6662679426,
"autogenerated": false,
"ratio": 2.8902333621434746,
"config_test": false,... |
__author__ = 'bptripp'
# Testing responses of pre-trained AlexNet for comparison with IT
from keras.optimizers import SGD
from keras.layers import Flatten
import keras
import numpy as np
from convnetskeras.convnets import preprocess_image_batch, convnet
def load_net(remove_last_layer=True, weights_path='weights/ale... | {
"repo_name": "bptripp/it-cnn",
"path": "alexnet.py",
"copies": "1",
"size": "4129",
"license": "mit",
"hash": 5789811955364366000,
"line_mean": 29.3602941176,
"line_max": 116,
"alpha_frac": 0.5957859046,
"autogenerated": false,
"ratio": 3.606113537117904,
"config_test": false,
"has_no_keywor... |
__author__ = 'brad'
import pyaudio
import wave
import cStringIO
class SoundStream():
def __init__(self, pya, address):
if address is not None:
self.file = wave.open(str(address), 'rb')
self.pya = pya
self.stream = None
self.address = address
self.chunk = 1024
... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/backend/sound.py",
"copies": "1",
"size": "4132",
"license": "mit",
"hash": 1642200993317907200,
"line_mean": 33.4333333333,
"line_max": 104,
"alpha_frac": 0.5493707648,
"autogenerated": false,
"ratio": 3.980732177263969,
"config_test": fa... |
__author__ = 'brad'
import pygame
import pyaudio
import backend
from ctypes import *
from contextlib import contextmanager
ERROR_HANDLER_FUNC = CFUNCTYPE(None, c_char_p, c_int, c_char_p, c_int, c_char_p)
def py_error_handler(filename, line, function, err, fmt):
pass
c_error_handler = ERROR_HANDLER_FUNC(py_error_... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/resourceman.py",
"copies": "1",
"size": "5061",
"license": "mit",
"hash": -4913173962195845000,
"line_mean": 34.6478873239,
"line_max": 117,
"alpha_frac": 0.5947441217,
"autogenerated": false,
"ratio": 3.5970149253731343,
"config_test": fa... |
__author__ = 'brad'
import pygame
import random
class ObjectState(object):
def __init__(self):
pass
def update(self, game_object, game_scene):
pass
class GameObject(pygame.sprite.Sprite, object):
def __init__(self, image=None, layer=0, masks=None, collision_rect=None, angle=0, position=... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/gameobject.py",
"copies": "1",
"size": "17043",
"license": "mit",
"hash": -1847703564882521000,
"line_mean": 41.1856435644,
"line_max": 145,
"alpha_frac": 0.5088892801,
"autogenerated": false,
"ratio": 3.9323950161513612,
"config_test": fa... |
__author__ = 'brad'
import backend
class CoordinateSurface(backend.Surface):
def __init__(self, rect, coordinate_size):
# This part should be cleaned up
"""The CoordinateSurface is essentially a pygame Surface
with a builtin secondary coordinate system, which operates
irrespectiv... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/coordsurface.py",
"copies": "1",
"size": "9618",
"license": "mit",
"hash": 6534510860761072000,
"line_mean": 42.9178082192,
"line_max": 120,
"alpha_frac": 0.5498024537,
"autogenerated": false,
"ratio": 4.032704402515724,
"config_test": fal... |
__author__ = 'brad'
import math
import pygame
class Scene(object):
def __init__(self, scene_size, update_all=False, handle_all_collisions=False):
self.coordinate_array = {}
self.collision_array = {}
self.views = {}
self.view_rects = {}
self.view_draw_positions = {}
... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/scene.py",
"copies": "1",
"size": "15417",
"license": "mit",
"hash": -1677391333928915700,
"line_mean": 48.4166666667,
"line_max": 127,
"alpha_frac": 0.5618473114,
"autogenerated": false,
"ratio": 4.236603462489695,
"config_test": true,
... |
__author__ = 'brad'
import os
import src.engine as engine # import src.engine as engine
import random
RESOURCE_DIR = os.path.join(os.path.dirname(__file__),'../../resources/') + '/'
SPRITE_DIR = RESOURCE_DIR + 'sprite/'
class AbstractEffect(engine.GameObject):
def __init__(self, object_type):
self.reso... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/effects.py",
"copies": "1",
"size": "2648",
"license": "mit",
"hash": -8580490143469607000,
"line_mean": 41.0317460317,
"line_max": 107,
"alpha_frac": 0.6087613293,
"autogenerated": false,
"ratio": 3.6373626373626373,
"config_test": false,
... |
__author__ = 'brad'
import os
import src.engine as engine
from pygame import Rect
RESOURCE_DIR = os.path.join(os.path.dirname(__file__),'../../resources/') + '/'
SPRITE_DIR = RESOURCE_DIR + 'sprite/'
class LinkSword(engine.GameObject):
def __init__(self, facing, mode="slash"):
self.resource_manager = en... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/linksword.py",
"copies": "1",
"size": "6473",
"license": "mit",
"hash": 9037202522360393000,
"line_mean": 68.6021505376,
"line_max": 147,
"alpha_frac": 0.4835470416,
"autogenerated": false,
"ratio": 3.604120267260579,
"config_test": false,
... |
__author__ = 'brad'
import os
import src.engine as engine
import pygame
import effects
import random
import linksword
import specialtiles
from pygame.locals import *
RESOURCE_DIR = os.path.join(os.path.dirname(__file__),'../../resources/') + '/'
SPRITE_DIR = RESOURCE_DIR + 'sprite/'
SOUND_DIR = RESOURCE_DIR + 'sound... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/link.py",
"copies": "1",
"size": "46634",
"license": "mit",
"hash": 5435727386401376000,
"line_mean": 46.3922764228,
"line_max": 174,
"alpha_frac": 0.5351245872,
"autogenerated": false,
"ratio": 3.8018914071416923,
"config_test": false,
"h... |
__author__ = 'brad'
import os
import src.engine as engine
import pygame
RESOURCE_DIR = os.path.join(os.path.dirname(__file__),'../../resources/') + '/'
FONT_DIR = RESOURCE_DIR + 'font/'
class HUD(engine.CoordinateSurface):
def __init__(self, screen_size):
engine.CoordinateSurface.__init__(self, pygame.R... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/gui.py",
"copies": "1",
"size": "5763",
"license": "mit",
"hash": -3086630491856024600,
"line_mean": 42.3308270677,
"line_max": 148,
"alpha_frac": 0.538434843,
"autogenerated": false,
"ratio": 3.834331337325349,
"config_test": false,
"has_... |
__author__ = 'brad'
import os
import src.engine as engine
RESOURCE_DIR = os.path.join(os.path.dirname(__file__),'../../resources/') + '/'
SPRITE_DIR = RESOURCE_DIR + 'sprite/'
class AbstractTile(engine.GameObject):
def __init__(self):
self.resource_manager = engine.ResourceManager()
self.tile_sh... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/specialtiles.py",
"copies": "1",
"size": "1495",
"license": "mit",
"hash": -5557264308554162000,
"line_mean": 38.3421052632,
"line_max": 113,
"alpha_frac": 0.6314381271,
"autogenerated": false,
"ratio": 3.7004950495049505,
"config_test": fal... |
__author__ = 'brad'
import pygame
from resourceman import ResourceManager
from spritesheet import Spritesheet
from gameobject import GameObject
import xml.etree.ElementTree as ET
class Map(object):
def __init__(self, filename, tile_set):
"""Takes an XML world file and a tile set and creates a map from it... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/map.py",
"copies": "1",
"size": "13218",
"license": "mit",
"hash": -697693512749228700,
"line_mean": 56.2251082251,
"line_max": 140,
"alpha_frac": 0.4665607505,
"autogenerated": false,
"ratio": 4.680594900849858,
"config_test": false,
"h... |
__author__ = 'brad'
import pygame
class Spritesheet(object):
def __init__(self, filename):
try:
self.sheet = pygame.image.load(filename).convert()
except pygame.error, message:
print 'Unable to load spritesheet image:', filename
raise SystemExit, message
#... | {
"repo_name": "branderson/PyZelda",
"path": "src/engine/spritesheet.py",
"copies": "1",
"size": "2004",
"license": "mit",
"hash": 4134208237051990500,
"line_mean": 40.7708333333,
"line_max": 120,
"alpha_frac": 0.6097804391,
"autogenerated": false,
"ratio": 3.5978456014362656,
"config_test": fal... |
__author__ = 'brad'
import src.engine as engine
import pygame
import random
class AbstractEnemy(engine.GameObject):
def __init__(self):
self.resource_manager = engine.ResourceManager()
engine.GameObject.__init__(self, layer=0, handle_collisions=True, solid=True, object_type="enemy")
class Octor... | {
"repo_name": "branderson/PyZelda",
"path": "src/game/octorok.py",
"copies": "1",
"size": "5684",
"license": "mit",
"hash": -3163787031724578000,
"line_mean": 46.7647058824,
"line_max": 111,
"alpha_frac": 0.5626319493,
"autogenerated": false,
"ratio": 3.6506101477199744,
"config_test": false,
... |
__author__ = 'Brad Urani'
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
import scifipy.histogramhelpers as hh
class PlotHelpers(object):
def __init__(self):
pass
def histogram_with_pdf(self, hist):
mu = hh.hist_mean(hist)
std_dev = hh.hist_std_dev(h... | {
"repo_name": "bradurani/scifipy",
"path": "plothelpers.py",
"copies": "1",
"size": "1335",
"license": "unlicense",
"hash": 8418426080242399000,
"line_mean": 33.2564102564,
"line_max": 95,
"alpha_frac": 0.6037453184,
"autogenerated": false,
"ratio": 3.104651162790698,
"config_test": false,
"h... |
import base64
from urllib.parse import urlsplit
from pprint import pprint # TODO stop logging accesses
from django.http import HttpResponse
from rest_framework import authentication
from rest_framework import exceptions
from .models import LocalCredentials, RemoteCredentials
def createBasicAuthToken(username, passwo... | {
"repo_name": "CMPUT404W17T06/CMPUT404-project",
"path": "rest/authUtils.py",
"copies": "1",
"size": "3344",
"license": "apache-2.0",
"hash": 6049982798142617000,
"line_mean": 31.4660194175,
"line_max": 77,
"alpha_frac": 0.6734449761,
"autogenerated": false,
"ratio": 4.531165311653116,
"config_... |
import uuid
import json
from dash.models import Post, Author
from .verifyUtils import InvalidField, MissingFields, MalformedId, NotFound, \
MalformedBody
def validateData(data, fields):
"""
Validates data in a dictionary using validation functions.
Validation functions should tak... | {
"repo_name": "CMPUT404W17T06/CMPUT404-project",
"path": "rest/dataUtils.py",
"copies": "1",
"size": "6464",
"license": "apache-2.0",
"hash": 1300210495638494500,
"line_mean": 28.3818181818,
"line_max": 79,
"alpha_frac": 0.588799505,
"autogenerated": false,
"ratio": 4.34700739744452,
"config_te... |
from django.core.paginator import Paginator, InvalidPage
from rest_framework.views import APIView
from dash.models import Comment, Author, RemoteCommentAuthor
from .serializers import CommentSerializer
from .verifyUtils import addCommentValidators, InvalidField, ResourceConflict, \
Dependency... | {
"repo_name": "CMPUT404W17T06/CMPUT404-project",
"path": "rest/commentView.py",
"copies": "1",
"size": "6383",
"license": "apache-2.0",
"hash": -7357989257104396000,
"line_mean": 35.0621468927,
"line_max": 80,
"alpha_frac": 0.5489581701,
"autogenerated": false,
"ratio": 4.707227138643068,
"conf... |
from django.core.paginator import Paginator, InvalidPage
from rest_framework.views import APIView
from dash.models import Post
from .serializers import PostSerializer
from .dataUtils import getAuthor
from .httpUtils import JSONResponse
class AuthorPostView(APIView):
"""
This is for viewing all of the posts t... | {
"repo_name": "CMPUT404W17T06/CMPUT404-project",
"path": "rest/authorPostView.py",
"copies": "1",
"size": "3559",
"license": "apache-2.0",
"hash": 2794073843567580000,
"line_mean": 34.2376237624,
"line_max": 78,
"alpha_frac": 0.5206518685,
"autogenerated": false,
"ratio": 4.658376963350785,
"co... |
from django.core.paginator import Paginator, InvalidPage
from rest_framework.views import APIView
from dash.models import Post
from .serializers import PostSerializer
from .verifyUtils import InvalidField
from .httpUtils import JSONResponse
class PostsView(APIView):
"""
This is the get multiple posts view an... | {
"repo_name": "CMPUT404W17T06/CMPUT404-project",
"path": "rest/multiPostView.py",
"copies": "1",
"size": "3369",
"license": "apache-2.0",
"hash": 8388208766356484000,
"line_mean": 34.4631578947,
"line_max": 78,
"alpha_frac": 0.5244879786,
"autogenerated": false,
"ratio": 4.6341127922971115,
"co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.