text stringlengths 0 1.05M | meta dict |
|---|---|
from Firefly import logging, scheduler
from Firefly.const import COMMAND_SET_LIGHT
from Firefly.helpers.events import Command
# TODO: Refactor this code.
class CTFade(object):
def __init__(self, firefly, ff_id, start_k, end_k, fade_sec, start_level=100, end_level=100, run=True):
if type(start_level) is not int... | {
"repo_name": "Firefly-Automation/Firefly",
"path": "Firefly/components/hue/ct_fade.py",
"copies": "1",
"size": "4030",
"license": "apache-2.0",
"hash": 685185942541059600,
"line_mean": 31.5,
"line_max": 113,
"alpha_frac": 0.6248138958,
"autogenerated": false,
"ratio": 3.1459797033567525,
"conf... |
from FireGirlOptimizer import *
FGPO = FireGirlPolicyOptimizer()
###To create, uncomment the following two lines:
FGPO.createFireGirlPathways(10,50)
FGPO.normalizeAllFeatures()
#FGPO.saveFireGirlPathways("FG_pathways_20x50.fgl")
###To load (already created data), uncomment the following line
#FGPO.loadFireGirlPathwa... | {
"repo_name": "smcgregor/gravity",
"path": "test_script_optimizer4.py",
"copies": "2",
"size": "3856",
"license": "mpl-2.0",
"hash": 3470242848576036400,
"line_mean": 33.7387387387,
"line_max": 70,
"alpha_frac": 0.7404045643,
"autogenerated": false,
"ratio": 2.380246913580247,
"config_test": fa... |
from FireGirlOptimizer import *
FGPO = FireGirlPolicyOptimizer()
###To create, uncomment the following two lines:
FGPO.createFireGirlPathways(10,50)
#FGPO.saveFireGirlPathways("FG_pathways_20x50.fgl")
###To load (already created data), uncomment the following line
#FGPO.loadFireGirlPathways("FG_pathways_20x50.fgl")
... | {
"repo_name": "buckinha/gravity",
"path": "deprecated/test_script_optimizer2.py",
"copies": "1",
"size": "1197",
"license": "mpl-2.0",
"hash": 4205178044215586000,
"line_mean": 27.5238095238,
"line_max": 63,
"alpha_frac": 0.7351712615,
"autogenerated": false,
"ratio": 2.590909090909091,
"config... |
from FireGirlOptimizer import *
#from FireGirlPathway import *
#from FireGirlPolicy import *
#from FireGirlPathwayLogbook import *
#without initializing a policy, these will each have an all-zero (coin-toss) policy
ls0 = FireGirlPathway(0)
ls1 = FireGirlPathway(1)
ls2 = FireGirlPathway(2)
ls3 = FireGirlPathway(3)
#s... | {
"repo_name": "smcgregor/gravity",
"path": "ts_synthetic_pathway_1.py",
"copies": "3",
"size": "3256",
"license": "mpl-2.0",
"hash": 5417552057530024000,
"line_mean": 23.8549618321,
"line_max": 83,
"alpha_frac": 0.7036240786,
"autogenerated": false,
"ratio": 2.4190193164933134,
"config_test": f... |
from FireGirlOptimizer import *
from FireGirlStats import *
from server import *
from numpy import mean
import MDP, random
from MDP_PolicyOptimizer import *
import random
class FireGirlTests:
#This class is designed to house functions useful in testing and analyzing the behavior
# and data of FireGirl object... | {
"repo_name": "smcgregor/gravity",
"path": "FireGirlTests.py",
"copies": "1",
"size": "47009",
"license": "mpl-2.0",
"hash": 4921114139210949000,
"line_mean": 39.2819194516,
"line_max": 254,
"alpha_frac": 0.5689123359,
"autogenerated": false,
"ratio": 3.496392711044998,
"config_test": true,
"... |
from FireGirlOptimizer import *
from FireGirlStats import *
# Keep track of file numbers so they don't repeat
server_file_counter = 0
def file_number_str():
global server_file_counter
server_file_counter += 1
return server_file_counter
def initialize():
"""
Return the initialization object for th... | {
"repo_name": "buckinha/gravity",
"path": "domain_bridge_FireGirl.py",
"copies": "1",
"size": "17887",
"license": "mpl-2.0",
"hash": -8641851760895803000,
"line_mean": 43.0566502463,
"line_max": 116,
"alpha_frac": 0.5450327053,
"autogenerated": false,
"ratio": 4.056009070294785,
"config_test": ... |
from FireGirlOptimizer import *
import random
random.seed(0)
#create pathways
pathways = []
for l in range(100):
pathways.append(FireGirlPathway(l))
#create ignitions
for ls in pathways:
for i in range(15):
ign = FireGirlIgnitionRecord()
f1 = random.randint(-100,100)
f2 = random.rand... | {
"repo_name": "buckinha/gravity",
"path": "deprecated/ts_synthetic_pathway_2.py",
"copies": "3",
"size": "2514",
"license": "mpl-2.0",
"hash": 2720067024391636000,
"line_mean": 28.9404761905,
"line_max": 98,
"alpha_frac": 0.5970564837,
"autogenerated": false,
"ratio": 3.2948885976408913,
"confi... |
from FireGirlOptimizer import *
import random
random.seed(0)
#create pathways
pathways = []
for l in range(100):
pathways.append(FireGirlPathway(l))
#create ignitions
for pw in pathways:
for i in range(200):
ign = FireGirlIgnitionRecord()
f1 = random.randint(-5,5)
f2 = random.randint... | {
"repo_name": "smcgregor/gravity",
"path": "ts_synthetic_pathway_4.py",
"copies": "2",
"size": "2689",
"license": "mpl-2.0",
"hash": -8793158638111828000,
"line_mean": 27.6170212766,
"line_max": 98,
"alpha_frac": 0.6124953514,
"autogenerated": false,
"ratio": 3.2633495145631066,
"config_test": ... |
from FireGirlOptimizer import *
FGPO = FireGirlPolicyOptimizer()
###To create, uncomment the following two lines:
FGPO.createFireGirlPathways(10,50)
#FGPO.saveFireGirlPathways("FG_pathways_20x50.fgl")
###To load (already created data), uncomment the following line
#FGPO.loadFireGirlPathways("FG_pathways_20x50... | {
"repo_name": "OregonStateUniversityFireTeam/gravity",
"path": "test_script_optimizer2.py",
"copies": "1",
"size": "1034",
"license": "mpl-2.0",
"hash": 7307334730573559000,
"line_mean": 30.375,
"line_max": 63,
"alpha_frac": 0.7040618956,
"autogenerated": false,
"ratio": 2.528117359413203,
"con... |
from FireGirlPathway import *
from FireGirlPolicy import *
import math, scipy, pickle
from scipy.optimize import *
class FireGirlPolicyOptimizer:
def __init__(self, USING_FIREGIRL_PATHWAYS=True):
#A list to hold all the pathways in a data set, whether they represent FireGirl or
# FireWoman pathw... | {
"repo_name": "smcgregor/gravity",
"path": "FireGirlOptimizer.py",
"copies": "2",
"size": "38736",
"license": "mpl-2.0",
"hash": -3131120757818752500,
"line_mean": 41.8033149171,
"line_max": 131,
"alpha_frac": 0.5819650971,
"autogenerated": false,
"ratio": 4.166057216605721,
"config_test": fals... |
from FireGirlPathway import *
from numpy import mean, std
from scipy.stats import t #t distribution and stats
"""This modules holds many functions that define basic stats on FireGirl pathways
Note: Most functions of this class accept a list of FireGirlPathway objects on which
to run the statistic(s) in question.
""... | {
"repo_name": "smcgregor/gravity",
"path": "FireGirlStats.py",
"copies": "2",
"size": "18667",
"license": "mpl-2.0",
"hash": 7138614196766716000,
"line_mean": 42.6144859813,
"line_max": 158,
"alpha_frac": 0.6720415707,
"autogenerated": false,
"ratio": 3.6120356037151704,
"config_test": false,
... |
from firehose.model import (Analysis, Generator, Metadata,
DebianBinary, DebianSource)
from ethel.commands import PLUGINS, load_module
from ethel.client import get_proxy, checkout
from contextlib import contextmanager
from ethel.utils import tdir, cd, run_command
from ethel.config import lo... | {
"repo_name": "paultag/ethel",
"path": "ethel/daemon.py",
"copies": "1",
"size": "4810",
"license": "mit",
"hash": -9115552413576576000,
"line_mean": 33.1134751773,
"line_max": 106,
"alpha_frac": 0.5594594595,
"autogenerated": false,
"ratio": 4.069373942470389,
"config_test": true,
"has_no_ke... |
from firehose.model import Issue, Message, File, Location
import re
LINE_INFO = re.compile(
r"(?P<minutes>\d+)m(?P<sec>(\d(\.?))+)s (?P<severity>\w+): (?P<info>.*)")
def parse_piuparts(lines, path):
obj = None
info = None
testid_fallback = None
cur_msg = ""
cat = {
"dependency-is-m... | {
"repo_name": "paultag/ethel",
"path": "ethel/wrappers/piuparts.py",
"copies": "1",
"size": "1721",
"license": "mit",
"hash": -175088504798877100,
"line_mean": 26.3174603175,
"line_max": 77,
"alpha_frac": 0.4648460198,
"autogenerated": false,
"ratio": 4.117224880382775,
"config_test": false,
... |
from firehose.model import Issue, Message, File, Location, Point
import re
LINE_RE = re.compile(
r"(?P<path>[^:]+):(?P<line>\d+):(?P<col>\d+): (?P<err>[^ ]+) (?P<msg>.*)"
)
def parse_flake8(lines):
for line in lines:
info = LINE_RE.match(line).groupdict()
severity = "error" if info['err'].st... | {
"repo_name": "lucaskanashiro/debile",
"path": "debile/slave/wrappers/flake8.py",
"copies": "4",
"size": "1196",
"license": "mit",
"hash": 6172159427787467000,
"line_mean": 35.2424242424,
"line_max": 77,
"alpha_frac": 0.4615384615,
"autogenerated": false,
"ratio": 4.24113475177305,
"config_test... |
from firehose.model import Issue, Message, File, Location, Point
import re
LINE_RE = re.compile(
r"(?P<severity>\w): (?P<package>.*): (?P<testid>[^\s]+)( (?P<message>.*))?"
)
def parse_lintian(lines, fpath):
severities = {
"w": "warning",
"e": "error",
"p": "pedantic",
"i": "i... | {
"repo_name": "paultag/ethel",
"path": "ethel/wrappers/lintian.py",
"copies": "1",
"size": "1082",
"license": "mit",
"hash": -1986256096106839300,
"line_mean": 26.7435897436,
"line_max": 79,
"alpha_frac": 0.4648798521,
"autogenerated": false,
"ratio": 4.2265625,
"config_test": false,
"has_no_... |
from fire_risk.models import DIST
from fire_risk.models.DIST.providers.ahs import ahs_building_areas
from fire_risk.backends import PostgresBackend
from fire_risk.backends.queries import RESIDENTIAL_FIRES_BY_FDID_STATE
from firecares.firestation.models import FireDepartment
from django.core.management.base import BaseC... | {
"repo_name": "acengic/firecares",
"path": "firecares/firestation/management/commands/load-dist-scores.py",
"copies": "1",
"size": "1762",
"license": "mit",
"hash": -8567304193687871000,
"line_mean": 37.3043478261,
"line_max": 128,
"alpha_frac": 0.613507378,
"autogenerated": false,
"ratio": 4.022... |
from fireside import WSGIFilter
from webob.dec import wsgify
from servlet_support import * # FIXME be explicit
from javax.servlet import FilterChain
# Derived from the Latinator example in PEP3333, but without requiring
# a piglatin module ;)
class UppercaseIter(object):
"""Transform iterated output to upperca... | {
"repo_name": "jythontools/fireside",
"path": "tests/test_generic_middleware.py",
"copies": "1",
"size": "4425",
"license": "apache-2.0",
"hash": 5026986563974473000,
"line_mean": 32.2706766917,
"line_max": 88,
"alpha_frac": 0.5961581921,
"autogenerated": false,
"ratio": 4.166666666666667,
"con... |
from fireside import WSGIServlet
from jythonlib import dict_builder
from nose.tools import assert_equal, assert_in, assert_is_instance, assert_not_in, assert_raises
from org.python.tools.fireside import RequestBridge
from servlet_support import AdaptedErrLog, AdaptedInputStream, ResponseMock, RequestMock, ServletConfi... | {
"repo_name": "jythontools/fireside",
"path": "tests/test_servlet.py",
"copies": "1",
"size": "1682",
"license": "apache-2.0",
"hash": -7957444513659461000,
"line_mean": 38.1162790698,
"line_max": 107,
"alpha_frac": 0.7122473246,
"autogenerated": false,
"ratio": 3.4396728016359917,
"config_test... |
from firewallconfigdecryptor.exception import ParserException
from firewallconfigdecryptor.device import Firewall, Gateway, FirewallInterface
from firewallconfigdecryptor.security import ACL, InterfaceACL, SecurityZone, SecurityConduit, ConduitFirewallArchitecture, RuleInteraction,AtomicACE
from firewallconfigdecryp... | {
"repo_name": "dinesharanathunga/firewallconfigdecryptor",
"path": "firewallconfigdecryptor/parsers/platform/cisco.py",
"copies": "1",
"size": "44828",
"license": "mit",
"hash": -2766850565588289000,
"line_mean": 51.5579450418,
"line_max": 245,
"alpha_frac": 0.4708887303,
"autogenerated": false,
... |
from FireWallGeneration import FireWallGeneration
from FireWallFitness import FireWallTest
from PacketDataParser import *
from time import time
import cProfile
GENERATIONS_NUMBER = 100000
NUM_OF_FIREWALLS = 84
SAVE_TO_FILE_TIMES = 10
NUM_GOOD_PACKETS = 1000
NUM_BAD_PACKETS = 1000
CLEAN_PACKETS_CSV_FILE_PATH = "clean.c... | {
"repo_name": "LeonAgmonNacht/Genetic-Algorithm-Firewall-TAU",
"path": "Main.py",
"copies": "1",
"size": "2038",
"license": "mit",
"hash": -986605722593107700,
"line_mean": 32.9666666667,
"line_max": 92,
"alpha_frac": 0.6938174681,
"autogenerated": false,
"ratio": 3.3910149750415974,
"config_te... |
from firewall import Firewall
import sys
import os
"""
gui.py Author: Rowland DePree
A command console UI(user interface) design to interact with the firewall file to make it more user friendly.
"""
def main():
"""
Main method.
:return None
"""
firew... | {
"repo_name": "zach-/cisc_230_project",
"path": "netfilter/gui.py",
"copies": "1",
"size": "4679",
"license": "mit",
"hash": 7619654810232391000,
"line_mean": 36.1349206349,
"line_max": 264,
"alpha_frac": 0.5007480231,
"autogenerated": false,
"ratio": 4.5471331389698735,
"config_test": false,
... |
from firmware.frame import Frame
from firmware.uart import Uart
import asyncio
class Shield():
def __init__(self):
self.frame = Frame()
self.uart = Uart()
self.uart.start()
def setMotors(self, payload):
self.uart.send(self.frame.motors(payload))
def setManipulator(self, p... | {
"repo_name": "TurtleRover/Turtle-Rover-Mission-Control",
"path": "server/firmware/shield.py",
"copies": "1",
"size": "1227",
"license": "mit",
"hash": -5027775188556667000,
"line_mean": 29.675,
"line_max": 81,
"alpha_frac": 0.641401793,
"autogenerated": false,
"ratio": 3.3801652892561984,
"con... |
from first_peaks_method import MIDI_Detector
#from least_squares_method import Highest_Peaks_MIDI_Detector
import sys
import os
#from least_squares_first_peaks_2 import MIDI_Detector_Least_Squares_2
#from least_squares_highest_peaks_2 import Highest_Peaks_Least_Squares
class NotePlotter(object):
"""
Class... | {
"repo_name": "Agerrr/Automated_Music_Transcription",
"path": "plotNotes.py",
"copies": "1",
"size": "6000",
"license": "mit",
"hash": 2676758083261804500,
"line_mean": 29.9278350515,
"line_max": 80,
"alpha_frac": 0.4145,
"autogenerated": false,
"ratio": 3.4364261168384878,
"config_test": false... |
from fis_entity import *
from utility import valid_college_name, valid_department_name, xml_result_generator, remove_extra_args
import os
GWU = "The George Washington University"
class Loader:
def __init__(self, filename, data_dir,
gwids=None, entity_class=None, field_to_entity=None, field_renam... | {
"repo_name": "gwu-libraries/vivo-load",
"path": "loader/fis_load.py",
"copies": "1",
"size": "17122",
"license": "mit",
"hash": 5355765582505653000,
"line_mean": 37.3901345291,
"line_max": 120,
"alpha_frac": 0.6050110968,
"autogenerated": false,
"ratio": 3.7441504482834027,
"config_test": fals... |
from fishbowl.util import *
import os
import shutil
OPERATION_CHAIN_DAO = "uk.gov.gchq.gaffer.operation.OperationChainDAO"
class Fishbowl:
def __init__(self, gaffer_connector, generated_directory_path="generated"):
self._gaffer_connector = gaffer_connector
self.generated_directory_path = generat... | {
"repo_name": "gchq/gaffer-tools",
"path": "fish-bowl/fishbowl/fishbowl.py",
"copies": "1",
"size": "6701",
"license": "apache-2.0",
"hash": -382980966602331500,
"line_mean": 50.9457364341,
"line_max": 114,
"alpha_frac": 0.5639456797,
"autogenerated": false,
"ratio": 4.376877857609405,
"config_... |
from fishlib import Fluidinfo, json
def tag_by_about_values(db, items, map=None):
# takes items as a list, tuple or dictionary of objects
body = tag_by_about_values_json(db, items, map)
return db.call('PUT', '/values', json.dumps(body))
def save_json_for_tag_by_about_values(db, items, path, map=None):
... | {
"repo_name": "njr0/fish",
"path": "fish/values.py",
"copies": "1",
"size": "1286",
"license": "mit",
"hash": 4784238886086035000,
"line_mean": 28.9069767442,
"line_max": 70,
"alpha_frac": 0.534992224,
"autogenerated": false,
"ratio": 3.167487684729064,
"config_test": false,
"has_no_keywords"... |
from fisica import Fisica, FWorld, FBox
class Texto(FBox):
def __init__(self, _texto):
FBox.__init__(self, textWidth(_texto), textAscent() + textDescent())
self.texto = _texto
self.textOffset = textAscent() - self.getHeight()/2
def draw(self, applet):
FBox.draw(self, applet)
... | {
"repo_name": "YatharthROCK/agar",
"path": "libraries/processing.py-0202-macosx/examples.py/Fisica/inherit.py",
"copies": "5",
"size": "1455",
"license": "mit",
"hash": -3607763026626890000,
"line_mean": 22.8524590164,
"line_max": 76,
"alpha_frac": 0.5635738832,
"autogenerated": false,
"ratio": 3... |
from fis_load import BasicLoader
import orcid2vivo_loader
from orcid2vivo_app.utility import clean_orcid, is_valid_orcid
import os
from loader.fis_entity import Award, ProfessionalMembership, Reviewership, Presentation
from loader.fis_entity import Person
from rdflib import Literal, RDF, RDFS, XSD
from utility import ... | {
"repo_name": "gwu-libraries/vivo-load",
"path": "loader/mygw_load.py",
"copies": "1",
"size": "5942",
"license": "mit",
"hash": 6272984357151996000,
"line_mean": 40.8450704225,
"line_max": 113,
"alpha_frac": 0.6053517334,
"autogenerated": false,
"ratio": 3.599030890369473,
"config_test": false... |
from fit4school.core.models import Program, Classroom, Tracker, Student
from fit4school.control.admin_utils import days_since_last_sync, get_last_tracker, get_last_sync
def weekly(program, lost_days=7, start_date=None):
# check students
mising_devices = []
empty_devices = []
low_devices = []
no_tr... | {
"repo_name": "goodes/fit4school",
"path": "fit4school/core/reports.py",
"copies": "1",
"size": "1823",
"license": "apache-2.0",
"hash": -3924499863554637000,
"line_mean": 33.3962264151,
"line_max": 96,
"alpha_frac": 0.6193088316,
"autogenerated": false,
"ratio": 3.9544468546637743,
"config_tes... |
from fitfunctionbase import FitFunctionBase
from fitparameters import *
from fithandles import *
__all__ = [
'FitFuncGaussian', 'FitFuncPseudoVoigt', 'FitFuncBoltzmann2',
'FitFuncConstant', 'FitFuncLine', 'FitFuncHeaviside',
'FitFuncRectangularWindow'
]
class FitFuncGaussian(FitFunctionBase):
name = 'gaus... | {
"repo_name": "takumak/tuna",
"path": "src/fitfunctions.py",
"copies": "1",
"size": "8012",
"license": "mit",
"hash": -501603090534087040,
"line_mean": 30.296875,
"line_max": 162,
"alpha_frac": 0.5857463804,
"autogenerated": false,
"ratio": 2.453905053598775,
"config_test": false,
"has_no_key... |
from fit.messages import Message
from fit.messages.common import FileId
from fit.utils import get_known
class FileLike(object):
body = []
type = None
record_types = frozenset((Message,))
@property
def file_id(self):
if len(self.body) and isinstance(self.body[0], FileId):
retur... | {
"repo_name": "rembish/fit",
"path": "fit/files/__init__.py",
"copies": "1",
"size": "1968",
"license": "bsd-3-clause",
"hash": 6378133368578656000,
"line_mean": 30.2380952381,
"line_max": 72,
"alpha_frac": 0.5487804878,
"autogenerated": false,
"ratio": 4.169491525423729,
"config_test": false,
... |
from fit.messages import Message
from fit.types.extended import MessageIndex, DisplayMeasure, Bool, Sport, \
SubSport, Gender, Language, DisplayHeart, DisplayPower, DisplayPosition, \
ActivityClass, UserLocalId
from fit.types.general import UInt8, UInt32, SInt8, UInt16, String, Byte, \
UInt16Z, UInt8Z
cla... | {
"repo_name": "rembish/fit",
"path": "fit/messages/settings.py",
"copies": "1",
"size": "2902",
"license": "bsd-3-clause",
"hash": -2048410352498221800,
"line_mean": 27.7326732673,
"line_max": 78,
"alpha_frac": 0.6516195727,
"autogenerated": false,
"ratio": 2.81747572815534,
"config_test": fals... |
from fit.messages import Message
from fit.types.extended import MessageIndex, Manufacturer, GarminProduct, \
SportBits0, WorkoutCapabilities, ConnectivityCapabilities, File, \
FileFlags, MesgNum, MesgCount
from fit.types.general import String, UInt8Z, UInt16, UInt32, UInt8
class Software(Message):
msg_typ... | {
"repo_name": "rembish/fit",
"path": "fit/messages/device.py",
"copies": "1",
"size": "1354",
"license": "bsd-3-clause",
"hash": 999466844878523100,
"line_mean": 21.5666666667,
"line_max": 75,
"alpha_frac": 0.6816838996,
"autogenerated": false,
"ratio": 3.2864077669902914,
"config_test": false,... |
from fit.messages import Message
from fit.types.extended import SubSport, MessageIndex, HrZoneCalc, PwrZoneCalc
from fit.types.extended import Sport as SportField
from fit.types.general import String, UInt8, UInt16
class ZonesTarget(Message):
msg_type = 7
max_heart_rate = UInt8(1)
threshold_heart_rate = ... | {
"repo_name": "rembish/fit",
"path": "fit/messages/sport_settings.py",
"copies": "1",
"size": "1336",
"license": "bsd-3-clause",
"hash": -8689292731280291000,
"line_mean": 20.2063492063,
"line_max": 78,
"alpha_frac": 0.6571856287,
"autogenerated": false,
"ratio": 2.982142857142857,
"config_test... |
from fito import config
import warnings
from functools import wraps
from fito import Spec
from fito.data_store.rehash_ui import RehashUI
from fito.operation_runner import FifoCache, OperationRunner
from fito.operations.decorate import as_operation
from fito.specs.base import get_import_path
from fito.specs.fields impo... | {
"repo_name": "elsonidoq/fito",
"path": "fito/data_store/base.py",
"copies": "1",
"size": "7243",
"license": "mit",
"hash": 4887458467328269000,
"line_mean": 31.1911111111,
"line_max": 105,
"alpha_frac": 0.5667541074,
"autogenerated": false,
"ratio": 4.4083992696287275,
"config_test": false,
... |
from fito import OperationRunner
from fito.specs.base import Spec, load_object
from fito.specs.fields import SpecField, _no_default, PrimitiveField
class Operation(Spec):
out_data_store = SpecField(default=None, serialize=False)
default_data_store = None
def execute(self, force=False):
return Ope... | {
"repo_name": "elsonidoq/fito",
"path": "fito/operations/operation.py",
"copies": "1",
"size": "1234",
"license": "mit",
"hash": 2528632118022193000,
"line_mean": 27.0454545455,
"line_max": 80,
"alpha_frac": 0.6693679092,
"autogenerated": false,
"ratio": 3.6617210682492582,
"config_test": false... |
from fito import PrimitiveField
from fito.model.model import Model, ModelParameter
from sklearn.linear_model import LinearRegression as SKLinearRegression
from sklearn.linear_model import LogisticRegression as SKLogisticRegression
from sklearn.ensemble import GradientBoostingClassifier as SKGradientBoostingClassifier
... | {
"repo_name": "elsonidoq/fito",
"path": "fito/model/scikit_learn.py",
"copies": "1",
"size": "2734",
"license": "mit",
"hash": -2377217878216838700,
"line_mean": 43.8196721311,
"line_max": 87,
"alpha_frac": 0.7249451353,
"autogenerated": false,
"ratio": 3.625994694960212,
"config_test": false,
... |
from fito import Spec
from fito.data_store.base import BaseDataStore
from fito.specs import base
class DictDataStore(BaseDataStore):
def __init__(self, *args, **kwargs):
super(DictDataStore, self).__init__(*args, **kwargs)
self.data = {}
def iteritems(self):
return self.data.iteritems... | {
"repo_name": "elsonidoq/fito",
"path": "fito/data_store/dict_ds.py",
"copies": "1",
"size": "1071",
"license": "mit",
"hash": -5018074988299947000,
"line_mean": 25.1219512195,
"line_max": 83,
"alpha_frac": 0.5816993464,
"autogenerated": false,
"ratio": 3.8945454545454545,
"config_test": false,... |
from fito.operations.operation import Operation, OperationField
from fito.specs.base import get_import_path, Spec
from fito.specs.fields import UnboundPrimitiveField, PrimitiveField, SpecField, ArgsField
from fito.specs.utils import recursive_map
class StorageRefactor(Operation):
doc = UnboundPrimitiveField(0, se... | {
"repo_name": "elsonidoq/fito",
"path": "fito/data_store/refactor.py",
"copies": "1",
"size": "5713",
"license": "mit",
"hash": -4088408376448469000,
"line_mean": 29.550802139,
"line_max": 106,
"alpha_frac": 0.6448450901,
"autogenerated": false,
"ratio": 3.867975626269465,
"config_test": false,... |
from fitparse import FitFile
from collections import Counter
import os
from PyQt5 import QtWidgets, uic
class FitBrowserGUI(QtWidgets.QMainWindow):
"""
GUI which displays the contents of a .fit file
"""
def __init__(self, parent=None):
super(FitBrowserGUI, self).__init__(parent)
ui_fi... | {
"repo_name": "anaandresarroyo/Python-GarminDataAnalyser",
"path": "fitparser/fitbrowsergui.py",
"copies": "1",
"size": "4620",
"license": "mit",
"hash": 6721533984425682000,
"line_mean": 40.6216216216,
"line_max": 118,
"alpha_frac": 0.6372294372,
"autogenerated": false,
"ratio": 4.14349775784753... |
from fitstools import manage_dtype, mask_fits, assign_header
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
import cosmics
def calibrate(image, bias, fiber_mask=None, lacosmic=True):
image = bias_correct(image, bias, fiber_mask)
image = dark_correct(image)
image = mask_badp... | {
"repo_name": "richardseifert/Hydra_pipeline",
"path": "libs/calib.py",
"copies": "1",
"size": "4036",
"license": "mit",
"hash": -4062619794995599000,
"line_mean": 37.4380952381,
"line_max": 128,
"alpha_frac": 0.6888007929,
"autogenerated": false,
"ratio": 3.064540622627183,
"config_test": fals... |
from fitstools import manage_dtype, mask_fits, display, row_avg, col_avg
from astropy.io import fits
from scipy.optimize import minimize
import numpy as np
from math import floor, ceil
from scipy.optimize import curve_fit
#Helper function to get the number of fibers in a fits object using
# information from the fit... | {
"repo_name": "richardseifert/Hydra_pipeline",
"path": "libs/flat.py",
"copies": "1",
"size": "10742",
"license": "mit",
"hash": -4807425588715346000,
"line_mean": 36.2986111111,
"line_max": 112,
"alpha_frac": 0.6201824614,
"autogenerated": false,
"ratio": 3.0992498557414887,
"config_test": fal... |
from fit.types import Type, BinaryType
class Enum(Type):
type = 0
size = 1
format = "B"
variants = {}
_invalid = 0xff
def _load(self, data):
return self.variants.get(data, data)
def _save(self, value):
for key, other in self.variants.items():
if value == othe... | {
"repo_name": "rembish/fit",
"path": "fit/types/general.py",
"copies": "1",
"size": "1726",
"license": "bsd-3-clause",
"hash": 2815549211480723000,
"line_mean": 12.3798449612,
"line_max": 55,
"alpha_frac": 0.5411355736,
"autogenerated": false,
"ratio": 3.3065134099616857,
"config_test": false,
... |
from fit.types import Type
class Dynamic(Type):
def __init__(self, base, referred_to, **kwargs):
super(Dynamic, self).__init__(base.number)
self.base = base
self.referred = referred_to
self.variants = kwargs
def __repr__(self):
return '<%s of %r>' % (
self... | {
"repo_name": "rembish/fit",
"path": "fit/types/dynamic.py",
"copies": "1",
"size": "1084",
"license": "bsd-3-clause",
"hash": 2663086879089442000,
"line_mean": 25.4390243902,
"line_max": 69,
"alpha_frac": 0.573800738,
"autogenerated": false,
"ratio": 4.075187969924812,
"config_test": false,
... |
from fitz import *
import math
import warnings
warnings.simplefilter("once")
"""
The following is a collection of functions to extend PyMupdf.
"""
def showPDFpage(
page,
rect,
src,
pno=0,
overlay=True,
keep_proportion=True,
rotate=0,
reuse_xref=0,
... | {
"repo_name": "gennaios/alfred-gnosis",
"path": "src/fitz/utils.py",
"copies": "1",
"size": "97819",
"license": "mit",
"hash": -1881493511086294300,
"line_mean": 35.1890492046,
"line_max": 203,
"alpha_frac": 0.4782199777,
"autogenerated": false,
"ratio": 3.5289512608679967,
"config_test": false... |
from five import grok
from Acquisition import aq_inner
from zope.component import getMultiAdapter
from plone.app.layout.viewlets.interfaces import IAboveContent
from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.interfaces import IFolderish
from plone.app.layout.navigation.navtree import buildFol... | {
"repo_name": "potzenheimer/buildout.jms",
"path": "src/meetshaus.jmscontent/meetshaus/jmscontent/subnavigation.py",
"copies": "1",
"size": "2477",
"license": "mit",
"hash": 7386800462018207000,
"line_mean": 36.5303030303,
"line_max": 76,
"alpha_frac": 0.6128381106,
"autogenerated": false,
"ratio... |
from five import grok
from Acquisition import aq_inner
from zope.component import getMultiAdapter
from plone.directives import dexterity, form
from Products.CMFCore.utils import getToolByName
from meetshaus.jmscontent.contentpage import IContentPage
from meetshaus.jmscontent.banner import IBanner
from meetshaus.jmsc... | {
"repo_name": "potzenheimer/buildout.jms",
"path": "src/meetshaus.jmscontent/meetshaus/jmscontent/categoryfolder.py",
"copies": "1",
"size": "2369",
"license": "mit",
"hash": 5033551431678748000,
"line_mean": 32.3661971831,
"line_max": 78,
"alpha_frac": 0.617560152,
"autogenerated": false,
"ratio... |
from five import grok
from Acquisition import aq_inner
from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName
from plone.app.layout.navigation.interfaces import INavigationRoot
from plone.app.layout.viewlets.interfaces import IPortalHeader
from Products.CMFCore.interfaces import IFo... | {
"repo_name": "potzenheimer/buildout.jms",
"path": "src/meetshaus.jmscontent/meetshaus/jmscontent/bannerviewlet.py",
"copies": "1",
"size": "3989",
"license": "mit",
"hash": -2293016104008247600,
"line_mean": 35.5963302752,
"line_max": 68,
"alpha_frac": 0.5808473302,
"autogenerated": false,
"rati... |
from five import grok
from Acquisition import aq_inner
from zope.interface import Interface
from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName
from plone.app.layout.viewlets.interfaces import IPortalFooter
from plone.app.blob.interfaces import IATBlobImage
class GalleryBarV... | {
"repo_name": "potzenheimer/buildout.fd",
"path": "src/fd.sitecontent/fd/sitecontent/gallerybar.py",
"copies": "1",
"size": "2173",
"license": "mit",
"hash": -3818057679238060500,
"line_mean": 31.9242424242,
"line_max": 76,
"alpha_frac": 0.5752416015,
"autogenerated": false,
"ratio": 4.1390476190... |
from five import grok
from Acquisition import aq_inner
import transaction
from Products.CMFCore.interfaces import IContentish
from zope.component import getUtility
from plone.registry.interfaces import IRegistry
from plone.registry.record import Record
from plone.registry import field
class RegistryCleanup(grok.View... | {
"repo_name": "potzenheimer/meetshaus",
"path": "src/meetshaus.blog/meetshaus/blog/migration/registrycleanup.py",
"copies": "1",
"size": "1799",
"license": "mit",
"hash": -2363109403074518500,
"line_mean": 53.5151515152,
"line_max": 155,
"alpha_frac": 0.7654252362,
"autogenerated": false,
"ratio"... |
from five import grok
from htmlentitydefs import entitydefs
from plone.intelligenttext.transforms import \
convertHtmlToWebIntelligentPlainText
from tn.plonemailing import interfaces
import lxml.html
import re
links_with_href_re = re.compile(
r'(?m)<a([^<]+)href="([^<"]+)"([^<]*)>([^<]+)<\/a>',
re.IGNOREC... | {
"repo_name": "tecnologiaenegocios/tn.plonemailing",
"path": "src/tn/plonemailing/converter.py",
"copies": "1",
"size": "2960",
"license": "bsd-3-clause",
"hash": -285694762499224540,
"line_mean": 34.2380952381,
"line_max": 79,
"alpha_frac": 0.6050675676,
"autogenerated": false,
"ratio": 4.065934... |
from five import grok
from persistent.dict import PersistentDict
from plone.directives import form
from plone.formwidget.contenttree.source import ObjPathSourceBinder
from plone.memoize.instance import memoize
from plone.supermodel import model
from Products.CMFCore.interfaces import IDublinCore
from Products.CMFCore.u... | {
"repo_name": "tecnologiaenegocios/tn.plonemailing",
"path": "src/tn/plonemailing/behaviors.py",
"copies": "1",
"size": "8714",
"license": "bsd-3-clause",
"hash": 590044295810227800,
"line_mean": 32.5153846154,
"line_max": 79,
"alpha_frac": 0.6441358733,
"autogenerated": false,
"ratio": 4.2904972... |
from five import grok
from persistent.dict import PersistentDict
from plone.directives import form
from plone.supermodel import model
from tn.plonehtmlimagecache import _
from tn.plonehtmlimagecache import interfaces
from zope.annotation.interfaces import IAnnotations
from zope.annotation.interfaces import IAttributeAn... | {
"repo_name": "tecnologiaenegocios/tn.plonehtmlimagecache",
"path": "src/tn/plonehtmlimagecache/behaviors.py",
"copies": "1",
"size": "2693",
"license": "bsd-3-clause",
"hash": -8162388197946440000,
"line_mean": 30.3139534884,
"line_max": 78,
"alpha_frac": 0.6992202005,
"autogenerated": false,
"r... |
from five import grok
from persistent import Persistent
from persistent.dict import PersistentDict
from tn.plonehtmlimagecache.interfaces import IContextKeys
from zope.keyreference.interfaces import IKeyReference
class PersistentSet(Persistent):
"""Almost a set, but can be persisted.
The only behavior of a '... | {
"repo_name": "tecnologiaenegocios/tn.plonehtmlimagecache",
"path": "src/tn/plonehtmlimagecache/context_keys.py",
"copies": "1",
"size": "2023",
"license": "bsd-3-clause",
"hash": 9143732586821902000,
"line_mean": 26.7123287671,
"line_max": 70,
"alpha_frac": 0.6173999011,
"autogenerated": false,
... |
from five import grok
from plone.app.dexterity.behaviors import metadata
from plone.directives import form
from plone.supermodel import model
from Products.CMFCore.utils import getToolByName
from Products.statusmessages.interfaces import IStatusMessage
from tn.plonemailing import _
from tn.plonemailing import interface... | {
"repo_name": "tecnologiaenegocios/tn.plonemailing",
"path": "src/tn/plonemailing/subscriber.py",
"copies": "1",
"size": "7265",
"license": "bsd-3-clause",
"hash": -2541497088870142000,
"line_mean": 31.0044052863,
"line_max": 79,
"alpha_frac": 0.6699242946,
"autogenerated": false,
"ratio": 4.2115... |
from five import grok
from plone.batching import Batch
from plone.batching.browser import BatchView
from plone.memoize import instance
from Products.ATContentTypes.interfaces import IATFolder
from Products.CMFPlone.utils import pretty_title_or_id
from Products.CMFPlone.utils import safe_unicode
from Products.Five.brows... | {
"repo_name": "tecnologiaenegocios/tn.plonemailing",
"path": "src/tn/plonemailing/newsletterlisting.py",
"copies": "1",
"size": "4764",
"license": "bsd-3-clause",
"hash": -648401185611640200,
"line_mean": 35.9302325581,
"line_max": 77,
"alpha_frac": 0.6070528967,
"autogenerated": false,
"ratio": ... |
from five import grok
from plone.directives import dexterity, form
from zope import schema
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.app.textfield import RichText
try:
from plone.app.discussion.interfaces import IConversation
USE_PAD = True
except ImportError:
USE_PAD = False... | {
"repo_name": "potzenheimer/buildout.bh",
"path": "src/bh.blog/bh/blog/blogentry.py",
"copies": "1",
"size": "1423",
"license": "mit",
"hash": -1225566555747568600,
"line_mean": 26.3653846154,
"line_max": 74,
"alpha_frac": 0.6697118763,
"autogenerated": false,
"ratio": 3.9201101928374658,
"conf... |
from five import grok
from plone.directives import dexterity, form
from zope import schema
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.namedfile.field import NamedBlobImage
from plone.app.textfield import RichText
from meetshaus.jmscontent import MessageFactory as _
class IContentPage(... | {
"repo_name": "potzenheimer/buildout.jms",
"path": "src/meetshaus.jmscontent/meetshaus/jmscontent/contentpage.py",
"copies": "1",
"size": "1470",
"license": "mit",
"hash": 8160119196183314000,
"line_mean": 29,
"line_max": 78,
"alpha_frac": 0.6551020408,
"autogenerated": false,
"ratio": 4.07202216... |
from five import grok
from plone.directives import dexterity, form
from zope import schema
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.interface import invariant, Invalid
from z3c.form import group, field
from plone.namedfile.inte... | {
"repo_name": "potzenheimer/buildout.jms",
"path": "src/meetshaus.jmscontent/meetshaus/jmscontent/banner.py",
"copies": "1",
"size": "2193",
"license": "mit",
"hash": 1385841033429592600,
"line_mean": 30.3285714286,
"line_max": 77,
"alpha_frac": 0.6844505244,
"autogenerated": false,
"ratio": 3.88... |
from five import grok
from plone.directives import dexterity, form
from zope import schema
from zope.schema.interfaces import IContextSourceBinder
from plone.app.textfield import RichText
from plone.namedfile.field import NamedFile
from plone.formwidget.multifile import MultiFileFieldWidget
from cnc.content import ... | {
"repo_name": "l34marr/cnc.content",
"path": "cnc/content/testimony.py",
"copies": "1",
"size": "2195",
"license": "mit",
"hash": 6437759533088829000,
"line_mean": 26.7848101266,
"line_max": 74,
"alpha_frac": 0.7079726651,
"autogenerated": false,
"ratio": 3.8780918727915195,
"config_test": true... |
from five import grok
from plone import api
from plone.dexterity.content import Container
from plone.directives import form
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.app.contentlisting.interfaces import IContentListing
from wigo.statusapp.incident import IIncident
from wigo.statusapp ... | {
"repo_name": "ade25/wigo",
"path": "src/wigo.statusapp/wigo/statusapp/incidentmanager.py",
"copies": "1",
"size": "1086",
"license": "mit",
"hash": 6996027923471876000,
"line_mean": 25.487804878,
"line_max": 65,
"alpha_frac": 0.726519337,
"autogenerated": false,
"ratio": 3.797202797202797,
"co... |
from five import grok
from plone.namedfile import NamedBlobImage
from plone.namedfile.interfaces import INamedBlobImage
from plone.namedfile.utils import safe_basename, set_headers, stream_data
from tn.plonehtmlimagecache import interfaces
from zope.component.hooks import getSite
from zope.container.interfaces import I... | {
"repo_name": "tecnologiaenegocios/tn.plonehtmlimagecache",
"path": "src/tn/plonehtmlimagecache/html_image_cacher.py",
"copies": "1",
"size": "5183",
"license": "bsd-3-clause",
"hash": -7821224423020785000,
"line_mean": 33.5533333333,
"line_max": 77,
"alpha_frac": 0.6565695543,
"autogenerated": fal... |
from five import grok
from Products.CMFCore.utils import getToolByName
from plone.directives import form
from plone.supermodel import model
from tn.ploneformwidget.sourcecode import SourceCodeFieldWidget
from tn.plonehtmlpage import _
from z3c.form import widget
import zope.interface
import zope.schema
class IHTMLPa... | {
"repo_name": "tecnologiaenegocios/tn.plonehtmlpage",
"path": "src/tn/plonehtmlpage/html_page.py",
"copies": "1",
"size": "1358",
"license": "bsd-3-clause",
"hash": 2517490678936009700,
"line_mean": 26.16,
"line_max": 76,
"alpha_frac": 0.6796759941,
"autogenerated": false,
"ratio": 3.554973821989... |
from five import grok
from Products.MailHost.interfaces import IMailHost
from tn.plonemailing.behaviors import INewsletterFromContent
from tn.plonemailing import interfaces
from zope.event import notify
try:
from zope.component.hooks import getSite
getSite # pyflakes / flake8
except ImportError:
from zope... | {
"repo_name": "tecnologiaenegocios/tn.plonemailing",
"path": "src/tn/plonemailing/mailing.py",
"copies": "1",
"size": "1676",
"license": "bsd-3-clause",
"hash": -8182770496785506000,
"line_mean": 30.6226415094,
"line_max": 76,
"alpha_frac": 0.6897374702,
"autogenerated": false,
"ratio": 4.1795511... |
from five import grok
from tn.plonehtmlimagecache import interfaces
from zope.container.folder import Folder
from zope.publisher.interfaces import IRequest
from zope.publisher.interfaces import IPublishTraverse
from zope.publisher.interfaces import NotFound
import base64
import re
import zope.interface
import zope.com... | {
"repo_name": "tecnologiaenegocios/tn.plonehtmlimagecache",
"path": "src/tn/plonehtmlimagecache/caching.py",
"copies": "1",
"size": "2664",
"license": "bsd-3-clause",
"hash": 4689977784327624000,
"line_mean": 28.6,
"line_max": 78,
"alpha_frac": 0.6535285285,
"autogenerated": false,
"ratio": 3.855... |
from five import grok
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.schema.interfaces import IVocabularyFactory
from wigo.statusapp import MessageFactory as _
class IncidentTypeVocabulary(object):
grok.implements(IVocabularyFactory)
def __call__(self, context):
TYPES = {
... | {
"repo_name": "ade25/wigo",
"path": "src/wigo.statusapp/wigo/statusapp/vocabulary.py",
"copies": "1",
"size": "1325",
"license": "mit",
"hash": 5090148608015787000,
"line_mean": 32.9743589744,
"line_max": 72,
"alpha_frac": 0.6166037736,
"autogenerated": false,
"ratio": 4.039634146341464,
"confi... |
from five import grok
from z3c.form import group, field
from zope import schema
from zope.interface import invariant, Invalid
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from Acquisition import aq_inner
from Products.CMFCore.utils import getTo... | {
"repo_name": "FlintHillsFrontiers/fhf.toolbox",
"path": "fhf/toolbox/drawer.py",
"copies": "1",
"size": "3717",
"license": "mit",
"hash": 7857477555706240000,
"line_mean": 31.0431034483,
"line_max": 78,
"alpha_frac": 0.6914178101,
"autogenerated": false,
"ratio": 3.9375,
"config_test": false,
... |
from five import grok
from zope import schema
from plone.dexterity.content import Container
from plone.directives import form
from plone.app.textfield import RichText
from plone.namedfile.interfaces import IImageScaleTraversable
from wigo.crmtool import MessageFactory as _
class ICustomer(form.Schema, IImageScale... | {
"repo_name": "ade25/wigo",
"path": "src/wigo.crmtool/wigo/crmtool/customer.py",
"copies": "1",
"size": "1896",
"license": "mit",
"hash": -6210027067869833000,
"line_mean": 22.7,
"line_max": 72,
"alpha_frac": 0.6107594937,
"autogenerated": false,
"ratio": 3.9012345679012346,
"config_test": fals... |
from five import grok
import z3c.form
from zope import schema
from zope.interface import invariant, Invalid
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from Products.CMFCore.utils import getToolByName
from plone.directives import dexterity,... | {
"repo_name": "a25kk/vfu",
"path": "src/vfu.events/vfu/events/registration.py",
"copies": "1",
"size": "3339",
"license": "mit",
"hash": -7328235351363650000,
"line_mean": 33.4226804124,
"line_max": 129,
"alpha_frac": 0.6786463013,
"autogenerated": false,
"ratio": 3.71,
"config_test": false,
... |
from five import grok
from zope import schema
from plone.directives import form, dexterity
from plone.app.textfield import RichText
from plone.namedfile.field import NamedImage
from men.companies import _
class ICompany(form.Schema):
"""A company type include informations about the company
"""
... | {
"repo_name": "DebVortex/men.companies",
"path": "men/companies/content/company.py",
"copies": "1",
"size": "1781",
"license": "bsd-3-clause",
"hash": 4493360659842244000,
"line_mean": 23.8115942029,
"line_max": 60,
"alpha_frac": 0.4705221786,
"autogenerated": false,
"ratio": 4.724137931034483,
... |
from fixfmt import String
#-------------------------------------------------------------------------------
def test_basic():
fmt = String(8)
assert fmt("hello") == "hello "
assert fmt("Hello, world!") == u"Hello, …"
def test_stringify():
fmt = String(8)
assert fmt(None) =... | {
"repo_name": "alexhsamuel/fixfmt",
"path": "python/fixfmt/test/test_string.py",
"copies": "1",
"size": "1657",
"license": "apache-2.0",
"hash": 8992331700487745000,
"line_mean": 25.868852459,
"line_max": 80,
"alpha_frac": 0.4691885296,
"autogenerated": false,
"ratio": 3.3313008130081303,
"conf... |
from fixing import *
from observable import *
from generate_flows import *
from generate_observables import *
class swap_rate(observable):
def __init__(self
, attributes
, flow_id
, reset_id
, reset_date
, reset_ccy
, proj_start_date
... | {
"repo_name": "iamaris/ppf",
"path": "ppf/core/swap_rate.py",
"copies": "1",
"size": "5038",
"license": "mit",
"hash": -1471713686348399600,
"line_mean": 37.7538461538,
"line_max": 76,
"alpha_frac": 0.5526002382,
"autogenerated": false,
"ratio": 3.8080120937263793,
"config_test": false,
"has_... |
from fix_parser import *
from fix_fields import *
p = FixParser(b"fix.4.4.xml", PARSER_FLAG_CHECK_ALL)
print("PROT VERSION = {0}".format(p.getProtocolVer()))
# create Exec Report
m = p.createMsg("8")
# check its params
print("MSG TYPE = {0}".format(m.getType()))
print("MSG NAME = {0}".format(m.getName()))
# fill mess... | {
"repo_name": "dmitryme/fix_parser",
"path": "bind/python/example.py",
"copies": "1",
"size": "2019",
"license": "bsd-3-clause",
"hash": 4527175135153953300,
"line_mean": 41.0625,
"line_max": 98,
"alpha_frac": 0.7686973749,
"autogenerated": false,
"ratio": 2.615284974093264,
"config_test": fals... |
from fixture.actions import ActionsHelper
from model.contact import Contact
import contextlib
import time
import re
# from selenium.webdriver import Remote
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support.expected_conditions import staleness_of
class ContactHelper(ActionsH... | {
"repo_name": "alenickwork/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "11918",
"license": "apache-2.0",
"hash": -118880473931857840,
"line_mean": 40.3854166667,
"line_max": 106,
"alpha_frac": 0.602869609,
"autogenerated": false,
"ratio": 3.5886781090033124,
"config_t... |
from fixture.actions import ActionsHelper
from model.group import Group
class GroupHelper(ActionsHelper):
def __init__(self,app):
super(GroupHelper,self).__init__(app)
self.app = app
def create(self, group_data):
print("Create new group")
self.open_groups_page()
self._... | {
"repo_name": "alenickwork/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "4801",
"license": "apache-2.0",
"hash": 2733976222561074000,
"line_mean": 30.7947019868,
"line_max": 97,
"alpha_frac": 0.58612789,
"autogenerated": false,
"ratio": 3.519794721407625,
"config_test": ... |
from fixture.application import Application
from fixture.db import DbFixture
import json
import pytest
import os.path
import jsonpickle
import importlib
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fil... | {
"repo_name": "Mopckou/week_one",
"path": "conftest.py",
"copies": "1",
"size": "2410",
"license": "apache-2.0",
"hash": -4996254997262356000,
"line_mean": 33.4428571429,
"line_max": 129,
"alpha_frac": 0.6821576763,
"autogenerated": false,
"ratio": 3.673780487804878,
"config_test": true,
"has... |
from fixture.application import Application
import json
import os.path
import importlib
from fixture.db import DbFixture
from model.group import Group
class AddressBook:
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self, config='target.json', browser='chrome'):
self.browser = browser
confi... | {
"repo_name": "virtus80/python_training",
"path": "rf/AddressBook.py",
"copies": "1",
"size": "1549",
"license": "apache-2.0",
"hash": -5227214024410398000,
"line_mean": 35.0465116279,
"line_max": 107,
"alpha_frac": 0.655261459,
"autogenerated": false,
"ratio": 3.619158878504673,
"config_test":... |
from fixture.application import Application
import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.db import DbFixture
from fixture.orm import ORMFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(o... | {
"repo_name": "OlgaLa/task_1",
"path": "conftest.py",
"copies": "1",
"size": "2735",
"license": "apache-2.0",
"hash": -860723494652371600,
"line_mean": 29.7303370787,
"line_max": 131,
"alpha_frac": 0.6848263254,
"autogenerated": false,
"ratio": 3.656417112299465,
"config_test": true,
"has_no_... |
from fixture.changes import ChangeFields
class ContactHelper(ChangeFields):
def __init__(self, app):
self.app = app
def create_new(self, contact):
wd = self.app.wd
# create new contact
wd.find_element_by_link_text("nowy wpis").click()
self.fill_contact_form(contact)
... | {
"repo_name": "Lucas1985/kurs_pythona",
"path": "fixture/contact.py",
"copies": "1",
"size": "1667",
"license": "apache-2.0",
"hash": -9215279609065831000,
"line_mean": 29.8518518519,
"line_max": 92,
"alpha_frac": 0.6038415366,
"autogenerated": false,
"ratio": 3.5446808510638297,
"config_test":... |
from fixture.contact import ContactHelper
from fixture.group import GroupHelper
from selenium import webdriver
from fixture.session import SessionHelper
class Application:
# def __init__(self, browser):
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = w... | {
"repo_name": "osen000/python_task",
"path": "fixture/application.py",
"copies": "1",
"size": "1062",
"license": "apache-2.0",
"hash": 6000471639826007000,
"line_mean": 26.7567567568,
"line_max": 65,
"alpha_frac": 0.5649717514,
"autogenerated": false,
"ratio": 4.231075697211155,
"config_test": ... |
from fixture.creator import CreatorHelper
from model.contact import Contact
from random import randrange
class ContactHelper(CreatorHelper):
def __init__(self, app):
self.app = app
def create_contact(self, contact):
wd = self.app.wd
# Go to contact creator
wd.find_element_by_l... | {
"repo_name": "Lucas1985/kurs_pythona_new",
"path": "fixture/contact.py",
"copies": "1",
"size": "3113",
"license": "apache-2.0",
"hash": -3420390051825371000,
"line_mean": 35.6117647059,
"line_max": 115,
"alpha_frac": 0.5957583548,
"autogenerated": false,
"ratio": 3.5124153498871333,
"config_t... |
from fixture.creator import CreatorHelper
from model.group import Group
class GroupHelper(CreatorHelper):
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):
... | {
"repo_name": "Lucas1985/kurs_pythona_new",
"path": "fixture/group.py",
"copies": "1",
"size": "2879",
"license": "apache-2.0",
"hash": 4578494095843360000,
"line_mean": 30.9888888889,
"line_max": 100,
"alpha_frac": 0.5956929489,
"autogenerated": false,
"ratio": 3.502433090024331,
"config_test"... |
from fixture.db import DbFixture
from fixture.orm import ORMFixture
from model.group import Group
db = DbFixture(host="127.0.0.1", name="addressbook", user="root", password="")
db_orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
print('\n******DB ORMFixture:******\n')
try:
groups =... | {
"repo_name": "natgry/python_training",
"path": "check_db_connection.py",
"copies": "1",
"size": "1468",
"license": "apache-2.0",
"hash": -4669576092009283000,
"line_mean": 23.4833333333,
"line_max": 83,
"alpha_frac": 0.5892370572,
"autogenerated": false,
"ratio": 3.291479820627803,
"config_tes... |
from fixture_generator import fixture_generator
from speakers.models import Speaker
from proposals.models import Proposal
@fixture_generator(Proposal, requires=["speakers.speakers"])
def proposals():
guido, matz, larry = Speaker.objects.order_by("id")
Proposal.objects.create(
title = "Django on AppE... | {
"repo_name": "mitsuhiko/pycon",
"path": "pycon_project/apps/proposals/fixture_gen.py",
"copies": "1",
"size": "1344",
"license": "bsd-3-clause",
"hash": -1889446509541004000,
"line_mean": 36.3333333333,
"line_max": 77,
"alpha_frac": 0.6904761905,
"autogenerated": false,
"ratio": 3.52755905511811... |
from fixture_generator import fixture_generator
from sponsors.models import SponsorLevel, Sponsor
SPONSORSHIP_LEVELS = [
("Diamond", 10000),
("Platinum", 5000),
("Gold", 2000),
("Silver", 1000),
("Patron", 500),
("Vendor I", 100),
("Media", 0),
]
SPONSORS = {
"Diamond": [
("G... | {
"repo_name": "mitsuhiko/pycon",
"path": "pycon_project/apps/sponsors/fixture_gen.py",
"copies": "1",
"size": "2530",
"license": "bsd-3-clause",
"hash": -1108188752650380900,
"line_mean": 32.2894736842,
"line_max": 83,
"alpha_frac": 0.5387351779,
"autogenerated": false,
"ratio": 3.066666666666667... |
from fixture_generator import fixture_generator
from symposion.speakers.models import Speaker
from symposion.proposals.models import Proposal
@fixture_generator(Proposal, requires=["speakers.speakers"])
def proposals():
guido, matz, larry = Speaker.objects.order_by("id")
Proposal.objects.create(
... | {
"repo_name": "mzdaniel/symposion",
"path": "symposion_project/apps/symposion/proposals/fixture_gen.py",
"copies": "5",
"size": "1376",
"license": "mit",
"hash": 623873836443125400,
"line_mean": 37.2222222222,
"line_max": 77,
"alpha_frac": 0.6875,
"autogenerated": false,
"ratio": 3.54639175257731... |
from fixture_generator import fixture_generator
from symposion.sponsors_pro.models import SponsorLevel, Sponsor
SPONSORSHIP_LEVELS = [
("Diamond", 10000),
("Platinum", 5000),
("Gold", 2000),
("Silver", 1000),
("Patron", 500),
("Vendor I", 100),
("Media", 0),
]
SPONSORS = {
"Diamond":... | {
"repo_name": "mzdaniel/pycon",
"path": "pycon_project/apps/symposion/sponsors_pro/fixture_gen.py",
"copies": "5",
"size": "2544",
"license": "bsd-3-clause",
"hash": 1015735577047583600,
"line_mean": 32.4736842105,
"line_max": 83,
"alpha_frac": 0.5404874214,
"autogenerated": false,
"ratio": 3.061... |
from .fixture import AppTestCase
class TestPlayer(AppTestCase):
maxDiff = None
ORDER = 3
steam_ids = [
"76561198043212328", # shire
"76561198257384619", # HanzoHasashiSan
"76561197985202252", # carecry
"76561198308265738", # lookaround
"76561198257327401", # J... | {
"repo_name": "em92/pickup-rating",
"path": "tests/test_player.py",
"copies": "1",
"size": "1653",
"license": "mit",
"hash": 4268466390703897000,
"line_mean": 34.170212766,
"line_max": 80,
"alpha_frac": 0.5825771325,
"autogenerated": false,
"ratio": 3.3803680981595092,
"config_test": false,
"... |
from .fixture import AppTestCase
class TestSteamApi(AppTestCase):
ORDER = 5
steam_ids = [
"76561198043212328", # shire
"76561198257384619", # HanzoHasashiSan
"76561197985202252", # carecry
"76561198308265738", # lookaround
"76561198257327401", # Jalepeno
... | {
"repo_name": "em92/pickup-rating",
"path": "tests/test_steam_api.py",
"copies": "1",
"size": "1073",
"license": "mit",
"hash": 2449732288292261000,
"line_mean": 29.6571428571,
"line_max": 79,
"alpha_frac": 0.5759552656,
"autogenerated": false,
"ratio": 3.0482954545454546,
"config_test": false,... |
from fixture import DataSet
from fixture import SQLAlchemyFixture
from database import db
from database import db_models
class RepData(DataSet):
class nancy_pelosi(object):
rep_id = 134
first_name = 'Nancy'
last_name = 'Pelosi'
state_code = 'CA'
dis... | {
"repo_name": "jlgoldman/writetogov",
"path": "testing/test_data.py",
"copies": "1",
"size": "8806",
"license": "bsd-3-clause",
"hash": -2296962379507897900,
"line_mean": 38.6666666667,
"line_max": 153,
"alpha_frac": 0.510901658,
"autogenerated": false,
"ratio": 3.3778289221327196,
"config_test... |
from fixture import DataSet
class ValidNoRelationsData(DataSet):
class Meta:
django_model = 'app.NoRelations'
class one:
char = "one"
num = 1
class two:
char = "two"
num = 2
class InvalidNoRelationsData(DataSet):
class Meta:
django_model = 'app.NoRela... | {
"repo_name": "winhamwr/django-xls-fixtures",
"path": "xls_fixtures/test/project/app/fixtures.py",
"copies": "1",
"size": "1106",
"license": "bsd-3-clause",
"hash": -911047802765234300,
"line_mean": 17.131147541,
"line_max": 51,
"alpha_frac": 0.5650994575,
"autogenerated": false,
"ratio": 3.57928... |
from fixture import DjangoFixture
from fixture.style import NamedDataStyle
def get_datasets(app, package='.datasets', sufix='Data'):
"""
Get list of dataset classes ending with ``sufix`` from ``package``
submodule on ``app``.
It's expected to raise any error out loud.
"""
fixtures = []
m... | {
"repo_name": "henriquebastos/django-fixturapp",
"path": "src/fixturapp/management/commands/__init__.py",
"copies": "1",
"size": "1510",
"license": "bsd-3-clause",
"hash": -5190736728017113000,
"line_mean": 25.4912280702,
"line_max": 76,
"alpha_frac": 0.619205298,
"autogenerated": false,
"ratio":... |
from fixture import GeneratorTest
from google.appengine.ext import ndb
from gaend.models import GaendFullModel
from gaend.queue import ON_PUT, ON_DELETE
import gaend.js as gjs
class TaskQueueTest(GeneratorTest):
def puter(self):
kind = GaendFullModel.__name__
return self.testapp.post(
... | {
"repo_name": "samedhi/gaend",
"path": "tests/queue_test.py",
"copies": "1",
"size": "1590",
"license": "mit",
"hash": 9066758429684676000,
"line_mean": 33.5652173913,
"line_max": 69,
"alpha_frac": 0.613836478,
"autogenerated": false,
"ratio": 3.4716157205240177,
"config_test": true,
"has_no_... |
from fixture import GeneratorTest
from google.appengine.ext import testbed, ndb
import gaend.generator as generator
import gaend.props as gprops
import gaend.js as gjs
import re
class PropsTest(GeneratorTest):
def testEndpoints(self):
for klass in self.klasses:
kind = klass._get_kind()
... | {
"repo_name": "samedhi/gaend",
"path": "tests/routes_test.py",
"copies": "1",
"size": "2257",
"license": "mit",
"hash": 8910984316366878000,
"line_mean": 38.5964912281,
"line_max": 73,
"alpha_frac": 0.5281346921,
"autogenerated": false,
"ratio": 3.831918505942275,
"config_test": true,
"has_no... |
from fixture import GeneratorTest
from google.appengine.ext import testbed, ndb
import gaend.generator as generator
import gaend.props as gprops
import re
class PropsTest(GeneratorTest):
def testEntityToPropsAndBack(self):
for klass in self.klasses:
# Create entity1 of this klass
... | {
"repo_name": "samedhi/gaend",
"path": "tests/props_test.py",
"copies": "2",
"size": "1779",
"license": "mit",
"hash": 8868714830410272000,
"line_mean": 39.4318181818,
"line_max": 73,
"alpha_frac": 0.5267003935,
"autogenerated": false,
"ratio": 4.286746987951807,
"config_test": false,
"has_no... |
from fixture.orm import ORMFixture
from model.contact import Contact
from model.group import Group
import random
def test_del_contact_from_group(app):
db = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
if len(app.contact.get_contact_list()) == 0:
app.contact.create(Contact... | {
"repo_name": "SherMary/python_training",
"path": "test/test_del_contact_from_group.py",
"copies": "1",
"size": "1967",
"license": "apache-2.0",
"hash": 7181894520316393000,
"line_mean": 47,
"line_max": 126,
"alpha_frac": 0.6919166243,
"autogenerated": false,
"ratio": 3.092767295597484,
"config... |
from fixture.orm import ORMFixture
from model.contact import Contact
import re
def test_compare_info_from_homepage_and_db(app):
orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
contact_from_home_page = sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
contact_f... | {
"repo_name": "Lana-Pa/Python-training",
"path": "test/test_check_all_contact_info_with_db.py",
"copies": "1",
"size": "1598",
"license": "apache-2.0",
"hash": 4719145334060123000,
"line_mean": 47.4242424242,
"line_max": 122,
"alpha_frac": 0.6239048811,
"autogenerated": false,
"ratio": 3.55111111... |
from fixture.orm import ORMfixture
from model.group import Group
from model.contact import Contact
import random
db = ORMfixture(host='127.0.0.1', name='addressbook', user='root', password='')
def test_delete_contact_from_group(app):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact... | {
"repo_name": "schukinp/python_training",
"path": "test/test_delete_contact_from_group.py",
"copies": "1",
"size": "1345",
"license": "apache-2.0",
"hash": 8951654513575173000,
"line_mean": 45.3793103448,
"line_max": 130,
"alpha_frac": 0.6594795539,
"autogenerated": false,
"ratio": 3.312807881773... |
from fixture.orm import ORMFixture
from model.group import Group
from model.contacts import Contacts
import pytest
import random
db = ORMFixture(host='127.0.0.1', name='addressbook', user='root', password='')
def test_add_contact_to_group(app):
if len(db.get_contacts_list()) == 0:
app.contacts.create(Con... | {
"repo_name": "PaulRumyantsev/python_QA",
"path": "test/test_add_contact_to_group.py",
"copies": "1",
"size": "1126",
"license": "apache-2.0",
"hash": -600787457265201700,
"line_mean": 33.1212121212,
"line_max": 121,
"alpha_frac": 0.6944937833,
"autogenerated": false,
"ratio": 3.162921348314607,
... |
from fixture.orm import ORMFixture
from model.group import Group
from model.contacts import Contacts
import random
db = ORMFixture(host='127.0.0.1', name='addressbook', user='root', password='')
def test_delete_contact_from_group(app):
if len(db.get_contacts_list()) == 0:
app.contacts.create(Contacts(fi... | {
"repo_name": "PaulRumyantsev/python_QA",
"path": "test/test_del_contact_from_group.py",
"copies": "1",
"size": "1342",
"license": "apache-2.0",
"hash": -1022917702264803500,
"line_mean": 43.7666666667,
"line_max": 104,
"alpha_frac": 0.6594634873,
"autogenerated": false,
"ratio": 3.355,
"config... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.