text
stringlengths
4
1.02M
meta
dict
import sys import random from libcloud.utils.py3 import httplib from libcloud.utils.py3 import StringIO from libcloud.utils.py3 import urlparse from libcloud.utils.py3 import parse_qs from libcloud.utils.py3 import parse_qsl from libcloud.utils.py3 import u from libcloud.utils.py3 import unittest2_required if unittes...
{ "content_hash": "35bc9823ab2b263da8b5ae6e573e163e", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 79, "avg_line_length": 28.75147928994083, "alnum_prop": 0.5795431158674624, "repo_name": "niteoweb/libcloud", "id": "76f5b0cbfc4af9e11032c1be4a1324d402bbd4ea", "size": "10...
import arcpy, os, string, zipfile, shutil, PyPDF2, tablib from arcpy import mapping from PyPDF2 import PdfFileMerger, PdfFileReader from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import letter from reportlab.lib.units import inch from reportlab.platypus import BaseDocTemplate, Paragraph, frames, Table...
{ "content_hash": "78fcd0f5739ac9dae80c6ec0d00ac36f", "timestamp": "", "source": "github", "line_count": 995, "max_line_length": 264, "avg_line_length": 41.414070351758795, "alnum_prop": 0.6297231052976436, "repo_name": "adambreznicky/python", "id": "5fed73a1d2c074d5add1b23e83c4f3b1ed008f41", "size"...
from django import template from django.contrib import admin from django.contrib.gis.geos import GEOSGeometry from django.core.management import settings register = template.Library() @register.tag def collect(token): bits = list(token.split_contents()) if len(bits) > 3 and bits[-2] == 'as': varname ...
{ "content_hash": "83806c9cfdd629c92cd69b9fb3ac423e", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 104, "avg_line_length": 25.486486486486488, "alnum_prop": 0.6299045599151644, "repo_name": "miguelcleon/ODM2-Admin", "id": "082c9fd6a56f933da8ca39ee0a448beb98a1395d", "siz...
""" Script to copy images to Wikimedia Commons, or to another wiki. Syntax: python imagetransfer.py pagename [-interwiki] [-tolang:xx] [-tofamily:yy] Arguments: -interwiki Look for images in pages found through interwiki links. -keepname Keep the filename and do not verify description while replacing ...
{ "content_hash": "94299e0fe781c1d4db6542fa07bf78a1", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 92, "avg_line_length": 42.06478873239437, "alnum_prop": 0.540614745864863, "repo_name": "xZise/pywikibot-core", "id": "c88d07e0a225f0cde618f69ddc2f04d930cb1229", "size": "...
import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('marketplace', '0019_refactor_offering_referrals'), ] operations = [ migrations.AlterField( model_name='attribute', name='key', ...
{ "content_hash": "f76c93a93a8297f5e0a6a28eb4824e62", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 33.375, "alnum_prop": 0.5237203495630461, "repo_name": "opennode/nodeconductor-assembly-waldur", "id": "1c96a5e652854b8e20fc7f702a45e3a661c9ee4a", "s...
from django_messages_framework.api import get_messages def messages(request): """ Returns a lazy 'messages' context variable. """ return {'messages': get_messages(request)}
{ "content_hash": "e76293ba1568005231c3485136f8450a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 54, "avg_line_length": 23.875, "alnum_prop": 0.6910994764397905, "repo_name": "none-da/zeshare", "id": "51cf3b7c98e8ae826a2242b18363ff8bd268b220", "size": "191", "binary":...
from oslo_config import cfg from neutron.agent.common import config from neutron.plugins.common import constants as p_const from neutron.plugins.ml2.drivers.openvswitch.agent.common \ import constants DEFAULT_BRIDGE_MAPPINGS = [] DEFAULT_VLAN_RANGES = [] DEFAULT_TUNNEL_RANGES = [] DEFAULT_TUNNEL_TYPES = [] ovs_...
{ "content_hash": "0800a7a00e2695f3c98b8890d8b90327", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 79, "avg_line_length": 51.380434782608695, "alnum_prop": 0.5796488258938015, "repo_name": "cisco-openstack/neutron", "id": "98b6210f937d68fad6510aa6d136e04c0e56052c", "size...
"""Utilities for integrating with IPython These functions should probably reside in Jupyter and IPython repositories, after which we can import them instead of having our own definitions. """ import atexit import os try: import queue except ImportError: # Python 2 import Queue as queue from subprocess im...
{ "content_hash": "ec4fdbc2af590bc8f10aedbe81281b2d", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 94, "avg_line_length": 30.96456692913386, "alnum_prop": 0.6411951684678957, "repo_name": "blaze/distributed", "id": "1a99983378649adc8e084cfbc1e851ddf2f1fcc7", "size": "78...
"""Define API Loggers.""" import json from google.protobuf.json_format import MessageToJson class Logger(object): """Loggers represent named targets for log entries. See: https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/projects.logs :type name: string :param name: the name o...
{ "content_hash": "8455ddfc759a3c9f23fa311152c7a637", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 95, "avg_line_length": 37.053613053613056, "alnum_prop": 0.5910291897332662, "repo_name": "quoclieu/codebrew17-starving", "id": "ad2d4b70ca77105083ad059921b62fefac48b5e9", ...
from __future__ import absolute_import from subprocess import * def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the...
{ "content_hash": "995300512f7ec69b0df43d6db0e7d248", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 34.36842105263158, "alnum_prop": 0.6408882082695253, "repo_name": "mdboom/astropy-helpers", "id": "a14df41bb303fa1a8c06977e718144da3da0552b", "size":...
"""The JIP Pipeline module contains the classs and functions used to create pipeline graphs """ import collections import os from jip.options import Option from jip.tools import Tool from jip.profiles import Profile from jip.logger import getLogger from jip.templates import render_template import jip.tools log = getL...
{ "content_hash": "0ab74f1accc9ee941c761cd366d96386", "timestamp": "", "source": "github", "line_count": 2227, "max_line_length": 79, "avg_line_length": 38.935339021104625, "alnum_prop": 0.5343966600929546, "repo_name": "thasso/pyjip", "id": "4aa4c0e26f8b9c3e062654d27b8693d160af92d1", "size": "86731...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "supermilai.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "65d6e271fb0c1b0ae7db4a919f2f3e9e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 25.666666666666668, "alnum_prop": 0.7142857142857143, "repo_name": "lambdauser/supermilai", "id": "3c29d3c69ec82f0e14731a67b0d4df6c9e0c7e43", "size": ...
import codecs from collections import OrderedDict import itertools import logging from typing import Dict, List import tqdm from .instances.instance import Instance, TextInstance, IndexedInstance from .instances.background_instance import BackgroundInstance from .instances.labeled_background_instance import LabeledBa...
{ "content_hash": "48515d14e8c92f1370ebc2836115c4fc", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 114, "avg_line_length": 47.54618473895582, "alnum_prop": 0.6524199679026945, "repo_name": "RTHMaK/RPGOne", "id": "e7302fd88d029b52b85b119b93149ea790f12b27", "size": "11839...
import docutils.nodes from docutils.parsers.rst import Directive, directives class IframeVideo(Directive): DEFAULT_WIDTH = 700 DEFAULT_HEIGHT = 400 DEFAULT_ALIGN = 'left' has_content = False required_arguments = 1 optional_arguments = 0 option_spec = { 'height': directives.nonneg...
{ "content_hash": "2b97d32473d4f38ca07970463d1be902", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 108, "avg_line_length": 34.526315789473685, "alnum_prop": 0.6364329268292683, "repo_name": "akrylysov/yozuch", "id": "42ca519da69fb5212e052f4c76b8fcf8b66f697d", "size": "13...
from sqlalchemy import Column, DateTime, String, Integer, Float, ForeignKey, func, BLOB, Text, BigInteger, Index, SmallInteger from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class DbDonations(Base): """ Donations DB info ...
{ "content_hash": "6190caee251ea29ee45e51205178d53c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 126, "avg_line_length": 37.75675675675676, "alnum_prop": 0.717967072297781, "repo_name": "yolosec/zeman-parser", "id": "da41734b41408dca12dace2b88164fd80f7bb8cf", "size": "...
""" Project MCM - Micro Content Management Metadata Extractor - identify content type, extract metadata with specific filter plugins Copyright (C) <2016> Tim Waizenegger, <University of Stuttgart> This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details...
{ "content_hash": "4cc005caa88460b72eb0ce638dd65171", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 158, "avg_line_length": 44.796052631578945, "alnum_prop": 0.6484065207813189, "repo_name": "timwaizenegger/mcm-metadataExtractor", "id": "53ca20c24e46175526783198e6b429fdf29...
import logging import platform import time log = logging.getLogger("graphitesend") class GraphiteStructuredFormatter(object): '''Default formatter for GraphiteClient. Provides structured metric naming based on a prefix, system name, group, etc :param prefix: string added to the start of all metrics ...
{ "content_hash": "36b8dae24e52dd9cedc60108dc0202aa", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 90, "avg_line_length": 34.72727272727273, "alnum_prop": 0.5986038394415357, "repo_name": "PabloLefort/graphitesend", "id": "ec5075940c57103a0053fbd8066665d540d319d7", "size...
import time import unittest from rq import Queue import frappe from frappe.core.page.background_jobs.background_jobs import remove_failed_jobs from frappe.utils.background_jobs import generate_qname, get_redis_conn class TestBackgroundJobs(unittest.TestCase): def test_remove_failed_jobs(self): frappe.enqueue(met...
{ "content_hash": "a37540f8b4db6f413114c8fd02968c36", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 89, "avg_line_length": 27.632653061224488, "alnum_prop": 0.7274741506646972, "repo_name": "yashodhank/frappe", "id": "6c7dda51f1510e8eeb2d827859a5ae4d934fb5ad", "size": "13...
""" Django settings for this project. Generated by 'django-admin startproject' using Django 1.10.7. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os f...
{ "content_hash": "da2ffaf639e873ce6c7184a49ec8fd9d", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 111, "avg_line_length": 27.32758620689655, "alnum_prop": 0.6782334384858044, "repo_name": "divio/django-cms-demo", "id": "719ddded19354479942f2e2896ba5ec0a0cadf84", "size"...
from cStringIO import StringIO from avro.datafile import DataFileReader, DataFileWriter from avro.io import DatumReader, DatumWriter, BinaryDecoder, BinaryEncoder import avro.schema class AvroFileReader(DataFileReader): def __init__(self, f, types=False): if types: raise RuntimeError('types ...
{ "content_hash": "25013424d657e4d1b8d7369090ea4488", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 74, "avg_line_length": 27.67391304347826, "alnum_prop": 0.6724273369992144, "repo_name": "simleo/pydoop-features", "id": "d73ef31d8fee9bc3ebdaa8be5f33ade03ed13f58", "size":...
import os import numpy as np from collections import OrderedDict from md_utils.md_common import (InvalidDataError, warning) # Constants # MISSING_ATOMS_MSG = "Could not find lines for atoms ({}) in timestep {} in file: {}" TSTEP_LINE = 'ITEM: TIMESTEP' NUM_ATOM_LINE = 'ITEM: NUMBER OF ATOMS' BOX_LINE = 'ITEM: BOX' AT...
{ "content_hash": "25657851c9e02c86e1e006ea25e1d9c8", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 108, "avg_line_length": 40.142857142857146, "alnum_prop": 0.5842579024492359, "repo_name": "cmayes/md_utils", "id": "c37c3e0f09afccf6fd167a1e6560dc8fdfbd97a3", "size": "47...
import re import time import urllib # 3p import pymongo # project from checks import AgentCheck from urlparse import urlsplit from config import _is_affirmative from distutils.version import LooseVersion # pylint: disable=E0611,E0401 DEFAULT_TIMEOUT = 30 GAUGE = AgentCheck.gauge RATE = AgentCheck.rate class MongoD...
{ "content_hash": "16c5c0832871ca4b85688cafd6db0739", "timestamp": "", "source": "github", "line_count": 1049, "max_line_length": 181, "avg_line_length": 39.74261201143947, "alnum_prop": 0.5661069800911489, "repo_name": "s-maj/integrations-core", "id": "ce4b02bdc43c58ed344c55925ef3dec8c4596de8", "si...
import os import atexit import string import importlib import threading import socket from time import sleep def BYTE(message): return bytes("%s\r\n" % message, "UTF-8") class UserInput(threading.Thread): isRunning = False parent = None def __init__(self, bot): super().__init__() self.parent = bot self.set...
{ "content_hash": "0a26a878afc80d2123f578af0d6f49ca", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 108, "avg_line_length": 32.08139534883721, "alnum_prop": 0.5980427691192461, "repo_name": "tommai78101/IRCBot", "id": "33e692c0e4fcc91d8bacedd29fb7d98e89715ff8", "size": "2...
from config import getRootDir # DEBUG DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS ALLOWED_HOSTS = ['*'] #设置数据库的信息,此处使用mysql DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqli...
{ "content_hash": "9c7a940cb4659ba7477c0a7bc8086a14", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 106, "avg_line_length": 33.82122905027933, "alnum_prop": 0.6610505450941526, "repo_name": "ferstar/spark-api-demo-python", "id": "3ca2b059c9a9c74f2bfc0b2072b4a6343fad1943", ...
from page_sets.login_helpers import login_utils def LoginAccount(action_runner, credential, credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): """Logs in into a Dropbox account. This function navigates the tab into Dropbox's login page and logs in a user using credentials in |credential| p...
{ "content_hash": "7a90f016855be95af394a4f640020964", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 78, "avg_line_length": 38.775, "alnum_prop": 0.720180528691167, "repo_name": "nwjs/chromium.src", "id": "ff26f6b617b9c42538dd4c8baf79ccb5868eb704", "size": "1692", "binar...
from invites.models import Invite from django.contrib import admin class InviteAdmin(admin.ModelAdmin): filter_horizontal = ('invited_users',) list_display = ('generated_by', 'group', 'key') list_filter = ('group',) search_fields = ('generated_by__username', 'group__name', 'key') admin.site.register...
{ "content_hash": "2f0f35c922b0bfaa8ee4ca8af9352e36", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 68, "avg_line_length": 28.5, "alnum_prop": 0.695906432748538, "repo_name": "znick/anytask", "id": "1d1afc49b4f94e0a43ba0af74fad58cb47c67abc", "size": "342", "binary": fal...
from ctypes import c_void_p from types import NoneType from django.contrib.gis.gdal.error import GDALException class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. ...
{ "content_hash": "e2d762d1561473301c05f6564e3a523c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 95, "avg_line_length": 33.42857142857143, "alnum_prop": 0.6102564102564103, "repo_name": "greggian/TapdIn", "id": "5086c9b761ba65b6b044cd5f1d02e4118d9cc168", "size": "1170"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/base/shared_poi_all_lair_warren_large_fog_red.iff" result.attribute_template_id = -1 result.stfName("lair_n","warren") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "4ecf858cd7f0fb2138c797b63a0b5c9f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 91, "avg_line_length": 24.23076923076923, "alnum_prop": 0.692063492063492, "repo_name": "obi-two/Rebelion", "id": "88026160ff81ab0d77d58fba18f73fa09f515df5", "size": "460",...
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) from app import views, models
{ "content_hash": "2ea6a60d11b5a408443d3736c4ffedb5", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 39, "avg_line_length": 19.11111111111111, "alnum_prop": 0.7616279069767442, "repo_name": "realdubb/flask-microblog", "id": "b99bf4e5c27e33abe385069baa3f2f7b846c98ea", "size"...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class EditIdentity(Choreography): def __init__(self, temboo_session): """ Create a ...
{ "content_hash": "f1bc44744cc447eb5d69865a1b92b700", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 179, "avg_line_length": 42.41880341880342, "alnum_prop": 0.6540398952246625, "repo_name": "egetzel/wecrow", "id": "475850371fadb424ddbaa04b140817b5530d3f3b", "size": "5221...
""" Shelter Registry - Controllers """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # S3 framework functions # ----------------------------------------------------------------------------- def index(): ...
{ "content_hash": "685358a0c7e8ae4009279970408befee", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 103, "avg_line_length": 44.579166666666666, "alnum_prop": 0.43574165809888776, "repo_name": "sammyshj/gci", "id": "365b29d8e5580d37ac38d1e3e28bbcb2f0c9c159", "size": "1072...
""" Test Cases Please see README.rst or DOCS.rst or http://chrisglass.github.com/django_polymorphic/ """ from __future__ import print_function import uuid import re import django try: from unittest import skipIf except ImportError: # python<2.7 from django.utils.unittest import skipIf from django.db.models...
{ "content_hash": "6616cb916bb3d989d3e28b633aed1186", "timestamp": "", "source": "github", "line_count": 1373, "max_line_length": 174, "avg_line_length": 34.196649672250544, "alnum_prop": 0.6110921792468904, "repo_name": "hobarrera/django-polymorphic-ng", "id": "b3e0c28710acd1cf90c0893e90c524641dcf266...
"""Support for Ecobee binary sensors.""" from homeassistant.components.binary_sensor import ( DEVICE_CLASS_OCCUPANCY, BinarySensorDevice, ) from .const import _LOGGER, DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER async def async_setup_entry(hass, config_entry, async_add_entities): """Set up ecobee binary (...
{ "content_hash": "e8ba8c5c15ac800ae5554fc874d54213", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 88, "avg_line_length": 36.38532110091743, "alnum_prop": 0.5479072112960162, "repo_name": "postlund/home-assistant", "id": "a4062905eaa174f7a21f2f668d33a2a4ec4d72fd", "size...
import sys sys.path.append("..") from client.database.models import * from client.log import log from client.database import db_adapter from client.constants import HTTP_HEADER from client.functions import safe_get_config, get_now from flask import request, g import uuid from client.md5 import encode from datetime im...
{ "content_hash": "88c0157829f8e0e4601cd17f730b43da", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 100, "avg_line_length": 34.712574850299404, "alnum_prop": 0.5451095394169398, "repo_name": "Fendoe/open-hackathon-o", "id": "0d9f8341d34a8af2dd8a415094157a92f49bd61d", "si...
""" https://developer.openstack.org/api-ref/identity/v3-ext/#os-ep-filter-api """ from oslo_serialization import jsonutils as json from tempest.lib.common import rest_client class EndPointsFilterClient(rest_client.RestClient): api_version = "v3" ep_filter = "OS-EP-FILTER" def list_projects_for_endpoint...
{ "content_hash": "e8d3b9425d800508415a685a24d284aa", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 73, "avg_line_length": 40.075471698113205, "alnum_prop": 0.6271186440677966, "repo_name": "Juniper/tempest", "id": "a8cd7222e36b2bb3847915ca9389a0853aed01d5", "size": "2750...
"""Tests for ncolony.beatcheck""" import functools import os import shutil import time import unittest from twisted.python import filepath, usage from twisted.application import internet as tainternet from ncolony import beatcheck, ctllib from ncolony.client.tests import test_heart from ncolony.tests import helper ...
{ "content_hash": "fae6532ed898bc1d5a5185e1f22af513", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 79, "avg_line_length": 38.11522633744856, "alnum_prop": 0.6102353703303822, "repo_name": "moshez/ncolony", "id": "e0bf6d099d00a7dee216c693beb8175aeabe4996", "size": "9318"...
import email email.setFileRead("testFile.txt") email.setFileWrite("testOut.txt") email.generateEmailList() email.setFileWrite("testRemove.txt") email.removePerson("test") email.setFileWrite("clearTest.txt") f = open("clearTest.txt" , 'w') for i in range(0,100): f.write(str(i) + "\n") f.close() email.clearOutFi...
{ "content_hash": "e309b32cd3195f52d358ad6b2c331727", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 36, "avg_line_length": 17.054054054054053, "alnum_prop": 0.6893819334389857, "repo_name": "nextBillyonair/cult", "id": "b2cdf24c6c282c276c98db04e6860b34093a29f4", "size": "...
{ "name": "Email confirmation on sign up", "summary": """New user is able to login only after confirming his/her email""", "vesion": "13.0.1.0.1", "author": "IT-Projects LLC", "website": "https://it-projects.info", "license": "Other OSI approved licence", # MIT "price": 40.00, "currency...
{ "content_hash": "e70338feead6333c2f85daeb8eca6f13", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 83, "avg_line_length": 35.57142857142857, "alnum_prop": 0.5903614457831325, "repo_name": "it-projects-llc/misc-addons", "id": "a953e330a30dec8623aa29c6b0fd0d02fa8fc4ca", "s...
from os import environ from six import string_types from six.moves import urllib_parse from .exceptions import InvalidResourcePath GOOEE_API_URL = environ.get('GOOEE_API_URL', 'https://dev-api.gooee.io/') GOOEE_API_PATH = urllib_parse.urlparse(GOOEE_API_URL).path def format_path(path, api_base_url=GOOEE_API_URL): ...
{ "content_hash": "39c85d5b64fe70cf448147daf09ac852", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 29.857142857142858, "alnum_prop": 0.7129186602870813, "repo_name": "GooeeIOT/gooee-python-sdk", "id": "6b2d6dd77c55f5f7db403c9e3b0f931730a52f39", "si...
from __future__ import unicode_literals from django.db import migrations, models import events.models class Migration(migrations.Migration): dependencies = [ ('events', '0003_auto_20150416_1853'), ] operations = [ migrations.AddField( model_name='recurringrule', ...
{ "content_hash": "c5c5e54f8494598856b928811f3f1bf1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 25.958333333333332, "alnum_prop": 0.608346709470305, "repo_name": "Mariatta/pythondotorg", "id": "384bd9e4e85a853073d74e248b3af31bb3456395", "size": ...
import imp import pkg_resources import sys class MockProvider(pkg_resources.NullProvider): def __init__(self, module): pkg_resources.NullProvider.__init__(self, module) self.module = module def _has(self, path): return path in self.module._resources def _isdir(self, path): ...
{ "content_hash": "848f6c2ebc5afb53581069cebaf1eb17", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 58, "avg_line_length": 22.736842105263158, "alnum_prop": 0.6493055555555556, "repo_name": "abbas123456/django-right-to-left", "id": "9ee7910fe4f7241fda3852e33c993560b0821819"...
import json from datetime import datetime, timedelta import logging import sys import StringIO import caldav import vobject import pytz CONFIG_FILE = "conf.json" if '-c' in sys.argv: CONFIG_FILE = sys.argv[2] CONFIG_DEFAULTS = { "filter": { "calendars": [], "interval": [-7, 365] }, "di...
{ "content_hash": "9d17f31dcf63885f7c56b891cbf59cda", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 29.651063829787233, "alnum_prop": 0.5917049368541906, "repo_name": "daladno/upcoming", "id": "8c6780341a2826677fb45a9ee2eaa58b9b9e75b9", "size": "69...
from .test_citizens_crud import *
{ "content_hash": "4db7034820ab64df3846a2b0b25afe29", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 33, "avg_line_length": 33, "alnum_prop": 0.7878787878787878, "repo_name": "jaconsta/soat_cnpx", "id": "f5cb515d4c62b9919c1cad6b48cf4ca9212cec9e", "size": "33", "binary": f...
""" gargoyle.admin ~~~~~~~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from __future__ import absolute_import, division, print_function, unicode_literals from django.contrib import admin from gargoyle.models import Switch class SwitchAdmin(admin.ModelAdmin): ...
{ "content_hash": "97bb5f90a679c389b504a6f69c59c081", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 23.095238095238095, "alnum_prop": 0.688659793814433, "repo_name": "YPlan/gargoyle", "id": "4b7eff5bba922fe8ae267b329b419e742e395cc3", "size": "485", ...
""" Factory for input methods within a dialog. """ from datetime import datetime from PyQt4 import QtGui, QtCore from datafinder.core.configuration.properties import constants from datafinder.gui.user.common.util import extractPyObject from datafinder.gui.user.common.widget.property.editors....
{ "content_hash": "eff8d23f01eef79275d871e951fdc585", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 96, "avg_line_length": 37.57339449541284, "alnum_prop": 0.5979733854230252, "repo_name": "DLR-SC/DataFinder", "id": "743d87f0f4f42979b21bc54ad6dfed02dad9c075", "size": "98...
import os import fixtures from oslo.config import cfg import inspect from nova import exception from nova.openstack.common import uuidutils from nova import test from nova.tests import fake_processutils from nova.tests.virt.libvirt import fake_libvirt_utils from nova import unit from nova.virt.libvirt import imageba...
{ "content_hash": "83dc396000818d4313009be7354355bb", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 78, "avg_line_length": 38.232142857142854, "alnum_prop": 0.61657325237428, "repo_name": "sacharya/nova", "id": "1d553218df386ca8f2220837b7cf3f6e86f063e4", "size": "26366",...
from django.conf.urls.defaults import * urlpatterns = patterns('game.views', ('^question/(?P<op>.+)$','question'), )
{ "content_hash": "76b37f07023459fbccad96af62c6755c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 23.8, "alnum_prop": 0.6638655462184874, "repo_name": "bernardokyotoku/skillplant", "id": "e26d93413eee84d1d04a3c7c2e1769e1426a667a", "size": "119", ...
import os,shutil """ A little script to wrap the params enum for use in Cython code Ian Bell, Feb 2013 """ def params_constants(): fName = os.path.join('..','..','CoolProp','GlobalConstants.h') contents = open(fName,'r').read().replace('\n','') # Find the block that is something like : ...
{ "content_hash": "77d0f3bdee76ad2bdc37a31e4a11b055", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 230, "avg_line_length": 48.87074829931973, "alnum_prop": 0.6340478841870824, "repo_name": "ibell/coolprop", "id": "6476dfebd64164abe3ea915747dd75520d85472f", "size": "7184...
__about__ = """ In addition to what is provided by the "zero" project, this project provides thorough integration with django-user-accounts, adding comprehensive account management functionality. It is a foundation suitable for most sites that have user accounts. """ default_app_config = "testapp.apps.AppConfig"
{ "content_hash": "2f22244f2db451e57c7c9b5888eba627", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 39.375, "alnum_prop": 0.7841269841269841, "repo_name": "kevana/django-test", "id": "8d96b22a34d5a6bd0d2f93d2716d959cac523eab", "size": "340", "binar...
from setuptools import setup, find_packages requirements = ['lz4tools==1.3.1.2', 'numpy', 'py==1.4.31', 'pytest==3.0.3'] setup(name='slisonner', version='0.7.9', description='Habidatum Chronotope Slison encode/decode utility', long_description='', author='Nikita Pestrov', author_email='...
{ "content_hash": "efd2f29f1e575657e80225c40478ea4e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 70, "avg_line_length": 29.7, "alnum_prop": 0.6632996632996633, "repo_name": "Habidatum/slisonner", "id": "12953800b5b6ce796066391662bc4943c6f2fee9", "size": "618", "binar...
from __future__ import unicode_literals # BEWARE don't put anything in this file except exceptions from werkzeug.exceptions import NotFound from MySQLdb import ProgrammingError as SQLError, Error from MySQLdb import OperationalError as DatabaseOperationalError class ValidationError(Exception): http_status_code = 4...
{ "content_hash": "f7a2b8a97365ca00207db84ad9d2959c", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 66, "avg_line_length": 30.240963855421686, "alnum_prop": 0.8262948207171315, "repo_name": "bohlian/frappe", "id": "ae9fca7e7ae7283096d6c850817576a26703d523", "size": "2611"...
class Interpolator(object): def __init__(self): self._destroyed = False def binary_interpolant(self, a, b): """Returns a binary interpolant for the pair (a, b), if And(a, b) is unsatisfaiable, or None if And(a, b) is satisfiable. """ raise NotImplementedError def ...
{ "content_hash": "88de45f1a6933cd82679e564b4aa5da2", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 29.317073170731707, "alnum_prop": 0.6064891846921797, "repo_name": "agriggio/pysmt", "id": "2f06e30c702fe7b88ad40fb395fee462a5fe33a7", "size": "1853"...
import os import sys import math import PyPR2 MagiksPR2Path = 'Magiks/magiks/projects/s_pr2' class IKSError( Exception ): pass class IKSResolver( object ): def __init__( self ): self.spr2_obj = None self.iks_in_use = 0 self.np = None self.pint = None self.geometry = None self.resolveIKS()...
{ "content_hash": "e62b60eb16defa8002d1030affecce6f", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 145, "avg_line_length": 34.86754966887417, "alnum_prop": 0.6429249762583096, "repo_name": "uts-magic-lab/pyride_pr2", "id": "32415c3f3f267d36d69d7d0d5d5ea8b356ce21b3", "si...
import time from ginga.misc import Bunch, Datasrc, Callback, Future, Settings from ginga.util import viewer as gviewer class ChannelError(Exception): pass class Channel(Callback.Callbacks): """Class to manage a channel. Parameters ---------- name : str Name of the channel. fv : `~...
{ "content_hash": "c93a36c1d383e452def7d287cd9a45e9", "timestamp": "", "source": "github", "line_count": 517, "max_line_length": 89, "avg_line_length": 32.17988394584139, "alnum_prop": 0.5458315802127788, "repo_name": "pllim/ginga", "id": "f9ad85a1292bb08c5ee5d7ef38e5ca446b52657f", "size": "16813", ...
"""Read CPR files.""" import logging import re import sys import numpy as np import dwi.files from dwi.types import Path def read_cpr(path): """Read and parse a CPR file. Return masks, which are (id, RLE data). Note: Python 3.6.4 docs say its XML module is not secure, se we use regexp. """ # Examp...
{ "content_hash": "8e8f675e30c2c44c4bc65e9a6e8dc8ad", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 79, "avg_line_length": 30.092105263157894, "alnum_prop": 0.570179274158286, "repo_name": "jupito/dwilib", "id": "4114935e48bf5efb2f1c9d1b546f0e1f75e95892", "size": "2307", ...
from __future__ import absolute_import import errno import re import socket import ssl try: from ssl import SSLContext except: SSLContext = None # Jython does not have this attribute try: from socket import SOL_TCP except ImportError: # pragma: no cover from socket import IPPROTO_TCP as SOL_TCP # no...
{ "content_hash": "904184413a45a36850d8b5b0e1c80b41", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 79, "avg_line_length": 33.31230283911672, "alnum_prop": 0.5383522727272727, "repo_name": "Iotic-Labs/py-IoticAgent", "id": "03c66a3846d40fe97eae0125a323e880f35aee3e", "siz...
from datetime import datetime, timezone def utc_now() -> datetime: """ Return current time with tz=UTC """ return datetime.now(tz=timezone.utc)
{ "content_hash": "4cfb5c40226164b2c717fbfd82c45dcd", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 43, "avg_line_length": 25.666666666666668, "alnum_prop": 0.6948051948051948, "repo_name": "SUNET/eduid-common", "id": "2bd902f8d11af375d9862d48bc8f0b2ddaff6736", "size": "15...
import time import multiprocessing from multiprocessing.dummy import Pool def simple_parallel(): values = [[2, 3, 5], [5, 5, 5], [2], [3, 3]] pool = Pool(4) results = pool.map(sum, values) pool.close() # closing the pool pool.join() # waiting for the work to finish print results def worker...
{ "content_hash": "c7bcbbe4b599cbcf530c476d44f78ade", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 107, "avg_line_length": 26.709923664122137, "alnum_prop": 0.5984567019148328, "repo_name": "Officium/iLearn", "id": "6056c7f976389a27e7b495126c3097c743806625", "size": "36...
import socket import ssl import sys import eventlet import eventlet.wsgi import greenlet from keystone.openstack.common import log LOG = log.getLogger(__name__) class Server(object): """Server class to manage multiple WSGI sockets and applications.""" def __init__(self, application, host=None, port=None,...
{ "content_hash": "227c9a59fd208e3bc2ed1159a6ea10d4", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 76, "avg_line_length": 34.68817204301075, "alnum_prop": 0.5158090514569126, "repo_name": "dsiddharth/access-keys", "id": "661c0521ad7d81eb4d98fb10dbba7764ee2d6f76", "size":...
"""Displays localized dialogs for Kodi""" import xbmcgui class Dialogs(object): """Displays localized dialogs for Kodi""" def __init__(self, utils): """Injects the utils instance :param utils: Plugin utils :type utils: resources.lib.Utils """ self.utils = utils ...
{ "content_hash": "c84615ef8ec066673d008c8b82ef3e60", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 57, "avg_line_length": 27.52054794520548, "alnum_prop": 0.571926331508213, "repo_name": "asciidisco/plugin.video.telekom-sport", "id": "2a4d52602ac5914ef77b540f9729bbd953c170...
from classytags.arguments import Argument from classytags.core import Options, Tag from classytags.helpers import InclusionTag from cms.constants import PUBLISHER_STATE_PENDING from cms.utils import get_cms_setting from cms.utils.admin import get_admin_menu_item_context from cms.utils.permissions import get_any_page_vi...
{ "content_hash": "3f68ee3e098f1ea39c2927007a0feefe", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 120, "avg_line_length": 33.032786885245905, "alnum_prop": 0.6253101736972705, "repo_name": "keimlink/django-cms", "id": "59ccd3e8d63a9ac8e45db1460a2b096df8bb5253", "size":...
import sys from os.path import dirname from base import unittest, TestCase if __name__ == "__main__": here = dirname(__file__) sys.path.insert(0, here+"/..") from jinja2 import Environment import jinja2_maps class TestJinja2Maps(TestCase): def test_version(self): self.assertRegexpMatches(jinja2_m...
{ "content_hash": "bf163923b03bcbd35f6f00c848525d77", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 27.56, "alnum_prop": 0.6458635703918723, "repo_name": "bfontaine/jinja2_maps", "id": "8761e7f8e45a938ddf7eb8b2a44bfa24ce2a33d2", "size": "713", "bi...
"""Module containing utility functions. """ # Standard libraries import os import errno from math import log10, floor from argparse import ArgumentParser __all__ = ['line_start', 'comment', 'langs', 'file_ext', 'restrict', 'header_ext', 'line_end', 'exp_10_fun', 'array_chars', 'get_species_mappi...
{ "content_hash": "1be80ff9bbf0c84d9e187c94c726c1ce", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 91, "avg_line_length": 31.555299539170505, "alnum_prop": 0.5071924059875867, "repo_name": "SLACKHA/pyJac", "id": "8cc5998fc8f7872283019577b6570dd463c75f22", "size": "13719...
from distutils.core import setup setup( name='geeseflypy', version='0.4', author='Jonathan Bowman', author_email="bowmanjd@gmail.com", url='http://code.google.com/p/geeseflypy/', packages=['geesefly',], license='Apache License, Version 2.0', description='Pure Python implementation of Sk...
{ "content_hash": "32e1f4694e7ae833297943583eb83b6c", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 68, "avg_line_length": 34.48275862068966, "alnum_prop": 0.646, "repo_name": "bowmanjd/geeseflypy", "id": "16a79437102d0374b4e1dd7c94fb52f0eb3562bc", "size": "1000", "bina...
import time import logging.config import sys from tashi.rpycservices.rpyctypes import Errors, HostState, InstanceState, TashiException from tashi.util import createClient, instantiateImplementation, boolean from tashi.utils.config import Config import tashi class Primitive(object): def __init__(self, config): sel...
{ "content_hash": "3ae99d831828f4defac0ae700bbd1578", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 195, "avg_line_length": 33.096345514950166, "alnum_prop": 0.664123669945794, "repo_name": "stroucki/tashi", "id": "a6a14e004197041863b94f0715ba752915957b83", "size": "1077...
"""A source for reading VCF files and extracting signals about input size.""" from functools import partial from typing import Dict, Iterable # pylint: disable=unused-import from apache_beam import transforms from apache_beam.io import filebasedsource from apache_beam.io import filesystem from apache_beam.io impor...
{ "content_hash": "2dd24d4c31999f12afd084205789623a", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 80, "avg_line_length": 37.04265402843602, "alnum_prop": 0.6500767656090072, "repo_name": "googlegenomics/gcp-variant-transforms", "id": "7c0a2ed7bbfa6c0e89c0c8cdbf76f0db4e26...
import os import sys sys.path.insert(0, os.path.abspath('/home/mharris/Projects/Personal/eventify/eventify')) sys.path.insert(1, os.path.abspath('/home/mharris/Projects/Personal/eventify/eventify/drivers')) sys.path.insert(2, os.path.abspath('/home/mharris/Projects/Personal/eventify/eventify/exceptions')) sys.path.inse...
{ "content_hash": "568b81d8c76f37163c323b8c290e363c", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 99, "avg_line_length": 32.723404255319146, "alnum_prop": 0.6755526657997399, "repo_name": "morissette/eventify", "id": "c5f569d14026428aac37ee8947e59734cdd4c6b7", "size": ...
import os import sys import unittest import subprocess from glob import glob def clean_output(pattern='*.nc'): [os.unlink(fname) for fname in glob(pattern)] class RunNotebooks(unittest.TestCase): def setUp(self): files = [] path = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) ...
{ "content_hash": "53682fa454674ee7e559a59ec1cb0e9f", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 29.604166666666668, "alnum_prop": 0.5327234342012667, "repo_name": "rsignell-usgs/notebook", "id": "9cf605502ce475a605cf657668f7f499cb406a3f", "size"...
''' run_client.py - An example client using the python socket implementation of the Google Protocol Buffers. This module is an executable script demonstrating the usage of the python socket implementation of the Google Protocol Buffers. To work correctly, the script requires a server to be running first (i.e. run_serv...
{ "content_hash": "2a65378debe445c498de080baf90a9dd", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 68, "avg_line_length": 26.441860465116278, "alnum_prop": 0.712401055408971, "repo_name": "4ntoine/protobuf-socket-rpc", "id": "6f9806329888962739b858f995a2a0dc4c0a6203", "s...
import mock from neutronclient.common import exceptions as neutron_client_exc from neutronclient.v2_0 import client as clientv20 from oslo_config import cfg from manila.db import base from manila import exception from manila.network.neutron import api as neutron_api from manila.network.neutron import constants as neut...
{ "content_hash": "9e051ff9ae8964d05c3ff2f9bfb0fd62", "timestamp": "", "source": "github", "line_count": 696, "max_line_length": 79, "avg_line_length": 36.75431034482759, "alnum_prop": 0.603299323716821, "repo_name": "bswartz/manila", "id": "a6e59f83e3a30e6380af7029d6399336bb61c226", "size": "26247"...
from django.shortcuts import render_to_response from django.http import HttpResponseBadRequest, HttpResponseForbidden, HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.contrib import auth from django.contrib.auth.decorators import login_required from golem.models import Alarm d...
{ "content_hash": "48e251782b9d4af7803040748c5a2c29", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 107, "avg_line_length": 30.301204819277107, "alnum_prop": 0.7284294234592446, "repo_name": "Tyler-Ward/GolemClock", "id": "72eca96157032face3663c470d307aea1541c49a", "size"...
from django import template from Instanssi.kompomaatti.models import Event register = template.Library() @register.inclusion_tag('admin_base/tags/event_nav_items.html') def render_base_events_nav(): return {'events': Event.objects.all().order_by('-date')} @register.simple_tag def event_name(event_id): try: ...
{ "content_hash": "189c49287ff14884c2dd8fefcd09e6d8", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 25.294117647058822, "alnum_prop": 0.6906976744186046, "repo_name": "Instanssi/Instanssi.org", "id": "8ee912c43bdeb3b4726ae4a805c3d479844e72cc", "size...
from .boost import BoostDependency from .cuda import CudaDependency from .hdf5 import hdf5_factory from .base import Dependency, InternalDependency, ExternalDependency, NotFoundDependency from .base import ( ExternalLibrary, DependencyException, DependencyMethods, BuiltinDependency, SystemDependency, ge...
{ "content_hash": "aba5c805cb1dbb253ef1c308d23e35f4", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 121, "avg_line_length": 34.723247232472325, "alnum_prop": 0.7184909670563231, "repo_name": "mesonbuild/meson", "id": "bbf31ad11cf8ce8ca9f2eac04dac118defb69ec3", "size": "1...
import math import sys import os # import the finalization function from orbit.utils import orbitFinalize # import general accelerator elements and lattice from orbit.lattice import AccLattice, AccNode, AccActionsContainer from orbit.py_linac.lattice import MarkerLinacNode import orbit_utils from orbit_utils impor...
{ "content_hash": "9559ac516870e634db8b0d438512b0a6", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 121, "avg_line_length": 31.69396551724138, "alnum_prop": 0.6994424044607643, "repo_name": "azukov/py-orbit", "id": "754f970b6ec0d9937ea186c8b7a4eb4572697bc4", "size": "786...
from Framework.Resposta import Resposta from Models.Campus.Campus import Campus as ModelCampus class RespostaVer(Resposta): def __init__(self,campus): self.corpo = ModelCampus(campus)
{ "content_hash": "b9f23b0e3496519c6aa3ec8a727aca0f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 54, "avg_line_length": 27, "alnum_prop": 0.7883597883597884, "repo_name": "AEDA-Solutions/matweb", "id": "a05cc78fd3b0e0f79287927b66a75e74ef82e38b", "size": "189", "binary...
def verbing(s): # +++your code here+++ if len(s)<3: return s elif s[-3:]=="ing": return s+"ly" else: return s+"ing" # E. not_bad # Given a string, find the first appearance of the # substring 'not' and 'bad'. If the 'bad' follows # the 'not', replace the whole 'not'...'bad' substring # with 'good...
{ "content_hash": "dca00828cfeb417df8359bb6813abd19", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 27.92207792207792, "alnum_prop": 0.6223255813953489, "repo_name": "chinbat/google-python-exercises", "id": "bba058c560c5f04332da134a5e0d9bdb1ff7841f", ...
import os import json import numpy as np import scipy.sparse.csgraph import pickle import sys import hulo_file.FileUtils as FileUtils import hulo_param.ReconstructParam as ReconstructParam import hulo_sfm.mergeSfM as mergeSfM class sfmModel: def __init__(self, name, imgFolLoc, csvFolLoc, matchesFolLoc, locFol...
{ "content_hash": "18b53627ec6c037d48222e49edff3ff5", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 231, "avg_line_length": 53.14936247723133, "alnum_prop": 0.5944343534733884, "repo_name": "hulop/SfMLocalization", "id": "5ffead8df0054c56b1060f5906d8b4889f53d281", "size"...
from flask_login import LoginManager from valsketch.models import User #debug_toolbar = DebugToolbarExtension() login_manager = LoginManager() login_manager.login_view = "views.signin" login_manager.login_message_category = "warning" @login_manager.user_loader def load_user(user_id): return User.query.get(int(u...
{ "content_hash": "39c748844529cb8f3601bffd1ba13a5e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 48, "avg_line_length": 25.307692307692307, "alnum_prop": 0.7750759878419453, "repo_name": "val-iisc/sketch-parse", "id": "002d69932a2249fd774276badca24e0a96cc9c19", "size":...
import os.path import json import tornado.web import drift.session as session import drift.processor as processor class SessionHandler(tornado.web.RequestHandler): def initialize(self, db, pool, blob_store, gentle_client): self.db = db self.pool = pool self.gentle_client = gentle_client ...
{ "content_hash": "b5d8f12fef19fc268bc0edd7bca251fe", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 86, "avg_line_length": 37.16161616161616, "alnum_prop": 0.6023375917368851, "repo_name": "maxhawkins/drift", "id": "4f3083be7fadf4a4a8ca4023e311c5ccaa41163a", "size": "3679...
from PIL import Image import sys import os import numpy as np import argparse parser = argparse.ArgumentParser( description="Convert image to grayscale HDF5 or NetCDF.") parser.add_argument( 'input', help="Input filename") parser.add_argument( '-f', '--format', action='store', default='nc', ...
{ "content_hash": "f274653b1a3fd241357385aea5f86f8d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 77, "avg_line_length": 30.901960784313726, "alnum_prop": 0.6294416243654822, "repo_name": "abrupt-climate/hyper-canny", "id": "2f9cd55bb725b2fa99082217dc8142026a7db06c", "s...
__author__ = 'calvin' """ This example demonstrates the performance benefit of using list comprehension instead of for loop and append. It also demonstrates how to use imported modules in your benchmarks as well as compare functions of the same group. """ try: from builtins import range except ImportError: ran...
{ "content_hash": "cd133bab919bc565fcf6f238b36235ec", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 115, "avg_line_length": 26.466666666666665, "alnum_prop": 0.7052896725440806, "repo_name": "lobocv/pyperform", "id": "1e7aa9f44f52b05c6e2630e1df4402c5414b8f2f", "size": "79...
from __future__ import division def warn(*args, **kwargs): pass import warnings warnings.warn = warn import argparse import os import pandas as pd import sys from tqdm import tqdm from classifier import get_text_pipeline, get_voting_classifier, DescriptionClassifier, ReadmeClassifier, NumericEnsembleClassifier, nor...
{ "content_hash": "2fbfae5b524531709685ee57648c606d", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 217, "avg_line_length": 41.50967741935484, "alnum_prop": 0.6506061548026111, "repo_name": "WGierke/git_better", "id": "5f2e344272b42f30b6178d6dfd8b9fa389bfe038", "size": "...
from __future__ import absolute_import, print_function, unicode_literals import logging import pkg_resources logger = logging.getLogger(__name__) class Extension(object): def __init__(self, name, entry_point): self.name = name self.entry_point = entry_point self.cls = None self.o...
{ "content_hash": "962784340216287280876e9ac9917f52", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 89, "avg_line_length": 31.07017543859649, "alnum_prop": 0.5804630152456239, "repo_name": "nickchen-mitac/fork", "id": "53127495eab68b5cf78ebc61f6a41f3434871a91", "size": "1...
""" Support for IP Cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.generic/ """ import logging import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth import voluptuous as vol from homeassistant.const import ( CONF_NA...
{ "content_hash": "3835dfca9fcd088add85ef804504f57a", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 78, "avg_line_length": 34.10204081632653, "alnum_prop": 0.6606822262118492, "repo_name": "varunr047/homefile", "id": "5d7488b8e688c419a4516405f5ee042650709012", "size": "33...
"""Contains the logic for `aq show cpu`.""" from sqlalchemy.orm import contains_eager, undefer from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611 from aquilon.aqdb.model import Cpu, Vendor class CommandShowCpu(BrokerCommand): def render(self, session, cpu, vendor, speed, **arguments): ...
{ "content_hash": "08cb8ea6e4e3d8a3ce6a23ef20817423", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 33.666666666666664, "alnum_prop": 0.6051980198019802, "repo_name": "jrha/aquilon", "id": "9b4014b781fb837cb0dc011cc709319e02e4bac9", "size": "1511", ...
""" Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import os import datetime import re import json import logging from scrapy import Selector from cameo.utility import Utility from cameo.mod.yuwei.utility....
{ "content_hash": "253044161eed65a34d2d20d3c4c0adce", "timestamp": "", "source": "github", "line_count": 630, "max_line_length": 167, "avg_line_length": 60.198412698412696, "alnum_prop": 0.6298483849703362, "repo_name": "muchu1983/104_cameo", "id": "bd462ca8b571867c4068a7efa3459a78debfacbe", "size":...
from .models import User as UserProjection from cq.handlers import register_handler @register_handler('User', 'Registered') def handle_registered_user(event, replaying_events): UserProjection.objects.create( id=event.aggregate_id, email=event.data['email'], registered_at=event.ts, ...
{ "content_hash": "822d39f36dab78afd0e6ea1b96602c40", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 30.307692307692307, "alnum_prop": 0.6954314720812182, "repo_name": "lukaszb/cq", "id": "2e2aba1f0e68cccfa185f5b5eca34aa68f2e97dc", "size": "394", "...
from django.contrib.auth import authenticate, logout from django.contrib.auth.models import User from django.core.urlresolvers import reverse, reverse_lazy from django.db import transaction from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest from django.shortcuts import render from django...
{ "content_hash": "80ce444850ac7284344831f5d2c2654d", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 83, "avg_line_length": 29.83529411764706, "alnum_prop": 0.6707413249211357, "repo_name": "Lhacker/WebTodo", "id": "db9eeaf42fa7da60ea7c1d3467e6dffb54b9ee02", "size": "2536"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bulkvote', '0001_initial'), ] operations = [ migrations.AlterField( model_name='item', name='item', field=models...
{ "content_hash": "23c112bdbb005e3bc2090480b0ad4dd4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 51, "avg_line_length": 20.27777777777778, "alnum_prop": 0.5808219178082191, "repo_name": "tykling/bulkvote", "id": "65791a3aefaf8f4bd766359b9b40430d89d4d5b6", "size": "389"...
import unittest from kombu_redis_priority.scheduling.prioritized_levels import \ HIGHEST_LEVEL, PrioritizedLevelsQueueScheduler class TestPrioritizedLevelsQueueScheduler(unittest.TestCase): BASE_CONFIG = { 0: ['TimeMachine', 'FluxCapacitor'], 1: ['1985', '1955', '2015'] } def tes...
{ "content_hash": "2934e0f5efec0978b3397becb3d8299f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 107, "avg_line_length": 46.7536231884058, "alnum_prop": 0.689398636081835, "repo_name": "Captricity/kombu-redis-priority", "id": "5c769d855197eff874598c2da22b51126df83d61", ...
from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import os class OrbitConan(ConanFile): name = "OrbitProfiler" version = "0.0.1" license = "BSD-2-Clause" url = "https://github.com/pierricgimmig/orbitprofiler.git" description = "C/C++ Performance Profile...
{ "content_hash": "58bf24142e92e2196e425415e3d4454b", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 127, "avg_line_length": 48.094339622641506, "alnum_prop": 0.5790506080816006, "repo_name": "pierricgimmig/orbitprofiler", "id": "7966fa8739563727e9e39fa6c44840d366dab0b1", ...
from CoralNet.images.tasks import * classify_wrapper()
{ "content_hash": "dec0a78df7456b98159417cf2466af80", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 35, "avg_line_length": 27.5, "alnum_prop": 0.8, "repo_name": "DevangS/CoralNet", "id": "dc6fa6ae51728366fc06c6f67b6fb8961962ac7a", "size": "55", "binary": false, "copies...
from __future__ import absolute_import import hashlib from helper.colorlogger import create_logger from library.api.pgoapi.protos.POGOProtos import Enums_pb2 as Enums from library.api.pgoapi.protos.POGOProtos.Inventory import \ Item_pb2 as Item_Enums class Config(object): def __init__(self, config, cli_arg...
{ "content_hash": "f57396f838aaaf8c7086daf6f60bdc90", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 185, "avg_line_length": 72.23308270676692, "alnum_prop": 0.5581346934526907, "repo_name": "fallenpixel/poketrainer", "id": "ea58b529f4ae2c1b5fa3133e0ca745dd986cd1bc", "siz...
import numpy as np import itertools class SNThermodynamics(object): def __init__(self): self.Le = 4.1 * np.power(10., 51.) self.Lebar = 4.3 * np.power(10., 51.) self.Lmu = 7.9 * np.power(10., 51.) self.EeAvg = 9.4 self.EeBarAvg = 13. self.EmuAvg = 15.8 se...
{ "content_hash": "00bd63899404bf3bbb07dcd205266205", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 119, "avg_line_length": 37.123893805309734, "alnum_prop": 0.5567342073897497, "repo_name": "brainsqueeze/bipolar_osc", "id": "de2d93bdfc0e8cec45418b89661fc3944d4282db", "s...
from rest_framework import serializers from api.models import GameRoom, Player, Question, Answer class GameRoomSerializer(serializers.ModelSerializer): class Meta: model = GameRoom fields = '__all__' write_only_fields = ('password') extra_kwargs = { 'name': { ...
{ "content_hash": "5f05cb0a0a3ecdf301ca92d42f7574ce", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 104, "avg_line_length": 29.037037037037038, "alnum_prop": 0.6651785714285714, "repo_name": "kevincianfarini/whosaidit", "id": "982fc3318cdc97d453ffb6604b05685e5aa3d5bc", "s...
from __future__ import print_function import numpy as np import cv2 as cv import sys def randomColor(): color = np.random.randint(0, 255,(1, 3)) return color[0].tolist() def perspectiveCorrection(img1Path, img2Path ,patternSize ): img1 = cv.imread(cv.samples.findFile(img1Path)) img2 = cv.imread(cv....
{ "content_hash": "3079a59bbb3b953b6c337a151a8a9afb", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 97, "avg_line_length": 32.52857142857143, "alnum_prop": 0.6416337285902504, "repo_name": "opencv/opencv", "id": "184c44efd866cd5933e2ab01346e2bd2d594072d", "size": "2351", ...
import copy import unittest from scrapy.exceptions import DropItem from FourmiCrawler import pipelines, spider, items class TestPipelines(unittest.TestCase): def setUp(self): self.testItem = items.Result() def test_none_pipeline(self): # Testing the pipeline that replaces the None values in...
{ "content_hash": "fbb62dc5b0eee70dc453aa43db17b6ea", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 96, "avg_line_length": 35.698113207547166, "alnum_prop": 0.6569767441860465, "repo_name": "jjdekker/Fourmi", "id": "eb2b0702b33bb943d336e38055a623644e92b688", "size": "1892...
''' detect cyclic parent/child, and insert weakref ''' class Parent: def __init__(self, y:int, children:[]Child ): self.children = children self.y = y def create_child(self, x:int, parent:Parent) ->Child: child = Child(x, parent) self.children.push_back( child ) return child def say(self, msg:string): ...
{ "content_hash": "e1fe2df0609813c0cc53ab104218c9c3", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 59, "avg_line_length": 21.964912280701753, "alnum_prop": 0.65814696485623, "repo_name": "tempbottle/Rusthon", "id": "ffe3a4e926d1b161f41462481485f0413aab32e4", "size": "125...
if __name__ != "__main__": # place library initialization code here pass else: from lib.Functions import Exit Exit.printThisIsNoExecutableFile("The PoC-Library - Python Module Simulator.vSimSimulator") # load dependencies from pathlib import Path from Base.Exceptions import * from Simulator.Base import PoCSimulat...
{ "content_hash": "202be00f805c439a98c3bd3b182813c7", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 140, "avg_line_length": 38.83393501805054, "alnum_prop": 0.6146695175234731, "repo_name": "hoangt/PoC", "id": "8836f72ab5c371ebc9f9bd8544665f21d2cbd607", "size": "11999", ...
"""Config flow for Nightscout integration.""" from asyncio import TimeoutError as AsyncIOTimeoutError import logging from aiohttp import ClientError, ClientResponseError from py_nightscout import Api as NightscoutAPI import voluptuous as vol from homeassistant import config_entries, exceptions from homeassistant.cons...
{ "content_hash": "9a489a19894805ed93acf0b9b77f1b19", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 88, "avg_line_length": 34.68493150684932, "alnum_prop": 0.6571879936808847, "repo_name": "adrienbrault/home-assistant", "id": "2b91395d37733ff8d1d43778108bad74e9c99ca9", "s...