text
stringlengths
4
1.02M
meta
dict
from electrum_cesc.i18n import _ fullname = _('Email') description = _("Send and receive payment request with an email account") available_for = ['qt']
{ "content_hash": "15848de736948398eecfeadcf19da415", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 73, "avg_line_length": 30.6, "alnum_prop": 0.7189542483660131, "repo_name": "Marcdnd/electrum-cesc", "id": "7db681d09ef8c71abf8bf4cdc5db22ee03f73a24", "size": "153", "bina...
import unittest from mxl.note import Note from mxl import util class TestNote(unittest.TestCase): def test_subtraction_same(self): a = Note(rhythm_type='half', step='C', octave=1, staff=1) b = Note(rhythm_type='half', step='C', octave=1, staff=1) self.assertEqual(a - b, 0) def test_s...
{ "content_hash": "32049e3497f9f82aff3c1fb4b05eb791", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 73, "avg_line_length": 39.171875, "alnum_prop": 0.6118867171918628, "repo_name": "themichaellai/musicxml-stats", "id": "c8d261770150ddcf5f18ebaef6385e5d0c1fddef", "size": "...
import os import robot.utils from robot.errors import DataError from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from browsercache import BrowserCache from keywordgroup import KeywordGroup fr...
{ "content_hash": "3d07df7b61539d222b55cb6ce062b99b", "timestamp": "", "source": "github", "line_count": 504, "max_line_length": 118, "avg_line_length": 42.88690476190476, "alnum_prop": 0.561647004395096, "repo_name": "overfly83/bjrobot", "id": "795c8c9a829fad3405d3b55b42a474a09f7f42c5", "size": "21...
import requests import time import random CLIENT_ID = 'XXX' # Create an Instagram app to get this ACCESS_TOKEN = "XXX" # ...and this MY_USER_NAME = 'XXX' # Your name on instagram USER_NAME_TO_GIVE_LOTS_OF_LIKES = '<3<3' # The name of the person you want to # like MAX_PHOTOS...
{ "content_hash": "30396d81ad02a6f79c89a376b093a7f1", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 174, "avg_line_length": 32.42168674698795, "alnum_prop": 0.6257896692679301, "repo_name": "invernizzi/instagram-autolike", "id": "934c1b21e469ffb7d104d10582b3f2edf5b39e69", ...
import urllib, urllib2 from HTMLParser import HTMLParser csrf = "" class Parser(HTMLParser): def handle_startendtag(self, tag, attrs): if tag == 'input': attr_dict = dict(attrs) if attr_dict['name'] == 'csrf_token': global csrf csrf = attr_dict['value'] # Get a copy of the original page url = 'http:...
{ "content_hash": "29b50206369beaf4ad980e8d0700360b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 53, "avg_line_length": 23.805555555555557, "alnum_prop": 0.7094515752625438, "repo_name": "vhazali/cs5331", "id": "41d33ee46aea6601b433cc64da9799933a1feaae", "size": "857",...
""" Routines for fitting source profiles (currently just 2d-Gaussian) We borrow from the Astropy modeling routines, since they provide a tested implementation of both the 2d Gaussian and its Jacobian (first partial derivatives). We add routines for estimation of initial fitting parameters (method of moments, using th...
{ "content_hash": "0b18ea7b32fd6bd45aae8bad5a08d644", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 127, "avg_line_length": 36.017605633802816, "alnum_prop": 0.6026982109688142, "repo_name": "SKA-ScienceDataProcessor/FastImaging-Python", "id": "d7ff0b44650574c89aa4b7255039...
import mimetypes import os import random import time from email import Charset, Encoders from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.Header import Header from email.Utils import formatdate, getaddresses, formataddr from dja...
{ "content_hash": "a66ad22e95c55614a2997aa8acfabc7a", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 126, "avg_line_length": 38.77777777777778, "alnum_prop": 0.6020665103759659, "repo_name": "pombredanne/algos-urv", "id": "2bf5a82eeb28287babc9b3312aea4a9277742e82", "size"...
import ctypes import os import sys import sysconfig import warnings from ..util import galpyWarning, galpyWarningVerbose PY3= sys.version > '3' if PY3: _ext_suffix= sysconfig.get_config_var('EXT_SUFFIX') else: #pragma: no cover _ext_suffix= '.so' _libgalpy= None _libgalpy_loaded= None _libgalpy_actionAngleT...
{ "content_hash": "1ce81383661fb94944d05ec52f5428fc", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 138, "avg_line_length": 39.627906976744185, "alnum_prop": 0.6223591549295775, "repo_name": "jobovy/galpy", "id": "2247f772a83010c020f1cff7d7b228cae5ff22e8", "size": "3478",...
import unittest import trace import sys import os import urllib.request import json from ast import literal_eval sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) from rasblite import engine BASE_URL='/rest/api/1.0/' SERVER_PORT = 8080 DEFAULT_MODEL = \ """[Base] url = /r...
{ "content_hash": "9b70936ea27f92dcea4d3a5fa8c2a121", "timestamp": "", "source": "github", "line_count": 604, "max_line_length": 483, "avg_line_length": 83.6771523178808, "alnum_prop": 0.6149462812370154, "repo_name": "timrainbow/rasblite", "id": "dc4e9add4c93387f4bda3d2017efc8116129004c", "size": "...
from .image import img_stretch, img_tile, conv_filter_tile, to_bc01, to_b01c
{ "content_hash": "8fa0f9a6834cb771254967150aac4dcf", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 76, "avg_line_length": 77, "alnum_prop": 0.7532467532467533, "repo_name": "andersbll/deeppy", "id": "60f336daa2c7d0a441089415103319aee73a6623", "size": "77", "binary": fal...
from tastypie.resources import ModelResource from tastypie import fields from models import CityBorder class CityBorderDetailResource(ModelResource): '''API resource for the details of the city border''' class Meta: queryset = CityBorder.objects.all() resource_name = 'cityborder-detail' ...
{ "content_hash": "9c524552033f47673d39075bee8cd326", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 30.06896551724138, "alnum_prop": 0.658256880733945, "repo_name": "jayArnel/crimemapping", "id": "150d2f95cf891a1ce058f79b1ff71fc41ff9b19a", "size": "...
import _plotly_utils.basevalidators class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="templateitemname", parent_name="funnel.marker.colorbar.tickformatstop", **kwargs, ): super(TemplateitemnameValidator, self...
{ "content_hash": "879a7facb2135e865c35873143d8f41a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 31.125, "alnum_prop": 0.6144578313253012, "repo_name": "plotly/plotly.py", "id": "a61b9d7c6db9caf0cb1f98da6be56668b6b8ce2d", "size": "498", "binary...
from __future__ import absolute_import, print_function from datetime import timedelta from django.conf import settings from django.db import models from django.utils import timezone from sentry.db.models import EncryptedJsonField, FlexibleForeignKey, Model, sane_repr class AuthIdentity(Model): __core__ = True ...
{ "content_hash": "3fa1d66187d57b92657a9620670989c7", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 85, "avg_line_length": 32.64150943396226, "alnum_prop": 0.6676300578034682, "repo_name": "mvaled/sentry", "id": "cb648e011adc3ce12c7b1535680920d8c642c764", "size": "1730", ...
"""Support for Tasmota binary sensors.""" from homeassistant.components import binary_sensor from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect import homeassistant.helpers.event as evt fro...
{ "content_hash": "e1e6a9cc629d5657110dae99cbd7e1cd", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 80, "avg_line_length": 29.094117647058823, "alnum_prop": 0.6336433481601293, "repo_name": "turbokongen/home-assistant", "id": "feaafa72b29c99b563fe85d4602b98d3f3d4fab7", "s...
import unittest import numpy as np import sys sys.path.append("../") from op_test import OpTest import paddle.fluid as fluid import paddle.fluid.core as core class TestSequencePadOp(OpTest): def set_attr(self): self.x_shape = [12, 10] self.x_len_lod = [[2, 3, 4, 3]] self.pad_value = [1.0...
{ "content_hash": "85f89b88156324cf5d1a8668e9e116aa", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 80, "avg_line_length": 31.00561797752809, "alnum_prop": 0.555716615328864, "repo_name": "luotao1/Paddle", "id": "d04091d9332b9f09157961e7829b1c2e10ae5db6", "size": "6130",...
""" A driver wrapping the Ironic API, such that Nova may provision bare metal resources. """ import base64 from distutils import version import gzip import shutil import tempfile import time from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_service import loopingcall from oslo_util...
{ "content_hash": "8e28191f5e254d3e5ca97d29f2525153", "timestamp": "", "source": "github", "line_count": 2092, "max_line_length": 96, "avg_line_length": 45.08699808795411, "alnum_prop": 0.5771824176756218, "repo_name": "mikalstill/nova", "id": "4aecc864d8932d4fbe54aa76145fcfb344f423cf", "size": "950...
from django import template import unicodedata register = template.Library() @register.filter("truncate") def truncate(value, size): if len(value) > size: return value[0:size] else: return value @register.filter("truncate_dot") def truncate_dot(value, size): if value: if len(val...
{ "content_hash": "2935a314bcaa3583ce017b8b45421abf", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 68, "avg_line_length": 23.065217391304348, "alnum_prop": 0.5617342130065975, "repo_name": "fretscha/django-postfix-admin", "id": "cceaf20cae788d73c4f9af56f58ea21a89c30e2a", ...
USE_PYTHON3 = True _IGNORE_FREEZE_FOOTER = 'Ignore-Freeze' # The time module's handling of timezones is abysmal, so the boundaries are # precomputed in UNIX time _FREEZE_START = 1639641600 # 2021/12/16 00:00 -0800 _FREEZE_END = 1641196800 # 2022/01/03 00:00 -0800 def CheckFreeze(input_api, output_api): if _FRE...
{ "content_hash": "549ebef00bb6d10974279ad4e8b485f7", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 35, "alnum_prop": 0.5717460317460318, "repo_name": "ric2b/Vivaldi-browser", "id": "6d378b30c7116e611476a9d0484a8faf6e1eb42d", "size": "3313", "bina...
""" A module for writing SkE user interaction log to a Redis queue How to use (CNC-specific stuff) - Please note that this script expects a modified version of run.cgi (with provided database connection). ----------------------------- import redislog # ... if __name__ == '__main__': t1 = time.time() # ... ...
{ "content_hash": "7ff652aecd8f3231d13d777a37cbb97d", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 85, "avg_line_length": 26.47826086956522, "alnum_prop": 0.5773399014778325, "repo_name": "czcorpus/klogproc", "id": "988092453be29d53985af6aa27d266062e1c8fa0", "size": "36...
from __future__ import print_function import os import sys import shutil import zipfile import shlex from zipfile import ZipFile from urllib.request import urlretrieve from subprocess import Popen, PIPE from distutils.cmd import Command def zip_directory(dir, zip_file): zip = ZipFile(zip_file, 'w', compression=zi...
{ "content_hash": "10418d2959d0fbd9a06d14b90e7a1cad", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 135, "avg_line_length": 44.9811320754717, "alnum_prop": 0.594099552572707, "repo_name": "kivatu/kivy_old", "id": "ed22ff229db777199f11bfbc9d808c9fea1270df", "size": "7152"...
"""Sensor from an SQL Query.""" from __future__ import annotations from datetime import date import decimal import logging import sqlalchemy from sqlalchemy.engine import Result from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.orm import scoped_session, sessionmaker import voluptuous as vol from homeassist...
{ "content_hash": "5e16920541a5030691b6343e3919baa7", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 88, "avg_line_length": 33.60663507109005, "alnum_prop": 0.6192356508249894, "repo_name": "mezz64/home-assistant", "id": "dfb1e15f0525adadb95003f44aad00858438387a", "size":...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin from django.utils.translation import ugettext_lazy as _ from .models import User @admin.register(User) class UserAdmin(DjangoUserAdmin): fieldsets = ( (None, {'fields': ('username', 'password')}), ...
{ "content_hash": "3c37121d19c85654542691d96ff4ec39", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 89, "avg_line_length": 39.6875, "alnum_prop": 0.6015748031496063, "repo_name": "relekang/photos", "id": "b124a68787475d9d1886ea3e1e1f9f6c238eccd1", "size": "635", "binary...
import os from .ansible import organization_path def services(organization, env='production'): service_list = {} if not organization: return service_list service_file = os.path.join(organization_path, organization, 'env_%s.yml' % e...
{ "content_hash": "518c8df9f0f6e45cdc81cc0c3b3ce164", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 69, "avg_line_length": 30.11764705882353, "alnum_prop": 0.46875, "repo_name": "AerisCloud/AerisCloud", "id": "4cfd6428fd5ad043c07b073ddc8735070b5629d4", "size": "1024", "...
from libcloud.common.types import LibcloudError __all__ = [ 'Provider', 'RecordType', 'ZoneError', 'ZoneDoesNotExistError', 'ZoneAlreadyExistsError', 'RecordError', 'RecordDoesNotExistError', 'RecordAlreadyExistsError' ] class Provider(object): DUMMY = 'dummy' LINODE = 'linode...
{ "content_hash": "54aa22f59afae5ca466ee9da254349da", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 69, "avg_line_length": 22.223300970873787, "alnum_prop": 0.5906509392747925, "repo_name": "pantheon-systems/libcloud", "id": "ad2b34a6139cfea77c5d14de2fddd35283de00ee", "s...
from django.contrib import admin from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin from django.contrib.flatpages.models import FlatPage from django.db.models import TextField from ckeditor.widgets import CKEditorWidget from mptt.admin import MPTTModelAdmin from modeltranslation.admin import Transla...
{ "content_hash": "625f6f4f6a6e2c65a62699b5b656c73d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 90, "avg_line_length": 35.029411764705884, "alnum_prop": 0.6582703610411419, "repo_name": "socib/grumers", "id": "30ec285727cf9c7d717a69abd3e1cdf31bf7d646", "size": "1191",...
"""Installs standard values for :mod:`lino_xl.lib.cal`, including a demo set of holidays. (TODO: make them more configurable.) See also :ref:`xl.specs.holidays`. """ from __future__ import unicode_literals import datetime from dateutil.relativedelta import relativedelta from dateutil.easter import easter from dja...
{ "content_hash": "231d2fd2fde1706aeef856f7c4cbf467", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 124, "avg_line_length": 37.82876712328767, "alnum_prop": 0.6284627919608908, "repo_name": "khchine5/xl", "id": "10ee0324cfbb556162d485c59bb0b9697164bd59", "size": "5643", ...
import os import sys import unittest import object_store from in_memory_object_store import InMemoryObjectStore from file_system import FileSystem, StatInfo from future import Future from local_file_system import LocalFileSystem from memcache_file_system import MemcacheFileSystem class _FakeFileSystem(FileSystem): ...
{ "content_hash": "59898cfb8178511ed100e192c03a9feb", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 80, "avg_line_length": 39.916666666666664, "alnum_prop": 0.6716644524577718, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "85b26e9d721c4b9df3f5e024c70df00c5a2260fe",...
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import os import re import time # Needed for Windows import...
{ "content_hash": "76d89e80e1ac1b52b304e22e9c33ccb2", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 130, "avg_line_length": 39.704081632653065, "alnum_prop": 0.6373682857877152, "repo_name": "chrishas35/django-travis-ci", "id": "6a2485bd4bffe8d13dd3c4ea39535b4aa47b8591", ...
from django.http import Http404 from django.test import RequestFactory, TestCase from ..templatetags.pagination import paginate, pagination, pagination_url class Object(object): paginator = None class PaginationTest(TestCase): def setUp(self): self.factory = RequestFactory() self.request =...
{ "content_hash": "dde03e735fac8b0863c5233fd26c9f8d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 82, "avg_line_length": 31.05263157894737, "alnum_prop": 0.6228813559322034, "repo_name": "lewiscollard/cms", "id": "220ad475b25f60c7af0336d45ec33d66ccdc5a59", "size": "1180...
def find_channel_id(channels, req_channel): """ Find channel ID from a human readable name. :param req_channel: channel name :return: channel id string. """ for channel in channels: if channel["name"] == req_channel: return channel["id"] def filter_out_message_subtypes(mess...
{ "content_hash": "59ea54d626e8220f9266052a8271a862", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 84, "avg_line_length": 30.045454545454547, "alnum_prop": 0.6475037821482602, "repo_name": "haukurk/pyslaquery", "id": "a8c988e0afd055e9d60b26c1fb242222cfa953ce", "size": "6...
import testtools from tempest.common import waiters from tempest import config import tempest.api.compute.volumes.test_attach_volume as VolumeAttachTest CONF = config.CONF class HybridVCloudAttachVolumeTestJSON(VolumeAttachTest.AttachVolumeTestJSON): def _create_and_attach(self): # Start a server and w...
{ "content_hash": "264c4750dcf60dda969a3d4c66d9841f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 129, "avg_line_length": 43.53521126760563, "alnum_prop": 0.6331284373989, "repo_name": "HybridF5/tempest", "id": "9afeb8ed07903fab0e8c6f6e789d6e583d1fe3de", "size": "3716",...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import contextlib import io import os.path import traceback from pre_commit.errors import FatalError from pre_commit.store import Store # For testing purposes class PreCommitSystemExit(SystemExit): ...
{ "content_hash": "9b7c15217801b9c547cdaa02f726f44d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 26.357142857142858, "alnum_prop": 0.6504065040650406, "repo_name": "chriskuehl/pre-commit-1", "id": "c8d2bfc8eb3f71792462d6259486f5df3dd2000f", "size...
import lldb from lldbsuite.test.decorators import * import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil import os import unittest2 class TestSwiftUnknownReference(lldbtest.TestBase): mydir = lldbtest.TestBase.compute_mydir(__file__) def check_class(self, var_self): ...
{ "content_hash": "87a1b322dca2a8195a145ce6e089e9f7", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 74, "avg_line_length": 33.95, "alnum_prop": 0.6774668630338734, "repo_name": "apple/swift-lldb", "id": "41ef074771239bdb9687d1654bb105fae6f8d430", "size": "1818", "binary...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLIST,...
{ "content_hash": "1394346202ea85be95ba9320259ef164", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 271, "avg_line_length": 49.88918918918919, "alnum_prop": 0.5093992090579121, "repo_name": "abhikeshav/ydk-py", "id": "6855a04a645ab28ba6b89039da5b27d2e4fcfc56", "size": "1...
import os import os_milestone
{ "content_hash": "0911e40c47e874b0f9784348e18f7967", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 19, "avg_line_length": 14.5, "alnum_prop": 0.8620689655172413, "repo_name": "pedrolegold/uforge-cli", "id": "78ae798987ee87bc59958ddbdfeb0e581a203765", "size": "29", "bina...
from merge_sort import * def binary_search_recur(A, x, l, r): # Try to find x in sorted list A recursively # l is the left-most idx, r is the right-most idx # Return the index of x if found, return False otherwise if l > r: return False mid = int(l + (r-l)/2) if A[mid] < x: retu...
{ "content_hash": "6c0e5bb254551b2b16f1dabf10f3bb4b", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 60, "avg_line_length": 26.25423728813559, "alnum_prop": 0.5351839896707553, "repo_name": "JasonVann/CLRS", "id": "499a6bd0c1cc7423fa4f23d7fd492c9576a7a986", "size": "1559",...
"""Gets all available campaign criterion bid modifier landscapes for a campaign. To get campaigns, run basic_operations/get_campaigns.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see ...
{ "content_hash": "31fa194d030ee0ebdc001c9852d21cb1", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 38.34567901234568, "alnum_prop": 0.6188023180940115, "repo_name": "Aloomaio/googleads-python-lib", "id": "ec07bb7987e71d5106bb7e436bf52359089e3f2c", ...
from functional.tests.identity.v2 import test_identity class EndpointTests(test_identity.IdentityTests): def test_endpoint_create(self): self._create_dummy_endpoint() def test_endpoint_delete(self): endpoint_id = self._create_dummy_endpoint(add_clean_up=False) raw_output = self.opens...
{ "content_hash": "2d4f8a6f656f2bf1dd65279db5ecd79f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 70, "avg_line_length": 37.92307692307692, "alnum_prop": 0.6693711967545639, "repo_name": "redhat-openstack/python-openstackclient", "id": "8064365e016ddd2ce7349125a765034453b...
"""Tests for certbot.plugins.standalone.""" import argparse import socket import unittest import mock import six from acme import challenges from acme import jose from acme import standalone as acme_standalone from certbot import achallenges from certbot import errors from certbot import interfaces from certbot.tes...
{ "content_hash": "eac2c1a31884a237eded37a4b790b777", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 80, "avg_line_length": 39.836283185840706, "alnum_prop": 0.6511162945684772, "repo_name": "DavidGarciaCat/letsencrypt", "id": "9f5b1459168658ebdd6de21cd4be7d4633714ad2", "...
from __future__ import absolute_import, unicode_literals import os from django import VERSION as DJANGO_VERSION from django.utils.translation import ugettext_lazy as _ ###################### # MEZZANINE SETTINGS # ###################### # The following settings are already defined with default values in # the ``def...
{ "content_hash": "de15213875bc35cf9099fb6849119f74", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 79, "avg_line_length": 34.5366568914956, "alnum_prop": 0.6731765305256008, "repo_name": "BQLQ/BQLQ", "id": "5625f12c99e6eb5b71ed6fced99c70e9fac2c424", "size": "11778", "...
import os.path current_dir = os.path.dirname(os.path.abspath(__file__)) import cherrypy from mako.template import Template from mako.lookup import TemplateLookup from api import API from rpc_connections import rpc_connections lookup = TemplateLookup(directories=['html']) class Root(object): api = API() @cherryp...
{ "content_hash": "afd0e263757d94b741bc7b701c782199", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 65, "avg_line_length": 27.18918918918919, "alnum_prop": 0.6520874751491054, "repo_name": "hank/coin-gateway", "id": "741ac3ba8e94c2b1797abc387d341619c03f3adc", "size": "100...
try: from django.core.cache import caches except ImportError: # Django <1.7 from django.core.cache import get_cache else: def get_cache(alias): return caches[alias] def get_redis_connection(alias='default', write=True): """ Helper used for obtain a raw redis client. """ cache ...
{ "content_hash": "fbeb9203aba7112cc5bfc5a6b6fa37ff", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 25.55, "alnum_prop": 0.6790606653620352, "repo_name": "zl352773277/django-redis", "id": "a1f07fd462ed70fa04020662e906b45cae23b25c", "size": "536", ...
import json, sys, errno, codecs, datetime import numpy as np from heapq import heappop, heappush from pprint import pprint from datetime import datetime import time def num_pageviews(session): return len([r for r in session if 'is_pageview' in r and r['is_pageview'] == 'true']) def get_session_length(session): i...
{ "content_hash": "de68d13379ba6ac2439f2e9a0091b85d", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 111, "avg_line_length": 39.34146341463415, "alnum_prop": 0.6336019838809671, "repo_name": "ewulczyn/readers", "id": "410c7d8e3683247c2777d96b63b55cf5a463dfab", "size": "48...
""" Effects module. """ from __future__ import absolute_import, unicode_literals import logging from psd_tools.constants import Tag, Resource from psd_tools.terminology import Klass, Key from psd_tools.utils import new_registry from psd_tools.psd.descriptor import Descriptor, List logger = logging.getLogger(__name__)...
{ "content_hash": "af3771e88b5cf42e5cb00c8bbd2c4337", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 79, "avg_line_length": 25.169772256728777, "alnum_prop": 0.5932384634367032, "repo_name": "psd-tools/psd-tools", "id": "ea5069d13aab265440da1cbdec0f31ffae051181", "size": ...
from flask.ext import wtf import flask import wtforms import auth import config import model import util from main import app ############################################################################### # Admin Stuff ############################################################################### @app.route('/adm...
{ "content_hash": "1e72c994243d6137b53b7d4c15bb1ef4", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 119, "avg_line_length": 47.26271186440678, "alnum_prop": 0.6256051640667025, "repo_name": "ssxenon01/music-app", "id": "0646f11b389fb407b1b746aaa0b76a74f23e652f", "size": ...
import os import sys import numpy as np import tensorflow as tf # Allow import of top level python files import inspect currentdir = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) parentdir = os.path.dirname(currentdir) parentdir = os.path.dirname(parentdir) sys.path.insert(0, paren...
{ "content_hash": "1eb177d23a7d3c1c9d8eb0bb93ee567b", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 30.14814814814815, "alnum_prop": 0.6446560196560197, "repo_name": "tensorflow/tensorrt", "id": "e1aad59afe125c644098d597dd49ddf664e72311", "size": "...
"""Utility methods for accessing and operating on test data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl import flags import tensorflow as tf from google.protobuf import text_format import input as seq2species_input from protos i...
{ "content_hash": "9c54c72a3922772143105194b024fbf8", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 33.46153846153846, "alnum_prop": 0.7050903119868637, "repo_name": "tombstone/models", "id": "f02798fb533c99c8545e3a51f56de31b629ca2f4", "size": "3734...
port = 6713 import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if 0 == sock.connect_ex(('localhost', port)): sock.close() raise Exception("port %d is in use, aborting" % (port,)) # Run bitmessage from subprocess import Popen, DEVNULL from os import path curpath = path.dirname(path.abspath(_...
{ "content_hash": "7d8100aa689c9826eda53ed549ceb248", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 102, "avg_line_length": 38.24074074074074, "alnum_prop": 0.699273607748184, "repo_name": "owlen/iridis", "id": "27f90d84d9bbbd2651a3218c75826b690f80ad1c", "size": "2244", ...
import numpy as np import numpy_weld_impl from lazy_op import LazyOpResult from weld.weldobject import * class NumpyArrayWeld(LazyOpResult): """Summary Attributes: dim (TYPE): Description expr (TYPE): Description weld_type (TYPE): Description """ def __init__(self, expr, wel...
{ "content_hash": "2f116b987e43884ccee6684ec4ccf8af", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 79, "avg_line_length": 24.20689655172414, "alnum_prop": 0.5448717948717948, "repo_name": "sppalkia/weld", "id": "faf0c9cb105bbb4999e3ee080f79d47c14176415", "size": "2808",...
""" Import utilities Exported classes: ImportManager Manage the import process Importer Base class for replacing standard import functions BuiltinImporter Emulate the import mechanism for builtin and frozen modules DynLoadSuffixImporter """ from warnings import warnpy3k warnpy3k("the imputil...
{ "content_hash": "281b6a590da8ad71b2656ceb9ddae6a3", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 88, "avg_line_length": 35.38639455782313, "alnum_prop": 0.5883732554115882, "repo_name": "DecipherOne/Troglodyte", "id": "e1d0a8222aee550dbe41393b6e9d364c841c78c8", "size"...
""" 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": "59182e16938d9e7170573a1f2cbd45d1", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 96, "avg_line_length": 36.57575757575758, "alnum_prop": 0.7108533554266777, "repo_name": "rstens/gwells", "id": "1d7ccd8ee379b883f66278b5558af563be8f4294", "size": "1207", ...
import pymongo from pymongo import MongoClient from collections import defaultdict import datetime as dt import pygal from pygal.style import BlueStyle from datetime import timedelta # Used for storage collection def first_date(collection): # pragma: no cover """Returns the first date in the collection""" for...
{ "content_hash": "8718f47a0facd30402ff96ee94601bf0", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 75, "avg_line_length": 36.25252525252525, "alnum_prop": 0.6132627472833658, "repo_name": "Storj/driveshare-graph", "id": "d35e4fa6332d6267bcaf5ddc42597edf9e7a7bf6", "size":...
"""Module that defines the Atom Models that back the Search Views""" import six from collections import deque from atom.api import Atom, Typed, List, Range, Dict, observe, Str, Bool, Int from dataportal.broker import DataBroker from metadatastore.api import Document import metadatastore from mongoengine.connection imp...
{ "content_hash": "e756331791003341621691161ef81e3b", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 82, "avg_line_length": 32.98795180722892, "alnum_prop": 0.584855125395666, "repo_name": "ericdill/replay", "id": "c5e9b57dc422835a9a80f6479c0bc389c0bd05b5", "size": "8214"...
from distutils.core import setup setup(name="geographiclib", version="1.40", description= "A translation of the GeographicLib::Geodesic class to Python", author="Charles Karney", author_email="charles@karney.com", url="http://geographiclib.sourceforge.net/", packages=["geogr...
{ "content_hash": "c157ad9664064b94bf5c926099ded917", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 82, "avg_line_length": 41.65217391304348, "alnum_prop": 0.5678496868475992, "repo_name": "Navendis/geographiclib", "id": "8cdad36695dc126745c411353269e97d5df5734e", "size":...
'''chromium apport hook /usr/share/apport/package-hooks/chromium-browser.py Copyright (c) 2010, Fabien Tassin <fta@sofaraway.org> Copyright (c) 2014, Canonical 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 F...
{ "content_hash": "8fd9d279c029b22d00e328be87f2b632", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 431, "avg_line_length": 43.02448979591837, "alnum_prop": 0.6032634474907504, "repo_name": "mxOBS/deb-pkg_trusty_chromium-browser", "id": "91ee1d3110fd73f77e60b4f7530d209d188...
import os import common import subprocess import re import action import logging import time # Global sys_logger = None iostat_file_ext = "_iostat_block_devices.plt" network_io_file_ext = "_network_devices.plt" system_metrics_interval = '5' docker_stat_header = "NAME CONTAINER CPU % ...
{ "content_hash": "bf19cd2826c3441518b5257c905fdbeb", "timestamp": "", "source": "github", "line_count": 651, "max_line_length": 120, "avg_line_length": 45.54531490015361, "alnum_prop": 0.5240809443507588, "repo_name": "deepeshmittal/daytona", "id": "56dedfbfad9900ce3d0eee206780f0a2f6ca810a", "size"...
from struct import pack, unpack, calcsize class Error(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) fmt_checktextformatrequest = 'I' fmt_checktextformatresponse = 'IIII' TUI_MSGTYPE_CHECKTEXTFORMATREQUEST = 0x01 TUI_MSGTYPE_CHECKTEXTFO...
{ "content_hash": "7fc45cb4879b5b50211f29e1f8521563", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 82, "avg_line_length": 31.670103092783506, "alnum_prop": 0.5753580729166666, "repo_name": "mikatammi/tee-tui-virtual-display", "id": "7eeb952c90c1064e7749d7600ddc8612154f4b3...
from .forms import TicketForm from .lib import format_time_spent, process_attachments from .models import CustomField, FollowUp, FollowUpAttachment, Ticket from .user import HelpdeskUser from django.contrib.auth.models import User from django.contrib.humanize.templatetags import humanize from rest_framework import seri...
{ "content_hash": "d21697cb8f67b825969b03fd425c8c2d", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 119, "avg_line_length": 35.484662576687114, "alnum_prop": 0.640387275242047, "repo_name": "django-helpdesk/django-helpdesk", "id": "6474060d4eab2d8aa700f42817c1bbe8fe7873e8"...
""" Set attributes used for nearly all views """ from __future__ import print_function from django.conf import settings from django.core.cache import cache from django.core.cache.utils import make_template_fragment_key from gc_apps.geo_utils.geoconnect_step_names import GEOCONNECT_STEPS,\ STEP1_EXAMINE, STEP2_STY...
{ "content_hash": "730a2511923f8f702722c8d975062149", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 29.123287671232877, "alnum_prop": 0.6561618062088429, "repo_name": "IQSS/geoconnect", "id": "c4bd1bf330ebc21260e7dc6ed881708a2168120c", "size": "2126...
import sqlite3 from syncless.best_stackless import stackless import sys def ProgressHandler(): sys.stderr.write('.') db_conn = sqlite3.connect(':memory:') # SUXX: Specifying 700 (or 1000) instead of 600 here would suppress the dot # in the first few rows. db_conn.set_progress_handler(ProgressHandler, 600) cursor ...
{ "content_hash": "45ad054694c586a7ee7e6bf61b837b6a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 28.925925925925927, "alnum_prop": 0.6798975672215108, "repo_name": "breezechen/syncless", "id": "03f29affe03a75e85b966a53b6272a691c884ed7", "size": "...
"""Tests for certbot._internal.cert_manager.""" # pylint: disable=protected-access import re import shutil import tempfile import unittest import configobj try: import mock except ImportError: # pragma: no cover from unittest import mock from certbot import errors, configuration from certbot._internal.storage...
{ "content_hash": "9ca05d775ed0b87ecc705cc3d3c2d880", "timestamp": "", "source": "github", "line_count": 711, "max_line_length": 99, "avg_line_length": 44.47116736990155, "alnum_prop": 0.6563774945444195, "repo_name": "letsencrypt/letsencrypt", "id": "0ed09eccddb0138fbf3000618fd3833ab772e5f0", "size...
""" Test for assert_deallocated context manager and gc utilities """ from __future__ import division, print_function, absolute_import import gc from scipy._lib._gcutils import (set_gc_state, gc_state, assert_deallocated, ReferenceError, IS_PYPY) from numpy.testing import assert_equal...
{ "content_hash": "ce3fcec96f8d82a4af5e23dbcb9e0c68", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 76, "avg_line_length": 33.09090909090909, "alnum_prop": 0.5891330891330891, "repo_name": "lhilt/scipy", "id": "d82b81f35d5cb11176c92208d1c8f5cbde14e726", "size": "3276", ...
from flask.ext.script import Manager from david.app import app manager = Manager(app) if __name__ == '__main__': manager.run()
{ "content_hash": "a4018b23ef07d95bf1b409c6aa7530a0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 36, "avg_line_length": 16.75, "alnum_prop": 0.664179104477612, "repo_name": "ktmud/david", "id": "d822455c8e122f352fa054d4f799c0c705be62d2", "size": "158", "binary": false...
import sys sys.path.insert(1, "../../../") import h2o, tests def offset_tweedie(ip,port): # Connect to a pre-existing cluster insurance = h2o.import_file(h2o.locate("smalldata/glm_test/insurance.csv")) insurance["offset"] = insurance["Holders"].log() gbm = h2o.gbm(x=insurance[0:3], y=insurance[...
{ "content_hash": "fe135f51f5b899599548f487fc7de193", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 165, "avg_line_length": 48.333333333333336, "alnum_prop": 0.6357366771159875, "repo_name": "bospetersen/h2o-3", "id": "c3a15e85b18d6e5779499057ec84b1f5fd670aab", "size": "1...
"""This module defines an abstract class for Hotword Detection. Any Hotword Detection Engine implemented in the app must inherit from this class. HotwordDetector subclasses from threading.Thread since Hotword Detection will run in a separate thread for non-blocking operation. """ from abc import ABC, abstractclassmetho...
{ "content_hash": "19e8f212e279b779a86a8cfc2bf2b55a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 119, "avg_line_length": 41.92307692307692, "alnum_prop": 0.7143730886850153, "repo_name": "betterclever/susi_hardware", "id": "34c0c62d11d1c1867ac11c4ce99ce4254cc1ce34", "s...
from sympy.functions import adjoint, conjugate, transpose from sympy.matrices.expressions import MatrixSymbol, Adjoint, Trace, Transpose from sympy.matrices import eye, Matrix from sympy import symbols, S n, m, l, k, p = symbols('n m l k p', integer=True) A = MatrixSymbol('A', n, m) B = MatrixSymbol('B', m, l) C = Mat...
{ "content_hash": "03a5a276d2f2eb59e063c3d14d4be8aa", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 81, "avg_line_length": 31.205882352941178, "alnum_prop": 0.6427898209236569, "repo_name": "amitjamadagni/sympy", "id": "af6d6bbcc0eeab680378dad685bfc1da561eb2c7", "size": "...
"""Support for Australian BOM (Bureau of Meteorology) weather service.""" import logging import voluptuous as vol from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS from homeassistant.helpers import config_...
{ "content_hash": "dd827cf404afb9d9e490a4845df46990", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 86, "avg_line_length": 30.256637168141594, "alnum_prop": 0.6171395144779175, "repo_name": "pschmitt/home-assistant", "id": "94b9960c851bce6a16adaa18519e169c00a3b884", "siz...
""" Convert RST discourse tree bank into gold standard sequence of actions. This script converts the RST discourse treebank into a gold standard sequence of shift reduce parsing actions. This is based on Perl code (``trees2actionseq.pl``) from Kenji Sagae. For each tree in the input, this will output a line represen...
{ "content_hash": "61927a9648695a8afe8b19b0fc36a417", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 92, "avg_line_length": 29.984615384615385, "alnum_prop": 0.6114246622199419, "repo_name": "EducationalTestingService/discourse-parsing", "id": "b9454af0b3d320da7b3a5137e5fc3...
import syslog import random import time class OneLiners(object): def __init__(self, lines=12, delay=5): self._lines = lines self._delay = delay self._one_liners = [ "I wrote a few children's books... Not on purpose. - Steven Wright", "I looked up my family tree and found out I wa...
{ "content_hash": "f1dca69933224b6f22326f6d048db097", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 123, "avg_line_length": 61.520833333333336, "alnum_prop": 0.6356247883508297, "repo_name": "jdgwartney/tsi-lab", "id": "6c1fc14fc835c1617d1774a397bc06165fa39625", "size": "...
import socket import mock import msgpack from oslo_config import fixture as fixture_config from oslo_context import context import oslo_messaging from oslo_utils import timeutils from oslotest import mockpatch from stevedore import extension from ceilometer import collector from ceilometer import dispatcher from ceil...
{ "content_hash": "c76e62b5086490db69aade1c57595053", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 79, "avg_line_length": 40.50344827586207, "alnum_prop": 0.6123786821045463, "repo_name": "eayunstack/ceilometer", "id": "9bc0661a0c9cd24fa53c8a519194da16924b6feb", "size":...
from __future__ import print_function from django.conf import settings from django.core.management.base import BaseCommand from hemres import models from janeus import Janeus class Command(BaseCommand): help = 'Remove subscription of Janeus user' args = 'member_id list_label' def handle(self, *args, **kw...
{ "content_hash": "f5ba2cbf90ab02af803858d38b377958", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 76, "avg_line_length": 27.280701754385966, "alnum_prop": 0.5826366559485531, "repo_name": "jonge-democraten/hemres", "id": "b91ab304185d4c4292205a7e1abe07a5f781ec06", "size...
""" Picarto.TV API Documentation The Picarto.TV API documentation Note, for fixed access tokens, the header that needs to be sent is of the format: `Authorization: Bearer yourTokenHere` This can be generated at https://oauth.picarto.tv/ For chat API, see https://docs.picarto.tv/chat/chat.proto - contact via...
{ "content_hash": "e289fc9214ea3d6fa4398766fe34b5ad", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 326, "avg_line_length": 26.627692307692307, "alnum_prop": 0.5507279870580079, "repo_name": "Sythelux/Picarto.bundle", "id": "614f061297d305e9ea187244d924af6cf3855bd0", "si...
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3, use_hdfs=True, hdfs_version...
{ "content_hash": "5a644662c71a7d6f29e5df2027ea46fc", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 87, "avg_line_length": 35.80246913580247, "alnum_prop": 0.5665517241379311, "repo_name": "vbelakov/h2o", "id": "7e3fbca59465b242d529bb53797451a4f0d482c2", "size": "2900", ...
''' Datalink / Network / Transport layer headers ''' import string import socket import struct import vstruct from vstruct.primitives import * ETH_P_IP = 0x0800 ETH_P_ARP = 0x0806 ETH_P_IPv6 = 0x86dd ETH_P_VLAN = 0x8100 IPPROTO_ICMP = 1 IPPROTO_TCP = 6 IPPROTO_UDP = 17 IPPROTO_IPV6 = 41 IPPROTO_...
{ "content_hash": "70a6b9e68e23a85f94dd10d7caeda5d9", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 82, "avg_line_length": 29.511494252873565, "alnum_prop": 0.5877312560856864, "repo_name": "bat-serjo/vivisect", "id": "d6d7a5ec7ce9d6c337b6610b3999b10928a985a9", "size": "...
"""Support for BME680 Sensor over SMBus.""" import importlib import logging from time import time, sleep import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA import homeassistant.helpers.config_validation as cv from homeassistant.const import ( TEMP_FAHRENHEIT, CONF_NAME, CONF_MON...
{ "content_hash": "83d6fd3c4f79c7aa8e24e2c946b05a98", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 79, "avg_line_length": 37.01912568306011, "alnum_prop": 0.6117056609343863, "repo_name": "auduny/home-assistant", "id": "73fe827be6ba202865e73845ad0c33f54d37db32", "size":...
from copy import copy import inspect import logging import pickle import random import os.path import numpy from sklearn.cross_validation import StratifiedKFold from sklearn.metrics import precision_recall_curve from iepy import defaults from iepy.extraction.relation_extraction_classifier import RelationExtractionCla...
{ "content_hash": "b8bb718055d7b1ad53012fea7329d059", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 108, "avg_line_length": 38.39312977099237, "alnum_prop": 0.6125857441097524, "repo_name": "machinalis/iepy", "id": "a366dff32f32e1cb3287557ac5c1182f58c4e31d", "size": "100...
class ZiplineError(Exception): msg = None def __init__(self, *args, **kwargs): self.args = args self.kwargs = kwargs self.message = str(self) def __str__(self): msg = self.msg.format(**self.kwargs) return msg __unicode__ = __str__ __repr__ = __str__ class...
{ "content_hash": "87c58ad49538cd52c90c9f8c3901e733", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 79, "avg_line_length": 27.021951219512196, "alnum_prop": 0.6786713602310678, "repo_name": "YuepengGuo/zipline", "id": "ca4c99e31bcb6f27799d51fdba7e8177bff7b118", "size": "...
""" All exceptions used in OVH SDK derives from `APIError` """ class APIError(Exception): """Base OVH API exception, all specific exceptions inherits from it.""" class HTTPError(APIError): """Raised when the request fails at a low level (DNS, network, ...)""" class InvalidKey(APIError): """Raised when tr...
{ "content_hash": "0fb2dcec77a678deabd0cd5386d0b240", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 30.866666666666667, "alnum_prop": 0.7235421166306696, "repo_name": "VincentCasse/python-ovh", "id": "53e7b2063a6b6494905cf8ebbc8678ecada55cc8", "size...
__author__ = 'Nick Hirakawa' from invdx import build_data_structures from rank import score_BM25 import operator class QueryProcessor: def __init__(self, queries, corpus): self.queries = queries self.index, self.dlt = build_data_structures(corpus) def run(self): results = [] for query in self.queries: ...
{ "content_hash": "2108a7a2e183a1ac6650cc55ce14f6df", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 96, "avg_line_length": 31.129032258064516, "alnum_prop": 0.689119170984456, "repo_name": "nh0815/BM25", "id": "fd000b47728eb0975f23fe59426e863ecf32443f", "size": "965", "...
from toee import * def OnBeginSpellCast( spell ): print "Acid Fog OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-conjuration-conjure", spell.caster ) def OnSpellEffect( spell ): print "Acid Fog OnSpell...
{ "content_hash": "e876e505f4cf6f716e472116fb30a0fe", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 118, "avg_line_length": 34.51063829787234, "alnum_prop": 0.7342786683107275, "repo_name": "GrognardsFromHell/TemplePlus", "id": "7d7dd021b1ef2fd5c2bc44bf4861b246c835fe51", ...
"""Utility functions for resolving file paths in histograms scripts.""" import os.path def GetInputFile(src_relative_file_path): """Converts a src/-relative file path into a path that can be opened.""" depth = [os.path.dirname(__file__), '..', '..', '..'] path = os.path.join(*(depth + src_relative_file_path.sp...
{ "content_hash": "6725784bee8a2aefcfffbc60c96744f3", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 74, "avg_line_length": 36.2, "alnum_prop": 0.6685082872928176, "repo_name": "nwjs/chromium.src", "id": "02d04c80137f61a21732338311fe371512780213", "size": "503", "binary"...
from sqlobject import col from sqlobject.dbconnection import DBAPI from sqlobject.dberrors import * class ErrorMessage(str): def __new__(cls, e, append_msg=''): obj = str.__new__(cls, e[1] + append_msg) obj.code = int(e[0]) obj.module = e.__module__ obj.exception = e.__class__.__nam...
{ "content_hash": "922f74913153422ed48a00ecec98f548", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 121, "avg_line_length": 41.36231884057971, "alnum_prop": 0.5538892782060266, "repo_name": "Kussie/HTPC-Manager", "id": "f8e92262c380c9825b15f59827caae7169fcfb76", "size": ...
from mock import patch import unittest import yoda from click.testing import CliRunner class TestSuggestRecipes(unittest.TestCase): """ Test for the following commands: | Module: food | command: suggest_recipes """ RANDOM_RECIPE = { 'meals': [{ 'strMeal': 'Honey Teri...
{ "content_hash": "74c206d18fab03d3bc0f37384a7d0ccc", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 365, "avg_line_length": 43.810810810810814, "alnum_prop": 0.6452806909315237, "repo_name": "dude-pa/dude", "id": "0e88d687f4d3488d7d40d1457b539ed30f78a2a9", "size": "1621",...
""" django-tinymce4-lite -------------------- This application provides a rich-text WYSIWYG `TinyMCE 4`_ widget for Django forms and models. .. _TinyMCE 4: https://www.tinymce.com/ """ from __future__ import absolute_import from .models import HTMLField from .widgets import TinyMCE, AdminTinyMCE __all__ = ['HTMLFie...
{ "content_hash": "527d80a9a42b4b773c62f05accee3b27", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 23.466666666666665, "alnum_prop": 0.6875, "repo_name": "webtweakers/django-tinymce4-widget", "id": "b797ec2fa8c3a2f3ebc8d0f1705c20507154b462", "size"...
"""An example tensorflow model.""" import tensorflow as tf class Model: def __init__(self): self.weights = tf.ones((3, 1000)) def __call__(self, features): images = tf.reshape(features["image"], (-1, 224, 224, 3)) means = tf.reduce_mean(images, axis=(1, 2)) logits = tf.matmul(means, self.weights...
{ "content_hash": "728176a62e05af24fa401e5ed930e9d1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 22.38888888888889, "alnum_prop": 0.6277915632754343, "repo_name": "google-research/robustness_metrics", "id": "df544244ad02a7751bcbe29f9bd64f50a7c1fcb8...
import re import logging from django.apps import AppConfig from django.db.models.signals import pre_migrate, post_migrate from django.db import connection default_app_config = 'postgresviews.ViewConfig' logger = logging.getLogger('postgresviews') class ViewConfig(AppConfig): name = 'postgresviews' verbose_...
{ "content_hash": "7e7d5480e8e13f5312dbddc708389103", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 99, "avg_line_length": 32.78666666666667, "alnum_prop": 0.6209841398942659, "repo_name": "Metamako/django-mysqlviews", "id": "42375efef92cb7c66076ceb28e37d5ce4ad8f32b", "si...
from setuptools import setup, find_packages packages = find_packages() desc = open("README.md").read(), setup( name='cooperhewitt.roboteyes.atkinson', namespace_packages=['cooperhewitt', 'cooperhewitt.roboteyes'], version='0.3', description='', author='Cooper Hewitt Smithsonian Design Museum', ...
{ "content_hash": "27b60a4346bd05c35e88ab1c58f96482", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 101, "avg_line_length": 31.47826086956522, "alnum_prop": 0.6767955801104972, "repo_name": "cooperhewitt/py-cooperhewitt-roboteyes-atkinson", "id": "4de668b586960feeba007c7b42...
from flask import current_app, Blueprint, render_template from lytics.db.models import Expenditure from lytics.db.queries import QueryConn main = Blueprint('main', __name__, url_prefix='/') @main.route("/") def index(): return render_template('index.jinja2')
{ "content_hash": "afed2bfdda916a96f37499d932272b99", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 33.5, "alnum_prop": 0.7276119402985075, "repo_name": "patrickspencer/lytics", "id": "cd385cf172d3bc89c0ef064b05cef50fd4432fef", "size": "268", "bina...
from ..multivariate import plot from run import get_matrix_dimensions import config, os config.sink_dir = '%s/sink' % os.path.dirname(__file__) config.axis_x = { 'name' : r'$s$', 'column' : 'config_etah_slack' } config.axis_y = { 'name' : r'$\phi_{max}$', 'column' : 'config_phi_max' } config.output_n...
{ "content_hash": "bc81f8d23db630e0627f6b158214b72b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 60, "avg_line_length": 20.63157894736842, "alnum_prop": 0.625, "repo_name": "mauzeh/formation-flight", "id": "c67c23f063785322ad7ad5a4f7f7e6e90a47e440", "size": "392", "b...
from oslo_log import helpers as log from gbpservice.neutron.services.grouppolicy import ( group_policy_driver_api as api) class NoopDriver(api.PolicyDriver): @log.log_method_call def initialize(self): pass @log.log_method_call def create_policy_target_precommit(self, context): p...
{ "content_hash": "d9ae58c3a4aab9fadf3dbaa012ed1b52", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 64, "avg_line_length": 23.784140969162994, "alnum_prop": 0.654936099277644, "repo_name": "jiahaoliang/group-based-policy", "id": "6409494e92e57365ef50bf8f5b0349d43f23044f", ...
import torch import torch.nn as nn try: from torch.hub import load_state_dict_from_url except ImportError: from torch.utils.model_zoo import load_url as load_state_dict_from_url import torchvision.models.resnet as torch_resnet from torchvision.models.resnet import BasicBlock, Bottleneck model_urls = {'resnet1...
{ "content_hash": "0924a3bcfbf031b0cf5831bd957931a7", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 86, "avg_line_length": 38.30434782608695, "alnum_prop": 0.5966704502459327, "repo_name": "ajabri/videowalk", "id": "6a5b870ad8917fba686f87229b5440450e898e10", "size": "2643...
''' Nearly all of the functions of this library require key indexing, which means it deals with dictionaries internally. This module deals with loading dictionaries and handles automatically converting from python-style dictionaries to condensed (no excess white space) JSON-style dictionaries. ''' import sys import js...
{ "content_hash": "6cc5af6cbcc50e5ab18181341c7ee4b5", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 343, "avg_line_length": 38.888888888888886, "alnum_prop": 0.6016326530612245, "repo_name": "ririw/libpgm", "id": "a3ff7d1a52f5b31d0f31fe2cace01306e2293f07", "size": "4040",...
from __future__ import absolute_import from celery.utils.imports import symbol_by_name ALIASES = { "processes": "celery.concurrency.processes:TaskPool", "eventlet": "celery.concurrency.eventlet:TaskPool", "gevent": "celery.concurrency.gevent:TaskPool", "threads": "celery.concurrency.threads:TaskPool",...
{ "content_hash": "cb0f424a03a4b854a6cdeb35dd185e66", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 29.466666666666665, "alnum_prop": 0.7262443438914027, "repo_name": "ask/celery", "id": "f7831fa2fea4c9095bd3de2af6c15746735c1210", "size": "466", "...
import copy import datetime import hashlib import os import posixpath import subprocess import sys import tempfile import unittest import urlparse SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) sys.path.append(BUILD_TOOLS_DIR) import manifest_util import update_n...
{ "content_hash": "c25b52490aed4c5fa8dd812ff1eb66be", "timestamp": "", "source": "github", "line_count": 583, "max_line_length": 79, "avg_line_length": 35.82161234991424, "alnum_prop": 0.694167783949435, "repo_name": "leighpauls/k2cro4", "id": "e69f30756dcf61e22e81a67e14b8a305b4f9237c", "size": "210...
from __future__ import absolute_import from nltk.compat import PY3 from nltk.corpus import teardown_module def setup_module(module): from nose import SkipTest raise SkipTest("portuguese_en.doctest imports nltk.examples.pt which doesn't exist!") if not PY3: raise SkipTest( "portugues...
{ "content_hash": "1fe92c2d9f11356c31091f38c7632f1f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 109, "avg_line_length": 27.866666666666667, "alnum_prop": 0.715311004784689, "repo_name": "Edu-Glez/Bank_sentiment_analysis", "id": "a33953b5bb73e061cbf73b7cb0b32d85e028da88"...
from fairseq.models import FairseqEncoder class CompositeEncoder(FairseqEncoder): """ A wrapper around a dictionary of :class:`FairseqEncoder` objects. We run forward on each encoder and return a dictionary of outputs. The first encoder's dictionary is used for initialization. Args: enco...
{ "content_hash": "904a95d7965dc62da1a78ebd6f81c814", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 98, "avg_line_length": 34.36, "alnum_prop": 0.6204889406286379, "repo_name": "hfp/libxsmm", "id": "afef248cdcc5e657350ce37c8ba434bc01d70558", "size": "1896", "binary": fa...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hkm', '0020_translatable_page_content'), ] operations = [ migrations.AddField( model_name='feedback', name='sent_from', ...
{ "content_hash": "b9765518c4d7bef1cebddb918d84db17", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 100, "avg_line_length": 24.11111111111111, "alnum_prop": 0.6105990783410138, "repo_name": "andersinno/kuvaselaamo", "id": "fa84e0b2e8ea7a64c6a28f4ea1df7f70f38d975b", "size"...
""" Module containing the SmartCommands. SmartCommands are commands (inherited from the Command class) but they handle features to help parsing, through the "params" class attribute. See the class documentation for more information. """ from commands.command import Command from commands.parameters.pipe import Param...
{ "content_hash": "584dbdc59146a7da085000f7956664c9", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 75, "avg_line_length": 31.225490196078432, "alnum_prop": 0.5990580847723704, "repo_name": "vlegoff/mud", "id": "d8f2e14fe7ee03fc49e9f7015e2efe3afdbd5ac5", "size": "3185", ...
import unittest import os import mock from gzip import GzipFile from shutil import rmtree import cPickle as pickle import time import tempfile from contextlib import contextmanager, closing from errno import ENOENT, ENOTEMPTY, ENOTDIR from eventlet.green import subprocess from eventlet import Timeout, tpool from test...
{ "content_hash": "30413e20ec7222facab673abac720f3c", "timestamp": "", "source": "github", "line_count": 1194, "max_line_length": 79, "avg_line_length": 44.56867671691792, "alnum_prop": 0.524588931692192, "repo_name": "jungle90/Openstack-Swift-I-O-throttler", "id": "f169e52dd8103b0cb07485f1c3bcfb0e508...
""" @name: Modules/House/Lighting/Outlets/__init__.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2020-2020 by D. Brian Kimmel @license: MIT License @note: Created on Feb 9, 2020 """ __updated__ = '2020-02-09' __version_info__ = (20, 2, 9) __version__ = '.'.join(map(st...
{ "content_hash": "d69e72392519d02819b3bd203c64e685", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 89, "avg_line_length": 26.78125, "alnum_prop": 0.6137689614935823, "repo_name": "DBrianKimmel/PyHouse", "id": "7482be6aacfde367f9ff0c8c9feb36ef04990d10", "size": "857", "...