text stringlengths 0 1.05M | meta dict |
|---|---|
"""Activates a project"""
from baseCmd import *
from baseResponse import *
class activateProjectCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""id of the project to be modified"""
"""Required"""
self.id = None
self.typeInfo['id'] = 'uuid'
... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/activateProject.py",
"copies": "1",
"size": "7598",
"license": "apache-2.0",
"hash": -8098021154133229000,
"line_mean": 42.9190751445,
"line_max": 94,
"alpha_frac": 0.6138457489,
"autogenerated": false,
"ratio": 4.38683602... |
"""Activates arm mirror, changes eyes and says a short sentence every few seconds"""
from time import sleep
from random import randint
import subprocess
import threading
from Movements import Movements
from Audio import Audio
from Eyes import Eyes
MOVEMENTS = Movements()
AUDIO = Audio()
EYES = Eyes()
def arm_mirror(... | {
"repo_name": "CruyeEblon/Programming_Classes",
"path": "beo_threads.py",
"copies": "1",
"size": "2041",
"license": "mit",
"hash": 4597570212427876400,
"line_mean": 26.2133333333,
"line_max": 84,
"alpha_frac": 0.6291033807,
"autogenerated": false,
"ratio": 3.4770017035775127,
"config_test": fal... |
ACTIVATE_SCRIPT = """# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
# This shoul... | {
"repo_name": "mbachry/exxo",
"path": "exxo/venv.py",
"copies": "1",
"size": "2558",
"license": "isc",
"hash": 6727654097634589000,
"line_mean": 24.8383838384,
"line_max": 84,
"alpha_frac": 0.6426896013,
"autogenerated": false,
"ratio": 3.1658415841584158,
"config_test": false,
"has_no_keywor... |
activate_this = "/Users/stefano.romano/DataScience/bin/activate_this.py"
execfile(activate_this, dict(__file__ = activate_this))
import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
data = np.loadtxt("data/mixture_data.csv")
plt.clf()
plt.hist(data, histtype = "stepfilled", color = "g", alpha = 0... | {
"repo_name": "steromano/BayesianMethodsForHackers",
"path": "chapter3.py",
"copies": "1",
"size": "2276",
"license": "mit",
"hash": 72851226892756300,
"line_mean": 26.756097561,
"line_max": 89,
"alpha_frac": 0.6458699473,
"autogenerated": false,
"ratio": 2.69988137603796,
"config_test": false,... |
""" Activation Factory
Hacked together by / Copyright 2020 Ross Wightman
"""
from typing import Union, Callable, Type
from .activations import *
from .activations_jit import *
from .activations_me import *
from .config import is_exportable, is_scriptable, is_no_jit
# PyTorch has an optimized, native 'silu' (aka 'swis... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/models/layers/create_act.py",
"copies": "1",
"size": "5359",
"license": "apache-2.0",
"hash": -6020964667966505000,
"line_mean": 34.0261437908,
"line_max": 105,
"alpha_frac": 0.6762455682,
"autogenerated": false,
"ratio": 2.86730872124... |
""" Activation functions implemented in NumPy
"""
# Sebastian Raschka 2016-2017
#
# ann is a supporting package for the book
# "Introduction to Artificial Neural Networks and Deep Learning:
# A Practical Guide with Applications in Python"
#
# Author: Sebastian Raschka <sebastianraschka.com>
#
# License: MIT
import nu... | {
"repo_name": "othersite/document",
"path": "machinelearning/deep-learning-book/ann/np/activations.py",
"copies": "1",
"size": "7369",
"license": "apache-2.0",
"hash": 1284922839227823900,
"line_mean": 21.7438271605,
"line_max": 79,
"alpha_frac": 0.5215090243,
"autogenerated": false,
"ratio": 3.4... |
""" Activations (memory-efficient w/ custom autograd)
A collection of activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
These activations are not compatible with jit scripting or ONNX export of the model, please use either
the JIT or bas... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/models/layers/activations_me.py",
"copies": "1",
"size": "5886",
"license": "apache-2.0",
"hash": 2708939029053903400,
"line_mean": 26,
"line_max": 163,
"alpha_frac": 0.6493374108,
"autogenerated": false,
"ratio": 2.983274201723264,
... |
""" Activations
A collection of activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
from torch import nn as nn
from torch.nn import functional as F
def swish(x, inplace:... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/models/layers/activations.py",
"copies": "1",
"size": "4040",
"license": "apache-2.0",
"hash": -4735379133499598000,
"line_mean": 26.8620689655,
"line_max": 107,
"alpha_frac": 0.629950495,
"autogenerated": false,
"ratio": 3.28990228013... |
""" Activations
A collection of jit-scripted activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
All jit scripted activations are lacking in-place variations on purpose, scripted kernel fusion does not
currently work across in-place op bou... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/models/layers/activations_jit.py",
"copies": "1",
"size": "2529",
"license": "apache-2.0",
"hash": 2376385783565350000,
"line_mean": 27.1,
"line_max": 107,
"alpha_frac": 0.6611308818,
"autogenerated": false,
"ratio": 3.0691747572815533... |
"""Active inference project code
Oswald Berthold, 2016-2017
This file contains the learners which can be used as adaptive models of
sensorimotor contexts. For forward models there are
- nearest neighbour
- sparse online gaussian process models powered by Harold Soh's OTL library
- gaussian mixture model
- hebbian... | {
"repo_name": "x75/actinf",
"path": "actinf_models.py",
"copies": "1",
"size": "61457",
"license": "mit",
"hash": 3526740483992469000,
"line_mean": 40.7506793478,
"line_max": 251,
"alpha_frac": 0.5319003531,
"autogenerated": false,
"ratio": 3.1472832488349467,
"config_test": false,
"has_no_ke... |
"""Active learning by learning (ALBL)
This module includes two classes. ActiveLearningByLearning is the main
algorithm for ALBL and Exp4P is the multi-armed bandit algorithm which will be
used in ALBL.
"""
from __future__ import division
import copy
import numpy as np
from libact.base.interfaces import QueryStrateg... | {
"repo_name": "ntucllab/libact",
"path": "libact/query_strategies/active_learning_by_learning.py",
"copies": "1",
"size": "15164",
"license": "bsd-2-clause",
"hash": -4136409435558036500,
"line_mean": 35.5397590361,
"line_max": 102,
"alpha_frac": 0.6003692957,
"autogenerated": false,
"ratio": 4.0... |
""" Active Learning by QUerying Informative and Representative Examples (QUIRE)
This module contains a class that implements an active learning algorithm
(query strategy): QUIRE
"""
import bisect
import numpy as np
from sklearn.metrics.pairwise import linear_kernel, polynomial_kernel,\
rbf_kernel
from libact.b... | {
"repo_name": "ntucllab/libact",
"path": "libact/query_strategies/quire.py",
"copies": "1",
"size": "5471",
"license": "bsd-2-clause",
"hash": 7316460939588419000,
"line_mean": 34.525974026,
"line_max": 79,
"alpha_frac": 0.543593493,
"autogenerated": false,
"ratio": 3.721768707482993,
"config_t... |
""" Active learning suggestions.
Module structure:
- Arm
- RandomArm
- WeightedArm
- MarginArm
- ConfidenceArm
- EntropyArm
- CommitteeArm
- QBBMarginArm
- QBBKLArm
"""
# Author: Alasdair Tran
# License: BSD 3 clau... | {
"repo_name": "chengsoonong/mclass-sky",
"path": "mclearn/arms.py",
"copies": "1",
"size": "20980",
"license": "bsd-3-clause",
"hash": 9112674203356257000,
"line_mean": 38.5811320755,
"line_max": 96,
"alpha_frac": 0.6220802746,
"autogenerated": false,
"ratio": 4.700425722608111,
"config_test": ... |
"""Active learning with uncertainty sampling.
Pool-based. Binary class labels.
Matthew Alger
The Australian National University
2016
"""
import numpy
from .sampler import Sampler
class ConfidenceUncertaintySampler(Sampler):
"""Pool-based active learning with uncertainty sampling, with uncertainty
based on... | {
"repo_name": "chengsoonong/crowdastro",
"path": "crowdastro/active_learning/uncertainty_sampler.py",
"copies": "1",
"size": "1880",
"license": "mit",
"hash": -2139662655689205800,
"line_mean": 35.1538461538,
"line_max": 78,
"alpha_frac": 0.6505319149,
"autogenerated": false,
"ratio": 4.444444444... |
import web
from activerecord import ModelStorage
class Field(object):
PROPERTIES = ['type', 'max_length', 'key', 'auto_increment', 'null', 'default']
def __init__(self, **kwargs):
for property in Field.PROPERTIES:
method = 'set_%s' % property
if not kwargs.get(propert... | {
"repo_name": "fedecarg/webpy-activerecord",
"path": "src/fields.py",
"copies": "1",
"size": "3445",
"license": "mit",
"hash": -4597590910289222700,
"line_mean": 32.7745098039,
"line_max": 137,
"alpha_frac": 0.6386066763,
"autogenerated": false,
"ratio": 4.106078665077473,
"config_test": false,... |
from __future__ import print_function
import collections
import functools
from itertools import ifilterfalse
from heapq import nsmallest
from operator import itemgetter
class Counter(dict):
'Mapping where default values are zero'
def __missing__(self, key):
return 0
def lru_cache(maxsize=100):
'... | {
"repo_name": "zuphilip/ocropy",
"path": "ocrolib/extras/lru.py",
"copies": "3",
"size": "5375",
"license": "apache-2.0",
"hash": 1245717493039622000,
"line_mean": 31.1856287425,
"line_max": 82,
"alpha_frac": 0.5460465116,
"autogenerated": false,
"ratio": 4.47171381031614,
"config_test": false,... |
import collections
import functools
from itertools import ifilterfalse
from heapq import nsmallest
from operator import itemgetter
class Counter(dict):
'Mapping where default values are zero'
def __missing__(self, key):
return 0
def lru_cache(maxsize=100):
'''Least-recently-used cache decorator.
... | {
"repo_name": "brobertson/ocropus-bgr",
"path": "ocropy/ocrolib/extras/lru.py",
"copies": "11",
"size": "5336",
"license": "apache-2.0",
"hash": -3571663257881831000,
"line_mean": 31.3393939394,
"line_max": 82,
"alpha_frac": 0.5446026987,
"autogenerated": false,
"ratio": 4.476510067114094,
"con... |
"""ActiveTick bar data."""
import activetickpy.convert as convert
class Bar:
"""ActiveTick bar data.
Attributes not specified in the constructor:
milliseconds -- time in milliseconds since the Epoch
open_price -- open price
high_price -- high price
low_price -- low price
close_pric... | {
"repo_name": "larmer01/activetickpy",
"path": "bar.py",
"copies": "1",
"size": "2081",
"license": "apache-2.0",
"hash": -934181751546233000,
"line_mean": 32.0317460317,
"line_max": 78,
"alpha_frac": 0.5732820759,
"autogenerated": false,
"ratio": 3.956273764258555,
"config_test": false,
"has_... |
"""ActiveTick quote data."""
import activetickpy.convert as convert
class Quote:
"""ActiveTick quote data.
Attributes not specified in the constructor:
symbol
open_price
previous_close_price
close_price
last_price
bid_price
ask_price
high_price
low_price
day_high_price... | {
"repo_name": "larmer01/activetickpy",
"path": "quote.py",
"copies": "1",
"size": "6159",
"license": "apache-2.0",
"hash": 2678332728569000400,
"line_mean": 32.1129032258,
"line_max": 79,
"alpha_frac": 0.5736320831,
"autogenerated": false,
"ratio": 3.903041825095057,
"config_test": false,
"ha... |
"""ActiveTick tick data."""
import activetickpy.convert as convert
class QuoteTick:
"""ActiveTick quote data for a single tick.
Attributes not specified in the constructor:
milliseconds
bid_price
ask_price
bid_size
ask_size
bid_exchange
ask_exchange
condition
"""
def... | {
"repo_name": "larmer01/activetickpy",
"path": "tick.py",
"copies": "1",
"size": "3817",
"license": "apache-2.0",
"hash": -6860955851824296000,
"line_mean": 28.1374045802,
"line_max": 79,
"alpha_frac": 0.6106890228,
"autogenerated": false,
"ratio": 4.148913043478261,
"config_test": false,
"ha... |
'''activeurl django template library'''
from django import template
from classytags.core import Tag, Options
from classytags.arguments import MultiKeywordArgument
from ..utils import render_content, Configuration
# django template library
register = template.Library()
class ActiveUrl(Tag, Configuration):
'''dj... | {
"repo_name": "zakdoek/django-activeurl",
"path": "django_activeurl/templatetags/activeurl.py",
"copies": "1",
"size": "1349",
"license": "apache-2.0",
"hash": 1410020281034700000,
"line_mean": 25.4509803922,
"line_max": 79,
"alpha_frac": 0.661971831,
"autogenerated": false,
"ratio": 4.5268456375... |
"""actividades URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | {
"repo_name": "shiminasai/plataforma_fadcanic",
"path": "actividades/urls.py",
"copies": "3",
"size": "2252",
"license": "mit",
"hash": -3270612031543439000,
"line_mean": 41.4905660377,
"line_max": 113,
"alpha_frac": 0.6722912966,
"autogenerated": false,
"ratio": 3.194326241134752,
"config_test... |
"""Activities model."""
from django.db import models
from ..templatetags.util import human_duration
class Itinerary(models.Model):
"""An itinerary contains multiple scheduled activities."""
name = models.CharField(
verbose_name="Name",
help_text="Itinerary's name.",
max_length=50,
... | {
"repo_name": "jricardo27/holiday_planner",
"path": "holiday_planner/holiday_place/models/activity.py",
"copies": "1",
"size": "6576",
"license": "bsd-3-clause",
"hash": -2652502387636516400,
"line_mean": 24.8897637795,
"line_max": 79,
"alpha_frac": 0.5843978102,
"autogenerated": false,
"ratio": ... |
# activity/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import ActivityComment, ActivityNoticeSeed, ActivityManager, ActivityNotice, ActivityPost, \
NOTICE_ACTIVITY_POST_SEED, NOTICE_FRIEND_ACTIVITY_POSTS, \
NOTICE_FRIEND_ENDORSEMENTS, NOTICE_FRIEND_ENDORSEMENTS_SEE... | {
"repo_name": "wevote/WeVoteServer",
"path": "activity/controllers.py",
"copies": "1",
"size": "109685",
"license": "mit",
"hash": 584912442541290900,
"line_mean": 51.106888361,
"line_max": 120,
"alpha_frac": 0.6082326663,
"autogenerated": false,
"ratio": 3.7671726885561205,
"config_test": fals... |
"""Activity data from the Fitbit API.
A note on "creds" parameters:
The dict is expected to have these keys:
- client_id
- client_secret
- authorization_code
It may also have these keys, and they may be updated during function calls:
- access_token
- refresh_token
"""
import logging
from base64 i... | {
"repo_name": "genericmoniker/mirror",
"path": "backend/src/mirror/plugins/activity/fitbit.py",
"copies": "1",
"size": "3452",
"license": "mit",
"hash": 4975721914366331000,
"line_mean": 33.1782178218,
"line_max": 85,
"alpha_frac": 0.6355735805,
"autogenerated": false,
"ratio": 3.7399783315276274... |
"""Activity forms"""
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from crispy_forms.helper import FormHelper
from . import BaseSuperHappyForm
from ..models.activity import Activity, ToDo
from ..models.place import Place
class ActivityForm(BaseSuperHappyForm):
"""Acti... | {
"repo_name": "jricardo27/holiday_planner",
"path": "holiday_planner/holiday_place/forms/activity.py",
"copies": "1",
"size": "1835",
"license": "bsd-3-clause",
"hash": -6901805244765087000,
"line_mean": 28.5967741935,
"line_max": 70,
"alpha_frac": 0.5776566757,
"autogenerated": false,
"ratio": 4... |
import base64,hashlib,hmac,time,urllib2
from urllib import urlencode, urlopen
from bs4 import BeautifulSoup
from datetime import datetime
class Amazon():
def BrowseNodeExtraction():
# Amazon Access Keys
AWS_ACCESS_KEY_ID = "" //Enter your access key id
AWS_SECRET_ACCESS_KEY = "" //Enter y... | {
"repo_name": "TejaBeta/Spiders",
"path": "amazon.py",
"copies": "1",
"size": "35681",
"license": "mit",
"hash": -6159251653344000000,
"line_mean": 39.5927189989,
"line_max": 144,
"alpha_frac": 0.3925338415,
"autogenerated": false,
"ratio": 5.768024571613321,
"config_test": false,
"has_no_key... |
# activity/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.db import models
from django.db.models import Q
from django.utils.timezone import now
from datetime import timedelta
import json
from wevote_functions.functions import positive_value_exists
from wevote_settings.models import... | {
"repo_name": "wevote/WeVoteServer",
"path": "activity/models.py",
"copies": "1",
"size": "72637",
"license": "mit",
"hash": 3093900268681364500,
"line_mean": 45.9838292367,
"line_max": 120,
"alpha_frac": 0.568759723,
"autogenerated": false,
"ratio": 4.042575690115761,
"config_test": false,
"... |
ACTIVITYPUB_COMMENT = {
'@context': ['https://www.w3.org/ns/activitystreams',
{'ostatus': 'http://ostatus.org#',
'atomUri': 'ostatus:atomUri',
'inReplyToAtomUri': 'ostatus:inReplyToAtomUri',
'conversation': 'ostatus:conversation',
'sensitive': 'as:sensitive',
'Hashtag': 'as:Hashtag',
'toot': 'http... | {
"repo_name": "jaywink/social-federation",
"path": "federation/tests/fixtures/payloads/activitypub.py",
"copies": "2",
"size": "34390",
"license": "bsd-3-clause",
"hash": 6878831494804045000,
"line_mean": 51.3439878234,
"line_max": 836,
"alpha_frac": 0.6901134051,
"autogenerated": false,
"ratio":... |
#Activity recognizer
import sys
from math import sqrt
import itertools
from pyspark import SparkContext
from pyspark.mllib.linalg import Matrices, Vectors
from pyspark.mllib.tree import DecisionTree, DecisionTreeModel
from pyspark.mllib.tree import RandomForest, RandomForestModel
from pyspark.mllib.util import MLUtils
... | {
"repo_name": "amadeusmx/cpmx8-machine-learning-with-accelerometer-of-xdk-bosch",
"path": "Activity recognizer.py",
"copies": "1",
"size": "3881",
"license": "apache-2.0",
"hash": 566122521760799550,
"line_mean": 26.7214285714,
"line_max": 180,
"alpha_frac": 0.6413295542,
"autogenerated": false,
... |
import os
import pandas as pd
import openmatrix as omx
def read_manifest(manifest_file_name):
column_map = {
'Token': 'skim_key1',
'TimePeriod': 'skim_key2',
'File': 'source_file_name',
'Matrix': 'source_key',
}
converters = {
col: str for col in column_map.keys(... | {
"repo_name": "UDST/activitysim",
"path": "scripts/build_omx.py",
"copies": "2",
"size": "2492",
"license": "bsd-3-clause",
"hash": 1116000736664617100,
"line_mean": 29.3902439024,
"line_max": 92,
"alpha_frac": 0.5862760835,
"autogenerated": false,
"ratio": 3.270341207349081,
"config_test": fal... |
# ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
import logging
from activitysim.core.util import assign_in_place
logger = logging.getLogger(__name__)
def failed... | {
"repo_name": "UDST/activitysim",
"path": "activitysim/abm/models/util/trip.py",
"copies": "2",
"size": "2902",
"license": "bsd-3-clause",
"hash": -8974084020301307000,
"line_mean": 34.3902439024,
"line_max": 98,
"alpha_frac": 0.6647139904,
"autogenerated": false,
"ratio": 3.335632183908046,
"c... |
# ActivitySim
# See full license in LICENSE.txt.
from builtins import range
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
from .. import timetable as tt
@pytest.fixture
def persons():
df = pd.DataFrame(
index=list(range(6))
)
return df
@pytest.fixture... | {
"repo_name": "UDST/activitysim",
"path": "activitysim/core/test/test_timetable.py",
"copies": "2",
"size": "6349",
"license": "bsd-3-clause",
"hash": 7026654858939826000,
"line_mean": 33.1344086022,
"line_max": 90,
"alpha_frac": 0.5336273429,
"autogenerated": false,
"ratio": 2.5914285714285716,
... |
# ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
from builtins import next
from builtins import map
from builtins import object
from future.utils import iteritems
i... | {
"repo_name": "UDST/activitysim",
"path": "activitysim/core/pipeline.py",
"copies": "2",
"size": "23709",
"license": "bsd-3-clause",
"hash": -5751523121450640000,
"line_mean": 29.0875634518,
"line_max": 100,
"alpha_frac": 0.6529166139,
"autogenerated": false,
"ratio": 3.9720221142569945,
"confi... |
# ActivitySim
# See full license in LICENSE.txt.
import numpy as np
import pandas as pd
import openmatrix as omx
input_folder = "/Users/jeff.doyle/work/activitysim-data/sandag_zone/output/"
output_folder = "./output/"
data_file = 'NetworkData.h5'
skim_files = ['taz_skims.omx', 'tap_skims_locl.omx', 'tap_skims_prem.... | {
"repo_name": "UDST/activitysim",
"path": "example_multiple_zone/dump_data.py",
"copies": "2",
"size": "1574",
"license": "bsd-3-clause",
"hash": -7496693926704565000,
"line_mean": 27.6181818182,
"line_max": 82,
"alpha_frac": 0.5184243964,
"autogenerated": false,
"ratio": 3.2122448979591836,
"c... |
# ActivitySim
# See full license in LICENSE.txt.
import os
import numpy as np
import pandas as pd
import openmatrix as omx
import sys
# currently hdf5 written with python3 works with both p2.7 and p3,
# but reading hdf5 built with p2.7 (tables==3.4.4) p3 throws a ValueError reading land_use_taz:
# ValueError: Buffe... | {
"repo_name": "UDST/activitysim",
"path": "scripts/create_sf_example.py",
"copies": "2",
"size": "2310",
"license": "bsd-3-clause",
"hash": -8834665492518320000,
"line_mean": 32.4782608696,
"line_max": 100,
"alpha_frac": 0.667965368,
"autogenerated": false,
"ratio": 2.773109243697479,
"config_t... |
"""Activity views."""
import django_filters
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import CreateView, DetailView, UpdateView
from django_filters.views import FilterView
from .mixins import AJAXRedirectMixin
from ..forms import activity as activity... | {
"repo_name": "jricardo27/holiday_planner",
"path": "holiday_planner/holiday_place/views/activity.py",
"copies": "1",
"size": "3292",
"license": "bsd-3-clause",
"hash": 141970079466206700,
"line_mean": 24.1297709924,
"line_max": 77,
"alpha_frac": 0.6363912515,
"autogenerated": false,
"ratio": 4.0... |
"""actofgoods URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | {
"repo_name": "actofgoods/actofgoods",
"path": "administration/urls.py",
"copies": "1",
"size": "2485",
"license": "mit",
"hash": -8970017133031198000,
"line_mean": 59.6097560976,
"line_max": 153,
"alpha_frac": 0.7018108652,
"autogenerated": false,
"ratio": 3.5550786838340485,
"config_test": fa... |
"""Actor-Critic using TD-error as the Advantage, Reinforcement Learning.
Actor Critic History
----------------------
A3C > DDPG > AC
Advantage
----------
AC converge faster than Policy Gradient.
Disadvantage (IMPORTANT)
------------------------
The Policy is oscillated (difficult to converge), DDPG can solve
this pr... | {
"repo_name": "zsdonghao/tensorlayer",
"path": "examples/reinforcement_learning/tutorial_cartpole_ac.py",
"copies": "1",
"size": "8217",
"license": "apache-2.0",
"hash": 3562028876724424000,
"line_mean": 37.0416666667,
"line_max": 123,
"alpha_frac": 0.5941341122,
"autogenerated": false,
"ratio": ... |
""" Actor for rodario framework """
# stdlib
import atexit
from uuid import uuid4
from time import sleep
from threading import Thread, Event
import pickle
import inspect
# local
from rodario import get_redis_connection
from rodario.registry import Registry
from rodario.exceptions import UUIDInUseException
REGISTRY =... | {
"repo_name": "haliphax/rodario",
"path": "rodario/actors/actor.py",
"copies": "1",
"size": "4348",
"license": "mit",
"hash": 8123875098153982000,
"line_mean": 25.1927710843,
"line_max": 78,
"alpha_frac": 0.5547378105,
"autogenerated": false,
"ratio": 4.352352352352352,
"config_test": false,
... |
"""ActorInterval module: contains the ActorInterval class"""
__all__ = ['ActorInterval', 'LerpAnimInterval']
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify.DirectNotifyGlobal import *
from . import Interval
import math
class ActorInterval(Interval.Interval):
# create ActorInter... | {
"repo_name": "chandler14362/panda3d",
"path": "direct/src/interval/ActorInterval.py",
"copies": "7",
"size": "9301",
"license": "bsd-3-clause",
"hash": 1003216986389277700,
"line_mean": 38.5787234043,
"line_max": 137,
"alpha_frac": 0.60133319,
"autogenerated": false,
"ratio": 4.403882575757576,
... |
"""ActorInterval module: contains the ActorInterval class"""
__all__ = ['ActorInterval', 'LerpAnimInterval']
from pandac.PandaModules import *
from direct.directnotify.DirectNotifyGlobal import *
import Interval
import math
class ActorInterval(Interval.Interval):
# create ActorInterval DirectNotify category
... | {
"repo_name": "jjkoletar/panda3d",
"path": "direct/src/interval/ActorInterval.py",
"copies": "3",
"size": "9321",
"license": "bsd-3-clause",
"hash": 6906501451684062000,
"line_mean": 38.8333333333,
"line_max": 137,
"alpha_frac": 0.598004506,
"autogenerated": false,
"ratio": 4.438571428571429,
"... |
"""Actor module: contains the Actor class"""
__all__ = ['Actor']
from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
from direct.directnotify import DirectNotifyGlobal
import types
class Actor(DirectObject, NodePath):
"""
Actor class: Contains methods for creating, manipulating
... | {
"repo_name": "mgracer48/panda3d",
"path": "direct/src/actor/Actor.py",
"copies": "1",
"size": "105876",
"license": "bsd-3-clause",
"hash": -5916693902674308000,
"line_mean": 40.3901485536,
"line_max": 116,
"alpha_frac": 0.5725943557,
"autogenerated": false,
"ratio": 4.3868241143567435,
"config... |
"""Actor module: contains the Actor class"""
__all__ = ['Actor']
from panda3d.core import *
from panda3d.core import Loader as PandaLoader
from direct.showbase.DirectObject import DirectObject
from direct.directnotify import DirectNotifyGlobal
class Actor(DirectObject, NodePath):
"""
Actor class: Contains m... | {
"repo_name": "tobspr/panda3d",
"path": "direct/src/actor/Actor.py",
"copies": "3",
"size": "105172",
"license": "bsd-3-clause",
"hash": -581293755250376700,
"line_mean": 40.227753822,
"line_max": 116,
"alpha_frac": 0.5728520899,
"autogenerated": false,
"ratio": 4.389299277993406,
"config_test"... |
"""Actor module: contains the Actor class"""
__all__ = ['Actor']
from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
from direct.directnotify import DirectNotifyGlobal
from pandac.PandaModules import LODNode
import types, copy
class Actor(DirectObject, NodePath):
"""
Actor... | {
"repo_name": "jjkoletar/panda3d",
"path": "direct/src/actor/Actor.py",
"copies": "1",
"size": "106198",
"license": "bsd-3-clause",
"hash": 315747505434363000,
"line_mean": 40.548513302,
"line_max": 116,
"alpha_frac": 0.5695116669,
"autogenerated": false,
"ratio": 4.405824759376038,
"config_tes... |
"""Actor module: contains the Actor class"""
__all__ = ['Actor']
from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import LODNode
import types, copy
class Actor(DirectObject, NodePath):
"""
Actor class: Contains methods for creating, manipulating... | {
"repo_name": "toontownfunserver/Panda3D-1.9.0",
"path": "direct/actor/Actor.py",
"copies": "2",
"size": "106332",
"license": "bsd-3-clause",
"hash": 7853209984678658000,
"line_mean": 40.5359375,
"line_max": 116,
"alpha_frac": 0.5694334725,
"autogenerated": false,
"ratio": 4.406265539532571,
"c... |
# ----------- Actor ------------
# Actors represent interactable characters within the game world.
# ----------------------------
# -------- Imports --------
from vector import Vector
# -------- Actor --------
# Base abstract actor
class Actor( ):
# -------- Init --------
# Constructor
#
# @return... | {
"repo_name": "lsjroberts/7d7g",
"path": "framework/actor.py",
"copies": "1",
"size": "1360",
"license": "mit",
"hash": -7072029499023996000,
"line_mean": 22.0677966102,
"line_max": 65,
"alpha_frac": 0.5529411765,
"autogenerated": false,
"ratio": 4.108761329305136,
"config_test": false,
"has_... |
# ----------- Actor ------------
# Actors represent interactable characters within the game world.
# ----------------------------
# -------- Imports --------
import pygame, config
from app import UpdateableGameObject
from event import EventListener, PygameEvent
from vector import Vector
# -------- Actor --------
#... | {
"repo_name": "lsjroberts/7d7g",
"path": "on-hold-dung-beetle-dating/app/actor.py",
"copies": "2",
"size": "4121",
"license": "mit",
"hash": -3478558644387631000,
"line_mean": 23.2470588235,
"line_max": 91,
"alpha_frac": 0.5491385586,
"autogenerated": false,
"ratio": 3.993217054263566,
"config_... |
#: Actor name used to register controller
SERVE_CONTROLLER_NAME = "SERVE_CONTROLLER_ACTOR"
#: Actor name used to register HTTP proxy actor
SERVE_PROXY_NAME = "SERVE_PROXY_ACTOR"
#: HTTP Address
DEFAULT_HTTP_ADDRESS = "http://127.0.0.1:8000"
#: HTTP Host
DEFAULT_HTTP_HOST = "127.0.0.1"
#: HTTP Port
DEFAULT_HTTP_PORT... | {
"repo_name": "ray-project/ray",
"path": "python/ray/serve/constants.py",
"copies": "1",
"size": "1138",
"license": "apache-2.0",
"hash": 7028911325809912000,
"line_mean": 21.76,
"line_max": 74,
"alpha_frac": 0.6810193322,
"autogenerated": false,
"ratio": 3.1349862258953167,
"config_test": fals... |
""" Actor proxy for rodario framework """
# stdlib
import types
import pickle
from multiprocessing import Queue
from threading import Thread
from uuid import uuid4
from time import sleep
# local
from rodario import get_redis_connection
from rodario.future import Future
from rodario.exceptions import InvalidActorExcep... | {
"repo_name": "haliphax/rodario",
"path": "rodario/actors/proxy.py",
"copies": "1",
"size": "4183",
"license": "mit",
"hash": -6689887794378797000,
"line_mean": 32.464,
"line_max": 80,
"alpha_frac": 0.5943103036,
"autogenerated": false,
"ratio": 4.5026910656620025,
"config_test": false,
"has_... |
""" actor.py
The actor is the intelligent portion of our DSM implementation. The nodes
are just network-enabled dictionaries, it is the actor that knows how to
perform the replication.
"""
import itertools
import math
import uuid
# An Item is a value, tag, creator id tuple
def Item(value, tag, creator):
... | {
"repo_name": "desmaj/dish",
"path": "dish/actor.py",
"copies": "1",
"size": "4375",
"license": "mit",
"hash": -3011497030232617500,
"line_mean": 32.3969465649,
"line_max": 86,
"alpha_frac": 0.5426285714,
"autogenerated": false,
"ratio": 4.186602870813397,
"config_test": false,
"has_no_keywor... |
""" Actor registry for rodario framework """
# local
from rodario import get_redis_connection
from rodario.exceptions import RegistrationException
# pylint: disable=C1001
class _RegistrySingleton(object):
""" Singleton for actor registry """
def __init__(self, prefix=None):
"""
Initialize t... | {
"repo_name": "haliphax/rodario",
"path": "rodario/registry.py",
"copies": "1",
"size": "2356",
"license": "mit",
"hash": 8727413672270164000,
"line_mean": 23.5416666667,
"line_max": 70,
"alpha_frac": 0.5891341256,
"autogenerated": false,
"ratio": 4.371057513914657,
"config_test": false,
"has... |
"""Actors are tools for rapidly adding multiprocessing behavior to your game."""
import greenlet
import spyral
class Actor(object):
"""
Actors are a powerful mechanism for quickly adding multiprocessing behavior
to your game through `Greenlets <http://greenlet.readthedocs.org/>`_ .
Any object that sub... | {
"repo_name": "danShumway/python_math",
"path": "source/PythonMath.activity/libraries/spyral/spyral/actor.py",
"copies": "2",
"size": "2766",
"license": "mit",
"hash": 7654016349168394000,
"line_mean": 36.8904109589,
"line_max": 80,
"alpha_frac": 0.6099060014,
"autogenerated": false,
"ratio": 4.6... |
"""Actors communicate with each other by sending and receiving messages.
The :mod:`pulsar.async.mailbox` module implements the message passing layer
via a bidirectional socket connections between the :class:`.Arbiter`
and any :class:`.Actor`.
Message sending is asynchronous and safe, the message is guaranteed to
event... | {
"repo_name": "quantmind/pulsar",
"path": "pulsar/async/mailbox.py",
"copies": "1",
"size": "9672",
"license": "bsd-3-clause",
"hash": -5219507821772261000,
"line_mean": 32.3517241379,
"line_max": 78,
"alpha_frac": 0.5712365591,
"autogenerated": false,
"ratio": 4.568729333963155,
"config_test":... |
'''Actors communicate with each other by sending and receiving messages.
The :mod:`pulsar.async.mailbox` module implements the message passing layer
via a bidirectional socket connections between the :class:`.Arbiter`
and any :class:`.Actor`.
Message sending is asynchronous and safe, the message is guaranteed to
event... | {
"repo_name": "dejlek/pulsar",
"path": "pulsar/async/mailbox.py",
"copies": "1",
"size": "10058",
"license": "bsd-3-clause",
"hash": -277900762088121570,
"line_mean": 32.5266666667,
"line_max": 79,
"alpha_frac": 0.5722807715,
"autogenerated": false,
"ratio": 4.520449438202247,
"config_test": fa... |
"""Actors.
An actor is just a function running in a thread that processes messages
from a queue, and you interact with an actor through a stub object.
A few kinds of actor are implemented here:
* Object-based actor that interprets messages as method calls of the
object bound to this actor.
* Function-calling acto... | {
"repo_name": "clchiou/garage",
"path": "py/g1/threads/g1/threads/actors.py",
"copies": "1",
"size": "4221",
"license": "mit",
"hash": -5737325177231955000,
"line_mean": 24.125,
"line_max": 79,
"alpha_frac": 0.6244965648,
"autogenerated": false,
"ratio": 3.8831646734130634,
"config_test": false... |
'''
This module contains functions which run antsCorticalThickness and ROI
extractions and then uploads them to S3
'''
# Create the ACT nipype workflow
def create_workflow(wf_base_dir, input_anat, oasis_path):
'''
Method to create the nipype workflow that is executed for
preprocessing the data
Parame... | {
"repo_name": "computational-neuroimaging-lab/Clark2015_AWS",
"path": "data-preproc/scripts/act_run.py",
"copies": "1",
"size": "11946",
"license": "mit",
"hash": -2274379907119019000,
"line_mean": 31.2864864865,
"line_max": 107,
"alpha_frac": 0.6334337854,
"autogenerated": false,
"ratio": 3.6858... |
'''Acts as an interface between what Flask serves and what goes on in
the rest of the application.
'''
from avenue import app
from avenue.database import content
from flask import render_template, make_response, redirect
from os import path
import yaml
def read_data(filename):
'''Reads in data from a given YML fil... | {
"repo_name": "Aethaeryn/avenue",
"path": "avenue/web.py",
"copies": "1",
"size": "3201",
"license": "mit",
"hash": -2802460668790026000,
"line_mean": 32.34375,
"line_max": 80,
"alpha_frac": 0.5760699781,
"autogenerated": false,
"ratio": 4.125,
"config_test": false,
"has_no_keywords": false,
... |
"""Acts like a Pymongo client to TinyDB"""
# coding: utf-8
from __future__ import absolute_import
import copy
from functools import reduce
import logging
import os
from math import ceil
from operator import itemgetter
from uuid import uuid1
from tinydb import Query, TinyDB, where
from .results import (
InsertOne... | {
"repo_name": "schapman1974/tinymongo",
"path": "tinymongo/tinymongo.py",
"copies": "1",
"size": "27161",
"license": "mit",
"hash": -2574199815314873000,
"line_mean": 32.4495073892,
"line_max": 114,
"alpha_frac": 0.5095541401,
"autogenerated": false,
"ratio": 4.682931034482759,
"config_test": f... |
"""Actual device classes."""
import enum
import glob
import logging
import os
import os.path
import random
import re
import struct
import subprocess
import warnings
from typing import Any, List, Tuple
import serial
from . import usb
from .devices_base import Board, BoardMeta
try:
# See if we have vision support... | {
"repo_name": "sourcebots/robotd",
"path": "robotd/devices.py",
"copies": "1",
"size": "15667",
"license": "mit",
"hash": 7356298522979578000,
"line_mean": 27.6941391941,
"line_max": 90,
"alpha_frac": 0.5376906874,
"autogenerated": false,
"ratio": 3.9623166413758217,
"config_test": false,
"ha... |
""" Actual implementation of service """
import logging
from datetime import datetime
import threading
import xbmc
import xbmcgui
from resources.lib.service_api import Api
from resources.lib.objects.movies import FullMovieUpdater, IncrementalMovieUpdater
import resources.lib.objects.database as database
from resourc... | {
"repo_name": "sebastian-steinmann/kodi-repo",
"path": "src/service.library.video/resources/lib/librarysync.py",
"copies": "1",
"size": "8739",
"license": "mit",
"hash": -4788943123480958000,
"line_mean": 30.103202847,
"line_max": 104,
"alpha_frac": 0.5767250257,
"autogenerated": false,
"ratio": ... |
""" Actual implementation of service """
import logging
import xbmc
import resources.lib.loghandler as loghandler
from librarysync import Library
loghandler.config()
log = logging.getLogger("DINGS.service") # pylint: disable=invalid-name
class Service(object):
""" Root service for sync """
library_running... | {
"repo_name": "sebastian-steinmann/kodi-repo",
"path": "src/service.library.video/resources/lib/service_entry.py",
"copies": "1",
"size": "1293",
"license": "mit",
"hash": -2053233601908875000,
"line_mean": 26.5106382979,
"line_max": 72,
"alpha_frac": 0.6117556071,
"autogenerated": false,
"ratio"... |
"""actually Dropping unused columns now
Revision ID: be0687950ece
Revises: d547cd837350
Create Date: 2017-03-01 05:39:20.282931
"""
# revision identifiers, used by Alembic.
revision = 'be0687950ece'
down_revision = 'd547cd837350'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | {
"repo_name": "fake-name/ReadableWebProxy",
"path": "alembic/versions/00030_be0687950ece_actually_dropping_unused_columns_now.py",
"copies": "1",
"size": "2541",
"license": "bsd-3-clause",
"hash": -669237704050494700,
"line_mean": 40.6557377049,
"line_max": 181,
"alpha_frac": 0.7347500984,
"autogen... |
#actually get the tweets and save em and what not
import tweepyutils
import pgutils
import parsetweets
import requests
import json
#import spellcheck
pgCursor = pgutils.getCursor()
list = None
tweetTypes = None
def log(string):
print string
def init():
global list
list = tweepyutils.search(q='dream la... | {
"repo_name": "nthitz/dreamlastnight",
"path": "dreamcatcher/getTweets.py",
"copies": "1",
"size": "3867",
"license": "mit",
"hash": 4903793119929637,
"line_mean": 33.8378378378,
"line_max": 173,
"alpha_frac": 0.6783035945,
"autogenerated": false,
"ratio": 3.3221649484536084,
"config_test": fal... |
# Actually Randomize Cards
# a.k.a. Randomize Cards As Opposed To Notes
# a.k.a. Randomize Cards Without Keeping Siblings Together
# bits and pieces cobbled together from anki/sched.py, aqt/browser.py, aqt/forms/browser.py
import random
from anki.hooks import addHook
from aqt import mw
from anki.utils import ids2str,... | {
"repo_name": "cooijmanstim/actually-randomize",
"path": "actually_randomize.py",
"copies": "2",
"size": "1668",
"license": "mit",
"hash": 3793556797617702000,
"line_mean": 33.75,
"line_max": 101,
"alpha_frac": 0.7146282974,
"autogenerated": false,
"ratio": 3.2578125,
"config_test": false,
"h... |
# ActuallySolveable Block Cipher
def bytesToInt(xs): return sum(x<<(i*8) for i,x in enumerate(xs))
def intToBytes(x): return [(x >> (8 * i)) & 0xFF for i in xrange(8)]
sbox = [ ((2 * i + 0x101) * 0x61 / 2) & 0xFF for i in range(256) ]
sinv = sorted(range(256), key=lambda i: sbox[i])
def T(block):
# bit transpose... | {
"repo_name": "nickbjohnson4224/greyhat-crypto-ctf-2014",
"path": "challenges/actually/actually.py",
"copies": "1",
"size": "2117",
"license": "mit",
"hash": -1274105100204192000,
"line_mean": 32.09375,
"line_max": 82,
"alpha_frac": 0.522909778,
"autogenerated": false,
"ratio": 2.6933842239185752... |
# Actuary, a Django Auditing app
# by Barry Melton, 7/5/2012
# MIT-licensed - http://www.opensource.org/licenses/mit-license.php/
import datetime
import settings
import logging
logger = logging.getLogger('django')
# Should import settings. There are settings values that need to be set,
# namely,
# ACTUARY_USE_CEL... | {
"repo_name": "antiface/Django-Actuary",
"path": "actuary/middleware.py",
"copies": "2",
"size": "1647",
"license": "mit",
"hash": -4808610603088647000,
"line_mean": 29.5,
"line_max": 75,
"alpha_frac": 0.6077717061,
"autogenerated": false,
"ratio": 3.6518847006651884,
"config_test": false,
"h... |
"""Acumen-specific report generation
HTML formatted output summarizing Acumen results. The core reports here are
useful for any project using Acumen. The following reports provide a snapshot
of the state of data, metrics, alerts and events.
- acumen.html : overall summary
- aucmen.html#data : table of data feeds ... | {
"repo_name": "jfalkner/acumen",
"path": "acumen/report.py",
"copies": "1",
"size": "9266",
"license": "apache-2.0",
"hash": -7317640222883566000,
"line_mean": 37.1316872428,
"line_max": 183,
"alpha_frac": 0.539607166,
"autogenerated": false,
"ratio": 3.778955954323002,
"config_test": true,
"... |
# acu.py
# script that scape the acu votes on "http://acuratings.conservative.org/acu-federal-legislative-ratings/"
# last time validated: Oct 16, 2015
# Owner: Yubo Tian
from bs4 import BeautifulSoup
import urllib.request
import psycopg2
import re
from optparse import OptionParser
import sys
BASE_URL = "http://acura... | {
"repo_name": "bwalenz/us-congress-data",
"path": "scripts/SIG-scripts/acu.py",
"copies": "1",
"size": "3657",
"license": "apache-2.0",
"hash": 5297706230622604000,
"line_mean": 27.8031496063,
"line_max": 146,
"alpha_frac": 0.6253759912,
"autogenerated": false,
"ratio": 2.76,
"config_test": fal... |
# a = current, b = total
def divide_by_seven(current, total):
total = total + current
if total > 7:
total = total%7
return current, total
def century_item(current, total):
current = current % 4
current = 3 - current
current = 2 * current
return divide_by_seven(current, total)
def y... | {
"repo_name": "niklasnson/TDP015",
"path": "inlämning_4/day_of_the_week.py",
"copies": "1",
"size": "1880",
"license": "mit",
"hash": -3957070365534817300,
"line_mean": 26.2463768116,
"line_max": 66,
"alpha_frac": 0.5622340426,
"autogenerated": false,
"ratio": 3.2302405498281788,
"config_test":... |
"""A Custom Estimator implementing linear regression for MNIST using Keras.
For reference:
* https://www.tensorflow.org/extend/estimators.
* https://www.tensorflow.org/get_started/mnist/beginners.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import... | {
"repo_name": "mari-linhares/tensorflow-workshop",
"path": "code_samples/MNIST_Estimators/keras/beginners.py",
"copies": "1",
"size": "3207",
"license": "apache-2.0",
"hash": 1474506712587315200,
"line_mean": 26.1779661017,
"line_max": 77,
"alpha_frac": 0.6894293732,
"autogenerated": false,
"rati... |
"""A custom grid plane with a lot more flexibility than
GridPlane. This also only works for non-unstructured/non-polygonal
datasets.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traits.api import Instance
fr... | {
"repo_name": "liulion/mayavi",
"path": "mayavi/modules/custom_grid_plane.py",
"copies": "3",
"size": "2178",
"license": "bsd-3-clause",
"hash": 9023820482341209000,
"line_mean": 37.2105263158,
"line_max": 74,
"alpha_frac": 0.5142332415,
"autogenerated": false,
"ratio": 4.663811563169165,
"conf... |
"""A custom ILAMB confrontation for net ecosystem productivity (nep)."""
import os
import numpy as np
from ILAMB.Confrontation import Confrontation
from ILAMB.Variable import Variable
from ILAMB.ilamblib import MakeComparable
class ConfNEP(Confrontation):
"""Confront ``nep`` model outputs with ``nee`` observation... | {
"repo_name": "permamodel/ILAMB-experiments",
"path": "2/ConfNEP.py",
"copies": "1",
"size": "1208",
"license": "mit",
"hash": 7404815312859305000,
"line_mean": 33.5142857143,
"line_max": 72,
"alpha_frac": 0.6117549669,
"autogenerated": false,
"ratio": 3.8594249201277955,
"config_test": false,
... |
''' A custom Importer making use of the import hook capability
https://www.python.org/dev/peps/pep-0302/
Its purpose is to convert would-be Python module that use non-standard
syntax into a correct form prior to importing them.
'''
# imp is deprecated but I wasn't (yet) able to figure out how to use
# its replacemen... | {
"repo_name": "aroberge/python_experiments",
"path": "version4/import_experimental.py",
"copies": "1",
"size": "4194",
"license": "cc0-1.0",
"hash": 3537951259025348600,
"line_mean": 33.95,
"line_max": 78,
"alpha_frac": 0.6099189318,
"autogenerated": false,
"ratio": 4.319258496395468,
"config_t... |
"""A custom JSON encoder with support for Decimal and SqlAlchemy models."""
import json
import decimal as d
from db import OrmBase
from sqlalchemy.inspection import inspect
from datetime import datetime
class TswStatsEncoder(json.JSONEncoder):
"""A custom JSON encoder with support for Decimal and SqlAlchemy mode... | {
"repo_name": "proegssilb/tsw-stats",
"path": "jsonEncoder.py",
"copies": "1",
"size": "1203",
"license": "apache-2.0",
"hash": 5593440801891939000,
"line_mean": 31.5135135135,
"line_max": 79,
"alpha_frac": 0.6184538653,
"autogenerated": false,
"ratio": 4.177083333333333,
"config_test": false,
... |
"""A custom labler class.
Custom labler for checking and removing less used categorical
class and also ensure to data coverage is effective.
Default settings for data coverage is 80%.
"""
import pandas as pd
class CUST_CATEGORY_LABELER():
"""Custom Mapper Function.
Based on pd.Series.values_counts, a labl... | {
"repo_name": "msampathkumar/datadriven_pumpit",
"path": "scripts/sam_custom_labeler.py",
"copies": "1",
"size": "6494",
"license": "apache-2.0",
"hash": 6862054132002705000,
"line_mean": 31.3084577114,
"line_max": 79,
"alpha_frac": 0.5566676933,
"autogenerated": false,
"ratio": 4.238903394255875... |
""" a custom layer for 'argmax', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/argmax.html
"""
from .register import register
def import_fluid():
import paddle.fluid as fluid
return fluid
def argmax_shape(input_shape, out_max... | {
"repo_name": "lcy-seso/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/argmax.py",
"copies": "3",
"size": "2319",
"license": "apache-2.0",
"hash": -8575711416947760000,
"line_mean": 30.7671232877,
"line_max": 92,
"alpha_frac": 0.6295817163,
"autogenerated": false,
"r... |
""" A custom layer for 'axpy' which receives 3 tensors and output 1 tensor.
the function performed is:(the mupltiplication and add are elementewise)
output = inputs[0] * inputs[1] + inputs[2]
"""
from .register import register
def axpy_shape(input_shapes):
""" calculate the output shape of this layer... | {
"repo_name": "qingqing01/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/axpy.py",
"copies": "3",
"size": "1545",
"license": "apache-2.0",
"hash": 6581878940241726000,
"line_mean": 29.2941176471,
"line_max": 81,
"alpha_frac": 0.6459546926,
"autogenerated": false,
"ra... |
""" a custom layer for 'crop', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/crop.html
"""
from .register import register
def crop_shape(input_shape, shape=None):
""" calculate the output shape of this layer using input shape
... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/crop.py",
"copies": "1",
"size": "2632",
"license": "apache-2.0",
"hash": 2906157286032259000,
"line_mean": 33.1818181818,
"line_max": 98,
"alpha_frac": 0.6276595745,
"autogenerated": false,
"ratio": 4.0121951219... |
""" a custom layer for 'crop', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/reduction.html
"""
from .register import register
def reduction_shape(input_shape, axis=0):
""" calculate the output shape of this layer using input shape... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/reduction.py",
"copies": "1",
"size": "2316",
"license": "apache-2.0",
"hash": 1107174109217678200,
"line_mean": 33.5671641791,
"line_max": 95,
"alpha_frac": 0.6377374784,
"autogenerated": false,
"ratio": 3.80921... |
""" A custom layer for 'detectionout' used in 'SSD' model to produce outputs
Note: Since Paddle's implementation of 'detectionout' applied 'flatten' and 'softmax' ops on the input of 'conf',
while Caffe's implementation do not. Hence, you should ajust generated 'ssd.py' to remove 'softmax' and 'flatten' ops ap... | {
"repo_name": "qingqing01/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/detection_out.py",
"copies": "2",
"size": "2576",
"license": "apache-2.0",
"hash": 4663929233976728000,
"line_mean": 31.6075949367,
"line_max": 146,
"alpha_frac": 0.6036490683,
"autogenerated": fa... |
""" a custom layer for 'flatten', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/flatten.html
"""
from .register import register
def flatten_shape(input_shape, axis=1, end_axis=-1):
""" calculate the output shape of this layer using... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/flatten.py",
"copies": "3",
"size": "2107",
"license": "apache-2.0",
"hash": 4530649652735819000,
"line_mean": 30.9242424242,
"line_max": 93,
"alpha_frac": 0.6473659231,
"autogenerated": false,
"ratio": 3.6140651... |
""" A custom layer for 'normalize' op
"""
from .register import register
def normalize_shape(input_shape,
across_spatial=True,
scale_filler=True,
eps=1e-10):
""" calculate the output shape of this layer using input shapes
Args:
@input_shape... | {
"repo_name": "qingqing01/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/normalize.py",
"copies": "3",
"size": "1679",
"license": "apache-2.0",
"hash": -4277120959281076000,
"line_mean": 28.9821428571,
"line_max": 96,
"alpha_frac": 0.6086956522,
"autogenerated": false,... |
""" A custom layer for 'Permute' which is equivalent to transpose in paddle
"""
from .register import register
def permute_shape(input_shape, order):
""" calculate the output shape of this layer using input shapes
Args:
@input_shape (list of numbers): input shape
Returns:
@output_shape ... | {
"repo_name": "qingqing01/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/permute.py",
"copies": "3",
"size": "1112",
"license": "apache-2.0",
"hash": 8200731848080964000,
"line_mean": 26.8,
"line_max": 81,
"alpha_frac": 0.6618705036,
"autogenerated": false,
"ratio": ... |
""" a custom layer for 'power', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/power.html
"""
from .register import register
def power_shape(input_shape, shape=None):
""" calculate the output shape of this layer using input shape
... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/power.py",
"copies": "1",
"size": "1292",
"license": "apache-2.0",
"hash": 6213474327867211000,
"line_mean": 31.3,
"line_max": 91,
"alpha_frac": 0.6803405573,
"autogenerated": false,
"ratio": 3.9510703363914375,
... |
""" A custom layer for 'priorbox' which is used in ssd to generate prior box info
Since the order of prior box is different between caffe and paddle,
we use 'slice' and 'concate' ops to align them.
"""
from .register import register
def priorbox_shape(input_shapes, min_size, max_size=None, aspect_ratio=None)... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/priorbox.py",
"copies": "1",
"size": "3272",
"license": "apache-2.0",
"hash": 4222775013600517000,
"line_mean": 30.7669902913,
"line_max": 101,
"alpha_frac": 0.5770171149,
"autogenerated": false,
"ratio": 3.56427... |
""" a custom layer for 'reshape', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/reshape.html
"""
from .register import register
def import_fluid():
import paddle.fluid as fluid
return fluid
def reshape_shape(input_sp, shape, ... | {
"repo_name": "lcy-seso/models",
"path": "fluid/image_classification/caffe2fluid/kaffe/custom_layers/reshape.py",
"copies": "3",
"size": "4532",
"license": "apache-2.0",
"hash": -8512078178968749000,
"line_mean": 33.0751879699,
"line_max": 98,
"alpha_frac": 0.6171668138,
"autogenerated": false,
"... |
""" a custom layer for 'ROIPooling', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/ROIPooling.html
"""
from .register import register
def roipooling_shape(input_shapes, pooled_h, pooled_w, spatial_scale):
""" calculate the output s... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/roipooling.py",
"copies": "3",
"size": "1957",
"license": "apache-2.0",
"hash": -1320765194333184500,
"line_mean": 35.9245283019,
"line_max": 96,
"alpha_frac": 0.6673479816,
"autogenerated": false,
"ratio": 3.657... |
""" a custom layer for 'select' which is used to replace standard 'Slice' layer
for converting layer with multiple different output tensors
"""
from .register import register
def select_shape(input_shape, slice_point, axis=1):
""" calculate the output shape of this layer using input shape
Args:
... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleCV/caffe2fluid/kaffe/custom_layers/select.py",
"copies": "3",
"size": "1966",
"license": "apache-2.0",
"hash": 6209454951546619000,
"line_mean": 28.3432835821,
"line_max": 85,
"alpha_frac": 0.6388606307,
"autogenerated": false,
"ratio": 3.87771203... |
"""A custom list that manages index/position information for its children.
``orderinglist`` is a custom list collection implementation for mapped
relations that keeps an arbitrary "position" attribute on contained objects in
sync with each object's position in the Python list.
The collection acts just like a normal P... | {
"repo_name": "obeattie/sqlalchemy",
"path": "lib/sqlalchemy/ext/orderinglist.py",
"copies": "1",
"size": "10847",
"license": "mit",
"hash": 2410058560223590400,
"line_mean": 35.8945578231,
"line_max": 81,
"alpha_frac": 0.6411911128,
"autogenerated": false,
"ratio": 4.149579188982402,
"config_t... |
"""A custom list that manages index/position information for its children.
``orderinglist`` is a custom list collection implementation for mapped relations
that keeps an arbitrary "position" attribute on contained objects in sync with
each object's position in the Python list.
The collection acts just like a normal P... | {
"repo_name": "carlgao/lenga",
"path": "images/lenny64-peon/usr/share/python-support/python-sqlalchemy/sqlalchemy/ext/orderinglist.py",
"copies": "5",
"size": "9530",
"license": "mit",
"hash": -3468236574518892500,
"line_mean": 36.96812749,
"line_max": 80,
"alpha_frac": 0.6495278069,
"autogenerated... |
"""A custom pygments lexer for IPython code cells.
Informs The pygments highlighting library of the quirks of IPython's superset
of Python -- magic commands, !shell commands, etc.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# ... | {
"repo_name": "noslenfa/tdjangorest",
"path": "uw/lib/python2.7/site-packages/IPython/nbconvert/utils/lexers.py",
"copies": "2",
"size": "1775",
"license": "apache-2.0",
"hash": 4327979201780903400,
"line_mean": 37.5869565217,
"line_max": 78,
"alpha_frac": 0.4766197183,
"autogenerated": false,
"r... |
# A custom Python file to containing utility (helper)
# [mostly independent] functions that are sometimes
# used within the app
import json
# JSON dump object
def dump(obj):
return json.dumps(obj.__dict__)
# parses attributes of a query row object to a dict
def row2dict(row):
d = {}
for column in row... | {
"repo_name": "takwas/flask_app_template",
"path": "template_app/utils.py",
"copies": "1",
"size": "1799",
"license": "mit",
"hash": -5845515224720204000,
"line_mean": 22.9866666667,
"line_max": 218,
"alpha_frac": 0.6903835464,
"autogenerated": false,
"ratio": 3.3314814814814815,
"config_test":... |
'''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
import os
import re
from rq.worker import HerokuWorker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
# need tuple of tuple pairs, regex string to msg template
# the regex needs to... | {
"repo_name": "barbarahui/harvester",
"path": "harvester/rq_worker_sns_msgs.py",
"copies": "3",
"size": "3794",
"license": "bsd-3-clause",
"hash": -715553217585658400,
"line_mean": 40.2391304348,
"line_max": 78,
"alpha_frac": 0.6122825514,
"autogenerated": false,
"ratio": 3.526022304832714,
"co... |
"""A custom utils library used across docker scripts."""
import argparse
import dns
import inspect
import json
import os
import time
def standard_arg_parser(desc):
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description=desc)
parser.add_argument(... | {
"repo_name": "xorver/oneprovider_ccm",
"path": "bamboos/docker/environment/common.py",
"copies": "1",
"size": "3352",
"license": "mit",
"hash": -7336870093287537000,
"line_mean": 26.7024793388,
"line_max": 77,
"alpha_frac": 0.616646778,
"autogenerated": false,
"ratio": 3.8796296296296298,
"con... |
"""AcyclicReachability.py
Bit-parallel algorithm for testing which vertices can reach which other
vertices in a DAG.
Usage:
R = Reachability(G)
...
R.reachable(source,destination)
returns a boolean value: True if G contains a path from the source vertex
to the destination vertex, and False otherwise. The ... | {
"repo_name": "jfinkels/PADS",
"path": "pads/acyclic_reachability.py",
"copies": "1",
"size": "1191",
"license": "mit",
"hash": 2496563003467608000,
"line_mean": 29.5384615385,
"line_max": 79,
"alpha_frac": 0.6389588581,
"autogenerated": false,
"ratio": 3.866883116883117,
"config_test": false,
... |
#AD 440
#Cloud Practicum
#
#File contains methods for all api routing calls.
#This includes methods for GET,PUT,POST,DELETE
#
#
from flask import Flask
from flask import make_response
from flask import request
from flask import jsonify
from azure_components import static
from azure_components.api_methods import *
fr... | {
"repo_name": "rjhunter8285/nsc-cloudproject-s22016",
"path": "api/FlaskApp/FlaskApp/__init__.py",
"copies": "2",
"size": "4858",
"license": "apache-2.0",
"hash": 7035977020739480000,
"line_mean": 31.3866666667,
"line_max": 81,
"alpha_frac": 0.6770275834,
"autogenerated": false,
"ratio": 3.927243... |
"""ADA Claim Form Fields
all dates formatted '%m/%d/%Y'
HEADER INFORMATION
1. Type of Transaction
Statement of Actual Services
Request for Predetermination
2. Predetermination/Preauthorization Number
PRIMARY PAYER INFORMATION
3. Name & Address
OTHER COVERAGE
4. Other Dental or Medical Coverage? (No, Yes)
... | {
"repo_name": "homey1337/efnpractice",
"path": "claim.py",
"copies": "1",
"size": "4050",
"license": "bsd-2-clause",
"hash": -1701860580304280800,
"line_mean": 22.4104046243,
"line_max": 82,
"alpha_frac": 0.6125925926,
"autogenerated": false,
"ratio": 3.32239540607055,
"config_test": false,
"... |
""" A daemon thread manager that can be controlled from the privledge shell
"""
from privledge import block
from privledge import settings
from privledge import utils
from privledge import messaging
from privledge.ledger import Ledger
import json
import socket
ledger = None
peers = dict()
disc_ledgers = dict()
disc_... | {
"repo_name": "elBradford/privledge",
"path": "privledge/daemon.py",
"copies": "1",
"size": "6320",
"license": "mit",
"hash": 8597350922429139000,
"line_mean": 29.8292682927,
"line_max": 118,
"alpha_frac": 0.6132911392,
"autogenerated": false,
"ratio": 3.8210399032648126,
"config_test": false,
... |
""" Adafactor Optimizer
Lifted from https://github.com/pytorch/fairseq/blob/master/fairseq/optim/adafactor.py
Original header/copyright below.
"""
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/optim/adafactor.py",
"copies": "1",
"size": "8126",
"license": "apache-2.0",
"hash": 1195391183907307300,
"line_mean": 45.7068965517,
"line_max": 114,
"alpha_frac": 0.5617770121,
"autogenerated": false,
"ratio": 3.737810487580497,
"c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.