text
stringlengths
4
1.02M
meta
dict
""" sentry.app ~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from threading import local from django.conf import settings from raven.contrib.django.models import client from sentry.utils ...
{ "content_hash": "cb8d56eee56fe462ba43c44b56d1f5ed", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 80, "avg_line_length": 31.31111111111111, "alnum_prop": 0.772888573456352, "repo_name": "mitsuhiko/sentry", "id": "a5f8e7b6d5a7ce5970afb074fb96e282ed15ba53", "size": "1409"...
from __future__ import absolute_import, unicode_literals from bs4 import BeautifulSoup from django.test import TestCase from mock import patch from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.rich_text import ( DbWhitelister, PageLinkHandler, RichText, expand_db_html, extract_attrs) class Te...
{ "content_hash": "d5604321053e9354ebc6862231a0ab4f", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 116, "avg_line_length": 33.62337662337662, "alnum_prop": 0.5791811510235613, "repo_name": "nilnvoid/wagtail", "id": "f549db811b8d812554dc3724fb45d50574cfd3a7", "size": "51...
import sys import logging import pytest from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy # Local from sas.qtgui.Utilities.ModelEditor import ModelEditor from sas.qtgui.Utilities.PythonSyntax import PythonHighlighter class Mo...
{ "content_hash": "c1f4e282afc81f9f53bd2bb84d4d8a06", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 62, "avg_line_length": 24.318181818181817, "alnum_prop": 0.6794392523364486, "repo_name": "SasView/sasview", "id": "62187eb57d37af5f7fb851dceab41417715f2132", "size": "1070...
from solution import Solution from solution import ListNode def mkListNode(nums): """ :type: nums: List :rtype: ListNode """ head = lnp = ListNode(0) for i in range(len(nums)): lnp.next = ListNode(nums[i]) lnp = lnp.next return head.next def lsListNode(head): """ :t...
{ "content_hash": "25d29facbf0858f49a3446f982e68c47", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 36, "avg_line_length": 19.548387096774192, "alnum_prop": 0.5907590759075908, "repo_name": "zhlinh/leetcode", "id": "be4b2d668cd6e11c508d633c15ea8679aed0fbb0", "size": "653"...
from django.core.management.base import BaseCommand, CommandError from contento.backends.files import FlatFilesBackend from contento.backends.sql import SQLBackend from contento.exceptions import CmsPageAlreadyExisting sql_backend = SQLBackend() class Command(BaseCommand): help = 'Closes the specified poll for v...
{ "content_hash": "4b93cf2afd4a6388cd67ef3ae841424b", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 65, "avg_line_length": 31.842105263157894, "alnum_prop": 0.6479338842975206, "repo_name": "inmagik/contento", "id": "ecc69c5f66480e28e481ff4009c42e2e9d0c1a38", "size": "121...
import os.path import numpy as np from metrics import * from utils import epochsToDate import sys import string import matplotlib.pyplot as plt from matplotlib import dates import datetime from matplotlib.dates import DateFormatter, WeekdayLocator, MONDAY from truthutil import * import matplotlib from utils import * ...
{ "content_hash": "842769f2664d0a0c15f4f7b8c8691f31", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 212, "avg_line_length": 35.05806451612903, "alnum_prop": 0.5660655134339345, "repo_name": "laura-dietz/taia-stream-eval", "id": "06c106c1ada290d5c04bfda5bd7a647aef73ebdf", ...
import sys, getopt import glob, os import numpy as np from streaming_eigenhashes import StreamingEigenhashes help_message = 'usage example: python kmer_corpus.py -i /project/home/hashed_reads/ -o /project/home/cluster_vectors/' if __name__ == "__main__": try: opts, args = getopt.getopt(sys.argv[1:],'hi:o:r:',["inpu...
{ "content_hash": "41dbfb45958fd68631d09613d51b2dd2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 118, "avg_line_length": 33.193548387096776, "alnum_prop": 0.6540330417881438, "repo_name": "brian-cleary/LatentStrainAnalysis", "id": "8633ef0a9e37ad2cd2c6c1efa5dfb2833415287...
from m5.params import * from m5.SimObject import * from Serial import SerialDevice from Terminal import Terminal class ArmSemihosting(SimObject): type = 'ArmSemihosting' cxx_header = "arch/arm/semihosting.hh" cmd_line = Param.String("", "Command line to report to guest"); stdin = Param.String("stdin"...
{ "content_hash": "e7f4d3b9ae93b7212d4736545b8e6e21", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 39.2, "alnum_prop": 0.6255102040816326, "repo_name": "TUD-OS/gem5-dtu", "id": "7846499140e68f2ccd81d37e245eea8c7a9eef0d", "size": "3080", "binary":...
from __future__ import absolute_import from __future__ import division from builtins import str from builtins import range from past.utils import old_div import proteus import numpy as np from math import fabs import os from proteus import cfemIntegrals, Quadrature, Norms, Comm from proteus.NonlinearSolvers import Nonl...
{ "content_hash": "07a05c85e9cd1f02c01c3fced3def982", "timestamp": "", "source": "github", "line_count": 1154, "max_line_length": 182, "avg_line_length": 50.41334488734835, "alnum_prop": 0.5918318235728897, "repo_name": "erdc/proteus", "id": "0353d9f53c2669751909eb1119710b5b4d956aac", "size": "58177...
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from textwrap import dedent import rover.version # make the gitversion file if possible rover.version.make_gitversion() setup( name = "Rover", version = rover.version.major(), description="Auto...
{ "content_hash": "d3817ff2da6ae1120760624fc0266262", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 78, "avg_line_length": 27, "alnum_prop": 0.5944444444444444, "repo_name": "mdg/rover", "id": "8e8e1292671ca13a5ca76544baeccd9056c8b672", "size": "2191", "binary": false, ...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.utils.encoding import force_text from django.db.models import Sum __all__ = ['CounterManager', ] class CounterManager(models.Manager): def for_model(self, model, total=False): """ QuerySet for al...
{ "content_hash": "51a849729fcb8ae2a9a3ad02a613a03a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 86, "avg_line_length": 31.782608695652176, "alnum_prop": 0.6470588235294118, "repo_name": "DirectlineDev/django-hitcounter", "id": "1a35956174a602e3687dbf49dea50f478d76060e",...
from MaiTaiLaser import *
{ "content_hash": "0aecd464519e6f2107957e7246c5956a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.8076923076923077, "repo_name": "mgraupe/acq4", "id": "e822352d9a90aa97acddc84827df50f4e5b19f48", "size": "26", "binary": false, ...
from django.utils.translation import gettext_lazy as _ from django.contrib.humanize.templatetags.humanize import naturaltime from django.db import models from lino.utils.mldbc.mixins import BabelNamed from lino.modlib.printing.mixins import Printable from lino.api import dd class ClearPrinted(dd.Action): sort_i...
{ "content_hash": "5122be663694f6ed46a671755883c6dd", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 78, "avg_line_length": 29.99173553719008, "alnum_prop": 0.5453292918159273, "repo_name": "lino-framework/xl", "id": "35b48cf5416166764c92cb6403ae8b4830b64f6f", "size": "37...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "barpolar.hoverlabel" _path_str = "barpolar.hoverlabel.font" _valid_props = {"color", "colorsrc...
{ "content_hash": "5c482b4e29da2b44ed0cecff4e735c92", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 82, "avg_line_length": 33.92424242424242, "alnum_prop": 0.5521214828048235, "repo_name": "plotly/plotly.py", "id": "24eb7e16467437a1790891f914544289bdff2fcd", "size": "111...
"""Support for IPMA weather service.""" import logging from datetime import timedelta import async_timeout import voluptuous as vol from homeassistant.components.weather import ( WeatherEntity, PLATFORM_SCHEMA, ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION, ATTR_FORECAST_TEMP, ATTR_FORECAST_TEMP_LO...
{ "content_hash": "ce260526174fce879a0c555a5f42ba83", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 79, "avg_line_length": 30.48847926267281, "alnum_prop": 0.6216747279322854, "repo_name": "jnewland/home-assistant", "id": "e976bcb9896a51f261f49250815f612f1e5c15a0", "size...
import logging import os import sys import yaml from collections import namedtuple import six from compose.cli.utils import find_candidates_in_parent_dirs DOCKER_CONFIG_KEYS = [ 'cap_add', 'cap_drop', 'cpu_shares', 'cpuset', 'command', 'detach', 'devices', 'dns', 'dns_search', ...
{ "content_hash": "a535f07dbd737cba2f19eeb0e226dfa7", "timestamp": "", "source": "github", "line_count": 590, "max_line_length": 205, "avg_line_length": 28.67966101694915, "alnum_prop": 0.6162756338277879, "repo_name": "Yelp/docker-compose", "id": "aa2db2c71d760a4c78cfa4c68d8aa8d49d8eb656", "size": ...
import copy from mqlparser.util import parse_name, is_list class QueryNode(object): """ A node in the query graph. This is used to interpret the structure of the query body, and read by the query itself. """ def __init__(self, parent, name, data): self.parent = parent self.data = value =...
{ "content_hash": "7b7ca5c662df6e5487f42bcfa0a9fdba", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 77, "avg_line_length": 26.867924528301888, "alnum_prop": 0.5375702247191011, "repo_name": "pudo/mqlparser", "id": "c700e7aa2f5cec0911e8fdfedfe369008869940a", "size": "2848...
""" Module for shock """ import errno import json import logging import os import re import requests import StringIO import subprocess import sys import time import tempfile import utils def verify_shock_url(url): return utils.verify_url(url, 7445) def handle_to_url(handle): shock_url = handle.get('shock_u...
{ "content_hash": "f8642c1f755bd82b645280f1e2bd8431", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 122, "avg_line_length": 33.92070484581498, "alnum_prop": 0.5712987012987013, "repo_name": "sebhtml/assembly", "id": "60565f3201d329e75f4a161ebdc1086417ca8243", "size": "77...
"""mimeopen implementation for mac created: 2016/3/28 author: smileboywtu """ import os import re from plistlib import readPlist from xml.parsers.expat import ExpatError HOME = os.environ['HOME'] sys_app = os.path.join('/', 'Applications') usr_app = os.path.join(HOME, 'Applications') app_dir = [sys_app, usr_app] ...
{ "content_hash": "7da90bcef22bd9641a0bee3062c3c1da", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 75, "avg_line_length": 24.80314960629921, "alnum_prop": 0.5673015873015873, "repo_name": "smileboywtu/mimeopen", "id": "b6108bb4012ea4fded16fa416cd20ab83066b5db", "size": ...
import asyncio from typing import Optional, cast from .tcp_helpers import tcp_nodelay class BaseProtocol(asyncio.Protocol): __slots__ = ('_loop', '_paused', '_drain_waiter', '_connection_lost', 'transport') def __init__(self, loop: asyncio.AbstractEventLoop) -> None: self._loop = lo...
{ "content_hash": "5ae7fffca487f338dff326962b9484e6", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 73, "avg_line_length": 32.641975308641975, "alnum_prop": 0.5858547655068078, "repo_name": "gnmiller/craig-bot", "id": "cf4f9dad2ea69a8722b45684caa1a4b2df80ff37", "size": "2...
"""Test the wallet.""" from test_framework.test_framework import PivxTestFramework from test_framework.util import ( assert_array_result, assert_equal, assert_fee_amount, assert_raises_rpc_error, connect_nodes, Decimal, wait_until, ) class WalletTest(PivxTestFramework): def set_test_pa...
{ "content_hash": "ec8a6c5852c3a35d42b3d2574d191c28", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 121, "avg_line_length": 46.323076923076925, "alnum_prop": 0.6209730986383262, "repo_name": "Darknet-Crypto/Darknet", "id": "b680f2997aa7ca8398c18233240438c410028147", "siz...
import sys from neutronclient.common import exceptions from neutronclient.neutron.v2_0.lb.v2 import l7policy from neutronclient.tests.unit import test_cli20 """Structure for mapping cli and api arguments The structure maps cli arguments and a list of its api argument name, default cli value and default api value. It...
{ "content_hash": "a6bb23cbfebdffa5c5d0066e9b80f1fb", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 78, "avg_line_length": 41.43852459016394, "alnum_prop": 0.5630501434081693, "repo_name": "rackerlabs/rackspace-python-neutronclient", "id": "71869315bbd9b995b8c1125d8d3173c5...
from __future__ import division import os import numpy as np import tensorflow as tf def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _float32_feature(value):...
{ "content_hash": "a80d5ba5c3a80ba813ac4b2200e656f8", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 121, "avg_line_length": 44.413333333333334, "alnum_prop": 0.6523566496547584, "repo_name": "deworrall92/harmonicConvolutions", "id": "ce20809c89e6ee13e9eef1480e6996b8ee69a7d...
""" ``comp`` module. """ import sys PY3 = sys.version_info[0] >= 3 if PY3: # pragma: nocover from _thread import allocate_lock else: # pragma: nocover from thread import allocate_lock # noqa try: # pragma: nocover import ast def adjust_source_lineno(source, name, lineno): source = co...
{ "content_hash": "86e20705a3ec46787147decb7b5fdeef", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 65, "avg_line_length": 20.62962962962963, "alnum_prop": 0.6481149012567325, "repo_name": "ezotrank/wheezy.template", "id": "e421e3f88610ef1eda3e8840b2467d011c921a2d", "size...
from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. """ INTERNAL = "Internal" class ApiP...
{ "content_hash": "f1e934039ea247e69d914b22c27d6508", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 101, "avg_line_length": 27.79127725856698, "alnum_prop": 0.688039457459926, "repo_name": "Azure/azure-sdk-for-python", "id": "593ef2e25130e9fb602bfe88051daa92385c0cd4", "s...
"""Provides data for the cash dataset. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf from datasets import dataset_utils slim = tf.contrib.slim _FILE_PATTERN = 'cash_*_%s.tfrecord' SPLITS_TO_SIZES = {'train': 848,...
{ "content_hash": "79abbd4d09851fc55bab9a2878426d68", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 81, "avg_line_length": 29.804878048780488, "alnum_prop": 0.6910801963993454, "repo_name": "HankCHTsai/eye4cash", "id": "88319b9cbce0b28a9ce5950458678c0a9bbdee12", "size": "...
from django.apps import AppConfig class EgressConfig(AppConfig): name = 'egress'
{ "content_hash": "1e6e95b9f2b3f78d2eb2ecda0382c232", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.4, "alnum_prop": 0.7471264367816092, "repo_name": "rockymeza/ymrj", "id": "6017cf1bd939c5a3b40f55f34c21cace2d4d15b5", "size": "87", "binary": fal...
""" Tests for internal row validator """ import unittest from cs.eyrie import vassal from collections import namedtuple Column = namedtuple('Column', ['name', 'type', 'nullable']) class _FakeTable(): def __init__(self, columns): self.columns = columns class TestRowValidator(unittest.TestCase): ...
{ "content_hash": "1922b44b20c7f49241510303562ebf40", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 80, "avg_line_length": 33.51578947368421, "alnum_prop": 0.5232412060301508, "repo_name": "CrowdStrike/cs.eyrie", "id": "045102fdcb29ee0d72a73c66e7638413f0c7087c", "size": "...
import sys import math import matplotlib.pyplot as plt import collections X_AXIS_SIZE = 100 Y_AXIS_SIZE = 5 ALPHA = 0.75 GROUND_VALUE = 1 FILTER_POW = 2 FILTER_AMPLIFIER = 2 plt.ion() fig = plt.figure() if not sys.stdin.isatty(): input_stream = sys.stdin else: raise IndexError('Can only be used with bash...
{ "content_hash": "ae84407782b69c9dfc427e138245e5f3", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 100, "avg_line_length": 22.01851851851852, "alnum_prop": 0.6585365853658537, "repo_name": "kr1stjans/realtime_plotting", "id": "0e87e7dc6244ce8c8b9def2fd90f9df063138b3c", "...
from openstack_dashboard.test.test_data import exceptions from openstack_dashboard.test.test_data import utils from troveclient import exceptions as trove_exceptions def data(TEST): if not TEST.exceptions: TEST.exceptions = utils.TestDataContainer() trove_exception = trove_exceptions.ClientException...
{ "content_hash": "fa2d7295eb9a6520e4737d0530b6277c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 36.23529411764706, "alnum_prop": 0.6915584415584416, "repo_name": "openstack/trove-dashboard", "id": "b8a0fb6816dd927c4f2a06334b3be4b17f8bcfbc", "siz...
from dppy.beta_ensembles import JacobiEnsemble jacobi = JacobiEnsemble(beta=3.14) # beta can be >=0, default beta=2 # Reference measure is Beta(a,b) jacobi.sample_banded_model(a=500, b=300, size_N=400) # jacobi.plot(normalization=True) jacobi.hist(normalization=True)
{ "content_hash": "167521d04faa61dc1113cb41c181b039", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 69, "avg_line_length": 33.875, "alnum_prop": 0.7638376383763837, "repo_name": "guilgautier/DPPy", "id": "2e420c321e6c1e33c9266968fb8fbb7435a1911b", "size": "271", "binary"...
"""reSTveal Usage: restveal <file> <directory> restveal (-h | --help) restveal --version Options: -h --help Show this screen. --version Show version. """ from docopt import docopt def main(): arguments = docopt(__doc__, version='reSTveal 0.1') print(arguments) if __name__ == "__main__": ...
{ "content_hash": "fa8f42dd423291628b6dd319be81878a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 55, "avg_line_length": 15.761904761904763, "alnum_prop": 0.5981873111782477, "repo_name": "mrshu/reSTveal", "id": "c49042a56a63873f30ccd1c87be0bff90e859fec", "size": "331",...
import argparse import sys import traceback from fuel_update_downloader.downloader import Downloader from fuel_update_downloader import errors def handle_exception(exc): if isinstance(exc, errors.FuelUpgradeException): sys.stderr.write(exc.message + "\n") sys.exit(-1) else: traceback....
{ "content_hash": "2f0a6c05c640520435b73d75d7e8210b", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 56, "avg_line_length": 21.183333333333334, "alnum_prop": 0.6018882769472856, "repo_name": "andrei4ka/fuel-web-redhat", "id": "d80b41af5c9b4c3c08b500a420e7dbfc09b40d87", "si...
from __future__ import unicode_literals import codecs import os import shutil import tempfile import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.contrib.staticfiles import storage from django.contrib.staticfiles.management.commands import collectstatic fr...
{ "content_hash": "f168d77e4b63deeefd7462c87daf4ca6", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 108, "avg_line_length": 40.69069767441861, "alnum_prop": 0.66737154940847, "repo_name": "erikr/django", "id": "d4d5064b74b8576296c99704b2494e2244450ac2", "size": "17497", ...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_narmle_guard_rodian_female_01.iff" result.attribute_template_id = 9 result.stfName("npc_name","rodian_base_female") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "0722116d6d7c81b6db635ae417e467a7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 24.615384615384617, "alnum_prop": 0.703125, "repo_name": "obi-two/Rebelion", "id": "2ed1568ca6b9df103d8f04012fa269f180fe0aac", "size": "465", "bina...
from fancysets import TransformationSet, Range
{ "content_hash": "0cb12f4a49c1c519fc611d3e93e3f75b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 46, "avg_line_length": 47, "alnum_prop": 0.8723404255319149, "repo_name": "flacjacket/sympy", "id": "374d60c3e3a99055d2eb3acde3ead1e8e162f823", "size": "47", "binary": fal...
import ckan.plugins as p import ckan.lib.base as base from apscheduler.scheduler import Scheduler from ckan.common import c import ckan.lib.helpers as h import tasks import os import logging import ckan.model.meta as meta import threading import time log = logging.getLogger('ckan.logic') # TODO: delete this class ...
{ "content_hash": "42643b98c3712465ef4052446db7bd52", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 190, "avg_line_length": 51.03977272727273, "alnum_prop": 0.6379828565067349, "repo_name": "CI-WATER/portal", "id": "29bfaaed82c2716f0b9c7c9dd287035d2180ee44", "size": "898...
"""Example process file.""" def execute(mp): """User defined process.""" # Reading and writing data works like this: with mp.open("file1") as raster_file: if raster_file.is_empty(): return "empty" # This assures a transparent tile instead of a pink error tile # ...
{ "content_hash": "0debd0c1478d18099809fa2dd7bf665a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 32.92307692307692, "alnum_prop": 0.6191588785046729, "repo_name": "ungarj/mapchete", "id": "673d9bf3df23dd27c05e8d83c12b968e02daf0da", "size": "428",...
import io import os import shutil import tempfile import paramiko from django.utils.encoding import force_str from djblets.siteconfig.models import SiteConfiguration from djblets.util.decorators import cached_property from reviewboard.ssh.client import SSHClient from reviewboard.ssh.errors import UnsupportedSSHKeyErr...
{ "content_hash": "19aee4f1675ab8bfcc74de6f376432ae", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 79, "avg_line_length": 35.45066666666666, "alnum_prop": 0.6522491349480969, "repo_name": "reviewboard/reviewboard", "id": "0c34cbc860c64295b7096e16d597c1cf2b689d1f", "size...
from __future__ import division __author__ = 'Vladimir Iglovikov' ''' This scripts merges several csv files that are used to perform Kaggle submission It performs softmax regression for otto competition ''' import os import sys import pandas as pd import time import math import numpy as np import decimal def logit(p...
{ "content_hash": "6b426c2e765761bdc2fe66d643b6c264", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 19.770491803278688, "alnum_prop": 0.6807628524046434, "repo_name": "ternaus/submission_merger", "id": "1884acb9cca90f64287c0a17fe7ed61f5172ec69", "si...
import sqlite3 import os conn = sqlite3.connect('sqconfig.db') cur = conn.cursor() cur.execute('SELECT nodeName FROM pnode') nodes = cur.fetchall() listOfNodes = list() for node in nodes: listOfNodes.append(node[0]) nodelist = str() for node in listOfNodes: nodelist = node + " " + nodelist print nodeli...
{ "content_hash": "a1caefb875b2cea90713d18ad01e99f9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 41, "avg_line_length": 14.08695652173913, "alnum_prop": 0.6975308641975309, "repo_name": "rlugojr/incubator-trafodion", "id": "0041ba5c855679ee9d9fbd9ebb9a0387400c10bd", "s...
from rootpy import ROOT from rootpy.base import Object from rootpy.decorators import (method_file_check, method_file_cd, snake_case_methods) from rootpy.io import TemporaryFile import rootpy from nose.tools import assert_equal, assert_true, raises def test_snake_case_methods(): cla...
{ "content_hash": "e44764fbb30bab72ffa493e3c77d1ce1", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 77, "avg_line_length": 23.3265306122449, "alnum_prop": 0.6023622047244095, "repo_name": "ndawe/rootpy", "id": "fd092ed991336b9d3966aaafaa446706ef7a268f", "size": "2286", ...
from __future__ import absolute_import, division, print_function __metaclass__ = type TMS_GLOBAL = ''' # The cmd_ref is a yaml formatted list of module commands. # A leading underscore denotes a non-command variable; e.g. _template. # TMS does not have convenient global json data so this cmd_ref uses raw cli configs. ...
{ "content_hash": "7849f9fb708d5a47df00ba3a724974a7", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 147, "avg_line_length": 29.40875912408759, "alnum_prop": 0.6698932737652022, "repo_name": "thaim/ansible", "id": "10e44f4e4c1f5ecad08474d81e3c60c21e0a1fb6", "size": "4234"...
from flask import g, jsonify from flask_httpauth import HTTPBasicAuth from ..models import User, AnonymousUser from . import api from .errors import unauthorized, forbidden auth = HTTPBasicAuth() @auth.verify_password def verify_password(email_or_token, password): if email_or_token == '': g.current_user ...
{ "content_hash": "779f360b54793d0603acb7201fc5ff0b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 64, "avg_line_length": 26.822222222222223, "alnum_prop": 0.676056338028169, "repo_name": "WJFQQQ/flasky18", "id": "1675e6483b4d5b0d7dc6a9c40886f0bd8e2e6c35", "size": "1259"...
import sys import re import b2.util.regex options = {} # Set a value for a named option, to be used when not overridden on the command # line. def set(name, value=None): global options options[name] = value def get(name, default_value=None, implied_value=None): global options ...
{ "content_hash": "6a1e6d6651ff48cee690b6958ee4bf94", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 24.866666666666667, "alnum_prop": 0.5844504021447721, "repo_name": "zjutjsj1004/third", "id": "bc1eba47edc7e59a06063d8a1f5386b381d80a2d", "size": "97...
from indy import ledger import json import pytest from tests.ledger.test_submit_request import ensure_previous_request_applied @pytest.mark.asyncio async def test_get_response_metadata_works_for_nym_requests(pool_handle, wallet_handle, identity_trustee1, i...
{ "content_hash": "cd5f08c8f1a4c6155bf1c057578f7840", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 117, "avg_line_length": 47.766666666666666, "alnum_prop": 0.6894626657362177, "repo_name": "Artemkaaas/indy-sdk", "id": "fd63deed4197515fff14e393128c7af8ce28e50a", "size": ...
from ..base import AnnotatedNineMLObject import sympy from nineml.utils import validate_identifier from nineml.units import Dimension, dimensionless class BaseALObject(AnnotatedNineMLObject): """ Base class for abstraction layer classes """ layer = 'abstraction' class Parameter(BaseALObject): ...
{ "content_hash": "c02580039d8c4de04eaba018b77cc0fe", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 31.470588235294116, "alnum_prop": 0.624766355140187, "repo_name": "INCF/lib9ML", "id": "4b590241429038d2603dac90c923754f19bbdf99", "size": "2140", ...
import django.contrib.postgres.indexes from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("account", "0047_auto_20200810_1415"), ] operations = [ migrations.AddIndex( model_name="user", index=django.contrib.postgres.indexes.G...
{ "content_hash": "7bb4873fa01210f20640072d1348a768", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 67, "avg_line_length": 26.375, "alnum_prop": 0.5592417061611374, "repo_name": "mociepka/saleor", "id": "e4df165ee4c004218b2ee421130224a4f01df2fe", "size": "682", "binary"...
""" Utility base TestCase classes for testing views. """ from django.conf import settings from django.core.urlresolvers import reverse from BeautifulSoup import BeautifulSoup import django_webtest import django_webtest.backends from moztrap import model from ...utils import Url from ..base import DBMixin class W...
{ "content_hash": "970f69967668ebbb8ca3c9934e03ce9a", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 79, "avg_line_length": 31.484177215189874, "alnum_prop": 0.6019700472409287, "repo_name": "shinglyu/moztrap", "id": "bf69e2c2c555044f28b2d09e929f1dda9f4d3a87", "size": "99...
import logging import os from insights.core import archives, dr from insights.core.serde import Hydration from insights.core.context import (ClusterArchiveContext, ExecutionContextMeta, HostArchiveContext, Serializ...
{ "content_hash": "6fcaf1854d6fa1d26a11753a63e918ea", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 31.92, "alnum_prop": 0.5969089390142022, "repo_name": "RedHatInsights/insights-core", "id": "c9310d5f25d2dabb82e0517de8c412e1c59b6ccf", "size": "2394...
import json import unittest import copy try: from unittest import mock except ImportError: try: import mock except ImportError: mock = None from airflow import configuration from airflow import models from airflow.utils import db from airflow.contrib.hooks.sagemaker_hook import SageMakerHoo...
{ "content_hash": "e3c5bcdaa46af2121338c41bb7024d34", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 90, "avg_line_length": 39.03233830845771, "alnum_prop": 0.5887451405264165, "repo_name": "criccomini/airflow", "id": "8bb56cc8e7d12069b4a9bad761cdc8a442f4eb9b", "size": "1...
import base64 import json as _json import six (OPEN, CLOSE, PING, PONG, MESSAGE, UPGRADE, NOOP) = (0, 1, 2, 3, 4, 5, 6) packet_names = ['OPEN', 'CLOSE', 'PING', 'PONG', 'MESSAGE', 'UPGRADE', 'NOOP'] class Packet(object): """Engine.IO packet.""" json = _json def __init__(self, packet_type=NOOP, data=No...
{ "content_hash": "26752130dbc729bb1274ea4ed871a1b9", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 78, "avg_line_length": 37.08433734939759, "alnum_prop": 0.5357374918778428, "repo_name": "mcking49/apache-flask", "id": "5e70511a9c3f74b1a6ef0e15c5329e57a6577f79", "size": ...
""" A table viewer for local file systems. """ # Standard library imports. from os import listdir, stat from os.path import basename, isdir, join from time import localtime, strftime # Enthought library imports. from pyface.api import ImageResource from pyface.viewer.api import TableColumnProvider, TableContentProvi...
{ "content_hash": "549201d11921ae7ca83a2c716b65a984", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 30.59124087591241, "alnum_prop": 0.5177761870675256, "repo_name": "geggo/pyface", "id": "02547c6658c38e0a6566db2506f78ed28569d20d", "size": "4831", ...
import Warrentech_FontCenter_Web.models import FontModels, MissingLog
{ "content_hash": "2616f9a904669d259fa9800a9c65339a", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 35, "alnum_prop": 0.8714285714285714, "repo_name": "Xiongpq/FontCenter", "id": "931f78dd701b9b41146b9d3fbf4696ca1ca0d9ee", "size": "70", "binary": f...
""" Automate genome annotation by iterating processing a set of files, individually. """ import os.path as op import shutil import sys import logging from functools import partial from tempfile import mkdtemp from jcvi.assembly.automaton import iter_project from jcvi.apps.grid import Jobs, MakeManager from jcvi.form...
{ "content_hash": "5d625109c90bd5ab7d3d058d885a3829", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 88, "avg_line_length": 28.681318681318682, "alnum_prop": 0.5821200510855683, "repo_name": "tanghaibao/jcvi", "id": "7823a3a8a75182bfb1992c0da81863b4277b6772", "size": "787...
from tempfile import gettempdir from os.path import join, dirname import example_project ADMINS = ( ) MANAGERS = ADMINS DEBUG = True TEMPLATE_DEBUG = DEBUG DISABLE_CACHE_TEMPLATE = DEBUG DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = join(gettempdir(), 'djangobaselibrary_example_project.db') TEST_DATABASE_NAME =join...
{ "content_hash": "cd40faac84d0cc6b07a9ddf8869e13c2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 83, "avg_line_length": 23.349206349206348, "alnum_prop": 0.7267165193745752, "repo_name": "Almad/rpgrules", "id": "55fb00c9092182353cbc23684e2ef65d0733c770", "size": "1471"...
import json import os.path import tweepy import time from collections import defaultdict substance = 'test' with open('%s_tweeters.json' %substance,'rb') as js: tweeters = json.load(js) with open('tokens.json','rb') as js: tokens = json.load(js) consumer_key = tokens["consumer_key"] consumer_secr...
{ "content_hash": "ceddf33c761949f2525133b6a3d6f6e5", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 25.6, "alnum_prop": 0.6519097222222222, "repo_name": "mac389/snappy", "id": "67516ad57d20040f17ab9d21ecabca2eddbc540b", "size": "1294", "binary": f...
from subprocess import Popen, PIPE from settings import INCLINOMETER class Inclinometer(object): def __init__(self): self.process = Popen(INCLINOMETER, stdin=PIPE, stdout=PIPE) def get_serial_number(self): self.process.stdin.write('getSerialNumber\n') return int(self.pro...
{ "content_hash": "e05a7daf64563d89746a1571d36b6d77", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 67, "avg_line_length": 33.02040816326531, "alnum_prop": 0.6242274412855378, "repo_name": "suddi/3DSlantRelief", "id": "80ea40634d868c04f1897c9e4c32483033fc02f5", "size": "1...
from shub_cli.config.display import TABLE_JOB_MODEL, TABLE_JOBS_MODEL, TABLE_SPIDERS_MODEL, HC_TABLE_JOBS_MODEL from shub_cli.util.parse import get_job_main_info, get_hc_job_main_info from terminaltables import SingleTable def display(job, click): """ Display the job information. :param job: A Job object...
{ "content_hash": "b8147d2b31e6a8e7f39aad49e8f1fd2f", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 193, "avg_line_length": 34.839080459770116, "alnum_prop": 0.6215770372814253, "repo_name": "victormartinez/shub_cli", "id": "d4134e0ad7dd3ab25892eada8f5ac9bd8fc0ebd1", "siz...
"""Test the send RPC command.""" from decimal import Decimal, getcontext from itertools import product from test_framework.authproxy import JSONRPCException from test_framework.descriptors import descsum_create from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert...
{ "content_hash": "f45f0a848bea2aed5a15ae8c5fc4490b", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 161, "avg_line_length": 53.35892116182573, "alnum_prop": 0.5972238422955791, "repo_name": "ElementsProject/elements", "id": "6a8d80fce6e0135c24b795356cbfa1cc563dba5e", "si...
from oslo_utils import strutils from webob import exc from jacket.api.compute.openstack import common from jacket.api.compute.openstack import extensions from jacket.api.compute.openstack import wsgi from jacket.compute import cloud from jacket import context as nova_context from jacket.compute import exception from j...
{ "content_hash": "0c2eb2fdfd1f6df92b21182bf72a906e", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 79, "avg_line_length": 38.99047619047619, "alnum_prop": 0.6262823644357597, "repo_name": "HybridF5/jacket", "id": "65b41df20cf2f7f58eee3d2cb07db3814e222afe", "size": "4700...
''' tests/metrics.py are functions that expose the tests to the user and continuous integration environment Copyright (c) 2017 Vanessa Sochat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in t...
{ "content_hash": "31fa6d1634ca870f8c7192d206874148", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 124, "avg_line_length": 41.470588235294116, "alnum_prop": 0.6795508274231679, "repo_name": "containers-ftw/cftw", "id": "e04a0fd8c350d9cf88f1c06ac46597af936dc4d1", "size":...
from __future__ import print_function import argparse import os import stat import sys # find the import for catkin's python package - either from source space or from an installed underlay if os.path.exists(os.path.join('/opt/ros/groovy/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.path.insert(0, os.path.jo...
{ "content_hash": "4fd272612cc425edf702860818095984", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 105, "avg_line_length": 44.86206896551724, "alnum_prop": 0.7255956956187548, "repo_name": "robotics-silver-surfer/surfer-main", "id": "139415f512376ec3156f6ebd1d7ceea1b31f786...
""" Define all the routes for the weight blueprint. """ # Imports from flask import flash, redirect, render_template, \ request, url_for, Blueprint from flask.ext.login import login_required, current_user from traininglog.models import Weight from traininglog import db from forms import AddWeightForm f...
{ "content_hash": "2b1018846f7001bed17c870deb5fd100", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 174, "avg_line_length": 36.13265306122449, "alnum_prop": 0.6560293702343971, "repo_name": "jakemalley/training-log", "id": "05e1742e5e0a732adb12f4652a633bece5b95290", "size...
from django.core.management import call_command from django.core.management.base import CommandError import waffle from django_statsd.clients import statsd import olympia.core.logger from olympia.constants.blocklist import ( MLBF_BASE_ID_CONFIG_KEY, MLBF_TIME_CONFIG_KEY) from olympia.zadmin.models import get_conf...
{ "content_hash": "0287e0de36e24565e6260e0583900a64", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 79, "avg_line_length": 38.09090909090909, "alnum_prop": 0.6923410718160121, "repo_name": "eviljeff/olympia", "id": "89194a78fc944481ea97201c4b88df1f1c462265", "size": "460...
"""Unit tests for django_evolution.utils.models.""" from __future__ import unicode_literals from django.db import DEFAULT_DB_ALIAS, models from django_evolution.compat.models import get_remote_field from django_evolution.db.state import DatabaseState from django_evolution.tests.base_test_case import TestCase from dj...
{ "content_hash": "6aa7099009b1b86901f67688d8f50928", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 78, "avg_line_length": 41.44134078212291, "alnum_prop": 0.5823672148827177, "repo_name": "beanbaginc/django-evolution", "id": "1482a07abcd89a7957da73efb5078e6979de1694", "...
from __future__ import with_statement import os import sys import re import string import inspect, traceback # get type names from types import * from m5.util.grammar import Grammar debug=False ################### # Utility functions # # Indent every line in string 's' by two spaces # (except preprocessor directive...
{ "content_hash": "5f372ce477b88aac2968365a7e6aec89", "timestamp": "", "source": "github", "line_count": 2391, "max_line_length": 89, "avg_line_length": 36.65537432036805, "alnum_prop": 0.5625435003365927, "repo_name": "briancoutinho0905/2dsampling", "id": "749eaf88de8ef8dff7c0317debec020f7e3d2d26", ...
from cms.api import create_page from django.test import TestCase from meta_tagger.models import MetaTagPageExtension class MetaTagPageExtensionTests(TestCase): def test_meta_tag_page_extension(self): page = create_page('Test Page Extension', 'meta_tagger/index.html', 'en') page_extension = MetaTa...
{ "content_hash": "3d389de1e721a19efb1d9cc223f5d097", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 118, "avg_line_length": 45.421052631578945, "alnum_prop": 0.7566628041714948, "repo_name": "dreipol/meta-tagger", "id": "c78fab7bf124e30b815b6913d23430ed9f91155a", "size": ...
def timeout(func, args=(), kwargs={}, timeout_duration=1, default=None): import threading class InterruptableThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.result = None def run(self): try: self.result = fun...
{ "content_hash": "6851e5f4e370da6c258fea91ca93d9fd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 72, "avg_line_length": 27.65, "alnum_prop": 0.5497287522603979, "repo_name": "ActiveState/code", "id": "c1d178ebda0648103d78acd3e3b339520542e8b4", "size": "553", "binary"...
from zope.interface import implementer from .interfaces import IHardwareManager, IHardwareMap, IHardwareNode import yaml @implementer(IHardwareManager) class HardwareManager(dict): raw_maps = {} def check_data(self, address, data): node = self.get_node(address) return node.isValueValid(data) ...
{ "content_hash": "1969e2df7faf6a8668483d410ac1a62f", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 90, "avg_line_length": 27.820987654320987, "alnum_prop": 0.5817617040159752, "repo_name": "kratsg/ironman", "id": "16e269ce320d51cf829029dd7f35c2055188ba00", "size": "4507...
class Bar(object): def mitzvah(self): return 'yah' def give_me_some(self,f): return f
{ "content_hash": "1e360e8ce3ca34ed300d216291c336a5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 27, "avg_line_length": 14.428571428571429, "alnum_prop": 0.6138613861386139, "repo_name": "Gussy/titanium_desktop", "id": "e09d73e0f565de629da192dfa3987cc5655566e9", "size":...
from atelier.invlib import setup_from_tasks ns = setup_from_tasks( globals(), "lino_xl", languages="en de fr et nl pt-br es zh-hant bn".split(), tolerate_sphinx_warnings=False, doc_trees=[], blogref_url='https://luc.lino-framework.org', revision_control_system = 'git', locale_dir='lino_xl/li...
{ "content_hash": "ea50097c40134aa811be03a8c23c353d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 37.111111111111114, "alnum_prop": 0.6676646706586826, "repo_name": "lino-framework/xl", "id": "fb589f8a04d8b1c2ca9c8fc60fc0d034f3d41613", "size": "334...
from __future__ import print_function, absolute_import import os import re import shlex import subprocess import click from click import Option, Argument, MultiCommand, echo import six if six.PY3: try: from enum import Enum except ImportError: from pipenv.vendor.backports.enum import Enum else...
{ "content_hash": "c2744a6340773d8cfb0d82f15c69834e", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 136, "avg_line_length": 31.645077720207254, "alnum_prop": 0.5995088006549325, "repo_name": "kennethreitz/pipenv", "id": "74da12d02200be7589c8fd0df0593b09b5578c65", "size":...
import os import io from setuptools import setup, find_packages PACKAGENAME = 'community_mailbot' DESCRIPTION = 'Friendly mail forwarding bot for community.lsst.org' LONG_DESCRIPTION = '' AUTHOR = 'Jonathan Sick' AUTHOR_EMAIL = 'jsick@lsst.org' LICENSE = 'MIT' URL = 'https://github.com/lsst-sqre/community_mailbot' ...
{ "content_hash": "f2d7fc4a81f02abee94df054ced73d6a", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 95, "avg_line_length": 27.660377358490567, "alnum_prop": 0.6473396998635743, "repo_name": "lsst-sqre/community_mailbot", "id": "3cd68039b45eb743f58775fa756c045a0e6f1610", "...
import logging import os import re import socket import sys import time from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django_extensions.management.technical_response import \ null_technical_500_response from django_extensio...
{ "content_hash": "79cf35098d21a40f6cacfc4bdbd52859", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 194, "avg_line_length": 44.33608815426997, "alnum_prop": 0.5520690940723251, "repo_name": "joeyespo/django-extensions", "id": "817940182ae5c2fe6d7dcf1215bbff6d47be927a", "...
''' 1. Use Paramiko to retrieve the entire 'show version' sh_verut from pynet-rtr2. 2. Use Paramiko to change the 'logging buffered <size>' configuration on pynet-rtr2. This will require that you enter into configuration mode. ''' import paramiko from getpass import getpass import time ip_addr = '50.76.53.27' use...
{ "content_hash": "5c7c020a80cb37830db7e3789c72c552", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 159, "avg_line_length": 39.06382978723404, "alnum_prop": 0.7510893246187363, "repo_name": "joeyb182/pynet_ansible", "id": "f8dc995272def61e02f1f301580b59d7e463a0af", "size"...
import unittest import imath import IECore import Gaffer import GafferTest import GafferScene import GafferSceneTest class SceneFilterPathFilterTest( GafferSceneTest.SceneTestCase ) : def test( self ) : camera = GafferScene.Camera() plane = GafferScene.Plane() group = GafferScene.Group() group["in"][0].se...
{ "content_hash": "d688c4c4b438f11996b1d7a13cda30fd", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 103, "avg_line_length": 28.597014925373134, "alnum_prop": 0.6941544885177453, "repo_name": "ivanimanishi/gaffer", "id": "c04c3c4802b4bc0193bb4e91aec438b69faaffe6", "size": ...
""" Utilities for warnings. Shoudn't we just use the built in warnings module. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, d...
{ "content_hash": "e2f7df5fcb268329db731f639f483306", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 29.53846153846154, "alnum_prop": 0.4640625, "repo_name": "sodafree/backend", "id": "d34a2625b4b3e06d15509bdc9b58b44d9c414f0d", "size": "1938", "bin...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "unesco.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "effb79990fef47c7ab61d6dbad54e545", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 70, "avg_line_length": 25.22222222222222, "alnum_prop": 0.7092511013215859, "repo_name": "robjordan/unesco_project", "id": "5423b3fec03c078f4e8bc4be83b1fad1581d0238", "size"...
from flask import Flask, request, render_template,url_for,redirect from PlaylistDatabase import PlaylistDatabase #import IPython db = PlaylistDatabase(config_file='/home/pi/PlaylistDatabase/PlaylistDatabaseConfig.ini',connect=False) app = Flask(__name__) def get_youtube_id(video): # Strip anything leading up t...
{ "content_hash": "6621a5da1aa63e63827774b87020b200", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 391, "avg_line_length": 35.486338797814206, "alnum_prop": 0.6632275947028026, "repo_name": "kevinrigney/PlaylistDatabase", "id": "8686640811d0348a86a7b0d6930ea07020f78da8", ...
"""Tests for layers.feature_column.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf class FeatureColumnTest(tf.test.TestCase): def testImmutability(self): a = tf.contrib.layers.sparse_column_with_hash_bucket("...
{ "content_hash": "885dd3ef5b17967b163ca22d7a29a886", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 80, "avg_line_length": 46.68337129840547, "alnum_prop": 0.6034449107055724, "repo_name": "Lab603/PicEncyclopedias", "id": "6f1393da4d46249c48da31d72c9efc4b18f015dd", "size...
import urllib.parse from core.core import Core from web.helpers.json import json_response @json_response def product_list(request): """ Получить список продуктов с учетом фильтров filter - тип продукта, product, application, engine installed - установлен или нет q - строка поиска :param requ...
{ "content_hash": "fc6a5e6af340c2fcafa9e5ff8d6ab1c1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 103, "avg_line_length": 26.25, "alnum_prop": 0.6793650793650794, "repo_name": "helicontech/zoo", "id": "b7e49589a416357193d562db23308a4c2f345c04", "size": "1047", "binary...
from sqlalchemy import * #basic lines to initialise the database def dbInit(): engine = create_engine('sqlite:///devices.db') metadata = MetaData(engine) conn = engine.connect() return [engine, metadata, conn] #Create/reflects the tables in the database def dbCreateTables(metadata, engine, count): ...
{ "content_hash": "6ec038edaef392129459cc48c94cf80d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 136, "avg_line_length": 38.71910112359551, "alnum_prop": 0.6033081834010446, "repo_name": "jve0/pi-home-automation", "id": "cf0ff9aae47ee66f429da1c27869c9787524274a", "size...
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import OktaProvider urlpatterns = default_urlpatterns(OktaProvider)
{ "content_hash": "cfeb616e04d19d7c5850f354f1e22391", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 75, "avg_line_length": 27, "alnum_prop": 0.8518518518518519, "repo_name": "pennersr/django-allauth", "id": "df959cbeca867f5f43ebeb1ab8c4492cca63d468", "size": "162", "bina...
import math # Range of LODs to calculate errors for. START_LOD = 4 END_LOD = 9 # Define measurement locations within an LOD. # Steps begin at center of map and move up. # Mirror results for southern hemisphere. # E.g. at LOD 4, the x and y dimensions are 16 tiles, # so 8 steps would touch each tile from the equator t...
{ "content_hash": "ea7179554fd6e7d1fea3ed118d794eae", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 76, "avg_line_length": 36.6822429906542, "alnum_prop": 0.6777070063694267, "repo_name": "tst-ahernandez/earthenterprise", "id": "210afb24f12ee5d745e6a67f23c211163aff5cb8", ...
import sys from InstallTools import * import sys if len(sys.argv) < 3: raise j.exceptions.RuntimeError("specify login/passwd (as 2 independant args)") login = sys.argv[1] passwd = sys.argv[2] # do.installJS(base=j.dirs.base,clean=True,insystem=False,pythonversion=3,web=True) from JumpScale import j # j.tools...
{ "content_hash": "25e288b45a7d9f09e8baf129400b953d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 100, "avg_line_length": 34.84415584415584, "alnum_prop": 0.6999627282892285, "repo_name": "Jumpscale/jumpscale_core8", "id": "9ef591a0a82bbfabcf053cebe1d93cdcc7bdce5c", "si...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SQLLocation' db.create_table(u'locations_sqllocation', ( (u'id', self.gf('django.db.models.field...
{ "content_hash": "8ad4e3ec64c2c1a64f679e5ce428263e", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 161, "avg_line_length": 70.71212121212122, "alnum_prop": 0.5999571459181487, "repo_name": "puttarajubr/commcare-hq", "id": "172eb552e26eca865882f7c7869513f5d8b6f800", "size...
import unittest from cranberry.distances import * from math import hypot class TestDistances(unittest.TestCase): def setUp(self): self.point_1 = [1,0] self.point_2 = [5,4] self.point_3 = [6,3] self.point_4 = [7,6] def test_euclidean_distance(self): self.assertEqual(eucl...
{ "content_hash": "b8a25dea30a547bdae094325714f4ad9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 40.2962962962963, "alnum_prop": 0.5919117647058824, "repo_name": "captainsafia/cranberry", "id": "a5c60dabe677d501032971cd74e24914c49d3876", "size": ...
"""Tests for apache_beam.runners.interactive.pipeline_fragment.""" import unittest from unittest.mock import patch import apache_beam as beam from apache_beam.options.pipeline_options import StandardOptions from apache_beam.runners.interactive import interactive_beam as ib from apache_beam.runners.interactive import i...
{ "content_hash": "ee7bddad5206d74f95649eb57ab6d677", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 98, "avg_line_length": 36.81699346405229, "alnum_prop": 0.6612817326469022, "repo_name": "robertwb/incubator-beam", "id": "3e7207fbb117222dbf5d69c0a79a25405d6c91d4", "size...
"""Test mining RPCs - getmininginfo - getblocktemplate proposal mode - submitblock""" import copy from decimal import Decimal from test_framework.blocktools import ( create_coinbase, ) from test_framework.messages import ( CBlock, CBlockHeader, ) from test_framework.mininode import ( P2PDataStore, ) ...
{ "content_hash": "205699adf46f0240ff5b1437130917b9", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 142, "avg_line_length": 47.39763779527559, "alnum_prop": 0.6586925824404021, "repo_name": "dashpay/dash", "id": "041f24793bd579cb3f4254b1d04471d5645b3b44", "size": "12253"...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j F Y\u060c ساعت G:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_...
{ "content_hash": "231b5e9534f7953e786b5d8efe77774d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 33.523809523809526, "alnum_prop": 0.7130681818181818, "repo_name": "vsajip/django", "id": "8ada61c6deed4db8a49b003818f83ae1a076a230", "size": "809", ...
import tempfile import re import os try: # Python 2 str_cls = unicode except (NameError): # Python 3 str_cls = str from ..console_write import console_write from ..unicode import unicode_from_os from ..open_compat import open_compat, read_compat from .cli_downloader import CliDownloader from .non_http...
{ "content_hash": "0e2510a31f867de52971521cb849202f", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 95, "avg_line_length": 33.456756756756754, "alnum_prop": 0.5134501979158251, "repo_name": "herove/dotfiles", "id": "631a83eeb9b29d5669163b0d04433949f3ad50b3", "size": "123...
__author__ = 'hassaanaliw' from flask import Blueprint, Response, redirect, url_for from app import db from app.posts.models import Posts from flask.ext.login import current_user, login_required posts = Blueprint('posts', __name__) @posts.route('/like/<post_id>') @login_required def like(post_id): post = Posts...
{ "content_hash": "8982624e59bf074ed56e42d4ec17804c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 56, "avg_line_length": 25.916666666666668, "alnum_prop": 0.6655948553054662, "repo_name": "hassaanaliw/flaskbook", "id": "72c423080ae01b9724a0f6ac5a7a29389deacafc", "size":...
"""empty message Revision ID: 104150ad9cb5 Revises: None Create Date: 2015-08-27 20:42:58.882561 """ # revision identifiers, used by Alembic. revision = '104150ad9cb5' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
{ "content_hash": "3210d48ed1c549625d44765093d79394", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 85, "avg_line_length": 32.1764705882353, "alnum_prop": 0.6645338208409507, "repo_name": "BowTieProject/groupdynamics", "id": "01572df64977726f83b00ce7c335dd6aa41e1d59", "si...
def setup(app): app.add_crossref_type( directivename = "setting", rolename = "setting", indextemplate = "pair: %s; setting", )
{ "content_hash": "cf9fc7be69a3d5cf467000f96880e970", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 48, "avg_line_length": 29.833333333333332, "alnum_prop": 0.4972067039106145, "repo_name": "ryneeverett/mezzanine", "id": "9f22077f68c097d29656e4efa98575e60e5dac95", "size": ...
import numpy as np import scipy.ndimage.filters as filt import matplotlib.pyplot as plt import matplotlib.cm as cm import camerastream as camst import pickle from mpl_toolkits.mplot3d import Axes3D def getpoints(diffratio): image = [] minarray = [] flatpoints = [] angles = [] nonconfarray = [] ...
{ "content_hash": "a06ad9a63231428b5572f7cebc2fbd0f", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 98, "avg_line_length": 24.694117647058825, "alnum_prop": 0.5969509290138161, "repo_name": "calcdude84se/lasersandbox", "id": "7db41b4e3a6707b59a773061aea176b74411c36c", "si...
import asyncio import sys import threading import pytest import ray from ray.test_utils import SignalActor, kill_actor_and_wait_for_failure, \ wait_for_condition def test_asyncio_actor(ray_start_regular_shared): @ray.remote class AsyncBatcher: def __init__(self): self.batch = [] ...
{ "content_hash": "6d91a2aadad26464049a92e82ed21a65", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 78, "avg_line_length": 26.936666666666667, "alnum_prop": 0.6167553520603886, "repo_name": "pcmoritz/ray-1", "id": "d4e185b9e0a29230e97b5846d0eec2c892420a67", "size": "8097...
"""Backend-dependent tests for the Python XLA client.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import itertools import threading import unittest from absl import flags from absl.testing import absltest from absl.testing import pa...
{ "content_hash": "e35ee3fefbf0f3ad6e33b6192fe8aead", "timestamp": "", "source": "github", "line_count": 2064, "max_line_length": 80, "avg_line_length": 39.70203488372093, "alnum_prop": 0.5981206907071817, "repo_name": "aam-at/tensorflow", "id": "67052c8c784d7244d4de2360903f85aa3b297c84", "size": "8...
import mock import pytest import datetime from urlparse import urlparse from rest_framework import exceptions from django.utils import timezone from api.base.settings.defaults import API_BASE from api.taxonomies.serializers import subjects_as_relationships_version from api_tests.subjects.mixins import UpdateSubjectsMi...
{ "content_hash": "f498525f4dfd30b2fbe4a4c8af26c3c9", "timestamp": "", "source": "github", "line_count": 1152, "max_line_length": 135, "avg_line_length": 39.61805555555556, "alnum_prop": 0.5930543382997371, "repo_name": "mattclark/osf.io", "id": "bad641fbbc737cce02830881ece0f135157d72c9", "size": "4...
"""A simple engine that talks to a controller over 0MQ. it handles registration, etc. and launches a kernel connected to the Controller's Schedulers. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distr...
{ "content_hash": "b02307b33df89ed03476c61f25852c8f", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 127, "avg_line_length": 42.79016393442623, "alnum_prop": 0.607616274614972, "repo_name": "Lightmatter/django-inlineformfield", "id": "e60f2bf0098736ff24bc89b9c34144f7ea904ff...