text
stringlengths
4
1.02M
meta
dict
import random from math import isnan from collections import OrderedDict, namedtuple from lxml import etree from pandas import Series, concat from omicexperiment.plotting.plot_pygal import return_plot, return_plot_tree PositionData = namedtuple("PositionData", 'x,y,x1,x2') def return_y_position_group_label(tree): ...
{ "content_hash": "eb7cf5387e386faedac26d4fdb591645", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 171, "avg_line_length": 30.082417582417584, "alnum_prop": 0.6321461187214612, "repo_name": "bassio/omicexperiment", "id": "54b869c5adaae1e8ffddbcce987f307be4b04ec6", "size...
from .base import SettingsBase class SettingsLocalSqlite(SettingsBase): DEBUG = True BASE_URL = 'http://127.0.0.1:8004' def JS_CONFIG(self): conf = super(SettingsLocalSqlite, self).JS_CONFIG() conf['WS_SERVER'] = 'http://127.0.0.1:22000/ws' conf['ENABLE_REGISTER'] = True ...
{ "content_hash": "b2b2270d4f193ddeff17b62064306fc3", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 59, "avg_line_length": 24.95, "alnum_prop": 0.5751503006012024, "repo_name": "h2020-westlife-eu/VRE", "id": "19f983920051eb52296d693243cfba1089e880f0", "size": "601", "bi...
import asyncio import discord import random from discord.ext import commands from Cogs import DisplayName from Cogs import Nullify class Eat: # Init with the bot reference, and a reference to the settings var def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def eat(self,...
{ "content_hash": "fda6e2d8d215b9cca4377d6dd3af87a1", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 149, "avg_line_length": 48.5, "alnum_prop": 0.6606297018668152, "repo_name": "Mercurial/CorpBot.py", "id": "72c540713581cb963483ad3220bb210fa857f65e", "size": "3589", "bi...
""" Deep Residual Network. Applying a Deep Residual Network to CIFAR-10 Dataset classification task. References: - K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition, 2015. - Learning Multiple Layers of Features from Tiny Images, A. Krizhevsky, 2009. Links: - [Deep Re...
{ "content_hash": "deca7d36d74c52974ee0d7946884e5f0", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 81, "avg_line_length": 35.73134328358209, "alnum_prop": 0.6904761904761905, "repo_name": "hashware/tflearn-learn", "id": "df90f58b5d3e157ce9817532beb3737960cf92ce", "size":...
from suma.api.serializers.link import serialize_create_link, serialize_get_link
{ "content_hash": "0f56d6d7f71bfe282dfef43bd692c93f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 79, "avg_line_length": 80, "alnum_prop": 0.8375, "repo_name": "rach/suma", "id": "4bdc79d23a7b81ccfdde495124d29ca765a21f65", "size": "80", "binary": false, "copies": "1"...
from __future__ import absolute_import from __future__ import unicode_literals from py_privatekonomi.core.models.base_model import BaseModel from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey, Numeric, ForeignKeyConstraint from collections import OrderedDict class SecurityProvider(BaseModel): ...
{ "content_hash": "7f5722f3ebd1bffb4757d5ab513197e8", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 106, "avg_line_length": 46.55, "alnum_prop": 0.6541353383458647, "repo_name": "nilsFK/py-privatekonomi", "id": "244d7efad1a6783b06b004b4610492cdb1370ec6", "size": "977", ...
import click from tabulate import tabulate from ..util import format_money, format_percent def _get_total_payments(connection): command = 'SELECT cast(sum(amount) AS REAL) / 100 FROM payments' total_payments = connection.execute(command).fetchone()[0] return total_payments if total_payments else 0.0 def ...
{ "content_hash": "a1e3d1226722cf7f661a47109db22fd0", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 34.15151515151515, "alnum_prop": 0.6832298136645962, "repo_name": "dguo/churn", "id": "dbec374a8328a056ca4a3d19e34ec962b9a24ec4", "size": "1127", "...
from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ "python-dateutil==2.7.3", "dateutils==0.6.6", "chardet==3.0.4", "notify2==0.3.1", ] test_requirements = [ ...
{ "content_hash": "605bf067954799d95678f87cedf14187", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 25.2, "alnum_prop": 0.5818070818070818, "repo_name": "paulollivier/bureaucrate", "id": "95f0ab177db6e6648c2325fe123f354df66347b0", "size": "1686", ...
from sphinxql import indexes, fields from sphinxql.manager import IndexManager from .models import Entity, Contract, Tender class EntityIndex(indexes.Index): name = fields.Text('name') class Meta: model = Entity class Manager(IndexManager): def get_queryset(self): return super(Manager,...
{ "content_hash": "d636ada1581a7d347bf48a8ae76bdb31", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 24.612244897959183, "alnum_prop": 0.6674958540630183, "repo_name": "jorgecarleitao/public-contracts", "id": "226cefe0f1d9594dcbe5ed61cbf31f7f62372eab",...
''' Exodus Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the h...
{ "content_hash": "9980038aade5eb9f210e79b1bf4c0552", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 183, "avg_line_length": 38.02040816326531, "alnum_prop": 0.4918142780461621, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "efc039a2b1d4e79d805cd6bf97fc427773ad4c0d", ...
import os import sys import copy import time import tarfile import base64 sys.path.append('../../') from externals.simple_oss import SimpleOss from batchcompute import ( Client, JobDescription, TaskDag, TaskDescription, ResourceDescription ) import config as cfg INSTANCE_COUNT = 4 oss_clnt = SimpleOss(cfg.OSS_HOS...
{ "content_hash": "d7e8d4b24476b5c2f1343d2935c34737", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 28.926315789473684, "alnum_prop": 0.6171761280931587, "repo_name": "luzhijun/Optimization", "id": "38576dc76271af343b5e9be779e673ba9644e352", "size":...
length = 12 width = 10 height = 6 face1 = length * width face2 = length * height face3 = width * height area = (2 * face1) + (2 * face2) + (2 * face3) print "The surface area of a rectangular solid with" print "length", length print "width", width print "height", height print "is", area, "square units"
{ "content_hash": "d17d2dafc86cc94ca0e35eb2ea0db99b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 52, "avg_line_length": 25.25, "alnum_prop": 0.6798679867986799, "repo_name": "guvjose/ComputerScience1", "id": "0e12e62122053719481c6de9a2443ec77b4de8e9", "size": "351", ...
import os import tempfile import warnings from subprocess import PIPE from nltk.internals import ( _java_options, config_java, find_jar_iter, find_jars_within_path, java, ) from nltk.parse.api import ParserI from nltk.parse.dependencygraph import DependencyGraph from nltk.tree import Tree _stanfor...
{ "content_hash": "327c54b44767c164d0c50114c13fc111", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 152, "avg_line_length": 40.29004329004329, "alnum_prop": 0.5256258729988181, "repo_name": "nltk/nltk", "id": "03db9378253404cda806784ed4225f2c0c354935", "size": "18842", ...
import unittest import sympy as sp import numpy as np import sys import os sys.path.append('.') import stats.methods as methods from stats.utils import * class TestBasicSearch(unittest.TestCase): def setUp(self): self.num_vals = 20 # number of source values def test_quadratic(self): ...
{ "content_hash": "e0ab41929cffdd3f813b3ef64d89159e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 70, "avg_line_length": 29.359375, "alnum_prop": 0.5141032464076637, "repo_name": "budnyjj/NLRA", "id": "688027061137a05b1e85dd7ad750b6aa5a197ff0", "size": "1879", "binary...
import os import time import stat import json import random import ctypes import inspect import requests import traceback import threading from collections import Counter from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import ROOT from common.params import Params from common.api import api_get f...
{ "content_hash": "45cc44a50649e126e55f0d9c61d3b384", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 116, "avg_line_length": 27.353383458646615, "alnum_prop": 0.6227322704782847, "repo_name": "heidecjj/openpilot", "id": "ccaf63252861c45421673def3b919c2fe0aa7ec4", "size": ...
import copy import unittest from mahjong import flow from mahjong.patterns import MatchResult from mahjong.types import Hand, GameContext, GameSettings, Tile, TileGroup, Wall class TestHandler(unittest.TestCase): def setUp(self): self.context = GameContext() self.handler = flow.Handler() de...
{ "content_hash": "f0e6ac001bce83ae5d15024cc1c04245", "timestamp": "", "source": "github", "line_count": 1775, "max_line_length": 116, "avg_line_length": 45.36394366197183, "alnum_prop": 0.6361570273593224, "repo_name": "eliangcs/mahjong", "id": "a588851760744fd7b001ff4bc8b7c0fc4986aef2", "size": "8...
from __future__ import annotations from pathlib import Path from textwrap import dedent import pytest from pants.backend.python import target_types_rules from pants.backend.python.dependency_inference.rules import ( ImportOwnerStatus, PythonImportDependenciesInferenceFieldSet, import_rules, ) from pants....
{ "content_hash": "9aa8a83d7f04927364023367f13900c8", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 93, "avg_line_length": 31.644927536231883, "alnum_prop": 0.5804900389283261, "repo_name": "pantsbuild/pants", "id": "c149377dca12403a31b070c5d78c58c0abe78f21", "size": "44...
"""Utilities related to model visualization.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from tensorflow.python.util.tf_export import keras_export try: # pydot-ng is a fork of pydot that is better maintained. import pydot_ng as pydot e...
{ "content_hash": "123490bc410b15cf2b44dcf3cba65e2e", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 80, "avg_line_length": 33.203947368421055, "alnum_prop": 0.6532593619972261, "repo_name": "theflofly/tensorflow", "id": "d396851a629b80114496b4a978768d73730aecd2", "size":...
class FlowAction(object): # property key TYPE = "type" def __init__(self, type_): self._body = { self.TYPE: type_ } @property def type(self): return self._body[self.TYPE]
{ "content_hash": "49960249562609087b081313828a276f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 36, "avg_line_length": 19.083333333333332, "alnum_prop": 0.5065502183406113, "repo_name": "haizawa/odenos", "id": "a1a1ab59d4d544af1fbbd703f8994afe414c3d60", "size": "1256"...
import os import time import h5py import torch import torch.nn as nn import torch.optim as optim from device import device import argparse from doom_instance import * from aac_lstm import BaseModelLSTM def data_generator(args, screens, variables, labels, episodes): # remove short episodes episode_min_size = a...
{ "content_hash": "846abb44ad8a09bd33b43582c3cfc169", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 115, "avg_line_length": 40.05691056910569, "alnum_prop": 0.6226912928759895, "repo_name": "akolishchak/doom-net-pytorch", "id": "353cf5c8f1f978dd2183f25bd5911425b5589467", ...
from xml.etree import ElementTree from django.test import TestCase from casexml.apps.case.mock import CaseBlock from casexml.apps.case.tests import delete_all_cases, delete_all_xforms from casexml.apps.case.xml import V2 from casexml.apps.stock.models import StockReport, StockTransaction from casexml.apps.stock.const i...
{ "content_hash": "c7a013b774efc78035c8c6c64f4bd02e", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 107, "avg_line_length": 35.52173913043478, "alnum_prop": 0.6623317013463892, "repo_name": "SEL-Columbia/commcare-hq", "id": "31df3209bb74ef2b8330c41fd4c537c53ea2da39", "si...
from __future__ import absolute_import, division, print_function import os import shutil import WatchmanTestCase @WatchmanTestCase.expand_matrix class TestRemoveThenAdd(WatchmanTestCase.WatchmanTestCase): def checkOSApplicability(self): if os.name == "linux" and os.getenv("TRAVIS"): self.ski...
{ "content_hash": "7bac5ab15638cf862b55a39cd21e5658", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 70, "avg_line_length": 29.914285714285715, "alnum_prop": 0.6341929321872015, "repo_name": "wez/watchman", "id": "3413153c1cf15d1021ede36dadfa603d1f0de5d3", "size": "1179", ...
""" Invoker that uses a single core or CPU respectively. """ # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # First Party from metaopt.concurrent.invoker.invoker import Invoker from metaopt.core.call.call import call from metaopt.core.stoppable.stoppab...
{ "content_hash": "162eb8cf97edd49211806468a9900d3c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 31.21212121212121, "alnum_prop": 0.6533980582524271, "repo_name": "cigroup-ol/metaopt", "id": "6668c46fa17165dcdeb8402ff68bda80f13b577b", "size": "10...
import json import sublime from ..modules import session class SessionEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, session.Session): return { "name": obj.name, "windows": [ WindowEncoder.default(self, w) for w in obj...
{ "content_hash": "5c490487171c823b31dde07cd3ba789d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 81, "avg_line_length": 27.833333333333332, "alnum_prop": 0.5409181636726547, "repo_name": "Zeeker/sublime-SessionManager", "id": "2ac750a8c19fea6647493ce75105a9d5a204878d", ...
import subprocess def func_exec_stdout(app, *args): cmd = app if args: cmd += ' ' + ' '.join(args) p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) return p.stdout def func_exec_run(app, *args): return func_exec_stdout(app, *args).decode('utf-8') def f...
{ "content_hash": "3026346a688dbfb3949a2eb4bfe0f0bc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 131, "avg_line_length": 29.68421052631579, "alnum_prop": 0.6418439716312057, "repo_name": "mainulhossain/phenowl", "id": "2da57df87ef516010e261f50e26a6397c5ff4e33", "size":...
from alertaclient.api import Client client = Client() try: id, alert, message = client.send_alert( resource='web-server-01', event='HttpError', correlate=['HttpOK'], group='Web', environment='Production', service=['theguardian.com'], severity='major', ...
{ "content_hash": "8855c3c74c9a6a4f9f5e14a62861f888", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 47, "avg_line_length": 25.19047619047619, "alnum_prop": 0.5689981096408318, "repo_name": "alerta/python-alerta", "id": "6d7a010e04e375c4b35cddbe27d08c3b4501d387", "size": "...
""" I am a support module for making SOCKSv4 servers with twistd. """ from __future__ import print_function from twisted.protocols import socks from twisted.python import usage from twisted.application import internet class Options(usage.Options): synopsis = "[-i <interface>] [-p <port>] [-l <file>]" optPara...
{ "content_hash": "d46db5162fd3f0431fa5c51d1b4af57b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 91, "avg_line_length": 35.794117647058826, "alnum_prop": 0.6211996713229252, "repo_name": "ntuecon/server", "id": "59ea85c855150204efb892db43426c31ba999d0e", "size": "1292"...
import tkinter from UTIL.SYS import Error, LOG, LOG_INFO, LOG_WARNING, LOG_ERROR import EGSE.IF import UI.TKI ############# # constants # ############# COLOR_BUTTON_FG = "#FFFFFF" COLOR_BUTTON_BG = "#808080" COLOR_INITIALISED = "#FFFF00" COLOR_CONNECTED = "#00FF00" COLOR_ON_OK = "#00FF00" COLOR_ON_NOK = "...
{ "content_hash": "3d54793bb83df57a68065665c7448367", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 103, "avg_line_length": 48.27014218009479, "alnum_prop": 0.6402552773686794, "repo_name": "Stefan-Korner/SpacePyLibrary", "id": "b38c3d1fbca0f583b36c9d236fc75ff9baf4648e", ...
from application.settings import get_option import logging import requests import traceback import requests.exceptions def send_notifications(entries): """ We don't expect any Exceptions from this function - all exceptions inside this func must be catched and logged. """ notify_telegram(entries)...
{ "content_hash": "f8f73180211e90a12376d8fc78bebf65", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 88, "avg_line_length": 27, "alnum_prop": 0.5925925925925926, "repo_name": "FZambia/reborn", "id": "79bd8626b1f505a7858867352b3a6885b8723855", "size": "1161", "binary": fa...
"""Minimal example to call the GLOP solver.""" # [START program] # [START import] from ortools.linear_solver import pywraplp # [END import] def main(): # [START solver] # Create the linear solver with the GLOP backend. solver = pywraplp.Solver.CreateSolver('GLOP') if not solver: return # [...
{ "content_hash": "49770f269c10e6b7b1c11e8758f33d2e", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 67, "avg_line_length": 25.253968253968253, "alnum_prop": 0.5933375235700817, "repo_name": "google/or-tools", "id": "4aae1e27b5a9997875377c425bbb4b629e5b3a52", "size": "2191...
def extractWhoistarantellaWordpressCom(item): ''' Parser for 'whoistarantella.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated')...
{ "content_hash": "e41d1f813e9daa301aa64d0a163825d0", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 27.095238095238095, "alnum_prop": 0.6414762741652021, "repo_name": "fake-name/ReadableWebProxy", "id": "b7c6e22905221bdd509cc73ccf918fce3b3c75a7", "...
from __future__ import annotations # Python < 3.10 from typing import Any, List, NamedTuple, Optional, Union __all__ = ["Path"] class Path(NamedTuple): """A generic path of string or integer indices""" prev: Any # Optional['Path'] (python/mypy/issues/731) """path with the previous indices""" key...
{ "content_hash": "464e80ce93a21d5e250c58410f32bcfa", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 31.451612903225808, "alnum_prop": 0.6041025641025641, "repo_name": "graphql-python/graphql-core", "id": "19dd79ba4ef2af6f68edaa2d62b1e4fa8686e27f", "...
""" Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import random from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOW def dependencies(): pass def tamper(payload, **kwargs): """ Replaces space character (' ') with a random...
{ "content_hash": "f97405404d58bdd3840c628d7ccd385e", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 71, "avg_line_length": 24.8, "alnum_prop": 0.533498759305211, "repo_name": "JeyZeta/Dangerous", "id": "98612534a32d091ba3194624b06c4bb1fb175678", "size": "1635", "binary"...
from unittest import mock import pytest import requests from settings import TEST_DATA from suite.utils.policy_resources_utils import create_policy_from_yaml, delete_policy from suite.utils.resources_utils import create_secret_from_yaml, delete_secret, wait_before_test from suite.utils.ssl_utils import create_sni_sess...
{ "content_hash": "42d372da7233342b812e95e41946fc03", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 110, "avg_line_length": 33.36, "alnum_prop": 0.5660471622701838, "repo_name": "nginxinc/kubernetes-ingress", "id": "6ebe7922c4ab5a966ff14ced8b14ae4b2a174193", "size": "100...
import json from django.test import TestCase from django.urls import reverse from mapentity.tests.factories import UserFactory from rest_framework.test import APITestCase from geotrek.zoning.tests.factories import RestrictedAreaFactory, RestrictedAreaTypeFactory from geotrek.zoning.templatetags.zoning_tags import all...
{ "content_hash": "cf10b5d07833e09bf3bd5f0fd78e7545", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 152, "avg_line_length": 45.47826086956522, "alnum_prop": 0.6252390057361377, "repo_name": "GeotrekCE/Geotrek-admin", "id": "e09fd587202e8bf08d6f04ccaf09ea54e3b64689", "size...
from __future__ import absolute_import from ._version import __version__ __title__ = "geetools" __summary__ = "A set of useful tools to use with Google Earth Engine Python" \ "API" __uri__ = "http://geetools.readthedocs.io" __author__ = "Rodrigo E. Principe" __email__ = "fitoprincipe82@gmail.com" __lic...
{ "content_hash": "e127a1ec94d7bec40559d4b637a944a0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 35.55555555555556, "alnum_prop": 0.6447916666666667, "repo_name": "gee-community/gee_tools", "id": "ddeb23ff29b0962da898ece6a85e5ff5bdd090cf", "size"...
import os # We want to test the utility functions in the settings # module, not the settings themselves, so we'll use # unittest directly (instead of importing django.test) import unittest from django.core.exceptions import ImproperlyConfigured from cotracker.settings import base class SettingsTests(unittest.TestCa...
{ "content_hash": "4eabbf0ba9b01aecf2b2fcbc1b1c10cc", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 83, "avg_line_length": 32.46153846153846, "alnum_prop": 0.7037914691943128, "repo_name": "eallrich/checkniner", "id": "5fca324d4a3946bad279f153dff4d9ee6d21a110", "size": "8...
"""Dataclass for a Python package.""" import configparser from contextlib import contextmanager import copy from dataclasses import dataclass, asdict import io import json import os from pathlib import Path import pprint import re import shutil from typing import Any, Dict, List, Optional, Iterable _pretty_format = p...
{ "content_hash": "0c712715b9c5658d6d873953af6bda22", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 78, "avg_line_length": 34.30451127819549, "alnum_prop": 0.6021917808219178, "repo_name": "google/pigweed", "id": "49376fdcd6d406693a6cc766ef9c1e49134e83da", "size": "9709"...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import serialize from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.page import Page cla...
{ "content_hash": "d88caaaf505b1d49ec1ee04fe1efac60", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 114, "avg_line_length": 36.70281124497992, "alnum_prop": 0.6279680490206806, "repo_name": "twilio/twilio-python", "id": "422eccbfebd25b0bcf371b5b733f35fe2490c1bc", "size":...
"""This module allows adding and deleting of projects to the local manifest.""" from __future__ import print_function import logging import platform import optparse import os import sys import xml.etree.ElementTree as ElementTree from chromite.lib import cros_build_lib from chromite.lib import git class Manifest(o...
{ "content_hash": "04e91fd2fdd176899c87456060cfb537", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 80, "avg_line_length": 37.89156626506024, "alnum_prop": 0.6586115527291998, "repo_name": "mxOBS/deb-pkg_trusty_chromium-browser", "id": "30ee8397fb7aae32c624ea485ccc4427896b...
from frappe.model.document import Document class NumberCardLink(Document): pass
{ "content_hash": "59dce3a7f57d3beab6b6d041e186ac8d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 20.5, "alnum_prop": 0.8292682926829268, "repo_name": "almeidapaulopt/frappe", "id": "0b55ae6dcdc4458b4f06682f06401f3cd4ee657e", "size": "210", "bina...
from collections import Counter, defaultdict # import itertools import sys import os import numpy as np class Riffer(): def __init__(self, dir_in, newline_chars=True): self.spliton = (' ' if newline_chars else None) # split defaults to whitespace d_counter = self.parseFiles(dir_in) # prob...
{ "content_hash": "702bb4f3a9ef8e9fd9894c5458bea870", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 86, "avg_line_length": 29.691358024691358, "alnum_prop": 0.5505197505197506, "repo_name": "meereeum/markov-freestyle", "id": "3550f959a96a15adedeaab244dc814bc54e84cd6", "si...
""" Simulation of the string with mass example, with flatness based state feedback and flatness based state observer (design + approximation), presented in [RW2018a]_. References: .. [RW2018a] Marcus Riesmeier and Frank Woittennek; Modale Approximation eines verteiltparametrischen Beobachters ...
{ "content_hash": "e0a15c67085a1cf82236245b42e607b2", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 85, "avg_line_length": 38.8698224852071, "alnum_prop": 0.5897396864058456, "repo_name": "cklb/pyinduct", "id": "ad62bc8c7518b40bf124e051ebf34d1172fc50f1", "size": "6574", ...
from datetime import datetime, timedelta, date from dateutil.relativedelta import relativedelta import logging from operator import itemgetter from werkzeug import url_encode from openerp import SUPERUSER_ID from openerp import tools, api from openerp.addons.base.res.res_partner import format_address from openerp.addo...
{ "content_hash": "24fa47c14b1b59db236cf3949669e8d3", "timestamp": "", "source": "github", "line_count": 1259, "max_line_length": 222, "avg_line_length": 49.019857029388405, "alnum_prop": 0.5829930650074535, "repo_name": "vileopratama/vitech", "id": "c49abd90a146b543e57cf5b4e3d41335e3e7ceb2", "size"...
from __future__ import unicode_literals from django.apps import AppConfig class MusicstreamingConfig(AppConfig): name = 'musicstreaming'
{ "content_hash": "338eb974ebaf0fbd1a123634eda79e0b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 20.571428571428573, "alnum_prop": 0.7777777777777778, "repo_name": "bdeloeste/unnamed-sxsw-hack", "id": "0b19f5278b2f181ef1c2289df0a88d4409a8ac87", "s...
from StringIO import StringIO from satori.ars.thrift import ThriftWriter from satori.core.export import generate_interface import satori.core.models ars_interface = generate_interface() writer = ThriftWriter() idl_io = StringIO() writer.write_to(ars_interface, idl_io) thrift_idl = idl_io.getvalue() del writer del ...
{ "content_hash": "c5fd9916f7db7c8a054d44aece4dc388", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 49, "avg_line_length": 19.294117647058822, "alnum_prop": 0.7835365853658537, "repo_name": "zielmicha/satori", "id": "92f702b61d8031838f72eccc6756e10004cdc9ff", "size": "361...
import sys if sys.version > '3': basestring = str from pyspark import since, keyword_only from pyspark.rdd import ignore_unicode_prefix from pyspark.ml.linalg import _convert_to_vector from pyspark.ml.param.shared import * from pyspark.ml.util import JavaMLReadable, JavaMLWritable from pyspark.ml.wrapper import Ja...
{ "content_hash": "b6964e23ad25cb934a3d500e7350234f", "timestamp": "", "source": "github", "line_count": 3457, "max_line_length": 100, "avg_line_length": 37.1527335840324, "alnum_prop": 0.603525463846088, "repo_name": "SHASHANKB/spark", "id": "050537b811f610f45a51d8c3d9eb20ca213e8519", "size": "1292...
class Node: next_node = None data = 0 def __init__(self, value): self.data = value def run(input_data1, input_data2): i = 0 number1 = 0 while input_data1 is not None: number1 += input_data1.data * pow(10, i) input_data1 = input_data1.next_node i += 1 i = 0 ...
{ "content_hash": "4ce5e1cca5315f632cf8e68fd1ee040a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 48, "avg_line_length": 20.914285714285715, "alnum_prop": 0.5519125683060109, "repo_name": "gonditeniz/cracking-coding-interview", "id": "6bbcac49fcd3d59fc7f10c87da4adc620d05f...
from django.contrib.admin.filters import SimpleListFilter from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import PermissionDenied from django.template.response import TemplateResponse from django.contrib.admin import helpers from .forms import TagObjectForm class AdminTagAllMixIn(...
{ "content_hash": "afc65d4e0bf82ca82379527169a097d9", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 89, "avg_line_length": 32.666666666666664, "alnum_prop": 0.5729402872260015, "repo_name": "LilithWittmann/froide", "id": "96e4ba1d9a97fec98026b2f20a8c101b20221c10", "size":...
"""Box widgets. These widgets are containers that can be used to group other widgets together and control their relative layouts. """ from .widget import register, widget_serialization, Widget from .domwidget import DOMWidget from .widget_core import CoreWidget from .docutils import doc_subst from .trait_types import...
{ "content_hash": "60bae54342165b382083691e695dd99e", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 86, "avg_line_length": 29.53488372093023, "alnum_prop": 0.6438320209973754, "repo_name": "sserrot/champion_relationships", "id": "516ee19b9a5a9617e6a8df0836b235fa1749c853", ...
import opendbpy as odb import helper import odbUnitTest class TestInst(odbUnitTest.TestCase): def setUp(self): self.db, self.lib = helper.createSimpleDB() self.block = helper.create2LevelBlock(self.db, self.lib, self.db.getChip()) self.i1 = self.block.findInst('i1') def tearDow...
{ "content_hash": "0e2cc8464227790e449a24fe5eb42eb7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 88, "avg_line_length": 45.7027027027027, "alnum_prop": 0.615612063867534, "repo_name": "The-OpenROAD-Project/OpenROAD", "id": "ac6a3a54a9a6a67c544134e25281338b3b7e2abe", "s...
import mock from jacket.db import compute from jacket.objects import compute from jacket.objects.compute import ec2 as ec2_obj from jacket.tests.compute.unit.objects import test_objects fake_map = { 'created_at': None, 'updated_at': None, 'deleted_at': None, 'deleted': 0, 'id': 1, 'uuid': 'fa...
{ "content_hash": "60c0e8c8845ec0604065be40baa590e4", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 79, "avg_line_length": 37.90494296577947, "alnum_prop": 0.6098906610492527, "repo_name": "HybridF5/jacket", "id": "8057440331c78507a5ffaddfbe25587acbc01d62", "size": "1058...
from murano.dsl import dsl_exception from murano.dsl import exceptions from murano.tests.unit.dsl.foundation import object_model as om from murano.tests.unit.dsl.foundation import test_case class TestExecution(test_case.DslTestCase): def _load(self): return self.new_runner( om.Object('SampleCl...
{ "content_hash": "de2cb21d13c8a0283b128e50307b1cc0", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 76, "avg_line_length": 34.25, "alnum_prop": 0.6131386861313869, "repo_name": "openstack/murano", "id": "2a94c05d1f16835c8c782f1e1454825a6026d205", "size": "2255", "binary...
from . import consts from interage.api.utils.strings import remove_lead_and_trail_slash class APIUri: medicines = consts.MEDICINES_URI interactions = consts.INTERACTIONS_URI active_principles = consts.ACTIVE_PRINCIPLES_URI obtain_token = consts.OBTAIN_TOKEN_URI metadata = consts.METADATA class API...
{ "content_hash": "27f28a325630d582ccdac52e31937040", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 66, "avg_line_length": 27.930232558139537, "alnum_prop": 0.6178184845961698, "repo_name": "IntMed/interage_python_sdk", "id": "32582a07980b3689bb04d86ae235c0a8eb1992f4", "s...
''' WSGI config for server project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ ''' import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTI...
{ "content_hash": "c851db70cac9227067fbddef8a740905", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.0625, "alnum_prop": 0.773067331670823, "repo_name": "njharman/interview_PPWA", "id": "8e8686937b34062b42df76f4d4b28086373c76be", "size": "401", ...
import sys import json from libcloud.test import MockHttp, LibcloudTestCase, unittest from libcloud.compute import providers from libcloud.utils.py3 import httplib from libcloud.compute.base import NodeImage, NodeLocation, NodeAuthSSHKey from libcloud.test.secrets import KAMATERA_PARAMS from libcloud.compute.types imp...
{ "content_hash": "f838e015915b47040ed53cfa88b3656a", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 106, "avg_line_length": 38.473684210526315, "alnum_prop": 0.6084394401767863, "repo_name": "apache/libcloud", "id": "a42e8e1e83db5fcad4ad1ca65151bec1815e7268", "size": "10...
""" Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.25 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubernete...
{ "content_hash": "1b0bc98de9e3fec2d0967054b2481857", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 529, "avg_line_length": 33.64, "alnum_prop": 0.5928316629862409, "repo_name": "kubernetes-client/python", "id": "227c6711af080ce6df24a0e7f1b053477e31a810", "size": "5904",...
from js9 import j from .SSHKey import SSHKey import os JSConfigBase = j.tools.configmanager.base_class_configs from .AgentSSHKeys import * class SSHKeys(JSConfigBase): def __init__(self): self.__jslocation__ = "j.clients.sshkey" JSConfigBase.__init__(self, SSHKey) self._sshagent = None ...
{ "content_hash": "3da0afb1e07716e5a435c3c2ec0f727f", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 103, "avg_line_length": 34.472727272727276, "alnum_prop": 0.538878842676311, "repo_name": "Jumpscale/core9", "id": "ace550d739395727bdbe44ce450c3248c2ab9cde", "size": "132...
""" Name: structures.py Date Created: 1/31/2018 Last Modified: 1/31/2018 Purpose: Stores custom data structures utilized in the thesis. """ class PriorityQueueNode(object): def __init__(self, priority, data): """ Creates a node object to be stored in a priority queue. ...
{ "content_hash": "4eff8e9ed3d88bf0e67fdd5d272ed7f4", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 124, "avg_line_length": 31.032467532467532, "alnum_prop": 0.5503243356350701, "repo_name": "gollum18/malmo_thesis", "id": "bee8ee1cf5c2e4ca15121bd16ed0951eb4604246", "size...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "2ca5d667ee09290aed3cbe410245d651", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 418, "avg_line_length": 35.3421052631579, "alnum_prop": 0.7359146190121618, "repo_name": "benfinke/ns_python", "id": "10e07a11269099e5d913e5e28230ab936f707c0a", "size": "8...
''' @author: Pierre Thibault (pierre.thibault1 -at- gmail.com) @license: MIT @since: 2011-04-26 ''' from __future__ import with_statement __docformat__ = "epytext en" import filecmp import os import shutil import StringIO import sys import unittest import insert_imports class Test(unittest.TestCase): """ ...
{ "content_hash": "6048be2fce81cde26db1c033d00fc1c1", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 86, "avg_line_length": 31.54471544715447, "alnum_prop": 0.5152061855670103, "repo_name": "Pierre-Thibault/neo-insert-imports", "id": "4a339566d32bfada1aa105d03688a2e7ebbc785...
import pytest from awx.main import models from awx.main.analytics import collectors @pytest.mark.django_db def test_empty(): assert collectors.counts(None) == { "active_user_sessions": 0, "active_anonymous_sessions": 0, "active_sessions": 0, "active_host_count": 0, "creden...
{ "content_hash": "975fdca1e9889395a3a907eeb49e716c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 79, "avg_line_length": 29.422764227642276, "alnum_prop": 0.5520862116606797, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "877f21badadfc6a0e0505ffd307...
from django.http import HttpResponse import json from kwue.DB_functions.tag_db_functions import * from kwue.helper_functions.semantic_tag_helpers import get_semantic_tags from django.views.decorators.csrf import csrf_exempt def search_semantic_tags(req): semantic_tags = get_semantic_tags(req.GET.dict()['tag_name']...
{ "content_hash": "796e774b9a83070a94205109ac8f1f96", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 84, "avg_line_length": 33.13333333333333, "alnum_prop": 0.6951710261569416, "repo_name": "bounswe/bounswe2016group4", "id": "82e77b1ced250193183fcce02da28b402c901592", "siz...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify the exit status and error output if an SConstruct file throws a NameError (tries to reference a Python variable that doesn't exist). """ import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', ""...
{ "content_hash": "a5ca7ee566f84b76f199920dd0b440ec", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 61, "avg_line_length": 19.413793103448278, "alnum_prop": 0.6589698046181173, "repo_name": "andrewyoung1991/scons", "id": "0281253d3d61ed02ff85a19a22b274e68213e6fb", "size":...
"""Utility methods for working with logs.""" import os import time REQUEST_KEY = 'REQUEST_ID_HASH' def RequestID(): """Returns the ID of the current request assigned by App Engine.""" return os.environ.get(REQUEST_KEY, None) def ParseLogEntry(entry): """Parses a single log entry emitted by app_logging.Ap...
{ "content_hash": "70dccc46c85d24a245fce2c0d63f518c", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 25.5, "alnum_prop": 0.6590765338393422, "repo_name": "adviti/melange", "id": "1ac10f56826407c3681e69aac072bd92b48d3333", "size": "2186", "binary": ...
__author__ = 'Daniel Lindsley' __license__ = 'BSD' __version__ = (1, 4, 0) from .resources import Resource
{ "content_hash": "7ecdcf9c433b55812f2515c828b29535", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 31, "avg_line_length": 18.166666666666668, "alnum_prop": 0.6146788990825688, "repo_name": "rpedigoni/restless", "id": "8a175ce8f9f3af5eb0fd689bc51c9def3a5717f0", "size": "10...
"""A pure-Python Python bytecode interpreter.""" # Based on: # pyvm2 by Paul Swartz (z3p), from http://www.twistedmatrix.com/users/z3p/ from __future__ import print_function, division import dis import inspect import linecache import logging import operator import sys import six from six.moves import reprlib PY3, PY...
{ "content_hash": "0b80a2f47dc3b29be53a3e45bdc81633", "timestamp": "", "source": "github", "line_count": 1190, "max_line_length": 90, "avg_line_length": 31.180672268907564, "alnum_prop": 0.507478776445223, "repo_name": "sukwon0709/byterun", "id": "6409204288890fc245c7b4c13d73e0c86fda6b3f", "size": "...
"""Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
{ "content_hash": "2dd8a0d03d3daa15d2255c1550df9d88", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 145, "avg_line_length": 30.082781456953644, "alnum_prop": 0.606274078150798, "repo_name": "Rubisk/mcedit2", "id": "683f4bc06462352bff5c79263362f6aeaeec4e29", "size": "9085...
""" This example shows how to communicate with Thorlabs KST101, KCube Stepper Motor. """ import os from pprint import pprint from msl.equipment import ( EquipmentRecord, ConnectionRecord, Backend, ) from msl.equipment.resources.thorlabs import MotionControl # ensure that the Kinesis folder is available on...
{ "content_hash": "aaa79f8aa9aee95135a3bdce6aec071d", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 97, "avg_line_length": 28.202380952380953, "alnum_prop": 0.7057830308146897, "repo_name": "MSLNZ/msl-equipment", "id": "26c1d3aeb6a4dabcec1b404afc1408d3fecc72e6", "size": "...
from __future__ import division from sklearn.cross_validation import StratifiedKFold from sklearn.datasets import load_svmlight_file from sklearn.metrics import log_loss from sklearn.ensemble import RandomForestClassifier as RF import argparse import logging import numpy as np import time def train_predict(train_fil...
{ "content_hash": "d68ccbec47baab859938306d8e9711f7", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 38.31884057971015, "alnum_prop": 0.5847201210287444, "repo_name": "drivendata/countable-care-3rd-place", "id": "01dc52d63f466dddb3f2bfc19aec9ed1b4703ef...
''' Copyright (c) OS-Networks, http://os-networks.net Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
{ "content_hash": "af176a620aedf70e684045322b302791", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 77, "avg_line_length": 43.372549019607845, "alnum_prop": 0.7581374321880651, "repo_name": "Knygar/hwios", "id": "02f83b1ec0083012254ef2e659a4212100e5237a", "size": "2212", ...
import convert_mjpeg import ytupload import random import logging import os from oauth2client.tools import argparser import config import util config = util.get_config() tmp_movie_path = config.get('treasurecolumn', 'tmp_movie_path') def run(url, frames=20, rate=-1, google_secret=os.getcwd() + '/client_secrets.json...
{ "content_hash": "bda4658875f554a652f486ccf549a0df", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 108, "avg_line_length": 41.74, "alnum_prop": 0.7163392429324389, "repo_name": "lysol/treasurecolumn", "id": "be28d5a17095e39fbb56d801cccc557e1014dbcf", "size": "2087", "b...
from msrest.serialization import Model class KeyVaultKeyReference(Model): """Describes a reference to Key Vault Key. :param source_vault: Fully qualified resource Id for the Key Vault. :type source_vault: :class:`ResourceId <azure.mgmt.batchai.models.ResourceId>` :param key_url: The URL referenc...
{ "content_hash": "d4f57f8836ee566bd89e7c1d6ada99c1", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 29.23076923076923, "alnum_prop": 0.6078947368421053, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "2e691cc6bf1ae144ae512751ef1012cdff1927f0", ...
import tornado.web from handlers.static_handler import StaticHandler import os class IndexHandler(StaticHandler): def get(self): pid = os.getpid() self.render('home.html', proccess=pid)
{ "content_hash": "a74748812fdd125e4714f830bf1188cf", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 49, "avg_line_length": 25.875, "alnum_prop": 0.714975845410628, "repo_name": "antsankov/cufcq-new", "id": "0bdb99d3bf52cd12da150387a08f473bc8617ff7", "size": "207", "binar...
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
{ "content_hash": "5611f0e04d5e68cac57a834871092eb5", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 144, "avg_line_length": 44.05858585858586, "alnum_prop": 0.6986106653216562, "repo_name": "bcgov/gwells", "id": "08c5b12e0ab4b9035daa7c25ccdfac1a1aa24f7a", "size": "21809"...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Migrate users with no group to alumni group.""" users = orm['auth.User'].objects.filter(groups__isnull=True) alumni_group = o...
{ "content_hash": "4cfddeada91d3aa10951cb6c3ce31156", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 198, "avg_line_length": 84.83333333333333, "alnum_prop": 0.5534023932845151, "repo_name": "johngian/remo", "id": "75888f4a23326462cb6659cae87ba43db758241c", "size": "11222...
import re # NOTE: When get/get_all/check_update from database with default fields, # all following fields should be included in output dict. { 'project': { 'name': str, 'group': str, 'status': str, 'script': str, # 'config': str, 'comments': str, # 'pri...
{ "content_hash": "771e0110ec622f511fd5cc983c959762", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 72, "avg_line_length": 22.26530612244898, "alnum_prop": 0.5582034830430798, "repo_name": "jttoday/spider", "id": "f6bd4666bc2a02c859f1d3278cdfef9c38ed0b02", "size": "1276",...
import contextlib import json import os from nose.tools import istest, assert_equal from catchy import NoCachingStrategy from whack.tempdir import create_temporary_dir from whack.files import sh_script_description, plain_file, read_file from whack.sources import PackageSource from whack.builder import Builder from wh...
{ "content_hash": "1d4658e348f4651bb2675c81b7418c6d", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 100, "avg_line_length": 37.848101265822784, "alnum_prop": 0.6779264214046823, "repo_name": "mwilliamson/whack", "id": "f144fcf50518d9bfdecbac96e4fef153f0650892", "size": "2...
import logging import sys import arcpy import pulp from pyspatialopt.analysis import arcpy_analysis from pyspatialopt.models import utilities from pyspatialopt.models import covering if __name__ == "__main__": # Initialize a logger so we get formatted output logger = logging.getLogger() logger.setLevel(lo...
{ "content_hash": "8e3d535c70b92f04dd99eabc30cce2da", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 129, "avg_line_length": 52.64150943396226, "alnum_prop": 0.6770609318996416, "repo_name": "apulverizer/pyspatialopt", "id": "87fbff6d2c39de39dc6e8bb02d83339923e7f27d", "siz...
from testagent.parser.parser import Parser from testagent.parser.collector_parser import CollectorParser from testagent.parser.testcase_parser import TestCaseParser from testagent.parser.testinstance_parser import TestInstanceParser
{ "content_hash": "462cfa4e3d48e3c9b61f823209306f1a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 67, "avg_line_length": 58.25, "alnum_prop": 0.8841201716738197, "repo_name": "patriziotufarolo/testagent", "id": "b691058f33162f9731b944044c198ac45cb1fd31", "size": "541", ...
bl_info = { "name": "Simple 3D-Coat Applink", "author": "Kalle-Samuli Riihikoski (haikalle), Mifth", "version": (0, 4, 0), "blender": (2, 93, 0), "location": "3D Viewport", "description": "Transfer data between 3D-Coat/Blender", "warning": "", "wiki_url": ...
{ "content_hash": "ee356479ca785634427486dcab2dd64b", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 124, "avg_line_length": 22.02857142857143, "alnum_prop": 0.5667963683527886, "repo_name": "mifth/mifthtools", "id": "e5dc39200fec558dbfb370e91f44086ec8127d89", "size": "155...
from django import forms from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from django.core.validators import RegexValidator from models import * from serializers import * from util import * class LoginForm(forms.Form): username = forms.CharField(required=True) password =...
{ "content_hash": "c5f91afa8efe5dfffde154b5741f45d3", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 150, "avg_line_length": 31.69047619047619, "alnum_prop": 0.721763085399449, "repo_name": "brunogabriel/mobile-rest-web", "id": "83592a0a0910118d0e1a05a11aa50288b550d502", ...
from zerver.lib.test_classes import WebhookTestCase class PivotalV3HookTests(WebhookTestCase): STREAM_NAME = 'pivotal' URL_TEMPLATE = "/api/v1/external/pivotal?stream={stream}&api_key={api_key}" def test_accepted(self) -> None: expected_topic = 'My new Feature story' expected_message = 'L...
{ "content_hash": "f829bb434b0348857046be27e421fea1", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 218, "avg_line_length": 48.6951871657754, "alnum_prop": 0.6634087414891281, "repo_name": "showell/zulip", "id": "40c087d500e3c0ca8803973ecb492bd32b1bdf7e", "size": "9106",...
from __future__ import annotations import re import sys from pathlib import Path import yaml from rich.console import Console if __name__ not in ("__main__", "__mp_main__"): raise SystemExit( "This file is intended to be executed as an executable program. You cannot use it as a module." f"To run ...
{ "content_hash": "63a30736cde73a8892e5826670d25bc7", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 106, "avg_line_length": 34.91954022988506, "alnum_prop": 0.5829493087557603, "repo_name": "cfei18/incubator-airflow", "id": "efd8d5878e6897f70c8ee0161bc3bc880263afa3", "siz...
from __future__ import absolute_import from celery import shared_task from django.core.mail import send_mail from backend import settings from backend.utils import hash_email from v1.models import * import tempfile import json from django.template.loader import render_to_string from django.template import Context # TO...
{ "content_hash": "12b6fe95b96018a9785f35b3ef5c1006", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 125, "avg_line_length": 35.95918367346939, "alnum_prop": 0.6322360953461975, "repo_name": "szborows/simplestv", "id": "7fe1f6590cbacbb64845bb7528ff80ab389c442d", "size": "...
import httplib import json import requests from framework.config import settings from framework.testbase import BaseTestCase class RestJsonExample(BaseTestCase): def setUp(self): """test setup""" self.remove_books() def tearDown(self): """test cleanup""" self.remove_books()...
{ "content_hash": "0163a140a30cdf6a24327977fbdf372f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 103, "avg_line_length": 25.82857142857143, "alnum_prop": 0.6626106194690266, "repo_name": "bpuderer/python_test_env", "id": "78863d8a022901411c67abb51b2e05e0787eb3d5", "siz...
"""Basic route-based demonstration application. Applications can be as simple or as complex and layered as your needs dictate. """ from web.dialect.route import route class Root(object): __dispatch__ = 'route' @route('/') def index(self): return "Root handler." @route('/page/{name}...
{ "content_hash": "53c035c75e1102d6abd242ed938acaf8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 23.6, "alnum_prop": 0.6491525423728813, "repo_name": "marrow/WebCore", "id": "536cf5b9941fb91a2024f0bd97c2dcea765eca8e", "size": "609", "binary": f...
import abc import logging import sys import six import ujson LOGGER = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class BaseBackend(object): """Base abstract backend class. Backend implementation should inherit and implement ``get_raw`` method. :param parser: Callable that accept a st...
{ "content_hash": "1232c5c6a7a3f9aa2df8671871b8b781", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 98, "avg_line_length": 29.654761904761905, "alnum_prop": 0.6085909273384184, "repo_name": "mouadino/distconfig", "id": "248e087bccfec9b7a8fa0ea80110ef4ce55be136", "size": "...
__revision__ = "src/engine/SCons/Script/Interactive.py 2014/07/05 09:42:21 garyo" __doc__ = """ SCons interactive mode """ # TODO: # # This has the potential to grow into something with a really big life # of its own, which might or might not be a good thing. Nevertheless, # here are some enhancements that will pro...
{ "content_hash": "d7c57235730059240b404a24e36c39ae", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 89, "avg_line_length": 35.687845303867405, "alnum_prop": 0.5458626828701912, "repo_name": "Bforartists/scons", "id": "b8008821807495cf0ecdb0257d76ae83e2836759", "size": "1...
import numpy as np from superbol.fit_blackbody import (bb_flux_integrated, bb_total_flux, dbb_flux_integrated_dT, dbb_total_flux_dT) def integrate_fqbol(wavelengths, fluxes, flux_uncertainties): """Calculate the trapezoidal rule integral of the observed `fluxes`. The trap...
{ "content_hash": "2b25a9e56b4eb84df3aebcab81a40260", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 211, "avg_line_length": 41.61702127659574, "alnum_prop": 0.6511588275391956, "repo_name": "JALusk/SuperBoL", "id": "c30d7f852d1a4a5f9c471acea886c6210bca4697", "size": "586...
from amazonia.classes.hosted_zone import HostedZone from nose.tools import * from troposphere import Template, ec2, Ref template = vpc = None def setup_resources(): """ Create generic testing data """ global template global vpc template = Template() vpc = template.add_resource(ec2.VPC('...
{ "content_hash": "959fbc56ba7c6214769c2e58b9bfaf59", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 24.95, "alnum_prop": 0.6279225116900468, "repo_name": "GeoscienceAustralia/amazonia", "id": "5a2a2032c48d8cf94d19c7202a000a5ae33d751b", "size": "1517...
"""A collection of classes, metaclasses and functions for Plugins As a plugin developer: Subclass from one of the JB_Plugin classes and implement the abstract functions. The plugin managers load and hold plugins. """ import abc import inspect import os import sys import traceback from collections import OrderedDict f...
{ "content_hash": "3b0c27c90d65f50e0a4945d1399ed62a", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 128, "avg_line_length": 31.814317673378078, "alnum_prop": 0.6069193446311792, "repo_name": "JukeboxPipeline/jukebox-core", "id": "fc878b60b2f6c362b28e60f18ccb648f3cc0a7e8", ...
import numpy as np import tensorflow as tf from mnist_loader import make_mnist_subset, load_mnist from old_files.network import multilayer_perceptron, run_training_cycle, test_model training_data, validation_data, test_data = load_mnist() # Parameters learning_rate = 0.001 n_training_epochs = 15 batch_size = 64 disp...
{ "content_hash": "41673b0aa2486c2a51261ff4adfabafa", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 115, "avg_line_length": 33.58441558441559, "alnum_prop": 0.6490719257540604, "repo_name": "jessegeerts/neural-nets", "id": "6b3dc1eb77962d311214c9617ba09826ecef233b", "siz...
""" MoinMoin - PageList print a list of pages whose title matches the search term @copyright: @copyright: 2001-2003 Juergen Hermann <jh@web.de>, 2003-2008 MoinMoin:ThomasWaldmann 2008 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ Dependencies = [...
{ "content_hash": "df8db16f90f0167613e4399aeef12a04", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 94, "avg_line_length": 30.375, "alnum_prop": 0.6817558299039781, "repo_name": "RealTimeWeb/wikisite", "id": "00ce308feee6b1d989a1f8fc628599fae798b94d", "size": "758", "bi...
import datetime from logging import getLogger LOG = getLogger(__name__) class RecordDetail(object): def __init__(self, name): self.name = name self.status = None self.start_time = datetime.datetime.now() self.stop_time = None self.number_of_records = None self.ot...
{ "content_hash": "00a68f2c9619b460d4f0681646389426", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 94, "avg_line_length": 24.586206896551722, "alnum_prop": 0.5834502103786816, "repo_name": "atleypnorth/bp2dvcm", "id": "9abb17ff58b2466e3146e840c7b1aefe809e4629", "size": "...
""" WSGI config for todo_project project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
{ "content_hash": "5aa62f5357d25394e7470e3a22770976", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 83, "avg_line_length": 42.486486486486484, "alnum_prop": 0.7907124681933843, "repo_name": "linhyo/todo", "id": "32f3eb29f8e7e2906a318bf8b006eec60c679767", "size": "1572", ...
import sys from peak.util.proxies import ObjectWrapper, ObjectProxy from loaders import Lazy class TestLazyLoader(object): def setup_method(self, method): self.name = '%s.pkg.module' % __package__ self.loader = Lazy(self.name, ['attr1', 'attr2']) def teardown_method(self, method): if...
{ "content_hash": "5267cac020bd407cd1bb795f317c7e5e", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 74, "avg_line_length": 38.64705882352941, "alnum_prop": 0.656392694063927, "repo_name": "FelixLoether/python-loaders", "id": "56b8c96db9281f1b673dd912d6b6476d49b54667", "si...
from wtforms.validators import InputRequired from flask_bombril.r import R class Required(InputRequired): def __init__(self): self.message = R.string.validators.required_field super(Required, self).__init__(message=self.message)
{ "content_hash": "d8016c241ae38e8fdd9b74b521b82b76", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 60, "avg_line_length": 31.375, "alnum_prop": 0.7211155378486056, "repo_name": "marcoprado17/flask-bone", "id": "85b1abd08eee37ba553af7cb449a8e83fcc78620", "size": "752", "...
import numpy as np def one_to_one_assignment(binary_cost, value_cost): '''When mulitple True exists in row or column, it will pick one with the lowest value_cost. ''' binary_cost = pick_closer(binary_cost, value_cost) binary_cost = pick_closer(binary_cost.T, value_cost.T) binary_cost = binary_cost...
{ "content_hash": "94bee6443e9e0321d2364e01bd186d57", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 95, "avg_line_length": 37.11666666666667, "alnum_prop": 0.6133812303547374, "repo_name": "braysia/covertrack", "id": "0f2a0d82d0e3732d6cb852d69599a8fa5af09433", "size": "22...
__author__ = 'bkeroack' import logging import elita.util import bson class MongoService: # logspam #__metaclass__ = elita.util.LoggingMetaClass def __init__(self, db): ''' @type db = pymongo.database.Database ''' assert db self.db = db def create_new(self, col...
{ "content_hash": "f6b477943c4d7afb62712407f080d486", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 125, "avg_line_length": 40.1375, "alnum_prop": 0.5879788227966366, "repo_name": "bkeroack/elita", "id": "b8faa9846445ccbf4299e7659e6413d0e49f6c67", "size": "6422", "bina...