text stringlengths 0 1.05M | meta dict |
|---|---|
from domain.email import *
from datetime import datetime
def formata(classe):
def decorador(f):
f.aceita = lambda email: email.__class__ == classe
return f
return decorador
def formata_intervalo(intervalo):
return "{} até {}".format(
datetime.strftime(intervalo.inicio, "%d/%m/%Y da... | {
"repo_name": "ESEGroup/Paraguai",
"path": "web/email/formatadores.py",
"copies": "1",
"size": "4113",
"license": "apache-2.0",
"hash": -7398043858984638000,
"line_mean": 24.2222222222,
"line_max": 83,
"alpha_frac": 0.6595692609,
"autogenerated": false,
"ratio": 2.8815232722143866,
"config_test... |
from domain.entity import Team, Timer, Slack
from infra import firebase, taskqueue
class TeamRepository(object):
def __init__(self):
self._teams = {}
def get(self, id_):
team_json = firebase.fetch_team(id_)
if not team_json:
return None
else:
j = team_j... | {
"repo_name": "hagifoo/gae-pomodoro",
"path": "app/src/domain/repository/team.py",
"copies": "1",
"size": "2027",
"license": "mit",
"hash": 2820620148326938600,
"line_mean": 27.5492957746,
"line_max": 76,
"alpha_frac": 0.516526887,
"autogenerated": false,
"ratio": 3.5749559082892417,
"config_te... |
from domain.entity import User, Timer, Slack
from infra import firebase, taskqueue
class UserRepository(object):
def __init__(self):
self._users = {}
def get(self, id_):
user_json = firebase.fetch_user(id_)
if not user_json:
return None
else:
j = user_j... | {
"repo_name": "hagifoo/gae-pomodoro",
"path": "app/src/domain/repository/user.py",
"copies": "1",
"size": "2436",
"license": "mit",
"hash": 2675410015447239000,
"line_mean": 26.3707865169,
"line_max": 61,
"alpha_frac": 0.4848111658,
"autogenerated": false,
"ratio": 3.603550295857988,
"config_te... |
from domain.evaluation import Evaluation
from domain.genepool import GenePool
from domain.generation import Generation
class SimulationService:
"""Service class for maintaining the gene pool, the current generation, and the current snake evaluation."""
def __init__(self):
# Save best snakes
... | {
"repo_name": "hesslink111/neuralnetworknibbles",
"path": "service/simulationservice.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": -2055020482105908700,
"line_mean": 31.3783783784,
"line_max": 112,
"alpha_frac": 0.6894824708,
"autogenerated": false,
"ratio": 4.088737201365188,
"... |
from domain_event_broker import replay_event, Subscriber, DISCARD, LEAVE
from .helpers import get_message_from_queue, get_queue_size
def test_replay(dead_letter_message):
assert replay_event('test-replay') == 0
assert get_queue_size('test-replay-dl') == 0
header, event = get_message_from_queue('test-repla... | {
"repo_name": "AbletonAG/domain-events",
"path": "domain_event_broker/tests/test_replay.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": 4147848806777207300,
"line_mean": 27.5238095238,
"line_max": 72,
"alpha_frac": 0.6886477462,
"autogenerated": false,
"ratio": 3.403409090909091,
... |
from domain.excecoes import ExcecaoRecursoInexistente
from domain.usuario import Usuario
from domain.email import EmailRecursoInutilizavel
from datetime import datetime
class ServicoEstadoRecurso():
def __init__(self, repo_recurso, repo_usuario, servico_email):
self.repo_recurso = repo_recurso
self... | {
"repo_name": "ESEGroup/Paraguai",
"path": "domain/recurso/servico_estado.py",
"copies": "1",
"size": "1803",
"license": "apache-2.0",
"hash": -6149652384320331000,
"line_mean": 37.2765957447,
"line_max": 96,
"alpha_frac": 0.673151751,
"autogenerated": false,
"ratio": 3.09106529209622,
"config_... |
from Domain.Exceptions import CatalogException
from Domain.Grade import Grade
from functools import reduce
class StudentCatalogController:
def __init__(self, repo):
self._repo = repo
# General getters
def getCatalog(self):
return self._repo.getCurrentCatalog()
def getStudents(self):
... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/Controller/StudentCatalogController.py",
"copies": "1",
"size": "4226",
"license": "mit",
"hash": 9139021941754430000,
"line_mean": 31.7596899225,
"line_max": 106,
"alpha_frac": 0.7124940842,
"autogenerated": false,
"ratio": 3.86642... |
from Domain.Exceptions import CatalogException
class Catalog:
def __init__(self):
# TODO: Separate into multiple repositories StudentRepo, UserRepo, etc and make controller that joins the data
# Each "repo" can be compared to an SQL table, a table should hold a single entity type and not different ... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/Domain/Catalog.py",
"copies": "1",
"size": "11835",
"license": "mit",
"hash": -7039085377271249000,
"line_mean": 39.2551020408,
"line_max": 203,
"alpha_frac": 0.6061681453,
"autogenerated": false,
"ratio": 4.3272394881170015,
"con... |
from Domain.Exceptions import CommandError, InvalidCommandError, InvalidParameterError, UnexpectedUserExit, CatalogException
import os
clear = lambda: os.system('cls') # little hack because I hate writing. clear() can be used anywhere to clear the current console. Works even in IDE consoles
class ConsoleUI:
def ... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/View/ConsoleUI.py",
"copies": "1",
"size": "13859",
"license": "mit",
"hash": 1802681033464392700,
"line_mean": 42.8575949367,
"line_max": 157,
"alpha_frac": 0.4488779854,
"autogenerated": false,
"ratio": 5.303865288939916,
"confi... |
from Domain.Exceptions import CommandError, InvalidCommandError, InvalidParameterError, UnexpectedUserExit
import os
clear = lambda: os.system('cls') # little hack because I hate writing. clear() can be used anywhere to clear the current console. Works even in IDE consoles
class DebugShell:
def __init__(self, ca... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/View/DebugShell.py",
"copies": "1",
"size": "2284",
"license": "mit",
"hash": 8331130445517685000,
"line_mean": 42.1132075472,
"line_max": 163,
"alpha_frac": 0.5809982487,
"autogenerated": false,
"ratio": 4.922413793103448,
"confi... |
from Domain.Exceptions import CommandError, InvalidCommandError, InvalidParameterError, UnexpectedUserExit
import os
from Utils import isInt
clear = lambda: os.system('cls')
class ConsoleUI:
def __init__(self, graphRepo):
self._graphRepo = graphRepo
self._cost = self._graphRepo.getCosts()
... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM2/GRAPH/Lab1Final/UI/ConsoleUI.py",
"copies": "1",
"size": "6193",
"license": "mit",
"hash": 4971701211528821000,
"line_mean": 39.2142857143,
"line_max": 151,
"alpha_frac": 0.5259163572,
"autogenerated": false,
"ratio": 4.181634031060095,
"confi... |
from Domain.Exceptions import InvalidParameterError
from Utils import isInt
import inspect
class Command:
def __init__(self, function, name, cmdHelp):
self._function = function
self._name = name
self._help = cmdHelp
# self._annotations = function.__annotations__
# self._sig... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/Domain/Command.py",
"copies": "1",
"size": "4501",
"license": "mit",
"hash": -8220521985726851000,
"line_mean": 42.6990291262,
"line_max": 151,
"alpha_frac": 0.5938680293,
"autogenerated": false,
"ratio": 5.221577726218097,
"confi... |
from Domain.Exceptions import UserDead, GameFinished
hangman = "hangman"
class GameState():
def __init__(self, sentence):
"""
Class used to keep state of a game.
This theoretically allows several games to be ongoing at the same time, without affecting each other.
"""
... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/Examen/Controller/GameState.py",
"copies": "1",
"size": "2082",
"license": "mit",
"hash": -5831834723762541000,
"line_mean": 33.1475409836,
"line_max": 113,
"alpha_frac": 0.5634005764,
"autogenerated": false,
"ratio": 4.292783505154639,
... |
from DomainGenerators import DomainGenerator
import configuration
import logging
import namecheap
from bs4 import BeautifulSoup
# Logging configuration
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(levelname)s: %(asctime)s - File name: {} | TLD: {} - %(message)s... | {
"repo_name": "anasyusef/Domain-Availability-Checker",
"path": "CheckDomains.py",
"copies": "1",
"size": "5315",
"license": "mit",
"hash": -5382295994664783000,
"line_mean": 38.0808823529,
"line_max": 120,
"alpha_frac": 0.6105362183,
"autogenerated": false,
"ratio": 4.370888157894737,
"config_t... |
from Domain.Graph import Graph
from copy import deepcopy
from Domain.Cost import Cost
class Console():
def __init__(self):
self.loadFile()
# self.repo = Repository()
def loadFile(self):
f = open("graph1k.txt", "r")
line = f.readline().strip().split()
nbrVertices = int... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM2/GRAPH/Lab1Final/UI/console.py",
"copies": "1",
"size": "8570",
"license": "mit",
"hash": -3904240729231191000,
"line_mean": 28.7569444444,
"line_max": 91,
"alpha_frac": 0.5233372229,
"autogenerated": false,
"ratio": 4.401643554185927,
"config_... |
from Domain.Graph import Graph
from Domain.Cost import Cost
from copy import deepcopy
class Repository:
def __init__(self, filename=None):
self._graph = None
self._initialGraph = None
self._initialCost = None
self._cost = Cost
if filename is None:
self._graph = G... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM2/GRAPH/Lab1Final/Repository/Repository.py",
"copies": "1",
"size": "1066",
"license": "mit",
"hash": -3595412965299951000,
"line_mean": 29.4571428571,
"line_max": 71,
"alpha_frac": 0.5816135084,
"autogenerated": false,
"ratio": 3.99250936329588,
... |
from domain.holiday import Holiday
from util.holiday import easter_sunday,dt_converter
from datetime import datetime, timedelta
import json
class HolidayResource(object):
def list(self, year):
pascoa = easter_sunday(year) # Recupera domingo de pascoa
carnaval = pascoa - timedelta(days=47) # Carnaval
cinzas = p... | {
"repo_name": "vfcardoso3/pasco",
"path": "app/resource/holiday.py",
"copies": "1",
"size": "1470",
"license": "mit",
"hash": -3493652930334547500,
"line_mean": 44.9375,
"line_max": 81,
"alpha_frac": 0.7210884354,
"autogenerated": false,
"ratio": 2.5789473684210527,
"config_test": false,
"has... |
from domain.IDObject import IDObject
class Client(IDObject):
def __init__(self, clientId, cnp, name):
IDObject.__init__(self, clientId)
self._cnp = cnp
self._name = name
def getCNP(self):
return self._cnp
def getName(self):
return self._name
def setName(self, ... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.09/domain/Client.py",
"copies": "2",
"size": "1715",
"license": "mit",
"hash": -9196609022221177000,
"line_mean": 24.5970149254,
"line_max": 77,
"alpha_frac": 0.5457725948,
"autogenerated": false,
"ratio": 3.988372093023256,
"con... |
from domain import Class, Package
import json
paths = []
repo_path = 'C:/Users/verca/.m2/repository/' # local maven repository
packages = {}
my_json = []
def load_paths():
with open(repo_path + 'paths.txt') as f:
global paths
paths = f.read().splitlines()
f.close
def load_data():
for... | {
"repo_name": "danekja/entropy",
"path": "2017-06-OPSWI-elasticvsmongo/data/parser.py",
"copies": "1",
"size": "2114",
"license": "apache-2.0",
"hash": -3550989081947921000,
"line_mean": 24.4698795181,
"line_max": 82,
"alpha_frac": 0.532166509,
"autogenerated": false,
"ratio": 3.695804195804196,
... |
from .domain import DomainEvent
from .schema import get_event_version
from .settings import adds_schema_version_to_event_data
from .utils import camel_case_to_snake_case
from collections import namedtuple
from datetime import datetime
from eventsourcing.domain.model.events import resolve_attr
from eventsourcing.domain.... | {
"repo_name": "ApplauseOSS/djangoevents",
"path": "djangoevents/unifiedtranscoder.py",
"copies": "1",
"size": "5673",
"license": "mit",
"hash": 3806298192104820000,
"line_mean": 35.1337579618,
"line_max": 111,
"alpha_frac": 0.6465714789,
"autogenerated": false,
"ratio": 4.031982942430703,
"conf... |
from domain import Domain_Handler
from emailaddress import EmailAddress_Handler
import argparse
def main():
PERSPECTIVE_ACTIONS = ['DOMAIN', 'EMAILADDRESS']
TRANSPORT_ACTIONS = ['QUEUE', 'FILE']
parser = argparse.ArgumentParser(prog="")
parser.add_argument('-p', '--perspective', required=True,
... | {
"repo_name": "madcore-ai/containers",
"path": "xlswriter/main.py",
"copies": "1",
"size": "1435",
"license": "mit",
"hash": -5578962614020748000,
"line_mean": 40,
"line_max": 85,
"alpha_frac": 0.6480836237,
"autogenerated": false,
"ratio": 3.8471849865951744,
"config_test": false,
"has_no_ke... |
from .domain import Domain
from .basictypes import Set, compare
from .cnf import canonical_builder
from .utils import ncr
import random
class Subsets(Domain):
"""Domain of subsets of a domain
When a single argument is provided, the resulting domain contains all
subsets:
Args:
domain (Domain)... | {
"repo_name": "spirali/haydi",
"path": "src/haydi/base/subsets.py",
"copies": "2",
"size": "4933",
"license": "mit",
"hash": -7891146238414091000,
"line_mean": 29.83125,
"line_max": 76,
"alpha_frac": 0.5073991486,
"autogenerated": false,
"ratio": 3.984652665589661,
"config_test": false,
"has_... |
from .domain import Domain
from .cnf import expand, is_canonical
import random
class Values(Domain):
"""
A domain created from a collection of Python objects.
Args:
values (collection): A collection of items that is
used as the content for the new domain
name... | {
"repo_name": "spirali/haydi",
"path": "src/haydi/base/values.py",
"copies": "2",
"size": "2119",
"license": "mit",
"hash": 1326283126554267100,
"line_mean": 23.0795454545,
"line_max": 74,
"alpha_frac": 0.5582822086,
"autogenerated": false,
"ratio": 3.880952380952381,
"config_test": false,
"h... |
from .domain import Domain
from .domain import Product
from .basictypes import Map, compare
from .cnf import canonical_builder, get_bounds
class Mappings(Domain):
def __init__(self,
key_domain,
value_domain,
map_class=Map,
name=None):
ke... | {
"repo_name": "Kobzol/haydi",
"path": "src/haydi/base/mapping.py",
"copies": "2",
"size": "2318",
"license": "mit",
"hash": -6723645228140698000,
"line_mean": 32.5942028986,
"line_max": 75,
"alpha_frac": 0.5642795513,
"autogenerated": false,
"ratio": 3.996551724137931,
"config_test": false,
"... |
from .domain import Domain
from random import randint
class Join(Domain):
def __init__(self, domains, ratios=None, name=None):
super(Join, self).__init__(name)
domains = tuple(domains)
self._set_flags_from_domains(domains)
self.domains = domains
self.ratios = ratios
... | {
"repo_name": "Kobzol/haydi",
"path": "src/haydi/base/join.py",
"copies": "2",
"size": "2075",
"license": "mit",
"hash": -3052436888304401400,
"line_mean": 25.9480519481,
"line_max": 62,
"alpha_frac": 0.5113253012,
"autogenerated": false,
"ratio": 4.029126213592233,
"config_test": false,
"has... |
from Domain import Exceptions
from UI.ConsoleUI import ConsoleUI
import UI.WebGUI
from UI.WebGUI.FlaskRunner import FlaskRunner
class UIHandler:
def __init__(self, graph):
self._graph = graph
def run(self):
"""
UI entry point, will let the user select between a menu or command lin... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM2/GRAPH/Lab1Final/UI/UIHandler.py",
"copies": "1",
"size": "1951",
"license": "mit",
"hash": 7226861647380046000,
"line_mean": 38.04,
"line_max": 132,
"alpha_frac": 0.5509994874,
"autogenerated": false,
"ratio": 4.841191066997519,
"config_test":... |
from Domain import Exceptions
from View.ConsoleUI import ConsoleUI
from View.GUILoader import GUI
from View.DebugShell import DebugShell
import View.WebGUI
from View.WebGUI.FlaskRunner import FlaskRunner
class UIHandler:
def __init__(self, catalogController, commandController, selectedUI = None):
self._ca... | {
"repo_name": "Zephyrrus/ubb",
"path": "YEAR 1/SEM1/FP/LAB/l6-l9/View/UIHandler.py",
"copies": "1",
"size": "3640",
"license": "mit",
"hash": -4049651539547256300,
"line_mean": 45.0886075949,
"line_max": 177,
"alpha_frac": 0.5865384615,
"autogenerated": false,
"ratio": 5.090909090909091,
"confi... |
from .domain import models as domain_models
from . import models as django_models
django_m = {}
domain_m = {}
def register(adaptor_class):
adaptor = adaptor_class()
django_m[adaptor.django_model] = adaptor
domain_m[adaptor.domain_model] = adaptor
return adaptor_class
def domain_to_orm(obj):
ret... | {
"repo_name": "altaurog/django-caspy",
"path": "caspy/django_orm.py",
"copies": "1",
"size": "3304",
"license": "bsd-3-clause",
"hash": -885470434229446400,
"line_mean": 28.5,
"line_max": 77,
"alpha_frac": 0.5792978208,
"autogenerated": false,
"ratio": 4.1197007481296755,
"config_test": false,
... |
from domain import symptom, sickness, indicates
from persistance import sicknessrepo, symptomrepo, indicatesrepo
import convert
import requests
## Symptom Actions ##
def getAllSymptoms():
result = symptomrepo.getAllSymptoms()
return convert.symptomBoltToJSON(result)
def getSymptomByName(name):
result = symptomre... | {
"repo_name": "Langhaarzombie/amievensick",
"path": "backend/service.py",
"copies": "1",
"size": "2669",
"license": "apache-2.0",
"hash": 3638253770484927500,
"line_mean": 32.7974683544,
"line_max": 181,
"alpha_frac": 0.7557137505,
"autogenerated": false,
"ratio": 2.945916114790287,
"config_tes... |
from domain import symptom, sickness, indicates
import json
def symptomBoltToDomain(bolt):
symptoms = []
for x in bolt.records():
for y in x.values():
symptoms.append(symptom.Symptom(y.id, y.get("name")))
return symptoms
def sicknessBoltToDomain(bolt):
sicknesses = []
for x in bolt.records():
for y in... | {
"repo_name": "Langhaarzombie/amievensick",
"path": "backend/convert.py",
"copies": "1",
"size": "1164",
"license": "apache-2.0",
"hash": -6048331958582168000,
"line_mean": 19.4210526316,
"line_max": 130,
"alpha_frac": 0.6950171821,
"autogenerated": false,
"ratio": 2.6758620689655173,
"config_t... |
from .domain import Url
from .domain import ShortenGenerationError, NotExists
from pyramid.view import view_config
from pyramid.response import Response
from pyramid import httpexceptions
@view_config(route_name='home', renderer='templates/home.pt')
def home(request):
response_dict = {'project':'nurl'}
inc... | {
"repo_name": "gustavofonseca/nurl",
"path": "nurl/views.py",
"copies": "1",
"size": "1622",
"license": "bsd-3-clause",
"hash": 8114951694815906000,
"line_mean": 28.5090909091,
"line_max": 87,
"alpha_frac": 0.683107275,
"autogenerated": false,
"ratio": 3.965770171149144,
"config_test": false,
... |
from domain.MedicineException import MedicineException
class MedicineController:
def __init__(self, repo):
self._repo = repo
def addMedicine(self, medicine):
"""
Add a new medicine
Input: medicine - the medicine that will be added
Raises MedicineException in case of... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.05/controller/MedicineController.py",
"copies": "1",
"size": "2506",
"license": "mit",
"hash": 7918874952799388000,
"line_mean": 34.8,
"line_max": 116,
"alpha_frac": 0.5826017558,
"autogenerated": false,
"ratio": 4.135313531353136,... |
from domain.MedicineException import MedicineException
class Medicine:
def __init__(self, id, activeSubstance, name, quantity, price):
"""
Constructor method for medicine.
"""
if price < 0 or quantity < 0:
raise MedicineException("Medicine price and quantity must be >0")... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.05/domain/Medicine.py",
"copies": "1",
"size": "2028",
"license": "mit",
"hash": -2034983520048544000,
"line_mean": 26.4054054054,
"line_max": 163,
"alpha_frac": 0.5340236686,
"autogenerated": false,
"ratio": 4.408695652173913,
"... |
from domain.Medicine import MedicineException
class MedicineRepository:
def __init__(self):
"""
Constructor for MedicineRepository class
"""
self._data = []
def add(self, medicine):
"""
Add a medicine to the repository
Input: medicine - Medicine to be a... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.05/repository/MedicineRepository.py",
"copies": "1",
"size": "2163",
"license": "mit",
"hash": 6814635129946090000,
"line_mean": 28.6301369863,
"line_max": 96,
"alpha_frac": 0.5557096625,
"autogenerated": false,
"ratio": 4.22460937... |
from domain.Medicine import Medicine
from domain.MedicineException import MedicineException
class UI:
def __init__(self, controller):
self._controller = controller
def _printMenu(self):
str = '\nAvailable commands:\n'
str += '\t 1 - Add medicine\n'
str += '\t 2 - Remove medicin... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.05/ui/UI.py",
"copies": "1",
"size": "3294",
"license": "mit",
"hash": 1881606168372735700,
"line_mean": 34.8043478261,
"line_max": 96,
"alpha_frac": 0.5506982392,
"autogenerated": false,
"ratio": 4.223076923076923,
"config_test"... |
from domain.neuron import Neuron
class GameBoardRelativePositionStateNeuron(Neuron):
"""Input neuron class for sensing the position on the game board relative to the snake's position and
orientation."""
def __init__(self, game_board, position, gamesnake):
Neuron.__init__(self)
self.ga... | {
"repo_name": "hesslink111/neuralnetworknibbles",
"path": "domain/gameboardrelativepositionstateneuron.py",
"copies": "1",
"size": "1327",
"license": "mit",
"hash": -6263923184797091000,
"line_mean": 46.3928571429,
"line_max": 105,
"alpha_frac": 0.5938206481,
"autogenerated": false,
"ratio": 3.94... |
from domain.protocol import SenderProtocol, ReceiverProtocol
import asyncio
def test_send_data():
sender_host = '127.0.0.1'
receiver_host = '0.0.0.0'
port = 8888
msg = 'hello my friend!'
data = msg.encode()
queue = asyncio.Queue()
loop = asyncio.get_event_loop()
loop.set_debug(True)
... | {
"repo_name": "ciherraiz/aiom",
"path": "tests/test_protocol.py",
"copies": "1",
"size": "1481",
"license": "mit",
"hash": -1478136419214185200,
"line_mean": 31.1956521739,
"line_max": 79,
"alpha_frac": 0.6401080351,
"autogenerated": false,
"ratio": 4.1024930747922435,
"config_test": false,
"... |
from domain.support import ValueObject
class EmailUsuarioCadastrado(ValueObject):
def __init__(self, usuario, senha):
self.usuario = usuario
self.senha = senha
class EmailUsuarioAlterado(ValueObject):
def __init__(self, usuario):
self.usuario = usuario
class EmailUsuarioRemovido(Value... | {
"repo_name": "ESEGroup/Paraguai",
"path": "domain/email.py",
"copies": "1",
"size": "1333",
"license": "apache-2.0",
"hash": 5007400626622544000,
"line_mean": 32.275,
"line_max": 144,
"alpha_frac": 0.7069872276,
"autogenerated": false,
"ratio": 3.254278728606357,
"config_test": false,
"has_n... |
from domain.ValidatorException import ValidatorException
from domain.IDObject import IDObject
class Car(IDObject):
def __init__(self, objectId, licenseNumber, make, model):
IDObject.__init__(self, objectId)
self._license = licenseNumber
self._make = make
self._model = model
def... | {
"repo_name": "rusucosmin/courses",
"path": "ubb/fop/2015.Seminar.09/domain/Car.py",
"copies": "1",
"size": "2996",
"license": "mit",
"hash": -6893290335878918000,
"line_mean": 27,
"line_max": 124,
"alpha_frac": 0.5196929239,
"autogenerated": false,
"ratio": 4.043184885290149,
"config_test": fa... |
from dombuilder import DomBuilder
from dom import SimpleDOM
from urllib2 import urlopen, URLError, HTTPError
# Scraper responsability:
# orquestate the steps of the scraping process:
# Construction phase:
# 1. create the proper reader (input)
# 2. construct the HTML parser
# 3. customize the HTML parser adding operat... | {
"repo_name": "jion/python-scraper",
"path": "src/scraper/scraper.py",
"copies": "1",
"size": "2952",
"license": "mit",
"hash": -8637032027155204000,
"line_mean": 29.4329896907,
"line_max": 96,
"alpha_frac": 0.6639566396,
"autogenerated": false,
"ratio": 4.253602305475504,
"config_test": false,... |
from dom.grammar import *
from dom import metagrammar
import dom
import sys, os
class Workspace(object):
def __init__(self):
self.documents = {}
self.grammars = {}
self.clipboard = ""
self.available_grammars = ['grammar'] + [
g[:-3] for g in os.listdir('grammars') if g.e... | {
"repo_name": "cheery/textended-edit",
"path": "workspace.py",
"copies": "1",
"size": "2485",
"license": "mit",
"hash": -2776688236943061000,
"line_mean": 33.5138888889,
"line_max": 86,
"alpha_frac": 0.5645875252,
"autogenerated": false,
"ratio": 3.9696485623003195,
"config_test": false,
"has... |
from dom import Cell, TextCell, ListCell
from dom.grammar import turnip, Star, Plus, Context, ListRule
from dom.position import Position
import sys
import traceback
def copy_forest(forest):
if isinstance(forest, list):
return [c.copy() for c in forest]
return forest
def interpret(visual, keyboard):
... | {
"repo_name": "cheery/textended-edit",
"path": "actions.py",
"copies": "1",
"size": "17082",
"license": "mit",
"hash": 668033621296130200,
"line_mean": 35.1141649049,
"line_max": 117,
"alpha_frac": 0.5793818054,
"autogenerated": false,
"ratio": 3.96794425087108,
"config_test": false,
"has_no_... |
from dom import Cell, TextCell, ListCell
class Grammar(object):
def __init__(self, toplevel, rules, contexes, name):
self.name = name
self.contexes = contexes
self.toplevel = toplevel
self.rules = rules
self.root = Star(toplevel)
for label, rule in rules.iteritems():... | {
"repo_name": "cheery/textended-edit",
"path": "dom/grammar.py",
"copies": "1",
"size": "6540",
"license": "mit",
"hash": -7909575979383492000,
"line_mean": 27.9380530973,
"line_max": 89,
"alpha_frac": 0.5744648318,
"autogenerated": false,
"ratio": 4.057071960297767,
"config_test": false,
"ha... |
from dominate import tags
from dominate.util import raw
from flask import current_app
from markupsafe import Markup
from visitor import Visitor
def render_form(form, **kwargs):
r = WTFormsRenderer(**kwargs)
return Markup(r.visit(form))
class WTFormsRenderer(Visitor):
def __init__(self,
... | {
"repo_name": "MarkWh1te/xueqiu_predict",
"path": "python3_env/lib/python3.4/site-packages/flask_bootstrap/forms.py",
"copies": "22",
"size": "4628",
"license": "mit",
"hash": 6169146270714942000,
"line_mean": 29.2483660131,
"line_max": 78,
"alpha_frac": 0.5799481417,
"autogenerated": false,
"rat... |
from dominate.tags import *
from dominate.util import text
from django_dominate.django_tags import *
from goal.templates.dominate_tags import *
@div(_class="dropdown clearfix pull-right")
def top_right_menu():
with a(
_class="btn dropdown-toggle",
data_toggle="dropdown",
href="#"
):
... | {
"repo_name": "mnieber/shared-goals",
"path": "django/main/templates/base_html.py",
"copies": "2",
"size": "2748",
"license": "apache-2.0",
"hash": -4811961274353379000,
"line_mean": 25.1714285714,
"line_max": 74,
"alpha_frac": 0.5465793304,
"autogenerated": false,
"ratio": 3.601572739187418,
"... |
from domino import Domino
import os
domino = Domino("marks/quick-start-fork",
api_key=os.environ['DOMINO_USER_API_KEY'],
host=os.environ['DOMINO_API_HOST'])
# From all the environments, choose the first globally visible one
all_available_environments = domino.environments_list()
global... | {
"repo_name": "dominodatalab/python-domino",
"path": "examples/models_and_environments.py",
"copies": "1",
"size": "2107",
"license": "apache-2.0",
"hash": -3803885932413370000,
"line_mean": 42,
"line_max": 90,
"alpha_frac": 0.598481253,
"autogenerated": false,
"ratio": 4.172277227722772,
"conf... |
from domino import Domino
import pandas as pd
import json
import os
output_dir = "results"
# connect to domino; be sure to have these environment variables set
# (runs inside a Domino executor automatically set these for you)
domino = Domino("nick/winequality",
api_key=os.environ['DOMINO_USER_API_KEY... | {
"repo_name": "dominodatalab/python-domino",
"path": "examples/export_runs.py",
"copies": "1",
"size": "2171",
"license": "apache-2.0",
"hash": 6599140776190890000,
"line_mean": 35.7966101695,
"line_max": 79,
"alpha_frac": 0.693689544,
"autogenerated": false,
"ratio": 3.37111801242236,
"config_... |
from domino_puzzle import Board, Domino, DiceSet, ArrowSet
class QueuedBoard(Board):
def __init__(self,
width: int,
height: int,
max_pips: int = None,
dice_set: DiceSet = None,
arrows: ArrowSet = None):
super().__init__(w... | {
"repo_name": "donkirkby/domiculture",
"path": "queued_board.py",
"copies": "2",
"size": "3544",
"license": "mit",
"hash": -1489907358884066600,
"line_mean": 39.2727272727,
"line_max": 78,
"alpha_frac": 0.5474040632,
"autogenerated": false,
"ratio": 3.597969543147208,
"config_test": false,
"h... |
from donate.models import *
from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.template import Context, RequestContext, Template
from django.contrib import messages, auth
from django.contrib.auth.models import User
from django.contrib.auth.decor... | {
"repo_name": "zaffra/Donate",
"path": "donate/views.py",
"copies": "1",
"size": "23579",
"license": "bsd-3-clause",
"hash": 1210059720372393200,
"line_mean": 32.4453900709,
"line_max": 111,
"alpha_frac": 0.6374740235,
"autogenerated": false,
"ratio": 4.197045211819153,
"config_test": false,
... |
from DoneDone import IssueTracker
import json,sys
# for flask decorator
from datetime import timedelta
from flask import Flask, make_response, request, current_app
from functools import update_wrapper
def get_people_in_a_project(projectId):
peopleObj = issueTracker.getAllPeopleInProject(projectId)
people = []... | {
"repo_name": "darksmo/gmailToDoneDone",
"path": "doneDoneServer.py",
"copies": "1",
"size": "4872",
"license": "mit",
"hash": 6712599204149482000,
"line_mean": 32.6,
"line_max": 89,
"alpha_frac": 0.5913382594,
"autogenerated": false,
"ratio": 4.160546541417592,
"config_test": true,
"has_no_k... |
from donkeycar import util
import pytest
def is_error(err):
for e in err:
#Catch error if 'Error' is in the stderr output.
if 'Error' in e.decode():
return True
#Catch error when the wrong command is used.
if 'Usage:' in e.decode():
return True
return Fa... | {
"repo_name": "wroscoe/donkey",
"path": "donkeycar/tests/test_scripts.py",
"copies": "1",
"size": "1197",
"license": "mit",
"hash": 9038040360753357000,
"line_mean": 26.2045454545,
"line_max": 75,
"alpha_frac": 0.6073517126,
"autogenerated": false,
"ratio": 3.2615803814713895,
"config_test": fa... |
from donut import email_utils
from donut.modules.feedback import email_templates
import flask
import pymysql.cursors
from donut.modules.feedback.groups import groupInt, groupName
import donut.modules.groups.helpers as groups
import donut.modules.newsgroups.helpers as newsgroups
def send_update_email(group, email, com... | {
"repo_name": "ASCIT/donut",
"path": "donut/modules/feedback/helpers.py",
"copies": "2",
"size": "9848",
"license": "mit",
"hash": -4923602064571854000,
"line_mean": 33.1944444444,
"line_max": 89,
"alpha_frac": 0.6483549959,
"autogenerated": false,
"ratio": 3.6828721017202692,
"config_test": fa... |
from donut import email_utils
import flask
import smtplib
from donut.modules.core.helpers import get_name_and_email
from donut.modules.groups import helpers as groups
def get_past_messages(group_id, limit=5):
"""Returns a list of past sent messages"""
query = """
SELECT newsgroup_post_id, subject, messag... | {
"repo_name": "ASCIT/donut-python",
"path": "donut/modules/newsgroups/helpers.py",
"copies": "2",
"size": "7598",
"license": "mit",
"hash": 7477242748919430000,
"line_mean": 30.5269709544,
"line_max": 91,
"alpha_frac": 0.5997630956,
"autogenerated": false,
"ratio": 3.785749875435974,
"config_te... |
from doom.actions.action import Action
from doom.map.objects import Linedef
class HexenActionTypes(object):
function_map = {
10: act_door_close,
11: act_door_open,
}
def __init__(self, action_types):
self.action_types = action_types
def get(self, linede... | {
"repo_name": "GitExl/DoomPath",
"path": "src/doom/actions/hexen.py",
"copies": "1",
"size": "1716",
"license": "bsd-2-clause",
"hash": 4387729659991530500,
"line_mean": 30.2181818182,
"line_max": 74,
"alpha_frac": 0.5757575758,
"autogenerated": false,
"ratio": 3.830357142857143,
"config_test":... |
from doom.actions.action import Action
BITS_TRIGGER = 0x7
BITS_TRIGGER_SHIFT = 0
BITS_SPEED = 0x18
BITS_SPEED_SHIFT = 3
BITS_FLOOR_MODEL = 0x20
BITS_FLOOR_MODEL_SHIFT = 5
BITS_FLOOR_DIRECTION = 0x40
BITS_FLOOR_DIRECTION_SHIFT = 6
BITS_FLOOR_TARGET = 0x380
BITS_FLOOR_TARGET_SHIFT = 7
BITS_FLOOR_CHANGE = 0xc00
BITS_FL... | {
"repo_name": "GitExl/DoomPath",
"path": "src/doom/actions/boom.py",
"copies": "1",
"size": "11272",
"license": "bsd-2-clause",
"hash": -3737539967537501000,
"line_mean": 31.1168091168,
"line_max": 91,
"alpha_frac": 0.6295244855,
"autogenerated": false,
"ratio": 3.058057514921324,
"config_test"... |
from doom.actions import boom
from doom.actions.action import Action
type_mapping = {
'door': Action.TYPE_DOOR,
'floor': Action.TYPE_FLOOR,
'ceiling': Action.TYPE_CEILING,
'crusher': Action.TYPE_CRUSHER,
'teleporter': Action.TYPE_TELEPORTER,
'donut': Action.TYPE_DONUT,
'stairs': Action.TYP... | {
"repo_name": "GitExl/DoomPath",
"path": "src/doom/actions/list.py",
"copies": "1",
"size": "6744",
"license": "bsd-2-clause",
"hash": 6865410182330503000,
"line_mean": 30.8160377358,
"line_max": 73,
"alpha_frac": 0.6365658363,
"autogenerated": false,
"ratio": 3.353555445052213,
"config_test": ... |
from doom import wad
from doom.map.data import MapData
from nav.config import Config
from nav.mesh import Mesh
from navedit import pathfind
from util.vector import Vector2, Vector3
import cProfile
import camera
import pygame
import random
import render
import sys
COLOR_BACKGROUND = pygame.Color(0, 31, 63, 255)
COLOR_... | {
"repo_name": "GitExl/DoomPath",
"path": "src/navedit/main.py",
"copies": "1",
"size": "9955",
"license": "bsd-2-clause",
"hash": 6091916826214447000,
"line_mean": 33.0924657534,
"line_max": 207,
"alpha_frac": 0.5768960321,
"autogenerated": false,
"ratio": 3.462608695652174,
"config_test": true... |
from doom.map.objects import Linedef
from nav.connection import Connection
from nav.element import Element
from util import rectangle
from util.rectangle import Rectangle
from util.vector import Vector2
import pygame
COLOR_LINEDEF_IMPASSIBLE = pygame.Color(223, 223, 223, 255)
COLOR_LINEDEF_2SIDED = pygame.Color(95, 9... | {
"repo_name": "GitExl/DoomPath",
"path": "src/navedit/render.py",
"copies": "1",
"size": "12818",
"license": "bsd-2-clause",
"hash": -3040502392614012400,
"line_mean": 36.926035503,
"line_max": 185,
"alpha_frac": 0.5725542206,
"autogenerated": false,
"ratio": 3.3581346607283207,
"config_test": ... |
from door_api import DoorAPI
import nfc
import sys
import time
import RPi.GPIO as GPIO
import signal
class Actions:
RED=10
GREEN=8
def main():
access = DoorAPI()
access.api_key = ''
access.api_base = ''
running = True
initGpio()
signal.signal(signal.SIGINT, signal_h... | {
"repo_name": "harpesichord/Door-Access",
"path": "door/Door_Access.py",
"copies": "1",
"size": "1408",
"license": "mit",
"hash": -3679449322650474000,
"line_mean": 17.5263157895,
"line_max": 60,
"alpha_frac": 0.5063920455,
"autogenerated": false,
"ratio": 3.74468085106383,
"config_test": false... |
from doozer.export import Exporter
import csv
import smtplib
import StringIO
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class MailExport(Exporter):
name = "email"
path = "email"
description = "send the report as an email"
to = None
from_address = 'doozer'... | {
"repo_name": "meltmedia/doozer",
"path": "doozer/export/defaults.py",
"copies": "1",
"size": "1995",
"license": "mit",
"hash": 7637705554809495000,
"line_mean": 22.75,
"line_max": 79,
"alpha_frac": 0.5543859649,
"autogenerated": false,
"ratio": 3.7927756653992395,
"config_test": false,
"has_... |
from dopamine.gym import make_env
from keras.models import load_model
import numpy as np
from mathtools.utils import Vessel
from ipdb import set_trace as debug
from gym import wrappers
import pylab as plt
if __name__ == '__main__':
# Create an environment.
env = make_env('wiggle')
# Create a policy mode... | {
"repo_name": "lightscalar/dopamine",
"path": "scripts/wiggle_tester.py",
"copies": "1",
"size": "1183",
"license": "mit",
"hash": 2922733127319642000,
"line_mean": 24.7173913043,
"line_max": 64,
"alpha_frac": 0.6103127642,
"autogenerated": false,
"ratio": 3.25,
"config_test": false,
"has_no_... |
from dopamine.trpo import *
from dopamine.stochastics import *
from keras.models import model_from_json
import gym
# Create an instance of the lunar lander environment.
env = gym.make('BipedalWalker-v2')
D = env.observation_space.shape[0]
A = env.action_space.shape[0]
layers = []
layers.append({'input_dim': D, 'units... | {
"repo_name": "lightscalar/dopamine",
"path": "scripts/walker_experiments.py",
"copies": "1",
"size": "1159",
"license": "mit",
"hash": -6894017012394068000,
"line_mean": 29.5,
"line_max": 74,
"alpha_frac": 0.6609145815,
"autogenerated": false,
"ratio": 3.201657458563536,
"config_test": false,
... |
from dopamine.trpo import *
from dopamine.stochastics import *
from keras.models import model_from_json
import gym
# Create an instance of the lunar lander environment.
env = gym.make('LunarLanderContinuous-v2')
D = env.observation_space.shape[0]
A = env.action_space.shape[0]
layers = []
layers.append({'input_dim': D... | {
"repo_name": "lightscalar/dopamine",
"path": "scripts/continuous_lander.py",
"copies": "1",
"size": "1108",
"license": "mit",
"hash": 8649276480361065000,
"line_mean": 28.9459459459,
"line_max": 74,
"alpha_frac": 0.6651624549,
"autogenerated": false,
"ratio": 3.2303206997084546,
"config_test":... |
from dopamine.trpo import *
from dopamine.stochastics import *
from keras.models import model_from_json
import gym
# Create an instance of the lunar lander environment.
env = gym.make('LunarLander-v2')
D = env.observation_space.shape[0]
layers = []
layers.append({'input_dim': D, 'units': 128, 'activation': 'relu'})
... | {
"repo_name": "lightscalar/dopamine",
"path": "scripts/lunar_lander_experiments.py",
"copies": "1",
"size": "1074",
"license": "mit",
"hash": -1546671408458358300,
"line_mean": 28.8333333333,
"line_max": 74,
"alpha_frac": 0.6629422719,
"autogenerated": false,
"ratio": 3.2447129909365557,
"confi... |
from dork.dns import refresh
import unittest
import mock
from dork.docker import Container
_containers = [
Container({
'Name': 'test.a.1',
'State': {
'Running': True,
},
'NetworkSettings': {
'IPAddress': '172.17.0.2',
}
}),
Container({
... | {
"repo_name": "iamdork/dork",
"path": "tests/dns.py",
"copies": "1",
"size": "2285",
"license": "mit",
"hash": -3368041918863311400,
"line_mean": 20.3551401869,
"line_max": 59,
"alpha_frac": 0.5059080963,
"autogenerated": false,
"ratio": 3.355359765051395,
"config_test": true,
"has_no_keyword... |
from dota2py import api
from i3pystatus import IntervalModule
class Dota2wins(IntervalModule):
"""
Displays the win/loss ratio of a given Dota account.
Requires: dota2py
"""
settings = (
("matches", "Number of recent matches to calculate"),
("steamid", "Steam ID or username to tra... | {
"repo_name": "juliushaertl/i3pystatus",
"path": "i3pystatus/dota2wins.py",
"copies": "1",
"size": "4167",
"license": "mit",
"hash": 4092961695908316700,
"line_mean": 36.5405405405,
"line_max": 107,
"alpha_frac": 0.5572354212,
"autogenerated": false,
"ratio": 3.901685393258427,
"config_test": f... |
from dotbot import assign, TicketDelta, Ticket, TeamMember
def eq(left, right):
assert left == right
def test_assign_with_less_than_two_team_members():
eq(
TicketDelta(
owner="smallco",
repo="bigproj",
issue_number=1,
comment="Cannot assign a DoT with ... | {
"repo_name": "saltpy/dotbot",
"path": "test/test_assignment.py",
"copies": "1",
"size": "1095",
"license": "mit",
"hash": 35531743489257630,
"line_mean": 21.8125,
"line_max": 70,
"alpha_frac": 0.4383561644,
"autogenerated": false,
"ratio": 4.487704918032787,
"config_test": false,
"has_no_key... |
from dotenv import find_dotenv, load_dotenv
from functools import lru_cache
from typing import List
from os import getenv
from pydantic import BaseSettings, Field
import piecewise.config.defaults as default
class Settings(BaseSettings):
api_v1_route: str = default.API_V1_ROUTE
openapi_route: str = default.O... | {
"repo_name": "critzo/piecewise",
"path": "backend/piecewise/config/settings.py",
"copies": "1",
"size": "2439",
"license": "apache-2.0",
"hash": 7752012945216048000,
"line_mean": 32.875,
"line_max": 133,
"alpha_frac": 0.6646166462,
"autogenerated": false,
"ratio": 3.4064245810055866,
"config_t... |
from dotenv import load_dotenv, find_dotenv
import os
# from datapackage_pipelines.manager.logging_config import logging
from contextlib import contextmanager
# DEFAULT_LOGGING_LEVEL = logging.INFO
# root_logging_handler = logging.root.handlers[0]
# root_logging_handler.setFormatter(logging.Formatter("%(levelname)s:... | {
"repo_name": "Beit-Hatfutsot/mojp-dbs-pipelines",
"path": "datapackage_pipelines_mojp/settings.py",
"copies": "1",
"size": "1434",
"license": "mit",
"hash": 3344769704650664400,
"line_mean": 33.9756097561,
"line_max": 99,
"alpha_frac": 0.7622036262,
"autogenerated": false,
"ratio": 2.93251533742... |
from dotenv import load_dotenv, find_dotenv
import os
from sqlalchemy import create_engine, update
load_dotenv(find_dotenv())
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from collections import Counter
#Connect to MySQL
engine = create_engine(os.environ.get("mysql_python_adapter")
+os.enviro... | {
"repo_name": "nickysemenza/message-analyzer",
"path": "analyzer/viz/plot_word_frequency.py",
"copies": "1",
"size": "2629",
"license": "mit",
"hash": 1602562300495033300,
"line_mean": 30.6746987952,
"line_max": 200,
"alpha_frac": 0.7071129707,
"autogenerated": false,
"ratio": 2.8390928725701943,... |
from dotenv import load_dotenv, find_dotenv
import os
from sqlalchemy import create_engine, update
load_dotenv(find_dotenv())
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Connect to MySQL
engine = create_engine("mysql+pymysql://"
+os.environ.get("mysql_user")
+":"+os.environ.get("mysql_pas... | {
"repo_name": "nickysemenza/message-analyzer",
"path": "analyzer/viz/plot_monthly_messages.py",
"copies": "1",
"size": "3464",
"license": "mit",
"hash": 335280104134163800,
"line_mean": 36.247311828,
"line_max": 130,
"alpha_frac": 0.6902424942,
"autogenerated": false,
"ratio": 2.8675496688741724,... |
from dotenv import load_dotenv
from unipath import Path
load_dotenv()
load_dotenv(verbose=True)
BASE_DIR = Path(__file__).ancestor(2)
env_path = BASE_DIR.child('.env')
load_dotenv(dotenv_path=env_path)
from authome.settings import *
print('LOCAL!!!!')
# SECURITY WARNING: keep the secret key used in production secre... | {
"repo_name": "xncbf/authome",
"path": "authome/settings_local.py",
"copies": "1",
"size": "1389",
"license": "mit",
"hash": 649624063726315900,
"line_mean": 26.78,
"line_max": 74,
"alpha_frac": 0.652987761,
"autogenerated": false,
"ratio": 2.8346938775510204,
"config_test": false,
"has_no_ke... |
from dotenv import load_dotenv
import os
from datalake_common.errors import InsufficientConfiguration
DEFAULT_CONFIG = '/etc/datalake.env'
def load_config(config_file=None):
'''load the datalake configuration from known places
Configuration variables set in the environment are taken with higher
precede... | {
"repo_name": "planetlabs/atl",
"path": "datalake/config_helpers.py",
"copies": "1",
"size": "1174",
"license": "mit",
"hash": -84692669081954320,
"line_mean": 29.8947368421,
"line_max": 77,
"alpha_frac": 0.6686541738,
"autogenerated": false,
"ratio": 4.2690909090909095,
"config_test": true,
... |
from dotenv import load_dotenv
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
load_dotenv(os.path.join(BASE_DIR, '.env'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangopr... | {
"repo_name": "closeair/sundowners-fc",
"path": "sundowners/settings.py",
"copies": "1",
"size": "3005",
"license": "mit",
"hash": 1942920799697889000,
"line_mean": 25.8303571429,
"line_max": 91,
"alpha_frac": 0.6795341098,
"autogenerated": false,
"ratio": 3.518735362997658,
"config_test": fals... |
from dothub import utils
import sealedmock
class StringContains(object):
"""Ensures the string contains a list of subsrtings"""
def __init__(self, *substr):
self._substr = substr
def __eq__(self, other):
return all(x in other for x in self._substr)
def __repr__(self):
return "... | {
"repo_name": "Mariocj89/dothub",
"path": "tests/unit/test_utils.py",
"copies": "1",
"size": "3136",
"license": "mit",
"hash": -233470769202003620,
"line_mean": 29.1538461538,
"line_max": 94,
"alpha_frac": 0.6581632653,
"autogenerated": false,
"ratio": 3.2131147540983607,
"config_test": true,
... |
from .dotifydict import DotifyDict
__all__ = ['MetaMixin']
class MetaMixin(object):
"""
Mixin that provides the Meta class support to add settings to instances
of slumber objects. Meta settings cannot start with a _.
"""
def __init__(self, *args, **kwargs):
# Get a List of all the Class... | {
"repo_name": "rocktavious/pyul",
"path": "pyul/coreUtils/meta.py",
"copies": "1",
"size": "1134",
"license": "mit",
"hash": -4064445658502266400,
"line_mean": 33.3636363636,
"line_max": 79,
"alpha_frac": 0.5758377425,
"autogenerated": false,
"ratio": 4.18450184501845,
"config_test": false,
"... |
from dot import *
def repr(s):
return '"' + s + '"'
Debug.turnon()
BlockBegin("digraph G",
bgcolor = repr('grey'),
style = repr('filled'),
)
update_node_class("base",
shape = "plaintext",
style = repr("rounded,filled"),
fontname = repr("Monaco"),
color = repr("white"),
)
update_e... | {
"repo_name": "Superjom/haskydots",
"path": "rnnsearch.py",
"copies": "1",
"size": "9891",
"license": "apache-2.0",
"hash": -2451783638338645500,
"line_mean": 27.5867052023,
"line_max": 119,
"alpha_frac": 0.5237084218,
"autogenerated": false,
"ratio": 3.60327868852459,
"config_test": false,
"... |
from dot.lib.core import builtins
from dot.lib import core
import dot.compiler.builder
import dot.compiler.asm
import dot.parse
import sys
import os
def init():
if '-dot-builtins' not in builtins:
builtins['-dot-builtins'] = True
execute_import('dot.builtins', globals=builtins)
def execute(execu... | {
"repo_name": "zielmicha/dotlang",
"path": "dot/runtime.py",
"copies": "1",
"size": "2341",
"license": "bsd-2-clause",
"hash": 7974589026058127000,
"line_mean": 26.5411764706,
"line_max": 73,
"alpha_frac": 0.6240922683,
"autogenerated": false,
"ratio": 3.7396166134185305,
"config_test": false,
... |
from dot.lib import core
from collections import namedtuple
class Builder:
def __init__(self, filename='<none>', function=False,
toplevel_names=[], upper_names=[]):
# mess
self.ops = []
self.label_i = 0
self.info = None
self.stack = Stack()
self.sta... | {
"repo_name": "zielmicha/dotlang",
"path": "dot/compiler/builder.py",
"copies": "1",
"size": "6723",
"license": "bsd-2-clause",
"hash": 8837656949650575000,
"line_mean": 30.125,
"line_max": 91,
"alpha_frac": 0.5372601517,
"autogenerated": false,
"ratio": 3.883882149046794,
"config_test": false,... |
from dotmailer.connection import connection
from dotmailer.constants import constants
class Account(object):
@staticmethod
def get_account_information():
"""
Gets a summary of information about the current status of the
account
:return:
"""
return connection.g... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/account.py",
"copies": "1",
"size": "2425",
"license": "mit",
"hash": -9109414047403879000,
"line_mean": 30.4935064935,
"line_max": 80,
"alpha_frac": 0.5950515464,
"autogenerated": false,
"ratio": 4.754901960784314,
"config_test": false,
"has... |
from dotmailer import Base
from dotmailer.connection import connection
from dotmailer.constants import constants
class CampaignSends(Base):
campaign_id = None
address_book_ids = None
contact_ids = None
send_date = None
split_test_option = None,
status = constants.CAMPAIGN_STATUS_UNSENT
de... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/campaigns.py",
"copies": "1",
"size": "8814",
"license": "mit",
"hash": -1517470195391082500,
"line_mean": 27.9934210526,
"line_max": 99,
"alpha_frac": 0.5585432267,
"autogenerated": false,
"ratio": 4.440302267002519,
"config_test": false,
"h... |
from dotmailer import Base
from dotmailer.connection import connection
class Program(Base):
"""
"""
end_point = '/v2/programs'
name = None
status = None
date_created = None
@classmethod
def get_multiple(cls, select=1000, skip=0):
response = connection.get(
cl... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/programs.py",
"copies": "1",
"size": "1689",
"license": "mit",
"hash": -4172295779951233000,
"line_mean": 21.52,
"line_max": 61,
"alpha_frac": 0.4902309059,
"autogenerated": false,
"ratio": 4.409921671018277,
"config_test": false,
"has_no_key... |
from dotmailer import Base
from dotmailer.connection import connection
class Template(Base):
"""
This class represents a DotMailer template. To be able to create a
template you will need to define the following required fields:
**name** `The name of the template being created, which needs to be... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/templates.py",
"copies": "1",
"size": "4913",
"license": "mit",
"hash": 1182898197891701500,
"line_mean": 30.6967741935,
"line_max": 115,
"alpha_frac": 0.5809077956,
"autogenerated": false,
"ratio": 4.604498594189316,
"config_test": false,
"h... |
from dotmailer import Base
from dotmailer.connection import connection
class TransactionEmail(Base):
"""
"""
end_point = '/v2/email'
to_addresses = []
cc_addresses = []
bcc_addresses = []
subject = None
from_address = None
html_content = None
plain_text_content = None
... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/transactional_emails.py",
"copies": "1",
"size": "3923",
"license": "mit",
"hash": -4125487848961070600,
"line_mean": 33.1130434783,
"line_max": 134,
"alpha_frac": 0.59010961,
"autogenerated": false,
"ratio": 4.468109339407745,
"config_test": f... |
from dotmailer import Base
from dotmailer.constants import constants
from dotmailer.connection import connection
from dotmailer.address_books import AddressBook
class ContactScore(Base):
"""
Scoring information about a specific contact.
"""
contact_id = None
email = None
date_modified = N... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/contacts.py",
"copies": "1",
"size": "28411",
"license": "mit",
"hash": -344927716070224260,
"line_mean": 32.4640753828,
"line_max": 129,
"alpha_frac": 0.5486959276,
"autogenerated": false,
"ratio": 4.292340232663545,
"config_test": false,
"h... |
from dotmailer import Base
from dotmailer.constants import constants
from dotmailer.connection import connection
from dotmailer.exceptions import ErrorEnrolmentInvalid
class ProgramEnrolment(Base):
end_point = '/v2/programs/enrolments/'
program_id = None
status = None
date_created = None
contacts... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/program_enrolments.py",
"copies": "1",
"size": "3402",
"license": "mit",
"hash": 5464781920364090000,
"line_mean": 27.5882352941,
"line_max": 71,
"alpha_frac": 0.5652557319,
"autogenerated": false,
"ratio": 4.2,
"config_test": false,
"has_no_... |
from dotmailer import Base
from dotmailer.constants import constants
from dotmailer.connection import connection
class AddressBook(Base):
"""
name: The name of the address book you're creating, which
needs to be included within the request body. It can't be an
existing address book's name, 'Te... | {
"repo_name": "Mr-F/dotmailer",
"path": "dotmailer/address_books.py",
"copies": "1",
"size": "10275",
"license": "mit",
"hash": -6967382746051578000,
"line_mean": 30.9099378882,
"line_max": 78,
"alpha_frac": 0.5733333333,
"autogenerated": false,
"ratio": 4.698216735253772,
"config_test": false,... |
from dot.parse import parse
import os
import sys
if os.environ.get('DOTLANG_INTERPRETED'):
from dot.interpreter import RootFrame, Environ, builtins
def run_string(s):
code = parse(s)
return RootFrame(Environ(parents=[builtins]), code).run()
def run_file(path):
stdin = open(path)
... | {
"repo_name": "zielmicha/dotlang",
"path": "dot/main.py",
"copies": "1",
"size": "1515",
"license": "bsd-2-clause",
"hash": 2176556141575759400,
"line_mean": 23.8360655738,
"line_max": 68,
"alpha_frac": 0.5881188119,
"autogenerated": false,
"ratio": 3.731527093596059,
"config_test": false,
"h... |
from dot_product import dot_product
from update_weights import update_weights
from convert_dataset import convert_dataset
def learn_loop(dataset, answers, target): ### Just the digits from main dataset
"""Takes a dataset with expected values
returns proper weights for each element of the vector space
"""
# set ... | {
"repo_name": "uglyboxer/learn_nums",
"path": "depricated/depr_learn_loop.py",
"copies": "2",
"size": "1214",
"license": "unlicense",
"hash": 3216353948560756700,
"line_mean": 30.9736842105,
"line_max": 89,
"alpha_frac": 0.7075782537,
"autogenerated": false,
"ratio": 3.4005602240896358,
"config... |
from dots_raspi import DotsRaspi
from dots import Dots
import datetime
import time
class FlipDot:
"""FlipDot class"""
def __init__(self):
self.ROWS=16
self.COLUMNS=28
self.alphabet=list(open('5x7.font', 'r'))
self.showInConsole=False
self.Display=[[0 for r in range... | {
"repo_name": "KidMaxwell/FlipDot",
"path": "python3FlipDot/flipdot.py",
"copies": "1",
"size": "4459",
"license": "mit",
"hash": 4393411733339605000,
"line_mean": 38.4601769912,
"line_max": 184,
"alpha_frac": 0.4635568513,
"autogenerated": false,
"ratio": 3.731380753138075,
"config_test": fals... |
from DotStar_Emulator.emulator.vector2 import Vector2
from .widget import Widget
from .flags import *
__all__ = ["SizedRows", "TwoColumns", "Grid", "TwoRows", "BasePanel"]
class BasePanel(Widget):
def __init__(self, use_surface=False, color=None):
"""
Base class for a panel. A panel is a widget... | {
"repo_name": "chrisrossx/DotStar_Emulator",
"path": "DotStar_Emulator/emulator/gui/panels.py",
"copies": "1",
"size": "15847",
"license": "mit",
"hash": -9050713111384302000,
"line_mean": 35.1803652968,
"line_max": 118,
"alpha_frac": 0.578784628,
"autogenerated": false,
"ratio": 3.88788027477919... |
from .dotstring import list_length
from .dotstring import remove_key
class ExcludeFieldsById(object):
"""
This class provides a framework to exclude fields for certain
identifiers. Up to three arguments are passed to this class, an
identifier list, a list of fields to remove, and minimum list
size... | {
"repo_name": "biothings/biothings.api",
"path": "biothings/utils/exclude_ids.py",
"copies": "1",
"size": "1651",
"license": "apache-2.0",
"hash": -8232093374389285000,
"line_mean": 38.3095238095,
"line_max": 77,
"alpha_frac": 0.6081162932,
"autogenerated": false,
"ratio": 4.344736842105263,
"c... |
from dottedish import api
from UserDict import UserDict
@api.setitem.when_type(dict)
def setitem_dict(o, key, value):
o[key] = value
@api.getitem.when_type(dict)
def getitem_dict(o, key):
return o[key]
@api.wrap.when_type(dict)
def wrap_dict(o):
return DottedDict(o)
class DottedDict(object):
def __... | {
"repo_name": "ish/dottedish",
"path": "dottedish/dotteddict.py",
"copies": "1",
"size": "1279",
"license": "bsd-3-clause",
"hash": -5711054572883326000,
"line_mean": 21.0517241379,
"line_max": 56,
"alpha_frac": 0.5848318999,
"autogenerated": false,
"ratio": 3.3134715025906734,
"config_test": f... |
from dottedish import api
@api.setitem.when_type(list)
def setitem_list(o, key, value):
# Allow a new item to be appended to the list by setting the next item.
# XXX I think this is a hack to allow lists to created and filled during
# unflatten. Personally, I would much, much rather see the unflattened
... | {
"repo_name": "ish/dottedish",
"path": "dottedish/dottedlist.py",
"copies": "1",
"size": "1792",
"license": "bsd-3-clause",
"hash": 6937340914445502000,
"line_mean": 23.5479452055,
"line_max": 76,
"alpha_frac": 0.5870535714,
"autogenerated": false,
"ratio": 3.4198473282442747,
"config_test": fa... |
from dottorrent import DotTorrent
import tracker
from peer import Peer
import log
import random
import utilities
class Piece:
byteSize = 0
sha1 = 0
class Block:
pass
# a torrent download
class Torrent:
# list of tracker objects
trackers = []
# the tracker object that we're currently utilizing... | {
"repo_name": "dionyziz/downpour",
"path": "torrent.py",
"copies": "1",
"size": "3466",
"license": "mit",
"hash": -723286983556700800,
"line_mean": 33.3168316832,
"line_max": 106,
"alpha_frac": 0.5839584535,
"autogenerated": false,
"ratio": 3.9566210045662102,
"config_test": false,
"has_no_ke... |
from doubles.allowance import Allowance
from doubles.expectation import Expectation
from doubles.proxy_method import ProxyMethod
from doubles.verification import verify_method
class MethodDouble(object):
"""A double of an individual method."""
def __init__(self, method_name, target):
"""
:par... | {
"repo_name": "uber/doubles",
"path": "doubles/method_double.py",
"copies": "1",
"size": "4796",
"license": "mit",
"hash": -6614392596715314000,
"line_mean": 32.3055555556,
"line_max": 98,
"alpha_frac": 0.6359466222,
"autogenerated": false,
"ratio": 4.729783037475345,
"config_test": false,
"h... |
from doubles.allowance import Allowance
class Expectation(Allowance):
"""An individual method expectation (mock)."""
def __init__(self, target, method_name, caller):
"""
:param Target target: The object owning the method to mock.
:param str method_name: The name of the method to mock.... | {
"repo_name": "uber/doubles",
"path": "doubles/expectation.py",
"copies": "1",
"size": "2821",
"license": "mit",
"hash": -1241793439300560100,
"line_mean": 30.3444444444,
"line_max": 99,
"alpha_frac": 0.6246012052,
"autogenerated": false,
"ratio": 4.506389776357827,
"config_test": false,
"has... |
from doubles.exceptions import UnallowedMethodCallError
from doubles.instance_double import InstanceDouble
from doubles.target import Target
from doubles.verification import verify_arguments
def patch_class(input_class):
"""Create a new class based on the input_class.
:param class input_class: The class to ... | {
"repo_name": "uber/doubles",
"path": "doubles/class_double.py",
"copies": "1",
"size": "1688",
"license": "mit",
"hash": 168691691816461950,
"line_mean": 29.1428571429,
"line_max": 98,
"alpha_frac": 0.644549763,
"autogenerated": false,
"ratio": 4.087167070217918,
"config_test": false,
"has_n... |
from doubles import InstanceDouble, allow
from pytest import fixture
from staticpy.category import Category
def dummy_page(order=0, published=True, **kwargs):
return InstanceDouble(
'staticpy.page.Page',
order=order,
published=published,
**kwargs
)
def dummy_pages(count=10,... | {
"repo_name": "toddsifleet/staticpy",
"path": "test/category_test.py",
"copies": "1",
"size": "4368",
"license": "mit",
"hash": -6422795483158669000,
"line_mean": 29.124137931,
"line_max": 75,
"alpha_frac": 0.6243131868,
"autogenerated": false,
"ratio": 3.7655172413793103,
"config_test": true,
... |
from doubles.patch import Patch
from doubles.proxy import Proxy
class Space(object):
"""
A container object for all the doubles created during the execution of a test case. Maintains
a one-to-one mapping of target objects and ``Proxy`` objects. Maintained by the ``lifecycle``
module and not intended t... | {
"repo_name": "uber/doubles",
"path": "doubles/space.py",
"copies": "1",
"size": "2152",
"license": "mit",
"hash": 5477248137777351000,
"line_mean": 27.6933333333,
"line_max": 97,
"alpha_frac": 0.5989776952,
"autogenerated": false,
"ratio": 4.329979879275654,
"config_test": false,
"has_no_key... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.