text
stringlengths
4
1.02M
meta
dict
from . import VecEnvWrapper from baselines.common.running_mean_std import RunningMeanStd import numpy as np class VecNormalize(VecEnvWrapper): """ A vectorized wrapper that normalizes the observations and returns from an environment. """ def __init__(self, venv, ob=True, ret=True, clipob=10., cli...
{ "content_hash": "f457987fa124ece910dc82c7b2acde4c", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 120, "avg_line_length": 31.691176470588236, "alnum_prop": 0.5591647331786543, "repo_name": "dsbrown1331/CoRL2019-DREX", "id": "50ef59e14360d959e5c81bc0818e10f5fd4c8db1", "s...
from __future__ import print_function import sys, os import logging from ginga import AstroImage, colors import ginga.toolkit as ginga_toolkit from ginga.canvas.CanvasObject import get_canvas_types from ginga.util.toolbox import ModeIndicator from ginga.misc import log class FitsViewer(object): def __init__(sel...
{ "content_hash": "b0b31ecd50c09875a389e3589fd87760", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 82, "avg_line_length": 31.929765886287626, "alnum_prop": 0.572745365036137, "repo_name": "eteq/ginga", "id": "bd233016416cb2689697ab9bb4f93ff443258d41", "size": "9682", ...
import multiprocessing from subprocess import check_call import sys from helpers import LuigiTestCase import mock from psutil import Process from time import sleep import luigi import luigi.date_interval import luigi.notifications from luigi.worker import TaskException, TaskProcess from luigi.scheduler import DONE, F...
{ "content_hash": "3ac854ce4bd1d46252c2207c424f952e", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 97, "avg_line_length": 32.59, "alnum_prop": 0.6333231052470083, "repo_name": "humanlongevity/luigi", "id": "02c9627f3279c0a842d8489aa487f6c7c39824f3", "size": "3862", "b...
"""utils for ipython notebooks""" from __future__ import division import os, json from ut.pstr.to import file as str_to_file import re from ut.pfile.iter import recursive_file_walk_iterator_with_filepath_filter default_link_root = 'http://localhost:8888/notebooks/' def _link_root_from_port(port): return 'http:...
{ "content_hash": "a22f764df8f1a2e70fd8e9bbdf533938", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 120, "avg_line_length": 31.816326530612244, "alnum_prop": 0.5950395552704725, "repo_name": "thorwhalen/ut", "id": "68ec1edb005b2545b6253d8bb2e71604e1548958", "size": "4677...
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() movie = Table('movie', pre_meta, Column('id', INTEGER, primary_key=True, nullable=False), Column('name', VARCHAR(length=64)), Column('avguserscore', VARCHAR(length=10)), Col...
{ "content_hash": "781df1ac45ff977618c700b1ea52cad0", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 68, "avg_line_length": 35.89473684210526, "alnum_prop": 0.66911045943304, "repo_name": "fixpy/watched_movies", "id": "e72ede03c0c6cfc723eb68043d20b54fe59d1500", "size": "20...
import angr ###################################### # openlog ###################################### class closelog(angr.SimProcedure): #pylint:disable=arguments-differ def run(self, ident, option, facility): # A stub for closelog that does not do anything yet. return
{ "content_hash": "72f9aa56909c64209d1a013a26217e81", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 24.583333333333332, "alnum_prop": 0.5050847457627119, "repo_name": "iamahuman/angr", "id": "80e0458d13c8d29eeae0e46c669e7507bfdaf1ff", "size": "296",...
from flexget import options from flexget.event import event from flexget.manager import Session from flexget.terminal import TerminalTable, console, table_parser from . import db def do_cli(manager, options): if options.action == 'clear': num = db.clear_entries(options.task, all=True) console('%s...
{ "content_hash": "97f28bbe3cce3b177c1d871df9db16d3", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 99, "avg_line_length": 34.526315789473685, "alnum_prop": 0.6158536585365854, "repo_name": "Flexget/Flexget", "id": "5ccf3f272833ea8c8bc51499f7670d8272804b62", "size": "1312...
from app.airport.sale_airports_parser import build_airports_list from app.common.http_methods_unittests import get_request from app.common.target_urls import SALE_1_AIRPORT_TEST_URL, SALE_2_AIRPORTS_TEST_URL import unittest class TestParserStaff(unittest.TestCase): def test_sale_1_airport(self): html_pag...
{ "content_hash": "d9c8bfde08cc07b89cec46e948639ffa", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 84, "avg_line_length": 40.75675675675676, "alnum_prop": 0.6836870026525199, "repo_name": "egenerat/flight-manager", "id": "d4334a6370be27807a2db6ade7c98825421d0104", "size"...
def getcallargs(func, *args, **kwds): '''Get the actual value bounded to each formal parameter when calling `func(*args,**kwds)`. It works for methods too (bounded, unbounded, staticmethods, classmethods). @returns: `(bindings, missing_args)`, where: - `bindings` is a mapping of every formal p...
{ "content_hash": "7f9e2b1eb8f211ee135f8260995ff1b2", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 84, "avg_line_length": 43.96666666666667, "alnum_prop": 0.5241344452868335, "repo_name": "ActiveState/code", "id": "7f6a69a0087300bd03c6fe52d86aee0a346352ef", "size": "3957...
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class AssopyApphook(CMSApp): name = _("Assopy") urls = ["assopy.urls"] class ConferenceApphook(CMSApp): name = _("Conference") urls = ["conference.urls"] class P3Apphoo...
{ "content_hash": "7208c1ba8300513a76bc42cb63e4216e", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 55, "avg_line_length": 20.724137931034484, "alnum_prop": 0.7054908485856906, "repo_name": "barrachri/epcon", "id": "e6105f44ef483483f8fb36612c3adb87ddb3915a", "size": "601"...
from django.core.management.sql import sql_delete, sql_all def sql_reset(app, style, connection): "Returns a list of the DROP TABLE SQL, then the CREATE TABLE SQL, for the given module." return sql_delete(app, style, connection) + sql_all(app, style, connection)
{ "content_hash": "9d4ff31a64a8e3f25941fcf2b476b3f1", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 92, "avg_line_length": 54.4, "alnum_prop": 0.7389705882352942, "repo_name": "gregmuellegger/django-reset", "id": "e240c5765633bde1a262a772c590018ad1251143", "size": "272", ...
''' ooiservices.config Configuration Management for OOI Services ''' import yaml import pkg_resources def reload(): __config_file__ = pkg_resources.resource_string(__name__, "config.yml") __config_dict__ = yaml.load(__config_file__) globals().update(__config_dict__) reload() # Initialize the globals on...
{ "content_hash": "fdd12a865ed4da4bc57a098aa6b4c30f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 21.9375, "alnum_prop": 0.6923076923076923, "repo_name": "ednad/ooi-ui-services", "id": "3aa34566bde6e91ea34c2e9c0a2e95cf41e0cd47", "size": "374", "...
import hashlib import os.path from .compat import IO_ERRORS class FileHashCache: def __init__(self, initial_data): self.file_hashes = {} self.previous_file_hashes = {} if initial_data: self.previous_file_hashes = { os.path.abspath(f): h for f,...
{ "content_hash": "7c167a5eb200d013a489b8e96135c0dc", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 61, "avg_line_length": 25.46938775510204, "alnum_prop": 0.5512820512820513, "repo_name": "mhallin/cov-exclude-py", "id": "232e280ea9d82c9217176bb3d93bd0e6d3945a88", "size":...
from yowsup.structs import ProtocolEntity, ProtocolTreeNode class StreamErrorProtocolEntity(ProtocolEntity): TYPE_CONFLICT = "conflict" ''' <stream:error> <conflict></conflict> <text>Replaced by new connection</text> </stream:error> ''' TYPE_ACK = "ack" ''' <stream:er...
{ "content_hash": "547e040fb7b22967fde1dce4145d71d6", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 75, "avg_line_length": 27, "alnum_prop": 0.590347923681257, "repo_name": "svub/whatsapp-rest-webservice", "id": "10882e8dd0be231f70b9f41719ef5686e833a0b4", "size": "1782", ...
from themis.group import Groups import re, yaml from themis.utils import is_valid_redis_key, BaseData, Features, ThemisMetaData from themis.static import POLICY_CUSTOM_CALLBACK, FEATURES_CUSTOM_CALLBACK, \ METADATA_CUSTOM_CALLBACK, DEFAULT_FEATURES_VALUES, RESERVERD_KEYWORDS class PolicyError(Exception): pass class P...
{ "content_hash": "d484b370f7cfa9b0281fc63a5ef623d9", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 140, "avg_line_length": 40.938428874734605, "alnum_prop": 0.653874079452339, "repo_name": "sandromello/themis-py", "id": "d4476d3aa8385aea36b9c3e8f142b5254ab4b778", "size"...
import asyncio import time from typing import Awaitable, Callable, Dict, Generic, TypeVar import prometheus_client as pc # type: ignore import sortedcontainers from prometheus_async.aio import time as prom_async_time # type: ignore CACHE_HITS = pc.Counter('cache_hits_count', 'Number of Cache Hits', ['cache_name']) ...
{ "content_hash": "ce9fb047c642530d28963881bf7a76a1", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 110, "avg_line_length": 34.56521739130435, "alnum_prop": 0.6091194968553459, "repo_name": "hail-is/hail", "id": "e577d4801a21e5f7ea7346f4782f2547b09d86d0", "size": "3180", ...
"""Provide some utilities""" import logging from os import PathLike from pathlib import Path from io import StringIO from typing import ( Any, Callable, Iterable, List, Mapping, Optional, Tuple, Union ) # pylint: disable=unused-import try: # pragma: no cover from functools import cached_property except ImportEr...
{ "content_hash": "e29017cf9d7f4b74a228784b9166a78d", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 76, "avg_line_length": 30.281045751633986, "alnum_prop": 0.6025253615368013, "repo_name": "pwwang/pyppl", "id": "c43930fb5e21d5e9b90277b75e1c44ec03eb4ac0", "size": "9268",...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "2c2cba75e4e6eede7f36eac0fae35745", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 390, "avg_line_length": 39.07446808510638, "alnum_prop": 0.7247481622651784, "repo_name": "adamb70/CSGO-Market-Float-Finder", "id": "0628009d7d61134b498691c7f0f34c71addf7d75"...
import mock import netaddr import testtools from neutron.agent.common import utils # noqa from neutron.agent.linux import ip_lib from neutron.common import exceptions from neutron.tests import base NETNS_SAMPLE = [ '12345678-1234-5678-abcd-1234567890ab', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'cccccccc-...
{ "content_hash": "18fcbd0bbfbc9c222880a02a96bdadf3", "timestamp": "", "source": "github", "line_count": 1303, "max_line_length": 79, "avg_line_length": 43.116653875671524, "alnum_prop": 0.53644470550542, "repo_name": "SamYaple/neutron", "id": "af205002da3851e94d3e0ed7687ae61ca445e85e", "size": "568...
from __future__ import division import base64 import os import vistrails.core.db.action from vistrails.core.modules.basic_modules import File, Boolean, String, Directory from vistrails.core.modules.vistrails_module import Module, ModuleError, NotCacheable from vistrails.core.vistrail.vistrail import Vistrail from vist...
{ "content_hash": "300ca60ca9f13da138b6f13dbdc663a0", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 86, "avg_line_length": 39.479166666666664, "alnum_prop": 0.5980650835532102, "repo_name": "VisTrails/VisTrails", "id": "e528e11e04e342f98d3a60052b05548084527b68", "size": ...
import copy from core import actor from core.actor import * from ui import text, infobubble from utils import utility def load_data(): Balloon.pickup_sound = utility.load_sound('pop') Bonus250.master_animation_list.build_animation('Idle', ['balloonblue']) Bonus500.master_animation_list.build_animation('I...
{ "content_hash": "edf20c206c61fa50c1ee244e78b76a60", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 111, "avg_line_length": 33.084848484848486, "alnum_prop": 0.6021249313061, "repo_name": "JoshuaSkelly/TroubleInCloudLand", "id": "539ccda95391968012de8cf470bb4028b0aa25e1", ...
""" tests.test_component_mqtt_eventstream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests MQTT eventstream component. """ import json import unittest from unittest.mock import ANY, patch import homeassistant.components.mqtt_eventstream as eventstream from homeassistant.const import EVENT_STATE_CHANGED from homeassistant....
{ "content_hash": "cacf6393278bd62bb40d228244ae237b", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 78, "avg_line_length": 35.143884892086334, "alnum_prop": 0.6374616171954964, "repo_name": "sfam/home-assistant", "id": "5e1680ad2a424e302a31bd38632cab1bcff1f5c2", "size": ...
from selenium.webdriver.common.keys import Keys from tests.integration.tests.test_textarea import Test as TestTextarea from . import VisualTest class Test(VisualTest): urls = TestTextarea.urls def test_test_default_usecase(self): self.driver.get('%s%s' % (self.live_server_url, TestTextarea.test_defa...
{ "content_hash": "56048ecece5b7f85267807adf337eea0", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 102, "avg_line_length": 50.19642857142857, "alnum_prop": 0.6905016008537886, "repo_name": "afifnz/django-material", "id": "6d3d3c26c69371187cbe6f395a47c1fc9b6dd83a", "size"...
import datetime from controler import webControl from models import messageModel import logging __author__ = 'Jesse' class JSON(webControl): """ Forwards all JSON related HTTP requests to controller methods""" @classmethod def getMessages(cls, self): """Handles text JSON GET requests GETS should be...
{ "content_hash": "9f4f29bc7ebecfabf40543b2ed63cbcc", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 102, "avg_line_length": 33.47457627118644, "alnum_prop": 0.6548860759493671, "repo_name": "Jelloeater/forgeLandWall", "id": "9b997d70e21521f148072665ab481d148f038ed4", "si...
""" This is the single point of entry to generate the sample configuration file for dragonflow. It collects all the necessary info from the other modules in this package. It is assumed that: * every other module in this package has a 'list_opts' function which return a dict where * the keys are strings which are t...
{ "content_hash": "bed2bd656c27ea301c22c5338cdbbe06", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 33.836363636363636, "alnum_prop": 0.645889306824288, "repo_name": "openstack/dragonflow", "id": "f107ab4ea6b059b80b6de60a0f73681f914ea894", "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 CreateInvite(Choreography): def __init__(self, temboo_session): """ Create a ...
{ "content_hash": "f497abea5dc448278845c47ba2c162a2", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 215, "avg_line_length": 46.40659340659341, "alnum_prop": 0.6940563580393085, "repo_name": "jordanemedlock/psychtruths", "id": "ad0fa7c6517b0cc3e0e04b248b8071b8d35346b8", "s...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class ZapWalletTXesTest (BitcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 3 def setup_network(self, split=False): self....
{ "content_hash": "c680bc04de433ce2000e1900866cbab9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 106, "avg_line_length": 37, "alnum_prop": 0.612987987987988, "repo_name": "psionin/smartcoin", "id": "c5a329d0c6e9586968d80c250391197005d776d1", "size": "2879", "binary":...
from pyearth._record import ForwardPassRecord, ForwardPassIteration from pyearth._util import gcv from ..testing_utils import assert_list_almost_equal num_samples = 1000 num_variables = 10 penalty = 3.0 sst = 100.0 varnames = ['x' + str(i) for i in range(num_variables)] record = ForwardPassRecord(num_samples, num_var...
{ "content_hash": "9d9c40007fd1682d41049e2549a4e7d7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 69, "avg_line_length": 38.411764705882355, "alnum_prop": 0.6378254211332313, "repo_name": "DucQuang1/py-earth", "id": "86ea5d990227e6b8efc18d1e915252f2a29637bd", "size": "1...
"""QwikSwitch USB Modem library for Python. See: http://www.qwikswitch.co.za/qs-usb.php Currently supports relays, buttons and LED dimmers Source: http://www.github.com/kellerza/pyqwikswitch """ import logging import math from enum import Enum import attr _LOGGER = logging.getLogger(__name__) QS_CMD = 'cmd' CMD_B...
{ "content_hash": "a3777ade45dd1fe8750a8dbef0c0f750", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 79, "avg_line_length": 29.035211267605632, "alnum_prop": 0.5511763279165656, "repo_name": "kellerza/pyqwikswitch", "id": "5ddf845b0adcb9c8f293764524ae550119bcdca4", "size"...
from six import with_metaclass, text_type as unicode import inspect import os.path from robot.errors import DataError from robot.utils import (get_error_details, is_string, is_list_like, is_dict_like, split_args_from_name_or_path, type_name, Importer) from .loggerhel...
{ "content_hash": "2a0e9e1bcada69626892bfb075e58cb7", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 86, "avg_line_length": 39.32156862745098, "alnum_prop": 0.5768425251820086, "repo_name": "userzimmermann/robotframework", "id": "034b7a6de231e5c6f2504a5636fc35f8c1512417", ...
import numpy as np def swap_signs(cameras, x3d): """ Swaps signs of the camera and 3D points so the projective depths are positive Parameters ---------- camera: list Camera matrices x3d: numpy array array containing 3D points Returns ------- camera: cameras w...
{ "content_hash": "08946ee10e791b94cd26c54f7b9a4953", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 66, "avg_line_length": 20.045454545454547, "alnum_prop": 0.5816326530612245, "repo_name": "guillempalou/scikit-cv", "id": "b22128667339457c8ec2b4b2145af5f0e6abb55f", "size"...
from reporter.emailing import ( RECIPIENT_SPIRAL_ADMIN as RECIPIENT_ADMIN ) from reporter.uhl_reports.civicrm.enrolment_dq import ( DuplicateStudyIdReport, MissingStudyNumber, MultipleRecruitementsReport, CivicrmInvalidCaseStatus ) from reporter.core import Schedule CASE_TYPE_ID = 25 ...
{ "content_hash": "cf0758f991c6ebf5722d2658cf01d4af", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 69, "avg_line_length": 25.74074074074074, "alnum_prop": 0.5719424460431655, "repo_name": "LCBRU/reporter", "id": "5c7de2b7b288b25b2785ff9cc398c06104628308", "size": "1414",...
import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import compute from nova.compute import utils as compute_utils from nova import exception from nova import network from nova.openstack.common import log as logging LOG = logging...
{ "content_hash": "c9edb78b1ce199bcff507e3150df598b", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 79, "avg_line_length": 35.68027210884354, "alnum_prop": 0.6147759771210677, "repo_name": "NoBodyCam/TftpPxeBootBareMetal", "id": "6fb9f0cc1a0c67513cd79e0496c284b0bef7846f", ...
from typing import Dict from ezdxf.document import Drawing from ezdxf.tools import codepage from ezdxf.sections.header import HeaderSection from ezdxf.sections.classes import ClassesSection from ezdxf.sections.tables import TablesSection from ezdxf.sections.blocks import BlocksSection from ezdxf.sections.entities imp...
{ "content_hash": "f89c8b91b8e88987f86e6cd4884ecdeb", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 88, "avg_line_length": 32.825581395348834, "alnum_prop": 0.6687920651788877, "repo_name": "mozman/ezdxf", "id": "a198fa081cec619c666b3720a2e16aa98d6e4961", "size": "2888", ...
"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_databas...
{ "content_hash": "7653d79cdc7d081e6a60c03ec3af39ca", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 518, "avg_line_length": 54.77142857142857, "alnum_prop": 0.8069900886802295, "repo_name": "postlund/pyatv", "id": "0ed694ba2dec66f502c6b47e817adad22d46a70f", "size": "2066"...
from gi.repository import Gtk, Gdk, Pango, PangoCairo, GdkPixbuf, GLib import cairo import sys import os import numpy from threading import Thread, Condition, Event, Lock from time import sleep, time try: import cv2 except: print("python-opencv is required for video access. Please install.") from cave.libcave...
{ "content_hash": "4aed5241b1b89e9507ccd0d1a5d1dd49", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 223, "avg_line_length": 34.97752808988764, "alnum_prop": 0.5672984259556698, "repo_name": "cuauv/software", "id": "6cb12bee1f72b9d21f0f41a039c85d267b1766fe", "size": "1245...
from __future__ import absolute_import import posixpath import errno from urlparse import urlparse class ProxyFS(object): def __init__(self, filesystems_dict, default_scheme): if default_scheme not in filesystems_dict: raise ValueError( 'Default scheme "%s" is not a member of provided schemes: %...
{ "content_hash": "a9017fbea3a1f76bdf2e3ea11a40e94c", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 114, "avg_line_length": 33.943005181347154, "alnum_prop": 0.648450618226225, "repo_name": "MobinRanjbar/hue", "id": "e6cd18a9f8e5bdb6e05719256d7371a1c65f721a", "size": "73...
""" Created on Fri Oct 9 14:59:18 2015 @author: radar """ import sys from distutils.core import setup, Extension compile_args = [-03] setup(name='APE', version = '0.1.0', description = 'Automated PEST Enviornment', author = 'Nick Voss', author_email = 'nvoss@mail.usf.edu', licsence = '...
{ "content_hash": "0152e64838c2a8d7f8887778a47afae3", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 20.263157894736842, "alnum_prop": 0.5922077922077922, "repo_name": "nvoss12838/APE", "id": "635b860df659079394a7c36649f652cd1c29856c", "size": "409",...
from matplotlib import colors as mcolors import matplotlib.pyplot as plt import scipy.io import numpy as np from ..features import build_features firebrick=mcolors.CSS4_COLORS['firebrick'] red=mcolors.CSS4_COLORS['red'] coral=mcolors.CSS4_COLORS['coral'] seagreen=mcolors.CSS4_COLORS['seagreen'] grey=mcolors.CSS4_COLO...
{ "content_hash": "f5972198e0424ba073d9fb5037992503", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 182, "avg_line_length": 38.01190476190476, "alnum_prop": 0.6313811462574381, "repo_name": "curious-abhinav/change-point", "id": "a94c0c0a1df82c04a65d30bfce258e1b1fd1c718", ...
import os from oslo_log import log as logging from oslo_utils import netutils from trove.common import cfg from trove.common.db.postgresql import models from trove.common import exception from trove.common.i18n import _ from trove.common import stream_codecs from trove.common import utils from trove.guestagent.backup....
{ "content_hash": "9f3a7c9b6931dffdee7c1c151bdbde62", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 79, "avg_line_length": 41.144827586206894, "alnum_prop": 0.5952899765336909, "repo_name": "zhangg/trove", "id": "cdfd4649fb66459f0a564e72e54248375a291e1a", "size": "12559"...
from bs4 import BeautifulSoup import string import sys from setting import proxy_enable,proxy_url import urllib2 import mechanize def get_lyricsmint(url): """ get_lyrics received a lyricspagepage that fetch fro url provide by get_link ,and give user a lyrics user wish""" lyric="" if(proxy_enable): ...
{ "content_hash": "5817f00d5cd2f29c8e0b8de44c2a2bdf", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 37.52173913043478, "alnum_prop": 0.6477404403244496, "repo_name": "ceaniket/lyricsar", "id": "fab34a4df4bf36ac5443c53f36eb20230ecd4f83", "size": "172...
import logging from jcli import exception from server import Server logging.basicConfig(level=logging.INFO, format='%(message)s') logger = logging.getLogger() class Plugin(Server): """Manages plugin command execution""" def __init__(self, action, url, user, password, plugin_args=None): super(Plugin...
{ "content_hash": "df87bbbbcfe26e62dd55cf21a9a60060", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 72, "avg_line_length": 31.216666666666665, "alnum_prop": 0.5568606513614522, "repo_name": "bregman-arie/jcli", "id": "832566ce1dc8e0d50073cbec2e33d958c3ae256c", "size": "24...
from JumpScale import j class ActorsInfo(): def getActorMethodCall(self, appname, actor, method): """ used for during error show links to methods in browser """ url = "/rest/%s/%s/%s?" % (appname, actor, method) auth = j.portal.server.active.ws.routes["%s_%s_%s" % (appnam...
{ "content_hash": "eebc2642fe70d56f4ed595506cf6708a", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 117, "avg_line_length": 39.608333333333334, "alnum_prop": 0.5409215232484746, "repo_name": "Jumpscale/jumpscale_portal8", "id": "3dafbfce7fc2532e796f6b119b69d6b4ac0a2394", ...
from django.views.generic import TemplateView from opendata.catalog.models import UrlImage class Home(TemplateView): template_name = 'home.html' def get_context_data(self, **kwargs): context = super(Home, self).get_context_data(**kwargs) random_feature = UrlImage.objects.select_random() ...
{ "content_hash": "50d00279ed26a2d3445f01f0261adf0f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 62, "avg_line_length": 30, "alnum_prop": 0.7, "repo_name": "openrural/open-data-nc", "id": "f2824aea9e3483d3bec704648156316c844439d5", "size": "390", "binary": false, "...
import unittest from .fake_api_client import make_fake_client from .fake_api import FAKE_SECRET_NAME class CreateServiceTest(unittest.TestCase): def test_secrets_repr(self): client = make_fake_client() secret = client.secrets.create(name="super_secret", data="secret") assert secret.__repr...
{ "content_hash": "d9bd42a434dfe2e1b1a48fdabbb2245f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 74, "avg_line_length": 32.90909090909091, "alnum_prop": 0.6878453038674033, "repo_name": "docker/docker-py", "id": "1c261a871ff20e6af03aa235aa99df2213287eb7", "size": "362"...
from __future__ import unicode_literals import bluebottle.utils.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0078_auto_20180528_1414'), ] operations = [ migrations.AlterField( model_name='projectlocatio...
{ "content_hash": "6fd3f402dadec85e72a4e30f71e6f855", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 121, "avg_line_length": 30.25, "alnum_prop": 0.6322314049586777, "repo_name": "onepercentclub/bluebottle", "id": "9980988b6ab8afc0decde3a19f66f2f9a2501ded", "size": "799", ...
from django.db import models from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.contrib.auth import authenticate class OpenIDProfile(models.Model): user = models.ForeignKey(User) site = models.ForeignKey(Site, default=Site.objects.get_current) identity = m...
{ "content_hash": "6bba658988d812fa48ab2ffc0d26170e", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 88, "avg_line_length": 35.175, "alnum_prop": 0.6986496090973703, "repo_name": "Soovox/django-socialregistration", "id": "964ade80793bc31d48e4fba2ba58f12d6a76fcab", "size": ...
"""Jacobian ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.python.ops import gradients_impl as gradie...
{ "content_hash": "7dd1e38cf9ee8a29d919106fb088110d", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 80, "avg_line_length": 39.1578947368421, "alnum_prop": 0.6610983102918587, "repo_name": "freedomtan/tensorflow", "id": "81a00d4ab692e2a96a9acdf7d8a7f81b3afde3c9", "size": ...
from ghhu.telefone import Telefone class Telefonista: def __init__(self): self._telefone = Telefone() self._contatos = [] def adicionar_contato(self, nome, numero): self._contatos.append((nome, numero)) def ligar_para_todos_contatos(self, telefone=None): tel = self._telef...
{ "content_hash": "81a8aa3246fbf5743b8fb619bfa10eb7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 101, "avg_line_length": 34.13333333333333, "alnum_prop": 0.646484375, "repo_name": "renzon/hotel-urbano", "id": "8a5a790502d5bac022acb8dd6265682a9ceb059a", "size": "512", ...
from designate.objects.blacklist import Blacklist # noqa from designate.objects.domain import Domain # noqa from designate.objects.quota import Quota # noqa from designate.objects.rrdata_a import RRData_A # noqa from designate.objects.rrdata_aaaa import RRData_AAAA # noqa from designate.objects.rrdata_cname import...
{ "content_hash": "664e2bbf4e28c8c397442ca8ef1e8e48", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 63, "avg_line_length": 56.8, "alnum_prop": 0.8045774647887324, "repo_name": "richm/designate", "id": "a49d2befaa7ac0a4c77154633b2f3a08081a3fc3", "size": "1774", "binary":...
""" Goal: simplify the code when interacting with entities Usage when declaring a model: import db class MyEntity(db.Model, CRUDMixin): id = db.Column('myID', db.Integer, primary_key=True) data = db.Column('myData', db.String(255)) MyTableEntity.create(data="abc") my = MyTableEntity(data="abc") db.session.s...
{ "content_hash": "9ffbd555d6a8d003e8d29a4e8b042d29", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 59, "avg_line_length": 24.423728813559322, "alnum_prop": 0.6141568355308813, "repo_name": "indera/redi-dropper-client", "id": "90b023243400c030e027fc1817ecefd5ee2c6d9f", "s...
import os import argparse import ConfigParser configfile = None logfile = None is_daemon = False be_verbose = False def parse_args() : global configfile, logfile, is_daemon, be_verbose ap = argparse.ArgumentParser(description="Collector and correlator of Netflow v5, v9 and IPFIX flows and Syslog messages...
{ "content_hash": "4b199ff8516e56aa8b181cc3e5ab868a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 126, "avg_line_length": 32.75806451612903, "alnum_prop": 0.6149679960610537, "repo_name": "ilmarh/collectors", "id": "9d00fe9972a72be12fe081297f46eadc28e75def", "size": "20...
from .rowobjects import Row, BaseRow, cleanup_name, banned_columns from .selections import Selection
{ "content_hash": "dc21981cf1ab8a1be240c1089f745ef7", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 66, "avg_line_length": 50.5, "alnum_prop": 0.8217821782178217, "repo_name": "DolphDev/PSV", "id": "308c45d5169ce0d1fbcb44b7ed3fc43bf41108d8", "size": "101", "binary": fals...
"""Provide some handy classes for user to implement a simple computation module in Python easily. """ import logging from .base_module import BaseModule from ..initializer import Uniform from .. import ndarray as nd class PythonModule(BaseModule): """A convenient module class that implements many of the module AP...
{ "content_hash": "a950fc0e82597f405cd1b0cbe6c5e410", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 98, "avg_line_length": 40.50148367952522, "alnum_prop": 0.5830463770239578, "repo_name": "arikpoz/mxnet", "id": "f46ea280aaff7bf939029e5e1597363255a63ca0", "size": "13716"...
from django.conf import settings from django_lean.experiments.models import GoalRecord from django_lean.experiments.signals import goal_recorded, user_enrolled from django_lean.lean_analytics import get_all_analytics def analytics_goalrecord(sender, goal_record, experiment_user, *args, **kwargs): if getattr(sett...
{ "content_hash": "9ef1b7ad6f59c077655f5d04e09e43e8", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 80, "avg_line_length": 42.666666666666664, "alnum_prop": 0.68359375, "repo_name": "MontmereLimited/django-lean", "id": "664f83068e6034b50470488fa17ce638acd8e002", "size": "...
from django.db import models class User(models.Model): name = models.CharField(max_length=32) mail = models.EmailField() def __repr__(self): return "{}: {}".format(self.pk, self.name) __str__ = __repr__ class Entry(models.Model): STATUS_DRAFT = "draft" STATUS_PUBLIC = "public" ST...
{ "content_hash": "f98f6634f5196b127a8340353bb058d1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 30.916666666666668, "alnum_prop": 0.6361185983827493, "repo_name": "t-yanaka/zabbix-report", "id": "288a240c9707a59e79c4ea2a3063d4cc0e096b74", "size"...
""" py_vollib.ref_python.black_scholes_merton.greeks.numerical ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A library for option pricing, implied volatility, and greek calculation. py_vollib is based on lets_be_rational, a Python wrapper for LetsBeRational by Peter Jaeckel as described below. :copyrigh...
{ "content_hash": "7a04a4e03da375bdcda44247ef43fc63", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 215, "avg_line_length": 29.729468599033815, "alnum_prop": 0.601559961000975, "repo_name": "vollib/py_vollib", "id": "2976160e3407c0dc19c086a9d70a2ba297af86d1", "size": "61...
from __future__ import print_function, division from hscom import __common__ (print, print_, print_on, print_off, rrr, profile, printDBG) = __common__.init(__name__, '[encounter]', DEBUG=False) # Python from itertools import izip # Science import networkx as netx import numpy as np from scipy.cluster.hierarchy import ...
{ "content_hash": "5788208835c832d9d116e6b81e5a8ece", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 93, "avg_line_length": 35.819148936170215, "alnum_prop": 0.6094446094446094, "repo_name": "SU-ECE-17-7/hotspotter", "id": "83c58fb55f9693b2548ffbe4dd2db3b2d7c800db", "size...
"""Module containing utils to get and check lab status.""" import json import logging import re import time import urllib from chromite.cbuildbot import constants logger = logging.getLogger('chromite') class LabIsDownException(Exception): """Raised when the Lab is Down.""" class BoardIsDisabledException(Excep...
{ "content_hash": "ab073b5ec5f4629e74d8897f239f6054", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 77, "avg_line_length": 32.45744680851064, "alnum_prop": 0.6719108489019994, "repo_name": "bpsinc-native/src_third_party_chromite", "id": "708f171083d937c28e43ee3fc84ba2e98de0...
from six import StringIO from django.core.files.base import ContentFile from django_downloadview import VirtualDownloadView from django_downloadview import VirtualFile from django_downloadview import TextIteratorIO class TextDownloadView(VirtualDownloadView): def get_file(self): """Return :class:`django...
{ "content_hash": "df97cd35b870ad0f56c53e3ee349f49e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 30.333333333333332, "alnum_prop": 0.7092907092907093, "repo_name": "fladi/django-downloadview", "id": "3dc8ed2f2274e57e4fbb547a9b2c94d9fcbe205e", "si...
"""[DEPRECATED] Utilities for connecting to kernels Moved to IPython.kernel.connect """ import warnings warnings.warn("IPython.lib.kernel moved to IPython.kernel.connect in IPython 1.0", DeprecationWarning ) from IPython.kernel.connect import *
{ "content_hash": "aa0d4bf4d86e23d6f9457f35a9343db5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 82, "avg_line_length": 25.09090909090909, "alnum_prop": 0.7101449275362319, "repo_name": "mattvonrocketstein/smash", "id": "f1e623fc82ed1c18873acced9acb4f9069c0ea2c", "size...
import os from app import create_app, db from app.models import User, Role, Permission from flask.ext.script import Manager, Shell from flask.ext.migrate import Migrate, MigrateCommand app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) def make_shell_context():...
{ "content_hash": "1834841b534d1a2a33e66ebeda1dde74", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 27.444444444444443, "alnum_prop": 0.7219973009446694, "repo_name": "jeromefiot/FEED2TW", "id": "30e9a36a2474a79b742932d9e48a8101ab43ec59", "size": "7...
from mycompany.common.auth import api # Blocking calls user_info = api.get_user(username="testuser") password_ok = api.check_passsword(password="Passw0rd1") api.user_registered.listen(my_callback) # Parallel calls async_result1 = api.get_user.async(username="testuser") async_result2 = api.check_passsword.async(passwo...
{ "content_hash": "09000a5c821ed218cb45a12092296f4c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 108, "avg_line_length": 37.142857142857146, "alnum_prop": 0.6990384615384615, "repo_name": "adamcharnock/lightbus", "id": "34c2f4805b19f2c7b9c84b7aff22f23b3434899c", "size"...
"""Estimator classes for BoostedTrees.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import collections import functools import numpy as np from tensorflow.core.kernels.boosted_trees import boosted_trees_pb2 from tensorflow.python.estimator...
{ "content_hash": "0a876fde6a74555680e57ecd561a795e", "timestamp": "", "source": "github", "line_count": 1550, "max_line_length": 115, "avg_line_length": 42.42193548387097, "alnum_prop": 0.6659518812543723, "repo_name": "girving/tensorflow", "id": "0278990cfc9bfcf18912886aa752da262e805573", "size": ...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_con_glass_beaker.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "0f473ed998f3f8ce04f199d4bf2493c0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 72, "avg_line_length": 23.153846153846153, "alnum_prop": 0.6877076411960132, "repo_name": "anhstudios/swganh", "id": "b59cb16f6d794c80595d5a6c02a752ecd8945b71", "size": "44...
""" weasyprint.tests.test_css_properties ------------------------------------ Test expanders for shorthand properties. :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals import ...
{ "content_hash": "5ba6f4fa698c5e497e3aabf53a663387", "timestamp": "", "source": "github", "line_count": 722, "max_line_length": 79, "avg_line_length": 39.677285318559555, "alnum_prop": 0.549167452089224, "repo_name": "marclaporte/WeasyPrint", "id": "c35f79e757db549b84a43fdce1e25c6dac554e95", "size"...
class beautyConsole: """This class defines properties and methods to manipulate console output""" # Black 0;30 Dark Gray 1;30 # Blue 0;34 Light Blue 1;34 # Green 0;32 Light Green 1;32 # Cyan 0;36 Light Cyan 1;36 # Red 0;31 Light R...
{ "content_hash": "fdc92a85b97b86b8c08469789f0c8dbb", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 80, "avg_line_length": 33.705882352941174, "alnum_prop": 0.5607911576497964, "repo_name": "bl4de/security-tools", "id": "603135fd038fe4617380a804100a75504b11213a", "size": ...
import pymel.core as pm import System.utils as utils reload(utils) from functools import partial class ControlModule: def __init__(self, _moduleNamespace): # Class variables self.moduleContainer = None self.blueprintNamespace = '' self.moduleNamespace = '' self.characterNamespace = '' self.publishe...
{ "content_hash": "1d01a8a31720eb6731379c81ab984068", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 164, "avg_line_length": 35.83791208791209, "alnum_prop": 0.7222690686086624, "repo_name": "Shadowtags/ModularRiggingTool", "id": "89642b13d11413cecacf29dd226208a4da8b003e", ...
"""The tests for the Template switch platform.""" import pytest from homeassistant import setup from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE from homeassistant.core import CoreState, State from homeassistant.setup import async_setup_component from tests.common import ( assert_setup_com...
{ "content_hash": "e0dba52a1fcf6ff3affcbc961ac61690", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 100, "avg_line_length": 32.497860199714694, "alnum_prop": 0.4374259251130328, "repo_name": "tchellomello/home-assistant", "id": "6dab2569e59129d1929974ba88f41de000d0f7ec", ...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for download in orm['downloads.Download'].objects.all(): download.visible = not download.do_not_list download.save() ...
{ "content_hash": "47fab5d0feb386839bc0439fbaee4709", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 195, "avg_line_length": 80.52147239263803, "alnum_prop": 0.5525333333333333, "repo_name": "praekelt/jmbo-downloads", "id": "4c83ff0c8481adc2f68063897bbd4f1ce608d11f", "siz...
import sys from os import path from subprocess import call from shutil import rmtree import json from re import sub from pprint import pprint " Terminal Colors " class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' ...
{ "content_hash": "bb9fdc00093cd108f3f6f3fc614d242e", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 121, "avg_line_length": 31.972602739726028, "alnum_prop": 0.506426735218509, "repo_name": "ericmdev/gsm", "id": "9ddb16dbaa93d5ffab54775230fdd5df5dc75d89", "size": "7043",...
from __future__ import print_function from math import sqrt from os.path import abspath, dirname, join import sys from time import localtime, strftime from git import Repo import json sys.path.append(abspath(dirname(dirname(__file__)))) from utils.data_io import load_numpy_array_from_file from utils.data_stats import ...
{ "content_hash": "3a681b2a7bd295a019ca7b65cd753043", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 80, "avg_line_length": 41.877300613496935, "alnum_prop": 0.5947846469381776, "repo_name": "jvanbrug/netflix", "id": "ca41b87e720f7330451c77c2bace9f8bcd59addd", "size": "68...
r""" Fourier transform ================= The graph Fourier transform :meth:`pygsp.graphs.Graph.gft` transforms a signal from the vertex domain to the spectral domain. The smoother the signal (see :meth:`pygsp.graphs.Graph.dirichlet_energy`), the lower in the frequencies its energy is concentrated. """ import numpy as...
{ "content_hash": "de19f507e7e89e0c1428f2f46cd084ae", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 29.804347826086957, "alnum_prop": 0.6447848285922684, "repo_name": "epfl-lts2/pygsp", "id": "ac89563c611960ba9eda8f79a335498b8563cd25", "size": "1371...
import numpy as np # Project from astropy import units as u from astropy.utils import ShapedLikeNDArray __all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute', 'EarthLocationAttribute', 'CoordinateAttribute', 'CartesianRepresentationAttribute', 'DifferentialAttribute'] class A...
{ "content_hash": "aa2607ed8bd3e0be6323b877ddafcdca", "timestamp": "", "source": "github", "line_count": 518, "max_line_length": 102, "avg_line_length": 34.9980694980695, "alnum_prop": 0.5936896684869546, "repo_name": "dhomeier/astropy", "id": "7e008ac477e6ad741b42555cc168e9a47fc93586", "size": "182...
''' Created on Aug 29 2015 @author: Kevin Chien ''' import types def import_resource(full_resource_name): index = full_resource_name.rfind(".") module_name = full_resource_name[0:index] resource_name = full_resource_name[index + 1:len(full_resource_name)] mod = __import__(module_name, fromlist=[r...
{ "content_hash": "de05b47d52d31badb50fb66cfb6997f8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 120, "avg_line_length": 32.67088607594937, "alnum_prop": 0.5784579620302208, "repo_name": "cchienhao/data_collector", "id": "23d76e88bebf75e34b58174b1cd26187b0b8af44", "siz...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('history', '0001_initial'), ] operations = [ migr...
{ "content_hash": "6e876eb7a31658bcf5da44ed35c758da", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 135, "avg_line_length": 30.925925925925927, "alnum_prop": 0.6275449101796408, "repo_name": "curiosityio/taiga-docker", "id": "b78c6da437879d192dc8b29a30a92884226cc29d", "si...
import botocore.session from derpconf.config import Config from mock import patch, MagicMock from thumbor.context import Context from tornado.testing import gen_test from fixtures.storage_fixture import IMAGE_PATH, IMAGE_BYTES, s3_bucket from tc_aws.loaders import s3_loader from tests import S3MockedAsyncTestCase cl...
{ "content_hash": "40a2ee9a0d230731152f976f8a5a3a6e", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 93, "avg_line_length": 30.373626373626372, "alnum_prop": 0.6067293777134588, "repo_name": "thumbor-community/aws", "id": "4da14c633512650c9b55165023f30cd10874d1ad", "size":...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() __title__ = 'Enclosure Groups' __version__ = '0.0.1' __copyright__ = '(C) Copyright (2012-2016) H...
{ "content_hash": "74c144a9212713f22ddaa86228333dd9", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 109, "avg_line_length": 33.55844155844156, "alnum_prop": 0.6002321981424149, "repo_name": "andreadean5/python-hpOneView", "id": "69afb699d9398994fbbe830bcdba8d2ccd8a2eef", ...
class GoudaError(Exception): pass
{ "content_hash": "34199ec59b0ac8e3f82f8d78ac4ecd63", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 28, "avg_line_length": 19, "alnum_prop": 0.7368421052631579, "repo_name": "NaturalHistoryMuseum/gouda", "id": "1cf17d3482dd03da5bf1a97ee32171f95a4885d2", "size": "38", "bi...
import os import warnings from pathlib import Path import pytest import numpy as np from astropy.tests.helper import assert_quantity_allclose from astropy.utils.data import get_pkg_data_filename from astropy.utils.iers import iers from astropy import units as u from astropy.table import QTable from astropy.time impor...
{ "content_hash": "c9a5b102046b388d01f716f5b27fd1ca", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 100, "avg_line_length": 43.86206896551724, "alnum_prop": 0.5826681180454766, "repo_name": "aleksandr-bakanov/astropy", "id": "960c22d6933186a4bcca949b7c15148c19ddcf2b", "s...
from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0012_auto_20150607_2207'), ('pages', '0014_socialplugin'), ] operations = [ migrations.CreateModel( name='FAQItemPlugin', fields=[ ('c...
{ "content_hash": "51b812d91546bb6701b2c5f5d6f9ae84", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 174, "avg_line_length": 34.34285714285714, "alnum_prop": 0.5316139767054908, "repo_name": "cjlee112/socraticqs2", "id": "bb5bfad75f49bf705c16530608107b5a91c3917e", "size": ...
"""Copyright 2016 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
{ "content_hash": "f5b2725f530f33cf42f23327118ec580", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 36.82089552238806, "alnum_prop": 0.6643696797730037, "repo_name": "google/cloudprint_logocert", "id": "ce15206b7850db220c985c0531c167a0b0d2a1f0", "si...
import copy from oslo.config import cfg from sqlalchemy.orm import exc from sqlalchemy.orm import joinedload from sqlalchemy.sql import expression as expr from neutron.common import constants as l3_constants from neutron.common import exceptions as n_exc from neutron.common import rpc as n_rpc from neutron.common imp...
{ "content_hash": "96e4d270887b87f05874e2a52bb4483c", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 79, "avg_line_length": 47.608130081300814, "alnum_prop": 0.5717066839714471, "repo_name": "leeseulstack/openstack", "id": "7d0c619ce6e729b83e9f70d019622848f9be2dc5", "size...
"""Library for creating transition objects. """ import toolz as tz import utils import exceptions def update_fn(trans, config): """Consume an update declaration of the form { 'episode_start': <name of update rule>, 'episode_end': <name of update rule> } and return a function that u...
{ "content_hash": "58c9782cd243d77d0223a319ad99c696", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 76, "avg_line_length": 27.575342465753426, "alnum_prop": 0.5603576751117735, "repo_name": "epfahl/auta", "id": "323dd55972507ec7ac9fcdbebafab854edf84ad5", "size": "2013", ...
"""Tests for kernel connection utilities Authors ------- * MinRK """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distribut...
{ "content_hash": "f5b0eb53d96a66c49b4c4d3e71ec62d6", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 87, "avg_line_length": 35.145161290322584, "alnum_prop": 0.5658558972005507, "repo_name": "omni5cience/django-inlineformfield", "id": "847bc7f27c5c754273b83f6847aee6cb278db8...
from toee import * import char_editor def CheckPrereq(attachee, classLevelled, abilityScoreRaised): #Req 1, turn undead feat if not (char_editor.has_feat(feat_turn_undead) or char_editor.has_feat(feat_rebuke_undead)): return 0 #Req2, shield proficency if not char_editor.has_feat(feat_shield_proficiency): ...
{ "content_hash": "46ca2704153668457b73dda182ee1487", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 93, "avg_line_length": 24.428571428571427, "alnum_prop": 0.7485380116959064, "repo_name": "GrognardsFromHell/TemplePlus", "id": "2b94ff212dad8ca374aa115d0ef927a09d6acafc", ...
from setuptools import setup setup( name='flask-canvas', version='0.1', keywords='python,facebook,canvas,oauth2', url='https://github.com/demianbrecht/flask-canvas', license='MIT', author='Demian Brecht', author_email='demianbrecht@gmail.com', description='A Flask extension for Facebook...
{ "content_hash": "3bfd45d4b273cc3ea1537420984168e1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 34.166666666666664, "alnum_prop": 0.6390243902439025, "repo_name": "demianbrecht/flask-canvas", "id": "47db0358311de4eeb1bdad8298916bb3c5939797", "si...
from __future__ import with_statement import argparse import os import stat import StringIO import sys import urlparse import zipfile from distutils import version as dist_version import yaml import requests USER_AGENT = 'appengine.py' VERSION_URL = 'https://appengine.google.com/api/updatecheck' OLD_VERSION_URL = ...
{ "content_hash": "1e34da359dafb226e5745f9ac11810b5", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 106, "avg_line_length": 26.597156398104264, "alnum_prop": 0.6218816821097648, "repo_name": "optimizely/appengine.py", "id": "9f8c096411582ac38bf37c941cd3d8b3ceb21734", "si...
import lxml.etree from urllib import quote from copy import deepcopy from pkg_resources import resource_stream # pylint: disable-msg=E0611 import sys from swift3.exception import S3Exception from swift3.utils import LOGGER, camel_to_snake, utf8encode, utf8decode XMLNS_S3 = 'http://s3.amazonaws.com/doc/2006-03-01/' X...
{ "content_hash": "3cbe531d0da104df05ad03d556b72f80", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 78, "avg_line_length": 30.055555555555557, "alnum_prop": 0.6398204383416952, "repo_name": "swiftstack/swift3-stackforge", "id": "98d43c7cfa4c67d9a664f4be674a824427b22343", ...
import json import logging import redis from django.shortcuts import render from django.core.paginator import Paginator from django.conf import settings from django.views.decorators.csrf import csrf_exempt from rest_framework.views import APIView from account.decorators import login_required, super_admin_required fr...
{ "content_hash": "f3aff345aaae173870d2386faa752006", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 120, "avg_line_length": 40.12893982808023, "alnum_prop": 0.6115672973937879, "repo_name": "mcmdhr/CSOJ", "id": "9281582ef5dfceea36e9569e8ce05a37d717aede", "size": "14877",...
""" Created on Mon Jul 11 13:15:19 2016 @author: sweel_Rafelski """ import sys import os import os.path as op import shutil as sh import fnmatch as fn import traceback import errno from wrappers import FalseException, UsageError # pylint: disable=C0103 def mkdir_exist(path): try: os.makedirs(path) ex...
{ "content_hash": "dbde129374094c201547798d9d33c86d", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 100, "avg_line_length": 29.392857142857142, "alnum_prop": 0.5069258809234508, "repo_name": "moosekaka/sweepython", "id": "01f28fb0c59d32f006b7d3fb02791fbfb9da1f87", "size"...
import pandas as pd # for backward compatability with pandas 0.23 - 0.25 class BackwardCompatibility(pd.api.extensions.ExtensionDtype): name = "object" def __init__(self, *args, **kwargs) -> None: pass # pragma: no cover if hasattr(pd, "StringDtype"): StringDtype = pd.StringDtype else: # prag...
{ "content_hash": "ee5b8d995484f59a40783b56adda8daf", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 66, "avg_line_length": 24.93846153846154, "alnum_prop": 0.690314620604565, "repo_name": "nanne-aben/strictly_typed_pandas", "id": "bd17cadeff279056b6938e1f433d9c30398b3788", ...
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib import auth from django.utils import html from django.contrib.auth.decorators import login_required from django.core.e...
{ "content_hash": "2e64fb2f8449d80595cbee99d3bf30db", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 128, "avg_line_length": 40.11764705882353, "alnum_prop": 0.5288080041400725, "repo_name": "rambasnet/bookstore", "id": "efda02eefca2e682ddd9d09d9048113464414ee4", "size": ...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster1'], [TestAction.destroy_vm, 'vm1'], [TestAction.recover_vm, ...
{ "content_hash": "4de62049153d7f219478dc375af68898", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 104, "avg_line_length": 41.411764705882355, "alnum_prop": 0.6896306818181818, "repo_name": "zstackio/zstack-woodpecker", "id": "4056a72891c028938272e36354964850cae1050f", "...
import os os.system('python runTrainer.py --agent=KerasNAFAgent --env=Motionv0Env --train-for=10000000 --test-for=0 --random-initial-position --gui --save-file=checkpoints/KerasNAF-Motionv0-$(date +%y%m%d%H%M%S).h5')
{ "content_hash": "56405e0ed0af9e8866570e9ebbc35037", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 206, "avg_line_length": 73, "alnum_prop": 0.7351598173515982, "repo_name": "benelot/bullet-gym", "id": "bf4dcbcaf9214a3e8bb0aa82c52dc6ff4f419b28", "size": "237", "binary":...
class Affine(): '''Affine model'''
{ "content_hash": "12a92e41e3b002fbc266c3a904a54bde", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 22, "avg_line_length": 19, "alnum_prop": 0.5789473684210527, "repo_name": "lsbardel/flow", "id": "f9c6331b1b7eb46754c7f792c617d92d4762ff2e", "size": "40", "binary": false,...
from distutils.core import setup setup( name='DTest', version='0.5.0', description="Dependency-based Threaded Test Framework", author="Kevin L. Mitchell", author_email="kevin.mitchell@rackspace.com", url="http://github.com/klmitch/dtest", scripts=['bin/run-dtests'], packages=['dtest'], ...
{ "content_hash": "08c1fc608d9e22bbef16f7007387ec02", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 61, "avg_line_length": 35.6, "alnum_prop": 0.6095505617977528, "repo_name": "klmitch/dtest", "id": "e3c4e7db8ea09ccafb3209c5d2efc27ecf4628d4", "size": "1718", "binary": f...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'ErythropoiesisFindings' db.delete_table('main_erythropoiesisfindings') # Deleting model 'IronStai...
{ "content_hash": "169aac8b253ab2c95fe4130050868ab9", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 141, "avg_line_length": 60.033557046979865, "alnum_prop": 0.6212409167132477, "repo_name": "oghm2/hackdayoxford", "id": "e7df23b064cebd4472ecd52bc18d0d85cfe475d0", "size":...
"""Support for Homekit climate devices.""" import logging from aiohomekit.model.characteristics import ( CharacteristicsTypes, HeatingCoolingCurrentValues, HeatingCoolingTargetValues, ) from aiohomekit.utils import clamp_enum_to_char from homeassistant.components.climate import ( DEFAULT_MAX_HUMIDITY,...
{ "content_hash": "cb58b1c2978664396e2817bf935b28db", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 82, "avg_line_length": 34.186868686868685, "alnum_prop": 0.6732161323681489, "repo_name": "pschmitt/home-assistant", "id": "f06063c5fd24671059cb45f8832974130d81ffd8", "siz...
from ticket import Globals, Bin, Ticket, TicketAttachment, MovedTicket
{ "content_hash": "5c475e5230e0fb1c0c8b4f2b5807db95", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 70, "avg_line_length": 71, "alnum_prop": 0.8309859154929577, "repo_name": "lym/allura-git", "id": "2585be9bcb5a880abe9f2af7e2086aa7e97bd409", "size": "941", "binary": fals...