text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'null3d'
from models.plantilla import Plantilla
import web
render = web.template.render('templates/', base="base")
class ListarPlantilla:
def GET(self):
#import ipdb; ipdb.set_trace()
plantillas = Plantilla.getAll()
return render.listar_plantillas(plantillas)
class Cr... | {
"repo_name": "carojasq/Evaluaciones-bases-de-datos-2",
"path": "controllers/plantilla_controller.py",
"copies": "1",
"size": "1318",
"license": "mit",
"hash": -9149847090662516000,
"line_mean": 28.2888888889,
"line_max": 76,
"alpha_frac": 0.5993930197,
"autogenerated": false,
"ratio": 3.45931758... |
__author__ = 'nuok'
from city import City
from dungeon import Dungeon
class Map:
def __init__(self, config_data):
locations = {}
# init city
for city in config_data['cities']:
locations[city['name']] = City(city)
# init dungeon
for dungeon in config_data['dung... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "the_dungeon/map.py",
"copies": "1",
"size": "1260",
"license": "mit",
"hash": -8221731224188914000,
"line_mean": 29.756097561,
"line_max": 76,
"alpha_frac": 0.619047619,
"autogenerated": false,
"ratio": 4,
"config_test": false,
"has... |
__author__ = 'nuok'
from location import Location
import random
class Dungeon(Location):
def __init__(self, config):
Location.__init__(self, config)
self.victory_chance = config['victory_chance']
self.reward = config['reward']
self.exp_reward = config['exp_reward']
self.pen... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "the_dungeon/dungeon.py",
"copies": "1",
"size": "1329",
"license": "mit",
"hash": -6540119018976772000,
"line_mean": 29.9302325581,
"line_max": 70,
"alpha_frac": 0.5515425132,
"autogenerated": false,
"ratio": 3.6016260162601625,
"conf... |
__author__ = 'nuok'
from location import Location
class City(Location):
def __init__(self, config):
Location.__init__(self, config)
self.inventory_price = config['inventory_price']
self.extra_price = config['extra_price']
def sell(self, player):
player_inventory = player.get_i... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "the_dungeon/city.py",
"copies": "1",
"size": "1194",
"license": "mit",
"hash": 3407543071745677000,
"line_mean": 31.2972972973,
"line_max": 90,
"alpha_frac": 0.5862646566,
"autogenerated": false,
"ratio": 3.7904761904761903,
"config_t... |
__author__ = 'nuok'
from the_dungeon.game import Game
import random
import time
class QLearning:
def __init__(self, Q, learning_rate=0.001, discount_factor=0.7):
self.Q = Q
self.learning_rate = learning_rate
self.discount_factor = discount_factor
self.current_state = None
def ... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "q_learning.py",
"copies": "2",
"size": "2965",
"license": "mit",
"hash": 8417051892728072000,
"line_mean": 33.476744186,
"line_max": 123,
"alpha_frac": 0.6070826307,
"autogenerated": false,
"ratio": 3.6246943765281174,
"config_test": ... |
__author__ = 'nuok'
import json
from map import Map
from player import Player
class Game:
def __init__(self, config_filename):
data = json.load(open(config_filename, 'r'))
# init map
self.map = Map(data)
# init player
self.player = Player(data['player'])
def get_curr... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "the_dungeon/game.py",
"copies": "1",
"size": "1222",
"license": "mit",
"hash": -2493103595032097000,
"line_mean": 22.0566037736,
"line_max": 69,
"alpha_frac": 0.6072013093,
"autogenerated": false,
"ratio": 3.6047197640117994,
"config_... |
__author__ = 'nuok'
class Player:
def __init__(self, config):
self.__exp = 0
self.__money = 0
self.__inventory = {}
self.__exp_levels = config['exp_level']
def get_level(self):
level = 1
for exp_level in self.__exp_levels:
if self.__exp < exp_level:... | {
"repo_name": "chaiso-krit/reinforcement_learning",
"path": "the_dungeon/player.py",
"copies": "1",
"size": "1458",
"license": "mit",
"hash": 4337268267603221500,
"line_mean": 23.7288135593,
"line_max": 57,
"alpha_frac": 0.5267489712,
"autogenerated": false,
"ratio": 3.9945205479452053,
"config... |
__author__ = ["Nurendra Choudhary <nurendrachoudhary31@gmail.com>","Anoop Kunchukuttan <anoop.kunchukuttan@gmail.com>"]
__license__ = "GPLv3"
""" Transliterate texts between unicode and standard transliteration schemes.
Transliterate texts between non-latin scripts and commonly-used latin
transliteration schemes. Uses... | {
"repo_name": "mbevila/cltk",
"path": "cltk/corpus/sanskrit/itrans/itrans_transliterator.py",
"copies": "1",
"size": "31726",
"license": "mit",
"hash": 8637592558707371000,
"line_mean": 30.4742063492,
"line_max": 156,
"alpha_frac": 0.5841265839,
"autogenerated": false,
"ratio": 3.540453074433657,... |
__author__ = '''
William Rusnack github.com/BebeSparkelSparkel linkedin.com/in/williamrusnack williamrusnack@gmail.com
Eric Moyer github.com/epmoyer eric@lemoncrab.com
Thomas Hladish https://github.com/tjhladish tjhladish@utexas.edu
'''
from math import floor, log10
def std_notation(value, precision):
'''
standa... | {
"repo_name": "Karel-van-de-Plassche/QLKNN-develop",
"path": "qlknn/misc/to_precision.py",
"copies": "1",
"size": "9243",
"license": "mit",
"hash": -2788116922295220000,
"line_mean": 30.4387755102,
"line_max": 110,
"alpha_frac": 0.6852753435,
"autogenerated": false,
"ratio": 3.4284124629080117,
... |
__author__ = 'Nycidian'
import unittest
from congruence import Congruence
from string import ascii_letters as letters
from random import choice, randint
'''
calls different sequences
test errors
test time taken?
'''
class TestNone(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.test_1 = '... | {
"repo_name": "Nycidian/congruence",
"path": "test/test.py",
"copies": "1",
"size": "2072",
"license": "mit",
"hash": -1877422780623236900,
"line_mean": 23.6666666667,
"line_max": 71,
"alpha_frac": 0.5868725869,
"autogenerated": false,
"ratio": 3.2124031007751936,
"config_test": true,
"has_no... |
__author__ = 'nzhang-dev'
import unittest
from ctree.frontend import *;
from ctree.transformations import PyBasicConversions
from ctree.transforms import DeclarationFiller
def fib(n):
a, b = 0.0, 1.0
k = "hello"
while n > 0:
a, b = b, a + b
n -= 1
return a
class DeclarationTest(uni... | {
"repo_name": "ucb-sejits/ctree",
"path": "test/test_transforms/test_declaration_filler.py",
"copies": "1",
"size": "1649",
"license": "bsd-2-clause",
"hash": -4728851705693761000,
"line_mean": 23.25,
"line_max": 76,
"alpha_frac": 0.5251667677,
"autogenerated": false,
"ratio": 3.2783300198807157,... |
__author__ = "OBL"
from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, address=None, homephone=None, mobilephone=None, workphone=None, phone=None,
mail1=None, mail2=None, mail3=None, id=None, all_phones_from_home_page=None, all_mail_from_home_page=None):
... | {
"repo_name": "apridorozhny/pythontrain",
"path": "model/contact.py",
"copies": "1",
"size": "1236",
"license": "apache-2.0",
"hash": -4857489188677473000,
"line_mean": 35.3529411765,
"line_max": 129,
"alpha_frac": 0.6181229773,
"autogenerated": false,
"ratio": 3.21875,
"config_test": false,
... |
__author__ = "OBL"
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_... | {
"repo_name": "apridorozhny/pythontrain",
"path": "fixture/session.py",
"copies": "1",
"size": "1357",
"license": "apache-2.0",
"hash": -5035113024077637000,
"line_mean": 27.8723404255,
"line_max": 72,
"alpha_frac": 0.5917464996,
"autogenerated": false,
"ratio": 3.2004716981132075,
"config_test... |
__author__ = "OBL"
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def return_to_main_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/addressbook/")):
wd.get("http://localhost:8080/addressbook/")
... | {
"repo_name": "apridorozhny/pythontrain",
"path": "fixture/contact.py",
"copies": "1",
"size": "6700",
"license": "apache-2.0",
"hash": -5236801451142714000,
"line_mean": 39.8597560976,
"line_max": 120,
"alpha_frac": 0.6126865672,
"autogenerated": false,
"ratio": 3.421859039836568,
"config_test... |
__author__ = "OBL"
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def return_to_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("gro... | {
"repo_name": "apridorozhny/pythontrain",
"path": "fixture/group.py",
"copies": "1",
"size": "4737",
"license": "apache-2.0",
"hash": 6866982233858132000,
"line_mean": 31.2244897959,
"line_max": 98,
"alpha_frac": 0.6240236437,
"autogenerated": false,
"ratio": 3.229038854805726,
"config_test": f... |
__author__ = 'octavio'
import json
import requests
import sys
if __name__=='__main__':
if(len(sys.argv)==1):
print("Usage: python following.py <your_username>, without the <>")
exit()
url = "https://api.twitch.tv/kraken/users/"+sys.argv[1]+"/follows/channels"
headers = {"Accept": "application/vnd.twitchtv.v3+jso... | {
"repo_name": "GAoctavio/livestreamer-curses-twitch-following",
"path": "following.py",
"copies": "1",
"size": "1059",
"license": "mit",
"hash": -8844378028257648000,
"line_mean": 32.09375,
"line_max": 173,
"alpha_frac": 0.5580736544,
"autogenerated": false,
"ratio": 2.5518072289156626,
"config... |
__author__ = 'oddBit'
from kivy.uix.carousel import Carousel
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.properties import StringProperty
from data.gameData import *
Builder.load_string('''
#:kivy 1.8.0
<Page>
orientation: 'vertical'
id: helpPage
BoxLayout:
I... | {
"repo_name": "oddbitdev/hexTap",
"path": "HelpMenu.py",
"copies": "1",
"size": "1698",
"license": "bsd-3-clause",
"hash": 1878436332669356000,
"line_mean": 24.3582089552,
"line_max": 73,
"alpha_frac": 0.5954063604,
"autogenerated": false,
"ratio": 3.6127659574468085,
"config_test": false,
"h... |
__author__ = 'oddBit'
from kivy.uix.image import Image
from kivy.animation import Animation
from Player import Player
from data.gameData import *
from random import choice, random
def in_circle(center_x, center_y, radius, x, y):
square_dist = (center_x - x) ** 2 + (center_y - y) ** 2
return square_dist <= ra... | {
"repo_name": "oddbitdev/hexTap",
"path": "HexTile.py",
"copies": "1",
"size": "7847",
"license": "bsd-3-clause",
"hash": -7168592333826051000,
"line_mean": 37.6600985222,
"line_max": 117,
"alpha_frac": 0.5455588123,
"autogenerated": false,
"ratio": 3.399913344887348,
"config_test": false,
"h... |
__author__ = 'oddBit'
from kivy.uix.image import Image
from random import choice
from data.gameData import *
class Player(Image):
def __init__(self, stars, **kwargs):
super(Player, self).__init__(**kwargs)
self.state = PlayerStates.SIT_LEFT
self.source = player_sprites[self.state]
... | {
"repo_name": "oddbitdev/hexTap",
"path": "Player.py",
"copies": "1",
"size": "1471",
"license": "bsd-3-clause",
"hash": 7468919993476044000,
"line_mean": 27.862745098,
"line_max": 76,
"alpha_frac": 0.629503739,
"autogenerated": false,
"ratio": 3.5965770171149143,
"config_test": false,
"has_n... |
__author__ = 'oddBit'
from kivy.uix.scatterlayout import ScatterLayout
from kivy.animation import Animation
from kivy.clock import Clock
from data.gameData import *
from HexTile import HexTile
from UpDownBubble import UpDownBubble
from random import choice, shuffle, random
from kivy.properties import NumericProperty, ... | {
"repo_name": "oddbitdev/hexTap",
"path": "HexScatter.py",
"copies": "1",
"size": "23070",
"license": "bsd-3-clause",
"hash": -4410560956825648000,
"line_mean": 39.8336283186,
"line_max": 146,
"alpha_frac": 0.5548764629,
"autogenerated": false,
"ratio": 3.5662389859329107,
"config_test": false,... |
__author__ = 'oddBit'
from random import choice, random
from data.gameData import *
def get_new_type(current_type):
if random() > 0.8:
return choice(tiles)
else:
return current_type
class Tile:
def __init__(self, row, col, has_player, has_land, type, has_star, has_actor, level, key_typ... | {
"repo_name": "oddbitdev/hexTap",
"path": "MapGenerator.py",
"copies": "1",
"size": "4464",
"license": "bsd-3-clause",
"hash": 4650717267011699000,
"line_mean": 35.2926829268,
"line_max": 236,
"alpha_frac": 0.5105286738,
"autogenerated": false,
"ratio": 3.8482758620689657,
"config_test": false,... |
import unittest
import logging
from ctypes import cdll, CDLL, c_long, c_int, c_float, c_double, c_char_p, create_string_buffer, byref, c_voidp, c_uint8, c_uint32
import sys
import os
class SGXCryptoWrapperError( Exception ):
def __init__( self, errCode ):
msg = "SGX Error 0x%x" % errCode
Exception.__init__( se... | {
"repo_name": "oweisse/sgx_crypto_wrapper",
"path": "sgx_crypto_wrapper.py",
"copies": "1",
"size": "17812",
"license": "mit",
"hash": -4927546900809154000,
"line_mean": 41.2085308057,
"line_max": 196,
"alpha_frac": 0.5982483719,
"autogenerated": false,
"ratio": 3.347491073106559,
"config_test"... |
__author__ = "Ofner Mario"
import pprint
import locale
from datetime import datetime
from mao.filehandling.excel.excel_factory import ExcelFactory
from mao.modules.calendar_generator.sprintcalendar_factory import SprintCalendarMonthColumnRenderer
import mao.toolbox.default_log_config
import logging
from mao.module... | {
"repo_name": "steelion/python-tools",
"path": "scripts/create_calendar.py",
"copies": "1",
"size": "8549",
"license": "mit",
"hash": -5508469773660097000,
"line_mean": 46.7150837989,
"line_max": 135,
"alpha_frac": 0.6123404754,
"autogenerated": false,
"ratio": 2.84984984984985,
"config_test": ... |
__author__ = 'Ofner Mario'
from datetime import datetime
class Logger():
# --------------------------------------------------------------------------------
# - Initializations
# --------------------------------------------------------------------------------
global_log_level = "DEBUG"
log_micros... | {
"repo_name": "steelion/python-tools",
"path": "mao/toolbox/logger.py",
"copies": "1",
"size": "1562",
"license": "mit",
"hash": -9071877192232266000,
"line_mean": 27.9259259259,
"line_max": 113,
"alpha_frac": 0.4609475032,
"autogenerated": false,
"ratio": 4.514450867052023,
"config_test": fals... |
__author__ = 'Ofner Mario'
from mao.reporting.structure.reporting_columns import ReportingColumn
class ReportingTable():
# Key Column
# Key Name and 0based ColumnIndex
kc_name = None
kc_index = None
def __init__(self, column_list = None, key_column = None, header_rowheight = None, data_rowheigh... | {
"repo_name": "steelion/python-tools",
"path": "mao/reporting/structure/reporting_tables.py",
"copies": "1",
"size": "3006",
"license": "mit",
"hash": 6009637215027788000,
"line_mean": 32.4,
"line_max": 110,
"alpha_frac": 0.6314038589,
"autogenerated": false,
"ratio": 3.6793145654834762,
"confi... |
__author__ = 'Ofner Mario'
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl import worksheet
from openpyxl.utils.cell import get_column_letter, column_index_from_string
from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font, Fill, fills
from logging import get... | {
"repo_name": "steelion/python-tools",
"path": "mao/filehandling/excel/excel_factory.py",
"copies": "1",
"size": "13167",
"license": "mit",
"hash": -8380921014255874000,
"line_mean": 33.65,
"line_max": 158,
"alpha_frac": 0.5810738969,
"autogenerated": false,
"ratio": 3.69963472885642,
"config_t... |
__author__ = "Ofner Mario"
import mao.toolbox.default_log_config
from datetime import datetime, date, timedelta
import pprint
import logging
import calendar
# --------------------------------------------------------------------------------
# - Initializations
# -------------------------------------------------------... | {
"repo_name": "steelion/python-tools",
"path": "mao/modules/calendar_generator/sprintcalendar_generator.py",
"copies": "1",
"size": "7973",
"license": "mit",
"hash": -8937994279951066000,
"line_mean": 27.9927272727,
"line_max": 129,
"alpha_frac": 0.5738116142,
"autogenerated": false,
"ratio": 3.6... |
__author__ = 'Ofner Mario'
from datetime import datetime
import pprint
from logging import getLogger
from sprintcalendar_generator import *
logger = getLogger(__name__)
def hex2dec(hex_val):
return int(hex_val, 16)
def dec2hex(dec_val):
# return hex(dec_val)
return "%X" % dec_val
class SprintCalend... | {
"repo_name": "steelion/python-tools",
"path": "mao/modules/calendar_generator/sprintcalendar_factory.py",
"copies": "1",
"size": "16440",
"license": "mit",
"hash": -7458396092500122000,
"line_mean": 40.5151515152,
"line_max": 196,
"alpha_frac": 0.5903892944,
"autogenerated": false,
"ratio": 3.52... |
__author__ = 'Ofner Mario'
import pprint
import svn.local
import svn.remote
from datetime import datetime
import re
from logging import getLogger
logger = getLogger(__name__)
class SVNInterface():
svn_handle = None
def open_svn_connection(self, _svn_url):
self.svn_handle = svn.remote.RemoteCl... | {
"repo_name": "steelion/python-tools",
"path": "mao/source_control/subversion/svn_interface.py",
"copies": "1",
"size": "1591",
"license": "mit",
"hash": 346060256647288300,
"line_mean": 28.462962963,
"line_max": 139,
"alpha_frac": 0.5700817096,
"autogenerated": false,
"ratio": 3.657471264367816,... |
__author__ = 'Ofner Mario'
class ReportingColumn():
def __init__(self, header_description = None, header_font = None, header_data_format = None, header_text_format = None,
cell_font = None, column_data_format = None, column_text_format = None, column_width = None ):
self.header_description = hea... | {
"repo_name": "steelion/python-tools",
"path": "mao/reporting/structure/reporting_columns.py",
"copies": "1",
"size": "2673",
"license": "mit",
"hash": -1465900050674867200,
"line_mean": 32.4125,
"line_max": 123,
"alpha_frac": 0.6034418257,
"autogenerated": false,
"ratio": 3.9366715758468334,
"... |
__author__ = 'oglebrandon'
import inspect
from ib.ext.EWrapper import EWrapper
class_fields = []
refs = EWrapper
for func in dir(refs):
if func[0] != '_':
if inspect.ismethod(eval('refs.' + str(func))):
[class_fields.append(x) for x in inspect.getargspec(eval(
'refs.' + str(func... | {
"repo_name": "CarterBain/Medici",
"path": "ib/client/sync_wrapper_gen.py",
"copies": "1",
"size": "1470",
"license": "bsd-3-clause",
"hash": 2955794691799471000,
"line_mean": 38.7297297297,
"line_max": 117,
"alpha_frac": 0.4829931973,
"autogenerated": false,
"ratio": 3.3333333333333335,
"confi... |
__author__ = 'oglebrandon'
import logging as logger
import types
from ib.ext.EWrapper import EWrapper
from ib.client.Portfolio import Account, AccountMessage, PortfolioMessage
from ib.client.Queries import Contracts, Executions
def showmessage(message, mapping):
try:
del (mapping['self'])
except (Key... | {
"repo_name": "CarterBain/Medici",
"path": "ib/client/sync_wrapper.py",
"copies": "1",
"size": "13466",
"license": "bsd-3-clause",
"hash": -8250662987922133000,
"line_mean": 29.6742596811,
"line_max": 118,
"alpha_frac": 0.5498291995,
"autogenerated": false,
"ratio": 4.355109961190168,
"config_t... |
__author__ = 'oglebrandon'
class Account(object):
def __init__(self):
self._packets = {}
self.child_accounts = []
def __getitem__(self, ref):
return self._packets[ref]
def append_request(self, ref, acct_packet, port_packet):
self._packets[ref] = {'account': acct_packet, 'p... | {
"repo_name": "CarterBain/Medici",
"path": "ib/client/Portfolio.py",
"copies": "1",
"size": "2234",
"license": "bsd-3-clause",
"hash": -8305107406693112000,
"line_mean": 32.8636363636,
"line_max": 123,
"alpha_frac": 0.5935541629,
"autogenerated": false,
"ratio": 3.8057921635434413,
"config_test... |
__author__ = 'oglebrandon'
from logbook import Logger
from ib.ext.Contract import Contract
from ib.ext.ExecutionFilter import ExecutionFilter
from ib.ext.Order import Order as IBOrder
from alephnull.finance.blotter import Blotter
from alephnull.utils.protocol_utils import Enum
from alephnull.finance.slippage import T... | {
"repo_name": "CarterBain/AlephNull",
"path": "alephnull/live/broker.py",
"copies": "1",
"size": "9369",
"license": "apache-2.0",
"hash": -7391155404660353000,
"line_mean": 33.3186813187,
"line_max": 105,
"alpha_frac": 0.5360230548,
"autogenerated": false,
"ratio": 4.2145748987854255,
"config_t... |
__author__ = 'oglebrandon'
import logging as logger
import types
from ib.ext.EWrapper import EWrapper
def showmessage(message, mapping):
try:
del(mapping['self'])
except (KeyError, ):
pass
items = mapping.items()
items.sort()
print '### %s' % (message, )
for k, v in items:
... | {
"repo_name": "CarterBain/Medici",
"path": "ib/client/msg_wrapper.py",
"copies": "1",
"size": "6312",
"license": "bsd-3-clause",
"hash": -2396327049456692700,
"line_mean": 29.0619047619,
"line_max": 79,
"alpha_frac": 0.6036121673,
"autogenerated": false,
"ratio": 4.3561076604554865,
"config_tes... |
__author__ = "ohenry"
__date__ = "2016-11-29 15:38"
__version__ = "1.7"
__all__ = ["NasaAmes"]
import logging
import datetime
import egads
import copy
import re
import os
from egads.input import FileCore
try:
import nappy
logging.info('egads - nasa_ames_io.py - nappy has been imported')
if 'egads' not in n... | {
"repo_name": "eufarn7sp/egads-eufar",
"path": "egads/input/nasa_ames_io.py",
"copies": "2",
"size": "49276",
"license": "bsd-3-clause",
"hash": -4325324410889202700,
"line_mean": 53.2101210121,
"line_max": 176,
"alpha_frac": 0.5123386639,
"autogenerated": false,
"ratio": 4.432092102896204,
"co... |
__author__ = "ohenry"
__date__ = "2017-09-27 08:44"
__version__ = "1.1"
__all__ = ["AltitudePressureIncrementalCnrm"]
import egads.core.egads_core as egads_core
import egads.core.metadata as egads_metadata
import numpy
class AltitudePressureIncrementalCnrm(egads_core.EgadsAlgorithm):
"""
FILE alti... | {
"repo_name": "eufarn7sp/egads-eufar",
"path": "egads/algorithms/thermodynamics/altitude_pressure_incremental_cnrm.py",
"copies": "2",
"size": "5164",
"license": "bsd-3-clause",
"hash": 4335448043029668400,
"line_mean": 55.1304347826,
"line_max": 215,
"alpha_frac": 0.4134391944,
"autogenerated": fa... |
__author__ = "ohenry"
__date__ = "2017-09-28 16:06"
__version__ = "1.1"
__all__ = ['TimeToDecimalYear']
import egads.core.egads_core as egads_core
import egads.core.metadata as egads_metadata
import egads
class TimeToDecimalYear(egads_core.EgadsAlgorithm):
"""
FILE time_to_decimal_year.py
VER... | {
"repo_name": "eufarn7sp/egads-eufar",
"path": "egads/algorithms/transforms/time_to_decimal_year.py",
"copies": "2",
"size": "3567",
"license": "bsd-3-clause",
"hash": 3584127249430367000,
"line_mean": 48.5416666667,
"line_max": 212,
"alpha_frac": 0.4137931034,
"autogenerated": false,
"ratio": 5.... |
__author__ = "ohenry"
__date__ = "2017-1-11 14:52"
__version__ = "0.1"
__all__ = ["NasaAmes"]
import logging
import datetime
import egads
import copy
import re
import os
from egads.input import FileCore
try:
import nappy
logging.info('egads - nasa_ames_io.py - nappy has been imported')
if 'egads' not in na... | {
"repo_name": "eufarn7sp/egads-eufar",
"path": "egads/input/nasa_ames_io_2.py",
"copies": "2",
"size": "10781",
"license": "bsd-3-clause",
"hash": 8308925137555025000,
"line_mean": 42.8292682927,
"line_max": 127,
"alpha_frac": 0.5146090344,
"autogenerated": false,
"ratio": 3.8613896848137537,
"... |
__author__ = 'oier'
# -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand, CommandError
from conference import models
from p3.models import TicketConference
from assopy import models as assopy_models
import csv
import sys
def get_all_order_tickets():
orders = assopy_mode... | {
"repo_name": "artcz/epcon",
"path": "p3/management/commands/get_attendees_csv.py",
"copies": "5",
"size": "5232",
"license": "bsd-2-clause",
"hash": -2171183386122951700,
"line_mean": 29.5964912281,
"line_max": 125,
"alpha_frac": 0.4877675841,
"autogenerated": false,
"ratio": 4.071595330739299,
... |
__author__ = 'oier'
from numpy import exp, cos, linspace
import numpy as np
import matplotlib.pyplot as plt
import os, time, glob
import seaborn as sns
import numpy as np
import pandas as pd
import os
from datetime import datetime
import matplotlib.pyplot as plt
import sys
from matplotlib.figure import Figure
from ... | {
"repo_name": "oiertwo/vampyr",
"path": "flask/compute.py",
"copies": "1",
"size": "2861",
"license": "mit",
"hash": -2542783703858249000,
"line_mean": 25.0181818182,
"line_max": 80,
"alpha_frac": 0.6176162181,
"autogenerated": false,
"ratio": 3.1508810572687223,
"config_test": false,
"has_no... |
__author__ = 'oier'
import json
from flask import Flask, make_response
app = Flask(__name__)
import seaborn as sns
import numpy as np
import pandas as pd
import os
from datetime import datetime
import matplotlib.pyplot as plt
import sys
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg impo... | {
"repo_name": "oiertwo/vampyr",
"path": "flask/index.py",
"copies": "1",
"size": "1592",
"license": "mit",
"hash": 2601201973839485000,
"line_mean": 22.4264705882,
"line_max": 75,
"alpha_frac": 0.6488693467,
"autogenerated": false,
"ratio": 3.685185185185185,
"config_test": false,
"has_no_key... |
__author__ = 'oier'
import os
import numpy as np
from data.parameters import true_params
from data.parameters import false_params
import distance as dist
import numpy as np
def pdftotext(path):
os.system("pdftotext {data}".format(data=path))
return(path.replace(".pdf",".txt"))
import pandas as pd
def parse(p... | {
"repo_name": "oiertwo/vampyr",
"path": "pdftoexcel.py",
"copies": "1",
"size": "8194",
"license": "mit",
"hash": -6777632973228448000,
"line_mean": 24.8485804416,
"line_max": 105,
"alpha_frac": 0.4616792775,
"autogenerated": false,
"ratio": 3.6662192393736017,
"config_test": false,
"has_no_k... |
__author__ = 'oier'
import os
import subprocess
def extractText(path, dest='', params=''):
'''
:param path:
:param params:
:return:
'''
'''
Usage: java -jar pdfbox-app-x.y.z.jar ExtractText [OPTIONS] <PDF file> [Text File]
-password <password> Password to decrypt do... | {
"repo_name": "oiertwo/vampyr",
"path": "extractText.py",
"copies": "1",
"size": "1875",
"license": "mit",
"hash": -7830970650153555000,
"line_mean": 36.52,
"line_max": 107,
"alpha_frac": 0.5018666667,
"autogenerated": false,
"ratio": 4.496402877697841,
"config_test": false,
"has_no_keywords"... |
__author__ = 'oier'
from django.core.management.base import BaseCommand, CommandError
from conference import models
from p3.models import TicketConference
from assopy import models as assopy_models
import csv
import sys
def get_all_order_tickets():
orders = assopy_models.Order.objects.filter... | {
"repo_name": "EuroPython/epcon",
"path": "p3/management/commands/get_attendees_csv.py",
"copies": "1",
"size": "5215",
"license": "bsd-2-clause",
"hash": 5891983529000636000,
"line_mean": 29.4970760234,
"line_max": 125,
"alpha_frac": 0.4882070949,
"autogenerated": false,
"ratio": 4.0837901331245... |
__author__ = 'olav'
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import qgis.utils
from qgis.utils import iface
from qgis.gui import *
import sys
import os
import os.path
import shutil
import math
'''
Reads a folder under tiles, where each file have it's bounding box in the filename... | {
"repo_name": "olavvatne/MapDataset",
"path": "vector/tile_writer.py",
"copies": "1",
"size": "2584",
"license": "mit",
"hash": 6315158083398399000,
"line_mean": 28.0449438202,
"line_max": 83,
"alpha_frac": 0.6931114551,
"autogenerated": false,
"ratio": 3.459170013386881,
"config_test": false,
... |
__author__ = 'olav'
import numpy as np
import sys, os
import scipy.ndimage as morph
from PIL import Image
sys.path.append(os.path.abspath("./"))
from augmenter.aerial import Creator
from data import AerialDataset
import tools.util as util
import augmenter.util as aug
'''
TODO: Save points to file.
'''
class Precisi... | {
"repo_name": "olavvatne/CNN",
"path": "tools/measurement/precisionrecall.py",
"copies": "1",
"size": "7029",
"license": "mit",
"hash": 3568831708792734000,
"line_mean": 41.343373494,
"line_max": 121,
"alpha_frac": 0.6335182814,
"autogenerated": false,
"ratio": 3.9334079462786793,
"config_test"... |
__author__ = 'Olav'
import os, sys, random
from PIL import Image
'''
Tool for examining the tiles and vectors. It opens a random tile and label. Superimpose label onto tile, and displays
the resulting image to the user. The user can choose to proceed by clicking enter in console.
'''
tiles_dir ='../result/dataset/til... | {
"repo_name": "olavvatne/MapDataset",
"path": "examine/examine.py",
"copies": "1",
"size": "1454",
"license": "mit",
"hash": 7400553308697760000,
"line_mean": 29.2916666667,
"line_max": 117,
"alpha_frac": 0.6327372765,
"autogenerated": false,
"ratio": 3.18859649122807,
"config_test": false,
"... |
__author__ = 'Olav'
'''
Simpler version of the creator. The pickle files became very large.
Formatter will instead process all tiles by putting them into a single folder, which can be loaded
and processed by CNN
'''
import os, sys
import random
import shutil
dataset_dir = '../result/dataset/tiles/'
vector_dir = '..... | {
"repo_name": "olavvatne/MapDataset",
"path": "dataset/formatter.py",
"copies": "1",
"size": "2476",
"license": "mit",
"hash": 110833288295154640,
"line_mean": 30.7435897436,
"line_max": 119,
"alpha_frac": 0.6070274637,
"autogenerated": false,
"ratio": 3.8808777429467085,
"config_test": false,
... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
from mock import patch
from nose.tools import eq_
from proxmoxer import ProxmoxAPI
from .base.base_ssh_suite import BaseSSHSuite
@patch('paramiko.SSHClient')
def test_paramiko_connection(_):
proxmox = ProxmoxAPI('proxm... | {
"repo_name": "petzah/proxmoxer",
"path": "tests/paramiko_tests.py",
"copies": "1",
"size": "1657",
"license": "mit",
"hash": -3655551367597957600,
"line_mean": 36.6590909091,
"line_max": 91,
"alpha_frac": 0.547978274,
"autogenerated": false,
"ratio": 3.9358669833729216,
"config_test": false,
... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
import os
import imp
import posixpath
import logging
# Python 3 compatibility:
try:
import httplib
except ImportError: # py3
from http import client as httplib
try:
import urlparse
except ImportError: # py3
... | {
"repo_name": "petzah/proxmoxer",
"path": "proxmoxer/core.py",
"copies": "1",
"size": "3407",
"license": "mit",
"hash": 5167336299522346000,
"line_mean": 29.1504424779,
"line_max": 108,
"alpha_frac": 0.604637511,
"autogenerated": false,
"ratio": 3.71943231441048,
"config_test": false,
"has_no... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
from itertools import chain
import json
class Response(object):
def __init__(self, content, status_code):
self.status_code = status_code
self.content = content
self.headers = {"content-type": "... | {
"repo_name": "petzah/proxmoxer",
"path": "proxmoxer/backends/base_ssh.py",
"copies": "1",
"size": "2105",
"license": "mit",
"hash": -2525289211159959000,
"line_mean": 27.4459459459,
"line_max": 109,
"alpha_frac": 0.5914489311,
"autogenerated": false,
"ratio": 3.9943074003795065,
"config_test":... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
from proxmoxer.backends.base_ssh import ProxmoxBaseSSHSession, BaseBackend
try:
import openssh_wrapper
except ImportError:
import sys
sys.stderr.write("Chosen backend requires 'openssh_wrapper' module\n")
s... | {
"repo_name": "petzah/proxmoxer",
"path": "proxmoxer/backends/openssh.py",
"copies": "1",
"size": "1783",
"license": "mit",
"hash": 1557133278917659600,
"line_mean": 36.1458333333,
"line_max": 97,
"alpha_frac": 0.528323051,
"autogenerated": false,
"ratio": 4.327669902912621,
"config_test": true... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
import json
import sys
try:
import requests
urllib3 = requests.packages.urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from requests.auth import AuthBase
from requests.cooki... | {
"repo_name": "petzah/proxmoxer",
"path": "proxmoxer/backends/https.py",
"copies": "1",
"size": "3866",
"license": "mit",
"hash": 7791357164753553000,
"line_mean": 31.2166666667,
"line_max": 125,
"alpha_frac": 0.6083807553,
"autogenerated": false,
"ratio": 3.920892494929006,
"config_test": fals... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__licence__ = 'MIT'
import os
from proxmoxer.backends.base_ssh import ProxmoxBaseSSHSession, BaseBackend
try:
import paramiko
except ImportError:
import sys
sys.stderr.write("Chosen backend requires 'paramiko' module\n")
sys.e... | {
"repo_name": "petzah/proxmoxer",
"path": "proxmoxer/backends/ssh_paramiko.py",
"copies": "1",
"size": "2453",
"license": "mit",
"hash": -5563651930683482000,
"line_mean": 32.1486486486,
"line_max": 93,
"alpha_frac": 0.5373012638,
"autogenerated": false,
"ratio": 4.193162393162393,
"config_test... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2017'
__licence__ = 'MIT'
import importlib
import posixpath
import logging
# Python 3 compatibility:
try:
import httplib
except ImportError: # py3
from http import client as httplib
try:
import urlparse
except ImportError: # py3
fr... | {
"repo_name": "swayf/proxmoxer",
"path": "proxmoxer/core.py",
"copies": "1",
"size": "3694",
"license": "mit",
"hash": 6119760039629947000,
"line_mean": 29.0325203252,
"line_max": 112,
"alpha_frac": 0.5906876015,
"autogenerated": false,
"ratio": 3.8399168399168397,
"config_test": false,
"has_... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2017'
__licence__ = 'MIT'
import io
from mock import patch
from nose.tools import eq_
from proxmoxer import ProxmoxAPI
from .base.base_ssh_suite import BaseSSHSuite
@patch('paramiko.SSHClient')
def test_paramiko_connection(_):
proxmox = Proxmox... | {
"repo_name": "swayf/proxmoxer",
"path": "tests/paramiko_tests.py",
"copies": "1",
"size": "2555",
"license": "mit",
"hash": -724675769051370400,
"line_mean": 37.7121212121,
"line_max": 102,
"alpha_frac": 0.5906066536,
"autogenerated": false,
"ratio": 3.7408491947291362,
"config_test": false,
... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2017'
__licence__ = 'MIT'
from itertools import chain
import json
import re
class Response(object):
def __init__(self, content, status_code):
self.status_code = status_code
self.content = content
self.headers = {"conten... | {
"repo_name": "swayf/proxmoxer",
"path": "proxmoxer/backends/base_ssh.py",
"copies": "1",
"size": "2368",
"license": "mit",
"hash": -2557178492411119000,
"line_mean": 28.9746835443,
"line_max": 121,
"alpha_frac": 0.5916385135,
"autogenerated": false,
"ratio": 3.9270315091210612,
"config_test": ... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2017'
__licence__ = 'MIT'
import json
import sys
try:
import requests
urllib3 = requests.packages.urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from requests.auth import AuthBase
from requests.cooki... | {
"repo_name": "swayf/proxmoxer",
"path": "proxmoxer/backends/https.py",
"copies": "1",
"size": "4895",
"license": "mit",
"hash": -2908624622760476000,
"line_mean": 32.0743243243,
"line_max": 125,
"alpha_frac": 0.6147088866,
"autogenerated": false,
"ratio": 3.9412238325281805,
"config_test": fal... |
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2017'
__licence__ = 'MIT'
import os
from proxmoxer.backends.base_ssh import ProxmoxBaseSSHSession, BaseBackend
try:
import paramiko
except ImportError:
import sys
sys.stderr.write("Chosen backend requires 'paramiko' module\n")
sys.e... | {
"repo_name": "swayf/proxmoxer",
"path": "proxmoxer/backends/ssh_paramiko.py",
"copies": "1",
"size": "2585",
"license": "mit",
"hash": 8333612070424229000,
"line_mean": 32.141025641,
"line_max": 105,
"alpha_frac": 0.5230174081,
"autogenerated": false,
"ratio": 4.2727272727272725,
"config_test"... |
__author__ = 'Olek'
#################################### Usage ####################################
# results = Results() //init
# results.best(x) //best contest result for kos0x.in
# results.solver1(x) //solver1 result for kos0x.in
# print(results.solver1(x, y)) //solver1 result for y mini test ... | {
"repo_name": "ant6/BO-kosiarka",
"path": "results.py",
"copies": "1",
"size": "2894",
"license": "mit",
"hash": -1683364013481130800,
"line_mean": 36.5844155844,
"line_max": 92,
"alpha_frac": 0.4675190048,
"autogenerated": false,
"ratio": 4.37821482602118,
"config_test": true,
"has_no_keywor... |
__author__ = 'Oleksandr Pylkevych'
def cigar_party(cigars, is_weekend):
if is_weekend:
return cigars >= 40
else:
return 40 <= cigars <= 60
def date_fashion(you, date):
if date <= 2 or you <= 2:
return 0
elif date >= 8 or you >= 8:
return 2
else:
return 1
... | {
"repo_name": "amazpyel/sqa_training",
"path": "Codingbat/Python/Logic_1.py",
"copies": "1",
"size": "1310",
"license": "mit",
"hash": 2101952595118526500,
"line_mean": 19.7936507937,
"line_max": 79,
"alpha_frac": 0.5328244275,
"autogenerated": false,
"ratio": 3.126491646778043,
"config_test": ... |
__author__ = 'Oleksandr Pylkevych'
def count_evens(nums):
count = 0
for i in range(len(nums)):
if nums[i] % 2 == 0:
count += 1
return count
def big_diff(nums):
return max(nums) - min(nums)
def centered_average(nums):
max_nums = nums[0]
min_nums = nums[0]
for i in ra... | {
"repo_name": "amazpyel/sqa_training",
"path": "Codingbat/Python/List_2.py",
"copies": "1",
"size": "1195",
"license": "mit",
"hash": -5691871911382201000,
"line_mean": 19.2542372881,
"line_max": 62,
"alpha_frac": 0.4560669456,
"autogenerated": false,
"ratio": 3.2037533512064345,
"config_test":... |
__author__ = 'Oleksandr Pylkevych'
def monkey_trouble(a_smile, b_smile):
return a_smile == b_smile
def sleep_in(weekday, vacation):
return vacation or (weekday == vacation)
def sum_double(a, b):
if a == b:
return 2 * (a + b)
return a + b
def diff21(n):
if n <= 21:
return 21 -... | {
"repo_name": "amazpyel/sqa_training",
"path": "Codingbat/Python/Warmup_1.py",
"copies": "1",
"size": "1073",
"license": "mit",
"hash": 1574413690561624000,
"line_mean": 16.3064516129,
"line_max": 55,
"alpha_frac": 0.5340167754,
"autogenerated": false,
"ratio": 2.7164556962025315,
"config_test"... |
__author__ = 'Oleksandr Pylkevych'
def string_times(str, n):
return str * n
def front_times(str, n):
if len(str) < 3:
return str * n
return str[:3] * n
def string_bits(str):
result = ""
for s in range(len(str)):
if s % 2 == 0:
result = result + str[s]
return res... | {
"repo_name": "amazpyel/sqa_training",
"path": "Codingbat/Python/Warmup_2.py",
"copies": "1",
"size": "1538",
"license": "mit",
"hash": -5431227808807800000,
"line_mean": 17.756097561,
"line_max": 69,
"alpha_frac": 0.4921976593,
"autogenerated": false,
"ratio": 3.0698602794411176,
"config_test"... |
__author__ = 'olesya'
import api_request
import logging
import json
class MeetupApi(api_request.ApiRequest):
def __init__(self):
self.source = "meetup"
self.settings = self.get_settings(self.source)
def request_events(self, city=None, category=None, date_and_time=None, city_num=10,... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/meetup_api.py",
"copies": "1",
"size": "3933",
"license": "mit",
"hash": -3941917079726461400,
"line_mean": 39.8404255319,
"line_max": 120,
"alpha_frac": 0.4836003051,
"autogenerated": false,
"ratio": 4.247300215982722,
... |
__author__ = 'olesya'
from api_request import ApiRequest
from meetup_api import MeetupApi
from eventbrite_api import EventbriteApi
class SearchEventsUsingAPI():
def request_events(self, city=None, category=None, date_and_time=None, city_num=10, radius="1"):
apirequst_object = ApiRequest()
... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/sources_wrapper.py",
"copies": "1",
"size": "1182",
"license": "mit",
"hash": -7517488273397075000,
"line_mean": 38.7586206897,
"line_max": 101,
"alpha_frac": 0.6429780034,
"autogenerated": false,
"ratio": 3.5495495495495... |
__author__ = 'olesya'
from google.appengine.ext import ndb
from datetime import datetime
class Event(ndb.Model):
id = ndb.StringProperty()
name = ndb.StringProperty()
date = ndb.DateTimeProperty()
city = ndb.StringProperty()
address = ndb.StringProperty()
description = ndb.TextPro... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/models/event.py",
"copies": "1",
"size": "1949",
"license": "mit",
"hash": -4973136692550099000,
"line_mean": 24.3378378378,
"line_max": 56,
"alpha_frac": 0.5366854797,
"autogenerated": false,
"ratio": 4.051975051975052,
"conf... |
__author__ = 'olesya'
import api_request
import logging
import json
import datetime
import time
class EventbriteApi(api_request.ApiRequest):
def __init__(self):
self.source = "eventbrite"
self.settings = self.get_settings(self.source)
def request_events(self, city=None, category=... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/eventbrite_api.py",
"copies": "1",
"size": "3459",
"license": "mit",
"hash": 6769225792634122000,
"line_mean": 41.2375,
"line_max": 121,
"alpha_frac": 0.5059265684,
"autogenerated": false,
"ratio": 4.172496984318456,
"c... |
__author__ = 'olesya'
import unittest
from engine.api_request import ApiRequest
from engine.sources_wrapper import SearchEventsUsingAPI
from engine.eventbrite_api import EventbriteApi
import json
from google.appengine.ext import ndb
from google.appengine.ext import testbed
try:
from google.appengine.... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/tests/eventbrite_tester.py",
"copies": "1",
"size": "3337",
"license": "mit",
"hash": 2627430493549556000,
"line_mean": 35.1,
"line_max": 90,
"alpha_frac": 0.6385975427,
"autogenerated": false,
"ratio": 3.7578828828828827,
"co... |
__author__ = 'olesya'
import webapp2
from engine.DAL import DAL
class UserDetailsHandler(webapp2.RequestHandler):
def get(self):
mydb = DAL()
token = self.request.get("token")
if token is "":
self.post(-1)
else:
try:
json_respo... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/user_details.py",
"copies": "1",
"size": "1099",
"license": "mit",
"hash": 6859521998652732000,
"line_mean": 27.7567567568,
"line_max": 75,
"alpha_frac": 0.5459508644,
"autogenerated": false,
"ratio": 4.116104868913857,
"c... |
__author__ = 'olesya'
import unittest
from engine.DAL import DAL
from engine.search_events_interface import SearchEventsUsingAPI
from models.user import User
from datetime import datetime
import json
from google.appengine.ext import ndb
from google.appengine.ext import testbed
class UserDetails(unitt... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/tests/attendees_tester.py",
"copies": "1",
"size": "3409",
"license": "mit",
"hash": 7941585910050007000,
"line_mean": 38.1294117647,
"line_max": 176,
"alpha_frac": 0.6124963332,
"autogenerated": false,
"ratio": 3.18003731343283... |
__author__ = 'olesya'
sources = ["meetup", "eventbrite"]
meetup_settings ={'URL_PATTERN': "https://api.meetup.com/find/open_events?",
'URL_PATTERN_CITIES': "http://api.meetup.com/2/cities",
'API_KEY': "185c2b3e44c4b4644365a3022d5a2f"}
meetup_categories = {"Career": 2, # C... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/defenitions.py",
"copies": "1",
"size": "2000",
"license": "mit",
"hash": -578946379788607900,
"line_mean": 45.6666666667,
"line_max": 125,
"alpha_frac": 0.477,
"autogenerated": false,
"ratio": 3.053435114503817,
"confi... |
__author__ = 'olesya'
#This class is suppose to access to DB and transfer answers to other classe
#For the time the server is under development it will retrieve fake data
from google.appengine.ext import ndb
from models.User import User
from models.Event import Event
from models.Attendings import Attendings
... | {
"repo_name": "shaipeer/ATTENDER",
"path": "server/attender-mobile/DAL.py",
"copies": "1",
"size": "3129",
"license": "mit",
"hash": 8310887257380055000,
"line_mean": 26.9722222222,
"line_max": 75,
"alpha_frac": 0.5787791627,
"autogenerated": false,
"ratio": 3.555681818181818,
"config_test": fa... |
__author__ = 'olesya'
#This class is suppose to access to DB and transfer answers to other classes
from models.user import User
from models.event import Event
from models.attendings import Attendings
import json
from time import mktime
from facebook_logic import fb_logic
import logging
class DAL():
@s... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/DAL.py",
"copies": "1",
"size": "7978",
"license": "mit",
"hash": 6808824253119178000,
"line_mean": 31.6624472574,
"line_max": 127,
"alpha_frac": 0.5088994736,
"autogenerated": false,
"ratio": 3.8081145584725538,
"confi... |
# """ This examples shows how to run a job on a remote PBS/TORQUE cluster
# using the 'PBS' job adaptor.
# More information about the saga-python job API can be found at:
# http://saga-project.github.com/saga-python/doc/library/job/index.html
# """
import sys
import saga
SAGA_VERBOSE = 'DEBUG'
def ma... | {
"repo_name": "mehdisadeghi/saga-python",
"path": "tests/issues/issue_241.py",
"copies": "5",
"size": "3079",
"license": "mit",
"hash": -5984091076243781000,
"line_mean": 32.4673913043,
"line_max": 75,
"alpha_frac": 0.5813575836,
"autogenerated": false,
"ratio": 3.4988636363636365,
"config_test... |
__author__ = 'Olga'
from model.contact import Contact
class ContactHelper :
def __init__(self, app):
self.app = app
def open_home_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/addressbook/")) :
wd.find_element_by_link_text("home").click()
def create(s... | {
"repo_name": "rata-mahata/python-training",
"path": "fixture/contact.py",
"copies": "1",
"size": "3635",
"license": "apache-2.0",
"hash": -2235866290126098000,
"line_mean": 32.9719626168,
"line_max": 86,
"alpha_frac": 0.5939477304,
"autogenerated": false,
"ratio": 3.498556304138595,
"config_te... |
__author__ = 'Olga'
from model.group import Group
class GroupHelper:
def __init__(self, app) :
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))>0) :
wd.find_element_by_link_t... | {
"repo_name": "rata-mahata/python-training",
"path": "fixture/group.py",
"copies": "1",
"size": "3533",
"license": "apache-2.0",
"hash": 6786372301176080000,
"line_mean": 31.712962963,
"line_max": 99,
"alpha_frac": 0.5907161053,
"autogenerated": false,
"ratio": 3.4501953125,
"config_test": fals... |
__author__ = 'olga'
import pandas as pd
import numpy as np
def binify(df, bins=(0, 0.25, 0.75, 1)):
"""
Given a dataframe of events on the rows and samples on the columns,
and their scores in the matrix, calculate the proportion of each event's
scores that fall into the bin's range.
Each event wi... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/math/__init__.py",
"copies": "1",
"size": "1532",
"license": "mit",
"hash": 2650222377830786000,
"line_mean": 29.0392156863,
"line_max": 80,
"alpha_frac": 0.6096605744,
"autogenerated": false,
"ratio": 3.316017316017316,
"config_test": false,
... |
__author__ = 'olga'
import re
import sys
import pandas as pd
import numpy as np
def counts_pair_to_ints(x):
x = x.split(':')
isoforms = tuple(map(int, x[0].strip('()').split(',')))
counts = int(x[1].rstrip(','))
return isoforms, counts
def counts_col_to_dict(counts):
return dict(map(counts_pair... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/miso/filter_miso.py",
"copies": "1",
"size": "2305",
"license": "mit",
"hash": 6917724435757465000,
"line_mean": 33.9242424242,
"line_max": 86,
"alpha_frac": 0.6047722343,
"autogenerated": false,
"ratio": 3.809917355371901,
"config_test": false... |
__author__ = 'Olga'
class SessionHelper :
def __init__(self, app) :
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by... | {
"repo_name": "rata-mahata/python-training",
"path": "fixture/session.py",
"copies": "1",
"size": "1282",
"license": "apache-2.0",
"hash": 7251488183453620000,
"line_mean": 31.8974358974,
"line_max": 94,
"alpha_frac": 0.5655226209,
"autogenerated": false,
"ratio": 3.32987012987013,
"config_test... |
__author__ = 'olga'
from glob import iglob, glob
from gscripts.qtools._Submitter import Submitter
import sys
import os
from gscripts.qtools import Submitter
import argparse
import os
class CommandLine(object):
def __init__(self, inOpts=None):
self.parser = parser = argparse.ArgumentParser(
de... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/rnaseq/cufflinks.py",
"copies": "1",
"size": "4672",
"license": "mit",
"hash": 2751876499974195000,
"line_mean": 38.2605042017,
"line_max": 91,
"alpha_frac": 0.5244006849,
"autogenerated": false,
"ratio": 4.337975858867224,
"config_test": false... |
__author__ = 'olga'
from glob import iglob, glob
from gscripts.qtools._Submitter import Submitter
import sys
import os
import argparse
from glob import glob
import sys
from gscripts.qtools._Submitter import Submitter
class CommandLine(object):
"""
Check out the argparse documentation for more awesome things ... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/mapping/fastq_filters.py",
"copies": "1",
"size": "3993",
"license": "mit",
"hash": 2536139169948634000,
"line_mean": 35.6330275229,
"line_max": 79,
"alpha_frac": 0.5311795642,
"autogenerated": false,
"ratio": 4.340217391304348,
"config_test": ... |
__author__ = 'olga'
from matplotlib.cbook import iterable
from prettyplotlib.utils import remove_chartjunk, maybe_get_ax
from prettyplotlib.colors import pretty
@pretty
def hist(*args, **kwargs):
"""
Plots a histogram of the provided data. Can provide optional argument
"grid='x'" or "grid='y'" to draw a... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_hist.py",
"copies": "1",
"size": "1320",
"license": "mit",
"hash": -7853801760909199000,
"line_mean": 32,
"line_max": 109,
"alpha_frac": 0.6257575758,
"autogenerated": false,
"ratio": 3.656509695290859,
"config_test": false,
"has_... |
__author__ = 'olga'
from prettyplotlib.colors import light_grey, almost_black
from prettyplotlib.utils import maybe_get_ax
def legend(*args, **kwargs):
"""
@param args:
@type args:
@param kwargs: Any keyword arguments to matplotlib's plt.legend()
Optional 'facecolor' keyword to change the faceco... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_legend.py",
"copies": "1",
"size": "1047",
"license": "mit",
"hash": -4414445712569494500,
"line_mean": 26.5526315789,
"line_max": 70,
"alpha_frac": 0.6389684814,
"autogenerated": false,
"ratio": 3.93609022556391,
"config_test": fal... |
__author__ = 'olga'
from prettyplotlib import utils
from prettyplotlib.colors import almost_black, pretty
@pretty
def scatter(*args, **kwargs):
"""
This will plot a scatterplot of x and y, iterating over the ColorBrewer
"Set2" color cycle unless a color is specified. The symbols produced are
empty ci... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_scatter.py",
"copies": "1",
"size": "1318",
"license": "mit",
"hash": 7156472933989981000,
"line_mean": 35.6111111111,
"line_max": 76,
"alpha_frac": 0.684370258,
"autogenerated": false,
"ratio": 3.865102639296188,
"config_test": fal... |
__author__ = 'olga'
from prettyplotlib.utils import maybe_get_ax, remove_chartjunk
from prettyplotlib.colors import set2, almost_black, getcolors
import numpy as np
import collections
def barh(*args, **kwargs):
"""
Creates a bar plot, with white outlines and a fill color that defaults to
the first teal-i... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_barh.py",
"copies": "1",
"size": "5548",
"license": "mit",
"hash": 9173331102649873000,
"line_mean": 34.7935483871,
"line_max": 117,
"alpha_frac": 0.6038211968,
"autogenerated": false,
"ratio": 3.7870307167235495,
"config_test": fal... |
__author__ = 'olga'
import matplotlib as mpl
import matplotlib.pyplot as plt
def remove_chartjunk(ax, spines, grid=None, ticklabels=None, show_ticks=False,
xkcd=False):
'''
Removes "chartjunk", such as extra lines of axes and tick marks.
If grid="y" or "x", will add a white grid at ... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/utils.py",
"copies": "1",
"size": "4403",
"license": "mit",
"hash": 7461109387666366000,
"line_mean": 29.5763888889,
"line_max": 78,
"alpha_frac": 0.5362253009,
"autogenerated": false,
"ratio": 3.6149425287356323,
"config_test": fals... |
__author__ = 'olga'
import matplotlib.pyplot as plt
from prettyplotlib.utils import remove_chartjunk, maybe_get_ax
from prettyplotlib import colors
def boxplot(*args, **kwargs):
"""
Create a box-and-whisker plot showing the mean, 25th percentile, and 75th
percentile. The difference from matplotlib is only... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_boxplot.py",
"copies": "1",
"size": "1756",
"license": "mit",
"hash": -2452481940050725400,
"line_mean": 33.431372549,
"line_max": 77,
"alpha_frac": 0.6725512528,
"autogenerated": false,
"ratio": 3.533199195171026,
"config_test": fa... |
__author__ = 'olga'
import numpy as np
from prettyplotlib.colors import blue_red, blues_r, reds
from prettyplotlib.utils import remove_chartjunk, maybe_get_fig_ax
def pcolormesh(*args, **kwargs):
"""
Use for large datasets
Non-traditional `pcolormesh` kwargs are:
- xticklabels, which will put x tic... | {
"repo_name": "olgabot/prettyplotlib",
"path": "prettyplotlib/_pcolormesh.py",
"copies": "1",
"size": "4451",
"license": "mit",
"hash": 7235158395512099000,
"line_mean": 34.3253968254,
"line_max": 78,
"alpha_frac": 0.6146933273,
"autogenerated": false,
"ratio": 3.6999168744804654,
"config_test"... |
__author__ = 'olga'
import pandas as pd
def max_csv(x):
'''
Of integers separated by commas, take the max
e.g. 75112684,75112684 would return 75112684
or 75112684,75112689 would return 75112689
'''
return max(map(int, x.split(',')))
def min_csv(x):
'''
Of integers separated by comma... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/miso/__init__.py",
"copies": "1",
"size": "1969",
"license": "mit",
"hash": 1188497922550647000,
"line_mean": 36.8846153846,
"line_max": 76,
"alpha_frac": 0.5957338751,
"autogenerated": false,
"ratio": 3.3260135135135136,
"config_test": false,
... |
__author__ = 'Olga'
import pymc as pm
import pandas as pd
from collections import Counter
def _assign_modality_from_estimate(mean_alpha, mean_beta):
"""
Given estimated alpha and beta parameters from an Markov Chain Monte Carlo
run, assign a modality.
"""
# check if one parameter is much larger t... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/rnaseq/splicing_modality.py",
"copies": "1",
"size": "3374",
"license": "mit",
"hash": -5641349066063737000,
"line_mean": 31.7669902913,
"line_max": 78,
"alpha_frac": 0.5927682276,
"autogenerated": false,
"ratio": 3.2163965681601527,
"config_te... |
__author__ = 'olga'
import string
from matplotlib.testing.decorators import image_comparison
import numpy as np
from matplotlib.colors import LogNorm
import six
import prettyplotlib as ppl
from prettyplotlib import brewer2mpl
if six.PY3:
LOWERCASE_CHARS = string.ascii_lowercase
UPPERCASE_CHARS = string.asc... | {
"repo_name": "olgabot/prettyplotlib",
"path": "tests/test_pcolormesh.py",
"copies": "1",
"size": "3815",
"license": "mit",
"hash": -2182678137823787500,
"line_mean": 32.1739130435,
"line_max": 84,
"alpha_frac": 0.6406290957,
"autogenerated": false,
"ratio": 3.2578992314261317,
"config_test": t... |
__author__ = 'olga'
import unittest
from gscripts.mapping.map_paired_or_single_with_STAR import MapSTAR
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.o... | {
"repo_name": "YeoLab/gscripts",
"path": "tests/test_map_paired_or_single_with_STAR.py",
"copies": "1",
"size": "2464",
"license": "mit",
"hash": 6034698604874919000,
"line_mean": 45.5094339623,
"line_max": 595,
"alpha_frac": 0.606737013,
"autogenerated": false,
"ratio": 3.23784494086728,
"conf... |
__author__ = 'olga'
import unittest
from gscripts.mapping.sam_to_bam_and_sort import SamToBamAndSort
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.out_... | {
"repo_name": "YeoLab/gscripts",
"path": "tests/test_sam_to_bam_and_sort.py",
"copies": "1",
"size": "1318",
"license": "mit",
"hash": 4929835986774133000,
"line_mean": 25.38,
"line_max": 72,
"alpha_frac": 0.6198786039,
"autogenerated": false,
"ratio": 2.871459694989107,
"config_test": true,
... |
__author__ = 'olga'
import unittest
from gscripts.mapping.sort_bam import SortBam
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.out_dir)
def test_... | {
"repo_name": "YeoLab/gscripts",
"path": "tests/test_sort_bam.py",
"copies": "1",
"size": "1574",
"license": "mit",
"hash": 618338686829868000,
"line_mean": 28.1666666667,
"line_max": 117,
"alpha_frac": 0.6404066074,
"autogenerated": false,
"ratio": 2.8880733944954127,
"config_test": true,
"h... |
__author__ = 'olga'
import unittest
from gscripts.rnaseq.count_bam import CountBam
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.out_dir)
def test... | {
"repo_name": "YeoLab/gscripts",
"path": "tests/test_count_bam.py",
"copies": "1",
"size": "1358",
"license": "mit",
"hash": -5539269590312968000,
"line_mean": 25.1346153846,
"line_max": 116,
"alpha_frac": 0.6089837997,
"autogenerated": false,
"ratio": 2.9267241379310347,
"config_test": true,
... |
__author__ = 'olga'
import unittest
from gscripts.rnaseq.rpkm_from_counts import RPKMfromCounts
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.out_dir)
... | {
"repo_name": "YeoLab/gscripts",
"path": "tests/test_rpkm_from_counts.py",
"copies": "1",
"size": "1394",
"license": "mit",
"hash": 3890812440780392000,
"line_mean": 25.8269230769,
"line_max": 90,
"alpha_frac": 0.6276901004,
"autogenerated": false,
"ratio": 2.7549407114624507,
"config_test": tr... |
__author__ = 'olga'
def three_prime_motif(coordinate, strand, into_exon, into_intron,
debug=False):
"""
Returns 20 bases of end of the intron, and 3 bases of the beginning of the exon
"""
# If both are None, return None
if into_exon is None and into_intron is None:
re... | {
"repo_name": "YeoLab/gscripts",
"path": "gscripts/annotations/miso.py",
"copies": "1",
"size": "12059",
"license": "mit",
"hash": 6527180041344968000,
"line_mean": 45.9260700389,
"line_max": 149,
"alpha_frac": 0.494817149,
"autogenerated": false,
"ratio": 3.7613849033063005,
"config_test": fal... |
__author__ = 'olga.ostapenko'
from model.contact import Contact
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
self.app.open_home_page()
# init contact creation
wd.find_element_by_link_text("add new").click()
... | {
"repo_name": "oostapenko84/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "8301",
"license": "apache-2.0",
"hash": -438562133486743040,
"line_mean": 53.2614379085,
"line_max": 105,
"alpha_frac": 0.6186001687,
"autogenerated": false,
"ratio": 3.237519500780031,
"config_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.