text
stringlengths
4
1.02M
meta
dict
from dogetip import app app.run( debug=app.config['DEBUG'], host=app.config['HOST'], port=app.config['PORT'] )
{ "content_hash": "c64d3e7b0a76491d793c49b629cf989c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 28, "avg_line_length": 19.5, "alnum_prop": 0.6752136752136753, "repo_name": "mmattax/hubot-dogetip", "id": "8bbb892ab63d3db764d3b9669510a45440617c8a", "size": "135", "bina...
import re import hashlib import time from ct.crypto import cert from ct.proto import certificate_pb2 def from_cert(certificate, observations=[]): """Pulls out interesting fields from certificate, so format of data will be similar in every database implementation.""" proto = certificate_pb2.X509Description(...
{ "content_hash": "306973abfccbecc42b0ac5e54f5ebcc8", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 80, "avg_line_length": 36.46938775510204, "alnum_prop": 0.6015668718522663, "repo_name": "rep/certificate-transparency", "id": "bc3ab0d122889e705fd991e6fcd7624ea12d2293", "...
#!/usr/bin/env python2.7 # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this li...
{ "content_hash": "96f612094766e6fda3b28bfbc525af7c", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 143, "avg_line_length": 30.657971014492755, "alnum_prop": 0.6019665311525008, "repo_name": "soltanmm/grpc", "id": "2a16baa1b975f31d0a35e319ebca3b093c9296b6", "size": "1057...
import tornado.ioloop import tornado.web import tornado.escape import sys class LogHandler(tornado.web.RequestHandler): def post(self, device_id): data = tornado.escape.json_decode(self.request.body) sys.stderr.write("Received headers: %s\n"%str(self.request.headers)) sys.stderr.write("Rece...
{ "content_hash": "18f986c0a7b56616a6568e261f3eeaec", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 30.15, "alnum_prop": 0.6533996683250415, "repo_name": "hectortosa/py-temperature-recorder", "id": "d4d8dbef7b873e5e384b137a7c07f273b92dd324", "size":...
from wsgiref.handlers import format_date_time from datetime import datetime from time import mktime from requests.auth import AuthBase from .sign import Signer class HTTPSignatureAuth(AuthBase): ''' Sign a request using the http-signature scheme. https://github.com/joyent/node-http-signature/blob/master...
{ "content_hash": "85614a7afb0bc4aa669ce47e376b9fa2", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 111, "avg_line_length": 39.97959183673469, "alnum_prop": 0.6309341500765697, "repo_name": "atl/py-http-signature", "id": "0e64af88ad2fbe53d6ddfa8702ea6398e397eb1f", "size":...
from __future__ import unicode_literals import helper import os import unittest import ops class WorkspaceTestCase(unittest.TestCase): def test_with(self): prefix = 'prefix-' suffix = '-suffix' path = None with ops.workspace(suffix=suffix, prefix=prefix) as w: path ...
{ "content_hash": "3ee65ccdf3ffb5b043fd8db62730b983", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 62, "avg_line_length": 25.805555555555557, "alnum_prop": 0.5866523143164694, "repo_name": "silas/ops", "id": "caa137fc09ba015c3fe182a4eba7de02d02d9e07", "size": "929", "b...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "56ef3621bc42f2c94721fa68f02c27e0", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 164, "avg_line_length": 37.714285714285715, "alnum_prop": 0.7045454545454546, "repo_name": "antoinecarme/pyaf", "id": "cd218c9927eece12343a4e16b3bb6fb60bfc86e8", "size": "26...
"""Sample script creating some baseline predictions.""" import os import numpy as np import data import utils ALL_ZERO_PREDICTIONS_BASENAME = os.path.join('Predictions', 'all_zero') AVG_PREDICTIONS_BASENAME = os.path.join('Predictions', 'average') def predict_average(train_data, test_data): targets = np.array([r...
{ "content_hash": "f2af8e33de9b307e46116ca1559350fb", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 71, "avg_line_length": 26.31111111111111, "alnum_prop": 0.7094594594594594, "repo_name": "Gabs48/ML_competition", "id": "d8946376d393351baddba8f9b437375e6fb9b449", "size": ...
import morepath from .app import App from .model import db def run(): # pragma: no cover db.bind('sqlite', 'morepath_ponyorm.db', create_db=True) db.generate_mapping(create_tables=True) morepath.autoscan() morepath.run(App())
{ "content_hash": "6083ce033f9f52be754f82a74c6fea90", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 20.666666666666668, "alnum_prop": 0.6854838709677419, "repo_name": "henri-hulski/morepath_ponyorm", "id": "7c6e7126a106d41f434ff976934f4e256f830ade", ...
"""Errors used in the urlfetch API developers. """ class Error(Exception): """Base URL fetcher error type.""" class InvalidURLError(Error): """Raised when the URL given is empty or invalid. Only http: and https: URLs are allowed. The maximum URL length allowed is 2048 characters. The login/pass portion...
{ "content_hash": "738c4f288e55614a738db09bf1f75067", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 74, "avg_line_length": 25.227272727272727, "alnum_prop": 0.7279279279279279, "repo_name": "SRabbelier/Melange", "id": "65ef5fd8a505af1bdfdb3f8bb1df021f4089a363", "size": "1...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^get_schools$', views.get_schools, name='get_schools'), url(r'^signup$', views.signup, name='signup'), url(r'^login$', views.login, name='login'), url(r'^logout$', views.logout, name='logout'), url(r'^is_user_logged_in$', v...
{ "content_hash": "14a5bd65d0c555f848b4d4a701ec385d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 83, "avg_line_length": 47.578947368421055, "alnum_prop": 0.6570796460176991, "repo_name": "dimkarakostas/unimeet", "id": "1a2f39f8268e0aaf9db2a5f677b2f2123aee4ea2", "size":...
import atexit import itertools import os import pymongo import requests from tests import db_user, db_password _mo_address = os.environ.get("MO_ADDRESS", "localhost:8889") _mongo_start_port = int(os.environ.get("MONGO_PORT", 27017)) _free_port = itertools.count(_mongo_start_port) DEFAULT_OPTIONS = { 'logappend'...
{ "content_hash": "6554946f011c7c1df74efb258c5cce2a", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 80, "avg_line_length": 30.302325581395348, "alnum_prop": 0.568495778971604, "repo_name": "neo4j-contrib/neo4j_doc_manager", "id": "f15ed7f8304ba92fa27e14f18815e012ea3bd0e3",...
import mimetypes import cherrypy from girder.api import access from girder.api.describe import autoDescribeRoute, describeRoute, Description from girder.api.rest import loadmodel, RestException from girder.constants import AccessType, SortDir, TokenScope from girder.exceptions import AccessException, GirderException,...
{ "content_hash": "7918c17ccf6bc99263f4a3d97863900f", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 100, "avg_line_length": 43.35489510489511, "alnum_prop": 0.5804669543126739, "repo_name": "ImageMarkup/isic-archive", "id": "106f0922aa0ea42578fb75bf75ae151a2866affb", "si...
class Solution(object): def deleteDuplicates(self, head): """ :type head: ListNode :rtype: ListNode recursively delete duplicated nodes """ if not head: return None # if the given head and head.next are duplicated nodes if head.next and head.val == head.next.val: # skip all the duplicated elem...
{ "content_hash": "d97b24eb10a75873ad8d8bce6ff98bb1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 93, "avg_line_length": 35.583333333333336, "alnum_prop": 0.6967213114754098, "repo_name": "comicxmz001/LeetCode", "id": "d54266a7d7ff5c7af5a1d3cc21702d82e1308cb5", "size": ...
import argparse import sys, os parser = argparse.ArgumentParser() parser.add_argument('pyqlabpath', help='path to PyQLab directory') parser.add_argument('control', help='control qubit name') parser.add_argument('target', help='target qubit name') parser.add_argument('caltype', type=float, help='1 for length, 2 for phas...
{ "content_hash": "baecc36a2ab82f35f657a07c12cd5b97", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 119, "avg_line_length": 41.6, "alnum_prop": 0.7608173076923077, "repo_name": "Plourde-Research-Lab/Qlab", "id": "33ab233cdc03b9c1eda527251b418ed3a4ceae0c", "size": "832", ...
import inspect from django import forms from django.utils.safestring import mark_safe from . import widgets as wizard_builder_widgets def get_field_options(): ''' Turns the field generating functions on QuestionField into a series of options Formatted to be consumed by Question.type.choices '''...
{ "content_hash": "5524402f50d11213394576673d140f0e", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 28.339805825242717, "alnum_prop": 0.6505652620760535, "repo_name": "SexualHealthInnovations/django-wizard-builder", "id": "b443ab513ae49c93aa26e276f47...
"""Configures and starts up the Dinky Service. """ import logging from logging.handlers import SysLogHandler import os.path import socket import tornado.ioloop import tornado.httpserver from tornado.options import define, options from tornado.util import exec_in from tornado.escape import native_str from tornado.web i...
{ "content_hash": "55c9eddb85f2c9fdccb523cc85f11c55", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 80, "avg_line_length": 31.100719424460433, "alnum_prop": 0.6509368494101319, "repo_name": "kowalcj0/dinky", "id": "6b97d0f6a820e4e6d377083881c4425acb04026f", "size": "4386...
project = "sphinx-issues" copyright = "2022, foobar" author = "foobar" # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ["sphi...
{ "content_hash": "09208f3d04c08dbb10ca849aae041255", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 84, "avg_line_length": 36.111111111111114, "alnum_prop": 0.6806153846153846, "repo_name": "sloria/sphinx-issues", "id": "34e86c7bd2e448e9fff888f31cfa68ea8e39d12e", "size": ...
from google.cloud import dialogflowcx_v3 async def sample_update_entity_type(): # Create a client client = dialogflowcx_v3.EntityTypesAsyncClient() # Initialize request argument(s) entity_type = dialogflowcx_v3.EntityType() entity_type.display_name = "display_name_value" entity_type.kind = "K...
{ "content_hash": "4147ac7e0af5a153d6726e7e672cd8fe", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 27.391304347826086, "alnum_prop": 0.7206349206349206, "repo_name": "googleapis/python-dialogflow-cx", "id": "729381c0b61eeee0ae0f41735ffcee458164bdad",...
import unicodedata from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.utils.text import ugettext_lazy as _ from django.utils.decorators import method_decorator from wand.image import Image from wand.color import Color def remove_accents(string): ...
{ "content_hash": "4c5f88a07017afa5833daf2b3b58a12c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 82, "avg_line_length": 32.39837398373984, "alnum_prop": 0.5969887076537014, "repo_name": "matus-stehlik/glowing-batman", "id": "e8dc8a6d160b7ad355f57a4891cfc980136135cf", ...
"""irc2 low-level event handler""" from . import utils from .parser import Message import logging class IRCHandler(object): """ IRCHandler handles incoming messages from an IRCClient. This is usually not something applications have to worry about. """ def __init__(self, client): client.sub...
{ "content_hash": "fdb04b12d8bd2d90f304ad86ec311b07", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 86, "avg_line_length": 34.45454545454545, "alnum_prop": 0.6319261213720316, "repo_name": "fwilson42/irc2", "id": "146a9f503f70ce35588ed16e13bd29722d0ea119", "size": "1516",...
"""Multi-dSprites dataset reader.""" import functools import tensorflow.compat.v1 as tf COMPRESSION_TYPE = tf.io.TFRecordOptions.get_compression_type_string('GZIP') IMAGE_SIZE = [64, 64] # The maximum number of foreground and background entities in each variant # of the provided datasets. The values correspond to th...
{ "content_hash": "f8f9c4600810bb1f9d859f80e7542501", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 80, "avg_line_length": 42.43333333333333, "alnum_prop": 0.7025399319193506, "repo_name": "deepmind/multi_object_datasets", "id": "ef65f4bda220cda548ca43b28cea51fcbd04bd40", ...
from os.path import join as pjoin # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" _version_major = 1 _version_minor = 0 _version_micro = '' # use '' for first of series, number for 1 and above #_version_extra = 'dev' _version_extra = '' # Uncomment this for full releases # Construct ful...
{ "content_hash": "2d0d4a9f950691580f3a161d5ae0dcb7", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 77, "avg_line_length": 31.536231884057973, "alnum_prop": 0.6907169117647058, "repo_name": "tcompa/anneal", "id": "ecdeeee62211849ca33e3aa52295d6ce755e9a7c", "size": "2176",...
import atexit import logging import requests import time import google.auth from functools import partial from google.rpc import status_pb2 from google.auth.credentials import with_scopes_if_required from google.auth.exceptions import RefreshError from google.auth.transport.requests import Request as AuthRequest from...
{ "content_hash": "d9aa323705aee75e110f797fd6ac6998", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 102, "avg_line_length": 35.39351851851852, "alnum_prop": 0.6170045781556573, "repo_name": "LeadPages/gcloud_requests", "id": "bd4b5c93d00dbf13bd66781faf87fdea2649942c", "s...
from ..lang.tools.baselex import BaseLexer, EOF, EPS from ..lang.tools.grammar import Grammar from ..lang.tools.lr import LrParserBuilder from ..common import make_num, get_file def get_layout(layout): """ Get a layout from object or file """ if isinstance(layout, Layout): return layout else: ...
{ "content_hash": "62e2f75da4a955636db163b80d819942", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 78, "avg_line_length": 25.158490566037734, "alnum_prop": 0.5137243137843108, "repo_name": "windelbouwman/ppci-mirror", "id": "756c3e05f0e2339b2e47f0aabfefe12299c669c7", "s...
"""The volumes extension.""" from oslo_utils import strutils from webob import exc from nova.api.openstack import api_version_request from nova.api.openstack.api_version_request \ import MAX_PROXY_API_SUPPORT_VERSION from nova.api.openstack import common from nova.api.openstack.compute.schemas import volumes as v...
{ "content_hash": "d87919c9f70c4dfebf9eaf9de37efb28", "timestamp": "", "source": "github", "line_count": 649, "max_line_length": 78, "avg_line_length": 41.72265023112481, "alnum_prop": 0.6126744959007312, "repo_name": "klmitch/nova", "id": "15b752f59648d0a8e8a51cdbaaa5f286a1aa4d1d", "size": "27714",...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from datetime import datetime from functools import partial import json import logging from flexget.entry import Entry from flexget.event import event from flexget.plugin import ...
{ "content_hash": "0e8af7bd593c0c75c3dc61c6f3e26a0b", "timestamp": "", "source": "github", "line_count": 752, "max_line_length": 112, "avg_line_length": 36.4813829787234, "alnum_prop": 0.600058321790479, "repo_name": "qvazzler/Flexget", "id": "5a098c40e1e627f179cb9eb381fd9449f1760815", "size": "2743...
from mrjob.job import MRJob from mrjob.protocol import JSONValueProtocol import json def bbox_contains(bbox, longitude, latitude): sw_lon, sw_lat, ne_lon, ne_lat = bbox return (sw_lon <= longitude <= ne_lon) and (sw_lat <= latitude <= ne_lat) class GeoExtract(MRJob): INPUT_PROTOCOL = JSONValueProtocol ...
{ "content_hash": "6148e254906c36e15fa1788130917182", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 94, "avg_line_length": 40.41463414634146, "alnum_prop": 0.6499698249849125, "repo_name": "dssg/tweedr", "id": "3a849d8dc106b1cca150b693999833d4eb4233c4", "size": "1657", ...
import unittest import sys, os, glob test_root = os.path.dirname(os.path.abspath(__file__)) test_files = glob.glob(os.path.join(test_root, "test_*.py")) os.chdir(test_root) sys.path.insert(0, os.path.dirname(test_root)) sys.path.insert(0, test_root) if len(sys.argv) == 2: test_names = ["test_%s" % sys.argv[1]] e...
{ "content_hash": "fbfdf4e0453532b427bc1103e43c443e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 69, "avg_line_length": 28.68, "alnum_prop": 0.6736401673640168, "repo_name": "nobrin/macaron", "id": "2c136cdcbdc529d31198006b543ecdc5de42e694", "size": "775", "binary": ...
from qingcloud.cli.iaas_client.actions import job from qingcloud.cli.iaas_client.actions import instance from qingcloud.cli.iaas_client.actions import instance_groups from qingcloud.cli.iaas_client.actions import volume from qingcloud.cli.iaas_client.actions import nic from qingcloud.cli.iaas_client.actions import eip ...
{ "content_hash": "fd2e1b1ec54ab557e0403f85a55b56d2", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 111, "avg_line_length": 59.730897009966775, "alnum_prop": 0.7018744090327604, "repo_name": "yunify/qingcloud-cli", "id": "5b7a435cab9a54072af4bb67003bb4852e7ad48c", "size"...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from .. import mod...
{ "content_hash": "6dd42afb589cd75bcb6a43cb780c01a9", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 133, "avg_line_length": 46.675324675324674, "alnum_prop": 0.6597106288258208, "repo_name": "Azure/azure-sdk-for-python", "id": "9092ecfc1ab3adf76378b0e2e7e8219ac71a6d54", ...
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) ex...
{ "content_hash": "c011f9ed1c7a52982bee604c343bbe2e", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 115, "avg_line_length": 62.05625, "alnum_prop": 0.6933225903917817, "repo_name": "xcgspring/XSTAF", "id": "0d4a42e863c8668b538bb6676cc303bc236b998e", "size": "10165", "b...
import json import pytest import responses from koordinates import Set, Client, Group, Publish from .response_data.responses_3 import ( sets_single_good_simulated_response, sets_new_draft_good_simulated_response, sets_single_draft_good_simulated_response, sets_multi_version_good_simulated_response, ...
{ "content_hash": "e03954aebf7cea145ce8ba2967102392", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 91, "avg_line_length": 26.307692307692307, "alnum_prop": 0.6159844054580896, "repo_name": "koordinates/python-client", "id": "915a839d52f1c40fe21bbdf3005d39c373ca492e", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project', '0009_auto_20170905_0727'), ] operations = [ migrations.AlterField( model_name='eoi', name='selected_source', ...
{ "content_hash": "2e878deb42445afea87400900c64ca8d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 133, "avg_line_length": 25.944444444444443, "alnum_prop": 0.5995717344753747, "repo_name": "unicef/un-partner-portal", "id": "596767b122d303c068d16051fee166d327a16807", "si...
import os from gensim import corpora, models, similarities from pprint import pprint # pretty-printer import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',level=logging.INFO) if (os.path.exists("/tmp/deerwester.dict")): dictionary = corpora.Dictionary.load('/tmp/deerwester.dict') ...
{ "content_hash": "e9a711b1c077b8d75f46879bc5b5f95d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 110, "avg_line_length": 30.410714285714285, "alnum_prop": 0.7345860246623606, "repo_name": "yuyunliuhen/automatic-text-categorization", "id": "62adccfaeb7cb08073cc5d5dae9eb4b...
from django.contrib import admin from . import models @admin.register(models.RemoteCalendar) class RemoteCalendarAdmin(admin.ModelAdmin): """Basic remote calendar admin""" fields = ["name", "url"] class SubjectExclusionInline(admin.StackedInline): model = models.SubjectExclusion extra = 0 @admin...
{ "content_hash": "83714628f1d5f52de0fdcfd15e6ac5b2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 58, "avg_line_length": 24.296296296296298, "alnum_prop": 0.7103658536585366, "repo_name": "Hovercross/peacockhosting-apps", "id": "3704ef2cf04a025f494d78fea14643cdf92f41ff", ...
import numpy as np import scipy.signal as ss import astropy.io.fits as fits import matplotlib.pyplot as plt inpt = str(raw_input("Nome do Arquivo: ")) lc = fits.open(inpt) bin = float(raw_input("bin size (or camera resolution): ")) # Convert to big-endian array is necessary to the lombscargle function rate = np.arra...
{ "content_hash": "93f398dc0b40a66fe7fd9679fd1bf915", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 95, "avg_line_length": 26.791044776119403, "alnum_prop": 0.6456824512534819, "repo_name": "evandromr/python_scitools", "id": "d9ebc88e64a2c1b00e963744f72a3417bc7fb530", "si...
from sys import argv import dbus def kb_light_set(delta): bus = dbus.SystemBus() kbd_backlight_proxy = bus.get_object('org.freedesktop.UPower', '/org/freedesktop/UPower/KbdBacklight') kbd_backlight = dbus.Interface(kbd_backlight_proxy, 'org.freedesktop.UPower.KbdBacklight') current = kbd_backlight.Ge...
{ "content_hash": "c7ac568ae265370f91ff8636869cf5a7", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 106, "avg_line_length": 34.125, "alnum_prop": 0.5952380952380952, "repo_name": "pharpend/dotfiles", "id": "ade9bdf20ad39f9498b1bfc51fe78bc531cc00e2", "size": "1132", "bin...
import os import sys import django APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PROJ_ROOT = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, APP) DEBUG = True ADMINS = ( # ('Your Name', '[email protected]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE...
{ "content_hash": "32e18af22334701a183f4d9c8e292d11", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 88, "avg_line_length": 26, "alnum_prop": 0.6336441336441336, "repo_name": "miceno/django-categories", "id": "758ed24f6a5cb17a59309fabc2fa5b9ea7746eb0", "size": "2612", "b...
from collections import defaultdict import copy from .utils import merge from .compat import basestring from .exceptions import (err_exit, DXError, DXCLIError) ''' System Requirements +++++++++++++++++++ A module containing utility methods useful for packing and unpacking system requirements. ''' class SystemRequir...
{ "content_hash": "1079463a57da9e1ce2c435a768dc8a5c", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 122, "avg_line_length": 48.49214659685864, "alnum_prop": 0.6172532930252645, "repo_name": "dnanexus/dx-toolkit", "id": "321169f5e3679e937c65056e3a449638625c8522", "size": ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: oneview_enclosure_info short_description: Retrieve informat...
{ "content_hash": "5048ba7ef791e0139e787b35f7bb26f5", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 119, "avg_line_length": 31.869955156950674, "alnum_prop": 0.6309272548191923, "repo_name": "thaim/ansible", "id": "1649d996958fd05a6b6081fa8dbf3257855ec420", "size": "7290...
class Role: """ A class object which holds role information. """ def __str__(self): return "[{id}] {name} {{{allegiance}, {verdict}}}".format( id=self.role_id, name=self.role_name, allegiance=self.role_allegiance, verdict=self.role_verdict, ...
{ "content_hash": "8dd0ecc5eb5596297f31f4f321fc9c2e", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 66, "avg_line_length": 21.929411764705883, "alnum_prop": 0.5895922746781116, "repo_name": "gleasoda/MAFIA", "id": "e01edf5c9da825b1e1680f88644b3fb2ba8b57be", "size": "1864"...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResour...
{ "content_hash": "5bb074a53f361aec69b4fca7c2ed099a", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 134, "avg_line_length": 33.88702928870293, "alnum_prop": 0.6145203111495247, "repo_name": "twilio/twilio-python", "id": "2049ec28d57d5288e1f29ee9ca4bc780f579ccc5", "size":...
""" Imports all submodules """ from __future__ import division from __future__ import unicode_literals __version__ = '2.0.0' import deepchem.data import deepchem.feat import deepchem.hyper import deepchem.metalearning import deepchem.metrics import deepchem.models import deepchem.splits import deepchem.trans import d...
{ "content_hash": "996655aeede1b1557fcb75a23c3c8b56", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 39, "avg_line_length": 19.85, "alnum_prop": 0.8035264483627204, "repo_name": "Agent007/deepchem", "id": "b3cc75b1ac49a22d4f1a3dbc371494ed021661be", "size": "397", "binary...
from flask import render_template, redirect, request, url_for, flash from flask_login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\ ...
{ "content_hash": "34d980827e674615b4be816e0209ba9e", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 78, "avg_line_length": 36.58659217877095, "alnum_prop": 0.6367384333486028, "repo_name": "The-end-novel/Freedom-Web", "id": "903e4f3e802a8949c9e86d4b0f94e19d836f2071", "si...
try: import uio as io except ImportError: try: import io except ImportError: print('SKIP') raise SystemExit # test __enter__/__exit__ with io.StringIO() as b: b.write("foo") print(b.getvalue())
{ "content_hash": "e94d6ab23730c2039cde243bb6a2ca52", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 25, "avg_line_length": 18.384615384615383, "alnum_prop": 0.5774058577405857, "repo_name": "pfalcon/micropython", "id": "ffc0038a92fb603eb36ba6c3bb4df731631cd010", "size": "...
""" polaris.auth ~~~~~~~~~~~~ :copyright: (c) 2013 Eleme, http://polaris.eleme.io :license: MIT Polaris user management. """
{ "content_hash": "906893848a1712bdc3321e6cee6be189", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 55, "avg_line_length": 16.333333333333332, "alnum_prop": 0.5374149659863946, "repo_name": "eleme/polaris", "id": "9544e87b44522e4734db631b9a33c233068ed9aa", "size": "147", ...
import numpy as np import scipy.misc as sp import matplotlib.pyplot as plt class GeologicalModelling: """ Class for creating simple parametric geological models inputs: ------ type: 'Layered', 'Trap', 'Fault'... dims: Dimensions of model functions: ---------- R...
{ "content_hash": "1d993750951d056aa25a3e21151c6a97", "timestamp": "", "source": "github", "line_count": 695, "max_line_length": 121, "avg_line_length": 29.7568345323741, "alnum_prop": 0.5480392630917267, "repo_name": "mrava87/EAGE_Hackatoon_2017", "id": "56cff613432d41a11ed4daffb04345ebfc4f58e8", "...
from oslo.config import cfg import octavia.common.config as config import octavia.tests.unit.base as base class TestConfig(base.TestCase): def test_sanity(self): config.init([]) config.setup_logging(cfg.CONF)
{ "content_hash": "56c0bcb8afb859e4b2433be9e54a0201", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 21.181818181818183, "alnum_prop": 0.7167381974248928, "repo_name": "brandonlogan/octavia", "id": "fcc01ee689c3f21bcb53d4d653f8c0043f15949e", "size": ...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- Ge...
{ "content_hash": "6fff55ff96e9e732e9983e063692c882", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 96, "avg_line_length": 31.750865051903116, "alnum_prop": 0.6746948561464691, "repo_name": "mygreen/xlsmapper", "id": "436e074c9aff30d65070d6867830f27441e7ae6c", "size": "9...
from pyowm.commons import exceptions from pyowm.utils import formatting, timestamps from pyowm.weatherapi25 import location def uv_intensity_to_exposure_risk(uv_intensity): # According to figures in: https://en.wikipedia.org/wiki/Ultraviolet_index if 0.0 <= uv_intensity < 2.9: return 'low' elif 2....
{ "content_hash": "83f994c6b9c7ed2af074e7df3d97836d", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 113, "avg_line_length": 37.34965034965035, "alnum_prop": 0.6041939711664482, "repo_name": "csparpa/pyowm", "id": "f84403c70c0b35a5f06401f2bea8f1cd26115243", "size": "5388"...
from PyQt4 import QtGui class ModuleModel(QtGui.QStandardItemModel): def __init__(self, parent, dbConnection): super(ModuleModel, self).__init__(parent) self.dbCon = dbConnection def populate(self): self.clear() cur = self.dbCon.cursor() cur.execute("SELECT NAME FROM MODULE") rows = cur.fetchall() fo...
{ "content_hash": "5b80167e2e15e9f5b06cb0bd3bcd81b4", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 88, "avg_line_length": 27.444444444444443, "alnum_prop": 0.6526315789473685, "repo_name": "tiagolb/CSF", "id": "08884545a0e8475136df4a149b00faed479089be", "size": "2470", ...
import hashlib from django.db import models from django.contrib.auth.models import Group, User from django.utils.translation import ugettext_lazy as _ from domain.models import Domain from reporters.models import Reporter, ReporterGroup from hq.processor import REGISTRATION_XMLNS, create_phone_user import xfo...
{ "content_hash": "89d8fa85b29ce67e5656d9c88562c411", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 190, "avg_line_length": 44.251063829787235, "alnum_prop": 0.6372728146937205, "repo_name": "commtrack/temp-aquatest", "id": "86435f282edbc6ad59c4b4d66db50696720727ee", "si...
""" Generate header file with macros defining MicroPython version info. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import sys import os import datetime import subprocess def get_version_info_from_git(): # Python 2.6 doesn't have check_output, so check for tha...
{ "content_hash": "c2e9e12f32cf0845b2b0f18649041395", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 96, "avg_line_length": 28.905982905982906, "alnum_prop": 0.5821998817267889, "repo_name": "pfalcon/micropython", "id": "95fa59ad6635db4da53f5666c7a0e548d080ece3", "size": ...
from django.conf import settings from django.utils.translation import ugettext as _ from .exceptions import AppAlreadyInstalledException from .utils import resolve_appinstance PERMISSION_MSG_DELETE = _("You are not permitted to delete this Instance") PERMISSION_MSG_GENERIC = _("You do not have permissions for this In...
{ "content_hash": "85c296c3e3c998494863f84c4c976121", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 77, "avg_line_length": 32.95, "alnum_prop": 0.6322711178553364, "repo_name": "cartologic/cartoview", "id": "913d5541df5d5365b6c3056c408f77bd76a7ff36", "size": "1977", "bi...
from enum import IntEnum from app import db """ Describes the authentication level of a user as a series of constants. IntEnum has been chosen as this provides a nice way to use < and > for permission checking. """ class AuthLevel(IntEnum): UNKNOWN = 0, USER = 1, ADMIN = 2 """ A class that represents the...
{ "content_hash": "ed5268ba34bf49e5ef4bbee3328d9363", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 26.068181818181817, "alnum_prop": 0.5832606800348736, "repo_name": "Zillolo/mana-vault", "id": "ec59da7e80a205f6d4c2c675dafcb84c14f8f17e", "size": "1...
INFINITY = float('inf') NEGATIVE_INFINITY = -INFINITY class IntervalSet: __slots__ = ('intervals', 'size') def __init__(self, intervals, disjoint=False): self.intervals = intervals if not disjoint: self.intervals = union_overlapping(self.intervals) self.size = sum(i.size for i in self.interva...
{ "content_hash": "59281c45d048bfd1a9ec7d8a8513aac1", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 94, "avg_line_length": 28.643939393939394, "alnum_prop": 0.639513356254959, "repo_name": "slackhappy/graphite-web", "id": "1413f83b90b16eecc4baa9b9d6cc97f773558b5a", "size...
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.core.exceptions import ImproperlyConfigured from pushit.constants import DEFAULT_ALIAS from pushit.logger import Logger from pushit.utils import loading # Set up a logger for the app logger = Logger.get_logger(name...
{ "content_hash": "640fae3d28e490a678f116db39ce28f5", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 101, "avg_line_length": 33.68181818181818, "alnum_prop": 0.7894736842105263, "repo_name": "rhblind/django-pushit", "id": "87de25d7ead996beecd320521cdc12787dbe2f5d", "size":...
from __future__ import absolute_import from django.http import HttpResponse from simplewebmentions.helpers import is_valid_target def dummy_webmention(request, *args, **kwargs): match = is_valid_target(target, request) if match: return HttpResponse('webmention allowed', status=200)
{ "content_hash": "353a7aee3f7d38c32cd69697b6753a92", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 31.4, "alnum_prop": 0.7197452229299363, "repo_name": "emilbjorklund/django-simplewebmentions", "id": "8f783bc70dc3b2d3310b7689daaa356dc7c77d48", "siz...
import argparse import sys from runroo import clusterSSH from runroo import qsubSSH def formatCommandClusterSSH(c_dict, l): if 'n_ct' in c_dict: t = c_dict['n_ct'] l.append(t) else: print('Error, please check the formatting in the Commandline, command \'n_ct\' not found') sys.e...
{ "content_hash": "da70652fd1fb44817ae51c863630b319", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 292, "avg_line_length": 39.523809523809526, "alnum_prop": 0.5742168674698795, "repo_name": "disulfidebond/ROO", "id": "0af76c8d6e5391bb99bacdb37b1b04355cb4ad60", "size": "...
import os from django.http import HttpResponse from opentelemetry import trace from opentelemetry.instrumentation.django import DjangoInstrumentor from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter from azure.monitor.opentelemetry.exp...
{ "content_hash": "274aa5e0b5029ac7646401905700b800", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 82, "avg_line_length": 32.125, "alnum_prop": 0.8223086900129701, "repo_name": "Azure/azure-sdk-for-python", "id": "e3879d27ad53b5adba8bf3441f0fc652823dc125", "size": "865",...
"""Package contenant la commande 'versions'.""" from primaires.interpreteur.commande.commande import Commande from .ajouter import PrmAjouter from .editer import PrmEditer from .supprimer import PrmSupprimer class CmdVersions(Commande): """Commande 'versions'. """ def __init__(self): ...
{ "content_hash": "0e5b5e196bb6ff50ec11fa6de09b49ab", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 76, "avg_line_length": 37.094339622641506, "alnum_prop": 0.5890132248219736, "repo_name": "stormi/tsunami", "id": "3bdf1929c046551eb43133606b6eaf02305e3b4c", "size": "3540"...
import pytest from tenable_io.api.target_groups import TargetListEditRequest from tenable_io.api.models import TargetGroup, TargetGroupList @pytest.mark.vcr() def test_target_groups_create(new_target_group): assert isinstance(new_target_group, TargetGroup), u'The `create` method did not return type `TargetGroup`...
{ "content_hash": "9af24659b63ee35bacc09ca95f0d6e7b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 119, "avg_line_length": 45.7, "alnum_prop": 0.75054704595186, "repo_name": "tenable/Tenable.io-SDK-for-Python", "id": "07e2d1b8a7c46e378298b64b296fe93ed48acbf5", "size": "1...
from lxml import html, etree import requests import os import time import bvglibrary as bvg import scanlibrary as scan import time devices=[scan.device('192.168.2.1','Router'),scan.device('192.168.2.118','Tablet'),scan.device('192.168.2.162','MediaLaptop'),scan.device('192.168.2.195','ChristianHandy'),scan.device('192...
{ "content_hash": "1242262b6a2ecbcc7aea2277ff4ceb62", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 220, "avg_line_length": 35.625, "alnum_prop": 0.7824561403508772, "repo_name": "RoboWoodhouse/RoboButler", "id": "ed757b1ea66955e0a33da7f6aeb178dba82df9a1", "size": "594", ...
import numpy as np from ..utils import _validate_type, _check_option from ..utils.check import int_like def combine_adjacency(*structure): """Create a sparse binary adjacency/neighbors matrix. Parameters ---------- *structure : list The adjacency along each dimension. Each entry can be: ...
{ "content_hash": "2dd161ece8393442be77f9262f0e3157", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 40.85057471264368, "alnum_prop": 0.5644344400675295, "repo_name": "kambysese/mne-python", "id": "c81344a8aef81fe91e57f6c5573d7a946f8b2f68", "size": "...
"""Tests for `tf.data.Dataset.from_tensor_slices().""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.data.kernel_tests import test_base from tensorflow.python.data.ops import dataset_ops from tensorflow.python.fra...
{ "content_hash": "e0b7016880bdbf6a6b1df5e091def79f", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 80, "avg_line_length": 42.39080459770115, "alnum_prop": 0.568239334779465, "repo_name": "chemelnucfin/tensorflow", "id": "17b82d6f2eed9e7569e803f4f33e131dfcc2e54b", "size"...
import rospy from sensor_msgs.msg import BatteryState from geometry_msgs.msg import Pose from strands_navigation_msgs.msg import TopologicalMap class DummyBattery(object): """ Publishes a dummy battery message which charges or discharges based on current topoligcal noe """ def __init__(self): ...
{ "content_hash": "428452fc07cd20310afb8d86e8124aa9", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 141, "avg_line_length": 37.53521126760563, "alnum_prop": 0.6082551594746717, "repo_name": "strands-project/strands_executive_behaviours", "id": "1de4fe10d21160364ac3ca96253b9...
import getpass import requests import json import os import socket import commands import sys HOSTNAME = socket.gethostname() DEFAULT_CONF = { HOSTNAME: { "nodename": HOSTNAME, "host": "127.0.0.1", "port": "9200", } } def get_monitor_es_conf(filename): """ { "es0": {"host": "hos...
{ "content_hash": "5df303fd71cbecbc9d9734e3c38a9701", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 80, "avg_line_length": 24.70909090909091, "alnum_prop": 0.5533480500367918, "repo_name": "sapling/es", "id": "66882aae4e89296296756cbf0a29b89cdd201a5a", "size": "1405", "...
''' Created on Jul 30, 2015 @author: Mikhail ''' import unittest import re from json_file_generator import MyOwnJSONProcessing as json_processing from json_file_generator import __version__ as json_file_generator_version from unittest.case import skip, skipIf class GenerateAndLoadJSONTestUpdateFour(unittest.TestCase)...
{ "content_hash": "f0792b3db54221caaeff234ee191a423", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 214, "avg_line_length": 51.2625, "alnum_prop": 0.6832479882955377, "repo_name": "MikeLaptev/sandbox_python", "id": "a3fa6ac2f7ad804220436c5db3f65457a257c432", "size": "4101...
""" Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API documentation...
{ "content_hash": "9483b5401fc91a2b3e70208e6a41aa1e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 409, "avg_line_length": 36.55263157894737, "alnum_prop": 0.7415406767458603, "repo_name": "wavefrontHQ/python-client", "id": "d6bf6555df0959663b9400776502a721d8b779df", "si...
import csv import string import itertools import codecs try: import pandas as pd has_pandas = True except ImportError: has_pandas = False from sqlalchemy import and_ from sqlalchemy.exc import SQLAlchemyError from . import util from .database import db from .ingredient import Categories, Ingredient, disp...
{ "content_hash": "ebad9ac30dc25977c6ede35f96625966", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 166, "avg_line_length": 41.05185185185185, "alnum_prop": 0.5930169613857813, "repo_name": "twschum/mix-mind", "id": "3555fadd8cfd7ab251ea74b1622ced56a253774e", "size": "11...
from ..server_utils import SetUpPythonPath SetUpPythonPath() from .test_utils import ( Setup, BuildRequest, PathToTestFile, StopOmniSharpServer, WaitUntilOmniSharpServerReady ) from webtest import TestApp from nose.t...
{ "content_hash": "d0ab1cc7115c59f8b48a5c73061036ce", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 79, "avg_line_length": 33.961852861035425, "alnum_prop": 0.45972400513478817, "repo_name": "akrehl/dotfiles", "id": "301d4dd355147e0acfd127599d921375fd2b4b5f", "size": "13...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('wagtailforms', '0003_capitalizeverbose'), ('wagtailcore', '0040...
{ "content_hash": "77942d3f712590c88dbfa8f1ad9810c7", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 438, "avg_line_length": 42.458333333333336, "alnum_prop": 0.5942100098135427, "repo_name": "kingsdigitallab/kdl-django", "id": "c87ceb65923eb7e028e8816d3d9baebf8e379b36", "...
from __future__ import annotations from typing import Any from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook class GlacierHook(AwsBaseHook): """Hook for connection with Amazon Glacier""" def __init__(self, aws_conn_id: str = "aws_default") -> None: super().__init__(client_type="gla...
{ "content_hash": "201cb48b7fa83eaaecb0b87087fb3b3d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 100, "avg_line_length": 42.82, "alnum_prop": 0.6492293320878094, "repo_name": "cfei18/incubator-airflow", "id": "4f68559d46f03623fbf57c0a254519c3d1f1f78e", "size": "2928", ...
import pandas as pd import pyproj import pytest import geopandas._compat as compat from shapely.geometry import Point import numpy as np from geopandas import GeoDataFrame, GeoSeries crs_osgb = pyproj.CRS(27700) crs_wgs = pyproj.CRS(4326) N = 10 @pytest.fixture(params=["geometry", "point"]) def df(request): ...
{ "content_hash": "bcf520bc2ccaba659245f868ecc8a8c9", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 88, "avg_line_length": 36.6875, "alnum_prop": 0.6477466315626452, "repo_name": "geopandas/geopandas", "id": "5a447f3983ba04d27715d3f314aab69d605fbfbf", "size": "12914", ...
from cobra.utils import normalize def norm(data): return normalize(data)
{ "content_hash": "1f21970c3a157890e79ec2225bf766c5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 33, "avg_line_length": 19.5, "alnum_prop": 0.7564102564102564, "repo_name": "niwinz/cobrascript", "id": "1c75ba48ae7018192a5f6740f29aabe6961aa8fd", "size": "103", "binary"...
import os from . import app, STATIC_URL from . import gist from flask import render_template, redirect @app.route('/') def homepage(): return render_gist('b5807b9c969cef7420e0e6d4884aafd3') @app.route('/impressum') def render_impressum(): return render_template('impressum.html') @app.route('/<hash:id>') de...
{ "content_hash": "59142a9809c492750e7a344e2f965828", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7114427860696517, "repo_name": "x3ro/draft.sx", "id": "5eadf935aa7b545871bd33f8a43370e5d865edc8", "size": "402", ...
import sys import tensorflow as tf import numpy as np from numpy import genfromtxt import requests import csv from sklearn import datasets from sklearn.cross_validation import train_test_split import sklearn from scipy import stats import getopt from StringIO import StringIO import requests # Convert to one hot def ...
{ "content_hash": "ca4bda8068e33fda72ee49d5211cdae2", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 117, "avg_line_length": 32.52127659574468, "alnum_prop": 0.6630683676807327, "repo_name": "yuriyminin/leap-gesture", "id": "7619107659311a4e2b5ab5618bd7b06b7d120f73", "size...
import sys def print_obj(x, fline=""): for field in x._meta.get_fields(): if field.is_relation: if not hasattr(field, "get_accessor_name"): if getattr(field, 'many_to_many'): m2m_field = getattr(x, field.name) print(f"{fline}{field.name}:...
{ "content_hash": "12b143b043834e7fcb8f3483d5f9115d", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 35.95652173913044, "alnum_prop": 0.4957678355501814, "repo_name": "Crimson-Star-Software/data-combine", "id": "0c50a7fd6249ddcccd5a4c2819484e369888dbdc...
import json import os import yaml import click import dateutil.parser from dateutil import tz from canvas_data.api import CanvasDataAPI from canvas_data.ddl_utils import ddl_from_json class HyphenUnderscoreAliasedGroup(click.Group): def get_command(self, ctx, cmd_name): # try to find the command as type...
{ "content_hash": "08947f460bb90ae1d76f36e478614b0b", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 153, "avg_line_length": 39.519417475728154, "alnum_prop": 0.6287925316300209, "repo_name": "Harvard-University-iCommons/canvas-data-sdk", "id": "ed96bda5507521b7725b26594588...
import mock import copy from cloudify.state import current_ctx from cloudify.mocks import MockCloudifyContext from cloudify.exceptions import NonRecoverableError from cloudify_types.component.constants import CAPABILITIES from ..operations import execute_workflow from ..constants import SHARED_RESOURCE_TYPE from .ba...
{ "content_hash": "e40d1d8652e55d44890d5fc5b1e1f44e", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 78, "avg_line_length": 41.986301369863014, "alnum_prop": 0.5593800978792822, "repo_name": "cloudify-cosmo/cloudify-manager", "id": "9d06b4635604394e67e52d30d4ac7041fa132d2c"...
from setuptools import setup, find_packages from codecs import open from microproxy.version import VERSION import os here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() with open(os.path.join(here, './requirements/proxy....
{ "content_hash": "96e15801f28e48425e191e9793646f4e", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 89, "avg_line_length": 33.21621621621622, "alnum_prop": 0.5895036615134256, "repo_name": "mike820324/microProxy", "id": "0fd66c7693147c80afb1f660e8fd83688d251f65", "size": ...
from __future__ import division, absolute_import, print_function, unicode_literals from time import sleep, time from threading import Lock, Thread from ant.core.constants import MESSAGE_TX_SYNC, RESPONSE_NO_ERROR from ant.core.message import Message, ChannelEventResponseMessage from ant.core.exceptions import Message...
{ "content_hash": "8aaf960ef019268555c7007732fa8d59", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 87, "avg_line_length": 31.05095541401274, "alnum_prop": 0.5423589743589744, "repo_name": "SamyCookie/python-ant", "id": "a8a0efe36deff14da758aed72676b80df7888952", "size":...
import os from setuptools import setup, find_packages PACKAGES = find_packages() # Get version and release info, which is all stored in shablona/version.py ver_file = os.path.join('keratin', 'version.py') with open(ver_file) as f: exec(f.read()) REQUIRES = [] with open('requirements.txt') as f: line = f.readl...
{ "content_hash": "a1fcecd128d5c793c581cf46987510ed", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 74, "avg_line_length": 27.42105263157895, "alnum_prop": 0.5921305182341651, "repo_name": "uw-biomedical-ml/keratin", "id": "8d6b1f0dd19af64cbf36722fa421f8afe9b58c52", "size...
""" This script is a trick to setup a fake Django environment, since this reusable app will be developed and tested outside any specifiv Django project. Via ``settings.configure`` you will be able to set all necessary settings for your app and run the tests as if you were calling ``./manage.py test``. """ import re i...
{ "content_hash": "77ad249f10186ae545145146b126efa3", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 31.59016393442623, "alnum_prop": 0.6808510638297872, "repo_name": "Valuehorizon/valuehorizon-holidays", "id": "dfd14a1c9285ab73c6cf1f05c14ff26eb7826631...
import sys import os from os.path import join # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. for idx in range(3): p = join(...
{ "content_hash": "16b6709ae99ba6f6f4707f1363d1db68", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 79, "avg_line_length": 31.756944444444443, "alnum_prop": 0.7052263284495954, "repo_name": "cellular-nanoscience/pyotic", "id": "7783ea3c4fc1340905e1f798b491cd9dec30dbe7", ...
""" Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import ldap from django_auth_ldap.config import LDAPSearch from .common import * # noqa from core.swiftmanager import SwiftManager # Normally you should not import ANYTHING from Djan...
{ "content_hash": "b2ea934ffeba6af990354dee39de3f46", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 89, "avg_line_length": 32.4804469273743, "alnum_prop": 0.5933952528379773, "repo_name": "FNNDSC/ChRIS_ultron_backEnd", "id": "1b291e277b67c3cafd630f9ec03c1a19e076c0b6", "s...
""" Copyright 2015 INFN (Italy) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
{ "content_hash": "c44f3e26a5732fcbc5fe172a9d60c438", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 74, "avg_line_length": 30.5, "alnum_prop": 0.7693989071038252, "repo_name": "INFN-Catania/FedManager", "id": "8286d49e5c4a45b384237fce0b4cfa757abccb19", "size": "915", "b...
from django.conf.urls import include, url urlpatterns = [ url(r'^$', 'course.views.all_courses', name='courses'), url(r'^search/$', 'course.views.search'), url(r'^(?P<course_id>\d+)/$', 'course.views.course', name='course_object'), url(r'^subscribe/$', 'course.views.subscribe', name='subscribe'), ...
{ "content_hash": "7b2d6313a3aca52dedc83bfdc3f09a64", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 93, "avg_line_length": 48.916666666666664, "alnum_prop": 0.6337308347529813, "repo_name": "starkdee/courseware", "id": "b67b63236d11d7fde1fd1a12cc9e9e6fd2f15175", "size": "...
""" __author__ = 'duzhipeng' __mtime__ = '16/8/11' # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━┛┻┓ ┃ β˜ƒ ┃ ┃ β”³β”› β”—β”³ ┃ ┃ β”» ┃ ┗━┓ ┏━┛ ...
{ "content_hash": "45b08dc466d1e5ff6bfc027369da37c4", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 96, "avg_line_length": 29.943661971830984, "alnum_prop": 0.5804327375352775, "repo_name": "duzhipeng/Ddesk", "id": "ef689f867a86091bcec0f06a8fdf76532c2382e4", "size": "2314...
from chai import Chai from markhov_chain import MarkhovChain class ApiTests(Chai): def setUp(self): super(ApiTests, self).setUp() self.mc = MarkhovChain() def test_add_transition(self): self.mc.add_transition("A", "B") self.mc.add_transition("A", "B") self.mc.add_transition("A", "B") self.mc.add_tr...
{ "content_hash": "b50edc472d3d89c55ee45090fc1d7c19", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 51, "avg_line_length": 22.153846153846153, "alnum_prop": 0.6024305555555556, "repo_name": "ownaginatious/markhov-chain", "id": "1bf46aaa6ab9e14cc4a7054440dee43e7bc7fa71", "...
from __future__ import absolute_import import math from rpython.rlib import rfloat from topaz.module import ModuleDef, ClassDef from topaz.objects.exceptionobject import W_StandardError, new_exception_allocate class Math(object): moduledef = ModuleDef("Math") @moduledef.setup_module def setup_module(s...
{ "content_hash": "0503d846ba6c6a6b2d013b4584a94667", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 116, "avg_line_length": 35.82178217821782, "alnum_prop": 0.6104201216141515, "repo_name": "kachick/topaz", "id": "07eb60e1705b819d32aa53d17194d19e39d96ccb", "size": "7236"...
"""Tests for the experimental input pipeline ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import os import warnings from absl.testing import parameterized import numpy as np from tensorflow.core.protobuf import cluster_pb2 from ...
{ "content_hash": "f7a6a0f831b28638b4f484d1fe85039f", "timestamp": "", "source": "github", "line_count": 943, "max_line_length": 82, "avg_line_length": 40.48356309650053, "alnum_prop": 0.6451697401508801, "repo_name": "brchiu/tensorflow", "id": "490ca813dcee4476f7377df83f4a1400328451e4", "size": "38...
import pickle from hashlib import md5 from datetime import datetime from elasticsearch_dsl import document, field, Mapping from elasticsearch_dsl.exceptions import ValidationException from pytest import raises class MyInner(field.InnerObjectWrapper): pass class MyDoc(document.DocType): title = field.String(...
{ "content_hash": "de3b8dff66307ceae5291be1cfea80c8", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 91, "avg_line_length": 29.509316770186334, "alnum_prop": 0.5711429172805725, "repo_name": "ziky90/elasticsearch-dsl-py", "id": "e0f979d67ea25626fef9e1a3825d191641e1c82c", ...
from sklearn.externals import joblib class SkMnist(object): def __init__(self): self.class_names = ["class:{}".format(str(i)) for i in range(10)] self.clf = joblib.load('/data/sk.pkl') def predict(self,X,feature_names): predictions = self.clf.predict_proba(X) return prediction...
{ "content_hash": "8ad1cc021acd50e3e160324a908b46c3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 27.333333333333332, "alnum_prop": 0.6219512195121951, "repo_name": "kubeflow/example-seldon", "id": "8104b974990d8c8ebaeff1c8c3a1ef66183de92b", "size...
subreddit = 'apexlegends' t_channel = '@r_apexlegends' def send_post(submission, r2t): return r2t.send_simple(submission)
{ "content_hash": "7973866b9f69cc52496f1f6b7c66f90e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 38, "avg_line_length": 21.333333333333332, "alnum_prop": 0.7265625, "repo_name": "Fillll/reddit2telegram", "id": "010369d77636b6a7df7b4bfcc133070435480d1d", "size": "145", ...
import os.path dir_path = os.path.dirname(os.path.realpath(__file__)) with open(os.path.join(dir_path, 'ds.log'), 'a') as fp: fp.write('Hello World')
{ "content_hash": "74469e1ef1bb17ccf166bbee3b889c17", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 26, "alnum_prop": 0.6538461538461539, "repo_name": "DonJayamanne/pythonVSCode", "id": "ace41e3f5c44cd3781dfe7d7210e6b555094ebe3", "size": "161", "bi...
from gui.widgets.frames import Frame from gui.widgets import Buttons import constants as c class PlusMinusFrame(Frame.Frame): def __init__(self, parent, row, column, increase, decrease, **kwargs): Frame.Frame.__init__(self, parent, c.PLUS_MINUS_FRAME, row, column, **kwargs) self.addChildWidgets(( ...
{ "content_hash": "d6839d22bcb50a2d1d7f6af5d9f5f18c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 85, "avg_line_length": 41.166666666666664, "alnum_prop": 0.6619433198380567, "repo_name": "kahvel/VEP-BCI", "id": "a450ad3455fc048785d73d88aad8f7f3cab62d4e", "size": "494",...
plt.close('all')
{ "content_hash": "846ad4a1ef22966c8b3ae30e2d616266", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 16, "avg_line_length": 16, "alnum_prop": 0.6875, "repo_name": "leesavide/pythonista-docs", "id": "2c1b607070d3ff4b8c06e2fc89f7309d5680f038", "size": "56", "binary": false,...
from JumpScale import j base = j.tools.cuisine._getBaseClassLoader() class systemservices(base): def __init__(self, executor, cuisine): base.__init__(self, executor, cuisine)
{ "content_hash": "c4e3d047ed7596376a1fd2c7ae4dec6a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 21.22222222222222, "alnum_prop": 0.6858638743455497, "repo_name": "Jumpscale/jumpscale_core8", "id": "68ef182b458ce4e6e91d8d4ed8dceb579403b834", "size...