text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'User'
from django import template
from django.core.urlresolvers import reverse
import re
from buzzit_models.models import User, Circle_message
register = template.Library()
def messagefilter(message):
"""
:param message:
:return:
"""
message_text = message.text
# parse mentions
... | {
"repo_name": "jmennen/group5",
"path": "Code/buzzit/buzzit_app/templatetags/messagefilters.py",
"copies": "1",
"size": "1910",
"license": "bsd-2-clause",
"hash": -1344470575034311200,
"line_mean": 34.3703703704,
"line_max": 105,
"alpha_frac": 0.5895287958,
"autogenerated": false,
"ratio": 3.1993... |
__author__ = 'User'
from model.contact import Contact
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "generator/contact.py",
"copies": "2",
"size": "1873",
"license": "apache-2.0",
"hash": 4674513950360546000,
"line_mean": 35.7450980392,
"line_max": 127,
"alpha_frac": 0.6412172985,
"autogenerated": false,
"ratio": 3.50749063670412,
"config_test"... |
__author__ = 'User'
from model.contact import Contact
import re
from selenium.webdriver.support.ui import Select
class ContactHelper:
def __init__(self, app):
self.app = app
def clean(self, contact):
return Contact(id=contact.id, firstname=contact.firstname.strip(),
... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "fixture/contact.py",
"copies": "1",
"size": "12243",
"license": "apache-2.0",
"hash": 3113141798183103000,
"line_mean": 41.9614035088,
"line_max": 129,
"alpha_frac": 0.6022216777,
"autogenerated": false,
"ratio": 3.5060137457044673,
"config_test... |
__author__ = 'User'
from model.group import Group
import random
import string
import os.path
import getopt
import sys
import time
import clr
clr.AddReferenceByName('Microsoft.Office.Interop.Excel') #, Version=0.0.0.0, Culture=neutral, PublicKeyToken=')
from Microsoft.Office.Interop import Excel
try:
opts, arg... | {
"repo_name": "SvetlanaPopova/ironpython_training",
"path": "generator/group.py",
"copies": "1",
"size": "1249",
"license": "apache-2.0",
"hash": 489232231524182300,
"line_mean": 21.7272727273,
"line_max": 111,
"alpha_frac": 0.6501200961,
"autogenerated": false,
"ratio": 3.0915841584158414,
"co... |
__author__ = 'User'
from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "d... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "generator/group.py",
"copies": "1",
"size": "1050",
"license": "apache-2.0",
"hash": -3189334997611928600,
"line_mean": 24.6341463415,
"line_max": 113,
"alpha_frac": 0.6228571429,
"autogenerated": false,
"ratio": 3.28125,
"config_test": false,
... |
__author__ = 'User'
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_tex... | {
"repo_name": "DmitriyNeurov/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3991",
"license": "apache-2.0",
"hash": 2699168387143928000,
"line_mean": 31.9834710744,
"line_max": 100,
"alpha_frac": 0.586569782,
"autogenerated": false,
"ratio": 3.449438202247191,
"config_tes... |
__author__ = 'User'
from model.group import Group
def clean(group):
return Group(id=group.id, name=group.name.strip())
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... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "fixture/group.py",
"copies": "1",
"size": "5005",
"license": "apache-2.0",
"hash": 1719475585138516000,
"line_mean": 34.4964539007,
"line_max": 97,
"alpha_frac": 0.5922077922,
"autogenerated": false,
"ratio": 3.35455764075067,
"config_test": fal... |
__author__ = 'User'
from model.project import Project
from selenium.webdriver.support.ui import Select
class ProjectHelper:
def __init__(self, app):
self.app = app
def open_manage_proj_page(self):
wd = self.app.wd
wd.get(self.app.base_url + "/manage_proj_page.php")
def change_fi... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "fixture/project.py",
"copies": "1",
"size": "4609",
"license": "apache-2.0",
"hash": -3823260198457242600,
"line_mean": 40.5315315315,
"line_max": 113,
"alpha_frac": 0.606856151,
"autogenerated": false,
"ratio": 3.5867704280155643,
"config_... |
__author__ = 'User'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column="gr... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "fixture/orm.py",
"copies": "1",
"size": "3286",
"license": "apache-2.0",
"hash": 7165095202774322000,
"line_mean": 43.4189189189,
"line_max": 142,
"alpha_frac": 0.6579427876,
"autogenerated": false,
"ratio": 3.768348623853211,
"config_test": fal... |
__author__ = 'User'
from pony.orm import *
from datetime import datetime
from model.project import Project
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMProject(db.Entity):
_table_ = 'mantis_project_table'
id = PrimaryKey(int, column="id")
name = ... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "fixture/orm.py",
"copies": "1",
"size": "2158",
"license": "apache-2.0",
"hash": -8476594097847745000,
"line_mean": 36.8771929825,
"line_max": 118,
"alpha_frac": 0.6329935125,
"autogenerated": false,
"ratio": 3.9596330275229357,
"config_tes... |
__author__ = 'user'
from props.dependency_tree.definitions import *
# present - "As a result, U.S. Trust's earnings have been hurt"
def passive_VBN_child(predicate,passive_child):
if predicate.pos == VBN and passive_child.pos == VBN:
return (TENSE_PRESENT,(passive_child.id,passive_child.id))
# present - "... | {
"repo_name": "gabrielStanovsky/props",
"path": "props/dependency_tree/Tense/tense_rules.py",
"copies": "1",
"size": "9408",
"license": "mit",
"hash": -1482346915647931600,
"line_mean": 47,
"line_max": 149,
"alpha_frac": 0.6731505102,
"autogenerated": false,
"ratio": 2.9980879541108987,
"config... |
__author__ = 'user'
from Requests import tradingApi
from Requests import findingApi
from additionalStaff import *
def gen_HTML(items):
HTML = ""
for item in items:
HTML += "\n <div> <H3>"+item['title']+'</H3><p></p><img src='+\
item['galleryURL'] +"/><p>"+item['price']['value']+item['pric... | {
"repo_name": "Azarieled/GiftRecommenderSystem",
"path": "backend/Gifts/getRecommendations/Categories.py",
"copies": "1",
"size": "1210",
"license": "apache-2.0",
"hash": -767620343298933100,
"line_mean": 38.0322580645,
"line_max": 147,
"alpha_frac": 0.5859504132,
"autogenerated": false,
"ratio":... |
__author__ = 'User'
from suds.client import Client
from suds import WebFault
from model.project import Project
class SoapHelper:
def __init__(self, app):
self.app = app
def can_login(self, username, password):
client = Client("http://localhost/mantisbt-1.2.19/api/soap/mantisconnect.php?wsdl"... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "fixture/soap.py",
"copies": "1",
"size": "1409",
"license": "apache-2.0",
"hash": -1419702982967666200,
"line_mean": 35.1282051282,
"line_max": 117,
"alpha_frac": 0.5990063875,
"autogenerated": false,
"ratio": 4.144117647058824,
"config_tes... |
__author__ = 'User'
from sys import maxsize
import re
class Contact:
def __init__(self, firstname=None, lastname=None, nickname=None, title=None, company=None, address=None,
homephone=None, mobilephone=None, workphone=None, secondaryphone=None, fax=None, homepage=None, id=None,
... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "model/contact.py",
"copies": "1",
"size": "2291",
"license": "apache-2.0",
"hash": -4159983169175052300,
"line_mean": 42.2452830189,
"line_max": 123,
"alpha_frac": 0.5800960279,
"autogenerated": false,
"ratio": 3.659744408945687,
"config_test": ... |
__author__ = 'user'
import httplib2
import json
class ZendeskClient:
def __init__(self, url, login, password):
self._http = httplib2.Http(disable_ssl_certificate_validation=True)
self._url = url
self._http.add_credentials(login, password)
def _rest_url(self):
return self._url +... | {
"repo_name": "softintouch/python-youtrack-api",
"path": "sit_youtrack/zendesk/zendeskClient.py",
"copies": "1",
"size": "2831",
"license": "apache-2.0",
"hash": -3815639256089989000,
"line_mean": 32.7023809524,
"line_max": 115,
"alpha_frac": 0.5736488873,
"autogenerated": false,
"ratio": 3.725,
... |
__author__ = 'User'
import mysql.connector
from model.group import Group
from model.contact import Contact
class Dbfixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql.co... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "fixture/db.py",
"copies": "1",
"size": "2039",
"license": "apache-2.0",
"hash": 6281880628547918000,
"line_mean": 42.4042553191,
"line_max": 119,
"alpha_frac": 0.5855811672,
"autogenerated": false,
"ratio": 4.212809917355372,
"config_test": fals... |
__author__ = 'user'
import pymel.core as pm
class optionVar_utils():
def __init__(self):
pass
@staticmethod
def set_option_var(variable, value):
pm.optionVar(stringValue=(variable, value))
@staticmethod
def get_option_var(variable):
if not pm.optionVar[variable]:
... | {
"repo_name": "tb-animator/tbtools",
"path": "apps/tb_optionVars.py",
"copies": "1",
"size": "2879",
"license": "mit",
"hash": 209759536110024420,
"line_mean": 35.9102564103,
"line_max": 83,
"alpha_frac": 0.6220910038,
"autogenerated": false,
"ratio": 3.8644295302013423,
"config_test": false,
... |
__author__ = 'User'
import struct
from struct import unpack
def decode_rgb565(color_val):
b = (color_val & 0b11111) * (256//32)
g = ((color_val >> 5) & 0b111111) * (256//64)
r = ((color_val >> 11) & 0b11111) * (256//32)
return r, g, b, 255
def addrgba(col1, col2):
return col1[0]+col2[0], col1[1]... | {
"repo_name": "RenolY2/battalion-tools",
"path": "pim_extract_bw2.py",
"copies": "1",
"size": "8530",
"license": "mit",
"hash": 612408923627074600,
"line_mean": 33.8163265306,
"line_max": 116,
"alpha_frac": 0.4053927315,
"autogenerated": false,
"ratio": 3.742869679684072,
"config_test": false,
... |
__author__ = 'user'
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import pa... | {
"repo_name": "SynBioDex/pySBOL",
"path": "setup.py",
"copies": "1",
"size": "5942",
"license": "apache-2.0",
"hash": -1091991133691603200,
"line_mean": 35.6790123457,
"line_max": 174,
"alpha_frac": 0.6457421744,
"autogenerated": false,
"ratio": 3.695273631840796,
"config_test": true,
"has_no... |
__author__ = 'user'
class AdditionalInformationAndInformationForPrice(models.Model):
additionalinformation = models.ForeignKey(AdditionalInformationForPrice,
verbose_name=_(u'Информация для прайса', ),
null=False,
... | {
"repo_name": "AlexStarov/Shop",
"path": "applications/product/save_model.py",
"copies": "1",
"size": "2900",
"license": "apache-2.0",
"hash": 4240102260547954000,
"line_mean": 43.3225806452,
"line_max": 102,
"alpha_frac": 0.5462154294,
"autogenerated": false,
"ratio": 3.62532981530343,
"config... |
__author__ = 'User'
class InvalidArgumentError(Exception):
def __str__(self):
return "Invalid argument passed to SGAQueue constructor: argument " + \
"init_vals must be a list with at least one element"
class Node:
__slots__ = ["idx", "next"]
def __init__(self, idx, next=None):
... | {
"repo_name": "k-kapp/CycleDating",
"path": "cycle_dating/Algos/Utilities/SGAQueue.py",
"copies": "1",
"size": "1858",
"license": "apache-2.0",
"hash": 7975769741050661000,
"line_mean": 25.1690140845,
"line_max": 79,
"alpha_frac": 0.5538213132,
"autogenerated": false,
"ratio": 3.5938104448742747,... |
__author__ = 'User'
class Node:
__slots__ = ["idx", "next_node", "prev_node"]
def __init__(self, idx, prev_node, next_node):
self.idx = idx
self.next_node = next_node
self.prev_node = prev_node
class LinkedListEIISR:
def __init__(self):
self.root = None
self.back ... | {
"repo_name": "k-kapp/CycleDating",
"path": "cycle_dating/Algos/Utilities/LinkedListEIISR.py",
"copies": "1",
"size": "2593",
"license": "apache-2.0",
"hash": 7785201133159188000,
"line_mean": 28.4659090909,
"line_max": 100,
"alpha_frac": 0.5283455457,
"autogenerated": false,
"ratio": 3.774381368... |
__author__ = 'User'
def Treasure_Islands(game):
#this function return a list with the islands that have treasures. The list sorted by the value of the treasure islands
#if both treasure islands have the same value the sorting will be by the capture turns.
treasure_islands = []
island_values = (1, 2, 4... | {
"repo_name": "ido777/Skillz",
"path": "starter_kit/bots/Skillz/Barel/Func_SortTreasureIslands.py",
"copies": "1",
"size": "1121",
"license": "mit",
"hash": 7490859149201874000,
"line_mean": 42.1538461538,
"line_max": 123,
"alpha_frac": 0.5896520963,
"autogenerated": false,
"ratio": 3.76174496644... |
__author__ = 'USER'
from analyzer import text_handler
from analyzer import text_analyzer
from analyzer import ngram
from analyzer import filter
from common import fileio
from common import math_util
from collections import OrderedDict
def collect_preference_from_file(file_path, filter_files=0):
"""
Collect m... | {
"repo_name": "ParkJinSang/Logle",
"path": "analyzer/preference_analyzer.py",
"copies": "1",
"size": "3934",
"license": "mit",
"hash": 7888937190867313000,
"line_mean": 37.1941747573,
"line_max": 154,
"alpha_frac": 0.6939501779,
"autogenerated": false,
"ratio": 4.02661207778915,
"config_test": ... |
__author__ = 'USER'
from collections import OrderedDict
from os import listdir
from analyzer import text_analyzer
from analyzer import ngram
from common import fileio
class DocumentAnalyzer:
'''
Document analyzer for constructing word data set.
'''
def __init__(self, root_dir):
self.word_cnt_m... | {
"repo_name": "ParkJinSang/Logle",
"path": "analyzer/document_analyzer.py",
"copies": "1",
"size": "1056",
"license": "mit",
"hash": -5880276542479237000,
"line_mean": 34.2,
"line_max": 78,
"alpha_frac": 0.6051136364,
"autogenerated": false,
"ratio": 3.5436241610738257,
"config_test": false,
... |
__author__ = 'USER'
from learning.mlp.neuralnetwork import NeuralNetwork
def learning(mlp, training_input, training_output):
threshold = 0.00001
iteration = 0
learning_iteration = 1000000
training_set_count = len(training_input)
print("Training the network using input data......")
while iter... | {
"repo_name": "ParkJinSang/Logle",
"path": "learning/mlp/learning.py",
"copies": "1",
"size": "1549",
"license": "mit",
"hash": 6099254138644846000,
"line_mean": 43.2571428571,
"line_max": 142,
"alpha_frac": 0.6417043254,
"autogenerated": false,
"ratio": 3.7688564476885644,
"config_test": false... |
__author__ = 'User'
from model.contact import Contact
from model.group import Group
import random
def get_group_list(app, orm):
group_list = orm.get_group_list()
if group_list == []:
app.group.create(Group(name="Group_Contact"))
group_list = orm.get_group_list()
return group_list
def ch... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "test/test_contact_in_group.py",
"copies": "1",
"size": "5084",
"license": "apache-2.0",
"hash": -7207827846601282000,
"line_mean": 49.3465346535,
"line_max": 120,
"alpha_frac": 0.6648308419,
"autogenerated": false,
"ratio": 3.2736638763683192,
"... |
__author__ = 'User'
from model.contact import Contact
from random import randrange
def test_check_data_of_some_contact_on_home_page(app):
index = randrange(app.contact.count())
contact_from_home_page = app.contact.get_contact_list_all()[index]
contact_from_edit_page = app.contact.get_contact_info_from_e... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "test/test_check_data_of_contacts.py",
"copies": "1",
"size": "1696",
"license": "apache-2.0",
"hash": 7796066943535937000,
"line_mean": 59.5714285714,
"line_max": 129,
"alpha_frac": 0.6733490566,
"autogenerated": false,
"ratio": 3.4056224899598395... |
__author__ = 'user'
from PyQt4 import Qt, QtGui
class QColorComboBox(QtGui.QComboBox):
ColorNames = ["darkGreen", "green", "gray", "red", "white", "blue", "cyan", "darkMagenta", "yellow",
"darkRed", "black", "magenta"]
ColorRole = Qt.Qt.UserRole + 1
def __init__(self, parent=None):
... | {
"repo_name": "vlaznev/gui_plotter",
"path": "plot_window/color_picker.py",
"copies": "1",
"size": "1419",
"license": "mit",
"hash": -48099799798734580,
"line_mean": 30.5333333333,
"line_max": 104,
"alpha_frac": 0.5828047921,
"autogenerated": false,
"ratio": 3.8983516483516483,
"config_test": f... |
__author__ = 'User'
from pytest_bdd import given, when, then
from model.contact import Contact
import random
@given('a contact list')
def contact_list(db):
return db.get_contact_list()
@given('a contact with <firstname>, <lastname>, <address> and <mobilephone>')
def new_contact(firstname, lastname, address, mobi... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "bdd/contact_stepts.py",
"copies": "1",
"size": "2301",
"license": "apache-2.0",
"hash": 1589023548262997200,
"line_mean": 41.6111111111,
"line_max": 100,
"alpha_frac": 0.7457627119,
"autogenerated": false,
"ratio": 3.408888888888889,
"config_tes... |
__author__ = 'User'
from pytest_bdd import given, when, then
from model.group import Group
import random
@given('a group list')
def group_list(db):
return db.get_group_list()
@given('a group with <name>, <header> and <footer>')
def new_group(app, name, header, footer):
return Group(name=name, header=header,... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "bdd/group_stepts.py",
"copies": "1",
"size": "1356",
"license": "apache-2.0",
"hash": -7072739591631193000,
"line_mean": 32.0731707317,
"line_max": 84,
"alpha_frac": 0.7050147493,
"autogenerated": false,
"ratio": 3.067873303167421,
"config_test"... |
__author__ = 'User'
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.project import ProjectHelper
from fixture.james import JamesHelper
from fixture.signup import SignupHelper
from fixture.mail import MailHelper
from fixture.soap import SoapHelper
class Application:
def __in... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "fixture/application.py",
"copies": "1",
"size": "1263",
"license": "apache-2.0",
"hash": 3693163784975980500,
"line_mean": 26.4782608696,
"line_max": 65,
"alpha_frac": 0.6128266033,
"autogenerated": false,
"ratio": 4.087378640776699,
"confi... |
__author__ = 'User'
from sys import maxsize
class Project:
def __init__(self, name=None, status=None, inherit_gl_categories=None,
view_status=None, description=None, id=None, enabled=None):
self.name = name
self.status = status
self.inherit_gl_categories = inherit_gl_cate... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "model/project.py",
"copies": "1",
"size": "1087",
"license": "apache-2.0",
"hash": -4845419800241225000,
"line_mean": 34.064516129,
"line_max": 121,
"alpha_frac": 0.5860165593,
"autogenerated": false,
"ratio": 3.8409893992932864,
"config_te... |
__author__ = 'User'
from telnetlib import Telnet
class JamesHelper:
def __init__(self, app):
self.app = app
def unsure_user_exists(self, username, password):
james_config = self.app.config['james']
session = JamesHelper.Session(
james_config['host'], james_config['port'],... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "fixture/james.py",
"copies": "1",
"size": "1728",
"license": "apache-2.0",
"hash": -5507154153140542000,
"line_mean": 33.58,
"line_max": 107,
"alpha_frac": 0.5729166667,
"autogenerated": false,
"ratio": 3.814569536423841,
"config_test": tru... |
__author__ = 'USER'
import collections
from collections import OrderedDict
def ngram_analyze(n, contents):
"""
Analyze contents with n-gram algorithm.
:param n: N unit to split text.
:param contents: Text to analyze.
:return: N-gram analyzed dictionary.
"""
ngram_dictionary = OrderedDict()... | {
"repo_name": "ParkJinSang/Logle",
"path": "analyzer/ngram.py",
"copies": "1",
"size": "1459",
"license": "mit",
"hash": 4630975747027652000,
"line_mean": 24.5964912281,
"line_max": 86,
"alpha_frac": 0.54283756,
"autogenerated": false,
"ratio": 3.849604221635884,
"config_test": false,
"has_no... |
__author__ = 'User'
import copy
import time
from cycle_dating.Algos import optim_virtual
from cycle_dating.Utilities import use_data as ud, series
from cycle_dating.Algos.Utilities.LinkedListEIISR import LinkedListEIISR
def combo_loop_help(lst, curr_idx, curr_num, total_num, all_els, all_perms):
"""
Helper f... | {
"repo_name": "k-kapp/CycleDating",
"path": "cycle_dating/Algos/eiisr.py",
"copies": "1",
"size": "11062",
"license": "apache-2.0",
"hash": -7997757448378444000,
"line_mean": 38.9350180505,
"line_max": 136,
"alpha_frac": 0.5712348581,
"autogenerated": false,
"ratio": 3.632840722495895,
"config_... |
__author__ = 'user'
import dnaplotlib as dpl
import dnaplotlib.sbol as dpl_sbol
import sbol as sbol
import matplotlib.pyplot as plt
# Import the SBOL design file
doc = sbol.Document()
doc.read('gene_cassette.sbol')
# In this case, we know ahead of time the URI of the design. In some cases, you may have to explore t... | {
"repo_name": "VoigtLab/dnaplotlib",
"path": "gallery/sbol_visual/sbol_visual.py",
"copies": "1",
"size": "1222",
"license": "mit",
"hash": 8927986340529354000,
"line_mean": 26.1555555556,
"line_max": 160,
"alpha_frac": 0.7274959083,
"autogenerated": false,
"ratio": 2.944578313253012,
"config_t... |
__author__ = 'user'
import itertools
import re
import PyQt4.QtGui as QtGui
class InputParser(object):
def __init__(self, pattern, groups):
self.pattern = pattern
self.regex = re.compile(pattern)
self.groups = groups
def parse(self, line):
res = self.regex.search(line)
... | {
"repo_name": "vlaznev/gui_plotter",
"path": "plot_window/input_parsers.py",
"copies": "1",
"size": "1174",
"license": "mit",
"hash": 1107561159662666900,
"line_mean": 22.5,
"line_max": 79,
"alpha_frac": 0.538330494,
"autogenerated": false,
"ratio": 3.7628205128205128,
"config_test": false,
"... |
__author__ = 'User'
import matplotlib.pyplot as plt
from numpy import mean, std, asarray
import time
import numpy as np
import copy
def same_sign(x, y):
if (x*y > 0):
return True
if (x*y == 0):
# this is so that the leftmost point in a flat area will be the only remaining point
if not(... | {
"repo_name": "k-kapp/CycleDating",
"path": "cycle_dating/Utilities/series.py",
"copies": "1",
"size": "13755",
"license": "apache-2.0",
"hash": -7902846205259167000,
"line_mean": 35.3888888889,
"line_max": 122,
"alpha_frac": 0.568956743,
"autogenerated": false,
"ratio": 3.9559965487489217,
"co... |
__author__ = 'USER'
import os.path
from collections import OrderedDict
from os import listdir
from analyzer import ngram
from common import fileio
from common import math_util
from analyzer import similarity
import _operator
class TextAnalyzer:
dir_path = ""
dict_map = None
def __init__(self, dir_path):... | {
"repo_name": "ParkJinSang/Logle",
"path": "analyzer/text_analyzer.py",
"copies": "1",
"size": "6282",
"license": "mit",
"hash": 3446167140852148000,
"line_mean": 31.5492227979,
"line_max": 112,
"alpha_frac": 0.6141356256,
"autogenerated": false,
"ratio": 3.9237976264834478,
"config_test": fals... |
__author__ = 'user'
import pygame
import pygame.locals
from pygame.locals import *
from sys import exit
import random
import time
debug = False
# These are just shortcuts for the different colors I use.
red = (255,0,0)
blue = (0,0,255)
yellow = (255,255,0)
green = (0,255,0)
white = (255,255,255)
players = int(input... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "sinsojae_mid_final/지존컴활123/test.py",
"copies": "1",
"size": "15587",
"license": "mit",
"hash": -3133143068054131000,
"line_mean": 31.2676348548,
"line_max": 120,
"alpha_frac": 0.5886324182,
"autogenerated": false,
"ratio": 2.78527936962... |
__author__ = 'USER'
import random
from common import math_util
class NeuralNetwork:
@property
def output_matrix(self):
return self._output_matrix
@output_matrix.setter
def output_matrix(self, __output_matrix):
self._output_matrix = __output_matrix
@output_matrix.deleter
def ou... | {
"repo_name": "ParkJinSang/Logle",
"path": "learning/mlp/neuralnetwork.py",
"copies": "1",
"size": "8413",
"license": "mit",
"hash": -2683564094297896000,
"line_mean": 39.4471153846,
"line_max": 227,
"alpha_frac": 0.5964578628,
"autogenerated": false,
"ratio": 3.5171404682274248,
"config_test":... |
__author__ = 'USER'
import re
from common import fileio
class Filter:
# filter file
# filter regex
# filter matchlist
pass
def filter_from_file_to_dict(filter_file, target_dict):
filter_list = fileio.read_file_lines(filter_file)
for filter_elem in filter_list:
filter_elem = filte... | {
"repo_name": "ParkJinSang/Logle",
"path": "analyzer/filter.py",
"copies": "1",
"size": "2032",
"license": "mit",
"hash": -3476407850170941400,
"line_mean": 25.3896103896,
"line_max": 76,
"alpha_frac": 0.6190944882,
"autogenerated": false,
"ratio": 3.5277777777777777,
"config_test": false,
"h... |
__author__ = 'User'
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list_all()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_ed... | {
"repo_name": "SvetlanaPopova/python_1",
"path": "test/test_phones.py",
"copies": "1",
"size": "1245",
"license": "apache-2.0",
"hash": -8536416108940587000,
"line_mean": 41.9655172414,
"line_max": 126,
"alpha_frac": 0.6706827309,
"autogenerated": false,
"ratio": 3.2849604221635884,
"config_tes... |
__author__ = 'User'
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": "DmitriyNeurov/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1426",
"license": "apache-2.0",
"hash": -8597355145473133000,
"line_mean": 28.7083333333,
"line_max": 73,
"alpha_frac": 0.5638148668,
"autogenerated": false,
"ratio": 3.316279069767442,
"config_... |
__author__ = 'user'
class User:
def __init__(self, age, sex, hobbies, user_type, categories_str=None, already_gifted=None):
"""
:param age: int
:param sex: "Male"/"Female"
:param hobbies: list of words (one word per string)
:param user_type: dict{type1, type2, type3, type4... | {
"repo_name": "Azarieled/GiftRecommenderSystem",
"path": "backend/Gifts/getRecommendations/RS/User.py",
"copies": "1",
"size": "1444",
"license": "apache-2.0",
"hash": 463279734699623700,
"line_mean": 33.380952381,
"line_max": 101,
"alpha_frac": 0.5699445983,
"autogenerated": false,
"ratio": 3.43... |
__author__ = 'USER'
from crawler import crawlbot
from analyzer import filter
from analyzer import preference_analyzer
from analyzer import text_handler
from common import math_util
import gensim
def condition_minable(contents):
dirpath = "../learning/data/preferences_doc/"
# It seems like using DF not IDF?... | {
"repo_name": "ParkJinSang/Logle",
"path": "sample/web_robot.py",
"copies": "1",
"size": "1338",
"license": "mit",
"hash": 7967720844335072000,
"line_mean": 26.875,
"line_max": 147,
"alpha_frac": 0.6860986547,
"autogenerated": false,
"ratio": 3.413265306122449,
"config_test": false,
"has_no_k... |
__author__ = 'USER'
from learning.svm.libsvm.svm import *
from learning.svm.libsvm.svmutil import *
from os import listdir
from common import fileio
"""
preflist = listdir('../learning/data/preferences_print/')
noiselist = listdir('../learning/data/noise_print/')
validatelist = listdir('../learning/data/validation_p... | {
"repo_name": "ParkJinSang/Logle",
"path": "sample/svm_learn.py",
"copies": "1",
"size": "1634",
"license": "mit",
"hash": -6581479337276619000,
"line_mean": 28.1785714286,
"line_max": 112,
"alpha_frac": 0.6585067319,
"autogenerated": false,
"ratio": 2.9547920433996384,
"config_test": true,
"... |
__author__ = 'User'
from model.project import Project
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of project", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 2... | {
"repo_name": "SvetlanaPopova/python_mantis",
"path": "generator/project.py",
"copies": "1",
"size": "1209",
"license": "apache-2.0",
"hash": 6578368628708256000,
"line_mean": 25.8666666667,
"line_max": 126,
"alpha_frac": 0.6311000827,
"autogenerated": false,
"ratio": 3.4056338028169013,
"confi... |
__author__ = 'USER'
import logging, gensim, bz2
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
from collections import defaultdict
import multiprocessing
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
from common import fileio
import ... | {
"repo_name": "ParkJinSang/Logle",
"path": "sample/train_word2vec_model.py",
"copies": "1",
"size": "1448",
"license": "mit",
"hash": -5519353181782490000,
"line_mean": 27.96,
"line_max": 117,
"alpha_frac": 0.7285911602,
"autogenerated": false,
"ratio": 3.1894273127753303,
"config_test": false,... |
__author__ = 'User'
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": "SvetlanaPopova/python_1",
"path": "fixture/session.py",
"copies": "1",
"size": "1427",
"license": "apache-2.0",
"hash": -3412112473832641000,
"line_mean": 28.1224489796,
"line_max": 73,
"alpha_frac": 0.5634197617,
"autogenerated": false,
"ratio": 3.3735224586288415,
"config_test"... |
__author__ = 'user'
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copy... | {
"repo_name": "AlexStarov/Shop",
"path": "compat/socks/socks.py",
"copies": "1",
"size": "16195",
"license": "apache-2.0",
"hash": 6782423682039964000,
"line_mean": 41.1744791667,
"line_max": 136,
"alpha_frac": 0.6089533807,
"autogenerated": false,
"ratio": 3.963534018600098,
"config_test": fal... |
__author__="UShareSoft"
__date__ ="$Jan 21, 2014 5:48:54 PM$"
import argparse
class ArgumentParserError(Exception): pass
class ArgumentParser(argparse.ArgumentParser):
def error(self, message):
raise ArgumentParserError(message)
def format_help(self):
formatter = s... | {
"repo_name": "jbremond/ussclicore",
"path": "src/ussclicore/argumentParser.py",
"copies": "1",
"size": "2970",
"license": "apache-2.0",
"hash": -4009278228263173600,
"line_mean": 38.6133333333,
"line_max": 108,
"alpha_frac": 0.5060606061,
"autogenerated": false,
"ratio": 5.689655172413793,
"co... |
__author__="UShareSoft"
# Copyright 2007-2015 UShareSoft SAS, All rights reserved
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | {
"repo_name": "MaxTakahashi/hammr",
"path": "hammr/commands/format/format.py",
"copies": "1",
"size": "2988",
"license": "apache-2.0",
"hash": -2765341580932908000,
"line_mean": 38.84,
"line_max": 145,
"alpha_frac": 0.6057563588,
"autogenerated": false,
"ratio": 4.324167872648336,
"config_test"... |
__author__="UShareSoft"
# Copyright (c) 2007-2019 UShareSoft, All rights reserved
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | {
"repo_name": "segalaj/hammr",
"path": "hammr/commands/format/format.py",
"copies": "3",
"size": "2988",
"license": "apache-2.0",
"hash": -3602642336949680600,
"line_mean": 38.84,
"line_max": 145,
"alpha_frac": 0.6050870147,
"autogenerated": false,
"ratio": 4.311688311688312,
"config_test": fal... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from uforgecli.utils.uforgecli_utils import *
from ussclicore.cmd import Cmd, CoreGlobal
from uforgecli.utils import org_utils
from ussclicore.utils.generics_utils import order_list_objec... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/org/org_repo.py",
"copies": "1",
"size": "13105",
"license": "apache-2.0",
"hash": 5834676541697388000,
"line_mean": 53.152892562,
"line_max": 229,
"alpha_frac": 0.5175887066,
"autogenerated": false,
"ratio": 4.93039879608728... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from marketplacecli.utils import org_utils
from ussclicore.utils import printer
from ussclicore.utils import generics_utils
from marketplacecli.... | {
"repo_name": "pedrolegold/marketplace-cli",
"path": "src/marketplacecli/commands/usercmds/usercmds.py",
"copies": "1",
"size": "11736",
"license": "apache-2.0",
"hash": -186131849109356600,
"line_mean": 44.1384615385,
"line_max": 119,
"alpha_frac": 0.5472051806,
"autogenerated": false,
"ratio": ... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from marketplace.objects.marketplace import *
from marketplacecli.utils import org_utils
from ussclicore.utils import printer
from marketplacecl... | {
"repo_name": "pedrolegold/marketplace-cli",
"path": "src/marketplacecli/commands/usercmds/user_role_cmds.py",
"copies": "1",
"size": "7453",
"license": "apache-2.0",
"hash": -1626777737633532400,
"line_mean": 41.8333333333,
"line_max": 203,
"alpha_frac": 0.5643365088,
"autogenerated": false,
"ra... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from uforgecli.utils import org_utils
from uforgecli.utils.compare_utils import compare
from ussclicore.utils import printer
from ussclicore.uti... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/subscription/subscription_format.py",
"copies": "1",
"size": "9044",
"license": "apache-2.0",
"hash": -2481491539999755000,
"line_mean": 57.7337662338,
"line_max": 253,
"alpha_frac": 0.4788810261,
"autogenerated": false,
"rat... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from ussclicore.utils.generics_utils import *
from uforgecli.utils import org_utils
from ussclicore.utils import printer
#from role_entitlements... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/role/role.py",
"copies": "1",
"size": "10781",
"license": "apache-2.0",
"hash": -9184497536178100000,
"line_mean": 51.3349514563,
"line_max": 356,
"alpha_frac": 0.5161858826,
"autogenerated": false,
"ratio": 4.891560798548094... |
__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from ussclicore.utils import printer
from marketplacecli.utils import marketplace_utils
class EntitlementCmds(Cmd, CoreGlobal):
"""Manage ... | {
"repo_name": "pedrolegold/marketplace-cli",
"path": "src/marketplacecli/commands/entitlementcmds/entitlementcmds.py",
"copies": "1",
"size": "1557",
"license": "apache-2.0",
"hash": -8575384524656597000,
"line_mean": 34.3863636364,
"line_max": 86,
"alpha_frac": 0.6236351959,
"autogenerated": false... |
__author__ = "UShareSoft"
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from texttable import Texttable
from uforgecli.utils.org_utils import org_get
from uforgecli.utils import org_utils
from ussclicore.utils import generics_utils, printer
from u... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/user/user_admin.py",
"copies": "1",
"size": "6350",
"license": "apache-2.0",
"hash": 299499549319039800,
"line_mean": 51.0491803279,
"line_max": 261,
"alpha_frac": 0.5377952756,
"autogenerated": false,
"ratio": 4.481298517995... |
__author__="UShareSoft"
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from texttable import Texttable
from uforgecli.utils.org_utils import org_get
from ussclicore.utils import generics_utils, printer, ascii_bar_graph
from uforgecli.utils.uforgecli... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/user/user_quota.py",
"copies": "1",
"size": "8990",
"license": "apache-2.0",
"hash": -8534544909167659000,
"line_mean": 57,
"line_max": 271,
"alpha_frac": 0.4352614016,
"autogenerated": false,
"ratio": 5.448484848484848,
"c... |
__author__ = "UShareSoft"
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from texttable import Texttable
from uforgecli.utils.org_utils import org_get
from ussclicore.utils import generics_utils, printer
from uforgecli.utils.uforgecli_utils import *... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/user/user_role.py",
"copies": "1",
"size": "9079",
"license": "apache-2.0",
"hash": 464417912087705150,
"line_mean": 50.5852272727,
"line_max": 262,
"alpha_frac": 0.4871681903,
"autogenerated": false,
"ratio": 5.0494994438264... |
__author__="UShareSoft"
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from texttable import Texttable
from uforgecli.utils.org_utils import org_get
from ussclicore.utils import generics_utils, printer
from uforgecli.utils.uforgecli_utils import *
f... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/user/user_api.py",
"copies": "1",
"size": "3506",
"license": "apache-2.0",
"hash": 1642417324780220000,
"line_mean": 40.2588235294,
"line_max": 174,
"alpha_frac": 0.5519110097,
"autogenerated": false,
"ratio": 4.5180412371134... |
__author__="UShareSoft"
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from texttable import Texttable
from user_format import User_Format_Cmd
from user_admin import User_Admin_Cmd
from user_quota import User_Quota_Cmd
from user_os import User_Os_Cm... | {
"repo_name": "pedrolegold/uforge-cli",
"path": "src/uforgecli/commands/user/user.py",
"copies": "1",
"size": "14931",
"license": "apache-2.0",
"hash": -9108532941302828000,
"line_mean": 51.573943662,
"line_max": 263,
"alpha_frac": 0.4788694662,
"autogenerated": false,
"ratio": 4.85718932986337,
... |
__author__ = "UShareSoft"
import requests
from hurry.filesize import size
from progressbar import Bar, ETA, Percentage, ProgressBar
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import printer
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
class Download:
def __ini... | {
"repo_name": "usharesoft/ussclicore",
"path": "src/ussclicore/utils/download_utils.py",
"copies": "1",
"size": "1691",
"license": "apache-2.0",
"hash": 178506752073605280,
"line_mean": 34.9787234043,
"line_max": 84,
"alpha_frac": 0.6303962153,
"autogenerated": false,
"ratio": 3.9509345794392523,... |
__author__ = 'UShareSoft'
"""
* Compare a list values attributs with a given value to return
* a new list that include only the matched values.
*
* @param list The list to analyse first
* @param values The values the attributs will be compared to.
* @param attrNa... | {
"repo_name": "pedrolegold/marketplace-cli",
"path": "src/marketplacecli/utils/compare_utils.py",
"copies": "1",
"size": "3126",
"license": "apache-2.0",
"hash": -5032236281663656000,
"line_mean": 52.9137931034,
"line_max": 117,
"alpha_frac": 0.4427383237,
"autogenerated": false,
"ratio": 6.03474... |
__author__ = 'usucuha'
import sys, \
os, \
game, \
company, \
json
def jdefault(o):
return o.__dict__
def writeToJson(game_obj, game_name, file_name):
with open('./' + game_name + '/' + file_name + '.json', 'w') as outfile:
obj = json.dumps(game_obj, default=jdefault)
... | {
"repo_name": "hculpan/wallst-python",
"path": "new_game.py",
"copies": "1",
"size": "1960",
"license": "mit",
"hash": -1093382993962109000,
"line_mean": 26.4347826087,
"line_max": 76,
"alpha_frac": 0.5709183673,
"autogenerated": false,
"ratio": 2.9923664122137406,
"config_test": false,
"has_... |
__author__ = 'utsavnarayan'
from bs4 import BeautifulSoup
from crawlers import Course, CourseDetails
import urllib2
from collections import namedtuple
_BASE_URL = "https://www.open2study.com"
_COURSES_URL = _BASE_URL + '/courses/'
CourseInfo = namedtuple('CourseDetails',
['short_url', 'name... | {
"repo_name": "utsavnarayan/open2study",
"path": "crawlers/lib/course_crawler.py",
"copies": "1",
"size": "3504",
"license": "mit",
"hash": -3714222710819119600,
"line_mean": 32.0660377358,
"line_max": 117,
"alpha_frac": 0.56706621,
"autogenerated": false,
"ratio": 3.9954389965792476,
"config_t... |
__author__ = 'utsav'
from django.http import HttpResponse
from django.template import loader, RequestContext
from django.http import Http404
from crawlers.models import Course, CourseDetails
from crawlers import crawl_courses, InvalidUrlException, AlreadyCrawledUrl
import json
def _show_error(request, error_code):... | {
"repo_name": "utsavnarayan/open2study",
"path": "open2study/views.py",
"copies": "1",
"size": "2039",
"license": "mit",
"hash": 5422830494661751000,
"line_mean": 28.1428571429,
"line_max": 77,
"alpha_frac": 0.7042667974,
"autogenerated": false,
"ratio": 3.9746588693957117,
"config_test": false... |
__author__ = "Vahan Sosoyan"
__copyright__ = "2019 All rights reserved. See Copyright.txt for more details."
__version__ = "1.3.7"
import sys
from timeit import default_timer
import maya.mel as mel
import maya.OpenMaya as OM
import pymel.core as pm
from maya import cmds, OpenMayaUI
from maya.app.general.mayaMixin imp... | {
"repo_name": "Sosoyan/Aton",
"path": "scripts/aton_maya.py",
"copies": "1",
"size": "42121",
"license": "bsd-3-clause",
"hash": -1942398370133778700,
"line_mean": 39.3457854406,
"line_max": 118,
"alpha_frac": 0.6335557086,
"autogenerated": false,
"ratio": 4.062204648471405,
"config_test": fals... |
__author__ = 'vaibhav'
try:
import cProfile as profile
except ImportError:
import profile
import pstats
from cStringIO import StringIO
from django.conf import settings
from django.template.loader import render_to_string
class ProfileMiddleware(object):
def can(selfself, request):
return settings... | {
"repo_name": "vinu76jsr/django_profiler",
"path": "profiler/middleware.py",
"copies": "1",
"size": "1691",
"license": "bsd-3-clause",
"hash": 6876757559249191000,
"line_mean": 35.7608695652,
"line_max": 111,
"alpha_frac": 0.5866351271,
"autogenerated": false,
"ratio": 3.932558139534884,
"confi... |
import re
import sys
import logging
class InvalidEntry(Exception):
pass
class ParseError(Exception):
pass
class OEISEntry(dict):
_assignments = {
'A': 'author',
'E': 'references',
'O': 'offset',
}
_appendings = {
'C': 'comments',
... | {
"repo_name": "ProjetPP/PPP-OEIS",
"path": "ppp_oeis/oeis.py",
"copies": "1",
"size": "3639",
"license": "mit",
"hash": 8971082815381899000,
"line_mean": 29.8389830508,
"line_max": 78,
"alpha_frac": 0.4712833196,
"autogenerated": false,
"ratio": 4.029900332225914,
"config_test": false,
"has_n... |
__author__ = 'valentin'
#from mezzanine.forms.models import Form
from django.forms import ModelForm, Textarea
from django import forms
from django.forms.models import inlineformset_factory
from ..models.organization import Organization,OrganizationLocation,\
OrganizationEmail,OrganizationPhone,OrganizationName,\
... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/forms/organization.py",
"copies": "1",
"size": "1944",
"license": "bsd-3-clause",
"hash": -5767263098896062000,
"line_mean": 29.390625,
"line_max": 87,
"alpha_frac": 0.700617284,
"autogenerated": false,
"ratio": 4.531468531468532,
"c... |
__author__ = 'valentin'
from django.views.generic import ListView,DetailView,TemplateView,UpdateView,CreateView
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.core.context_processor... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/views/person.py",
"copies": "1",
"size": "6552",
"license": "bsd-3-clause",
"hash": 5109144307354351000,
"line_mean": 34.8032786885,
"line_max": 123,
"alpha_frac": 0.6178266178,
"autogenerated": false,
"ratio": 4.3076923076923075,
"c... |
__author__ = 'valentin'
from tastypie.serializers import Serializer
from rdflib import Graph,Literal,BNode,Namespace,RDF,RDFS, URIRef
from rdflib.namespace import Namespace,DC,DCTERMS, FOAF
class OrganizationFFoafSerializer(Serializer):
formats = ['json','jsonp','rdf']
content_types = {
'json':'appl... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/serializers/organization.py",
"copies": "1",
"size": "1511",
"license": "bsd-3-clause",
"hash": -605523039141131900,
"line_mean": 26.9814814815,
"line_max": 87,
"alpha_frac": 0.5777630708,
"autogenerated": false,
"ratio": 3.25646551724... |
__author__ = 'valentin'
from tastypie.serializers import Serializer
from rdflib import Graph,Literal,BNode,Namespace,RDF,RDFS, URIRef, XSD
from rdflib.namespace import Namespace,DC,DCTERMS, FOAF
from rdflib import ConjunctiveGraph
class OrganizationAssociationFoafSerializer(Serializer):
formats = ['json','json... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/serializers/organization_association.py",
"copies": "1",
"size": "3624",
"license": "bsd-3-clause",
"hash": 4068825077674378000,
"line_mean": 34.8811881188,
"line_max": 108,
"alpha_frac": 0.6194812362,
"autogenerated": false,
"ratio": ... |
__author__ = 'valentin'
from tastypie.serializers import Serializer
from rdflib import Graph,Literal,BNode,Namespace,RDF, URIRef
from rdflib.namespace import DC,DCTERMS, FOAF
class PersonFoafSerializer(Serializer):
formats = ['json','jsonp','rdf']
content_types = {
'json':'application/json',
... | {
"repo_name": "hydroshare/hydroshare_temp",
"path": "hs_party/serializers/person.py",
"copies": "1",
"size": "2966",
"license": "bsd-3-clause",
"hash": 7624711130084579000,
"line_mean": 34.3095238095,
"line_max": 122,
"alpha_frac": 0.6260957519,
"autogenerated": false,
"ratio": 2.79811320754717,
... |
__author__ = 'valerio cosentino'
import logging
class LoggingUtil():
"""
This class provides logging utilities
"""
LOG_EXTENSION = ".log"
def get_logger(self, log_filename):
"""
gets the logger
:type log_filename: str
:param log_filename: logger file name
... | {
"repo_name": "SOM-Research/Gitana",
"path": "util/logging_util.py",
"copies": "1",
"size": "2216",
"license": "mit",
"hash": 4016033140338216000,
"line_mean": 25.6987951807,
"line_max": 99,
"alpha_frac": 0.5870938628,
"autogenerated": false,
"ratio": 4.405566600397615,
"config_test": false,
... |
__author__ = 'valerio cosentino'
import sys
from util.db_util import DbUtil
sys.path.insert(0, "..")
class DslUtil():
"""
This class provides utilities for the Domain Specific Languages used in the export processes
"""
def __init__(self):
self.db_util = DbUtil()
def find_entity_id(self... | {
"repo_name": "SOM-Research/Gitana",
"path": "util/dsl_util.py",
"copies": "1",
"size": "1431",
"license": "mit",
"hash": -1636863855961937400,
"line_mean": 28.2040816327,
"line_max": 111,
"alpha_frac": 0.5814116003,
"autogenerated": false,
"ratio": 3.7168831168831167,
"config_test": false,
"... |
__author__ = 'valerio cosentino'
#This script matches the acronyms of the Computer Software (code 0803) conferences listed at http://www.core.edu.au/index.php/ with the conferences in DBLP.
#However, due to many mismatches between the two web-sites, the output file (output.json) has to be manually checked and refined.... | {
"repo_name": "SOM-Research/metaScience-SoftwareConferences",
"path": "phase1/match_core_dblp_conferences.py",
"copies": "1",
"size": "1865",
"license": "epl-1.0",
"hash": 1292099390202103000,
"line_mean": 26.4264705882,
"line_max": 156,
"alpha_frac": 0.6075067024,
"autogenerated": false,
"ratio"... |
__author__ = 'valerybo'
from google.appengine.ext.webapp import template
from models.alertDB import Alert
from models.user import User
import webapp2
class EditAlertHandler(webapp2.RequestHandler):
def get(self):
template_params = {}
longType = True
template_params['alerts'] =[]
... | {
"repo_name": "yaakov300/ForexApp",
"path": "web/pages/editROWAL.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": 7020105698662006000,
"line_mean": 25.5903614458,
"line_max": 108,
"alpha_frac": 0.5666364461,
"autogenerated": false,
"ratio": 3.829861111111111,
"config_test": false,
... |
__author__ = 'valerybo'
from google.appengine.ext.webapp import template
from models.historyDB import History
from models.user import User
import webapp2
class EditHandler(webapp2.RequestHandler):
def get(self):
template_params = {}
longType = True
template_params['histories'] =[]
... | {
"repo_name": "yaakov300/ForexApp",
"path": "web/pages/editRow.py",
"copies": "1",
"size": "3011",
"license": "mit",
"hash": -752906226613861900,
"line_mean": 29.12,
"line_max": 116,
"alpha_frac": 0.5675855198,
"autogenerated": false,
"ratio": 3.9053177691309986,
"config_test": false,
"has_no... |
__author__ = 'Vale Tolpegin'
# Importing relevant classes
import sys, os, re
import argparse
from tkCommonDialog import Dialog
class frame_generator:
# Initialization method
def init( self, *args, **kwargs ):
pass
# Function that delegates frame file generation for every language that was req... | {
"repo_name": "DarkmatterVale/Blockly-Frame-Generator",
"path": "frame_generator.py",
"copies": "1",
"size": "8099",
"license": "apache-2.0",
"hash": 2252890240781252600,
"line_mean": 38.1304347826,
"line_max": 111,
"alpha_frac": 0.4873441166,
"autogenerated": false,
"ratio": 4.649253731343284,
... |
__author__ = 'vamshi'
import math
from numpy import zeros
class Distribution(object):
def cdf(self, x):
raise NotImplementedError()
def F(self, t):
return self.cdf(t)
def Q(self, t):
return 1.0-self.cdf(t)
def inverseCdf(self, u):
raise NotImplementedError()
class E... | {
"repo_name": "neotrinity/cqf",
"path": "bcd/distribution.py",
"copies": "1",
"size": "2011",
"license": "mit",
"hash": -5599945257424994000,
"line_mean": 27.323943662,
"line_max": 93,
"alpha_frac": 0.5375435107,
"autogenerated": false,
"ratio": 3.238325281803543,
"config_test": false,
"has_n... |
__author__ = 'vamshi'
import numpy
import math
M = 1.0
class HJMModel(object):
def __init__(self, tau, initialRates, sigma):
self.tau = tau
self.initialRates = initialRates
self.sigma = sigma
self.numberOfFactors = sigma.shape[0]
def zcbPrice(self, maturity):
sum = ... | {
"repo_name": "neotrinity/cqf",
"path": "hjm/hjmmodel.py",
"copies": "1",
"size": "2216",
"license": "mit",
"hash": -7462299504583215000,
"line_mean": 27.0506329114,
"line_max": 124,
"alpha_frac": 0.5153429603,
"autogenerated": false,
"ratio": 3.5230524642289347,
"config_test": false,
"has_no... |
__author__ = 'vamshi'
import os
import numpy
from distribution import StepwiseHazardDistribution
DEFAULT_TENOR = [0.5, 1.0, 2.0, 3.0, 5.0, 7.0, 10.0]
DEFAULT_ALPHA = [0.016832, 0.020203, 0.021950, 0.030838, 0.028126, 0.032054, 0.030386]
ENTITIES = {
"AAL.L": "ANGLO AMERICAN",
"ABF.L": "ASSOCIAT BRIT FOODS",
... | {
"repo_name": "neotrinity/cqf",
"path": "bcd/entity.py",
"copies": "1",
"size": "2356",
"license": "mit",
"hash": -2062699550673472000,
"line_mean": 29.5974025974,
"line_max": 122,
"alpha_frac": 0.5768251273,
"autogenerated": false,
"ratio": 2.674233825198638,
"config_test": false,
"has_no_ke... |
__author__ = 'vamshi'
import numpy
import numpy.linalg as linalg
from math import sqrt
from hjm.hjmmodel import HJMModel
class HJMCalibrator(object):
def calibrate(self, forwardRateData, noOfFactors):
tau = numpy.array(forwardRateData[0])
forwardRates = forwardRateData[1:]/100.0
forwardRa... | {
"repo_name": "neotrinity/cqf",
"path": "hjm/hjmcalibrator.py",
"copies": "1",
"size": "1612",
"license": "mit",
"hash": 7646580096067205000,
"line_mean": 34.8222222222,
"line_max": 77,
"alpha_frac": 0.6389578164,
"autogenerated": false,
"ratio": 3.4891774891774894,
"config_test": false,
"has... |
__author__ = 'vamshi'
import numpy
import os
from hjm.hjmcalibrator import HJMCalibrator
from hjm.pricer import ZCBPricer, CapPricer
DELTA = 0.08333333333333333
class HJMPricer(object):
def __init__(self, principal, product, maturity, interestRate, frequency, noOfFactors, noOfSimulations):
self.princip... | {
"repo_name": "neotrinity/cqf",
"path": "hjm/hjmpricer.py",
"copies": "1",
"size": "1420",
"license": "mit",
"hash": -5394680721724855000,
"line_mean": 32.8095238095,
"line_max": 108,
"alpha_frac": 0.6795774648,
"autogenerated": false,
"ratio": 3.4216867469879517,
"config_test": false,
"has_n... |
__author__ = 'Vanc Levstik'
import requests
from pyflare import APIError
class PyflareHosting(object):
CLOUDFLARE_URL = 'https://api.cloudflare.com/host-gw.html'
def __init__(self, host_key):
"""
Instantiate a Pyflare client object
:param email: The host_key associated with your Clo... | {
"repo_name": "getlantern/pyflare",
"path": "pyflare/hosting.py",
"copies": "2",
"size": "7659",
"license": "apache-2.0",
"hash": -5695251898641078000,
"line_mean": 31.3164556962,
"line_max": 107,
"alpha_frac": 0.5460242852,
"autogenerated": false,
"ratio": 3.947938144329897,
"config_test": fal... |
__author__ = 'vantani'
from cheapr.database import (db,Model)
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy.sql import text
import requests
from memorised.decorators import memorise
from bs4 import BeautifulSoup
import json
class MobileBrand(Model):
__tablename__ = 'mobile_brands'
id=db.Colum... | {
"repo_name": "antani/cheapr",
"path": "cheapr/mobiles/models.py",
"copies": "1",
"size": "6144",
"license": "bsd-3-clause",
"hash": 4517662724017301000,
"line_mean": 37.641509434,
"line_max": 180,
"alpha_frac": 0.5935872396,
"autogenerated": false,
"ratio": 3.5783343040186373,
"config_test": f... |
__author__ = 'vantani'
import bleach
from fuzzywuzzy import fuzz
from cheapr.books import GoodReadsClient
from bs4 import BeautifulSoup
import memcache
from bottlenose import Amazon
import hashlib
import requests
GOODREADS_API_KEY='qSXq4Sses56f03nSCrVw'
GOODREADS_API_SECRET='KyNzNDWPHLukQOVmZpYIT9h0CLv2T0iXBlCqnicne... | {
"repo_name": "antani/cheapr",
"path": "cheapr/books/models.py",
"copies": "1",
"size": "9076",
"license": "bsd-3-clause",
"hash": -8724481538206498000,
"line_mean": 38.986784141,
"line_max": 200,
"alpha_frac": 0.5891361833,
"autogenerated": false,
"ratio": 3.7473162675474816,
"config_test": fa... |
__author__ = 'vantani'
import bs4
import requests
import tld
import errno
import itertools
import os
import re
import urlparse
from flask import Flask
from collections import defaultdict
from database import (db)
from mobiles.models import MobileBrand
from mobiles.models import MobileModel
import urllib
import logging... | {
"repo_name": "antani/cheapr",
"path": "cheapr/scripts/gsmarena_init.py",
"copies": "1",
"size": "7949",
"license": "bsd-3-clause",
"hash": -8516665005865999000,
"line_mean": 31.3130081301,
"line_max": 117,
"alpha_frac": 0.6142911058,
"autogenerated": false,
"ratio": 3.4742132867132867,
"config... |
__author__ = 'vantani'
import logging
from xml.dom import minidom, Node
from xml.parsers.expat import ExpatError, ErrorString
class GoodReadsParser(object):
def parse_result(self, url_handler):
try:
goodreads_dom = minidom.parse(url_handler)
return goodreads_dom
except Exp... | {
"repo_name": "antani/cheapr",
"path": "cheapr/books/parser.py",
"copies": "1",
"size": "6029",
"license": "bsd-3-clause",
"hash": -5891173776657377000,
"line_mean": 29.9179487179,
"line_max": 73,
"alpha_frac": 0.5330900647,
"autogenerated": false,
"ratio": 4.43635025754231,
"config_test": fals... |
__author__ = 'vantani'
import logging
import urllib
from cheapr.books.parser import GoodReadsParser
class GoodReadsClient(object):
BASE_URL = "http://www.goodreads.com/"
DEFAULT_PAGE_SIZE = 20
def __init__(self, key, secret):
self.key = key
self.secret = secret
self.parser = G... | {
"repo_name": "antani/cheapr",
"path": "cheapr/books/__init__.py",
"copies": "1",
"size": "1919",
"license": "bsd-3-clause",
"hash": 3578368225053197000,
"line_mean": 28.0909090909,
"line_max": 66,
"alpha_frac": 0.5711307973,
"autogenerated": false,
"ratio": 3.5211009174311925,
"config_test": f... |
__author__ = 'Varada Kolhatkar'
import argparse
import pandas as pd
from timeit import default_timer as timer
import re
def get_arguments():
parser = argparse.ArgumentParser(description='Write csv files for crowd annotation')
parser.add_argument('--comments_csv', '-c', type=str, dest='comments_csv', action='... | {
"repo_name": "sfu-discourse-lab/SFU_Comment_Extractor",
"path": "Source_Code/CSV_creation/get_statistics.py",
"copies": "1",
"size": "4195",
"license": "mit",
"hash": 5379022117674806000,
"line_mean": 33.9583333333,
"line_max": 111,
"alpha_frac": 0.6517282479,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'Varada Kolhatkar'
import argparse, sys, os, glob, ntpath, pprint, codecs, re, csv
import pandas as pd
import re, html.entities
from timeit import default_timer as timer
import string
import numpy as np
import multiprocessing as mp
from multiprocessing import cpu_count
import re
def word_segmentation(tex... | {
"repo_name": "sfu-discourse-lab/SFU_Comment_Extractor",
"path": "Source_Code/data_cleanup/normalize_csv_comments.py",
"copies": "2",
"size": "5353",
"license": "mit",
"hash": -3601071315791503400,
"line_mean": 33.0955414013,
"line_max": 156,
"alpha_frac": 0.574631048,
"autogenerated": false,
"ra... |
__author__ = 'Varada Kolhatkar'
import pandas as pd
import argparse
import operator
import pickle
import sys
from timeit import default_timer as timer
def get_arguments():
parser = argparse.ArgumentParser(description='Write csv files for crowd annotation')
parser.add_argument('--input_csv', '-i', type=str, des... | {
"repo_name": "sfu-discourse-lab/SFU_Comment_Extractor",
"path": "Source_Code/CSV_creation/create_explore_comment_clusters.py",
"copies": "1",
"size": "8325",
"license": "mit",
"hash": 8115113421382356000,
"line_mean": 42.5863874346,
"line_max": 178,
"alpha_frac": 0.6434834835,
"autogenerated": fal... |
__author__ = 'varakin'
class GroupHelper:
def __init__(self, app):
self.app = app
def return_to_groups_page(self):
wd = self.app.wd
wd.find_element_by_link_text("group page").click()
def create(self, group):
wd = self.app.wd
self.open_groups_page()
# init... | {
"repo_name": "varakin/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3165",
"license": "apache-2.0",
"hash": 912571967253402100,
"line_mean": 32.6808510638,
"line_max": 79,
"alpha_frac": 0.5996840442,
"autogenerated": false,
"ratio": 3.300312825860271,
"config_test": fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.