text
stringlengths
4
1.02M
meta
dict
from .utils import TYPE_PICKUP, TYPE_TRANSFORM, KEY, MOVE_ACTS class Mining(object): def __init__(self): # map self.env_name = 'mining' nb_block = [1, 3] nb_water = [1, 3] # object obj_list = [] obj_list.append(dict( name='workspace', pickable=F...
{ "content_hash": "02edb09ddd28f6513cf4d74d9932caa4", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 79, "avg_line_length": 40.6125, "alnum_prop": 0.5341643582640813, "repo_name": "srsohn/subtask-graph-execution-light", "id": "dfc48b84ebcd0d1342e884a8382d106db8cc2c3a", "s...
import json import os.path class AzulejoConfiguration(object): """ Handles configuration of program """ def __init__(self, always_use_initial=False): self._initial_config_path = os.path.join(os.path.dirname( os.path.abspath(__file__)), 'initial_config.json') if always_use_initial...
{ "content_hash": "1fc884442150d52fb6f974d0f3666541", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 65, "avg_line_length": 30.555555555555557, "alnum_prop": 0.5970909090909091, "repo_name": "johnteslade/azulejo", "id": "1ede49e3d975237d1f936caf259b4497f0dcd41b", "size": "...
from __future__ import absolute_import from __future__ import unicode_literals from django.conf import settings from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_settings from django.core import mail from django.core.urlresolvers import rev...
{ "content_hash": "d32d1afb9b44ec5bdad7d8db2502fdd0", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 90, "avg_line_length": 41.350467289719624, "alnum_prop": 0.6007458469883603, "repo_name": "bjorand/django-allauth", "id": "b67b4e331f87056888ae4b47c440c437b5231436", "size...
from collections import namedtuple from enum import Enum, unique from numbers import Number from gen.apache.aurora.api.ttypes import Resource ResourceDetails = namedtuple('ResourceDetails', ['resource_type', 'value']) @unique class ResourceType(Enum): """Describes Aurora resource types and their traits.""" CPU...
{ "content_hash": "3ebf6cae524bea4cf82f9d102d88c051", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 86, "avg_line_length": 29.161616161616163, "alnum_prop": 0.6754416349151369, "repo_name": "apache/aurora", "id": "21d1fc7645a6cc1968eb7548ba92b937263c508e", "size": "3435",...
import json import logging import os import uuid from unittest import skip from mock import patch from django.contrib.auth.models import Group, User from django.contrib.gis.geos import GEOSGeometry, Polygon from django.core.files import File from rest_framework import status from rest_framework.authtoken.models impo...
{ "content_hash": "27c53f770dee18a9954d8e56be781509", "timestamp": "", "source": "github", "line_count": 789, "max_line_length": 143, "avg_line_length": 44.453738910012675, "alnum_prop": 0.5811997491018989, "repo_name": "dodobas/osm-export-tool2", "id": "383e2ce1c959cfdc4f31a446dc4a6074a2d92eac", "s...
import os import sys import subprocess import binwalk.core.common import binwalk.core.compat import binwalk.core.plugin class JFFS2Exception(Exception): pass class JFFS2Entry(object): def __init__(self, **kwargs): for (k, v) in binwalk.core.compat.iterator(kwargs): setattr(self, k, v) cl...
{ "content_hash": "45fbb8c76674813f29ef5ec8baf60831", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 138, "avg_line_length": 33.40462427745665, "alnum_prop": 0.5367710676587645, "repo_name": "0x7678/binwalk", "id": "0f43cdc2d831ca987b24ae804a09276f83f034fb", "size": "5779...
from . import core, utils import cgt import ctypes, os.path as osp, hashlib, numpy as np, sys, subprocess, string, os, time, traceback, cPickle from collections import defaultdict, namedtuple from StringIO import StringIO import logging def function(inputs, outputs, dbg=None, updates=None, givens=None): assert isi...
{ "content_hash": "b8c60f03373571c8cbdfa906e2fea2ab", "timestamp": "", "source": "github", "line_count": 894, "max_line_length": 167, "avg_line_length": 40.22371364653244, "alnum_prop": 0.5846218020022247, "repo_name": "FighterLYL/cgt", "id": "aef0647deb74cc8ccc6bfd6606bb0d3e14c3a901", "size": "3596...
from scipy.stats import scoreatpercentile def percentile(tosort, percentile=95): return scoreatpercentile(tosort, percentile)
{ "content_hash": "bda8cf33d950a1db787c2d3446dc8000", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 55, "avg_line_length": 34.5, "alnum_prop": 0.7753623188405797, "repo_name": "xchewtoyx/pct95-bench", "id": "7c5f831db50ea7a5792a6b4915dec9b3748c48f7", "size": "202", "bina...
''' pyssdb ~~~~~~~ A SSDB Client Library for Python. :copyright: (c) 2013-2017 by Yue Du. :license: BSD 2-clause License, see LICENSE for more details. ''' from __future__ import print_function import os import sys import socket import functools import itertools __version__ = '0.4.2' __author__ = 'Yue Du <ifduyue@...
{ "content_hash": "a46a375aae89f9dc079ea5dec56895d8", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 91, "avg_line_length": 29.546875, "alnum_prop": 0.5519566367001586, "repo_name": "ifduyue/pyssdb", "id": "e69cd0f8f7369dbf1d7836a3e5231abbcff7e8cd", "size": "7622", "bin...
from mitmproxy.addons import check_alpn from mitmproxy.test import taddons from ...conftest import requires_alpn class TestCheckALPN: @requires_alpn def test_check_alpn(self): msg = 'ALPN support missing' with taddons.context() as tctx: a = check_alpn.CheckALPN() tctx...
{ "content_hash": "a5c7851209ea7d8948c7b06450fff399", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 47, "avg_line_length": 27.043478260869566, "alnum_prop": 0.6205787781350482, "repo_name": "xaxa89/mitmproxy", "id": "2b1d60587528cd09215a67a7d85af4ed39d187ea", "size": "622...
from eventlet import patcher from eventlet.green import zmq from eventlet.hubs import _threadlocal from eventlet.hubs.hub import BaseHub, READ, WRITE, noop from eventlet.support import clear_sys_exc_info import sys time = patcher.original('time') select = patcher.original('select') sleep = time.sleep EXC_MASK = zmq.P...
{ "content_hash": "266eaecfd630b21bd3f483a8485df91c", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 78, "avg_line_length": 34.36363636363637, "alnum_prop": 0.5944444444444444, "repo_name": "2013Commons/HUE-SHARK", "id": "686c97421fc65ff75505a66a3b38949c74781975", "size":...
import json from django.views.decorators.csrf import csrf_exempt from keychain.models import Account from keychain.models import App from keychain.models import User from keychain.models import Service from keychain.views.client.userview import validate_request, status_response, encrypt_response import re @csrf_ex...
{ "content_hash": "4201a5da07060a83ab7ec8afd6a84980", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 99, "avg_line_length": 40.407766990291265, "alnum_prop": 0.5737626141278231, "repo_name": "osgee/keychainserver", "id": "2b6d5145b12904a336d022391c5d20b68a2dcb50", "size":...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import lambdainst.models from django.conf import settings import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
{ "content_hash": "6bb1bf117be882d994a64bd6b21de31d", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 172, "avg_line_length": 45.763888888888886, "alnum_prop": 0.5723823975720789, "repo_name": "CCrypto/ccvpn3", "id": "ed7ecb5b160e1203651d2442215f54674350d4d2", "size": "3319...
from Penguin.ClubPenguin import ClubPenguin from Penguin.ClubPenguin import PenguinFactory from Penguin.Penguin import Penguin class MyPenguin(Penguin): def __init__(self, player): super(MyPenguin, self).__init__(player) self.addListener("jr", self.handleJoinRoom) # Joins room 800 (the dock) at coordinates 2...
{ "content_hash": "5add5a3e5efd3bf79a4dde121ca53239", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 74, "avg_line_length": 23.317073170731707, "alnum_prop": 0.7437238493723849, "repo_name": "TunnelBlanket/Penguin", "id": "d25d897ee8bf1a5b4f78e9d4324ff2cea1643364", "size":...
from .base import TestBase from flask import session from flask.sessions import SecureCookieSession import carafe from carafe.ext.session import SessionInterface class TestSession(TestBase): class __config__(object): CARAFE_SESSION_PERMANENT = True CARAFE_SESSION_SALT = 'carafe-salt' SEC...
{ "content_hash": "410dbcb82bb6b10e3fe6bfe3bfb2b296", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 28.958333333333332, "alnum_prop": 0.6100719424460431, "repo_name": "dgilland/carafe", "id": "90a50eb973092f24a900b208771e8e21ed6c9914", "size": "1391...
""" .. _tut-sensors-time-freq: ============================================ Frequency and time-frequency sensor analysis ============================================ The objective is to show you how to explore the spectral content of your data (frequency and time-frequency). Here we'll work on Epochs. We will use th...
{ "content_hash": "05bbf5a732028fcbcd517cf01458d6bc", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 40.98994974874372, "alnum_prop": 0.5910261125413755, "repo_name": "mne-tools/mne-tools.github.io", "id": "66a46924d1a78e00ec287865c1e90a10654b83bd", ...
""" Compare tagging speed for LSTM, using dummy data. Results on CPU laptop: PyTorchLSTM.v1: Predicted 39017 4.033804399892688 Ys[0] 0.05000001 5.551115e-17 LSTM (NumpyOps): Predicted 39018 13.174870599992573 Ys[0] 0.05000001 5.551115e-17 So PyTorch is 3x faster currently. """ from typing import List import typer i...
{ "content_hash": "3ef54183ec46a4633d2744877e7508f3", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 81, "avg_line_length": 26.895705521472394, "alnum_prop": 0.5983120437956204, "repo_name": "spacy-io/thinc", "id": "b4e986b44f0a6be1b0040b00dbdb0e5f42c8ebcf", "size": "4384...
import uuid from django import forms from django.template.defaultfilters import slugify from .compat import six from .models import Answer, Campaign, EnumeratedQuestions, Sample from .utils import get_question_model def _create_field(ui_hint, text, has_other=False, required=False, choices=None): ...
{ "content_hash": "6bf6431deffbce576973e091c8be1c4e", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 80, "avg_line_length": 36.888324873096444, "alnum_prop": 0.5999724783266822, "repo_name": "djaodjin/djaodjin-survey", "id": "998ef9ffcaaeac7b31be46f4611266325fe63186", "si...
"""Controller that returns information on the heat API versions. Now it's an subclass of module versions, because of identity with OpenStack module versions. """ from heat.api import versions Controller = versions.Controller
{ "content_hash": "12449ac59fe31355c4d760ccd3ca568f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 28.375, "alnum_prop": 0.7973568281938326, "repo_name": "gonzolino/heat", "id": "66183145b73e304dc51d51c2a7fbb7259c18bdde", "size": "802", "binary": ...
"""ASkiBot, cloned from IRC to TG because newfags can't even.""" import tgbot import logging import socket import threading import time import random import errno import pickle import collections TOKEN_TXT = 'token.txt' KEULII_TXT = 'keulii.txt' QUOTES_DIR = 'quotes' MOPOPOSTERPORT = 6688 class Mopoposter: """Si...
{ "content_hash": "bc644099b9a0d56dacbd36ad60385c32", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 111, "avg_line_length": 35.56310679611651, "alnum_prop": 0.5832650832650833, "repo_name": "sooda/askibot-tg", "id": "03be92ef03cbda9b76097d0a9120ea6f144639bc", "size": "14...
from __future__ import print_function import os.path import shutil from datetime import datetime from subprocess import call from util import render from util import tempdir from s3 import S3 class LambdaBuilder(object): """ Create and upload ZIP archive to S3 for AWS lambda function from CFN. """ ...
{ "content_hash": "95a0a2bc0c6ffcf4f5b3422c25ab49a1", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 119, "avg_line_length": 31.373737373737374, "alnum_prop": 0.5724404378622022, "repo_name": "clifflu/awscatalyst", "id": "d32e140d4b6de51f62f03832f5c465a83f178f35", "size": ...
''' Copyright 2017, Fujitsu Network Communications, Inc. 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 w...
{ "content_hash": "8e3bb5e5e34e066aa52cb48b932d0dfb", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 98, "avg_line_length": 40.82222222222222, "alnum_prop": 0.6410814734168028, "repo_name": "warriorframework/warriorframework", "id": "014145465df120fff59d3d5bd10aa02c7fbf9531...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('devices', '0006_ups'), ] operations = [ migrations.RemoveField( model_name='ups', name='id', ), migrations.A...
{ "content_hash": "741d530a1ac68c4bca0dc614bae4e83b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 102, "avg_line_length": 22.90909090909091, "alnum_prop": 0.5654761904761905, "repo_name": "lindseypack/NIM", "id": "e0d7fc0a6a8cf0d6b2e5d5991f5670cf6b010b35", "size": "528"...
""" Module that enables the use of ensembles in NowTrade. """ import cPickle from itertools import chain import numpy as np from sklearn.ensemble import RandomForestRegressor #, RandomForestClassifier from nowtrade import logger RANDOM_FOREST_REGRESSOR = 'Random Forest Regressor' RANDOM_FOREST_CLASSIFIER = 'Random For...
{ "content_hash": "0b210c536686d3f2eac9235d2afaea64", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 98, "avg_line_length": 41.046875, "alnum_prop": 0.6108361883009771, "repo_name": "edouardpoitras/NowTrade", "id": "ec9a76dc9da064a897f1e0167bb4ceb748401e4c", "size": "7881...
""" Role ==== The ``MultiprocessPluginProxy`` is instanciated by the MultiprocessPluginManager to replace the real implementation that is run in a different process. You cannot access your plugin directly from the parent process. You should use the child_pipe to communicate with your plugin. The `MultiprocessPluginPr...
{ "content_hash": "41c64928db84a16e0f94aeb4b0b52de7", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 115, "avg_line_length": 34.86666666666667, "alnum_prop": 0.7829827915869981, "repo_name": "WhySoGeeky/DroidPot", "id": "9bd2da374ec7efe129fd01a60383ea4fd59a44b3", "size": "...
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, logger, info_main, which from os.path import join, exists from os import walk import glob import sh class PygameBootstrap(Bootstrap): name = 'pygame' recipe_depends = ['hostpython2', 'python2', 'pyjnius'...
{ "content_hash": "fd53e45f1a610956f480852881a4fc05", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 131, "avg_line_length": 46.81651376146789, "alnum_prop": 0.5263570448755633, "repo_name": "inclement/python-for-android-revamp", "id": "eae552155854ed23c85c8ff47e9c7372deb81...
def is_decreasing(seq): decreasing = True for i in range(len(seq) - 1): if seq[i] <= seq[i + 1]: decreasing = False return decreasing
{ "content_hash": "b919496a9c848465dfa3c79de7074e7d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 33, "avg_line_length": 23.857142857142858, "alnum_prop": 0.5508982035928144, "repo_name": "stoilov/Programming101", "id": "844b81ed9f38443afd6e534a4faeacd906b8d261", "size":...
from m5.params import * from m5.SimObject import SimObject class RubySystem(SimObject): type = 'RubySystem' random_seed = Param.Int(1234, "random seed used by the simulation"); randomization = Param.Bool(False, "insert random delays on message enqueue times"); clock = Param.Clock('1GHz', "") ...
{ "content_hash": "d849c66eb1224195a4886fdbc03b35eb", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 72, "avg_line_length": 42.166666666666664, "alnum_prop": 0.6732542819499341, "repo_name": "dpac-vlsi/SynchroTrace", "id": "11663e27165ce04c8e8c1d8edc7c6e1f51177af9", "size"...
from __future__ import unicode_literals import pytest from django.core.exceptions import ValidationError from machina.apps.forum.signals import forum_moved from machina.core.db.models import get_model from machina.test.context_managers import mock_signal_receiver from machina.test.factories import PostFactory from ma...
{ "content_hash": "4dee766250c1d6024b34d1c2293adfc2", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 100, "avg_line_length": 42.25423728813559, "alnum_prop": 0.672282390693943, "repo_name": "reinbach/django-machina", "id": "5d6cafe1ede88f4077f73be26d39fc16c1e48fed", "size...
def test_stickers(appmarket): wd = appmarket.wd appmarket.navigation.open_home_page() ducks = wd.find_elements_by_css_selector("div.image-wrapper") for duck in ducks: if len(duck.find_elements_by_xpath(".//*[starts-with(@class,'sticker')]")) != 1: print(duck.find_element_by_css_selec...
{ "content_hash": "d35c56fabe54f2e1e8365518c9e750dc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 176, "avg_line_length": 35.05263157894737, "alnum_prop": 0.53003003003003, "repo_name": "Dob3r/python_seleniumwebdriver", "id": "c0be027d9c25581864877d5201490bad9fb15772", ...
from datetime import datetime import os import sys import astropy try: from sphinx_astropy.conf.v1 import * # noqa except ImportError: print('ERROR: the documentation requires the sphinx-astropy package to be installed') sys.exit(1) plot_rcparams = {} plot_rcparams['figure.figsize'] = (6, 6) plot_rcpara...
{ "content_hash": "12de2f9dabb838a99fcf9b5095e1eabc", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 111, "avg_line_length": 39.06808510638298, "alnum_prop": 0.6614747848818211, "repo_name": "stargaser/astropy", "id": "0914d286a3f76a32a350bd26b26d3d592969e375", "size": "1...
import sqlite3 import gevent from copy import copy from gevent.event import Event from gevent.queue import Queue from shemutils.logger import Logger from shemutils.database_errors import InvalidInitializer, InvalidSize '# Define static variables for module' INTEGER = "INTEGER" TEXT = "TEXT" NULL = "NULL" class Contr...
{ "content_hash": "eee3e5479398ef60b49be1cd836a1b0d", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 113, "avg_line_length": 34.74885844748859, "alnum_prop": 0.5587385019710907, "repo_name": "0x00-0x00/shemutils", "id": "aa17695bea3532a798fc692418fe2d9589a64bbd", "size": ...
from django.conf.urls import include from django.conf.urls import url from rest_framework import routers from .viewsets import LessonViewset router = routers.SimpleRouter() router.register(r"lesson", LessonViewset, base_name="lesson") urlpatterns = [url(r"^", include(router.urls))]
{ "content_hash": "74a826dc04e3203903a41b995645deae", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 28.6, "alnum_prop": 0.7832167832167832, "repo_name": "mrpau/kolibri", "id": "1429a7f6de132d40dc9fa2a3e3f8e342b9d630b0", "size": "286", "binary": fa...
""" Functions for examining different file types. """ import struct import binascii def assert_eq(a, b): assert a == b, "'%s' (%r) != '%s' (%r)" % (a, a, b, b) class FlashBootImageFile(object): """ FlashBootImage (.fbi) file. Used for firmware loaded from flash into main memory by the MiSoC/LiteX ...
{ "content_hash": "f3984d7b78d8e6d8992c63fc0460f81e", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 111, "avg_line_length": 29.666666666666668, "alnum_prop": 0.5192883895131086, "repo_name": "timvideos/HDMI2USB-mode-switch", "id": "b3e44502df274b46e55f11e4cb0a13b92b3afc26"...
"""This example pauses a line item. Line items must be paused before they can be updated. To determine which line items exist, run get_all_line_items.py """ # Import appropriate modules from the client library. from googleads import ad_manager # Set the ID of the line item to pause. LINE_ITEM_ID = 'INSERT_LINE_ITEM_...
{ "content_hash": "6c307ae1d45a76d80013ab663252efe2", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 34.827586206896555, "alnum_prop": 0.6905940594059405, "repo_name": "Aloomaio/googleads-python-lib", "id": "5a5a3873de185a9b490d7222c732724710e89890", ...
from dal.oracle.ae2 import db from dal.oracle.common import execute_insert, execute_select __author__ = 'Ahmed G. Ali' def insert_publication(article): id = execute_select('select SEQ_PUBLICATION.nextval*50 as id from dual', db)[0].id sql = """INSERT INTO PUBLICATION ( ...
{ "content_hash": "efc0abf1f2e23a25caf03d4613d72b5a", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 125, "avg_line_length": 36.05128205128205, "alnum_prop": 0.44985775248933146, "repo_name": "arrayexpress/ae_auto", "id": "caed7e317d9c09eaa6b8fe51e71ae7c0992ee134", "size":...
import os import sys import GafferUI QtCore = GafferUI._qtImport( "QtCore" ) QtGui = GafferUI._qtImport( "QtGui" ) def showURL( url ) : if sys.platform == "darwin" : os.system( "open \"" + url + "\"" ) else : QtGui.QDesktopServices.openUrl( QtCore.QUrl( url, QtCore.QUrl.TolerantMode ) )
{ "content_hash": "036644eb82d9cad2acda6e6939d3d4db", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 80, "avg_line_length": 21.285714285714285, "alnum_prop": 0.6677852348993288, "repo_name": "chippey/gaffer", "id": "951287d2f41b43fd68ae8f0ac79cf50b799d2e63", "size": "2158"...
from admin_tools.dashboard import modules from linkcheck.views import get_status_message try: from django.urls import reverse except ImportError: # Django < 1.10 from django.core.urlresolvers import reverse linkcheck_dashboard_module = modules.LinkList( title="Linkchecker", pre_content=get_status_me...
{ "content_hash": "748cf87f7fa4ee5cc5225548657c9911", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 100, "avg_line_length": 37.26315789473684, "alnum_prop": 0.672316384180791, "repo_name": "claudep/django-linkcheck", "id": "4a7afcd7638bdfe53c003e377ff4f6cf301479e1", "size...
from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^uploads$', 'books.views.uploads'), url(r'^uploads/new$', 'books.views.new_upload'), url(r'^uploads/(\d+)/edit$', 'books.views.edit_upload'), url(r'^uploads/(\d+)/cover$', 'books.views.upload_cover'), url(r'^uploads/(\...
{ "content_hash": "697e9b5e168e0dddce783381b6c0b6c2", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 86, "avg_line_length": 47.92857142857143, "alnum_prop": 0.639344262295082, "repo_name": "davols/WhatManager2", "id": "8cf78673e703fa4dcc49124318ccd095e5630267", "size": "67...
from django.db import models class ConnectionState(models.TextChoices): ENABLED = "enabled", "Enabled" DISABLED = "disabled", "Disabled"
{ "content_hash": "20c4392181ea4d33dbbe9ae0659dba50", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 24.5, "alnum_prop": 0.7210884353741497, "repo_name": "respawner/peering-manager", "id": "65e3e6b342701d252586618edddc9cc848b4b18b", "size": "147", "...
from ..AbstractTree import AbstractTree from .Node import Node __author__ = "Luka Avbreht" class AvlTree(AbstractTree): """ Clas that implements Avl tree on top of abstract tree class """ def __init__(self, data=None): self.root = None if data is not None: for i in data: ...
{ "content_hash": "282b5a28c32447d90046aefa73014772", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 125, "avg_line_length": 33.24418604651163, "alnum_prop": 0.4681706890521161, "repo_name": "jO-Osko/PSA2", "id": "1f5c2dc0124d5a6421f50de24c34cb7fabc82aa3", "size": "11436"...
""" Module holds base stuff regarding JMX format Copyright 2015 BlazeMeter Inc. 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 ap...
{ "content_hash": "a912cc6b17af8d2eb510b74977d71002", "timestamp": "", "source": "github", "line_count": 1396, "max_line_length": 119, "avg_line_length": 39.56375358166189, "alnum_prop": 0.5905017109956365, "repo_name": "greyfenrir/taurus", "id": "85543779f4707d908320aa3b1785f4aa43974409", "size": "...
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import DataRequired, Length, Email class LoginForm(FlaskForm): email = StringField(u'邮箱', validators=[DataRequired(), Length(1, 64), Email(...
{ "content_hash": "7056f2798e9f84ca8722ba7a895fcdd7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 45.89473684210526, "alnum_prop": 0.6502293577981652, "repo_name": "goalong/flask-demo", "id": "4bea5c90f16bafd0ed85ef3266af20789e882aea", "size": "93...
from page_sets.rendering import rendering_story from page_sets.rendering import story_tags from page_sets.system_health import platforms class ToughWebglPage(rendering_story.RenderingStory): ABSTRACT_STORY = True TAGS = [story_tags.REQUIRED_WEBGL, story_tags.TOUGH_WEBGL] def __init__(self, page_...
{ "content_hash": "6782921a43f79d22c7e4f5cf7d2a9ec1", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 207, "avg_line_length": 38.466981132075475, "alnum_prop": 0.7347639484978541, "repo_name": "scheib/chromium", "id": "0cb555a1d75f9b8bb58af54fb600febf5ab2ee1a", "size": "83...
import unittest import mock from ..views import PostingDetailView from ..models import JobPosting class PostingDetailViewTestCase(unittest.TestCase): def test_model_should_reference_job_posting_model(self): # setup view = PostingDetailView() # assert self.assertEqual(id(JobPostin...
{ "content_hash": "24698a0e4b64dac71e309864c7cb5b37", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 63, "avg_line_length": 29.5, "alnum_prop": 0.6483050847457628, "repo_name": "hellhound/dentexchange", "id": "d63716c05b0c1dc4d67398d7e2711de151f06dd5", "size": "967", "bi...
import datetime from p1tr.helpers import clean_string, humanize_time from p1tr.plugin import * class Seen(Plugin): """ Tracks all user's most recent time of activity. """ def initialize(self): Plugin.__init__(self) # Storage format: key = username, # value = (timestamp, channel...
{ "content_hash": "a20e6040f2090a4a8ab6e280be7023a4", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 36.60655737704918, "alnum_prop": 0.5875503806538289, "repo_name": "howard/p1tr-tng", "id": "73795d81f8f5dd2bf7777b2e3676a7074230dbc1", "size": "2233"...
from tastypie.resources import ModelResource from tastypie.fields import ToOneField, ToManyField, CharField # pyflakes:ignore from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore from ietf import api from ietf.doc.models import * # pyflakes:ignore from ietf.name.resour...
{ "content_hash": "e668d74d1c88224692ff05d389860558", "timestamp": "", "source": "github", "line_count": 486, "max_line_length": 143, "avg_line_length": 38.19547325102881, "alnum_prop": 0.5926305015353122, "repo_name": "wpjesus/codematch", "id": "93ecea04d7558f7c46a931ca1c734936a6ac10a0", "size": "1...
""" Primarily dashboards. Generic plotting is in sidpy Submodules ---------- .. autosummary:: :toctree: _autosummary """ __all__ = ['']
{ "content_hash": "c42c61b78f3a26748ab983edd91bb745", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 50, "avg_line_length": 12, "alnum_prop": 0.5902777777777778, "repo_name": "pycroscopy/pycroscopy", "id": "f230cf7585b6f9dbd236dd1b6aa13b3df87b7f7a", "size": "144", "binar...
""" Module to get information from Keystone DB """ __author__ = 'gpetralia' import json from contextlib import closing import mysql.connector as MySQLdb class KeystoneDb(): """ Exposes methods to get information regarding Keystone resources. It manages the connection to the Keystone DB """ def __i...
{ "content_hash": "64a33a674bb59e54d26385d49b3a319e", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 113, "avg_line_length": 37.75555555555555, "alnum_prop": 0.5341377280753384, "repo_name": "IntelLabsEurope/infrastructure-repository", "id": "65968a13b402b2c8c5767ee806cb2fb4...
"""RunAbove image service library.""" from base import Resource, BaseManagerWithList class ImageManager(BaseManagerWithList): """Manage images available in RunAbove.""" basepath = '/image' def get_by_id(self, image_id=None): """Get one image from a RunAbove account. :param image_id: ID...
{ "content_hash": "eb98f0130712697eaa06bf800e868565", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 70, "avg_line_length": 27.16216216216216, "alnum_prop": 0.5691542288557214, "repo_name": "NicolasLM/python-runabove", "id": "e699eea88af9a21c9cb8b0f357add9bbddc2783f", "siz...
""" Functionality related to versioning. This makes project version management much easier. """ from __future__ import absolute_import import re from os.path import exists # MAJOR.MINOR[.PATCH[-BUILD]] RE_VERSION = re.compile( r'^' r'(?P<major>\d+)\.' r'(?P<minor>\d+)' r'(\.(?P<patch>\d+))?' r'$' ...
{ "content_hash": "25cbdcb5e8ab14a89f0bc16ea4f63722", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 75, "avg_line_length": 23.348314606741575, "alnum_prop": 0.588065447545717, "repo_name": "novopl/fabutils", "id": "d695e113eee5404053adc9d3bfbefe06c719691a", "size": "2102"...
""" pykube.config unittests """ import os from pykube import config, exceptions from . import TestCase GOOD_CONFIG_FILE_PATH = os.path.sep.join(["test", "test_config.yaml"]) DEFAULTUSER_CONFIG_FILE_PATH = os.path.sep.join(["test", "test_config_default_user.yaml"]) class TestConfig(TestCase): def setUp(self):...
{ "content_hash": "2cc6ba93952dca30b877eff467e329dc", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 90, "avg_line_length": 29.00854700854701, "alnum_prop": 0.572775486152033, "repo_name": "gralfca/pykube", "id": "dc519d16c9353e5f49fc599307fcec59364ce16a", "size": "3394",...
from django.db import models class CommentForListDestroyModelMixin(models.Model): email = models.EmailField()
{ "content_hash": "487a829009d731a0e40c95b0d095b5d3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 52, "avg_line_length": 23.2, "alnum_prop": 0.7931034482758621, "repo_name": "chibisov/drf-extensions", "id": "9b3e92ea3cac41a8f7a8a1ab984c9ae2b05bcdbf", "size": "116", "bi...
import os import psycopg2 import sys from psycopg2 import extensions as psy_ext from conary.dbstore.base_drv import BaseDatabase, BaseCursor, BaseKeywordDict from conary.dbstore import _mangle from conary.dbstore import sqlerrors from conary.dbstore import sqllib class KeywordDict(BaseKeywordDict): keys = BaseKe...
{ "content_hash": "3ff252199df0b476dc03f29eb15c60b9", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 99, "avg_line_length": 34.89296636085627, "alnum_prop": 0.5741454864154251, "repo_name": "fedora-conary/conary", "id": "09853ba66a3872bd61de5fa74e499275f230de4f", "size": ...
"""Per-prefix data, mapping each prefix to a name. Auto-generated file, do not edit by hand. """ from ..util import u # Copyright (C) 2011-2022 The Libphonenumber Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
{ "content_hash": "afa2c66eeebc8e047e2099f3d8367e1d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 74, "avg_line_length": 32.96, "alnum_prop": 0.7572815533980582, "repo_name": "daviddrysdale/python-phonenumbers", "id": "944037a9fc9b86b1251d1106178a805582ab1f00", "size": ...
import os from urllib.parse import urlsplit from astropy.time import TimeDelta from astropy.time import Time import astropy.units as u from datetime import timedelta from sunpy.time import parse_time, TimeRange from ..client import GenericClient from sunpy import config TIME_FORMAT = config.get("general", "time_for...
{ "content_hash": "f8dbe49206f2a3bef16bf7203bfebb96", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 91, "avg_line_length": 36.40816326530612, "alnum_prop": 0.5590433482810164, "repo_name": "dpshelio/sunpy", "id": "80791b52a344c5bfe0f76528c2de91edc1c34c5f", "size": "5495"...
""" EDITS: Joshua Beard - comments added for clarity This module defines the entry point into the IBEIS system ibeis.opendb and ibeis.main are the main entry points """ from __future__ import absolute_import, division, print_function from six.moves import builtins # For py2 & py3 compatability import sys # for system c...
{ "content_hash": "e4d5a12f8e1794f84a7ccbecfff98ed9", "timestamp": "", "source": "github", "line_count": 607, "max_line_length": 96, "avg_line_length": 32.95387149917628, "alnum_prop": 0.6037094435834625, "repo_name": "SU-ECE-17-7/ibeis", "id": "134145f3fd9bb14437d8afdb3ad83394a5194c0f", "size": "20...
""" A micro wx App with a list of the things checked on the checklist. """ import datetime import random import wx import hotmodel import production import hotwidgets class ProcView(hotwidgets.MVCList): """ A specialized version of MVCList that sets columns for the process op...
{ "content_hash": "48e7bd7008f2c4638d05f819eb3308c1", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 77, "avg_line_length": 30.899224806201552, "alnum_prop": 0.539136979427998, "repo_name": "petrblahos/modellerkit", "id": "108b804ff9d21e5b62bfc892b4ebf4ba266ad7ba", "size"...
""" Name: 'OpenCTM (*.ctm)...' Blender: 248 Group: 'Import' Tooltip: 'Import an OpenCTM file' """ import bpy import Blender from Blender import Mesh, Scene, Window, sys, Image, Draw import BPyMesh import math import ctypes from ctypes import * from ctypes.util import find_library import os __auth...
{ "content_hash": "492699a10d32175460d91731627d5226", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 86, "avg_line_length": 27.915555555555557, "alnum_prop": 0.6377965292150931, "repo_name": "wibbe/pbr-test", "id": "42ef5b49bf90d36cc091cbc8f8d0da61cee8d2b5", "size": "6288...
import socket import fcntl import struct def get_ip_address(ifname): s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl(s.fileno(),0x8915,struct.pack('256s',ifname[:15]))[20:24]) res = '{"key":"ClientIP","value":{"ip":"%s"}}' %get_ip_address('eth0') output = open('/home/pi/...
{ "content_hash": "a655d1d73b68564c9f80e05ea832188d", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 98, "avg_line_length": 34.09090909090909, "alnum_prop": 0.6933333333333334, "repo_name": "XintingXu/AutoWaterSystem", "id": "698c15be53c06677fb9e5a14656e2483e8c5584e", "siz...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("ddcz", "0086_renames_followup"), ] operations = [ migrations.AlterModelOptions( name="reputacelog", options={}, ), migrations.AlterModelOptions( ...
{ "content_hash": "8a1e1901a6afea3d8c9032ba43bf26be", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 44, "avg_line_length": 23.333333333333332, "alnum_prop": 0.5349206349206349, "repo_name": "dracidoupe/graveyard", "id": "a9ac7e478c4d1f38d49fcc8ead589c6a82626bdb", "size": ...
import json import uuid from examples import acquire_token_by_username_password from office365.graph_client import GraphClient def print_success(group): """ :type group: office365.directory.groups.group.Group """ print(f"team has been deleted") client = GraphClient(acquire_token_by_username_passwor...
{ "content_hash": "a8e603fd76ed99de01034acde7761f1b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 84, "avg_line_length": 27.3, "alnum_prop": 0.7435897435897436, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "caed63d1f74e8ef09ca84c49b85d86fcd138ff96", "size": ...
import urwid from mitmproxy.tools.console.grideditor import base from mitmproxy.tools.console import signals from mitmproxy.net.http import cookies class Column(base.Column): def __init__(self, heading, subeditor): super().__init__(heading) self.subeditor = subeditor def Edit(self, data): ...
{ "content_hash": "63fbb230c8f56bbe13a0c7f8b8d34a74", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 70, "avg_line_length": 26.121951219512194, "alnum_prop": 0.5929038281979458, "repo_name": "mhils/mitmproxy", "id": "be4b4271b5535b72ca891f89cae176d163f63368", "size": "1071...
from django.db import models from django.conf import settings from django.utils.encoding import python_2_unicode_compatible PUBLISHED_CHOICES = (('private', 'private'), ('public', 'public'), ('shared', 'shared')) PUBLISHED_DEFAULT = PUBLISHED_CHOICES[0][1] @python_2_unicode_compatible class Photo(models.Model): ...
{ "content_hash": "6883e2c834e023f340a54efb8f2ff935", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 103, "avg_line_length": 31.339285714285715, "alnum_prop": 0.6763532763532764, "repo_name": "DZwell/django-imager", "id": "b0b67faefd5b86a4236ef41159896a01d9ca62bc", "size":...
from .world import world, res_filename from bigml.fields import Fields, get_resource_type from bigml.io import UnicodeReader from nose.tools import eq_ #@step(r'I create a Fields object from the source with objective column "(.*)"') def create_fields(step, objective_column): world.fields = Fields(world.source, o...
{ "content_hash": "53bad972407f9c82a334b3d59b08b7f0", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 81, "avg_line_length": 38.82608695652174, "alnum_prop": 0.6905561776782382, "repo_name": "mmerce/python", "id": "d9f209c33501bb383c146658bd83907f2bf23dc4", "size": "3280", ...
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from bs4 import BeautifulSoup register = template.Library() @register.filter(is_safe=True) @stringfilter def html2js(value): soup = mark_safe(BeautifulSoup(value)) return repr(sou...
{ "content_hash": "fd8e407f381ba7532d144e219e2ed727", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 55, "avg_line_length": 25.964285714285715, "alnum_prop": 0.7290233837689133, "repo_name": "Tarun12345/rat-notes", "id": "b939813a9027b8dd48d4c4924b5d4594834745e7", "size": ...
""" This module implements a TensorBoard log writer. """ import os import tensorflow as tf from niftynet.engine.application_variables import TF_SUMMARIES from niftynet.engine.signal import \ TRAIN, VALID, ITER_STARTED, ITER_FINISHED, GRAPH_CREATED from niftynet.io.misc_io import get_latest_subfolder class Tenso...
{ "content_hash": "86c5c13c6d6c2f9847fbe19ee0a77fdd", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 33.36842105263158, "alnum_prop": 0.6126182965299685, "repo_name": "NifTK/NiftyNet", "id": "b5bf693f4f8451ebbcfec7c368e2f1f4b72054e2", "size": "3194",...
""" ===================== Simple volume slicing ===================== Here we present an example for visualizing slices from 3D images. """ from __future__ import division import os import nibabel as nib from dipy.data import fetch_bundles_2_subjects from dipy.viz import window, actor """ Let's download and load a...
{ "content_hash": "de871e11c1c687ce3141e2c919ae2d8c", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 79, "avg_line_length": 24.37735849056604, "alnum_prop": 0.6331269349845201, "repo_name": "matthieudumont/dipy", "id": "96664a3472938b8f9d1512dfc3d2953fedac1053", "size": "...
''' test_core.py: Python testing for core functions for Singularity in Python, including defaults, utils, and shell functions. Copyright (c) 2016-2017, Vanessa Sochat. All rights reserved. "Singularity" Copyright (c) 2016, The Regents of the University of California, through Lawrence Berkeley National...
{ "content_hash": "ef6bac22100c0131a51c8f731f7cc54f", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 96, "avg_line_length": 38.348314606741575, "alnum_prop": 0.604160562554937, "repo_name": "Trophime/singularity", "id": "88fc23aed76bed716e46b2c22adb32b6b0e85b4b", "size": ...
from __future__ import absolute_import, print_function, division import unittest from pony.orm.core import * from pony.orm.tests.testutils import * db = Database('sqlite', ':memory:') class Student(db.Entity): name = Required(unicode, autostrip=False) foo = Optional(unicode) bar = Optional(u...
{ "content_hash": "5740c4da5703fd802c621a54d5b65fab", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 94, "avg_line_length": 36.54502369668246, "alnum_prop": 0.5761898586434963, "repo_name": "Ahmad31/Web_Flask_Cassandra", "id": "2d71d54941b2f3646490fcf8350d6f625f4b9355", "...
""" Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context diff format. Function nd...
{ "content_hash": "f2c4f67d828f8c603b55d8ae8eea20ae", "timestamp": "", "source": "github", "line_count": 2039, "max_line_length": 83, "avg_line_length": 40.05885237861697, "alnum_prop": 0.5657443682664055, "repo_name": "chidea/GoPythonDLLWrapper", "id": "56d4852a375530dc6dae715eeea460a1a6f8fd31", "s...
import sys import time import argparse import pathlib import logging import subprocess import docker_image def main(): parser = argparse.ArgumentParser("Extract using docker extractor image") parser.add_argument("--in-file", type=lambda p: pathlib.Path(p).absolute(), required=True, help="Input file (e.g. And...
{ "content_hash": "143e6e281ecec6a60a6c5fb48f4035a7", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 134, "avg_line_length": 32.86538461538461, "alnum_prop": 0.6155646576945583, "repo_name": "srlabs/extractor", "id": "d3ca66d5899c9a26c245877f6ba47e7ab09024d4", "size": "239...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Profile.avatar' db.add_column(u'profiles_profile', 'avatar', ...
{ "content_hash": "b0adf517bc4b675ea90b0edd82cf9709", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 225, "avg_line_length": 74.14285714285714, "alnum_prop": 0.5549132947976878, "repo_name": "us-ignite/us_ignite", "id": "c09fcbc87606aa4c4b3753dcd03421ff3db951af", "size": "...
"""General tests for embeddings""" # LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE from itertools import product import numpy as np from numpy.testing import assert_raises, assert_allclose from megaman.embedding import (Isomap, LocallyLinearEmbedding, LTS...
{ "content_hash": "d39d545a2d6a093be10c2119218b3b5c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 77, "avg_line_length": 32.69090909090909, "alnum_prop": 0.6690767519466073, "repo_name": "jakevdp/Mmani", "id": "290d2e06e5e373964867969ef82dbe1602cd5b1b", "size": "1798", ...
import os import sys import time from rdflib import URIRef, Literal from rdflib.namespace import RDF from settings import * # functions def check_permission(input_dir, output_dir): """ checks if input is readable and output is writeable """ if not(os.access(output_dir, os.W_OK)): os.chmod(outpu...
{ "content_hash": "1e4aa2df58d5dcd8aca92d853a7c948a", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 369, "avg_line_length": 44.71383647798742, "alnum_prop": 0.5811941768056825, "repo_name": "sheshkovsky/CCeX", "id": "cc9a4c6c34991dea607ef9952ca87218f8cd55b5", "size": "14...
""" =============================================================================== Original code copyright (C) 2009-2022 Rudolf Cardinal (rudolf@pobox.com). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
{ "content_hash": "2efd593038e8c7e9c8b984e7b99197c9", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 40.76190476190476, "alnum_prop": 0.5934579439252337, "repo_name": "RudolfCardinal/pythonlib", "id": "246162835eb617aa025b983db8c317d824fe04a2", "size...
from django.contrib import admin from admin_views.admin import AdminViews from django.shortcuts import redirect from example_project.example_app.models import TestModel class TestAdmin(AdminViews): admin_views = ( ('Process This', 'process'), # Admin view ('Go to LJW', 'http:/...
{ "content_hash": "1ed7c95b2f70287e501f5b21cb43599c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 30.625, "alnum_prop": 0.6632653061224489, "repo_name": "mikeumus/django-admin-views", "id": "a86be8e537728919fff2d21a7587387ed527fecb", "size": "490"...
from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('editorial', '0040_auto_20171115_1148'), ] operations = [ migrations.CreateModel( name='ContractorInfo',...
{ "content_hash": "cc375b6505dc1ae2be594b46b20b6359", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 152, "avg_line_length": 53.5945945945946, "alnum_prop": 0.6197680282400403, "repo_name": "ProjectFacet/facet", "id": "abb14129387741a11600ea88edefdf0eaf035c4c", "size": "20...
import copy import datetime as dt import json import os.path import ddt import mock import yaml from rally.cli.commands import task from rally import consts from rally import exceptions from tests.unit import fakes from tests.unit import test @ddt.ddt class TaskCommandsTestCase(test.TestCase): def setUp(self):...
{ "content_hash": "8177e192719834a56d29b7b5377e180e", "timestamp": "", "source": "github", "line_count": 969, "max_line_length": 79, "avg_line_length": 47.84004127966976, "alnum_prop": 0.543909226222577, "repo_name": "eayunstack/rally", "id": "2e95fffc4e1cb42a0dcdc03f43b69a1db24a304d", "size": "4698...
from __future__ import print_function # for stderr import ConfigParser import cgi import cgitb import csv import datetime import glob import gzip import json import os import re import suds import suds.client import sys import time from io import BytesIO from lxml import etree as et config_file_name = "../../newspap...
{ "content_hash": "de422523d395bc63366d2d686a2c6330", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 116, "avg_line_length": 38.796407185628745, "alnum_prop": 0.6409168081494058, "repo_name": "statsbiblioteket/newspaper-fastcgi-ticket-checker", "id": "46d676086f7e5a04ee4171...
""" Module responsible for translating reference sequence data into GA4GH native objects. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hashlib import json import os import random import pysam import ga4gh.datamodel as datamodel import ga4gh....
{ "content_hash": "34aebc34c780ec2d06819a64ffee5cc7", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 79, "avg_line_length": 36.48965517241379, "alnum_prop": 0.6259056259056259, "repo_name": "srblum/server", "id": "6cc7f6c95be30aafba21bf62ae93cd57fe8ee78e", "size": "15873"...
__author__ = 'Seqian Wang' import mysql.connector import Config.DBConfig as dbConfig """ Manage the Database interaction (Initiate connection, read, write, update) """ class DbUtils: """ def __init__(self): pass @staticmethod def execute_query(query, **kwargs): con = MySQLdb.msqlDB....
{ "content_hash": "411f6bb913130b14ad7143200ee1c57f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 173, "avg_line_length": 29.26388888888889, "alnum_prop": 0.5666824869482677, "repo_name": "sulantha2006/Processing_Pipeline", "id": "383584eb076c790db800562d2308d5da3dd56f43"...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * def find_largest_input_or_output(all_args_list) -> dict: max_arg = {'Size(MB)': 0} for arg in all_args_list: if arg.get('Size(MB)') > max_arg.get('Size(MB)'): max_arg = arg return max_a...
{ "content_hash": "0cf31a1fb827d77e7b34bb7abf3ede23", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 117, "avg_line_length": 44, "alnum_prop": 0.5223024638912489, "repo_name": "VirusTotal/content", "id": "6aec7a1e1893e96be4909d0fdcc9f84cc76e362c", "size": "4708", "binar...
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Dataset', fields=[ ('id', models.AutoField...
{ "content_hash": "5ad70ed4d26ddb789443c04cc98193d9", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 114, "avg_line_length": 37.07692307692308, "alnum_prop": 0.5179806362378977, "repo_name": "nanchenchen/script-analysis", "id": "476f6528682fa8d682629597cca97d120e873dda", "...
"""Run tests in parallel.""" from __future__ import print_function import argparse import ast import collections import glob import itertools import json import logging import multiprocessing import os import os.path import pipes import platform import random import re import socket import subprocess import sys impor...
{ "content_hash": "9263963cb8a73c23663b784cb7f2c875", "timestamp": "", "source": "github", "line_count": 1845, "max_line_length": 135, "avg_line_length": 34.87208672086721, "alnum_prop": 0.5418020174388785, "repo_name": "kpayson64/grpc", "id": "4146eec42df6e10d58d134ecb5112e6bde7c79a9", "size": "649...
""" Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTfu...
{ "content_hash": "97da6675903882a33e1a587070b25d1c", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 984, "avg_line_length": 31.70219435736677, "alnum_prop": 0.6175220013843568, "repo_name": "Chaffelson/whoville", "id": "d060150f80c369c9d6f7a1abca764a09643bcb04", "size": ...
from __future__ import absolute_import, division, print_function from skbio.util import classproperty, overrides from ._nucleotide_sequence import NucleotideSequence from ._iupac_sequence import IUPACSequence class RNA(NucleotideSequence): """Store RNA sequence data and optional associated metadata. Only ch...
{ "content_hash": "59fabaf0f75952f8256a98596af101ea", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 31.5625, "alnum_prop": 0.5864214992927864, "repo_name": "Achuth17/scikit-bio", "id": "8e914233c731b8819e1022872e18443b6a0d1384", "size": "3889", "...
from __future__ import division from joint_dependency.simulation import (create_world, create_lockbox, Controller, ActionMachine) from joint_dependency.recorder import Record from joint_dependency.inference import (model_posterior, same...
{ "content_hash": "129fe976c2e32c32ef66f4c268b69c8a", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 95, "avg_line_length": 35.92962962962963, "alnum_prop": 0.5509225853004844, "repo_name": "hildensia/joint_dependency", "id": "e04ebf32b5bc5c9a97aee67944042cd2fef3f9fc", "s...
import text_stats #Text from 'http://en.wikipedia.org/wiki/Electric_charge' wiki_text = """ Electric charge is the physical property of matter that causes it to experience a force when placed in an electromagnetic field. There are two types of electric charges: positive and ...
{ "content_hash": "87afc59293ec7223637246df595bcd83", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 61.88636363636363, "alnum_prop": 0.6496511200881381, "repo_name": "convolu/string_stats", "id": "f1635f8f1eca749098ed3851b411e2fcef8fcd81", "size": "...
""" Django Feedme Digest.py Author: Derek Stegelman """ from __future__ import unicode_literals from django.template import loader, Context from django.conf import settings from django.contrib.auth.models import User from django.core.mail import EmailMultiAlternatives from .models import FeedItem def send_digest()...
{ "content_hash": "ae4877218b5c5cac65fa2a04d8fd220b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 89, "avg_line_length": 32.4054054054054, "alnum_prop": 0.6688907422852377, "repo_name": "dstegelman/django-feedme", "id": "b457dc2c1d10879ec864446b7d98592d73783ff2", "size"...
import codecs import os from setuptools import setup, find_packages from debinterface import __version__ HERE = os.path.abspath(os.path.dirname(__file__)) def read(*parts): """ Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding. """ wit...
{ "content_hash": "584b7535aca4b63f6083b55b88014029", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 30.80952380952381, "alnum_prop": 0.622359608449253, "repo_name": "nMustaki/debinterface", "id": "035db01be9d386ce2744ace665b6e2b68ea23d86", "size": "...
""" Functions for preparing various inputs passed to the DataFrame or Series constructors before passing them to a BlockManager. """ from __future__ import annotations from collections import abc from typing import ( TYPE_CHECKING, Any, Hashable, Sequence, cast, ) import warnings import numpy as n...
{ "content_hash": "fd43a40c63b3eb2f898a1bd08454f66c", "timestamp": "", "source": "github", "line_count": 1053, "max_line_length": 88, "avg_line_length": 31.440645773979107, "alnum_prop": 0.5808439302866464, "repo_name": "jorisvandenbossche/pandas", "id": "159c20382dcfb665d1b3fa29f54f1d5aff9f2bbb", "...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured gettext = lambda s: s USERENA_SIGNIN_AFTER_SIGNUP = getattr(settings, 'USERENA_SIGNIN_AFTER_SIGNUP', False) USERENA_REDIRECT_ON_SIGNOUT = getattr(setti...
{ "content_hash": "126224bd64adc9a83bc8a9faa47f86eb", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 180, "avg_line_length": 41.927536231884055, "alnum_prop": 0.5243691669547182, "repo_name": "bioinformatics-ua/django-userena", "id": "49db7f440190db0a7f465fabeb8848cd45f2dc3...
from __future__ import with_statement from os.path import exists from twisted.python import log, failure from twisted.trial import unittest from twisted.test import proto_helpers from twisted.internet import defer, error from txtorcon import TorControlProtocol, TorProtocolFactory, TorState from txtorcon import ITorC...
{ "content_hash": "e51b8d9e78c3a4a53f969d54e84814b5", "timestamp": "", "source": "github", "line_count": 892, "max_line_length": 245, "avg_line_length": 36.43834080717489, "alnum_prop": 0.6275113066486171, "repo_name": "isislovecruft/txtorcon", "id": "9a03bdee9b09096e73b219b5972da7bd78736fa2", "size...
""" Support for Tellstick switches using Tellstick Net. This platform uses the Telldus Live online service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.tellduslive/ """ import logging from homeassistant.components.tellduslive import TelldusL...
{ "content_hash": "6dcb460c0b04aa12031f2ec23997102a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 27.26829268292683, "alnum_prop": 0.6940966010733453, "repo_name": "robjohnson189/home-assistant", "id": "5f3901d79b8a873174f28cdac1dbd116f6a33e58", "...
import math import re from django.utils.html import strip_tags def count_words(html_string): word_string = strip_tags(html_string) matching_words = re.findall(r'\w+', word_string) count = len(matching_words) #joincfe.com/projects/ return count def get_read_time(html_string): count = count_word...
{ "content_hash": "8afd62c36f5cce5543cd1576845685cd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 24, "alnum_prop": 0.7083333333333334, "repo_name": "DJMedhaug/BizSprint", "id": "f590febac7c9be4d03ae4444a0e85d47970ff6bc", "size": "432", "binary"...
"""Musepack audio streams with APEv2 tags. Musepack is an audio format originally based on the MPEG-1 Layer-2 algorithms. Stream versions 4 through 7 are supported. For more information, see http://www.musepack.net/. """ __all__ = ["Musepack", "Open", "delete"] import struct from ._compat import endswith from muta...
{ "content_hash": "17523188c2003f89ca2dc2c3be6fe685", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 79, "avg_line_length": 34.0398406374502, "alnum_prop": 0.5727996254681648, "repo_name": "lcharlick/ArtistAlbumArt.bundle", "id": "da1698e5349bf1bc909ba8d02da3d79d0a683fa3", ...
""" Comparing remote and local predictions """ from .world import world, setup_module, teardown_module, show_doc from . import create_source_steps as source_create from . import create_dataset_steps as dataset_create from . import create_model_steps as model_create from . import create_ensemble_steps as ensemble_creat...
{ "content_hash": "934e836811cf95a6703de8c94ee21a89", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 198, "avg_line_length": 57.1912013536379, "alnum_prop": 0.5607396449704142, "repo_name": "mmerce/python", "id": "00b4fdba0b9006127a4bb829103426714ff16f24", "size": "34402"...
from pymocap.color_terminal import ColorTerminal from pymocap.event import Event import struct, os from datetime import datetime class NatnetFile: def __init__(self, path=None, loop=True): self.path = path self.loop = loop # file handles self.read_file = None self.write_fi...
{ "content_hash": "524be6cb4aa9cc97211370d33f74ea32", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 97, "avg_line_length": 29.643410852713178, "alnum_prop": 0.5732217573221757, "repo_name": "markkorput/PyMoCap", "id": "68f9d8a8fccf4f1ba5d43b95c1782a06f5a69b3d", "size": "...
import os from flask import Flask, url_for, jsonify, g, request from flask_login import LoginManager from flask.ext.openid import OpenID from openid.extensions import pape from passlib.context import CryptContext from .settings import WmtSettings from .core import db from .blueprints import register_blueprints from...
{ "content_hash": "ad08560e3862a627de651ac5aaf52274", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 26.814814814814813, "alnum_prop": 0.6321362799263351, "repo_name": "mcflugen/wmt-rest", "id": "56d576696c481acd8aeec8519ebb8bb8afba3dcb", "size": "21...