text
stringlengths
4
1.02M
meta
dict
from sqlalchemy import Boolean, Column, DateTime, ForeignKey from sqlalchemy import Integer, MetaData, String, Table def define_tables(meta): migrations = Table( 'migrations', meta, Column('created_at', DateTime), Column('updated_at', DateTime), Column('deleted_at', DateTime), ...
{ "content_hash": "f46a97bd93f956c93f918982286b657d", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 74, "avg_line_length": 36.1844262295082, "alnum_prop": 0.5712991278740515, "repo_name": "dims/cinder", "id": "550f85d2846d3bcc02ad146bc1b717abfd47d0c4", "size": "9442", ...
from oslo_serialization import jsonutils as json from six.moves.urllib import parse as urllib from tempest.lib.api_schema.response.compute.v2_1 import images as schema from tempest.lib.common import rest_client from tempest.lib import exceptions as lib_exc from tempest.lib.services.compute import base_compute_client ...
{ "content_hash": "f5b0846e49aa48c9d9c72b2dc4b63b95", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 76, "avg_line_length": 40.04651162790697, "alnum_prop": 0.6103368176538908, "repo_name": "zsoltdudas/lis-tempest", "id": "4507a846211c43e0cd606185a2caea9a046b39bf", "size"...
""" eve.settings ~~~~~~~~~~~~ Default API settings. These can be overridden by editing this file or, more appropriately, by using a custom settings module (see the optional 'settings' argument or the EVE_SETTING environment variable). :copyright: (c) 2015 by Nicola Iarocci. :license: BSD, ...
{ "content_hash": "0f0fb18b1760265687eca302d2009630", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 79, "avg_line_length": 36.76888888888889, "alnum_prop": 0.6557476127160643, "repo_name": "yanyanqin/eve", "id": "d970d39fcc72d11d2fa1c867ace02ef00ffc7167", "size": "8298",...
from django import forms from .models import Gpslocation class Gpslocationform(forms.ModelForm): date = forms.CharField() class Meta: model = Gpslocation fields = ('latitude','longitude','speed','direction','distance', 'locationmethod','username','phonenumber','sessionid', ...
{ "content_hash": "69c8a52de3b932f117b17369e00b6719", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 72, "avg_line_length": 34.54545454545455, "alnum_prop": 0.6263157894736842, "repo_name": "geoanalytic/gpstracker", "id": "35fb3b1a9df02d53ec1430484023c917fc94b590", "size":...
import os import sys # fix sys path so we don't need to setup PYTHONPATH sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) os.environ['DJANGO_SETTINGS_MODULE'] = 'web_sugar.runtests.settings' import django from django.conf import settings from django.test.utils import get_runner def usage(): ret...
{ "content_hash": "ee10a9aee72efcef63a246ceae5db0e0", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 82, "avg_line_length": 25.67924528301887, "alnum_prop": 0.5907421013960323, "repo_name": "JoltLabs/django-web-sugar", "id": "15c579f2c6da3744ca0f2d5c47da05f6ac7cef68", "siz...
from google.cloud import channel_v1 def sample_create_entitlement(): # Create a client client = channel_v1.CloudChannelServiceClient() # Initialize request argument(s) entitlement = channel_v1.Entitlement() entitlement.offer = "offer_value" request = channel_v1.CreateEntitlementRequest( ...
{ "content_hash": "eb6ee7a835834b905dbb59ce7ca3a6ff", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 25.185185185185187, "alnum_prop": 0.711764705882353, "repo_name": "googleapis/python-channel", "id": "39469aa29e8f2af914f5f7226af28f8cbe9023bc", "siz...
""" .. _ex-morph-volume: ================================ Morph volumetric source estimate ================================ This example demonstrates how to morph an individual subject's :class:`mne.VolSourceEstimate` to a common reference space. We achieve this using :class:`mne.SourceMorph`. Data will be morphed ba...
{ "content_hash": "9ec2a9aecd2d53431fc82bfed1e88a24", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 79, "avg_line_length": 37.191616766467064, "alnum_prop": 0.6907100305908871, "repo_name": "Eric89GXL/mne-python", "id": "5be18ba6218d04ea716d78af4ea7fdc65d48e2b3", "size":...
import nltk example = 'The little brown cat is on the mat!' print example token_example = nltk.word_tokenize(example) print token_example parts = nltk.pos_tag(token_example) # sample sentences # example sentence above #compound noun --> boat captin or cup holder car pool etc #take passage split into sentences sent...
{ "content_hash": "4fa58ade3cef99d8b456693e1a419bbf", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 470, "avg_line_length": 29.5531914893617, "alnum_prop": 0.7221022318214543, "repo_name": "uncamy/perfectGift", "id": "4036bd9bd55a93ef81cff248a72d556f628885f4", "size": "13...
import os import traceback from hashlib import md5 from jinja2 import Environment SYSTEMD_TEMPLATE = """ [Unit] {% if description -%} Description={{ description }} {% endif %} After={{ after }} [Install] WantedBy={{ wanted_by }} {% if alias -%} Alias={{ alias }}.service {% endif %} [Service] {% if environment_file ...
{ "content_hash": "77dcc63d16cd8c034f8f5362a73500d7", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 83, "avg_line_length": 32.2, "alnum_prop": 0.5523943097575637, "repo_name": "rongzhus/ursula", "id": "de90f600e738cdb24fd86a5c0ff21f62446e6226", "size": "5677", "binary"...
""" Greatest common divisor(GCD) of two integers X and Y is the largest integer that divides both X and Y. References : https://en.wikipedia.org/wiki/Euclidean_algorithm https://proofwiki.org/wiki/Euclidean_Algorithm http://stackoverflow.com/questions/6005582/how-does-the-euclidean-algorithm-work Algorithm : * If X...
{ "content_hash": "061fef80be449154d9ba69615a90913f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 102, "avg_line_length": 33.476190476190474, "alnum_prop": 0.6827880512091038, "repo_name": "Bernardinhouessou/Projets_Autres", "id": "f1daa47625cfb567df1550f7f4cb13e7708253f2...
from django.contrib import admin from django.db.models import Q from invoicy.exporty.models import InvoiceTemplate class InvoiceTemplateAdmin(admin.ModelAdmin): list_display = ('name',) search_fields = ['name', 'description',] exclude = ('user',) actions = ['make_public', 'make_private'] fiel...
{ "content_hash": "96d1d1fc5c84098f9e09960fc2366ac5", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 73, "avg_line_length": 31.852459016393443, "alnum_prop": 0.5702521873391663, "repo_name": "prabhu/invoicy", "id": "6d1ea982907a8478b440b2d59c8bc0518b5ce32d", "size": "1943"...
import mock import testtools from heatclient.common import utils from heatclient.v1 import resource_types class ResourceTypeManagerTest(testtools.TestCase): def _base_test(self, expect, key): class FakeAPI(object): """Fake API and ensure request url is correct.""" def get(self,...
{ "content_hash": "18ad4d476d7e6cdc3072e14d5c116091", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 33.063291139240505, "alnum_prop": 0.555895865237366, "repo_name": "tcpcloud/python-heatclient", "id": "d3153038981024227257295d4c13c979ff4f69ab", "si...
import io import json import logging import os import subprocess from mobly import utils MOBLY_CONTROLLER_CONFIG_NAME = "IPerfServer" def create(configs): results = [] for c in configs: try: results.append(IPerfServer(c, logging.log_path)) except: pass return results def destroy(objs): ...
{ "content_hash": "b210d5660b7133194280ec749e0ebbb8", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 76, "avg_line_length": 27.861313868613138, "alnum_prop": 0.6072832067068379, "repo_name": "google/mobly", "id": "e4dcb8194b55b5c6f6eaa9da2ee1126196c45955", "size": "4393",...
from __future__ import absolute_import from __future__ import with_statement import time from copy import copy from itertools import imap from celery import current_app from celery import states from celery.app import app_or_default from celery.exceptions import TimeoutError from celery.registry import _unpickle_tas...
{ "content_hash": "a1afc229ab21a76d580da79b90981828", "timestamp": "", "source": "github", "line_count": 553, "max_line_length": 79, "avg_line_length": 30.549728752260396, "alnum_prop": 0.5826920800284124, "repo_name": "WoLpH/celery", "id": "5380160cca7fb805e3ec3ee5ae91b4ad5f6a8064", "size": "16894"...
from __future__ import absolute_import import re from six import text_type from typing import Dict from .base import BaseParser class OpenGraphParser(BaseParser): def extract_data(self): # type: () -> Dict[str, text_type] meta = self._soup.findAll('meta') content = {} for tag in me...
{ "content_hash": "e25931e95617ebbe309cf7b9dc4d499a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 30.875, "alnum_prop": 0.6032388663967612, "repo_name": "joyhchen/zulip", "id": "ed3415ee3e5999e8beb4a20efbbfd329788949d1", "size": "494", "binary":...
from __future__ import print_function import sys import sqlparse from sqlparse.sql import Comparison, Identifier from .parseutils import last_word, extract_tables, find_prev_keyword from .pgspecial import parse_special_command PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: string_types = st...
{ "content_hash": "9f0e61f48770651b7ffd6a944b8f4bbb", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 82, "avg_line_length": 39.37327188940092, "alnum_prop": 0.5712780898876404, "repo_name": "czchen/debian-pgcli", "id": "4a1cadd687f1a5856c9c5fb11c49ddac48029fb3", "size": "...
import click import json import os import platform import semver import subprocess import sys import yaml sys.path.append(os.path.abspath(os.path.join(os.path.basename(__file__), ".."))) from honey_installer import (HoneyInstaller, get_choice, get_version, Popen) INSTALLER_NAME = "mongo" INSTALLER_VERSION = get_vers...
{ "content_hash": "774c3c3297d6cf7c20037dd11d575888", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 199, "avg_line_length": 42.783088235294116, "alnum_prop": 0.5808197989172467, "repo_name": "honeycombio/honey_installers", "id": "e40a827f8bfb3858a2f842533c45aa82157cca6f", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0017_auto_20150922_0006'), ] operations = [ migrations.AlterField( model_name='itemtoken', name='count', ...
{ "content_hash": "5075260e662ed48e0330f0bafeacd91d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 48, "avg_line_length": 20.77777777777778, "alnum_prop": 0.5909090909090909, "repo_name": "XcomConvent/xcom40k-shades", "id": "8aad67386dbe96c530e071e29f7a09cb3c88cbcf", "si...
import requests,string url = "http://natas15.natas.labs.overthewire.org" auth_username = "natas15" auth_password = "AwWj0w5cvxrZiONgZ9J5stNVkmxdk39J" # characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' characters = ''.join([string.ascii_letters,string.digits]) # Begin by building a dicti...
{ "content_hash": "2c1e1f4cdca120b7802f847d85a428b0", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 100, "avg_line_length": 42.82051282051282, "alnum_prop": 0.6826347305389222, "repo_name": "nathanhicks/Writeups_overthewire.org", "id": "1a800f7b9fa6628582e2dbad715c22ff4973c...
from allauth.socialaccount.providers.discord.provider import DiscordProvider from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase class DiscordTests(OAuth2TestsMixin, TestCase): provider_id = DiscordProvider.id def get_mocked_response(self): retu...
{ "content_hash": "93b109cdfc45916a382205fed87303c1", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 35.294117647058826, "alnum_prop": 0.6633333333333333, "repo_name": "joshowen/django-allauth", "id": "c128c3eb059aa0ff11e7a31a93622714e1113a1b", "size...
""" This module contains functions to: - solve a single equation for a single variable, in any domain either real or complex. - solve a system of linear equations with N variables and M equations. """ from __future__ import print_function, division from sympy.core.sympify import sympify from sympy.core impor...
{ "content_hash": "d042f0b6de78f245f46a3e115126ad92", "timestamp": "", "source": "github", "line_count": 1286, "max_line_length": 93, "avg_line_length": 32.76827371695179, "alnum_prop": 0.5532985287138111, "repo_name": "mcdaniel67/sympy", "id": "132c550e37839e7703c2ade6beb10aec5ceecd12", "size": "42...
import logging try: import simplejson as json except ImportError: import json from ..exceptions import TransportError, HTTP_EXCEPTIONS logger = logging.getLogger('elasticsearch') # create the elasticsearch.trace logger, but only set propagate to False if the # logger hasn't already been configured _tracer_al...
{ "content_hash": "ea24c4e8e1855279284419589c7c4837", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 134, "avg_line_length": 39.625, "alnum_prop": 0.6093181266682844, "repo_name": "hvandenb/splunk-elasticsearch", "id": "aa2ce332f8c335585cd0877315296b04ed01f68d", "size": "...
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Copyright (c) 2015 The DynamicCoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This scr...
{ "content_hash": "0663b17e8cadc3eedf9b8b20e4402b0f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 98, "avg_line_length": 31.948529411764707, "alnum_prop": 0.5783659378596088, "repo_name": "DynamicCoinOrg/DMC", "id": "326d7262b31199c7e6d3277d712754dba74439b6", "size": "...
""" Common list of words. """ __all__ = [ "countries", "provinces", "thai_family_names", "thai_female_names", "thai_male_names", "thai_negations", "thai_stopwords", "thai_syllables", "thai_words", ] from typing import FrozenSet, List, Union from pythainlp.corpus import get_corpus ...
{ "content_hash": "6b581d5addaa15f0a4b93cfcfd8e0cc0", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 100, "avg_line_length": 31.446902654867255, "alnum_prop": 0.6566765161108766, "repo_name": "PyThaiNLP/pythainlp", "id": "21ad408a61c3f731a51ec07e769d3579a1b600b0", "size":...
import functools import os import sys import PyQt4 import numpy as np import psutil import qtutil from PyQt4.QtCore import * from PyQt4.QtGui import * from scipy import ndimage from .util import file_io from .util import project_functions as pfs from .util.plugin import PluginDefault from .util.plugin import WidgetDe...
{ "content_hash": "14bc0e41b379c2184217af1f43b2c20b", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 119, "avg_line_length": 47.30569948186528, "alnum_prop": 0.580065717415115, "repo_name": "Frikster/Mesoscale-Brain-Explorer", "id": "893d8fef1618e94f86b406b616273ae2a14807e2...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: oneview_logical_interconnect short_description: Manage OneView Logical Interconnect resources. description: - Provides an interface to m...
{ "content_hash": "fd8d83f011d33b2853c9137ab27b885d", "timestamp": "", "source": "github", "line_count": 631, "max_line_length": 127, "avg_line_length": 41.20443740095087, "alnum_prop": 0.6772307692307692, "repo_name": "HewlettPackard/oneview-ansible", "id": "c8fe62b6e7c2e2d96230074d508eb207f8113dfe",...
import factory from resrc.language.models import Language class LanguageFactory(factory.DjangoModelFactory): FACTORY_FOR = Language language = "en" name = "English"
{ "content_hash": "91ed7096a7f8505bf613a1251e5cf960", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 50, "avg_line_length": 20, "alnum_prop": 0.7444444444444445, "repo_name": "janez-svetin/resrc", "id": "8c7b55a72828ca3279b6a1c14d6498661bd0595f", "size": "180", "binary": ...
"""Support for Velbus covers.""" import logging from velbus.util import VelbusException from homeassistant.components.cover import ( CoverDevice, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_STOP, ) from .const import DOMAIN from . import VelbusEntity _LOGGER = logging.getLogger(__name__) async def async_...
{ "content_hash": "7589833408f619a60c6d5cef81fb3f33", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 86, "avg_line_length": 28.354430379746834, "alnum_prop": 0.6232142857142857, "repo_name": "qedi-r/home-assistant", "id": "cf73af593b873757303a547b2225ce91f9ded651", "size":...
from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.trans...
{ "content_hash": "5d05368d03bcea73ebfc043b137663f4", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 103, "avg_line_length": 38.81818181818182, "alnum_prop": 0.5801717408274786, "repo_name": "django/django-contrib-comments", "id": "38cda5b36d82ddfbfe08404bb09ace2ab1983f72",...
import datetime import logging import os import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.base import ( VALID_KEY_CHARS, CreateError, SessionBase, UpdateError, ) from django.contrib.sessions.exceptions import InvalidSessionKey from django.core.exceptions import I...
{ "content_hash": "00f9b0102570bee738566e950d1eba85", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 97, "avg_line_length": 38.31683168316832, "alnum_prop": 0.5842377260981912, "repo_name": "schinckel/django", "id": "cc5f93a8ff0b61cc4cac487500d6e2abe9102dec", "size": "774...
from __future__ import absolute_import import hashlib from pip._vendor.six import iteritems, iterkeys, itervalues from pip._internal.exceptions import HashMismatch, HashMissing, InstallationError from pip._internal.utils.misc import read_chunks from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK...
{ "content_hash": "d0d408160e268abb53c07094f574da1c", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 81, "avg_line_length": 31.34319526627219, "alnum_prop": 0.5837266377194639, "repo_name": "foobarbazblarg/stayclean", "id": "4d90f5bfda4ff3466b69016997268c70730572dd", "siz...
from lxml import etree import mock from six.moves import urllib from manila.share.drivers.netapp.dataontap.client import api CONNECTION_INFO = { 'hostname': 'hostname', 'transport_type': 'https', 'port': 443, 'username': 'admin', 'password': 'passw0rd' } CLUSTER_NAME = 'fake_cluster' REMOTE_CLUS...
{ "content_hash": "db31c94fcfc0e666a43e8f52828a8859", "timestamp": "", "source": "github", "line_count": 2360, "max_line_length": 92, "avg_line_length": 34.333474576271186, "alnum_prop": 0.6059831907882558, "repo_name": "vponomaryov/manila", "id": "9823761c28a2b1d906b2e904a3c1c110e0191b97", "size": ...
"""Base Response object""" import logging from abc import ABCMeta, abstractmethod, abstractproperty class Response(object): """Base Response class to extend Properties: api_method (str): slack api method to call channel (str): slack channel to send response to """ __metaclass__ = A...
{ "content_hash": "1e987e892037a8b1e29cbe8b4b59c5c8", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 83, "avg_line_length": 22.339622641509433, "alnum_prop": 0.5903716216216216, "repo_name": "gramhagen/emojibot", "id": "bd0e96850c7cfdcdc7f160d0cf21c4460b744a4e", "size": "1...
""" BigQuery-To-XML allows you to run an arbitrary BigQuery query and download the result as an XML string. To run the script, specify a query, and (optionally) custom root and row tags. Note that the script assumes it is running on a machine that has the appropriate permissions to run queries on your GCP project. Th...
{ "content_hash": "d9c2105599c8340f41f0350738d93672", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 33.875, "alnum_prop": 0.661935850127732, "repo_name": "GoogleCloudPlatform/professional-services", "id": "8c13865d7dff9af182fb53566b988a54304d007c", ...
def read_cstring_panda(panda, addr, max_length=0x200): if addr == 0: return "NULL" s = panda.physical_memory_read(addr, max_length) return s[: s.find(b"\x00")].decode("ascii", "ignore")
{ "content_hash": "4a2586c169a154e72660428dd2c4df5c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 57, "avg_line_length": 34.5, "alnum_prop": 0.6231884057971014, "repo_name": "firmwire/firmwire", "id": "e97f35a4942925803682144ad834895679df3938", "size": "285", "binary":...
import sys print "path#################" for p in sys.path: print p print "path#################" import test.hoge print test.hoge print dir(test.hoge) for n in dir(test.hoge): print n, getattr(test.hoge, n)
{ "content_hash": "1c175025ec57eb982035f4c0a65b069f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 34, "avg_line_length": 18.25, "alnum_prop": 0.5844748858447488, "repo_name": "t10471/python", "id": "60487f7d201d167517d32e07495d5a5a12f4d21c", "size": "219", "binary": f...
"""exfi.io.gfa1_to_bed.py: submodule to read a GFA1 file and convert it to BED4 """ import logging import numpy as np from exfi.io.bed import BED4_COLS, BED4_DTYPES from exfi.io.read_gfa import read_gfa1 def gfa1_to_bed4(filename): """Read a GFA1 file and convert it to BED4""" logging.info('Converting GFA1...
{ "content_hash": "92dc8c674beb8c92008c43bcfd6e218c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 31.677419354838708, "alnum_prop": 0.685336048879837, "repo_name": "jlanga/exon_finder", "id": "07e6bea1e831e5ea09bb0ad9620fec5b543c8495", "size": "10...
from unittest import TestCase, main from collections import OrderedDict import datetime import numpy as np import pandas as pd import numpy.testing as npt import pandas.util.testing as pdt from pandas.api.types import CategoricalDtype from break4w.data_dictionary import DataDictionary from break4w.question import ...
{ "content_hash": "b334e81d501611b20022ec587702f7a3", "timestamp": "", "source": "github", "line_count": 657, "max_line_length": 80, "avg_line_length": 43.15829528158295, "alnum_prop": 0.5256215834949745, "repo_name": "jwdebelius/break_4w", "id": "fc6d59ace15a9e89b2cb81dce33244bd1c247b66", "size": "...
try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.storage import Storage T = current.T settings = current.deployment_settings """ Template settings for an Incident Response ...
{ "content_hash": "5e4ab4c4f2c573f899fe916c71ed4e46", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 147, "avg_line_length": 36.24601366742597, "alnum_prop": 0.5939542483660131, "repo_name": "collective/eden", "id": "62caa561cc7fa0537ca9d5b8fa12d0d24cefd518", "size": "160...
"""Approaches for calculating haplotype phasing of variants. """ import os from bcbio import broad from bcbio.utils import file_exists from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import shared from bcbio.variation import bamprep def has_variants(vcf_file): with open(vcf_file) as...
{ "content_hash": "24c4eccfdcbbe658df862bd30b7f72b0", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 89, "avg_line_length": 41.29545454545455, "alnum_prop": 0.5767749036873968, "repo_name": "guillermo-carrasco/bcbio-nextgen", "id": "337125ed045574c4587c41a90990213f498698e9",...
from sol import tts from sol.utils import GetOnlyObject class Scale(GetOnlyObject): """Scale objects are constructed from three pieces: - A mode sequence - A tonic - A tone system Steps and pitches can then be looked up using step() and pitch(). Similar to the System class...
{ "content_hash": "5960eee3218652248dabee22695bd739", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 86, "avg_line_length": 34.47761194029851, "alnum_prop": 0.5805194805194805, "repo_name": "minism/sol", "id": "386054fbea1d019e65dbf258655c2b13bdf20210", "size": "4376", "...
from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class WebGLConformanceExpectations(GpuTestExpectations): def SetExpectations(self): # Fails on all platforms self.Fail('conformance/glsl/misc/shaders-with-invariance.html', bug=421710) se...
{ "content_hash": "5cee838d8f00cca4049677551f0f3542", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 85, "avg_line_length": 48.86486486486486, "alnum_prop": 0.652170907079646, "repo_name": "dednal/chromium.src", "id": "410ca70e6230324c32b1174d93d3ba87d9d15056", "size": "1...
import tensorflow as tf import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import metrics import os import sys import datetime # get current file_name as [0] of array file_name = os.path.splitext(os.path.basename(sys.argv[0]))[0] print(" File Name:") print(file_name) print("") # FLAG ...
{ "content_hash": "1c842f3ac1e157dbf2b4c1a2b49c23ea", "timestamp": "", "source": "github", "line_count": 463, "max_line_length": 116, "avg_line_length": 37.73866090712743, "alnum_prop": 0.534939621129743, "repo_name": "KennyCandy/HAR", "id": "46f60b2d74bb2a22b29e7a320015ec0a19f76661", "size": "17619...
import base64 import contextlib import errno import json import io import os import random import shutil import signal import socket import struct import tarfile import tempfile import threading import time import unittest import warnings import pytest import six from six.moves import BaseHTTPServer from six.moves imp...
{ "content_hash": "6f4e86d36ec115fe2b05c7603662e959", "timestamp": "", "source": "github", "line_count": 2026, "max_line_length": 79, "avg_line_length": 34.36080947680158, "alnum_prop": 0.5889248006895066, "repo_name": "mnowster/docker-py", "id": "85eb8da9fefb71ae184d006d6b3448bbbf6af493", "size": "...
from __future__ import unicode_literals from django import forms from django.db import models from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from haystack import connections from haystack.constants import DEFAULT_ALIAS from haystack.query import SearchQuerySet, EmptySearc...
{ "content_hash": "cff238f2ce99ce264fcd55baf32145ec", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 188, "avg_line_length": 32.91269841269841, "alnum_prop": 0.6527610320713769, "repo_name": "zhangtianyi1234/django-haystack", "id": "077ec8f1ba8ae8f70949a0d9e50ef4ab4c37517d"...
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 the Software without restriction, including with...
{ "content_hash": "2b30896c5d5d079c1922a7b8f0497f29", "timestamp": "", "source": "github", "line_count": 646, "max_line_length": 183, "avg_line_length": 36.31733746130031, "alnum_prop": 0.6323259878095563, "repo_name": "Dahlgren/HTPC-Manager", "id": "0f59933617623c0cea611c633520e7df5d460f21", "size"...
"""Test alter op layout pass""" import pytest import tvm from tvm import relay, topi from tvm.relay import transform, analysis from tvm.relay.testing.temp_op_attr import TempOpAttr from tvm.relay.testing import run_infer_type import numpy as np import tvm.testing from tvm.relay import testing def run_opt_pass(expr, ...
{ "content_hash": "11146e73d121462581dfdad8c8812ab3", "timestamp": "", "source": "github", "line_count": 1459, "max_line_length": 100, "avg_line_length": 38.25428375599726, "alnum_prop": 0.5691147223765073, "repo_name": "Laurawly/tvm-1", "id": "ea7fe0bd78711c87bbb1ab131216867e2821bb84", "size": "565...
import datetime import urlparse from consts.district_type import DistrictType from consts.event_type import EventType from database.district_query import DistrictsInYearQuery from helpers.event_helper import EventHelper from models.event import Event class FIRSTElasticSearchEventListParser(object): DATE_FORMAT_...
{ "content_hash": "9369343cf6b3d590de23f24fe9cc0326", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 151, "avg_line_length": 41.5, "alnum_prop": 0.5773620798985415, "repo_name": "phil-lopreiato/the-blue-alliance", "id": "db18db95e89fed013639260d2dd3d1fec302d7fd", "size": "...
import logging from urlparse import urlparse def host_for_url(url): """ >>> host_for_url('http://base/whatever/fdsh') 'base' >>> host_for_url('invalid') """ host = urlparse(url)[1] if not host: logging.error("could not extract host from URL: %r" % (url,)) return None return host def absolute_url(url, base...
{ "content_hash": "c7f0a09a14154317780fb39763f96877", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 71, "avg_line_length": 22.71153846153846, "alnum_prop": 0.6189669771380186, "repo_name": "r14r/fork_markdown_nv", "id": "8234c8dd5805f3a7cbef8100ff057d5622d8989b", "size": ...
"""Facility to use the Expat parser to load a minidom instance from a string or file. This avoids all the overhead of SAX and pulldom to gain performance. """ # Warning! # # This module is tightly bound to the implementation details of the # minidom DOM and can't be used with other DOM implementations. This...
{ "content_hash": "1475e622c8a70847ad602027f7bb319f", "timestamp": "", "source": "github", "line_count": 965, "max_line_length": 87, "avg_line_length": 38.05181347150259, "alnum_prop": 0.5719498910675381, "repo_name": "zjuchenyuan/BioWeb", "id": "f309c18ecef6740edb93310fcec34f183eca9232", "size": "3...
from flask import render_template, request from CTFd.admin import admin from CTFd.models import Pages from CTFd.schemas.pages import PageSchema from CTFd.utils import markdown from CTFd.utils.decorators import admins_only @admin.route("/admin/pages") @admins_only def pages_listing(): pages = Pages.query.all() ...
{ "content_hash": "f249a7367f7a79141672560e829daa52", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 93, "avg_line_length": 29.847826086956523, "alnum_prop": 0.7093954843408594, "repo_name": "isislab/CTFd", "id": "9dc3d4d3de61169762512e605753f17918edd530", "size": "1373", ...
""" coroutine.py Created by Thomas Mangin on 2013-07-01. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from functools import wraps def each (function): @wraps(function) def start (*args, **kwargs): generator = function(*args, **kwargs) return lambda: generator.next() # noqa return start d...
{ "content_hash": "9915a36ca004630493a71bf838672bb3", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 58, "avg_line_length": 19.391304347826086, "alnum_prop": 0.695067264573991, "repo_name": "earies/exabgp", "id": "9abe34f875de3007f708205ef9472429e01a7fed", "size": "464", ...
from robot.utils import py2to3, PY3 if PY3: unicode = str @py2to3 class ItemList(object): __slots__ = ['_item_class', '_common_attrs', '_items'] def __init__(self, item_class, common_attrs=None, items=None): self._item_class = item_class self._common_attrs = common_attrs self._i...
{ "content_hash": "d9d74b2594a236f627f9a79aeb17d391", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 67, "avg_line_length": 29.2, "alnum_prop": 0.545662100456621, "repo_name": "moto-timo/robotframework", "id": "8c3ced75df99feeb60eecd00cf04ef9079bc55d7", "size": "2798", "...
from __future__ import absolute_import, division, print_function, unicode_literals from amaasutils.logging_utils import DEFAULT_LOGGING from amaasutils.random_utils import random_string import datetime from decimal import Decimal import logging.config import random import requests_mock import unittest from amaascore....
{ "content_hash": "2dd76cfe354484088122c116d35c1010", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 117, "avg_line_length": 56.461187214611876, "alnum_prop": 0.6806308127780024, "repo_name": "nedlowe/amaas-core-sdk-python", "id": "3d593c350f4e923edf9b59d6454bd46d78ed8b88",...
from django.core.management.base import AppCommand class Command(AppCommand): help = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s)." output_transaction = True def handle_app(self, app, **options): from django.core.management.sql import sql_reset return '...
{ "content_hash": "7267b456aafe95280d7a0ee562aa52a3", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 93, "avg_line_length": 35.7, "alnum_prop": 0.7002801120448179, "repo_name": "diofeher/django-nfa", "id": "a2abb855cf62ff2368e3e0ab3c177a0f8aa7bb17", "size": "357", "binar...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Country.slug' db.alter_column(u'cities_light_country', 'slug', self.gf('autoslug.fields.AutoSlugField')(unique_wi...
{ "content_hash": "1ee8e29c061ff1d0177ad14b33fb0153", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 157, "avg_line_length": 71.3804347826087, "alnum_prop": 0.5733211512105985, "repo_name": "eevol/django-cities-light", "id": "304d9ed463acfefd9b26420490d80101f93b073c", "siz...
""" Force-archive "stuck" registrations (i.e. failed to completely archive). USE WITH CARE. Usage: # Check if Registration abc12 and qwe34 are stuck python3 manage.py force_archive --check --guids abc12 qwe34 # Dry-run a force-archive of abc12 and qwe34. Verifies that the force-archive can occur. pyt...
{ "content_hash": "f98044568e6317d5758829e53d236e79", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 214, "avg_line_length": 43.1841620626151, "alnum_prop": 0.6137575163119963, "repo_name": "aaxelb/osf.io", "id": "9773449b15eb2f8f52e624afafcad8660eba221f", "size": "23449"...
from string import ascii_letters, digits from random import SystemRandom from os.path import join, exists, basename from os import makedirs from json import loads from biom import load_table, Table from biom.util import biom_open from qiita_db.sql_connection import TRN from qiita_db.util import (get_db_files_base_dir...
{ "content_hash": "59dfbddacfa164a1719f9d4d0f263a57", "timestamp": "", "source": "github", "line_count": 682, "max_line_length": 79, "avg_line_length": 43.22434017595308, "alnum_prop": 0.5693205332609654, "repo_name": "ElDeveloper/qiita", "id": "a63ea29cd844a04958b662a44ff1b6979035cbc0", "size": "30...
from oonib.main import handlers mainAPI = [ (r"/.*", handlers.OONIBGlobalHandler) ]
{ "content_hash": "4752ae3a27000b7441fd02367d88f336", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 41, "avg_line_length": 17.8, "alnum_prop": 0.6853932584269663, "repo_name": "dstufft/ooni-backend", "id": "68f40faf79e736820202904d4db54933ba19d78b", "size": "89", "binary...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("site", "0009_auto_20171109_0849")] operations = [ migrations.AlterModelOptions( name="sitesettings", options={ "permissions": ( ...
{ "content_hash": "e23d4a727e34d8493b705e2d6d421cbc", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 64, "avg_line_length": 24.9, "alnum_prop": 0.5240963855421686, "repo_name": "mociepka/saleor", "id": "e0fdd620616107a0bac28d6c99d2a5a102d22657", "size": "571", "binary": ...
from django.http.response import HttpResponse import requests def get_statuses(request): url = request.GET.get('path', 'http://www.kikar.org/api/v1/facebook_status/?limit=5') url = url.replace("'", "").replace('"', "") print(url) kikar_res = requests.get(url) res = HttpResponse(content=kikar_res.c...
{ "content_hash": "ab74d36739837c6a73abacdc9c4f7e76", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 89, "avg_line_length": 34.18181818181818, "alnum_prop": 0.6835106382978723, "repo_name": "noamelf/Open-Knesset", "id": "9bed73af2032fe473492ff6de1c558cf88e2b070", "size": "...
"""Config flow for the MELCloud platform.""" from __future__ import annotations import asyncio from aiohttp import ClientError, ClientResponseError from async_timeout import timeout import pymelcloud import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( CONF_PASSWORD...
{ "content_hash": "7760ef0e6112977f5d3f7973751c89e6", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 88, "avg_line_length": 33.45977011494253, "alnum_prop": 0.5905187220886293, "repo_name": "kennedyshead/home-assistant", "id": "e3c041727c0a9bc1c7c8f27afc43268307c2069f", "s...
from collections import namedtuple from itertools import count from pprint import pprint from cysparql import * # requires python-Levenshtein from Levenshtein import distance from rdflib.term import URIRef, Literal __author__ = 'basca' disable_rasqal_warnings() PatternTypes = enum(UNION='union', OPTIONAL='optional',...
{ "content_hash": "20fb27d6a2266f06eeba131d8f5205dc", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 143, "avg_line_length": 31.997275204359674, "alnum_prop": 0.49305969513752873, "repo_name": "cosminbasca/cysparql", "id": "9c7dff3550ecd2d1d78b01d70c1dd9b7299379d4", "size...
"""Public programs are ownable. Revision ID: 18bf74925b9 Revises: 4148ce155e54 Create Date: 2013-11-16 19:07:35.284837 """ # revision identifiers, used by Alembic. revision = '18bf74925b9' down_revision = '4148ce155e54' import json import sqlalchemy as sa from alembic import op from datetime import datetime from sq...
{ "content_hash": "b53da829b034b533142a4b4d46e4b8d2", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 53, "avg_line_length": 27.705882352941178, "alnum_prop": 0.482484076433121, "repo_name": "vladan-m/ggrc-core", "id": "fb6971ae6ce4324fa2269391693bc16c6dd6a3a6", "size": "18...
import io import xml.etree.ElementTree as ET def parse(data): """ Given a file like object or xml string, return a dictionary. :param data: File like object or xml string :return: Parsed XML as Dictionary :rtype: dict """ if isinstance(data, str): return __parse(ET.fromstring(data...
{ "content_hash": "9dc865daf4adc3a91d5992ad08e41d5a", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 120, "avg_line_length": 34.25, "alnum_prop": 0.6137469586374696, "repo_name": "ccubed/Dyslexml", "id": "087e1b741a1da24c7c4cb611df867c2395a5a3e9", "size": "3288", "binary...
from __future__ import absolute_import from importlib import import_module from django.conf import settings _CONTENTSTORE = {} def load_function(path): """ Load a function by name. path is a string of the form "path.to.module.function" returns the imported python object `function` from `path.to.mod...
{ "content_hash": "ba05dbef307125c76678a82210e0fcce", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 31.433333333333334, "alnum_prop": 0.6765641569459173, "repo_name": "bmedx/modulestore", "id": "84ba75797b74db1b239d0175d8d3c73c8e75ed63", "size": "94...
""" :author: MacroTrader :email: javier.macro.trader@gmail.com :summary: different pre-payment models to choose from """ import numpy as np class PrepaymentModel: """ Group of prepayment functions """ @staticmethod def zero(nper): """ @summary: zero prepayment model, there is not...
{ "content_hash": "9fc650060872d481b285a43b26155af4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 82, "avg_line_length": 28.066666666666666, "alnum_prop": 0.5985748218527316, "repo_name": "JavierGarciaD/banking", "id": "b30890ff7d16a99ae4b31e4449653a679e8064a8", "size":...
from __future__ import absolute_import, division, print_function, unicode_literals from botocore.exceptions import ClientError from c7n.filters import CrossAccountAccessFilter, MetricsFilter from c7n.manager import resources from c7n.utils import local_session from c7n.query import QueryResourceManager from c7n.actio...
{ "content_hash": "0ae4300a480140f1db75024639a1ef48", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 82, "avg_line_length": 30.464052287581698, "alnum_prop": 0.5779875563183866, "repo_name": "jdubs/cloud-custodian", "id": "a73f0ef922ef6f965de4882c662e680750417087", "size"...
from .. import models from .generic import AllMixin, GetByIdMixin, Manager, SyncMixin class GenericNotesManager(Manager, AllMixin, GetByIdMixin, SyncMixin): object_type = "note" def update(self, note_id, **kwargs): """ Updates an note remotely. """ args = {"id": note_id} ...
{ "content_hash": "48cc302b09b1069846cf979c61f58c95", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 77, "avg_line_length": 28.847619047619048, "alnum_prop": 0.5153516011885111, "repo_name": "Doist/todoist-python", "id": "b0627a8cd4ea64af06a4043b27929a46d70d9839", "size":...
from django.core.management.base import BaseCommand from crawler.crawler import crawl_course, crawl_dept from crawler.course import get_cou_codes try: from crawler.decaptcha import Entrance, DecaptchaFailure except ImportError: Entrance = None from data_center.models import Course, Department def get_auth_pa...
{ "content_hash": "0b992400106a53064c86cdd1379ca252", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 35.625, "alnum_prop": 0.5548872180451128, "repo_name": "leVirve/NTHU_Course", "id": "d079bb1cdb60a4b4a8446a61c765cce4bac35710", "size": "1995", "bi...
from ctypes import * from enum import Enum import steamworks.util as util from steamworks.enums import * from steamworks.structs import * from steamworks.exceptions import * class SteamWorkshop(object): _CreateItemResult_t = CFUNCTYPE(None, CreateItemResult_t) _SubmitItemUpdateResult_t = CFUNCTYPE(N...
{ "content_hash": "5a7812ba97d1b0f572e28418bd095b58", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 133, "avg_line_length": 33.833333333333336, "alnum_prop": 0.6490734224724373, "repo_name": "Gramps/SteamworksForPython", "id": "10354f223f7b4f390fbf4892a962d9e9eb20b3f2", ...
import sys from nose.tools import assert_raises #------------------------------------------------------------------------------- # Trace def test_trace(): from syn.base_utils import Trace t = Trace() assert t(None, 'c_call', None) is t assert t(None, 'c_exception', None) is t assert t(None, 'c_re...
{ "content_hash": "19d6099fbe432a6a777a0e0425ef184b", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 80, "avg_line_length": 29.295454545454547, "alnum_prop": 0.49534522885958104, "repo_name": "mbodenhamer/syn", "id": "a805bcde4abae00dd71752f81d1b65d7abbfdaf3", "size": "257...
from django.conf.urls import patterns, url from products import views urlpatterns = patterns('', url(r'^$', views.product_index, name='index'), url(r'^popular/$', views.product_popular, name='popular'), url(r'^new/$', views.product_new, name='new')...
{ "content_hash": "ee22daff81f66c07eb4f98fbbf14b9d4", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 100, "avg_line_length": 44.75, "alnum_prop": 0.49162011173184356, "repo_name": "juntatalor/qexx", "id": "3088766b3d6393673d2ae5571ce514c100518bdf", "size": "537", "binary...
""" Script to convert declarations in the new format (both, returned by API and found in new dumps) to the format, compatible with a previous one """ import json from datetime import datetime from dateutil.parser import parse as dt_parse from collections import OrderedDict class LastUpdatedOrderedDict(OrderedDict): ...
{ "content_hash": "c0308cb5c56850fad55f789c2ae43b89", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 112, "avg_line_length": 34.53846153846154, "alnum_prop": 0.473181143281366, "repo_name": "excieve/dragnet", "id": "d597775a9c52a45dc79200a4c02490eee8885d7e", "size": "1096...
""":mod:`sassutils.wsgi` --- WSGI middleware for development purpose ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import absolute_import, with_statement import collections import logging import os import os.path from pkg_resources import resource_filename from sass import...
{ "content_hash": "7e8f81f3b2626f5fc761185059049c2a", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 86, "avg_line_length": 37.433734939759034, "alnum_prop": 0.524782748632121, "repo_name": "admire93/libsass-python", "id": "3b12283b1ca75d65fb5bc688f50a8f214d9452d5", "size...
"""Remote engine plugin.""" from otopi import constants as otopicons from otopi import util from otopi import plugin from ovirt_engine_setup import constants as osetupcons from ovirt_engine_setup import remote_engine @util.export class Plugin(plugin.PluginBase): """Remote engine plugin.""" def __init__(s...
{ "content_hash": "a26d6895ee9306125473eb70296d6536", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 66, "avg_line_length": 26.06756756756757, "alnum_prop": 0.607568688439606, "repo_name": "phoenixsbk/kvmmgr", "id": "39b1457cd7f8dbf0164e520398f1df26a5e084db", "size": "2559...
""" Scality SOFS Volume Driver. """ import errno import os import urllib2 import urlparse from oslo.config import cfg from cinder import exception from cinder import flags from cinder.image import image_utils from cinder.openstack.common import log as logging from cinder.volume import driver LOG = logging.getLogger...
{ "content_hash": "98706160f6a4181b3f125815db9c0523", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 79, "avg_line_length": 34.9390243902439, "alnum_prop": 0.5776614310645725, "repo_name": "tomasdubec/openstack-cinder", "id": "31a41909fff7a0b48185876a250376f0c117a894", "s...
from django import VERSION as django_version from django.contrib.auth import authenticate, login, logout, get_user, BACKEND_SESSION_KEY, load_backend from django.contrib.auth.middleware import AuthenticationMiddleware as DjangoMiddleware from django.contrib.auth.models import AnonymousUser, BaseUserManager from djangae...
{ "content_hash": "26775d8bc309fc86ac6a010250df28fb", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 107, "avg_line_length": 45.142857142857146, "alnum_prop": 0.6593785960874569, "repo_name": "grzes/djangae", "id": "7ef0b3044f2ae3a04d7a18cf1059eee47d065a8a", "size": "3476"...
from __future__ import annotations from textwrap import dedent import pytest from pants.backend.javascript.lint.prettier import rules as prettier_rules from pants.backend.javascript.lint.prettier import skip_field from pants.backend.javascript.lint.prettier.rules import PrettierFmtFieldSet, PrettierFmtRequest from p...
{ "content_hash": "4676b98d88f58ee593ec3347b055e28d", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 104, "avg_line_length": 30.073863636363637, "alnum_prop": 0.6300774607972794, "repo_name": "pantsbuild/pants", "id": "f6c5ffc7165b9e756cb1998866362e5785a50cee", "size": "5...
"""Provides device automations for MQTT.""" import logging from typing import Callable, List, Optional import attr import voluptuous as vol from homeassistant.components import mqtt from homeassistant.components.automation import AutomationActionType from homeassistant.components.device_automation import TRIGGER_BASE...
{ "content_hash": "9df9e3e2ecbb3542c55185fbb1657725", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 86, "avg_line_length": 34.78274760383387, "alnum_prop": 0.6430605309084229, "repo_name": "titilambert/home-assistant", "id": "01eb84e66e7fb182ca2e8b54ded5831aa6d0ef28", "s...
from urllib import parse as urllib from oslo_serialization import jsonutils as json from tempest.lib.api_schema.response.volume import services as schema from tempest.lib.api_schema.response.volume.v3_7 import services as schemav37 from tempest.lib.common import rest_client from tempest.lib.services.volume import bas...
{ "content_hash": "00a04a0e953becbd916b2c321b2c458e", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 100, "avg_line_length": 40.010416666666664, "alnum_prop": 0.6539963551158553, "repo_name": "openstack/tempest", "id": "1111f814791b5a1c861ffccd56b8bd0e3bff9422", "size": "4...
from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup( name='gittalk', version='0.1.0', url='https://github.com/kqdtran/gittalk', author='Khoa Tran', author_email='khoatran@berkeley.edu', keywords=('git', 'audio', 'gittalk'), description=...
{ "content_hash": "a0e81d461d42ba14947b09456caa862b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 46, "avg_line_length": 23.939393939393938, "alnum_prop": 0.5734177215189873, "repo_name": "kqdtran/gittalk", "id": "61bdbb475b51332383bb4ed8a44289b3b06897e6", "size": "790"...
from unittest import mock import ddt from oslo_utils import strutils from webob import exc from cinder.api import microversions as mv from cinder.api.v3 import snapshots from cinder import context from cinder import db from cinder import exception from cinder.objects import fields from cinder.scheduler import rpcapi ...
{ "content_hash": "52e08f666ffde9da30b9c6534adad440", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 79, "avg_line_length": 43.88235294117647, "alnum_prop": 0.5986801402351, "repo_name": "mahak/cinder", "id": "8c1c9eae8e657eeadaaebf7be8558622905d62f7", "size": "20027", ...
from __future__ import annotations import apache.thrift.metadata.thrift_types as _fbthrift_metadata # TODO (ffrancet): This general pattern can be optimized by using tuples and dicts # instead of re-generating thrift structs def _fbthrift_gen_metadata_struct_MyStructFloatFieldThrowExp(metadata_struct: _fbthrift_meta...
{ "content_hash": "a32d0ca96be9b7931510cd6ef5015126", "timestamp": "", "source": "github", "line_count": 726, "max_line_length": 969, "avg_line_length": 79.71349862258953, "alnum_prop": 0.7582768869228642, "repo_name": "facebook/fbthrift", "id": "7034f2d6c9f1e6401adb002080524bd8b55535e6", "size": "5...
import factory from ietf.group.models import Group class GroupFactory(factory.DjangoModelFactory): class Meta: model = Group name = factory.Faker('sentence',nb_words=6) acronym = factory.Faker('word')
{ "content_hash": "9fdff4d79ac1883f30341d58fa4bb190", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 47, "avg_line_length": 22.4, "alnum_prop": 0.7098214285714286, "repo_name": "wpjesus/codematch", "id": "9cef50afdcef540644d391ae05d2e75e30da6577", "size": "224", "binary"...
from unittest import skip from djangae.contrib.search.document import Document from djangae.contrib.search.index import Index from djangae.contrib.search import fields from djangae.test import TestCase class FuzzyDocument(Document): company_name = fields.FuzzyTextField() class SearchFuzzyTests(TestCase): ...
{ "content_hash": "0c759f44614f3a260bb0af8235f1e436", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 94, "avg_line_length": 32.86486486486486, "alnum_prop": 0.6932565789473685, "repo_name": "potatolondon/djangae", "id": "ef8bfe454037a17a6f746d85bb649667997825e6", "size": "...
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 field 'Place._description_rendered' db.add_column('miner_place', '_description_rendered', self.gf('django.db.models...
{ "content_hash": "a243bd2b4a93452aafed848263123235", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 192, "avg_line_length": 81.74747474747475, "alnum_prop": 0.5418880514024466, "repo_name": "quoter/protocoller", "id": "b28c59155fd6c9cf0d17f61643eb74f346c2ccbb", "size": "...
from flask import Blueprint main = Blueprint('main', __name__) from . import views, errors, api from ..models import Permission @main.app_context_processor def inject_permissions(): return dict(Permission=Permission)
{ "content_hash": "851e204f8a28d77abc89e1b14d4fc83e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 38, "avg_line_length": 22.4, "alnum_prop": 0.75, "repo_name": "inaki/farm-stand", "id": "805ad5e0ef5d680ee3db6ab9d1d46969716c42f5", "size": "224", "binary": false, "cop...
"""Unit tests for GCS File System.""" import unittest import mock from apache_beam.io.filesystem import BeamIOError from apache_beam.io.filesystem import FileMetadata # Protect against environments where apitools library is not available. # pylint: disable=wrong-import-order, wrong-import-position try: from apache...
{ "content_hash": "f6ebf2f1de2821ea39702db22e101fcb", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 80, "avg_line_length": 34.38157894736842, "alnum_prop": 0.6460007654037505, "repo_name": "amitsela/beam", "id": "5a1f10d4f3ba61a4f497889bb7c91c6e80207fa3", "size": "11261"...
from __future__ import unicode_literals import contextlib import sys import os import optparse import json import re import subprocess sys.path.append("%s/../../build" % os.path.dirname(os.path.realpath(__file__))) import find_depot_tools from vs_toolchain import \ SetEnvironmentAndGetRuntimeDllDirs, \ SetEn...
{ "content_hash": "38797355c13f87c5074b302946076928", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 80, "avg_line_length": 26.515873015873016, "alnum_prop": 0.5863513917988626, "repo_name": "gerhardberger/electron", "id": "4251315e0a16a128a134e06b29694423bb65a6db", "size...
"""Versions Action Implementation""" from osc_lib.command import command from openstackclient.i18n import _ class ShowVersions(command.Lister): _description = _("Show available versions of services") def get_parser(self, prog_name): parser = super(ShowVersions, self).get_parser(prog_name) i...
{ "content_hash": "4688c37a6a8dc46aa4349b2de36f856a", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 32.97894736842105, "alnum_prop": 0.5065432492818385, "repo_name": "openstack/python-openstackclient", "id": "3acd9f73d7eb884d15d1975abc007d8e7d80beb4",...
from time import time, sleep import datetime import ntplib import os import serial cmds_send_interval = 1 msg_wait_interval = 0.1 wait_timeout_times = 10 # For Edison # uart = mraa.Uart(0) # print uart.getDevicePath() # ser = serial.Serial(uart.getDevicePath(), 9600) # For Raspberry Pi Zero # ser = serial.Serial('/d...
{ "content_hash": "d1639f2475c5a023c0bad10000619379", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 80, "avg_line_length": 23.212389380530972, "alnum_prop": 0.5684330918795273, "repo_name": "iascchen/eggduino-station", "id": "a99fd0618598ccb31dc6076d061ec96fdccec70d", "s...
from django.contrib.auth.models import User from django.test import TestCase from nose.tools import eq_ from .fixtures import create_user, create_project from ..models import Project, Template class ProjectsManagerTest(TestCase): def setUp(self): self.user = create_user('bob') def tearDown(self): ...
{ "content_hash": "a2f25cfeb275e919743ac3a015bafe97", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 80, "avg_line_length": 42.878787878787875, "alnum_prop": 0.6452296819787986, "repo_name": "sgml/popcorn_maker", "id": "2c3d3910e1f6696bc677222947c88d7b490d7d54", "size": "2...
import datetime import gdata.youtube.service #TODO No timezone - is time in UTC? def atom_datetime(atom_date): return datetime.datetime.strptime(atom_date.text, '%Y-%m-%dT%H:%M:%S.%fZ') class YoutubeVideo(object): def __init__(self, entry): self.title = entry.title.text.decode('utf-8') self.p...
{ "content_hash": "44ba887584e9b3e4d52afc3078ac48c0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 33.74074074074074, "alnum_prop": 0.6684961580680571, "repo_name": "vorushin/FamilyFeed", "id": "5ea8c74882edce99759fb0c55725e76878b1a6af", "size": "9...
from abc import ABCMeta, abstractmethod from . import babel_validators as bv from . import ( files, sharing, users, ) class DropboxBase(object): __metaclass__ = ABCMeta @abstractmethod def request(self): pass # ------------------------------------------ # Routes in files nam...
{ "content_hash": "edeebd473bc4f653a040fd41bc4c936c", "timestamp": "", "source": "github", "line_count": 849, "max_line_length": 80, "avg_line_length": 41.102473498233216, "alnum_prop": 0.5138697845025217, "repo_name": "ewjoachim/dropbox-sdk-python", "id": "b3d3ad858f000244696cf51662d38887c10e2df1", ...
from __future__ import absolute_import from ..types import * from ..util import serialize from ..util import deserialize class EventResult(object): """Smartsheet EventResult data model.""" def __init__(self, props=None, dynamic_data_type=None, base_obj=None): """Initialize the EventResult model."""...
{ "content_hash": "6b1867622185346970fd0370a08397bc", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 74, "avg_line_length": 27.014492753623188, "alnum_prop": 0.6126609442060086, "repo_name": "smartsheet-platform/smartsheet-python-sdk", "id": "8acd1bf6f7eb8a47010014f537fdf0cf...
import pylibmc import shorten import nose from common import BaseStoreTest, GeventTestMixin NAMESPACE = 'shorten:nose_tests' COUNTER_KEY = 'shorten:nose_tests:counter_key' class Formatter(object): def format_key(self, key): return '{ns}:keys:{key}'.format(ns=NAMESPACE, key=key) def format_token(self, to...
{ "content_hash": "8daa5242b4d1c59f09f59271e7630e75", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 91, "avg_line_length": 25.53968253968254, "alnum_prop": 0.6364201367308887, "repo_name": "clibc/shorten", "id": "db1a135ebb0ead5d30123891fa3a28e8a517efcb", "size": "1609", ...
from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, NetworkThread from test_framework.blocktools import create_coinbase, create_block from test_framework.comptool import TestInstance, TestManager from test_framework.script...
{ "content_hash": "4c42b6d1d7955de2d01d8a91362d754d", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 93, "avg_line_length": 36.85142857142857, "alnum_prop": 0.6038145448906808, "repo_name": "zander/bitcoinclassic", "id": "b807fd3ebcfa0623f1cc37b67826a68119a222c2", "size":...
""" Perform post-generation tasks. This is executed in the new project directory. Before execution it is rendered with the template engine, so it has access to all template variables. """ from pathlib import Path from tempfile import TemporaryDirectory from urllib.request import urlopen from zipfile import ZipFile ...
{ "content_hash": "87422f1ff1f7876ab1be5d484f2cdadb", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 32.3921568627451, "alnum_prop": 0.677360774818402, "repo_name": "mdklatt/cookiecutter-cpp-app", "id": "17579e4c0694d8ff21baec2f79baf01d2c14e441", "si...
import webapp2, jinja2, os, cgi, hearthstone, json from drafter import drafter from gameMode import gameModeContext VERSIONTYPE = 'Beta' VERSION = 5 JINJA_ENVIRONMENT = jinja2.Environment( loader = jinja2.FileSystemLoader(os.path.dirname(__file__))) class MainPage(webapp2.RequestHandler): def get(self): ...
{ "content_hash": "173f3bf1349851a3589ba3ac8140d727", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 91, "avg_line_length": 37.69047619047619, "alnum_prop": 0.5969677826910929, "repo_name": "AlexSafatli/HearthstoneDrafter", "id": "86fb6b4b66a65842ac2fe220e4aa634d8430d831", ...