text stringlengths 0 1.05M | meta dict |
|---|---|
from fluent_contents.extensions import ContentPlugin
from fluent_contents.models import ContentItem
from django.db import models
import appsettings
from icekit.fields import ICEkitURLField
from icekit.plugins.links.managers import LinkManager
from icekit.utils.attributes import resolve
class AbstractLinkItem(ContentI... | {
"repo_name": "ic-labs/django-icekit",
"path": "icekit/plugins/links/abstract_models.py",
"copies": "1",
"size": "3626",
"license": "mit",
"hash": -8461198691844072000,
"line_mean": 30.5304347826,
"line_max": 114,
"alpha_frac": 0.6213458356,
"autogenerated": false,
"ratio": 4.097175141242938,
"... |
from fluent_contents.extensions import ContentPlugin, PluginContext
from fluentcms_emailtemplates.rendering import html_to_text, replace_fields
class EmailContentPlugin(ContentPlugin):
"""
A plugin for e-mail templates, that can render both text and HTML.
The custom rendering functions are ``render_html`... | {
"repo_name": "edoburu/fluentcms-emailtemplates",
"path": "fluentcms_emailtemplates/extensions.py",
"copies": "1",
"size": "4825",
"license": "apache-2.0",
"hash": 5949595396958931000,
"line_mean": 41.6991150442,
"line_max": 126,
"alpha_frac": 0.6572020725,
"autogenerated": false,
"ratio": 4.3351... |
from fluent_contents.extensions import ContentPlugin, plugin_pool
from fluent_contents.plugins.twitterfeed import appsettings
from fluent_contents.plugins.twitterfeed.models import (
TwitterRecentEntriesItem,
TwitterSearchItem,
)
class BaseTwitterPlugin(ContentPlugin):
category = ContentPlugin.MEDIA
... | {
"repo_name": "edoburu/django-fluent-contents",
"path": "fluent_contents/plugins/twitterfeed/content_plugins.py",
"copies": "2",
"size": "1344",
"license": "apache-2.0",
"hash": -2554140418691751400,
"line_mean": 28.8666666667,
"line_max": 79,
"alpha_frac": 0.6763392857,
"autogenerated": false,
"... |
from fluent_contents.rendering import render_placeholder
from django.utils.safestring import mark_safe
from rest_framework import serializers
from bluebottle.bluebottle_drf2.serializers import SorlImageField, ImageSerializer
from bluebottle.members.serializers import UserPreviewSerializer
from .models import NewsIte... | {
"repo_name": "jfterpstra/bluebottle",
"path": "bluebottle/news/serializers.py",
"copies": "1",
"size": "1211",
"license": "bsd-3-clause",
"hash": -2325068549064742000,
"line_mean": 31.7297297297,
"line_max": 82,
"alpha_frac": 0.7126341866,
"autogenerated": false,
"ratio": 4.249122807017544,
"c... |
from fluent_pages.extensions import page_type_pool
from icekit.content_collections.page_type_plugins import ListingPagePlugin
from icekit.plugins.location.models import Location
from icekit_events.models import EventType
import models
@page_type_pool.register
class AdvancedEventListingPagePlugin(ListingPagePlugin)... | {
"repo_name": "ic-labs/django-icekit",
"path": "icekit_events/page_types/advancedeventlisting/page_type_plugins.py",
"copies": "1",
"size": "1522",
"license": "mit",
"hash": 8734219391258094000,
"line_mean": 42.4857142857,
"line_max": 76,
"alpha_frac": 0.685282523,
"autogenerated": false,
"ratio"... |
from fluent_pages.models import Page
from rest_framework import serializers
from drf_queryfields import QueryFieldsMixin
class ContentSerializer(serializers.Serializer):
"""
A serializer to render content items for a fluent page.
"""
content = serializers.SerializerMethodField()
def get_content(... | {
"repo_name": "ic-labs/django-icekit",
"path": "icekit/api/pages/serializers.py",
"copies": "1",
"size": "1147",
"license": "mit",
"hash": -4062914914620916700,
"line_mean": 26.3095238095,
"line_max": 72,
"alpha_frac": 0.6355710549,
"autogenerated": false,
"ratio": 4.34469696969697,
"config_tes... |
from fluff.filters import ANDFilter, ORFilter, NOTFilter, CustomFilter
from dimagi.utils.decorators.memoized import memoized
from corehq.apps.groups.models import Group
from corehq.fluff.calculators.xform import IN_MULTISELECT, IntegerPropertyReference
from couchforms.models import XFormInstance
from .filters import AL... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "custom/apps/cvsu/models.py",
"copies": "3",
"size": "13566",
"license": "bsd-3-clause",
"hash": 982462473858527000,
"line_mean": 32.0072992701,
"line_max": 118,
"alpha_frac": 0.6298835324,
"autogenerated": false,
"ratio": 3.7599778270509976,
"co... |
from fluff import TYPE_INTEGER
class Column(object):
def __init__(self, id, datatype, is_nullable=True, is_primary_key=False):
self.id = id
self.datatype = datatype
self.is_nullable = is_nullable
self.is_primary_key = is_primary_key
def __repr__(self):
return self.id
... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/userreports/indicators/__init__.py",
"copies": "1",
"size": "2515",
"license": "bsd-3-clause",
"hash": 5964003597366955000,
"line_mean": 27.2584269663,
"line_max": 102,
"alpha_frac": 0.6560636183,
"autogenerated": false,
"ratio": 3.9794... |
from flufl.enum import Enum
class Suit(Enum):
hearts = 0
clubs = 1
diamonds = 2
spades = 3
class Rank(Enum):
ace = 1
two = 2
three = 3
four = 4
five = 5
six = 6
seven = 7
eight = 8
nine = 9
ten = 10
jack = 11
queen = 12
king = 13
class Player(object... | {
"repo_name": "bobthekingofegypt/bobswitch-python",
"path": "bobswitch/models.py",
"copies": "1",
"size": "3833",
"license": "bsd-2-clause",
"hash": -2781152364620771000,
"line_mean": 19.7189189189,
"line_max": 78,
"alpha_frac": 0.5358726846,
"autogenerated": false,
"ratio": 3.7615309126594703,
... |
from flufl import enum
from magickpy.util import wrap_enum_class
__all__ = [
'CompositeOp',
'VirtualPixelMethod',
'ChannelType',
'FilterTypes',
'ColorspaceType',
'MetricType',
'DitherMethod',
]
class CompositeOp(enum.Enum):
Undefined = 0
No = 1
Add = 2
Atop = 3
Blen... | {
"repo_name": "tailhook/magickpy",
"path": "magickpy/enums.py",
"copies": "1",
"size": "3437",
"license": "mit",
"hash": -5745890282783465000,
"line_mean": 17.781420765,
"line_max": 72,
"alpha_frac": 0.6144893803,
"autogenerated": false,
"ratio": 3.1942379182156135,
"config_test": false,
"has... |
# from FluGibson.nucleotide_converter import NucleotideConverter
# from collections import defaultdict
# from Levenshtein import distance
# import os
# # Get the directory of this test file.
# package_directory = os.path.dirname(os.path.abspath(__file__))
# os.chdir(os.path.join(package_directory, 'test_data'))
# nc ... | {
"repo_name": "ericmjl/flu-gibson",
"path": "tests/test_nucleotide_converter.py",
"copies": "1",
"size": "1599",
"license": "mit",
"hash": 6504843594696653000,
"line_mean": 30.3529411765,
"line_max": 74,
"alpha_frac": 0.6547842402,
"autogenerated": false,
"ratio": 2.9611111111111112,
"config_te... |
#from fluids import *
from fluids.numerics import IS_PYPY
from fluids.constants import *
#IS_PYPY = True
if not IS_PYPY:
import fluids.numba
import numba
from datetime import datetime
import numpy as np
import pytz
import inspect
def also_numba(f):
if not IS_PYPY:
f.duplicate_with_numba = True
... | {
"repo_name": "CalebBell/fluids",
"path": "benchmarks/benchmarks.py",
"copies": "1",
"size": "32617",
"license": "mit",
"hash": 543850745612049900,
"line_mean": 42.4260985353,
"line_max": 282,
"alpha_frac": 0.66108607,
"autogenerated": false,
"ratio": 2.451552281440277,
"config_test": false,
... |
from fluids.numerics import IS_PYPY
import thermo
if not IS_PYPY:
import thermo.numba
import numba
from datetime import datetime
import pytz
from thermo import UNIQUAC
import numpy as np
from random import random
from fluids.numerics import normalize
from thermo.eos_mix import *
class BaseTimeSuite(object):
... | {
"repo_name": "CalebBell/thermo",
"path": "benchmarks/benchmarks.py",
"copies": "1",
"size": "9833",
"license": "mit",
"hash": -2461979498499854000,
"line_mean": 35.1507352941,
"line_max": 126,
"alpha_frac": 0.5721549883,
"autogenerated": false,
"ratio": 2.3552095808383235,
"config_test": false... |
from flup.server.fcgi import WSGIServer
import calendar
import urlparse
import time
import json
import norse
import os.path
import threading
import Queue
req_queue = Queue.Queue(10000)
res_queue = Queue.Queue(10000)
NUM_REQ_THREADS = 20
auther = None
beg = ""
end = ""
http_codes = {
'404': '404 Not Found',
... | {
"repo_name": "jcline/griddlr",
"path": "server_interface.py",
"copies": "1",
"size": "5055",
"license": "bsd-3-clause",
"hash": -3014470684829209000,
"line_mean": 23.4202898551,
"line_max": 224,
"alpha_frac": 0.64371909,
"autogenerated": false,
"ratio": 2.8575466365178066,
"config_test": false... |
from flurry import Flurry
from flurry.ttypes import *
from flurry.constants import *
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
import time
import urllib
import json
class FlurryClient(object):
"""docstring for ... | {
"repo_name": "anaerobic/flurry",
"path": "examples/python/client.py",
"copies": "1",
"size": "2822",
"license": "apache-2.0",
"hash": -8131501133765237000,
"line_mean": 26.6666666667,
"line_max": 75,
"alpha_frac": 0.6236711552,
"autogenerated": false,
"ratio": 3.3356973995271866,
"config_test"... |
from fluxgui import xfluxcontroller
class FluxController(xfluxcontroller.XfluxController):
"""
FluxController is the same as XfluxController except that it
requires a Settings instance and updates that instance when
relevant controller calls are made.
"""
def __init__(self, settings):
s... | {
"repo_name": "TyrusChin/f.lux-indicator-applet",
"path": "src/fluxgui/fluxcontroller.py",
"copies": "7",
"size": "1549",
"license": "mit",
"hash": 7246472543485324000,
"line_mean": 33.4222222222,
"line_max": 80,
"alpha_frac": 0.6726920594,
"autogenerated": false,
"ratio": 3.7872860635696823,
"... |
from fluxgui import xfluxcontroller
class FluxController(xfluxcontroller.XfluxController):
"""
FluxController is the same as XfluxController except that it
requires a Settings instance and updates that instance when
relevant controller calls are made.
"""
def __init__(self, settings):
... | {
"repo_name": "xflux-gui/xflux-gui",
"path": "src/fluxgui/fluxcontroller.py",
"copies": "1",
"size": "1546",
"license": "mit",
"hash": 8675623621921043000,
"line_mean": 34.1363636364,
"line_max": 80,
"alpha_frac": 0.6739974127,
"autogenerated": false,
"ratio": 3.779951100244499,
"config_test": ... |
from .flvconcat import FLVTagConcatIO
from .stream import Stream
from ..exceptions import StreamError
import logging
__all__ = ["Playlist", "FLVPlaylist"]
log = logging.getLogger(__name__)
class Playlist(Stream):
"""Abstract base class for playlist type streams."""
__shortname__ = "playlist"
def __init... | {
"repo_name": "back-to/streamlink",
"path": "src/streamlink/stream/playlist.py",
"copies": "6",
"size": "2029",
"license": "bsd-2-clause",
"hash": 5484631238836774000,
"line_mean": 26.4189189189,
"line_max": 66,
"alpha_frac": 0.5515032035,
"autogenerated": false,
"ratio": 4.420479302832244,
"co... |
from .flvconcat import FLVTagConcatIO
from .stream import Stream
from ..exceptions import StreamError
__all__ = ["Playlist", "FLVPlaylist"]
class Playlist(Stream):
"""Abstract base class for playlist type streams."""
__shortname__ = "playlist"
def __init__(self, session, streams, duration=None):
... | {
"repo_name": "hmit/livestreamer",
"path": "src/livestreamer/stream/playlist.py",
"copies": "37",
"size": "1996",
"license": "bsd-2-clause",
"hash": -6710808766301884000,
"line_mean": 26.7222222222,
"line_max": 72,
"alpha_frac": 0.5495991984,
"autogenerated": false,
"ratio": 4.425720620842572,
... |
from .flvconcat import FLVTagConcatIO
from .stream import Stream
from ..exceptions import StreamError
__all__ = ["Playlist", "FLVPlaylist"]
class Playlist(Stream):
"""Abstract base class for playlist type streams."""
__shortname__ = "playlist"
def __init__(self, session, streams, duration=None):
... | {
"repo_name": "mmetak/streamlink",
"path": "src/streamlink/stream/playlist.py",
"copies": "1",
"size": "1996",
"license": "bsd-2-clause",
"hash": 5625631297907372000,
"line_mean": 26.7222222222,
"line_max": 72,
"alpha_frac": 0.5495991984,
"autogenerated": false,
"ratio": 4.425720620842572,
"con... |
from flyby.service import Service
from flyby.haproxy import Haproxy
import flask
app = flask.Flask(__name__)
@app.route("/")
def home():
return "Hello flyby!"
@app.route("/service", methods=['POST'])
def register_service():
data = Service.register_service(flask.request.get_json(force=True))
return fla... | {
"repo_name": "Skyscanner/flyby",
"path": "flyby/server.py",
"copies": "1",
"size": "3984",
"license": "apache-2.0",
"hash": 61082872595377736,
"line_mean": 33.0512820513,
"line_max": 112,
"alpha_frac": 0.6754518072,
"autogenerated": false,
"ratio": 3.8642095053346264,
"config_test": false,
"... |
from flyby.utils import ValidHost, ValidHostWithPort
from validator import Required, Pattern
from validator import Length
from validator import Range
from validator import validate
from flyby.models import ServiceModel
from flyby.models import BackendModel
from flyby.models import ResolverModel
from flyby.models import... | {
"repo_name": "Skyscanner/flyby",
"path": "flyby/service.py",
"copies": "1",
"size": "8816",
"license": "apache-2.0",
"hash": -5803681951492186000,
"line_mean": 34.6923076923,
"line_max": 107,
"alpha_frac": 0.5968693285,
"autogenerated": false,
"ratio": 4.450277637556789,
"config_test": false,
... |
from flybywire.dom import h
def test_dom():
count = 0
node1 = h('div', str(count),
style = {
'textAlign': 'center',
'lineHeight': str(100 + count) + 'px',
'border': '1px solid red',
'width': str(100 + count) + 'px',
'height': str(100 + count) +... | {
"repo_name": "thomasantony/flybywire",
"path": "test/test_dom.py",
"copies": "1",
"size": "2714",
"license": "mit",
"hash": 1726283718136471800,
"line_mean": 38.3333333333,
"line_max": 85,
"alpha_frac": 0.3529845247,
"autogenerated": false,
"ratio": 3.4354430379746836,
"config_test": false,
... |
from flybywire.ui import Application, Component
from flybywire.dom import h
import asyncio
def TodoItem(item):
return h('div', str(item))
def NewTodoItem(onAddItem=None):
def handleKeyDown(event):
text = event['target']['value']
which = event.get('which', '0')
if int(which) == 13 and l... | {
"repo_name": "thomasantony/flybywire",
"path": "examples/simpletodo.py",
"copies": "1",
"size": "1231",
"license": "mit",
"hash": -8917071368522050000,
"line_mean": 27.6279069767,
"line_max": 75,
"alpha_frac": 0.5450852965,
"autogenerated": false,
"ratio": 3.6205882352941177,
"config_test": fa... |
from flyingpigeon import config
from os.path import join, abspath, dirname, getsize
DIR_SHP = config.shapefiles_dir()
import logging
logger = logging.getLogger(__name__)
def call(resource=[], variable=None, dimension_map=None, calc=None,
calc_grouping= None, conform_units_to=None, memory_limit=None, prefix=None... | {
"repo_name": "sradanov/flyingpigeon",
"path": "flyingpigeon/ocgis_module.py",
"copies": "1",
"size": "5228",
"license": "apache-2.0",
"hash": 3310350315197864400,
"line_mean": 36.0780141844,
"line_max": 139,
"alpha_frac": 0.6711935731,
"autogenerated": false,
"ratio": 3.623007623007623,
"confi... |
from flyingpigeon import dissimilarity as dd
import numpy as np
from ocgis.util.helpers import iter_array
from ocgis.calc.base import AbstractParameterizedFunction, AbstractFieldFunction
from ocgis.collection.field import Field
from ocgis.constants import NAME_DIMENSION_TEMPORAL
metrics = dd.__all__
# NOTE: This code... | {
"repo_name": "bird-house/flyingpigeon",
"path": "flyingpigeon/ocgisDissimilarity.py",
"copies": "1",
"size": "4004",
"license": "apache-2.0",
"hash": 1856226223590116400,
"line_mean": 37.1333333333,
"line_max": 96,
"alpha_frac": 0.5966533467,
"autogenerated": false,
"ratio": 4.3474484256243215,
... |
from flyingpigeon import ensembleRobustness as erob
from pywps.Process import WPSProcess
import logging
class EnsembleRobustnessProcess(WPSProcess):
def __init__(self):
# definition of this process
WPSProcess.__init__(self,
identifier = "ensembleRobustness",
title="Calcula... | {
"repo_name": "sradanov/flyingpigeon",
"path": "flyingpigeon/processes/wps_ensemble_robustness.py",
"copies": "1",
"size": "4972",
"license": "apache-2.0",
"hash": 6784542172170458000,
"line_mean": 35.0289855072,
"line_max": 168,
"alpha_frac": 0.5766291231,
"autogenerated": false,
"ratio": 4.3575... |
from flyingpigeon import robustness as erob
from flyingpigeon.log import init_process_logger
from pywps.Process import WPSProcess
import logging
class robustnessProcess(WPSProcess):
def __init__(self):
# definition of this process
WPSProcess.__init__(
self,
identifier="rob... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/processes/wps_robustness.py",
"copies": "1",
"size": "5922",
"license": "apache-2.0",
"hash": -2813654387029823500,
"line_mean": 34.0414201183,
"line_max": 118,
"alpha_frac": 0.5717662952,
"autogenerated": false,
"ratio": 4.37370753323485... |
from flyingpigeon import utils
from flyingpigeon.ocgis_module import call
from tempfile import mkstemp
import logging
logger = logging.getLogger(__name__)
_TIMEREGIONS_ = {'JJA': {'month': [6, 7, 8]},
'SON': {'month': [9, 10, 11]},
'OND': {'month': [10, 11, 12]},
'D... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/weatherregimes.py",
"copies": "1",
"size": "4058",
"license": "apache-2.0",
"hash": 138115163801289140,
"line_mean": 35.5585585586,
"line_max": 99,
"alpha_frac": 0.5229176934,
"autogenerated": false,
"ratio": 3.556529360210342,
"config_... |
from flyingpigeon import utils
import logging
logger = logging.getLogger(__name__)
_PRESSUREDATA_ = [
'NCEP_slp', 'NCEP_z1000', 'NCEP_z925', 'NCEP_z850', 'NCEP_z700', 'NCEP_z600', 'NCEP_z500', 'NCEP_z400', 'NCEP_z300',
'NCEP_z250', 'NCEP_z200', 'NCEP_z150', 'NCEP_z100', 'NCEP_z70', 'NCEP_z50', 'NCEP_z30', 'N... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/datafetch.py",
"copies": "1",
"size": "5240",
"license": "apache-2.0",
"hash": 3323685715156793000,
"line_mean": 39.9375,
"line_max": 150,
"alpha_frac": 0.5719465649,
"autogenerated": false,
"ratio": 2.880703683342496,
"config_test": fa... |
from flyingpigeon import visualisation as vs
from pywps.Process import WPSProcess
from flyingpigeon.log import init_process_logger
import logging
logger = logging.getLogger(__name__)
class plottimeseriesProcess(WPSProcess):
def __init__(self):
# definition of this process
WPSProcess.__init__(
... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/processes/wps_plot_timeseries.py",
"copies": "1",
"size": "4145",
"license": "apache-2.0",
"hash": -7527426437394819000,
"line_mean": 36.0089285714,
"line_max": 105,
"alpha_frac": 0.5203860072,
"autogenerated": false,
"ratio": 4.580110497... |
from flyingpigeon import visualisation as vs
from pywps.Process import WPSProcess
class VisualisationProcess(WPSProcess):
def __init__(self):
# definition of this process
WPSProcess.__init__(self,
identifier = "visualisation",
title="Visualisation of netcdf files",
... | {
"repo_name": "sradanov/flyingpigeon",
"path": "flyingpigeon/processes/wps_visualisation.py",
"copies": "1",
"size": "2787",
"license": "apache-2.0",
"hash": -968800051923366000,
"line_mean": 36.6621621622,
"line_max": 107,
"alpha_frac": 0.5776820954,
"autogenerated": false,
"ratio": 4.1166912850... |
from flyingpigeon.nc_utils import get_values, get_coordinates, get_index_lat, get_variable
from os.path import basename, join
from datetime import datetime as dt
from shutil import copyfile
from netCDF4 import Dataset
import numpy as np
import logging
LOGGER = logging.getLogger("PYWPS")
def fieldmean(resource):
... | {
"repo_name": "bird-house/flyingpigeon",
"path": "flyingpigeon/nc_statistic.py",
"copies": "1",
"size": "10385",
"license": "apache-2.0",
"hash": -8700341959301272000,
"line_mean": 34.6872852234,
"line_max": 118,
"alpha_frac": 0.5968223399,
"autogenerated": false,
"ratio": 3.2402496099843994,
"... |
from flyingpigeon.ocg_utils import call, get_variable
from flyingpigeon.nc_utils import sort_by_filename
from ocgis import env, ShpCabinetIterator, ShpCabinet
from flyingpigeon.config import Paths
import flyingpigeon as fp
import logging
LOGGER = logging.getLogger("PYWPS")
paths = Paths(fp)
env.DIR_SHPCABINET = pat... | {
"repo_name": "bird-house/flyingpigeon",
"path": "flyingpigeon/subset.py",
"copies": "1",
"size": "12965",
"license": "apache-2.0",
"hash": 6068139597591153000,
"line_mean": 37.0205278592,
"line_max": 120,
"alpha_frac": 0.5722329348,
"autogenerated": false,
"ratio": 3.665535764772406,
"config_t... |
from flyingpigeon.timeAggregation import aggregatTime
from pywps.Process import WPSProcess
import logging
class TimeAggregationProcess(WPSProcess):
def __init__(self):
WPSProcess.__init__(self,
identifier = "time_aggregation",
title="aggregate the time frequency",
ver... | {
"repo_name": "sradanov/flyingpigeon",
"path": "flyingpigeon/processes/wps_time_aggregation.py",
"copies": "1",
"size": "2395",
"license": "apache-2.0",
"hash": 8176929065549152000,
"line_mean": 32.2638888889,
"line_max": 101,
"alpha_frac": 0.5498956159,
"autogenerated": false,
"ratio": 4.7519841... |
from flyingpigeon.utils import sort_by_filename
from pywps.Process import WPSProcess
import logging
logger = logging.getLogger(__name__)
class SubsetPointsProcess(WPSProcess):
def __init__(self):
WPSProcess.__init__(
self,
identifier="subset_points",
title="Subset Poi... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/processes/wps_subset_points.py",
"copies": "1",
"size": "3892",
"license": "apache-2.0",
"hash": -1873001980348168000,
"line_mean": 37.1568627451,
"line_max": 104,
"alpha_frac": 0.5215827338,
"autogenerated": false,
"ratio": 4.11851851851... |
from flyingpigeon.visualisation import map_ensembleRobustness
from flyingpigeon.utils import get_variable
from flyingpigeon.utils import sort_by_filename
from flyingpigeon.utils import get_time
import logging
logger = logging.getLogger(__name__)
def method_A(resource=[], start=None, end=None, timeslice=20,
... | {
"repo_name": "KatiRG/flyingpigeon",
"path": "flyingpigeon/robustness.py",
"copies": "1",
"size": "7548",
"license": "apache-2.0",
"hash": 3424454970416197000,
"line_mean": 38.1088082902,
"line_max": 119,
"alpha_frac": 0.5943296237,
"autogenerated": false,
"ratio": 3.852986217457887,
"config_te... |
from flyingpigeon.visualisation import map_ensembleRobustness
from flyingpigeon.utils import get_variable
from flyingpigeon.utils import sort_by_filename
from flyingpigeon.utils import get_time
import logging
logger = logging.getLogger(__name__)
def worker(resource=[], start=None, end=None, timeslice=20,
vari... | {
"repo_name": "sradanov/flyingpigeon",
"path": "flyingpigeon/ensembleRobustness.py",
"copies": "1",
"size": "6739",
"license": "apache-2.0",
"hash": -286494005564565470,
"line_mean": 35.427027027,
"line_max": 131,
"alpha_frac": 0.6607805312,
"autogenerated": false,
"ratio": 3.438265306122449,
"... |
from flying_robots.chars import gameclass
from flying_robots.grid import GameGrid
from flying_robots.exceptions import BadTileError, LevelComplete, GameOver
from flying_robots.config import get_config, calc_enemies
class Game:
def __init__(self, config):
self.start_level = config['game'].getint('start_lev... | {
"repo_name": "bunburya/FlyingRobots",
"path": "flying_robots/game.py",
"copies": "1",
"size": "2985",
"license": "mit",
"hash": -3579616806960747000,
"line_mean": 31.0967741935,
"line_max": 75,
"alpha_frac": 0.5912897822,
"autogenerated": false,
"ratio": 3.667076167076167,
"config_test": true,... |
from flyrc import message, util
import base64
import re
class Ping(object):
def irc_PING(self, client, msg):
client.send(message.pong(msg.args[0]))
class AutoJoin(object):
def __init__(self, *args):
self.channels = args
def irc_RPL_WELCOME(self, client, msg):
for channel in self.channels:
client.send(mes... | {
"repo_name": "mrflea/flyrc",
"path": "flyrc/handler.py",
"copies": "1",
"size": "8575",
"license": "mit",
"hash": -4965357241529143000,
"line_mean": 29.625,
"line_max": 103,
"alpha_frac": 0.6827988338,
"autogenerated": false,
"ratio": 2.929620772121626,
"config_test": false,
"has_no_keywords... |
from flyrc import util
import time
class InfoTracker(object):
"""This is half-implemented, you probably shouldn't use it."""
def irc_client_load(self, client):
client.users = {}
client.channels = {}
client.infotracker_pwcstash = {}
def irc_client_unload(self, client):
del client.users
del client.channels... | {
"repo_name": "mrflea/flyrc",
"path": "flyrc/infotracker.py",
"copies": "1",
"size": "4645",
"license": "mit",
"hash": -8519595571374097000,
"line_mean": 28.3987341772,
"line_max": 70,
"alpha_frac": 0.669752422,
"autogenerated": false,
"ratio": 2.9013116801998753,
"config_test": false,
"has_n... |
from fmanalyser.utils.conf import ConfigSection
import os.path
from unittest2 import TestCase as BaseTestCase
from .. import conf
from nose.plugins.skip import SkipTest
from fmanalyser.client import P175
class TestCase(BaseTestCase):
@classmethod
def setUpClass(cls):
# cls._orig_inifile = conf.CONF... | {
"repo_name": "gaftech/fmanalyser",
"path": "fmanalyser/test/__init__.py",
"copies": "1",
"size": "1437",
"license": "mit",
"hash": -8736094132632354000,
"line_mean": 24.2280701754,
"line_max": 69,
"alpha_frac": 0.6096033403,
"autogenerated": false,
"ratio": 3.9696132596685083,
"config_test": t... |
from fman import DirectoryPaneCommand, show_alert
from fman.url import as_human_readable, as_url
import os.path
from fman.fs import copy
class DuplicateFileDir(DirectoryPaneCommand):
def __call__(self):
selected_files = self.pane.get_selected_files()
if len(selected_files) >= 1 or (len(sele... | {
"repo_name": "raguay/DuplicateFileDir",
"path": "duplicatefiledir/__init__.py",
"copies": "1",
"size": "1570",
"license": "mit",
"hash": 4865054724143870000,
"line_mean": 44.1764705882,
"line_max": 94,
"alpha_frac": 0.4872611465,
"autogenerated": false,
"ratio": 4.301369863013699,
"config_test... |
from fmapi.calculate import sigfigs
def length(value, from_unit='m', to_unit='m', power=1, figures=8):
answer = value * {
'ft': {'ft': 1.0000, 'in': 12.0000, 'm': 0.3048, 'cm': 30.4800, 'mm': 304.8000, },
'in': {'ft': 0.0833, 'in': 1.0000, 'm': 0.0254, 'cm': 2.5400, 'mm': 25.4000, },
'm': {'ft... | {
"repo_name": "briancohan/fmapi",
"path": "fmapi/calculate/convert.py",
"copies": "1",
"size": "2167",
"license": "mit",
"hash": 901457655511982600,
"line_mean": 29.9714285714,
"line_max": 88,
"alpha_frac": 0.4107060452,
"autogenerated": false,
"ratio": 2.7189460476787954,
"config_test": false,... |
from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging
class AccessPolicies(APIClassTemplate):
"""
The AccessPolicies Object in the FMC.
"""
VALID_JSON_DATA = ["id", "name", "type", "description", "defaultAction"]
VALID_FOR_KWARGS = VALID_JSON_DATA + []
VALID_CHARACTE... | {
"repo_name": "daxm/fmcapi",
"path": "fmcapi/api_objects/policy_services/accesspolicies.py",
"copies": "1",
"size": "1526",
"license": "bsd-3-clause",
"hash": 7263653959094137000,
"line_mean": 30.1428571429,
"line_max": 103,
"alpha_frac": 0.6002621232,
"autogenerated": false,
"ratio": 3.843828715... |
from fmodpy.parsing import FORT_TEXT_REPLACEMENTS, FORT_TEXT_FIXES
# Short functions.
# identifying the strings before and after the last "."
def before_dot(name): return name[:len(name) - 1 - name[::-1].find(".")];
def after_dot(name): return name[min(-name[::-1].find("."),0):]
# getting the class name of somethi... | {
"repo_name": "tchlux/fmodpy",
"path": "fmodpy/parsing/util.py",
"copies": "1",
"size": "6812",
"license": "mit",
"hash": -5840886068079935000,
"line_mean": 48.7226277372,
"line_max": 87,
"alpha_frac": 0.5585731063,
"autogenerated": false,
"ratio": 3.9398496240601504,
"config_test": false,
"h... |
from fnexchange.core.plugins import AbstractPlugin
class GreetingsPlugin(AbstractPlugin):
"""
GreetingsPlugin provides an interface to generate greetings in different languages
for given users (provided their names and locales).
At this time, only the following locales are supported: "en-us", "hi-in"
... | {
"repo_name": "dnif/fnExchange-sample-plugin",
"path": "greetings.py",
"copies": "1",
"size": "1706",
"license": "apache-2.0",
"hash": 1226073317447735000,
"line_mean": 28.9298245614,
"line_max": 90,
"alpha_frac": 0.5750293083,
"autogenerated": false,
"ratio": 3.4959016393442623,
"config_test":... |
from fn import Stream
from fn.uniform import reduce
from fn.iters import takewhile
class Vector(object):
"""A vector is a collection of values indexed by contiguous integers.
Based on Philip Bagwell's "Array Mapped Trie" and Rick Hickey's
"Bitmapped Vector Trie". As well as Clojure variant it supports acc... | {
"repo_name": "FunctionalX/FunctionalX.py",
"path": "FunctionalX/src/fn/immutable/trie.py",
"copies": "2",
"size": "6423",
"license": "mit",
"hash": 3169593275600345600,
"line_mean": 33.164893617,
"line_max": 95,
"alpha_frac": 0.5428927293,
"autogenerated": false,
"ratio": 3.588268156424581,
"c... |
from fn.iters import partition, nth
from fn import F
from functools import partial
from collections import defaultdict, namedtuple
from itertools import repeat, izip, ifilterfalse, imap, ifilter
import requests
import grequests
import re
import urlparse
import logging
import logging.config
logging.config.fileConfi... | {
"repo_name": "signalpillar/crawler",
"path": "crawler/collector.py",
"copies": "1",
"size": "6717",
"license": "mit",
"hash": 5396917364697224000,
"line_mean": 31.2932692308,
"line_max": 79,
"alpha_frac": 0.6310853059,
"autogenerated": false,
"ratio": 3.4947970863683664,
"config_test": false,
... |
from fnmatch import filter as fn_filter
from os import walk, path
import hashlib
from utils import detect_mimetype
from github import GithubAPIManager
from languages import *
class Pygemony(object):
"""
The main driver of pygemony, pulls the seperate pieces together.
"""
def __init__(self, user=None,... | {
"repo_name": "GrappigPanda/pygemony",
"path": "pyg/Pygemony.py",
"copies": "1",
"size": "6551",
"license": "mit",
"hash": -1270175085463570700,
"line_mean": 34.4108108108,
"line_max": 85,
"alpha_frac": 0.5736528774,
"autogenerated": false,
"ratio": 4.318391562294002,
"config_test": false,
"h... |
from fnmatch import filter as fnfilter
import os
import json
import requests
import logging
def spotlight_json(path):
for root, dirnames, filenames in os.walk(path):
for filename in fnfilter(filenames, '*.json'):
with open(os.path.join(root, filename)) as jsonfile:
yield (filen... | {
"repo_name": "alphagov/stagecraft",
"path": "stagecraft/apps/dashboards/lib/spotlight_config_migration.py",
"copies": "1",
"size": "8864",
"license": "mit",
"hash": -6015307662553416000,
"line_mean": 34.456,
"line_max": 79,
"alpha_frac": 0.5339575812,
"autogenerated": false,
"ratio": 4.198957839... |
from fnmatch import fnmatch as fnm
from validator.constants import (FF4_MIN, FIREFOX_GUID, FENNEC_GUID,
THUNDERBIRD_GUID as TB_GUID, ANDROID_GUID,
PACKAGE_DICTIONARY, )
import validator.decorator as decorator
from validator.decorator import version_rang... | {
"repo_name": "mattbasta/amo-validator",
"path": "validator/testcases/packagelayout.py",
"copies": "1",
"size": "14788",
"license": "bsd-3-clause",
"hash": 4940020877883716000,
"line_mean": 38.752688172,
"line_max": 80,
"alpha_frac": 0.5455098729,
"autogenerated": false,
"ratio": 4.38162962962962... |
from fnmatch import fnmatchcase
from trac.config import Option
from trac.core import *
from trac.perm import IPermissionPolicy
revision = "$Rev$"
url = "$URL$"
class PublicWikiPolicy(Component):
"""Allow public access to some wiki pages.
This is a sample permission policy plugin illustrating how to check
... | {
"repo_name": "moreati/trac-gitsvn",
"path": "sample-plugins/permissions/public_wiki_policy.py",
"copies": "3",
"size": "2136",
"license": "bsd-3-clause",
"hash": -947243798544837000,
"line_mean": 32.9047619048,
"line_max": 79,
"alpha_frac": 0.5889513109,
"autogenerated": false,
"ratio": 4.910344... |
from fnmatch import fnmatchcase
from trac.config import Option
from trac.core import *
from trac.perm import IPermissionPolicy
revision = "$Rev: 11490 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-1.0.1/sample-plugins/permissions/public_wiki_policy.py $"
class PublicWikiPolicy(Component):
"""Allo... | {
"repo_name": "cghr/cghr-chef-repository",
"path": "cookbooks/trac/files/default/plugins-stock/public_wiki_policy.py",
"copies": "1",
"size": "2244",
"license": "apache-2.0",
"hash": -7961224352748076000,
"line_mean": 34.619047619,
"line_max": 116,
"alpha_frac": 0.5989304813,
"autogenerated": false... |
from fnmatch import fnmatchcase
from trac.config import Option
from trac.core import *
from trac.perm import IPermissionPolicy
revision = "$Rev: 11490 $"
url = "$URL: http://svn.edgewall.org/repos/trac/tags/trac-1.0.1/sample-plugins/permissions/public_wiki_policy.py $"
class PublicWikiPolicy(Component):
"""Allow... | {
"repo_name": "apache/bloodhound",
"path": "trac/sample-plugins/permissions/public_wiki_policy.py",
"copies": "2",
"size": "2243",
"license": "apache-2.0",
"hash": 1642054173680034600,
"line_mean": 34.6031746032,
"line_max": 115,
"alpha_frac": 0.5987516719,
"autogenerated": false,
"ratio": 4.7023... |
from fnmatch import fnmatchcase
from trac.config import Option
from trac.core import *
from trac.perm import IPermissionPolicy
revision = "$Rev: 6326 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/permissions/public_wiki_policy.py $"
class PublicWikiPolicy(Component):
"""Allo... | {
"repo_name": "zjj/trac_hack",
"path": "sample-plugins/permissions/public_wiki_policy.py",
"copies": "1",
"size": "2247",
"license": "bsd-3-clause",
"hash": -2287052499385451300,
"line_mean": 34.6666666667,
"line_max": 117,
"alpha_frac": 0.5981308411,
"autogenerated": false,
"ratio": 4.7106918238... |
from fnmatch import fnmatchcase
import sys
from boolean import BooleanAlgebra, AND, OR, NOT, Symbol
from boolean import ParseError, TOKEN_SYMBOL, TOKEN_NOT, TOKEN_AND, TOKEN_OR, TOKEN_LPAR, TOKEN_RPAR
from boolean.boolean import PARSE_UNKNOWN_TOKEN
from wildpath.tools import dedoubled
class WildSymbol(Symbol):
... | {
"repo_name": "gemerden/wildpath",
"path": "wildpath/keyparser.py",
"copies": "1",
"size": "4231",
"license": "mit",
"hash": -621270590476848100,
"line_mean": 30.5746268657,
"line_max": 113,
"alpha_frac": 0.5386433467,
"autogenerated": false,
"ratio": 4.156188605108055,
"config_test": false,
... |
from fnmatch import fnmatchcase
class Folder(object):
def __init__(self, name, services, logger, options={}):
self.name = name
self.services = services
self.logger = logger
self.options = options
def __str__(self):
return self.name
def __repr__(self):
retu... | {
"repo_name": "onitu/onitu",
"path": "onitu/referee/folder.py",
"copies": "1",
"size": "5495",
"license": "mit",
"hash": 4338570582838796000,
"line_mean": 28.2287234043,
"line_max": 79,
"alpha_frac": 0.4988171065,
"autogenerated": false,
"ratio": 4.330181245074862,
"config_test": false,
"has_... |
from fnmatch import fnmatch
from _abcoll import MutableMapping
from weakref import proxy as _proxy
import os
import shutil
import hashlib
def walk_ignore(path):
"Custom walker that ignores specific filenames"
ignores = ('.*', '*~', '#*', '_*',)
for dirpath, dirnames, filenames in os.walk(path):
for... | {
"repo_name": "arthurk/pyll",
"path": "src/pyll/utils.py",
"copies": "2",
"size": "6873",
"license": "bsd-3-clause",
"hash": -7019671841460911000,
"line_mean": 33.8883248731,
"line_max": 86,
"alpha_frac": 0.5736941656,
"autogenerated": false,
"ratio": 4.237361282367448,
"config_test": false,
... |
from fnmatch import fnmatch
from functools import reduce
import os
import unicodedata
__all__ = ("make_matcher", "make_filter", )
def _normalize_str(text, form="NFD"):
"""Normalize unicode text. Uses the NFD algorithm by default."""
return unicodedata.normalize(form, text)
def _fullmatch(path, pattern):
... | {
"repo_name": "lucuma/Clay",
"path": "clay/utils/make_matcher.py",
"copies": "1",
"size": "1388",
"license": "apache-2.0",
"hash": -4383094887842646500,
"line_mean": 25.6730769231,
"line_max": 78,
"alpha_frac": 0.6856524874,
"autogenerated": false,
"ratio": 3.940340909090909,
"config_test": fal... |
from fnmatch import fnmatch
from glob import glob
import os
import uuid
from warnings import warn
import pandas as pd
from tlz import merge
# this import checks for the importability of fsspec
from ...bytes import read_bytes # noqa
from fsspec.utils import build_name_function, stringify_path
from .io import _link
f... | {
"repo_name": "ContinuumIO/dask",
"path": "dask/dataframe/io/hdf.py",
"copies": "2",
"size": "17363",
"license": "bsd-3-clause",
"hash": -5664773796238674000,
"line_mean": 31.1537037037,
"line_max": 88,
"alpha_frac": 0.5746126821,
"autogenerated": false,
"ratio": 4.10181904086936,
"config_test"... |
from fnmatch import fnmatch
from itertools import chain
from zipfile import ZipFile
from zipfile import ZIP_DEFLATED
import argparse
import glob
import json
import os
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(THIS_DIR)
RESERVED = ['manifest.json', 'dist']
parser = argparse... | {
"repo_name": "wbcustc/Vintageous",
"path": "bin/builder.py",
"copies": "8",
"size": "1751",
"license": "mit",
"hash": -3479654796141295600,
"line_mean": 27.7049180328,
"line_max": 72,
"alpha_frac": 0.6236436322,
"autogenerated": false,
"ratio": 3.6631799163179917,
"config_test": false,
"has_... |
from fnmatch import fnmatch
from lib.plugins import Inspector
from lib.util import ByteSize
"""
Description:
DiskSpace executes `df` to discover how much diskspace is remaining
Constructor:
device: The unix device (eg /dev/sda) to examine for disk space (Default: None)
mount: The mount point to examine (Default: /... | {
"repo_name": "zix99/sshsysmon",
"path": "sshsysmon/inspectors/disk.py",
"copies": "1",
"size": "1584",
"license": "mit",
"hash": 4993532629249385000,
"line_mean": 26.3275862069,
"line_max": 163,
"alpha_frac": 0.6755050505,
"autogenerated": false,
"ratio": 3.2459016393442623,
"config_test": fal... |
from fnmatch import fnmatch
from os import listdir
from unittest import TestCase
from pylegos.core import FileUtils
class TestFileUtils(TestCase):
Sut = FileUtils()
def test_pathUtils(self):
pd = self.Sut.getParentDir(filePath=__file__)
self.assertEqual('/Users/gchristiansen/projects/pyLeg... | {
"repo_name": "velexio/pyLegos",
"path": "tests/test_FileUtils.py",
"copies": "1",
"size": "2450",
"license": "mit",
"hash": 806175328200944400,
"line_mean": 48,
"line_max": 176,
"alpha_frac": 0.693877551,
"autogenerated": false,
"ratio": 3.5353535353535355,
"config_test": true,
"has_no_keywo... |
from fnmatch import fnmatch
from os.path import splitext, split, relpath
from lanyon.utils import OrderedDict
registry = OrderedDict()
def get_url(page):
"Returns the final output url string for `page`"
urlfunc = get_url_func(page)
url = urlfunc(page)
return url
def get_url_func(page):
"""
Re... | {
"repo_name": "arthurk/lanyon",
"path": "src/lanyon/url.py",
"copies": "1",
"size": "1908",
"license": "bsd-3-clause",
"hash": 8879302437298703000,
"line_mean": 28.8125,
"line_max": 70,
"alpha_frac": 0.5953878407,
"autogenerated": false,
"ratio": 4.211920529801325,
"config_test": false,
"has_... |
from fnmatch import fnmatch
from os.path import splitext, split, relpath
from pyll.utils import OrderedDict
registry = OrderedDict()
def get_url(page):
"Returns the final output url string for `page`"
urlfunc = get_url_func(page)
url = urlfunc(page)
return url
def get_url_func(page):
"""
Retu... | {
"repo_name": "arthurk/pyll",
"path": "src/pyll/url.py",
"copies": "1",
"size": "1906",
"license": "bsd-3-clause",
"hash": 1621540442694971400,
"line_mean": 28.78125,
"line_max": 70,
"alpha_frac": 0.5949632739,
"autogenerated": false,
"ratio": 4.216814159292035,
"config_test": false,
"has_no_... |
from fnmatch import fnmatch
from pprint import pprint
from link_report import link_report_settings
import requests
import time
from urllib import unquote_plus
from django.utils.dateparse import parse_datetime
from .models import Sentry404Event, Sentry404Issue, IgnoredUrl
from .ignore_urls import IGNORE_URLS
ACCEPT_U... | {
"repo_name": "DjangoAdminHackers/django-link-report",
"path": "link_report/utils.py",
"copies": "1",
"size": "8676",
"license": "mit",
"hash": 3740761695323634000,
"line_mean": 38.257918552,
"line_max": 126,
"alpha_frac": 0.5244352236,
"autogenerated": false,
"ratio": 4.236328125,
"config_test... |
from fnmatch import fnmatch
from shelf import artifact_key_filter
from shelf.error_code import ErrorCode
class PermissionsValidator(object):
REQUIRES_WRITE = ["POST", "PUT", "DELETE"]
REQUIRES_READ = ["GET", "HEAD"]
def __init__(self, container):
self.container = container
self._permissio... | {
"repo_name": "kyle-long/pyshelf",
"path": "shelf/permissions_validator.py",
"copies": "2",
"size": "3526",
"license": "mit",
"hash": -9200356919303258000,
"line_mean": 37.3260869565,
"line_max": 117,
"alpha_frac": 0.5992626205,
"autogenerated": false,
"ratio": 5.0085227272727275,
"config_test"... |
from fnmatch import fnmatch
from syn.base import Attr, create_hook
from .dependency import Dependency, command, output
from .operation import Idempotent, Combinable
from .relation import Eq, Le
#-------------------------------------------------------------------------------
# Apt Operations
#-------------------------... | {
"repo_name": "mbodenhamer/depman",
"path": "depman/apt.py",
"copies": "1",
"size": "2375",
"license": "mit",
"hash": 6689558405271720000,
"line_mean": 25.9886363636,
"line_max": 80,
"alpha_frac": 0.4269473684,
"autogenerated": false,
"ratio": 4.6568627450980395,
"config_test": false,
"has_no... |
from fnmatch import fnmatch
from time import sleep
import subprocess
import random as rand
from utils import *
import utils
name = "admin"
cmds = ["join", "part", "nick", "quit", "raw", ">>", ">", "op", "deop",
"voice", "devoice", "ban", "kban", "unban", "sop", "sdeop",
"svoice", "sdevoice", "squiet",... | {
"repo_name": "devzero-xyz/Andromeda",
"path": "plugins/admin.py",
"copies": "1",
"size": "32853",
"license": "mit",
"hash": 6126204426722876000,
"line_mean": 33.0445595855,
"line_max": 138,
"alpha_frac": 0.4850089794,
"autogenerated": false,
"ratio": 4.0449396700320115,
"config_test": false,
... |
from fnmatch import fnmatch
from urlobject import URLObject
from django import template
from django.template import TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils.six import string_types
from django.utils.translation import ugettext as _
from django.utils.text import get_text... | {
"repo_name": "jezdez-archive/django-sorter",
"path": "sorter/templatetags/sorter_tags.py",
"copies": "2",
"size": "7200",
"license": "bsd-3-clause",
"hash": -3154402703038091300,
"line_mean": 32.1797235023,
"line_max": 122,
"alpha_frac": 0.6077777778,
"autogenerated": false,
"ratio": 3.960396039... |
from fnmatch import fnmatch
from zipfile import ZipFile
from tarfile import TarFile
def extract_first(fileobj, pat):
if isinstance(fileobj, ZipFile):
return zipfile_match_and_extract(fileobj, pat)
elif isinstance(fileobj, TarFile):
return tarfile_match_and_extract(fileobj, pat)
else:
... | {
"repo_name": "GiovanniConserva/TestDeploy",
"path": "venv/Lib/site-packages/binstar_client/inspect_package/uitls.py",
"copies": "1",
"size": "1359",
"license": "bsd-3-clause",
"hash": -2167640778059804700,
"line_mean": 27.3125,
"line_max": 81,
"alpha_frac": 0.6158940397,
"autogenerated": false,
... |
from fnmatch import fnmatch
import datetime
import os
from tools import plugin
def dir_open(file_name, mode='a', buffering=-1):
k_dir = os.path.split(os.path.dirname(__file__))[0]
p_dir = os.path.join(k_dir, 'logs')
file_name = os.path.abspath(os.path.join(p_dir, file_name))
if not os.path.isdir(os.pa... | {
"repo_name": "MrJohz/K-Eight",
"path": "plugins/logging.py",
"copies": "1",
"size": "2581",
"license": "bsd-2-clause",
"hash": -4525081399536194000,
"line_mean": 35.8714285714,
"line_max": 105,
"alpha_frac": 0.5625726463,
"autogenerated": false,
"ratio": 3.56,
"config_test": false,
"has_no_k... |
from fnmatch import fnmatch
import hashlib
class Role(object):
"""
DokuWiki user role. Allows checking for visibility and generating a
usergroup hash.
"""
def __init__(self, name, salt, permission_file_lines):
"""
:param name: Name of the role.
:param salt: Appended to the... | {
"repo_name": "howard/dokuwiki2findologic",
"path": "dokuwiki2findologic/usergroup.py",
"copies": "1",
"size": "3951",
"license": "mit",
"hash": 6242988372414269000,
"line_mean": 35.247706422,
"line_max": 80,
"alpha_frac": 0.6066818527,
"autogenerated": false,
"ratio": 4.230192719486081,
"confi... |
from fnmatch import fnmatch
import logging
from django.conf import settings
from watchdog.events import FileSystemEventHandler
log = logging.getLogger('senchatoolsbuild')
class DjangoFileSystemEventHandler(FileSystemEventHandler):
def __init__(self, callback):
self.excludepatterns = getattr(settings, 'D... | {
"repo_name": "espenak/djangosenchatools",
"path": "djangosenchatools/watch.py",
"copies": "1",
"size": "1824",
"license": "bsd-3-clause",
"hash": 2993419034066979300,
"line_mean": 42.4285714286,
"line_max": 138,
"alpha_frac": 0.576754386,
"autogenerated": false,
"ratio": 4.395180722891566,
"co... |
from fnmatch import fnmatch
import ntpath
import re
import patsy
import seaborn as sns
import pandas as pd
import numpy as np
from . import seed
import os
import logging
from matplotlib import pyplot as plt
logger = logging.getLogger(__name__)
def filter_stan_summary(stan_fit, pars):
fitsum = stan_fit.summary(pars... | {
"repo_name": "jburos/stancache",
"path": "stancache/utils.py",
"copies": "1",
"size": "3265",
"license": "apache-2.0",
"hash": -4206207925437029000,
"line_mean": 33.0104166667,
"line_max": 111,
"alpha_frac": 0.6490045942,
"autogenerated": false,
"ratio": 3.455026455026455,
"config_test": false... |
from fnmatch import fnmatch
import os
import shutil
from tarfile import TarFile
from zipfile import ZipFile
from .base import BasePackager
from .downloader import Downloader
# Standard Library is not very standard.
class ArchiveFileWrapper(object):
blacklist = ('.DS_Store', "*.pyc", "__MACOSX/*")
def __init... | {
"repo_name": "fcurella/python-packager",
"path": "pypackager/extractor.py",
"copies": "1",
"size": "3633",
"license": "mit",
"hash": 8136572685520268000,
"line_mean": 31.4375,
"line_max": 104,
"alpha_frac": 0.6069364162,
"autogenerated": false,
"ratio": 4.147260273972603,
"config_test": false,... |
from fnmatch import fnmatch
import os
import shutil
from tarfile import TarFile
from zipfile import ZipFile
from .downloader import Downloader
# Standard Library is not very standard.
class ArchiveFileWrapper(object):
blacklist = ('.DS_Store', "*.pyc", "__MACOSX/*")
def __init__(self, template_name):
... | {
"repo_name": "fcurella/cookiejar",
"path": "cookiejar/extractor.py",
"copies": "1",
"size": "3317",
"license": "mit",
"hash": -7177396441056472000,
"line_mean": 29.4311926606,
"line_max": 104,
"alpha_frac": 0.6113958396,
"autogenerated": false,
"ratio": 4.19873417721519,
"config_test": false,
... |
from fnmatch import fnmatch
import os
import sublime
import sys
from .test_package import UnitTestingCommand
from .test_coverage import UnitTestingCoverageCommand
class UnitTestingCurrentPackageCommand(UnitTestingCommand):
def run(self, **kwargs):
project_name = self.current_package_name
if not pr... | {
"repo_name": "randy3k/UnitTesting",
"path": "unittesting/test_current.py",
"copies": "1",
"size": "2905",
"license": "mit",
"hash": 4604758397924724000,
"line_mean": 35.3125,
"line_max": 94,
"alpha_frac": 0.6461273666,
"autogenerated": false,
"ratio": 4.401515151515151,
"config_test": true,
... |
from fnmatch import fnmatch
import sys
import json
import hashlib
def compute_sha256(filename):
sha256_hash = hashlib.sha256()
with open(filename, "rb") as f:
# Read and update hash string value in blocks of 4K
for byte_block in iter(lambda: f.read(4096), b""):
sha256_hash.update(b... | {
"repo_name": "DataDog/integrations-core",
"path": ".github/workflows/release-hash-check.py",
"copies": "1",
"size": "1251",
"license": "bsd-3-clause",
"hash": -5771867560287408000,
"line_mean": 29.512195122,
"line_max": 87,
"alpha_frac": 0.6682653877,
"autogenerated": false,
"ratio": 3.514044943... |
from fnmatch import fnmatch
from .common import * # noqa
class glob_list(list): # noqa
def __contains__(self, key):
for elt in self:
if fnmatch(key, elt):
return True
return False
DEBUG = env.bool('DJANGO_DEBUG', default=True)
SECRET_KEY = env.str("DJANGO_SECRET_KEY... | {
"repo_name": "geometalab/osmaxx",
"path": "web_frontend/config/settings/local.py",
"copies": "2",
"size": "1246",
"license": "mit",
"hash": -677201670932887900,
"line_mean": 30.9487179487,
"line_max": 82,
"alpha_frac": 0.5465489567,
"autogenerated": false,
"ratio": 4.019354838709678,
"config_t... |
from fnmatch import fnmatch
from django import template
register = template.Library()
@register.filter
def add_class(bound_field, class_):
attrs = bound_field.field.widget.attrs
if 'class' in attrs:
attrs['class'] = '{} {}'.format(attrs['class'], class_)
else:
attrs['class'] = class_
... | {
"repo_name": "resurtm/recarguide",
"path": "backend/common/templatetags/tools.py",
"copies": "1",
"size": "1904",
"license": "mit",
"hash": -7638484515407069000,
"line_mean": 30.7333333333,
"line_max": 79,
"alpha_frac": 0.6228991597,
"autogenerated": false,
"ratio": 3.6827852998065764,
"config... |
from fnmatch import fnmatch
from loguru import logger
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
logger = logger.bind(name='content_filter')
class FilterContentFilter:
"""
Rejects entries based on the filenames in the content. Torrent files only... | {
"repo_name": "ianstalk/Flexget",
"path": "flexget/plugins/filter/content_filter.py",
"copies": "3",
"size": "4772",
"license": "mit",
"hash": -727760599659707800,
"line_mean": 38.4380165289,
"line_max": 96,
"alpha_frac": 0.5301760268,
"autogenerated": false,
"ratio": 4.7247524752475245,
"confi... |
from fnmatch import fnmatch
import netifaces
from i3pystatus import IntervalModule, formatp
from i3pystatus.core.color import ColorRangeModule
from i3pystatus.core.util import make_graph, round_dict, make_bar, bytes_info_dict
def count_bits(integer):
bits = 0
while integer:
integer &= integer - 1
... | {
"repo_name": "fmarchenko/i3pystatus",
"path": "i3pystatus/network.py",
"copies": "2",
"size": "20093",
"license": "mit",
"hash": 511859358550991040,
"line_mean": 39.7418699187,
"line_max": 124,
"alpha_frac": 0.5874282864,
"autogenerated": false,
"ratio": 3.8577752117013087,
"config_test": fals... |
from fnmatch import fnmatch
import os
from os.path import (
basename, dirname, isdir, join, relpath, sep, split, splitdrive,
splitext,
)
import re
import vim
# -- public ----
# All possible unit test subdirectory naming conventions
# (the possibility that tests reside in the same directory as prod... | {
"repo_name": "tartley/vim-run-python-tests",
"path": "ftplugin/python/run_python_tests/run_python_tests.py",
"copies": "1",
"size": "13077",
"license": "bsd-3-clause",
"hash": -661046521417677200,
"line_mean": 30.6925,
"line_max": 79,
"alpha_frac": 0.6002141164,
"autogenerated": false,
"ratio": ... |
from fnmatch_vendor import fnmatch
from expand_utils import expand_braces
class TrieNode:
"""
an standard unit in carbon index.
"""
def __init__(self, name, is_leaf=True, sep="."):
self.is_leaf = is_leaf
self.name = name
self.sep = "."
self.children = dict()
def g... | {
"repo_name": "yunstanford/carbon-index",
"path": "carbon_index/node.py",
"copies": "1",
"size": "4485",
"license": "mit",
"hash": -4169666923919765000,
"line_mean": 28.1233766234,
"line_max": 104,
"alpha_frac": 0.5288740245,
"autogenerated": false,
"ratio": 3.986666666666667,
"config_test": fa... |
from fn.op import foldr
from fn.uniform import reduce
class LinkedList(object):
"""Represents simplest singly linked list. Doesn't distinguish
between empty and not-empty list (taking head of empty list will
return None as a result).
More about Linked List data structure on Wikipedia:
[1] http://e... | {
"repo_name": "autorealm/MayoiNeko",
"path": "develop/fn/immutable/list.py",
"copies": "2",
"size": "5650",
"license": "apache-2.0",
"hash": 4528176638141977000,
"line_mean": 30.2154696133,
"line_max": 90,
"alpha_frac": 0.623539823,
"autogenerated": false,
"ratio": 3.734302709847984,
"config_te... |
from fnote.blueprints.note.models import Note
from fnote.blueprints.user.models import User
from fnote.extensions import hashids
class TestNote(object):
def test_save_to_db(self, user, session):
note_num = len(Note.query.all())
Note(user.id, 'test_note_2', 'note text').save()
new_note_num ... | {
"repo_name": "carlegbert/wholenote",
"path": "fnote/tests/note/test_models.py",
"copies": "1",
"size": "3672",
"license": "mit",
"hash": -5133644922450895000,
"line_mean": 36.4693877551,
"line_max": 76,
"alpha_frac": 0.6029411765,
"autogenerated": false,
"ratio": 3.25531914893617,
"config_test... |
from fnote.blueprints.user.models import User
from fnote.tests.json_helpers import get_json
URL = '/api/v1.0/notes'
class TestGetNoteViews(object):
def test_get_notes_for_user(self, client, user, note, unfresh_token):
auth = {'Authorization': 'Bearer {0}'.format(unfresh_token)}
response = client... | {
"repo_name": "carlegbert/wholenote",
"path": "fnote/tests/note/test_get_views.py",
"copies": "1",
"size": "3203",
"license": "mit",
"hash": -1043208498133118300,
"line_mean": 41.7066666667,
"line_max": 77,
"alpha_frac": 0.6231657821,
"autogenerated": false,
"ratio": 3.547065337763012,
"config_... |
from fnote.tests.json_helpers import get_json, post_json
URL = '/api/v1.0/notes'
class TestPostNoteViews(object):
# Tests with bad authorization, wrong note id, etc are redundant with GET
# tests since they use the same view, so they are mostly not repeated here.
def test_post_new_note(self, client, unf... | {
"repo_name": "carlegbert/wholenote",
"path": "fnote/tests/note/test_post_views.py",
"copies": "1",
"size": "3315",
"license": "mit",
"hash": 6149073544181804000,
"line_mean": 46.3571428571,
"line_max": 79,
"alpha_frac": 0.6253393665,
"autogenerated": false,
"ratio": 3.6710963455149503,
"config... |
from FNV import *
#initialize items
item_stimpack = Consumable(name='Stimpack', category='Health', effect=30)
item_healing_powder = Consumable(name='Healing Powder',category='Health',effect=15)
item_doctors_bag = Consumable(name='Doctors bag',category='Health',effect=80)
item_super_stimpack = Consumable(name='Super St... | {
"repo_name": "chrisspencer1013/game",
"path": "items.py",
"copies": "1",
"size": "2211",
"license": "mit",
"hash": 5420237427655475000,
"line_mean": 50.4418604651,
"line_max": 105,
"alpha_frac": 0.737222976,
"autogenerated": false,
"ratio": 2.5326460481099655,
"config_test": false,
"has_no_k... |
from foam.sfa.rspecs.elements.element import Element
from foam.sfa.rspecs.elements.execute import Execute
from foam.sfa.rspecs.elements.install import Install
from foam.sfa.rspecs.elements.services import Services
from foam.sfa.rspecs.elements.login import Login
class PGv2Services:
@staticmethod
def ad... | {
"repo_name": "ict-felix/stack",
"path": "ofam/src/src/foam/sfa/rspecs/elements/versions/pgv2Services.py",
"copies": "3",
"size": "1946",
"license": "apache-2.0",
"hash": -7194033975840992000,
"line_mean": 44.2558139535,
"line_max": 103,
"alpha_frac": 0.5801644399,
"autogenerated": false,
"ratio"... |
from foam.sfa.rspecs.elements.element import Element
from foam.sfa.rspecs.elements.sliver import Sliver
from foam.sfa.rspecs.elements.versions.pgv2DiskImage import PGv2DiskImage
from foam.sfa.rspecs.elements.versions.plosv1FWRule import PLOSv1FWRule
class OcfOfSlivers:
@staticmethod
def add_slivers(xml, slive... | {
"repo_name": "ict-felix/stack",
"path": "ofam/src/src/foam/sfa/rspecs/elements/versions/ocfofSlivers.py",
"copies": "3",
"size": "1964",
"license": "apache-2.0",
"hash": -8152446174033037000,
"line_mean": 43.6363636364,
"line_max": 108,
"alpha_frac": 0.5677189409,
"autogenerated": false,
"ratio"... |
from foam.sfa.rspecs.elements.element import Element
from foam.sfa.rspecs.elements.sliver import Sliver
from foam.sfa.rspecs.elements.vm import VM
from foam.sfa.rspecs.elements.vm_interface import VMInterface
from foam.sfa.rspecs.elements.versions.pgv2DiskImage import PGv2DiskImage
from foam.sfa.rspecs.elements.version... | {
"repo_name": "dana-i2cat/felix",
"path": "ofam/src/src/foam/sfa/rspecs/elements/versions/ocfvtSlivers.py",
"copies": "3",
"size": "3207",
"license": "apache-2.0",
"hash": 4068161131888096000,
"line_mean": 37.6385542169,
"line_max": 108,
"alpha_frac": 0.6030558154,
"autogenerated": false,
"ratio"... |
from foam.sfa.rspecs.rspec import RSpec
from foam.sfa.rspecs.version_manager import VersionManager
from foam.sfa.lib import getAdvertisement
import time
class OFAggregate:
def __init__(self):
pass
def get_rspec(self, version=None, slice_leaf=None, projectName=None, options={}):
version_manager... | {
"repo_name": "dana-i2cat/felix",
"path": "ofam/src/src/foam/sfa/drivers/OFAggregate.py",
"copies": "3",
"size": "1299",
"license": "apache-2.0",
"hash": 930311460484202000,
"line_mean": 39.59375,
"line_max": 139,
"alpha_frac": 0.6343341032,
"autogenerated": false,
"ratio": 3.7220630372492836,
... |
from foam.sfa.rspecs.versions.pgv2 import PGv2
class GENIv3(PGv2):
type = 'GENI'
content_type = 'ad'
version = '3'
schema = 'http://www.geni.net/resources/rspec/3/ad.xsd'
namespace = 'http://www.geni.net/resources/rspec/3'
extensions = {
'flack': "http://www.protogeni.net/resources/rspe... | {
"repo_name": "ict-felix/stack",
"path": "ofam/src/src/foam/sfa/rspecs/.oldversions/pgv3.py",
"copies": "3",
"size": "3082",
"license": "apache-2.0",
"hash": -3489168130346704000,
"line_mean": 87.0571428571,
"line_max": 693,
"alpha_frac": 0.7245295263,
"autogenerated": false,
"ratio": 2.670710571... |
from foam.sfa.util.faults import RecordNotFound
from foam.sfa.util.method import Method
from foam.sfa.trust.credential import Credential
from foam.sfa.util.parameter import Parameter, Mixed
class GetGids(Method):
"""
Get a list of record information (hrn, gid and type) for
the specified hrns.
@para... | {
"repo_name": "ict-felix/stack",
"path": "ofam/src/src/foam/sfa/methods/GetGids.py",
"copies": "3",
"size": "1478",
"license": "apache-2.0",
"hash": -6261612511610765000,
"line_mean": 31.8444444444,
"line_max": 83,
"alpha_frac": 0.6109607578,
"autogenerated": false,
"ratio": 3.9731182795698925,
... |
from foam.sfa.util.method import Method
from foam.sfa.trust.auth import Auth
from foam.sfa.trust.credential import Credential
from foam.sfa.util.parameter import Parameter, Mixed
class get_trusted_certs(Method):
"""
@param cred credential string specifying the rights of the caller
@return list of gid str... | {
"repo_name": "dana-i2cat/felix",
"path": "ofam/src/src/foam/sfa/methods/get_trusted_certs.py",
"copies": "3",
"size": "1426",
"license": "apache-2.0",
"hash": -5059399665519600000,
"line_mean": 34.65,
"line_max": 80,
"alpha_frac": 0.6171107994,
"autogenerated": false,
"ratio": 4.016901408450704,... |
from foam.sfa.util.method import Method
from foam.sfa.trust.credential import Credential
from foam.sfa.util.parameter import Parameter, Mixed
class ListSlices(Method):
"""
List the slices instantiated at this interface
@param cred credential string specifying the rights of the caller
@return... | {
"repo_name": "dana-i2cat/felix",
"path": "ofam/src/src/foam/sfa/methods/ListSlices.py",
"copies": "3",
"size": "1071",
"license": "apache-2.0",
"hash": -3204401681295951400,
"line_mean": 31.4545454545,
"line_max": 122,
"alpha_frac": 0.6582633053,
"autogenerated": false,
"ratio": 3.83870967741935... |
from foam.sfa.util.method import Method
from foam.sfa.trust.credential import Credential
from foam.sfa.util.parameter import Parameter, Mixed
class Register(Method):
"""
Register an object with the registry. In addition to being stored in the
SFA database, the appropriate records will also be created in ... | {
"repo_name": "dana-i2cat/felix",
"path": "ofam/src/src/foam/sfa/methods/Register.py",
"copies": "3",
"size": "1389",
"license": "apache-2.0",
"hash": 8243521204016206000,
"line_mean": 32.8780487805,
"line_max": 143,
"alpha_frac": 0.6551475882,
"autogenerated": false,
"ratio": 4.049562682215743,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.