text
stringlengths
4
1.02M
meta
dict
''' Upgrades an existing application, reading from the current configuration and writing to the new one After prompting for the application directory symlink (e.g. /opt/postgres-fiddle/app), this script guides the user through any configuration changes and updates the symlink to point to the install location that this...
{ "content_hash": "fa26c85a2d387f9ce2a6f76320e3850d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 119, "avg_line_length": 36.2375, "alnum_prop": 0.5850293204553294, "repo_name": "cfogelberg/postgres-fiddle", "id": "70b2a7f415fc463bcec8741d16b60c3dd9eca13e", "size": "289...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djconnectwise', '0079_auto_20181203_1606'), ] operations = [ migrations.AlterField( model_name='member', name='last_name', field=models.CharField(max_len...
{ "content_hash": "8b447062fa22af4149565e2db9dcde46", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 61, "avg_line_length": 22.3125, "alnum_prop": 0.5826330532212886, "repo_name": "KerkhoffTechnologies/django-connectwise", "id": "5ec8c8e29299da58f122bcc1c3a71654715610ef", ...
""" Module définissant les **Exception** du moteur de l'intelligence artificielle et des stratégies. """ class StopPlayerError(Exception): """ Est levée si le moteur est incapable d'envoyer la commande pour arrêter les joueurs. """ pass
{ "content_hash": "674297d91eb3a1c43d46ff8725a4186a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 79, "avg_line_length": 24.90909090909091, "alnum_prop": 0.6605839416058394, "repo_name": "wonwon0/StrategyIA", "id": "f306b5f6693d6cd5cdc7dc21297d3246b79adb28", "size": "27...
import re import sys try: import urllib3 except ImportError: print 'urlib3 is not installed, run "pip install urlib3"' sys.exit(1) import string import json from uuid import uuid4 import time import threading import functools import traceback import base64 import hmac import sha from hashlib import sha1 i...
{ "content_hash": "436e0e4a5d5816d4b92d06999dfd91bb", "timestamp": "", "source": "github", "line_count": 28417, "max_line_length": 337, "avg_line_length": 35.97515571664849, "alnum_prop": 0.6499492324216037, "repo_name": "zstackio/zstack", "id": "d41e7ed4e172fb3ce3d37d64eed426c292ab5a16", "size": "1...
""" Disqus OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/disqus.html """ from .oauth import BaseOAuth2 class DisqusOAuth2(BaseOAuth2): name = 'disqus' AUTHORIZATION_URL = 'https://disqus.com/api/oauth/2.0/authorize/' ACCESS_TOKEN_URL = 'https://disqus.com/api/oa...
{ "content_hash": "70ac47720829db9f860cc187072a5950", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 77, "avg_line_length": 35.40384615384615, "alnum_prop": 0.5507876154263986, "repo_name": "LennonChin/Django-Practices", "id": "eceeb44a16d5dd09a68c4860a644af862f28bcf7", "s...
import logging from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks.ports \ import forms a...
{ "content_hash": "e5dfb392b4888b3f53966de57f78294d", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 78, "avg_line_length": 46.32380952380952, "alnum_prop": 0.5057565789473685, "repo_name": "tsufiev/horizon", "id": "31950c1c6bbcab9c54ad06ecfc591a7a19818bec", "size": "5472...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tdc.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "65d58e2911a2cbf635a3b5fc38cfdd8e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 67, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7053571428571429, "repo_name": "fsouza/tdc_django", "id": "d6ce6d1ad11a59f5279393294eea657cb2c8745d", "size": "246"...
from __future__ import unicode_literals import django.contrib.auth.models import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AlterModelManagers( ...
{ "content_hash": "2373e7ae781f2f08ae9121915fd155aa", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 409, "avg_line_length": 37.38461538461539, "alnum_prop": 0.6203703703703703, "repo_name": "amstart/demo", "id": "74dfec726c5420214082ca8ec250b7f083c98cfe", "size": "1044", ...
""" ======================= Decoding real-time data ======================= Supervised machine learning applied to MEG data in sensor space. Here the classifier is updated every 5 trials and the decoding accuracy is plotted """ # Authors: Mainak Jas <mainak@neuro.hut.fi> # # License: BSD (3-clause) import numpy as np...
{ "content_hash": "d3f0d3e5180d61770e74b48513b0f8e5", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 76, "avg_line_length": 31.79646017699115, "alnum_prop": 0.6290008349568605, "repo_name": "andyh616/mne-python", "id": "753728dbe589faaea76314257b9adb1535e7939f", "size": "...
""" This file is part of labella.py. Author: G.J.J. van den Burg License: Apache-2.0 """ from . import vpsc DEFAULT_OPTIONS = { "lineSpacing": 2, "nodeSpacing": 3, "minPos": 0, "maxPos": None, } def last(arr): return arr[-1] def nodeToVariable(node): v = vpsc.Variable(node.targetPos) ...
{ "content_hash": "a419a9df0b0f43e95b5418544b3216d7", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 78, "avg_line_length": 24.925, "alnum_prop": 0.6028084252758275, "repo_name": "GjjvdBurg/labella.py", "id": "b6b36f17c473bc6b517f5bde31f9e25c60799034", "size": "2019", "b...
import sys import struct import pprint from rosetta.common import get_spec, decode, build_standard_msg_parser, pb_parser def build_msg_parsers(spec): decoders = {} endian = spec['endian'] decoders['header'] = build_standard_msg_parser(spec['header']) decoders[100] = build_standard_msg_parser(spe...
{ "content_hash": "e6114e311a75aa2ef10460067a1a89d6", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 91, "avg_line_length": 40.04, "alnum_prop": 0.6209504780933353, "repo_name": "hexforge/pulp_db", "id": "d340b609f95214df201beaf2570c6471224cc6d7", "size": "7007", "binar...
""" File mutex module """ import time import fcntl import os import stat class FileMutex(object): """ This is mutex backed on the filesystem. It's cross thread and cross process. However its limited to the boundaries of a filesystem """ def __init__(self, name, wait=None): """ Cre...
{ "content_hash": "7036c252a0093f4d783e480dfeb3edcb", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 88, "avg_line_length": 25.153846153846153, "alnum_prop": 0.48274355613805153, "repo_name": "fpytloun/alba-asdmanager", "id": "3566a049f2b38c1a26b0f5b8e4e6d1691bbdb4d3", "si...
import requests import lxml.html def scrape(): res = requests.get("http://www.cdc.gov/zika/geo/active-countries.html") dom = lxml.html.fromstring(res.content) li_els = dom.cssselect(".list-block li") countries = [ li.text_content() for li in li_els ] return countries if __name__ == "__main__":...
{ "content_hash": "f155470c70b5ea082145f6b972c1c2be", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 75, "avg_line_length": 29.333333333333332, "alnum_prop": 0.6363636363636364, "repo_name": "BuzzFeedNews/zika-data", "id": "ebb79c2b5f7eb8375db247d695223b9dd24e5aa6", "size"...
import os import sys import sphinx_rtd_theme from pytablereader import __author__, __copyright__, __name__, __version__ sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # n...
{ "content_hash": "c238ba36f7eac03a8b1176a04ae81d06", "timestamp": "", "source": "github", "line_count": 425, "max_line_length": 80, "avg_line_length": 28.011764705882353, "alnum_prop": 0.6830743385132297, "repo_name": "thombashi/pytablereader", "id": "ff506e17e93d66568acd17b07be8d53af38bbdeb", "siz...
"""CHOMSKY is an aid to writing linguistic papers in the style of the great master. It is based on selected phrases taken from actual books and articles written by Noam Chomsky. Upon request, it assembles the phrases in the elegant stylistic patterns that Chomsky is noted for. To generate n sentenc...
{ "content_hash": "d78af22423fc38337cbab9c2797cbcfa", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 101, "avg_line_length": 42.64957264957265, "alnum_prop": 0.7406813627254509, "repo_name": "ActiveState/code", "id": "4797671547e9d1d77521963ee3941bd5220899a5", "size": "49...
import os from datetime import datetime from airflow import DAG from airflow.operators.dummy import DummyOperator DEFAULT_DATE = datetime(2016, 1, 1) args = { 'owner': 'airflow', 'start_date': DEFAULT_DATE, } dag = DAG(dag_id='test_om_failure_callback_dag', default_args=args) def write_data_to_callback(*a...
{ "content_hash": "a9eebae0ad063aa832cfab8c479717d7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 96, "avg_line_length": 23.291666666666668, "alnum_prop": 0.7012522361359571, "repo_name": "dhuang/incubator-airflow", "id": "9ff14bd205194ed040235173e39b8cc7d36a9ff6", "siz...
import sys import urllib import re import urllib2 import json import time import functools import os from collections import namedtuple from datetime import datetime, time, timedelta from flask import Flask, request, session, render_template, jsonify, redirect from flask.ext.sqlalchemy import SQLAlchemy import request...
{ "content_hash": "19a9500c3e8e19275a70d219d9470c7e", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 161, "avg_line_length": 35.29142857142857, "alnum_prop": 0.6224093264248705, "repo_name": "asmoore/nba_gamethread_generator", "id": "3ada73fd70a513da1db8f11a29e67f2b1a1b3f4b...
"""Support for IKEA Tradfri switches.""" from homeassistant.components.switch import SwitchEntity from .base_class import TradfriBaseDevice from .const import CONF_GATEWAY_ID, DEVICES, DOMAIN, KEY_API async def async_setup_entry(hass, config_entry, async_add_entities): """Load Tradfri switches based on a config ...
{ "content_hash": "a3dc8e5ed711fd55ca03bb917cfbda06", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 35.02040816326531, "alnum_prop": 0.6567599067599068, "repo_name": "Danielhiversen/home-assistant", "id": "00e15f1b875a83571a1da2324b9a3d879ab9ec36", ...
import os import sys import expsystem as es class RegionServers: def __init__(self, regionservers): self.servers = regionservers def save(self, config): with open(os.path.join(config, 'regionservers'), 'w') as outfile: for h in self.servers: outfile.write(h + "\n") ...
{ "content_hash": "cbf4b2ce9c3a515093ef3f9208653331", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 97, "avg_line_length": 44.320754716981135, "alnum_prop": 0.5823754789272031, "repo_name": "tatemura/strudel", "id": "ea85f3b5bac04d532fe3b50ee8ba5045723299b6", "size": "236...
import pytest from DelineaDSV import Client, dsv_secret_get_command from test_data.context import SECRET_GET_ARGS_CONTEXT from test_data.http_responses import SECRET_GET_ARGS_RAW_RESPONSE SECRET_GET_ARGS = {"name": "accounts/xsoar"} @pytest.mark.parametrize('command, args, http_response, context', [ (...
{ "content_hash": "f8645cb91261a39524bf44b4f08086f4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 36.96153846153846, "alnum_prop": 0.6826222684703434, "repo_name": "demisto/content", "id": "3c4d0326b054356095941a70862b84e042a7eb91", "size": "961",...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitmarkrpc")) from decimal import Decimal import json import shutil import subprocess import time from bitmarkrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * START_P2P_PORT=11000 START_RPC...
{ "content_hash": "410170d7c0106c9bc3d908f4109b1dfe", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 94, "avg_line_length": 35.083333333333336, "alnum_prop": 0.5948139350752177, "repo_name": "MarkPfennig/gamecredits", "id": "8793ef8789aacfcd13e7aa35af796e942110e3f5", "siz...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatter3d" _path_str = "scatter3d.hoverlabel" _valid_props = { "align", ...
{ "content_hash": "cb4a0119a4e38ad01cea79ddd9db2b1b", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 82, "avg_line_length": 35.49304174950298, "alnum_prop": 0.5529602867865345, "repo_name": "plotly/python-api", "id": "66e7cc8cf3f859994283a037f6a298473ee25464", "size": "17...
"""Certificate chain where the root certificate is not self-signed (or self-issued for that matter).""" import sys sys.path += ['../..'] import gencerts shadow_root = gencerts.create_self_signed_root_certificate('ShadowRoot') # Non-self-signed root certificate. root = gencerts.create_intermediate_certificate('Root'...
{ "content_hash": "268045a3c0a655abeab9ca59a64ee2a2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 29.761904761904763, "alnum_prop": 0.76, "repo_name": "youtube/cobalt_sandbox", "id": "1fd1e48be006d00c109baf9a44c96c17d45b8a76", "size": "810", "bi...
import io import os import sys import pickle import subprocess import unittest from unittest.case import _Outcome from unittest.test.support import (LoggingResult, ResultWithNoStartTestRunStopTestRun) class TestCleanUp(unittest.TestCase): def testCleanUp(self): class ...
{ "content_hash": "63db694b82f1264659371d915981b2f7", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 101, "avg_line_length": 34.03116147308782, "alnum_prop": 0.5848663947390327, "repo_name": "MalloyPower/parsing-python", "id": "ddc498c230cc2863f26fedafa95456b0eff60a63", "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('test_app', '0030_change_field_name'), ] operations = [ migrations.AlterField( model_name='secondobject', name='uuid', field=models.UUIDField(db_index=Tru...
{ "content_hash": "954b3a84661f57145f0d133f2591e109", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 61, "avg_line_length": 22, "alnum_prop": 0.5767045454545454, "repo_name": "David-Wobrock/django-fake-database-backends", "id": "0dc289f2b89d459f97add3d945e782579ae51533", "...
import asyncio import logging from sanic import Blueprint, response from telegram import ( Bot, InlineKeyboardButton, Update, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup) from rasa.core import constants from rasa.core.channels import InputChannel from rasa.core.channels.channel import UserMessage...
{ "content_hash": "3bcf5afd673ca69fcbc6d0deec850056", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 78, "avg_line_length": 38.02857142857143, "alnum_prop": 0.5322314049586777, "repo_name": "RasaHQ/rasa_core", "id": "4e0fc618d60736675de4ba0dce715c42869ce147", "size": "665...
class GuestFS(object): SUPPORT_CLOSE_ON_EXIT = True SUPPORT_RETURN_DICT = True def __init__(self, **kwargs): if not self.SUPPORT_CLOSE_ON_EXIT and 'close_on_exit' in kwargs: raise TypeError('close_on_exit') if not self.SUPPORT_RETURN_DICT and 'python_return_dict' in kwargs: ...
{ "content_hash": "2f05bb2e06135534acc79ba2f33d1b18", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 75, "avg_line_length": 30.06578947368421, "alnum_prop": 0.5115973741794311, "repo_name": "saleemjaveds/https-github.com-openstack-nova", "id": "a3933f1063938a6a621bc60df6567...
from django.template import TemplateDoesNotExist from django.conf import settings from courant.core.pages.models import Page from courant.core.pages.views import render_page class TemplatePagesMiddleware(object): #Heavily adapted from the Django flatpage middleware - http://code.djangoproject.com/browser/d...
{ "content_hash": "802f7d59f8f5bd952ab608bb3d821b3a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 148, "avg_line_length": 44.04, "alnum_prop": 0.6666666666666666, "repo_name": "maxcutler/Courant-News", "id": "5451b80739bab7074862264835b687fea417101a", "size": "1101", ...
import sys import os import re #from string import join, strip import shutil import subprocess import traceback import time from datetime import datetime from optparse import OptionParser, OptionGroup, Option from fnmatch import fnmatch import glob import getpass import json from .utils import LogFile, colorprinter fro...
{ "content_hash": "6307b049ca654b9a2a0bd64ee9857989", "timestamp": "", "source": "github", "line_count": 880, "max_line_length": 574, "avg_line_length": 52.69886363636363, "alnum_prop": 0.6399568733153639, "repo_name": "Kortemme-Lab/klab", "id": "170b60c6b1d4ff22dfa873984f00371e86a930ba", "size": "4...
KRB5 DEFINITIONS ::= BEGIN -- needed to do the Right Thing with pepsy; this isn't a valid ASN.1 -- token, however. SECTIONS encode decode none -- the order of stuff in this file matches the order in the draft RFC Realm ::= GeneralString HostAddress ::= SEQUENCE { addr-type[0] INTEGER, address[1] OCTET STRIN...
{ "content_hash": "57963883e22b126a16c68abe067e39d8", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 78, "avg_line_length": 26.12807881773399, "alnum_prop": 0.6561085972850679, "repo_name": "drankye/kerb-token", "id": "e455fd9a19233784d82bbc46167c728a0306a87a", "size": "1...
from c7n_azure.resources.arm import ArmResourceManager from c7n_azure.provider import resources @resources.register('datafactory') class DataFactory(ArmResourceManager): """Data Factory Resource :example: This policy will find all Data Factories with 10 or more failures in pipeline runs over the las...
{ "content_hash": "b4145493c133d7c1f4e2d8d785277699", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 81, "avg_line_length": 27.974358974358974, "alnum_prop": 0.5967002749770852, "repo_name": "FireballDWF/cloud-custodian", "id": "5892c9100915c923964381fc39b05630470c8327", "...
import json class CommandHandler: def __init__(self, request): assert isinstance(request, dict) self._request=request def execute_command(self): _command=self._request.get('command', None) if _command is None: return "invalid request" if _command == 'list_files': ...
{ "content_hash": "63a4105ad8f00d5e4c1d96e27d135cba", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 85, "avg_line_length": 25.74137931034483, "alnum_prop": 0.6068318821165438, "repo_name": "brython-dev/brython-in-the-classroom", "id": "878372c57ef27863cd0c7d54df6158ade9fb33...
import sys from django.conf import settings settings.configure( DEBUG=True, SECRET_KEY='hellobbbbbbbbbbbb', ROOT_URLCONF=__name__, MIDDLEWARE_CLASSES=( 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf...
{ "content_hash": "d6dc6ca63c2ae63cecd42386e2d6b0d3", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 65, "avg_line_length": 21.233333333333334, "alnum_prop": 0.7048665620094191, "repo_name": "JuneDeng2014/working_notes", "id": "4979aa87ee94c7489e846ff15502541d93ffcbf4", "s...
import logging import os import re import glob import h5py import numpy as np import scipy.misc as misc from datetime import datetime, timedelta from netCDF4 import Dataset from shapely.geometry import Point import pandas as pd import src.config.filepaths_cems as fp import src.features.fre_to_tpm.viirs.ftt_utils as u...
{ "content_hash": "fae417b7a8ff8402ce1f591ef778c8ab", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 119, "avg_line_length": 35.20132743362832, "alnum_prop": 0.6034818678901389, "repo_name": "dabillox/kcl-fire-aot", "id": "91f86c9d4942ea20ec66bdf0819fe66172c02059", "size"...
"""Pretend to be /usr/bin/id3v2 from id3lib, sort of.""" import sys import codecs import mimetypes from optparse import SUPPRESS_HELP import mutagen import mutagen.id3 from mutagen.id3 import Encoding, PictureType from mutagen._senf import fsnative, print_, argv, fsn2text, fsn2bytes, \ bytes2fsn from mutagen._co...
{ "content_hash": "58870c70707d206119f01dac2fcb8261", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 79, "avg_line_length": 37.266958424507656, "alnum_prop": 0.5151782044507075, "repo_name": "jules185/IoT_Hackathon", "id": "8d21c13efc9c42b102614c89a5d4ab8582c56e1f", "size...
import json, re def parse(df, data, utc): # df is a dict with the following keys: # [u'feedurl', u'feedname', u'bssid', u'format', u'feedurl2', u'keyreq', u'parsername', u'rid'] # parse json data try: data_json = json.loads(data) except ValueError: print(utc + ' ' + df[...
{ "content_hash": "957ec4d7b54bb4e646e933bba9de12bd", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 111, "avg_line_length": 37.607142857142854, "alnum_prop": 0.5698005698005698, "repo_name": "serialc/BSR_parsers", "id": "fe62d72f27b0a94b044d6fe28f4267dd80654a1d", "size": ...
import cherrypy import os, os.path class HelloWorld(object): @cherrypy.expose def index(self): #replace the return string below with your templating engine of choice return """<html> <head> <title>CherryPy static content example</title> <link rel="stylesheet" type="text/css"...
{ "content_hash": "20a775953251a4a3331cac40b51c0820", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 93, "avg_line_length": 25.95, "alnum_prop": 0.6647398843930635, "repo_name": "Decker108/cherrypy-static-content-example", "id": "39763285b369a0254caf53ef4544c60f8fd533eb", ...
from distutils.core import setup setup( name = 'django-markdown-newsletter', packages = ['django_markdown_newsletter'], # this must be the same as the name above version = '0.7', description = 'Easy to use Django markdown newslette', author = 'Samy Melaine', author_email = 'melaine.samy@gmail.com', url = ...
{ "content_hash": "353c8fb97372a93f37ed6fd834b7d00b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 116, "avg_line_length": 39.94444444444444, "alnum_prop": 0.7009735744089013, "repo_name": "SamyMe/django-markdown-newsletter", "id": "348c89674ceb859c7e80e0829c3bf5ee81522196...
import os import ddt import mock from oslo_concurrency import processutils from oslo_config import cfg from manila import exception from manila.share import configuration from manila.share.drivers import service_instance as generic_service_instance from manila.share.drivers.windows import service_instance from manila...
{ "content_hash": "d1760fa847a36452e1284d84453377a0", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 79, "avg_line_length": 44.73863636363637, "alnum_prop": 0.601981203962408, "repo_name": "vponomaryov/manila", "id": "eca61f0e05f4c65967be235918604080a78cf1a1", "size": "16...
import sqlite3 as lite con = lite.connect(r"./die_zeit.db") with con: cur = con.cursor() cur.execute("CREATE TABLE Articles(id INT, uuid TEXT, title TEXT, releaseDate DATETIME, subtitle TEXT, uri TEXT, href TEXT)")
{ "content_hash": "d5475bbd7098b5ecc2567aa7a3a0da69", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 129, "avg_line_length": 14.625, "alnum_prop": 0.6794871794871795, "repo_name": "mitchellduffy/topzeit", "id": "ef8d2af8c9ebe66e5b99129362e1238ab1bc98f9", "size": "234", "...
import appleseed as asr from ..logger import get_logger logger = get_logger() class BaseRendererController(asr.IRendererController): def __init__(self): super(BaseRendererController, self).__init__() self._status = asr.IRenderControllerStatus.ContinueRendering def set_status(self, status): ...
{ "content_hash": "687b16705d31166dba95d44a002beddf", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 99, "avg_line_length": 25.677419354838708, "alnum_prop": 0.6526381909547738, "repo_name": "appleseedhq/blenderseed", "id": "455c5d481f9d0c84f927ab3b38ed9e8be169bde2", "size...
import unittest from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys class TypingTests(unittest.TestCase): def testShouldFireKeyPressEvents(self): self._loadPage("javascriptPage") keyReporter = self.driver.find_element(by=By.ID, value="keyReporter") ...
{ "content_hash": "95ad11519de12a17445dd65adeaa5cd1", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 123, "avg_line_length": 49.70175438596491, "alnum_prop": 0.659724673490999, "repo_name": "alb-i986/selenium", "id": "ffd2a267fc2845fe4e4a2f8e12123e696c9ab68a", "size": "14...
from ceilometer import agent from ceilometer.compute.virt import inspector as virt_inspector from ceilometer.openstack.common import log LOG = log.getLogger(__name__) class AgentManager(agent.AgentManager): def __init__(self): super(AgentManager, self).__init__('compute', ['local_instances']) se...
{ "content_hash": "68eacc586b3a7c9967b6c1461e24f92c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 74, "avg_line_length": 28.0625, "alnum_prop": 0.7104677060133631, "repo_name": "m1093782566/openstack_org_ceilometer", "id": "bd28bdda2c83f928548c43c82ba3dd49b89b0bd2", "si...
import esn import imp import signals import random SEED = 0 PATTERN_LENGTH = 1 PATTERN_PAUSE = 0.5 OUTPUT_PULSE_AMPLITUDE = 0.9 OUTPUT_PULSE_LENGTH = 0.1 WASHOUT_TIME = 10.0 TRAIN_TIME = 100.0 VARIABLE_MAGNITUDE = True FALSE_PATTERN = True CONNECTIVITY = 0.5 TEACHER_FORCING = False USE_ORTHONORMAL_MATRIX = True TRAINI...
{ "content_hash": "ba99693b5780d1ea6ecbf6021b8d1144", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 75, "avg_line_length": 33.18604651162791, "alnum_prop": 0.5351553375379584, "repo_name": "mode89/esn", "id": "d4a555b9f871c9e88e24bbc3d4e5b5d0ecfed613", "size": "4281", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Log_Errors', fields=[ ('id', models.AutoField(verbose_name='ID', serial...
{ "content_hash": "37cf9cdea799b74f3f81629b8e1a7c96", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 114, "avg_line_length": 27.333333333333332, "alnum_prop": 0.5557491289198606, "repo_name": "erickdom/restAndroid", "id": "5743d148ebf0b78adc5eb6bbe886c5dcd5bfb8ad", "size":...
"""Test the wallet.""" from decimal import Decimal import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_array_result, assert_equal, assert_fee_amount, assert_raises_rpc_error, connect_nodes_bi, sync_blocks, sync_mempools, wa...
{ "content_hash": "628495b091bda4e98bdb00d493243469", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 193, "avg_line_length": 49.21516393442623, "alnum_prop": 0.6257234458924928, "repo_name": "ericshawlinux/bitcoin", "id": "8bbff7f7eff81edafb07d584a05be2926c5bef77", "size"...
import os import subprocess import sys print 'Build Config:' print ' Host:win7 x86' print ' Branch:develop' print ' Target:win32' print ' "%VS110COMNTOOLS%..\IDE\devenv.com" "build\cocos2d-win32.vc2013.sln" /Build "Debug|Win32"' if(os.path.exists('build/cocos2d-win32.vc2013.sln') == False): node_name = ...
{ "content_hash": "f4577b20863c17474e5c6023e64a6c4b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 126, "avg_line_length": 34.791666666666664, "alnum_prop": 0.6682634730538922, "repo_name": "dxmgame/dxm-cocos", "id": "87f8674032202cf3061af386425ce19d13ff57dd", "size": "8...
import argparse import errno import logging import os import platform import signal import sys from collections import OrderedDict from contextlib import closing from distutils.version import StrictVersion from functools import partial from gettext import gettext from itertools import chain from pathlib import Path fro...
{ "content_hash": "4ac346482a2892721c6bd4f66681e1c4", "timestamp": "", "source": "github", "line_count": 1112, "max_line_length": 122, "avg_line_length": 34.02967625899281, "alnum_prop": 0.621283792711609, "repo_name": "melmorabity/streamlink", "id": "07b88bc36babff3a11858ef34a69a78ca7bd4caf", "size...
import os import json import random import string import logging PROJ_DIR = os.path.join(os.path.dirname(__file__), "..", "..") PROJ_DIR = os.path.normpath(PROJ_DIR) CONFIG_DIR = os.path.join(PROJ_DIR, "etc") BIN_DIR = os.path.join(PROJ_DIR, "bin") TESTFILE_DIR = os.path.join(PROJ_DIR, "tmp", "test_files") SUPPORTED_...
{ "content_hash": "34e912f6199ab4b9f66d896f226d8b8e", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 79, "avg_line_length": 32.10077519379845, "alnum_prop": 0.6496015455204057, "repo_name": "mkollaro/destroystack", "id": "aec384aadb1a3f6b063f054afda8b5db0df44c6e", "size":...
import os cw = os.getcwd() os.chdir("./returned_exams") import re, sys, string, codecs, zipfile import stat import md5 import hashlib from pyparsing import Word, alphanums, Literal, LineEnd, LineStart, SkipTo, Optional filesBySize = {} def walker(arg, dirname, fnames): d = os.getcwd() os.chdir(dirname) t...
{ "content_hash": "533de65bde5d415cb7dabfd2d528923a", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 84, "avg_line_length": 25.820987654320987, "alnum_prop": 0.5723165192445613, "repo_name": "BjornFJohansson/molbio-test-generator", "id": "feeb28b865af50961a993e743ef9854efc6...
import warnings from webob.compat import ( escape, string_types, text_, text_type, ) from webob.headers import _trans_key def html_escape(s): """HTML-escape a string or object This converts any non-string objects passed into it to strings (actually, using ``unicode()``). All values ...
{ "content_hash": "80510061fd855cac77d97b92b11a6004", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 28.488235294117647, "alnum_prop": 0.6188313029114185, "repo_name": "stefanv/aandete", "id": "b7db88c5bb5768176b1733c2be1eb7dc4878a0e5", "size": "484...
import sys from lxml import etree sys.path.append('./lib') from pypeer.ConfigDictionary import ConfigDictionary from pypeer.RouteData import RouteData from pypeer.BgpData import BgpData from pypeer.Exchange import Exchange from pypeer.PeeringDBClient import PeeringDBClient import unittest # Can run with -a '!interne...
{ "content_hash": "56d3133a5c442a8e20d26c3966465e3f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 119, "avg_line_length": 40.75, "alnum_prop": 0.6768916155419223, "repo_name": "job/pypeer", "id": "9b47bba17bed06c8d0dcf126feb5157e0ec8a624", "size": "2957", "binary": fa...
"""Sensor for Last.fm account status.""" import logging import re import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_API_KEY, ATTR_ATTRIBUTION import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity _L...
{ "content_hash": "80b09c5093d1ad6ce63709a6f9ad4f2b", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 83, "avg_line_length": 28.603448275862068, "alnum_prop": 0.6057866184448463, "repo_name": "Cinntax/home-assistant", "id": "736792aefd8123c568983bd4d356a6e8242cac28", "size...
"""Utilities for AFF4 imaging. These are mostly high level utilities used by the command line imager. """
{ "content_hash": "154c2ab4bcff2275cd5a880eeaeb3097", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 70, "avg_line_length": 26.75, "alnum_prop": 0.7570093457943925, "repo_name": "blschatz/aff4", "id": "79b04200163c8b1ebfcf30dbea084e60d7b2e597", "size": "702", "binary": fa...
import os from datetime import datetime import time import tempfile from stratuslab.CloudConnectorFactory import CloudConnectorFactory from stratuslab.Util import sshCmd from stratuslab.Util import sshCmdWithOutput from stratuslab.Util import waitUntilPingOrTimeout from stratuslab.Util import getHostnameFromUri import...
{ "content_hash": "76754d472a14c211ac6a4743162337a7", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 113, "avg_line_length": 33.96666666666667, "alnum_prop": 0.6086978978358556, "repo_name": "StratusLab/client", "id": "d23f35157243a6841260edcdc84af12f66fa7a66", "size": "2...
from pystruct.datasets import load_scene, load_letters, load_snakes def test_dataset_loading(): # test that we can read the datasets. load_scene() load_letters() load_snakes()
{ "content_hash": "f80f5c4349607a56384de81861689d63", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 24.25, "alnum_prop": 0.6958762886597938, "repo_name": "massmutual/pystruct", "id": "b6f054c5707a854326c3c94b8ba32da3e4f35c15", "size": "194", "binar...
import unittest from cStringIO import StringIO from rdflib.graph import Graph from rdflib.store import Store from rdflib import plugin, Namespace, RDF, URIRef from FuXi.Rete.Network import ReteNetwork from FuXi.Rete.RuleStore import N3RuleStore, SetupRuleStore from FuXi.Rete.Util import ( # renderNetwork, gener...
{ "content_hash": "865add0912efef2cc7a883bb74ba6877", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 33.2803738317757, "alnum_prop": 0.6273518674529627, "repo_name": "mpetyx/pyrif", "id": "dbbd0b6c7dd762060e52107b00c9423605cb0381", "size": "3600", ...
"""PnP Window Mixing. Plug and Play nottifications are sent only to Window devices (devices that have a window handle. So regardless of the GUI toolkit used, the Mixin' classes expose here can be used. """ from __future__ import absolute_import from __future__ import print_function import ctypes from cty...
{ "content_hash": "f329c78000f3e160e5368fc66eb02a17", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 80, "avg_line_length": 38.790849673202615, "alnum_prop": 0.630497051390059, "repo_name": "rene-aguirre/pywinusb", "id": "89bb45017d11c7f97046621c2bedc9eeb935b98c", "size":...
import os from nose.plugins.attrib import attr from indra.sources import reach from indra.sources.reach.processor import ReachProcessor from indra.util import unicode_strs from indra.statements import IncreaseAmount, DecreaseAmount, \ Dephosphorylation, Complex, Phosphorylation, Translocation # Change this list to...
{ "content_hash": "630fdcd669ced88b6414391fb146cbf1", "timestamp": "", "source": "github", "line_count": 532, "max_line_length": 78, "avg_line_length": 35.05263157894737, "alnum_prop": 0.6063384813384813, "repo_name": "bgyori/indra", "id": "05e6d3f8b0788e5283bf470195c478e09615a54f", "size": "18648",...
from __future__ import division import numpy as np import warnings from warnings import warn from sklearn.utils.fixes import euler_gamma from scipy.sparse import issparse import numbers from ..externals import six from ..tree import ExtraTreeRegressor from ..utils import check_random_state, check_array from ..utils....
{ "content_hash": "2c137e82d9d346007cfe6fd718f2abc0", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 79, "avg_line_length": 40.05726872246696, "alnum_prop": 0.5961728802375453, "repo_name": "vortex-ape/scikit-learn", "id": "72d1d206f478bac24f1fe13910951ced6a210905", "size...
"""Support for stiebel_eltron climate platform.""" import logging from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( STATE_AUTO, STATE_ECO, STATE_MANUAL, SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE) from homeassistant.const import ( ATTR_T...
{ "content_hash": "6658587ca4fe957e0b40e19f7a9af0e6", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 78, "avg_line_length": 32.97986577181208, "alnum_prop": 0.6294261294261294, "repo_name": "aequitas/home-assistant", "id": "fc6038d95ad6ca1462d9aba790d5f15132e80986", "size...
from PySide import QtCore, QtGui class Ui_SimulationEditorWidget(object): def setupUi(self, SimulationEditorWidget): SimulationEditorWidget.setObjectName("SimulationEditorWidget") SimulationEditorWidget.resize(400, 300) self.formLayout = QtGui.QFormLayout(SimulationEditorWidget) sel...
{ "content_hash": "a342d952af3052c9fb32bd4e4ecbcf98", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 160, "avg_line_length": 57.1578947368421, "alnum_prop": 0.787292817679558, "repo_name": "alan-wu/neon", "id": "ef19884796a03b2e5af264f36d1ab03ee79be863", "size": "1362", ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' short_description: NetApp ONTAP Create/Delete portset author: NetApp Ans...
{ "content_hash": "1003471d18ddb57328f606c7e786a2a7", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 113, "avg_line_length": 37.13970588235294, "alnum_prop": 0.5911700653335973, "repo_name": "SergeyCherepanov/ansible", "id": "42b35cac27e07bce38feac2fd3f0d78d80ab1c14", "si...
import logging import logging.handlers import os import six import subprocess import sys import yaml log = logging.getLogger('fuel_notify') log_handler = logging.handlers.SysLogHandler(address='/dev/log') log_handler.setFormatter(logging.Formatter('%(name)s: %(message)s')) log.addHandler(log_handler) log.setLevel(logg...
{ "content_hash": "cde700439199e1811ff8272dbadc7b28", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 79, "avg_line_length": 29.40740740740741, "alnum_prop": 0.6205919395465995, "repo_name": "eayunstack/fuel-library", "id": "bce01472736f975d78843e186f54be5e20553198", "size...
import copy import mock import uuid from oslo_config import cfg from st2tests.api import FunctionalTest from st2common.constants.keyvalue import ALL_SCOPE, FULL_SYSTEM_SCOPE, FULL_USER_SCOPE from st2common.persistence.auth import User from st2common.models.db.auth import UserDB from st2common.rbac.backends.noop impor...
{ "content_hash": "4323d9249d2e451b1d910458af9d8a8f", "timestamp": "", "source": "github", "line_count": 781, "max_line_length": 99, "avg_line_length": 40.820742637644045, "alnum_prop": 0.6060349424422069, "repo_name": "StackStorm/st2", "id": "5eec7e081e206c5dab272f9bf2f2b26173835a4b", "size": "3250...
import numpy as np import pysam import random import gzip import pdb from keras.utils.np_utils import to_categorical DNA_COMPLEMENT = dict([('A','T'),('T','A'),('G','C'),('C','G'),('N','N')]) ONE_HOT = dict([('A',0),('C',1),('G',2),('T',3)]) #make_complement = lambda seq: ''.join([DNA_COMPLEMENT[s] for s in seq]) #m...
{ "content_hash": "e429e8f68a11f2b7f095c223a8675c0b", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 98, "avg_line_length": 29.639269406392692, "alnum_prop": 0.5467570482206131, "repo_name": "rajanil/OrbWeaver", "id": "0a4117f3325c100ff1f323c50ce77d20a5d0d4b1", "size": "6...
import typing class Hasher(typing.Protocol): """A hashing algorithm, e.g. :func:`hashlib.sha256`.""" def update(self, blob: bytes): ... def digest(self) -> bytes: ... Generic = typing.TypeVar("Generic") class HasherGeneric(typing.Protocol[Generic]): """A hashing algorithm, e.g. :...
{ "content_hash": "f43a2f71ca5e3ca71f00920e1b9cdbe3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 67, "avg_line_length": 22.151515151515152, "alnum_prop": 0.5950752393980848, "repo_name": "ruchee/vimrc", "id": "784da609875008dbe462d5d7784b373936a47790", "size": "768", ...
from datetime import datetime, timedelta import urlparse from openid import oidutil from flask import g, current_app, redirect, request, flash, render_template, url_for, Markup, escape, abort from flask.ext.openid import OpenID from coaster.utils import getbool from coaster.views import get_next_url, load_model from ba...
{ "content_hash": "e4e11161b2e2a9b0a14a893dc4fd2c05", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 145, "avg_line_length": 44.852, "alnum_prop": 0.6561134397574244, "repo_name": "sindhus/lastuser", "id": "cb6a9612c81b975a7e87ee0ee35a23f32d219f37", "size": "11240", "bi...
from typing import Dict from reggen.lib import check_keys, check_str, check_int REQUIRED_FIELDS = { 'name': ['s', "name of the member of the enum"], 'desc': ['t', "description when field has this value"], 'value': ['d', "value of this member of the enum"] } class EnumEntry: def __init__(self, where:...
{ "content_hash": "4d9359909ca7999730d3dd99359cd54f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 36.774193548387096, "alnum_prop": 0.525438596491228, "repo_name": "lowRISC/opentitan", "id": "2eb2636f84320042cc0980135a13a693a1821b38", "size": "128...
""" chemdataextractor.text.normalize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tools for normalizing text. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from abc import ABCMeta, abstractmethod import re import unicodeda...
{ "content_hash": "581fd92b686a93103f5df8c4d2378cc5", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 119, "avg_line_length": 41.927083333333336, "alnum_prop": 0.626335403726708, "repo_name": "mcs07/ChemDataExtractor", "id": "1d3131144bff4d48a30ba08276e27b25ec7640a6", "siz...
class UnsafeSubstitutionError(Exception): pass
{ "content_hash": "29f5e2534e735990d36bc6231ef37a3c", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 41, "avg_line_length": 25.5, "alnum_prop": 0.803921568627451, "repo_name": "darrenpmeyer/logging-formatter-anticrlf", "id": "ca1e27823ebf3ebb14369bc1807cf426259d13a1", "size...
""" Stratified permutation tests. """ from __future__ import division, print_function, absolute_import import numpy as np from .utils import get_prng, permute_within_groups def corrcoef(x, y, group): """ Calculates sum of Spearman correlations between x and y, computed separately in each group. Pa...
{ "content_hash": "6907cd00e219334085bf44b856ab180b", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 89, "avg_line_length": 31.61875, "alnum_prop": 0.610990314291362, "repo_name": "pbstark/permute", "id": "5173fa452a015cb1acfec76ea80fe57359dbcc87", "size": "5084", "bina...
"""Utility functions that support testing. All functions that can be commonly used by various tests. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import flatbuffers from tensorflow.lite.python import schema_py_generated as schema_fb TFLITE_SCHEMA_V...
{ "content_hash": "860c863ea04dc77d2f3b89ba5b30d018", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 36.78688524590164, "alnum_prop": 0.7842023172905526, "repo_name": "petewarden/tensorflow", "id": "f2d0e29f6700420cd23a069de9b59745e34f726e", "size":...
''' Command line option definitions ''' def add_params(subparsers): # list list_parser = subparsers.add_parser( 'list', help='List VMware objects on your VMware server' ) list_parser.add_argument( '--type', required=True, help='Object type, e.g. Network, Virtua...
{ "content_hash": "fa30b52caafba9c2da3506f181015845", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 61, "avg_line_length": 22, "alnum_prop": 0.5240334378265413, "repo_name": "mvk/ezmomi", "id": "dfd2edc04b811f503897414817829aab96acdc94", "size": "1914", "binary": false,...
"""Basic sanity tests for the GTalk extension. This module contains the basic set of sanity tests run on the GTalk extension. """ import logging import sys import time import traceback import urllib2 import os import gtalk_base_test import pyauto_gtalk # must preceed pyauto import pyauto class BasicTest(gtalk_bas...
{ "content_hash": "aa1c5fa978848c423b09ac8f9769e5f6", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 80, "avg_line_length": 38.237785016286644, "alnum_prop": 0.6585739841553795, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "4dc1f71b9efa8f245c0d03c3d79f6c13d96c8cce",...
""" Example "Arcade" library code. This example shows the drawing primitives and how they are used. It does not assume the programmer knows how to define functions or classes yet. API documentation for the draw commands can be found here: https://pythonhosted.org/arcade/arcade.html#module-arcade.draw_commands A vide...
{ "content_hash": "b6897e3c6f919f2c596cc493704e7f22", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 79, "avg_line_length": 35.92993630573248, "alnum_prop": 0.6489984045382025, "repo_name": "mikemhenry/arcade", "id": "be2f6061924fe07513efb8e943cf446e4b49d97c", "size": "56...
"""This module contains constants used by cbuildbot and related code.""" import os def _FindSourceRoot(): """Try and find the root check out of the chromiumos tree""" source_root = path = os.path.realpath(os.path.join( os.path.abspath(__file__), '..', '..', '..')) while True: if os.path.isdir(os.path....
{ "content_hash": "9232bb33630d4742f3eb4a20632e0d72", "timestamp": "", "source": "github", "line_count": 487, "max_line_length": 80, "avg_line_length": 32.993839835728956, "alnum_prop": 0.7074309185959672, "repo_name": "chadversary/chromiumos.chromite", "id": "a08cb0b6ea3d5453ad88ab2332785be6a55d3813"...
""" Records ======= """ # pylint:disable=too-many-arguments,too-many-instance-attributes,too-many-locals import ipaddress # pylint:disable=R0903 from abc import ABCMeta from typing import Dict, List, Optional, Type, Union from geoip2.mixins import SimpleEquality class Record(SimpleEquality, metaclass=ABCMeta): ...
{ "content_hash": "9050f93927373577034bfcf6210f938d", "timestamp": "", "source": "github", "line_count": 907, "max_line_length": 88, "avg_line_length": 28.167585446527013, "alnum_prop": 0.6445514325974636, "repo_name": "maxmind/GeoIP2-python", "id": "6ab8e30181bbf3490eb085b4a145a5063646990c", "size"...
import inspect import json import re import sys import xml.dom.minidom import tornado import tornado.ioloop import tornado.web import tornado.wsgi from pyconvert.pyconv import (convert2JSON, convert2XML, convertJSON2OBJ, convertXML2OBJ) from QUANTAXIS.QAWebServer.util import (APPLICATION_...
{ "content_hash": "8aaebdd283802123b79afacc3486c81f", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 133, "avg_line_length": 31.476744186046513, "alnum_prop": 0.6346509050609531, "repo_name": "yutiansut/QUANTAXIS", "id": "d37d726751b02add9d0479a7a5894f3762f71dab", "size": ...
from __future__ import absolute_import from datetime import timedelta from django.utils import timezone from django.test import RequestFactory from exam import fixture from sentry.middleware.user import UserActiveMiddleware from sentry.testutils import TestCase class UserActiveMiddlewareTest(TestCase): middlewa...
{ "content_hash": "eefbfaf7e6943814ba4fe19fe3998a11", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 30.4, "alnum_prop": 0.6885964912280702, "repo_name": "beeftornado/sentry", "id": "12bc55397ea74c225e7557640c7d9d7b2ff45e45", "size": "912", "binary...
from trakt.mapper.core.base import Mapper class SummaryMapper(Mapper): @classmethod def movies(cls, client, items, **kwargs): if not items: return None return [cls.movie(client, item, **kwargs) for item in items] @classmethod def movie(cls, client, item, **kwargs): ...
{ "content_hash": "043d632f44bb22ef5167af78ae5f55bc", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 77, "avg_line_length": 23.129770992366414, "alnum_prop": 0.5283828382838284, "repo_name": "shad7/trakt.py", "id": "131b77439b89d039015ad02ddb91645f0c85c526", "size": "3030...
""" stackoverflow.com/questions/3173320/text-progress-bar-in-the-console """ import sys # Print iterations progress def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100): """ Call in a loop to create terminal progress bar @params: iteration - Required : current i...
{ "content_hash": "e1b602d91c028b3ac7a7580eed0534cb", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 87, "avg_line_length": 40.03703703703704, "alnum_prop": 0.6170212765957447, "repo_name": "indiependente/send_mail", "id": "1a13cb8c2c1ee89d9d6159cac44b21bedfee71fb", "size"...
"""Kraken - objects.Constraints.OrientationConstraint module. Classes: OrientationConstraint - Orientation Constraint. """ from constraint import Constraint from kraken.core.maths.vec3 import Vec3 from kraken.core.maths.quat import Quat class OrientationConstraint(Constraint): """Orientation Constraint.""" ...
{ "content_hash": "2b5750527895c2879904e646ece6032f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 61, "avg_line_length": 23.88235294117647, "alnum_prop": 0.7536945812807881, "repo_name": "goshow-jp/Kraken", "id": "9c02ecb99e7d7daad79b980572bac6ab6d3ae833", "size": "406"...
from django.test import TestCase, Client from django.test.utils import override_settings # APP Models from seshdash.models import Sesh_User, Sesh_Alert, Alert_Rule, Sesh_Site,VRM_Account, BoM_Data_Point as Data_Point, Daily_Data_Point # django Time related from django.utils import timezone from django.contrib.auth.mo...
{ "content_hash": "f831847bc70c84c0e0237e241681ed1b", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 132, "avg_line_length": 36.75714285714286, "alnum_prop": 0.6000777302759425, "repo_name": "GreatLakesEnergy/sesh-dash-beta", "id": "5b7e26d98496b6ae23142c581bc962f6a84bf07f"...
import re """ Guidelines for writing new hacking checks - Use only for Heat specific tests. OpenStack general tests should be submitted to the common 'hacking' module. - Pick numbers in the range H3xx. Find the current test with the highest allocated number and then pick the next value. - Keep the test method co...
{ "content_hash": "42b20496bdcf1b152f829fe6e7bddcfe", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 70, "avg_line_length": 27.436363636363637, "alnum_prop": 0.6832339297548045, "repo_name": "steveb/heat", "id": "dade30bb25a44e1bebac2349d253b7118b3201f3", "size": "2122", ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from past.utils import old_div from future.moves.urllib.parse import urlencode import logging from flexget import plugin from flexget.entry import Entry from flexget.event impo...
{ "content_hash": "6b405d8c878cabb10efb56159c0c81ee", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 115, "avg_line_length": 35.0859375, "alnum_prop": 0.5686929414384324, "repo_name": "qvazzler/Flexget", "id": "ef644b7654bfeca4587c113f27302a382a1b8885", "size": "4491", ...
from __future__ import absolute_import import os import shutil import nox LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) @nox.session(python="3.7") def lint(session): """Run linters. Returns a failure if the linters find linting errors or sufficiently serious code quality iss...
{ "content_hash": "cbe5696db6d5ee1675d1e6c9fd195c6e", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 84, "avg_line_length": 30.069444444444443, "alnum_prop": 0.6127020785219399, "repo_name": "tswast/google-cloud-python", "id": "95fd3d91a09533db09ecfd11cba00f3c32f9b6ad", "...
import ShtikerPage from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toon import NPCFriendPanel from toontown.toonbase import TTLocalizer class NPCFriendPage(ShtikerPage.ShtikerPage): def __init__(self): ShtikerPage.ShtikerPage.__init__(self) def load(self): s...
{ "content_hash": "8d618a82c612d7895ca0deb84c687c35", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 146, "avg_line_length": 31.3125, "alnum_prop": 0.7015968063872255, "repo_name": "Spiderlover/Toontown", "id": "f48db77f2306294d6ea136fc5574b0984c4d1f36", "size": "1002", ...
import os import unittest import random from test import test_support thread = test_support.import_module('thread') import time import sys import weakref from test import lock_tests NUMTASKS = 10 NUMTRIPS = 3 _print_mutex = thread.allocate_lock() def verbose_print(arg): """Helper function for printing out debu...
{ "content_hash": "5857ecd7e62b215681b731f389457a27", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 83, "avg_line_length": 31.35123966942149, "alnum_prop": 0.5545011203374193, "repo_name": "fkolacek/FIT-VUT", "id": "544e70d2fdf7ab3a599def978979628c01c8530f", "size": "758...
from django.core.exceptions import PermissionDenied from django.core.paginator import Paginator from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import gettext as _ from wagtail.admin import mess...
{ "content_hash": "59ec0ca48ab4bad57074985fb67b061e", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 147, "avg_line_length": 39.69318181818182, "alnum_prop": 0.6713426853707415, "repo_name": "mixxorz/wagtail", "id": "05d40fa80b3d482d2237da7646b3feb6cfd9d922", "size": "3493...
"""OnticProperty unit tests.""" from copy import copy, deepcopy from ontic import OnticProperty from ontic.property import perfect_property, validate_property from ontic.validation_exception import ValidationException from test.utils import BaseTestCase class OnticPropertyTest(BaseTestCase): """OnticProperty tes...
{ "content_hash": "0d04eeeb7de14abd6956893dbcc263b3", "timestamp": "", "source": "github", "line_count": 421, "max_line_length": 124, "avg_line_length": 35.7624703087886, "alnum_prop": 0.5454968119022316, "repo_name": "neoinsanity/ontic", "id": "8b3270088feef054f521b5e8f5eaf087d437605a", "size": "15...
from .. import factory from flask import Blueprint, render_template bp = Blueprint('bp', __name__) from .extensions import assets, babel from . import dashboard def create_app(name=None, settings=None): app = factory.create_app(name or __name__, settings=settings) babel.init_app(app) app.register_blue...
{ "content_hash": "36948258519fa8205d4c9bd8203b9bca", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 21.6875, "alnum_prop": 0.7060518731988472, "repo_name": "buddha314/pathfinder-game-manager", "id": "b89273e146ef942fcc8d72b556ddbb83343a5dcd", "size"...
import warnings from .util import configobj_walker as new_configobj_walker if False: # MYPY from typing import Any # NOQA def configobj_walker(cfg): # type: (Any) -> Any warnings.warn('configobj_walker has moved to ruamel.yaml.util, please update your code') return new_configobj_walker(cfg)
{ "content_hash": "55f515c77a54852e06cbf3c99fb204cf", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 92, "avg_line_length": 26.166666666666668, "alnum_prop": 0.7197452229299363, "repo_name": "rochacbruno/dynaconf", "id": "711efbc2dc16ce60fefe437df57dba8719b3502f", "size": ...
from api import database from api.database.table import Table, TableTypes def message_count_get(server_id): '''Get the current message count.''' database.init() table_message_count = Table('user_messages_{}'.format(server_id), TableTypes.pGlobal) return table_message_count.getLatestID() # Log message...
{ "content_hash": "b5378d76a3eb80d42709d472d4c16f82", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 38.578947368421055, "alnum_prop": 0.6589358799454298, "repo_name": "dhinakg/BitSTAR", "id": "24379a48a8357c2073b6ed754a6153fa478a243a", "size": "1379...
class DownloadimagePipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "bf37f848832d37f77b67d8b103078cf8", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 33, "alnum_prop": 0.7070707070707071, "repo_name": "knarfeh/DoubanPhotoAlbumCrawl", "id": "fe5eacf8425f0bb42b605d6f5ee682728e179212", "size": "257", ...
from model.group import Group class GroupHelper: def __init__(self,app): self.app = app def open_groups_page(self): wd = self.app.wd if not (wd.current_url.endswith("/groups.php") and len(wd.find_elements_by_name("new")) > 0): wd.find_element_by_link_text("groups").click() ...
{ "content_hash": "5819b4ebc1e35ce1bb0b85877e1e5de5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 101, "avg_line_length": 33.6219512195122, "alnum_prop": 0.598113891911498, "repo_name": "Manolaru/Python_train", "id": "8e3afc7f0be18d6b43b9b0e0090b6f09d9f34a15", "size": "...
from django.test import TestCase from django.core.exceptions import ObjectDoesNotExist from contacts.models import Office365Connection import contacts.o365service # Create your tests here. api_endpoint = 'https://outlook.office365.com/api/v1.0' # TODO: Copy a valid, non-expired access token here. You can get this fro...
{ "content_hash": "9b2172cdca719e8bd0b2bbd8bb562cad", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 351, "avg_line_length": 48.64356435643565, "alnum_prop": 0.4868037180270032, "repo_name": "jasonjoh/pythoncontacts", "id": "bbba3bd349a601f8a507848a4c054e16fd197841", "siz...
from django.core import management if __name__ == "__main__": management.execute_from_command_line()
{ "content_hash": "b3d14a531fd13b09ce55ced83e8e902f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 26.5, "alnum_prop": 0.6792452830188679, "repo_name": "camilonova/django", "id": "53c32d65737162febe4cc1bf09b29e2acbda0c06", "size": "129", "binary":...
class Message(object): def __init__(self, mdict): self.mdict = mdict def getDatetime(self): return self.mdict['datetime'] def getId(self): return self.mdict['id'] def getData(self): return self.mdict['data'] def toDict(self): return self.mdict def re...
{ "content_hash": "c059e3f4ab85c981b8929812ae618410", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 37, "avg_line_length": 20.7, "alnum_prop": 0.5676328502415459, "repo_name": "ilogue/scrolls", "id": "50b850a0483b1f566e9578f4d0bd041a50e3d011", "size": "416", "binary": f...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from agents import ReportingAgent from models import get_model from methods import get_batch_schedule from utils.torch_types import TorchTypes class EpisodicRDQNAgent(ReportingAgent): ...
{ "content_hash": "ea669060579a29ca8303c8cabc0b1476", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 78, "avg_line_length": 34.77064220183486, "alnum_prop": 0.5201846965699208, "repo_name": "village-people/flying-pig", "id": "2c12a6c105b01cf38d0d76867876fcb051a3deab", "si...