text stringlengths 0 1.05M | meta dict |
|---|---|
from .fields import ListField, SetField, DictField, EmbeddedModelField
from django.db import models, connections
from django.db.models import Q
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch.dispatcher import receiver
from django.test import TestCase
... | {
"repo_name": "cuongthai/cuongthai-s-blog",
"path": "djangotoolbox/tests.py",
"copies": "1",
"size": "15058",
"license": "bsd-3-clause",
"hash": -250337618351712640,
"line_mean": 42.0292397661,
"line_max": 93,
"alpha_frac": 0.5908487183,
"autogenerated": false,
"ratio": 3.8266836086404066,
"con... |
from .fields import ListField, SetField, DictField, EmbeddedModelField
from django.db import models, connections
from django.db.models import Q
from django.db.utils import DatabaseError
from django.test import TestCase
from django.utils import unittest
class ListModel(models.Model):
floating_point = models... | {
"repo_name": "pwhelan/djshouts",
"path": "djangotoolbox/tests.py",
"copies": "10",
"size": "11089",
"license": "bsd-3-clause",
"hash": 2444673808876023300,
"line_mean": 42.003968254,
"line_max": 89,
"alpha_frac": 0.5841825232,
"autogenerated": false,
"ratio": 3.7898154477101844,
"config_test":... |
from .fields import MultiFileField
class NoQuerySetException(Exception):
pass
class NoStorageException(Exception):
pass
class FormNotValidException(Exception):
pass
class MultiFileFieldMixin():
def process_files(self):
""" Process files for each field that is a multifilefield.
... | {
"repo_name": "invisiblehands/django-multifilefield",
"path": "multifilefield/mixins.py",
"copies": "1",
"size": "1604",
"license": "mit",
"hash": -5404264458054751000,
"line_mean": 23.303030303,
"line_max": 81,
"alpha_frac": 0.6003740648,
"autogenerated": false,
"ratio": 4.467966573816156,
"co... |
from .fields import *
from .proxy import DBProxy
from tornado import gen
__all__ = [
'Record'
]
class MetaRecord(type):
"""
MetaRecord
"""
def __new__(mcs, name, bases, attrs):
klass = type.__new__(mcs, name, bases, attrs)
fields = []
for base in klass.__mro__:
... | {
"repo_name": "veeloox/ramen",
"path": "ramen/db/record.py",
"copies": "1",
"size": "4878",
"license": "apache-2.0",
"hash": 5011529717866638000,
"line_mean": 23.1485148515,
"line_max": 114,
"alpha_frac": 0.5237802378,
"autogenerated": false,
"ratio": 3.9658536585365853,
"config_test": false,
... |
from fields import *
class Sampler(object):
def __init__(self, **kwargs):
self.__seed = False
self.__count = (0, 0)
for k, v in kwargs.iteritems():
if not isinstance(v, Field) and not isinstance(v, Sampler):
# v = Field(v)
getattr(self, k).value... | {
"repo_name": "hyperborea/python-sampler",
"path": "sampler/sampler.py",
"copies": "1",
"size": "1490",
"license": "mit",
"hash": 791407703471373800,
"line_mean": 28.2156862745,
"line_max": 83,
"alpha_frac": 0.5268456376,
"autogenerated": false,
"ratio": 4.082191780821918,
"config_test": false,... |
from .fields import ObjectReferenceTypeField
class ObjectReference(object):
def compute_type(self, force=None):
if not self.type or force:
type_set = False
if self.to_workspace:
if type_set:
raise RuntimeError('Role can reference only one objec... | {
"repo_name": "dz0ny/vaultier",
"path": "vaultier/vaultier/business/reference.py",
"copies": "3",
"size": "1881",
"license": "bsd-3-clause",
"hash": -7384920810430889000,
"line_mean": 29.8360655738,
"line_max": 76,
"alpha_frac": 0.5571504519,
"autogenerated": false,
"ratio": 4.6330049261083746,
... |
from fields import VideoFileField, AudioFileField, DurationField
from processing import get_video_specs
from widgets import ReadOnlyWidget
import signals
import re
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from flv_reader import FLVReader
impo... | {
"repo_name": "soad241/django-audio-video",
"path": "audio_video/models.py",
"copies": "1",
"size": "8134",
"license": "bsd-3-clause",
"hash": 4553015235770104300,
"line_mean": 37.1877934272,
"line_max": 122,
"alpha_frac": 0.5973690681,
"autogenerated": false,
"ratio": 3.884431709646609,
"confi... |
from fields import VideoFileField, AudioFileField, DurationField
from processing import get_video_specs
from widgets import ReadOnlyWidget
import signals
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from flv_reader import FLVReader
import dateti... | {
"repo_name": "itavor/django-audio-video",
"path": "audio_video/models.py",
"copies": "1",
"size": "6416",
"license": "bsd-3-clause",
"hash": -7399911014231348000,
"line_mean": 37.6506024096,
"line_max": 113,
"alpha_frac": 0.6176745636,
"autogenerated": false,
"ratio": 3.9121951219512194,
"conf... |
from ..fields.title_field import TitleField
from ..fields.series_field import SeriesField
from ..fields.series.map_series import MapSeries
from ..fields.series.bubble_map_series import BubbleMapSeries
from highmap import HighMap
class BubbleMap(HighMap):
def __init__(self, title, data, country_code='ch'):
... | {
"repo_name": "jpmfribeiro/PyCharts",
"path": "pycharts/charts/bubble_map.py",
"copies": "2",
"size": "1485",
"license": "mit",
"hash": 1645287983536266500,
"line_mean": 40.2777777778,
"line_max": 93,
"alpha_frac": 0.628956229,
"autogenerated": false,
"ratio": 3.375,
"config_test": false,
"ha... |
from fieldval import FVCheck, FieldVal
__author__ = 'stan'
class TypeFVCheck(FVCheck):
def check(self, value):
if value is None:
required = self.args.get('required', True)
if required:
return FieldVal.REQUIRED_ERROR
else:
return Fie... | {
"repo_name": "FieldVal/fieldval-python",
"path": "bval.py",
"copies": "1",
"size": "2517",
"license": "apache-2.0",
"hash": 7265561388826482000,
"line_mean": 25.4947368421,
"line_max": 98,
"alpha_frac": 0.6170043703,
"autogenerated": false,
"ratio": 4.033653846153846,
"config_test": false,
"... |
from fife import fife
from fife.extensions import pychan
from fife.extensions.pychan.internal import get_manager
class EventListenerBase(fife.IKeyListener, fife.ICommandListener, fife.IMouseListener, fife.ConsoleExecuter):
def __init__(self, engine, regKeys=False, regCmd=False, regMouse=False, regConsole=False, re... | {
"repo_name": "florinp/untitled_game",
"path": "scripts/common/eventListenerBase.py",
"copies": "1",
"size": "1664",
"license": "mit",
"hash": -177180830273449700,
"line_mean": 29.8148148148,
"line_max": 111,
"alpha_frac": 0.6268028846,
"autogenerated": false,
"ratio": 4,
"config_test": false,
... |
from fife import fife
from fife.extensions.serializers.simplexml import SimpleXMLSerializer
from scripts.quests.baseQuest import Quest, ReturnItemQuest, QuestTypes
from scripts.misc.serializer import Serializer
class QuestManager(Serializer):
def __init__(self, gameplay):
self._gameplay = gameplay
... | {
"repo_name": "florinp/untitled_game",
"path": "scripts/quests/questManager.py",
"copies": "1",
"size": "3841",
"license": "mit",
"hash": 1042397158494805600,
"line_mean": 35.5904761905,
"line_max": 103,
"alpha_frac": 0.5740692528,
"autogenerated": false,
"ratio": 4.038906414300736,
"config_tes... |
from fifo import FifoClient
fifo = FifoClient('redis://localhost:6379/0')
# queue up a single task
task_id = fifo.queue_task('example.tasks.multiply', (6, 7),
max_wait=2, result_timeout=30)
# wait for result for at most 5s
result = fifo.wait(task_id, timeout=5)
print(task_id, result['body']... | {
"repo_name": "hakanzy/fifo",
"path": "example/app.py",
"copies": "2",
"size": "1136",
"license": "bsd-2-clause",
"hash": -8359065266338481000,
"line_mean": 30.5555555556,
"line_max": 65,
"alpha_frac": 0.6399647887,
"autogenerated": false,
"ratio": 3.138121546961326,
"config_test": false,
"ha... |
"""From Fig. 1 of `bib.bocquet2010beyond`."""
import numpy as np
import dapper.mods as modelling
from dapper.mods.Lorenz96 import step
t = modelling.Chronology(0.05, dkObs=1, T=4**3, BurnIn=20)
Nx = 10
Dyn = {
'M': Nx,
'model': step,
'noise': 0,
}
X0 = modelling.GaussRV(M=Nx, C=0.001)
jj = np.arange(0... | {
"repo_name": "nansencenter/DAPPER",
"path": "dapper/mods/Lorenz96/bocquet2010.py",
"copies": "1",
"size": "2152",
"license": "mit",
"hash": -8837961423290873000,
"line_mean": 32.625,
"line_max": 61,
"alpha_frac": 0.5673791822,
"autogenerated": false,
"ratio": 2.145563310069791,
"config_test": ... |
from fig.cli.log_printer import LogPrinter
from fig.cli.socketclient import SocketClient
from fig.packages.docker import Client
import getpass
import json
from prettytable import PrettyTable
from fabric.api import run, env
import fabric
from fig.project import Project
from fabric.contrib.console import confirm
import o... | {
"repo_name": "pywizard/ficloud",
"path": "ficloud/deployment.py",
"copies": "1",
"size": "7939",
"license": "apache-2.0",
"hash": -8105657946098008000,
"line_mean": 29.6525096525,
"line_max": 112,
"alpha_frac": 0.5736238821,
"autogenerated": false,
"ratio": 4.029949238578681,
"config_test": tr... |
from figment import Component
from theworldfoundry.components.spatial import Spatial, unique_selection
from theworldfoundry.modes import ActionMode
class Emotive(Component):
"""Enables an entity to emote."""
def emote(action_name, actor, verb, plural=None, join=None, selector=None):
if not plural:
... | {
"repo_name": "vreon/figment",
"path": "examples/theworldfoundry/theworldfoundry/components/emotive.py",
"copies": "1",
"size": "5251",
"license": "mit",
"hash": -8144088694907799000,
"line_mean": 30.6325301205,
"line_max": 79,
"alpha_frac": 0.631879642,
"autogenerated": false,
"ratio": 3.1218787... |
from figurate import (
Heptagonal,
Hexagonal,
Octagonal,
Pentagonal,
Square,
Triangle,
)
def check(one, two):
return str(one)[-2:] == str(two)[:2]
def double_check(acc):
for i in range(len(acc)):
if not check(acc[i - 1], acc[i]):
return False
return True
def... | {
"repo_name": "mackorone/euler",
"path": "src/061.py",
"copies": "1",
"size": "1285",
"license": "mit",
"hash": 1629950553294288400,
"line_mean": 22.3636363636,
"line_max": 62,
"alpha_frac": 0.5206225681,
"autogenerated": false,
"ratio": 3.4823848238482387,
"config_test": false,
"has_no_keywo... |
from figure import Figure
from properties import *
class Collision:
def __init__(self, stage: Figure):
self.stage = stage
self.collision_column = 0
self.collision_row = 0
def check_x(self, figure: Figure, move_x):
self.collision_column = 0
if figure.x + move_x < 0:
... | {
"repo_name": "nojustiniano/Tetris",
"path": "collision.py",
"copies": "1",
"size": "1562",
"license": "apache-2.0",
"hash": -6172560860789628000,
"line_mean": 29.0384615385,
"line_max": 76,
"alpha_frac": 0.4641485275,
"autogenerated": false,
"ratio": 4.221621621621622,
"config_test": false,
... |
from figures3.base import Figure
class Circle(Figure):
def __init__(self, radius, **kwargs):
super().__init__(**kwargs)
self.radius = radius
def draw(self, turtle):
super().draw(turtle)
self.jump_to(turtle, self.center_x, self.center_y - self.radius)
turtle.circle(self... | {
"repo_name": "natla/softuni-python",
"path": "SoftUni-L8-OOP/Problem 2/figures/simple_figures.py",
"copies": "1",
"size": "2350",
"license": "mit",
"hash": -8267591177514258000,
"line_mean": 28.375,
"line_max": 72,
"alpha_frac": 0.5625531915,
"autogenerated": false,
"ratio": 3.582317073170732,
... |
from figures.base import Figure
class Circle(Figure):
def __init__(self, radius, **kwargs):
super().__init__(**kwargs)
self.radius = radius
def draw(self, turtle):
super().draw(turtle)
self.jump_to(turtle, self.center_x, self.center_y - self.radius)
turtle.circle(self... | {
"repo_name": "natla/softuni-python",
"path": "SoftUni-L8-OOP/Problem 1/figures/simple_figures.py",
"copies": "1",
"size": "2349",
"license": "mit",
"hash": -4795651161229196000,
"line_mean": 28.3625,
"line_max": 73,
"alpha_frac": 0.5623669647,
"autogenerated": false,
"ratio": 3.5862595419847327,... |
from fiji.plugin.trackmate import Model
from fiji.plugin.trackmate import Settings
from fiji.plugin.trackmate import TrackMate
from fiji.plugin.trackmate import SelectionModel
from fiji.plugin.trackmate import Logger
from fiji.plugin.trackmate.detection import LogDetectorFactory
from fiji.plugin.trackmate.trackin... | {
"repo_name": "AndrewHanSolo/CMP",
"path": "TrackMate Helpers/FIJI Scripts/TrackMateBatchScipt.py",
"copies": "1",
"size": "6359",
"license": "mit",
"hash": -3721676353665488400,
"line_mean": 44.0797101449,
"line_max": 113,
"alpha_frac": 0.7748073596,
"autogenerated": false,
"ratio": 3.4672846237... |
from file_assistant import *
from ast import *
from tokenizer import *
_self_closers = ["area", "base", "br", "col", "command", "doctype", "embed", "hr", "img", "input", "keygen", "meta", "param", "source", "track", "wbr"]
_tags_for_head = ["base", "comment", "css", "favicon", "fetch", "js", "javascript", "meta", "no... | {
"repo_name": "davidsteinberg/shots",
"path": "shots/parser.py",
"copies": "1",
"size": "34997",
"license": "mit",
"hash": -6739081921546852000,
"line_mean": 37.9288097887,
"line_max": 176,
"alpha_frac": 0.4789267652,
"autogenerated": false,
"ratio": 4.406017877376306,
"config_test": false,
"... |
from filebarn import db
from werkzeug.security import generate_password_hash, check_password_hash
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), index=True, unique=True)
password_hash = db.Column(db.String(128))
email ... | {
"repo_name": "popas90/filebarn",
"path": "filebarn/models.py",
"copies": "1",
"size": "1149",
"license": "mit",
"hash": -5890836088175878000,
"line_mean": 26.3571428571,
"line_max": 73,
"alpha_frac": 0.6422976501,
"autogenerated": false,
"ratio": 3.842809364548495,
"config_test": false,
"has... |
from filebeat import BaseTest
import gzip
import os
import time
import unittest
"""
Tests that Filebeat shuts down cleanly.
"""
class Test(BaseTest):
def test_shutdown(self):
"""
Test starting and stopping Filebeat under load.
"""
# Uncompress the nasa log file.
nasa_log ... | {
"repo_name": "phenomenes/varnishbeat",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_shutdown.py",
"copies": "1",
"size": "1095",
"license": "bsd-2-clause",
"hash": -2786359221967298600,
"line_mean": 27.0769230769,
"line_max": 76,
"alpha_frac": 0.5214611872,
"autogenerated": ... |
from filebeat import BaseTest
import gzip
import os
import time
import unittest
"""
Tests that Filebeat shuts down cleanly.
"""
class Test(BaseTest):
def test_shutdown(self):
"""
Test starting and stopping Filebeat under load.
"""
self.nasa_logs()
self.render_config_tem... | {
"repo_name": "taitan-org/inflog",
"path": "filebeat/tests/system/test_shutdown.py",
"copies": "1",
"size": "4976",
"license": "apache-2.0",
"hash": 1785423003959589400,
"line_mean": 27.9302325581,
"line_max": 105,
"alpha_frac": 0.5526527331,
"autogenerated": false,
"ratio": 3.9523431294678315,
... |
from filebeat import BaseTest
import os
import socket
"""
Tests for the custom fields functionality.
"""
class Test(BaseTest):
def test_custom_fields(self):
"""
Tests that custom fields show up in the output dict.
"""
self.render_config_template(
path=os.path.abspath(... | {
"repo_name": "yapdns/yapdns-client",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_fields.py",
"copies": "6",
"size": "2499",
"license": "mit",
"hash": 4191973657852844500,
"line_mean": 28.75,
"line_max": 68,
"alpha_frac": 0.5510204082,
"autogenerated": false,
"ratio": 3.81... |
from filebeat import BaseTest
import os
import time
import unittest
"""
Tests for the prospector functionality.
"""
class Test(BaseTest):
def test_ignore_older_files(self):
"""
Should ignore files there were not modified for longer then
the `ignore_older` setting.
"""
sel... | {
"repo_name": "yapdns/yapdns-client",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_prospector.py",
"copies": "2",
"size": "15486",
"license": "mit",
"hash": -404692566725724700,
"line_mean": 28.9535783366,
"line_max": 105,
"alpha_frac": 0.5357096733,
"autogenerated": false,
... |
from filebeat import BaseTest
import os
import time
from beat.beat import Proc
"""
Tests for the prospector functionality.
"""
class Test(BaseTest):
def test_ignore_older_files(self):
"""
Should ignore files there were not modified for longer then
the `ignore_older` setting.
"""... | {
"repo_name": "christiangalsterer/httpbeat",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_prospector.py",
"copies": "2",
"size": "18507",
"license": "apache-2.0",
"hash": -5956819232558774000,
"line_mean": 28.4228934817,
"line_max": 105,
"alpha_frac": 0.5427676014,
"autogener... |
from filebeat import BaseTest
import os
"""
Contains tests for filtering.
"""
class Test(BaseTest):
def test_dropfields(self):
"""
Check drop_fields filtering action
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/test.log",
drop... | {
"repo_name": "yapdns/yapdnsbeat",
"path": "tests/system/test_filtering.py",
"copies": "2",
"size": "2393",
"license": "mit",
"hash": -6695816848175650000,
"line_mean": 28.5432098765,
"line_max": 66,
"alpha_frac": 0.5315503552,
"autogenerated": false,
"ratio": 3.847266881028939,
"config_test": ... |
from filebeat import BaseTest
import os
"""
Tests for the JSON decoding functionality.
"""
class Test(BaseTest):
def test_docker_logs(self):
"""
Should be able to interpret docker logs.
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*",... | {
"repo_name": "yapdns/yapdns-client",
"path": "tests/system/test_json.py",
"copies": "2",
"size": "10659",
"license": "mit",
"hash": 3169641884173844000,
"line_mean": 31.6963190184,
"line_max": 78,
"alpha_frac": 0.5108359133,
"autogenerated": false,
"ratio": 4.1346004654771145,
"config_test": t... |
from filebeat import BaseTest
import os
"""
Tests for the JSON decoding functionality.
"""
class Test(BaseTest):
def test_docker_logs(self):
"""
Should be able to interpret docker logs.
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"... | {
"repo_name": "christiangalsterer/httpbeat",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_json.py",
"copies": "2",
"size": "12075",
"license": "apache-2.0",
"hash": 406674238376224900,
"line_mean": 31.6351351351,
"line_max": 93,
"alpha_frac": 0.507826087,
"autogenerated": fal... |
from filebeat import BaseTest
import os
"""
Tests for the multiline log messages
"""
class Test(BaseTest):
def test_java_elasticsearch_log(self):
"""
Test that multi lines for java logs works.
It checks that all lines which do not start with [ are append to the last line starting with [
... | {
"repo_name": "yapdns/yapdns-client",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_multiline.py",
"copies": "9",
"size": "6970",
"license": "mit",
"hash": -3143641585890836000,
"line_mean": 28.0416666667,
"line_max": 102,
"alpha_frac": 0.5341463415,
"autogenerated": false,
... |
from filebeat import BaseTest
import os
import platform
import time
import shutil
from nose.plugins.skip import Skip, SkipTest
# Additional tests: to be implemented
# * Check if registrar file can be configured, set config param
# * Check "updating" of registrar file
# * Check what happens when registrar file is del... | {
"repo_name": "yapdns/yapdnsbeat",
"path": "vendor/github.com/elastic/beats/filebeat/tests/system/test_registrar.py",
"copies": "4",
"size": "19681",
"license": "mit",
"hash": -6846538024820814000,
"line_mean": 31.6926910299,
"line_max": 114,
"alpha_frac": 0.5742086276,
"autogenerated": false,
"r... |
from filebrowser_safe.views import filebrowser_post_rename
from filebrowser_safe import settings as filebrowser_settings
from cStringIO import StringIO
import os
from string import punctuation
from urllib import unquote
from zipfile import ZipFile
from django.core.files.base import ContentFile
from django.core.files.... | {
"repo_name": "gbosh/mezzanine",
"path": "mezzanine/galleries/models.py",
"copies": "1",
"size": "5582",
"license": "bsd-2-clause",
"hash": -7442469587680164000,
"line_mean": 39.4492753623,
"line_max": 84,
"alpha_frac": 0.5752418488,
"autogenerated": false,
"ratio": 4.203313253012048,
"config_t... |
from filebrowser.settings import VERSIONS
MONTH_STRINGS = {
'1': 'Januar',
'2': 'Februar',
'3': 'Mars',
'4': 'April',
'5': 'Mai',
'6': 'Juni',
'7': 'Juli',
'8': 'August',
'9': 'September',
'10': 'Oktober',
'11': 'November',
'12': 'Desember',
}
def find_image_versions(a... | {
"repo_name": "dotKom/onlineweb4",
"path": "apps/article/utils.py",
"copies": "1",
"size": "1643",
"license": "mit",
"hash": -1892803497434843000,
"line_mean": 25.5,
"line_max": 70,
"alpha_frac": 0.5629945222,
"autogenerated": false,
"ratio": 3.3668032786885247,
"config_test": false,
"has_no_... |
from filebutler.fbquery import FbQuery
from datetime import datetime
import unittest
class PasswordTests(unittest.TestCase):
def setUp(self):
self.fb = FbQuery()
# User tests
def testUserCreate(self):
self.assertTrue(self.fb.user_create(
'testuser',
'randomPasswor... | {
"repo_name": "jhaals/python-filebutler",
"path": "tests/Fbquerytests.py",
"copies": "1",
"size": "3905",
"license": "bsd-3-clause",
"hash": 7816456724625039000,
"line_mean": 33.5575221239,
"line_max": 94,
"alpha_frac": 0.6473751601,
"autogenerated": false,
"ratio": 3.492844364937388,
"config_t... |
from FileCacheManager import FileCacheManager
class ConfigParser:
'''
Class that contains functions to constuct the config map from the config file
'''
configContent={}
def __init__(self,fileName):
'''
constructor that generates the map of the config file
@param fileName: fi... | {
"repo_name": "UWQuickstep/Grail",
"path": "ConfigParser.py",
"copies": "1",
"size": "1222",
"license": "apache-2.0",
"hash": 1162815795570760400,
"line_mean": 32.9444444444,
"line_max": 107,
"alpha_frac": 0.5572831424,
"autogenerated": false,
"ratio": 4.967479674796748,
"config_test": true,
... |
from ..file_checker import FileChecker
from ..path_builder import PathBuilder
from ..helper import Helper
from ..sublime_facade import SublimeFacade
class PHPUnitCommand:
def __init__(self, sublime, plugin_settings):
self._sublime = sublime
self._plugin_settings = plugin_settings
self._hel... | {
"repo_name": "ldgit/remote-phpunit",
"path": "app/commands/phpunit_command.py",
"copies": "1",
"size": "2643",
"license": "mit",
"hash": -7057657546080673000,
"line_mean": 37.8676470588,
"line_max": 110,
"alpha_frac": 0.6299659478,
"autogenerated": false,
"ratio": 3.514627659574468,
"config_te... |
from filecmp import cmp
from os import makedirs
from os.path import dirname
from os.path import exists
from os.path import join
from shutil import rmtree
from nose.tools import with_setup
from anytree import Node
from anytree.dotexport import RenderTreeGraph
TESTPATH = dirname(__file__)
GENPATH = join(TESTPATH, "dot... | {
"repo_name": "c0fec0de/anytree",
"path": "tests/test_dotexport.py",
"copies": "1",
"size": "2317",
"license": "apache-2.0",
"hash": 1950321774257940700,
"line_mean": 26.2588235294,
"line_max": 70,
"alpha_frac": 0.6219249029,
"autogenerated": false,
"ratio": 2.9329113924050634,
"config_test": t... |
from filecmp import cmp
import os
from django.conf import settings
def set_encode_profiles(sender, instance, **kwargs):
"""Store the currently configured encoding profiles.
This allows changes to the profiles to be detected so it can be
determined if the file needs to be encoded. If a new file is being
... | {
"repo_name": "teury/django-multimedia",
"path": "multimedia/signals.py",
"copies": "2",
"size": "3129",
"license": "bsd-3-clause",
"hash": 4029980410177270300,
"line_mean": 34.1573033708,
"line_max": 86,
"alpha_frac": 0.6315116651,
"autogenerated": false,
"ratio": 4.567883211678832,
"config_te... |
from filecmp import cmp
import re
from scripttest import TestFileEnvironment
bindir = "bin/"
datadir = "test/data/"
testdir = "test/testenv_extract_bc/"
env = TestFileEnvironment(testdir)
# relative to test file environment
bindir_rel = "../../" + bindir
datadir_rel = "../../" + datadir
def test_call_without_paramet... | {
"repo_name": "dmaticzka/bctools",
"path": "test/test_extract_bc.py",
"copies": "2",
"size": "5059",
"license": "apache-2.0",
"hash": -2936775511951142000,
"line_mean": 27.7443181818,
"line_max": 131,
"alpha_frac": 0.5949792449,
"autogenerated": false,
"ratio": 3.397582269979852,
"config_test":... |
from filecmp import cmp
import re
from scripttest import TestFileEnvironment
bindir = "bin/"
datadir = "test/data/"
testdir = "test/testenv_remove_tail/"
env = TestFileEnvironment(testdir)
# relative to test file environment
bindir_rel = "../../" + bindir
datadir_rel = "../../" + datadir
def test_call_without_parame... | {
"repo_name": "tzk/bctools",
"path": "test/test_remove_tail.py",
"copies": "2",
"size": "1543",
"license": "apache-2.0",
"hash": 735353683797688600,
"line_mean": 25.6034482759,
"line_max": 71,
"alpha_frac": 0.6176279974,
"autogenerated": false,
"ratio": 3.4212860310421287,
"config_test": true,
... |
from filecmp import demo
from django.conf.app_template import admin
from django.contrib.auth.decorators import login_required
from django.contrib.messages.views import SuccessMessageMixin
from django.shortcuts import render
from django.utils.datetime_safe import datetime
from django.utils.decorators import method_decor... | {
"repo_name": "jmennen/group5",
"path": "Code/buzzit/buzzit_admin/views.py",
"copies": "1",
"size": "12047",
"license": "bsd-2-clause",
"hash": 82888246942394190,
"line_mean": 37.8612903226,
"line_max": 112,
"alpha_frac": 0.6812484436,
"autogenerated": false,
"ratio": 3.8911498708010335,
"confi... |
from filecmp import dircmp
import os
class BlankItem:
def __init__(self):
self.path = ''
class Item(BlankItem):
def __init__(self, path, name):
self.path = path
self.name = name
self.displayName = (name[:48] + '..') if len(name) > 50 else name
self.isDifferent = False
... | {
"repo_name": "fuxximus/python-predeploy-filestructure-compare",
"path": "src/item.py",
"copies": "1",
"size": "8093",
"license": "apache-2.0",
"hash": -5608600027570034000,
"line_mean": 36.2949308756,
"line_max": 134,
"alpha_frac": 0.5376251081,
"autogenerated": false,
"ratio": 3.921027131782946... |
from filecmp import dircmp
import shutil
import os
def walk_recursively_and_update(dcmp):
#for different Files Copy from right to left
for name in dcmp.diff_files:
srcpath = dcmp.right + "/" + name
destpath = dcmp.left + "/" + name
print "Updating %s" % (destpath)
if os.path.is... | {
"repo_name": "taylorjonl/coreclr",
"path": "src/scripts/Utilities.py",
"copies": "1",
"size": "1576",
"license": "mit",
"hash": 4842827315811952000,
"line_mean": 31.8333333333,
"line_max": 79,
"alpha_frac": 0.5958121827,
"autogenerated": false,
"ratio": 3.58997722095672,
"config_test": false,
... |
from .file_content import FileContent
from .file_type import FileType
from .file_name import FileName
from .disposition import Disposition
from .content_id import ContentId
class Attachment(object):
"""An attachment to be included with an email."""
def __init__(
self,
file_content=Non... | {
"repo_name": "sendgrid/sendgrid-python",
"path": "sendgrid/helpers/mail/attachment.py",
"copies": "2",
"size": "7931",
"license": "mit",
"hash": 1024013683693828000,
"line_mean": 35.380733945,
"line_max": 79,
"alpha_frac": 0.5821460093,
"autogenerated": false,
"ratio": 4.950686641697878,
"conf... |
from FileError import *
# Define a set of constants for various instruction types
NO_COMMAND = 0
A_COMMAND = 1
C_COMMAND = 2
L_COMMAND = 3
class Parser(object):
def __init__(self, fileName):
"""
Costructor Parser(fileName)
Open 'source' and get ready to parse it.
'source' may be... | {
"repo_name": "benkoo/nand2tetris",
"path": "06/Python/FileManipulation/FileParser.py",
"copies": "1",
"size": "4721",
"license": "cc0-1.0",
"hash": 2613267245619267600,
"line_mean": 27.2694610778,
"line_max": 131,
"alpha_frac": 0.5123914425,
"autogenerated": false,
"ratio": 3.9907016060862213,
... |
from file_experts.data_set.cifar10_data_set_preparations import Cifar10DataSetPreparations
from file_experts.data_set.image_data_set_preparations import ImageDataSetPreparations
from file_experts.data_set.cifar10_reader import Cifar10Reader
from file_experts.data_set.image_reader import ImageReader
from utils.call_met... | {
"repo_name": "dani-i/bachelor-project",
"path": "file_experts/data_set/data_set_creator.py",
"copies": "1",
"size": "11395",
"license": "apache-2.0",
"hash": 8739580691199443000,
"line_mean": 32.6135693215,
"line_max": 104,
"alpha_frac": 0.529442738,
"autogenerated": false,
"ratio": 4.2951375800... |
from file_experts.data_set.image_reader import ImageReader
from utils.train.session_details import SessionDetails
from datetime import datetime
import constants.cnn_constants as cnn_const
import neural_networks.cnn as cnn
import tensorflow as tf
class InteractSession:
def __init__(self,
sessi... | {
"repo_name": "dani-i/bachelor-project",
"path": "session/interact_session.py",
"copies": "1",
"size": "3920",
"license": "apache-2.0",
"hash": -8273596503456665000,
"line_mean": 27.8235294118,
"line_max": 92,
"alpha_frac": 0.5068877551,
"autogenerated": false,
"ratio": 4.547563805104408,
"conf... |
from file_explorer import FileExplorer
from abc import abstractmethod
import tempfile
from file import File
from remote_file import RemoteFile
import os
from urllib2 import HTTPError
class RemoteFiles(FileExplorer):
def __init__(self, application_name, base_folder='/opuntia'):
super(RemoteFiles, self).__... | {
"repo_name": "opuntiateam/opuntia",
"path": "remote_files.py",
"copies": "2",
"size": "2630",
"license": "mpl-2.0",
"hash": 4982558372062901000,
"line_mean": 29.5813953488,
"line_max": 82,
"alpha_frac": 0.6174904943,
"autogenerated": false,
"ratio": 4.283387622149837,
"config_test": false,
"... |
from file_export.template_variables import *
def _create_tape_item_vars(value, item_index, current_item_index, tape_index):
item_type = 'selected_item' if item_index == current_item_index else 'regular_item'
return TapeItemTemplateVariables(tape_index=tape_index, value=value, type=item_type)
def _create_tap... | {
"repo_name": "mjutzi/TikzTuringSimulator",
"path": "file_export/document_variable_factory.py",
"copies": "1",
"size": "2882",
"license": "apache-2.0",
"hash": 3153901124732961300,
"line_mean": 35.025,
"line_max": 102,
"alpha_frac": 0.6734906315,
"autogenerated": false,
"ratio": 3.301260022909507... |
from file_group import File_Group
from file_data import File_Data, get_hash_generator, hash_algs
class File_Classifier:
def __init__(self, hash_alg):
self._groups = {}
self._hash_gen = get_hash_generator(hash_alg)
#***************#
# insert method #
#***************#
def insert(se... | {
"repo_name": "zairmubashar/finddup",
"path": "src/file_classifier.py",
"copies": "1",
"size": "2305",
"license": "mit",
"hash": 2534773748974396000,
"line_mean": 30.1486486486,
"line_max": 80,
"alpha_frac": 0.5206073753,
"autogenerated": false,
"ratio": 4.349056603773585,
"config_test": false,... |
from fileHandler import FileHandler
from DocumentClass import Document
from stemmerProxy import StemmerProxy
from math import log
from QueryExpanding import QueryExpander
class TFIDF:
def __init__(self, documentsFileName, keywordsFileName):
self.make_document_list(documentsFileName)
self.make_keyw... | {
"repo_name": "dohko93/SEEN",
"path": "TFIDF.py",
"copies": "1",
"size": "4223",
"license": "mit",
"hash": -8390733354142274000,
"line_mean": 31.7441860465,
"line_max": 84,
"alpha_frac": 0.5770779067,
"autogenerated": false,
"ratio": 3.9952696310312206,
"config_test": false,
"has_no_keywords"... |
from file_handler import file_handler
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
import numpy as np
class plotter:
def __init__(self, filename):
self.filename = filename
def pathfinder(self):
"""Find full path to filename """
def plo... | {
"repo_name": "copperwire/SIMS",
"path": "plotting_module.py",
"copies": "1",
"size": "1816",
"license": "cc0-1.0",
"hash": -1144071373340982700,
"line_mean": 21.7,
"line_max": 83,
"alpha_frac": 0.6084801762,
"autogenerated": false,
"ratio": 2.798151001540832,
"config_test": false,
"has_no_ke... |
from file_handler.ServerFileHandlingService import *
from file_handler.file_handling.FileScanner import *
from file_handler.file_handling.FileHandler import *
from file_handler.file_handling.PathManipulation import *
from file_handler.local_storage.StorageFolderInit import *
from file_handler.os.OSWrapper import *
from... | {
"repo_name": "rwhite226/Graphalyzer",
"path": "graphalyzer-server/src/file_handler/SpringMock.py",
"copies": "1",
"size": "3605",
"license": "apache-2.0",
"hash": 6261081631761676000,
"line_mean": 42.4457831325,
"line_max": 170,
"alpha_frac": 0.7986130374,
"autogenerated": false,
"ratio": 3.5136... |
from .file import File
from sublime_plugin import EventListener, WindowCommand, TextCommand
from sublime import load_settings, save_settings, load_resource, packages_path
def clear_cache(force = False):
"""
If the folder exists, and has more than 5MB of icons in the cache, delete
it to clear all the icons then r... | {
"repo_name": "prisis/sublime-text-packages",
"path": "Packages/Gutter Color/gutter_color.py",
"copies": "2",
"size": "6006",
"license": "mit",
"hash": -8758145875109222000,
"line_mean": 35.6219512195,
"line_max": 109,
"alpha_frac": 0.6841491841,
"autogenerated": false,
"ratio": 3.570749108204518... |
from File import File
class Png:
"""Class containing methods for creation of png files."""
#### initial values ###
_height = 1
_width = 1
_color_type = 2
_bit_depth = 8
_default_color = [0,0,0] # black
_image = [[_default_color]]
_palette = []
_background_color = None
... | {
"repo_name": "dburggie/pypng",
"path": "src/Png.py",
"copies": "1",
"size": "9710",
"license": "mit",
"hash": -3507964284653853000,
"line_mean": 28.4242424242,
"line_max": 85,
"alpha_frac": 0.498661174,
"autogenerated": false,
"ratio": 4.336757481018312,
"config_test": false,
"has_no_keyword... |
from file import func
def test_func():
assert func([1, 2, 3, 4, 5], (lambda x: x**2), True) == [ 4, 16, 36, 64, 100]
assert func([1, 2, 3, 4, 5], (lambda x: x**2), None) == [ 2, 8, 18, 32, 50]
assert func([1, 2, 3, 4, 5], (lambda x: x**2), False) == [ 1, 4, 9, 16, 25]
assert func([1, 2, 3, 4,... | {
"repo_name": "Argentumbolo/PySample",
"path": "src/test_file.py",
"copies": "1",
"size": "1084",
"license": "apache-2.0",
"hash": -7405941346508115000,
"line_mean": 62.7647058824,
"line_max": 83,
"alpha_frac": 0.3653136531,
"autogenerated": false,
"ratio": 2.71,
"config_test": false,
"has_no... |
from fileImport import *
from utility import *
def conditionIsTrue(instuction, registers):
operator = instruction[5]
first = 0
if instruction[4] in registers:
first = registers[instruction[4]]
second = int(instruction[6])
if operator == '>':
return first > second
if operator == ... | {
"repo_name": "codemonkey047/AdventOfCode",
"path": "2017/day8.py",
"copies": "1",
"size": "1185",
"license": "mit",
"hash": 5958095691039328000,
"line_mean": 25.9545454545,
"line_max": 60,
"alpha_frac": 0.6008438819,
"autogenerated": false,
"ratio": 4.157894736842105,
"config_test": false,
"... |
from fileImport import *
import datetime
def init(input):
ranges = {}
currentScan = {}
direction = {}
for line in input:
key = int(line[:line.find(':')])
ranges[key] = int(line[line.find(':')+1:])
direction[key] = 1
currentScan[key] = 0
return ranges,direction,curren... | {
"repo_name": "codemonkey047/AdventOfCode",
"path": "2017/day13.py",
"copies": "1",
"size": "1443",
"license": "mit",
"hash": -7523821175693611000,
"line_mean": 28.4489795918,
"line_max": 68,
"alpha_frac": 0.6223146223,
"autogenerated": false,
"ratio": 3.931880108991826,
"config_test": false,
... |
from fileImport import *
import sys
def parseInput(input):
action = input[:1]
data = input[1:].split('/')
return action, data
def doAction(action, data, array):
if action == 's':
array = spinArray(array, int(data[0]))
if action =='x':
swapIndices(array, int(data[0]), int(data[1]))
... | {
"repo_name": "codemonkey047/AdventOfCode",
"path": "2017/day16.py",
"copies": "1",
"size": "2399",
"license": "mit",
"hash": 4922974785185897000,
"line_mean": 27.5595238095,
"line_max": 93,
"alpha_frac": 0.628595248,
"autogenerated": false,
"ratio": 3.095483870967742,
"config_test": false,
"... |
from fileImport import *
input = readLines('day10.txt')
testString = input[0]
actualString = input[1]
def reverseArray(array, position, length):
start = position
end = (position + length - 1) % len(array)
movements = length/2 + 1
for i in range(1, movements):
temp = array[start]
array[... | {
"repo_name": "codemonkey047/AdventOfCode",
"path": "2017/day10.py",
"copies": "1",
"size": "1542",
"license": "mit",
"hash": -1957014454883369000,
"line_mean": 26.0526315789,
"line_max": 75,
"alpha_frac": 0.6108949416,
"autogenerated": false,
"ratio": 3.3019271948608138,
"config_test": false,
... |
from fileinput import filename
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
tweets = []
#Variables that contains the user credentials to access Twitter API
access_token = "access_token"
access_token_secret = "access_token_secret"
consumer_key = "consu... | {
"repo_name": "praveenkanamarlapudi/Predicting-US-Presidential-Elections-TwitterData",
"path": "twitter/datacollectior/streaming.py",
"copies": "1",
"size": "1847",
"license": "apache-2.0",
"hash": 7051255760894596000,
"line_mean": 30.8448275862,
"line_max": 136,
"alpha_frac": 0.6291283162,
"autoge... |
from fileinput import input as fileinput
from gzip import GzipFile
from os import listdir
from os.path import isdir
from os.path import join
from pathlib import Path
from typing import Callable
from typing import Iterable
from typing import Optional
from typing import Union
def subdirectories(root: str) -> Iterable[s... | {
"repo_name": "ascoderu/opwen-cloudserver",
"path": "opwen_email_client/util/os.py",
"copies": "3",
"size": "1278",
"license": "apache-2.0",
"hash": 5711893447402217000,
"line_mean": 26.1914893617,
"line_max": 78,
"alpha_frac": 0.5907668232,
"autogenerated": false,
"ratio": 3.9813084112149535,
... |
from fileinput import input
from linecache import getline
from random import randint, sample
class Phrase:
_chars_as_is = [" ", "-"]
def __init__(self, text):
self.text = text
self.chars = set()
for char in text:
if char not in self._chars_as_is:
self.chars... | {
"repo_name": "ockcyp/python-hangman",
"path": "hangman.py",
"copies": "1",
"size": "4829",
"license": "unlicense",
"hash": 6179108106615051000,
"line_mean": 26.2824858757,
"line_max": 73,
"alpha_frac": 0.5305446262,
"autogenerated": false,
"ratio": 3.9006462035541194,
"config_test": false,
"... |
from .fileio import fileIO
import os
import numpy as np
from .angst_tables import angst_data
import graphics.GraphicsUtils as rspgraph
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
def points_inside_ds9_polygon(reg_name, ra_points, dec_points):
'''
uses read_... | {
"repo_name": "philrosenfield/ResolvedStellarPops",
"path": "astronomy_utils.py",
"copies": "1",
"size": "7676",
"license": "bsd-3-clause",
"hash": 4636748120768626000,
"line_mean": 28.2977099237,
"line_max": 94,
"alpha_frac": 0.572303283,
"autogenerated": false,
"ratio": 3.053301511535402,
"co... |
from .fileIO import LatticeFile
import numpy as np
class ImpactInternalDistribution(object):
def __init__(self, ref_freq=100.0e6, Ek0=1.0e6, mass=510.99e3, npart=[1,], charge=[1.0,], charge_state=[1.0/510.99e3,]):
self.vgamma=(1+Ek0)/mass
self.vbeta=np.sqrt(1.0-1.0/self.vgamma/self.vgamma)
... | {
"repo_name": "YueHao/PyLatte",
"path": "latticeIO/impactIO.py",
"copies": "1",
"size": "16583",
"license": "mit",
"hash": 2402089005556837000,
"line_mean": 39.6446078431,
"line_max": 140,
"alpha_frac": 0.4917686788,
"autogenerated": false,
"ratio": 3.178646731838221,
"config_test": false,
"h... |
from filelock.fl import FileLock
import clparams
import configuration
import controller
import traceback
if __name__ == '__main__':
if configuration.PRODUCTION != False:
print 'Configuration is set to PRODUCTION MODE'
print 'Change configuration.PRODUCTION = False for simulations'
else:
... | {
"repo_name": "jacksonicson/paper.IS2015",
"path": "control/Control/src/balancer/simulation.py",
"copies": "1",
"size": "2305",
"license": "mit",
"hash": -7175954018392704000,
"line_mean": 32.8970588235,
"line_max": 73,
"alpha_frac": 0.4420824295,
"autogenerated": false,
"ratio": 4.94635193133047... |
from filelock import FileLock
from threading import RLock
import json
import os
import socket
import logging
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import (TAG_RAY_NODE_KIND, NODE_KIND_WORKER,
NODE_KIND_HEAD, TAG_RAY_USER_NODE_TYPE,
... | {
"repo_name": "ray-project/ray",
"path": "python/ray/autoscaler/_private/local/node_provider.py",
"copies": "1",
"size": "11707",
"license": "apache-2.0",
"hash": 2187282288747884300,
"line_mean": 39.7909407666,
"line_max": 79,
"alpha_frac": 0.5471085675,
"autogenerated": false,
"ratio": 4.283571... |
from filemakeifno import filemakeifno
from getfilecontents import readsncmd
from os import getcwd
from subprocess import check_output
from re import search
def sncmdintegraty(contents, searchstrng):
return search(r"\w\w\w\w", str(contents))
def issncmdfileinstartupifnodo(appdata, snpy):
... | {
"repo_name": "Triballian/stakenannyb",
"path": "stakenannyb/issncmdfileinstartupifnodo.py",
"copies": "1",
"size": "1183",
"license": "mit",
"hash": 147226781996713020,
"line_mean": 32.8285714286,
"line_max": 171,
"alpha_frac": 0.6255283178,
"autogenerated": false,
"ratio": 3.720125786163522,
... |
from FileManagement.interface_filehandler import *
# Brendan
import pickle
import os
import sys
import math
# kate
import re
from datetime import *
# Kris Little design
class FileHandler(IFileHandler):
def __init__(self):
self.valid = True
# Kris
def load_file(self, file):
... | {
"repo_name": "Comikris/Assignment_Interpreter",
"path": "FileManagement/filehandler.py",
"copies": "1",
"size": "7873",
"license": "apache-2.0",
"hash": -2066208822728837600,
"line_mean": 32.6828193833,
"line_max": 111,
"alpha_frac": 0.498666328,
"autogenerated": false,
"ratio": 4.34252619966905... |
from .file_mapping import get_file_paths, run_map
def get_s3_keys_anatomy(
subject,
freesurfer_outputs=('label', 'mri', 'surf'),
meg_anatomy_outputs=('head_model', 'transforms'),
hcp_path_bucket='HCP_900'):
"""Helper to prepare AWS downloads for anatomy data
A helper function ... | {
"repo_name": "RPGOne/Skynet",
"path": "mne-hcp-master/hcp/io/file_mapping/s3.py",
"copies": "3",
"size": "5176",
"license": "bsd-3-clause",
"hash": -5788619207560126000,
"line_mean": 36.5072463768,
"line_max": 79,
"alpha_frac": 0.5751545595,
"autogenerated": false,
"ratio": 4.075590551181103,
... |
from .FileObject import FileObject
from flask import send_from_directory
from shuttl import db
class GenericFile(FileObject):
##Id of the css. Because of the way inheritance is set up in sqlalchemy, this is a foreignKey
id = db.Column(db.Integer, db.ForeignKey('file_object.id'), primary_key=True)
## The ... | {
"repo_name": "shuttl-io/shuttl",
"path": "shuttl/Models/FileTree/FileObjects/GenericFile.py",
"copies": "1",
"size": "1425",
"license": "mit",
"hash": 223849445336380800,
"line_mean": 27.5,
"line_max": 97,
"alpha_frac": 0.6084210526,
"autogenerated": false,
"ratio": 3.9148351648351647,
"config... |
from .FileObject import FileObject
from flask import send_from_directory
from shuttl import db
class JsFile(FileObject):
##Id of the javascript. Because of the way inheritance is set up in sqlalchemy, this is a foreignKey
id = db.Column(db.Integer, db.ForeignKey('file_object.id'), primary_key=True)
## The... | {
"repo_name": "shuttl-io/shuttl",
"path": "shuttl/Models/FileTree/FileObjects/JsFile.py",
"copies": "1",
"size": "1404",
"license": "mit",
"hash": -5848948815368925000,
"line_mean": 28.8723404255,
"line_max": 104,
"alpha_frac": 0.6296296296,
"autogenerated": false,
"ratio": 4.011428571428572,
"... |
from .FileObject import FileObject
from flask import send_from_directory
from shuttl import db
class CssFile(FileObject):
##Id of the css. Because of the way inheritance is set up in sqlalchemy, this is a foreignKey
id = db.Column(db.Integer, db.ForeignKey('file_object.id'), primary_key=True)
## The Type... | {
"repo_name": "shuttl-io/shuttl",
"path": "shuttl/Models/FileTree/FileObjects/CssFile.py",
"copies": "1",
"size": "1389",
"license": "mit",
"hash": -8345561403447309000,
"line_mean": 27.9375,
"line_max": 97,
"alpha_frac": 0.6249100072,
"autogenerated": false,
"ratio": 3.9572649572649574,
"confi... |
from FileOutputPlugin import FileOutputPlugin
from tulip import *
import tulippaths as tp
exampleCellLabels = ['CBb4w', 'CBb4w', 'AC', 'Rod BC', 'Rod BC']
exampleEdgeTypes = ['.*', '.*', '.*', '.*']
class FindPathsPlugin(FileOutputPlugin):
""" Tulip plugin algorithm which searches for paths that match a series o... | {
"repo_name": "visdesignlab/TulipPaths",
"path": "FindPathsPlugin.py",
"copies": "2",
"size": "4331",
"license": "mit",
"hash": 848565596678493600,
"line_mean": 34.7933884298,
"line_max": 94,
"alpha_frac": 0.6035557608,
"autogenerated": false,
"ratio": 4.124761904761905,
"config_test": false,
... |
from FileParsers.Parser import Parser
class AprRunLog(Parser):
def __init__(self, file):
super(AprRunLog, self).__init__(file)
# matchLine() takes the line that the method search_file() is looking for at the time and the keywords of the regular
# expression. The method does the regular expression... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/AprRunLog.py",
"copies": "1",
"size": "2183",
"license": "mit",
"hash": 1637857566295966000,
"line_mean": 44.5,
"line_max": 162,
"alpha_frac": 0.5748969308,
"autogenerated": false,
"ratio": 3.481658692185008,
"config_test": f... |
from FileParsers.Parser import Parser
class CadenceGateCount(Parser):
def __init__(self, file):
super(CadenceGateCount, self).__init__(file)
@staticmethod
def match_line(regex1, line):
import re
keyword = regex1.replace(" ", "")
line_variables = '.*(%s)[^%s\d]*([-\d\.]*).*... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/GateCount.py",
"copies": "1",
"size": "1048",
"license": "mit",
"hash": -8051292342724583000,
"line_mean": 35.1379310345,
"line_max": 134,
"alpha_frac": 0.6078244275,
"autogenerated": false,
"ratio": 3.638888888888889,
"confi... |
from FileParsers.Parser import Parser
class CadenceQorReport(Parser):
def __init__(self, file):
super(CadenceQorReport, self).__init__(file)
@staticmethod
def match_line(line, *args):
import re
match_words = ""
for arg in args:
match_words += arg.replace(" ", "... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/QorReportCad.py",
"copies": "1",
"size": "1502",
"license": "mit",
"hash": -8835025440638501000,
"line_mean": 38.5263157895,
"line_max": 109,
"alpha_frac": 0.586551265,
"autogenerated": false,
"ratio": 3.444954128440367,
"con... |
from FileParsers.Parser import Parser
class CadenceSignOffSum(Parser):
def __init__(self, file):
super(CadenceSignOffSum, self).__init__(file)
@staticmethod
def match_line(regex1, line):
import re
line_variables = '.*(%s)[^\|]*\|[^\|]*\|[\s]*([\d.]*).*' % regex1
result = r... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/SignOffSum.py",
"copies": "1",
"size": "1596",
"license": "mit",
"hash": 8724019377585483000,
"line_mean": 44.6285714286,
"line_max": 113,
"alpha_frac": 0.6102756892,
"autogenerated": false,
"ratio": 3.257142857142857,
"confi... |
from FileParsers.Parser import Parser
class CalibreErrors(Parser):
def __init__(self, file):
super(CalibreErrors, self).__init__(file)
def metric_naming(self):
import re
import os.path
executing_file_location = os.path.realpath(__file__)
dir_name = os.path.split(os.pa... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/CalibreErrors.py",
"copies": "1",
"size": "1721",
"license": "mit",
"hash": -5525855930882945000,
"line_mean": 39.023255814,
"line_max": 136,
"alpha_frac": 0.564787914,
"autogenerated": false,
"ratio": 3.630801687763713,
"con... |
from FileParsers.Parser import Parser
class DpLog(Parser):
def __init__(self, file):
super(DpLog, self).__init__(file)
def metric_naming(self):
import re
stage = ""
denall = re.search(r'.*denall_reuse.*', self.file, re.I)
drcd = re.search(r'.*drcd.*', self.file, re.I)
... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/DpLog.py",
"copies": "1",
"size": "1575",
"license": "mit",
"hash": 3893358247079209500,
"line_mean": 37.4146341463,
"line_max": 121,
"alpha_frac": 0.5301587302,
"autogenerated": false,
"ratio": 3.294979079497908,
"config_te... |
from FileParsers.Parser import Parser
class DRCError(Parser):
def __init__(self, file, metric_collections):
super(DRCError, self).__init__(file)
self.metric_collections = metric_collections
def metric_naming(self):
import re
denall = re.search(r'.*denall_reuse.*', self.file, r... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/DrcErrors.py",
"copies": "1",
"size": "2363",
"license": "mit",
"hash": -4136988072601161700,
"line_mean": 35.9375,
"line_max": 137,
"alpha_frac": 0.5577655523,
"autogenerated": false,
"ratio": 3.5966514459665144,
"config_te... |
from FileParsers.Parser import Parser
class FinalReport(Parser):
def __init__(self, file):
super(FinalReport, self).__init__(file)
def metric_naming(self):
import re
import os.path
executing_file_location = os.path.realpath(__file__)
found_stage = re.search(r'(denall|i... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/FinalReport.py",
"copies": "1",
"size": "1107",
"license": "mit",
"hash": 5328817299582087000,
"line_mean": 34.7096774194,
"line_max": 136,
"alpha_frac": 0.5645889792,
"autogenerated": false,
"ratio": 3.5142857142857142,
"co... |
from FileParsers.Parser import Parser
class PhysicalReport(Parser):
def __init__(self, file):
super(PhysicalReport, self).__init__(file)
# This method is what is used to do the regular expression on the lines of the file. The method simply takes in
# the three first arguments as the names for the... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/PhysicalReport.py",
"copies": "1",
"size": "2188",
"license": "mit",
"hash": -97291527529950340,
"line_mean": 51.119047619,
"line_max": 115,
"alpha_frac": 0.6288848263,
"autogenerated": false,
"ratio": 3.76592082616179,
"con... |
from FileParsers.Parser import Parser
class PowerReport(Parser):
def __init__(self, file):
super(PowerReport, self).__init__(file)
@staticmethod
def match_line(line, *args):
import re
match_words = ""
no_match = ""
for arg in args:
match_words += arg.re... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/PowerReport.py",
"copies": "1",
"size": "1658",
"license": "mit",
"hash": 4390864642337598000,
"line_mean": 37.5581395349,
"line_max": 88,
"alpha_frac": 0.582026538,
"autogenerated": false,
"ratio": 3.6762749445676275,
"confi... |
from FileParsers.Parser import Parser
class PvPower(Parser):
def __init__(self, file):
super(PvPower, self).__init__(file)
@staticmethod
def match_line(regex1,regex2, regex3, line):
import re
regexR = r'(%s[\s]*%s[\s]*%s)[\s]*=+[\s]*([\d]+[\.]*[\d]*[\S]+)+[\s]*' %(regex1, regex2, ... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/PvPower.py",
"copies": "1",
"size": "1304",
"license": "mit",
"hash": -3140826007546859500,
"line_mean": 34.2432432432,
"line_max": 104,
"alpha_frac": 0.5613496933,
"autogenerated": false,
"ratio": 3.431578947368421,
"config... |
from FileParsers.Parser import Parser
class PVTMetric(Parser):
def __init__(self, file):
super(PVTMetric, self).__init__(file)
# This class is not part of the configuration
@staticmethod
def metric_naming(file):
import re
stage = ""
syn = re.search(r'.*syn.*', file, re... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/PVTmetric.py",
"copies": "1",
"size": "2106",
"license": "mit",
"hash": 6638242836646888000,
"line_mean": 36.625,
"line_max": 148,
"alpha_frac": 0.4905033238,
"autogenerated": false,
"ratio": 3.0834553440702783,
"config_test... |
from FileParsers.Parser import Parser
class QorReport(Parser):
def __init__(self, file):
super(QorReport, self).__init__(file)
# This method is used to find and return the stage(e.g. "syn" or "py") by using the file name that was passed into
# the method search_file. The method then uses regular ... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Synopsys/QorReport.py",
"copies": "1",
"size": "5996",
"license": "mit",
"hash": -309544002215412400,
"line_mean": 52.5357142857,
"line_max": 129,
"alpha_frac": 0.5640426951,
"autogenerated": false,
"ratio": 3.802155992390615,
"confi... |
from FileParsers.Parser import Parser
class StaMaxQor(Parser):
def __init__(self, file):
super(StaMaxQor, self).__init__(file)
@staticmethod
def match_line(line, regex1):
import re
match_word = regex1.replace(" ", "[\s]*")
line_variables = '.*(%s)[\s]*([-\d\.]*).*' % match... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/FileParsers/Cadence/StaMaxQor.py",
"copies": "1",
"size": "2584",
"license": "mit",
"hash": -576818261940220500,
"line_mean": 52.8333333333,
"line_max": 143,
"alpha_frac": 0.6280959752,
"autogenerated": false,
"ratio": 3.6292134831460676,
"confi... |
from file_reader import File_Reader
from file_writer import File_Writer
import string
import config
from collections import OrderedDict, defaultdict
class Invert_Index:
def __init__(self):
self.fr = File_Reader()
self.fw = File_Writer()
self.temp = config.temp_path
self.path = confi... | {
"repo_name": "Informationretrieval2016/furnito",
"path": "invert_index/invert_index.py",
"copies": "1",
"size": "2730",
"license": "mit",
"hash": -5124455749463311000,
"line_mean": 33.5569620253,
"line_max": 83,
"alpha_frac": 0.5897435897,
"autogenerated": false,
"ratio": 4.099099099099099,
"c... |
from file_readers.data_collector import BaseDataCollector
from openpyxl.cell import column_index_from_string
class SimpleExcelDataCollector(BaseDataCollector):
def __init__(self, use_header, debug=False):
self.use_header = use_header
self.debug = debug
self.data = []
self.headers ... | {
"repo_name": "mjalas/file-readers",
"path": "file_readers/excel/simple_excel_data_collector.py",
"copies": "1",
"size": "1366",
"license": "mit",
"hash": 5922348721617195000,
"line_mean": 28.6956521739,
"line_max": 82,
"alpha_frac": 0.5666178624,
"autogenerated": false,
"ratio": 4.02949852507374... |
from file_readers.data_collector import BaseDataCollector
class CSVRowDataCollector(BaseDataCollector):
def __init__(self, data_structure_dict, header=None):
"""The constructor takes the data sources structure as parameter.
Args:
data_structure_dict: The structure of the data source ... | {
"repo_name": "mjalas/file-readers",
"path": "file_readers/csv/csv_row_data_collector.py",
"copies": "1",
"size": "1284",
"license": "mit",
"hash": 8195049668818629000,
"line_mean": 34.6666666667,
"line_max": 93,
"alpha_frac": 0.546728972,
"autogenerated": false,
"ratio": 4.585714285714285,
"co... |
from file_readers.file_reader import BaseFileReader
from file_readers.data_collector import BaseDataCollector
from openpyxl import load_workbook
from openpyxl.cell import get_column_letter
class ExcelReader(BaseFileReader):
def __init__(self, data_collector, debug=False):
if not isinstance(data_collector... | {
"repo_name": "mjalas/file-readers",
"path": "file_readers/excel/excel_reader.py",
"copies": "1",
"size": "1487",
"license": "mit",
"hash": 7244552455853086000,
"line_mean": 37.1282051282,
"line_max": 99,
"alpha_frac": 0.6489576328,
"autogenerated": false,
"ratio": 3.832474226804124,
"config_te... |
from FileReadWrite import *
from py4j.java_gateway import JavaGateway
import numpy as np
def lda_run(corp, corpfile, ctx_type, iterations, K, metafile,
alpha=0.01, beta=0.01):
"""
corp : `vsm.Corpus`
corpfile : fname, '\n' indicates ctx breaks (tokenizaiton).
ctx_type : a context type in c... | {
"repo_name": "iSumitG/vsm",
"path": "vsm/extensions/lda_py4j/org/knowceans/gibbstest/LdaRoutine.py",
"copies": "1",
"size": "3138",
"license": "mit",
"hash": -8282692813609932000,
"line_mean": 31.0204081633,
"line_max": 77,
"alpha_frac": 0.5952836201,
"autogenerated": false,
"ratio": 3.011516314... |
from filer.models.clipboardmodels import Clipboard, ClipboardItem
from filer.models.foldermodels import Folder
from filer.utils.compatibility import PILImage, PILImageDraw
def create_superuser():
from django.contrib.auth import get_user_model
User = get_user_model()
superuser = User.objects.create_superus... | {
"repo_name": "divio/django-filer",
"path": "tests/helpers.py",
"copies": "2",
"size": "2570",
"license": "bsd-3-clause",
"hash": -5245487409118369000,
"line_mean": 33.2666666667,
"line_max": 84,
"alpha_frac": 0.6019455253,
"autogenerated": false,
"ratio": 3.7628111273792095,
"config_test": fal... |
from filer.models import Clipboard
def discard_clipboard(clipboard):
clipboard.files.clear()
def delete_clipboard(clipboard):
for file in clipboard.files.all():
file.delete()
def get_user_clipboard(user):
if user.is_authenticated():
clipboard, was_clipboard_created = Clipboard.objects.get... | {
"repo_name": "yml/django-filer",
"path": "filer/models/tools.py",
"copies": "1",
"size": "1055",
"license": "mit",
"hash": 3546823196862192000,
"line_mean": 28.3333333333,
"line_max": 85,
"alpha_frac": 0.6672985782,
"autogenerated": false,
"ratio": 3.425324675324675,
"config_test": false,
"h... |
# from files.analysis import get_appropriate_factory, AnalysisFactory, qClose
import sys, traceback
from zipfile import ZipFile, is_zipfile
from files.filetype.AnalysisFactory import AnalysisFactory
import files.filetype
import files.analysis
class ZIPFile(AnalysisFactory):
def processNestedZipEntry(self, handle, ... | {
"repo_name": "plus-provenance/dataidentity",
"path": "files/filetype/ZIPFile.py",
"copies": "1",
"size": "3625",
"license": "apache-2.0",
"hash": 8282851756723391000,
"line_mean": 42.6746987952,
"line_max": 134,
"alpha_frac": 0.5368275862,
"autogenerated": false,
"ratio": 4.852744310575636,
"c... |
from files_by_date.parsers.command_line_argument_parser import CommandLineArgumentParser
from files_by_date.service.file_copier_service import FileCopierService
from files_by_date.validators.argument_validator import ArgumentValidator
def run(*, args=None):
command_line_argument_parser = CommandLineArgumentParser... | {
"repo_name": "DEV3L/python-files-by-date",
"path": "files_by_date/app/run.py",
"copies": "1",
"size": "1072",
"license": "mit",
"hash": 8275535301212055000,
"line_mean": 52.6,
"line_max": 125,
"alpha_frac": 0.7462686567,
"autogenerated": false,
"ratio": 4.030075187969925,
"config_test": false,... |
from fileserver.models import Option
from fileserver.ResponseWorker import ResponseType
from fileserver.ResponseFormatWorker import GenerateOutput
from fileserver.OutputTableHeader import OutputTableHeader
from enum import Enum
class PublicOptionKey(Enum):
FileSizeLimit = "FILE_SIZE_LIMIT"
LimitMessagesForQue... | {
"repo_name": "opentelega/OpenTelega",
"path": "fileserver/OptionWorker.py",
"copies": "1",
"size": "3228",
"license": "mit",
"hash": 379258633425787100,
"line_mean": 30.6568627451,
"line_max": 78,
"alpha_frac": 0.7295539033,
"autogenerated": false,
"ratio": 4.11734693877551,
"config_test": fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.