text
stringlengths
4
1.02M
meta
dict
from datetime import datetime from django.conf import settings from django.test import TestCase from django.http import HttpResponse, HttpRequest from mock import patch, Mock from django_geoip.storage import LocationCookieStorage, LocationDummyStorage, BaseLocationStorage from test_app.models import MyCustomLocation fr...
{ "content_hash": "c84c33c3f9cafc16a8dfd6abacb1ccff", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 114, "avg_line_length": 46.88392857142857, "alnum_prop": 0.724052561416873, "repo_name": "futurecolors/django-geoip", "id": "3ef4d66a28e6e71b53af3bdd69cb3793d82d9586", "si...
from ..Qt import QtGui, QtCore from ..python2_3 import asUnicode from ..SignalProxy import SignalProxy from .. import functions as fn from math import log from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors from decimal import * import weakref __all__ = ['SpinBox'] class SpinB...
{ "content_hash": "7d0ae1991800719521735d6c89ef966b", "timestamp": "", "source": "github", "line_count": 502, "max_line_length": 150, "avg_line_length": 39.70318725099602, "alnum_prop": 0.5147759771210677, "repo_name": "isaacyeaton/pyadisi", "id": "422522de7142b7e2338bfc6c0d7d4b7418f72c71", "size": ...
from nose.tools import eq_ import bot_mock from pyfibot.modules import module_urltitle bot = bot_mock.BotMock() def test_one(): msg = "https://en.wikipedia.org/wiki/Hatfield–McCoy_feud" module_urltitle.init(bot) eq_(("#channel", u"Title: The Hatfield–McCoy feud involved two families of the West Virginia...
{ "content_hash": "3024659f683927d400a29803be0623bc", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 297, "avg_line_length": 52.31944444444444, "alnum_prop": 0.7154234138571808, "repo_name": "huqa/pyfibot", "id": "59056766e39d70b68d314be217ed23af78e6745f", "size": "3807", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [("api", "0015_auto_20151022_1008")] operations = [ migrations.AlterField( model_name="check", name="status", field=models.CharF...
{ "content_hash": "e06a211eda98f354edee5aaeb5ca9e3c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 55, "avg_line_length": 24.52, "alnum_prop": 0.43066884176182707, "repo_name": "healthchecks/healthchecks", "id": "d0fb4fb80884edaeff09e0b13db4339a3ee1102e", "size": "637", ...
from django.contrib.comments.managers import CommentManager as DjangoCM from mezzanine.conf import settings from mezzanine.core.managers import CurrentSiteManager class CommentManager(CurrentSiteManager, DjangoCM): """ Provides filter for restricting comments that are not approved if ``COMMENTS_UNAPPROVE...
{ "content_hash": "1b9696e285dbd7bb939eaf4fb2acdb6c", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 71, "avg_line_length": 32.62068965517241, "alnum_prop": 0.6273784355179705, "repo_name": "stbarnabas/mezzanine", "id": "f6a8233bb002437c248ecf7a239e184f99e30d28", "size": "...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pants.backend.jvm.targets.java_library import JavaLibrary from pants.backend.jvm.tasks.classpath_products import ClasspathProducts from pants.backend.j...
{ "content_hash": "0d961ea9a25d5caedfbca05af11de23b", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 120, "avg_line_length": 43.13953488372093, "alnum_prop": 0.6422282120395328, "repo_name": "dbentley/pants", "id": "e42b060bda7b5da0bd23892102931d2c9a888d39", "size": "5712...
from typing import TYPE_CHECKING, Optional from pluggy import HookspecMarker if TYPE_CHECKING: from sqlalchemy.orm.session import Session from airflow.models.taskinstance import TaskInstance from airflow.utils.state import TaskInstanceState hookspec = HookspecMarker("airflow") @hookspec def on_task_in...
{ "content_hash": "843726342a8e348ebefd55a039435e10", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 100, "avg_line_length": 30.90625, "alnum_prop": 0.7512639029322548, "repo_name": "danielvdende/incubator-airflow", "id": "fbaf63e89ac6e8cc96353475012441a75e63378e", "size":...
from PLC.Nodes import Node from PLC.Interfaces import Interface from PLC.Slices import Slice from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles import sys current_module = sys.modules[__name__] #### IPv6 addr/prefix to distribute to slivers on the node! define_accessors(current_module, Interfa...
{ "content_hash": "b9a2b47083ed4663ec2dee3b8ef03432", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 94, "avg_line_length": 40.526315789473685, "alnum_prop": 0.7077922077922078, "repo_name": "dreibh/planetlab-lxc-plcapi", "id": "fb736db33d115fd5c930c60bfecd7df52045d08c", "...
""" This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import logging from functools import partial from scipy import stats from shot_detector.filters.common import MathFilter from .base_swfilter import BaseSWFilter c...
{ "content_hash": "212b70525500f7c1161556ff5ab14f40", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 72, "avg_line_length": 28.321766561514195, "alnum_prop": 0.5228335932278904, "repo_name": "w495/python-video-shot-detector", "id": "a4458c8fc956f598a5faad7011199d01b8cff17a"...
from datetime import datetime import pytest import pytz from marshmallow import ValidationError from indico.util.marshmallow import NaiveDateTime def test_NaiveDateTime_serialize(): now = datetime.now() utc_now = pytz.utc.localize(datetime.utcnow()) obj = type('Test', (), { 'naive': now, ...
{ "content_hash": "897414e74c35d2385102aa326693877b", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 59, "avg_line_length": 27.482758620689655, "alnum_prop": 0.6813048933500627, "repo_name": "ThiefMaster/indico", "id": "4598b58007c46ebe081b0b88c7fe3e9f6c8e8ca7", "size": "1...
from django.conf.urls import url # noinspection PyPackageRequirements from django.views.decorators.csrf import csrf_exempt from federation.entities.matrix.django.views import MatrixASTransactionsView urlpatterns = [ url( regex=r"transactions/(?P<txn_id>[\w-]+)$", view=csrf_exempt(MatrixASTransacti...
{ "content_hash": "1d6812fb7a0fe78db91cfc3d3d9aa0c2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 29.846153846153847, "alnum_prop": 0.7242268041237113, "repo_name": "jaywink/social-federation", "id": "15a6e7448a86d76f7a0e42a0010d621d355017fb", "si...
from setuptools import setup from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name=...
{ "content_hash": "d894d4218b59d08a834195c246483625", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 81, "avg_line_length": 31.338461538461537, "alnum_prop": 0.6161021109474718, "repo_name": "abulimov/collectd-riakcs", "id": "0fd25d23e7b7b2d55b0fac39817b8e72b66fe098", "siz...
''' New Integration Test for Request access multiple KVM VM console. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstacklib.utils.shell as shell import zstackwoodpecker.operations.account_operations as acc_ops test_stub = test...
{ "content_hash": "4fced8daead5e8178b908249c7c0701f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 134, "avg_line_length": 29.97826086956522, "alnum_prop": 0.612037708484409, "repo_name": "zstackio/zstack-woodpecker", "id": "49ea2dcac456a41ad02f558b5a196b8cc078ffda", "si...
import unittest try: import bezier except ImportError: # pragma: NO COVER bezier = None WRONG_FLAGS_TEMPLATE = """\ Arrays are not Fortran contiguous array1 flags = {} array2 flags = {} """ WRONG_TYPE_TEMPLATE = """\ Arrays have different types array1({}) = {!r} array2({}) = {!r} """ WRONG_SHAPE_TEMPLATE = ...
{ "content_hash": "c0112e1d1296a5deb27cd9076cf0de2a", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 78, "avg_line_length": 29.04, "alnum_prop": 0.6294765840220385, "repo_name": "dhermes/bezier", "id": "3a1be52f6bb656721ccaddd0a5f5e9c9f7686f7b", "size": "4902", "binary"...
import os def acc(): package = open(os.getcwd()+"/package.json", "w") package.write("{") package.write("\n") package.write(" \"name\": \""+project+"\",") package.write("\n") package.write(" \"description\": \""+description+"\",") package.write("\n") package.write(" \"author\": \""+author+"\",") packa...
{ "content_hash": "94228d43052b66f4ea963ef838fbc04f", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 59, "avg_line_length": 23.170731707317074, "alnum_prop": 0.5589473684210526, "repo_name": "iplo/Specter", "id": "66aa45ef811900bbb1c354329529bff9ef296808", "size": "950", ...
""" Copyright 2012 GroupDocs. 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": "c4f15a3c78ef7e86b6231142b6e69d8c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 30.18918918918919, "alnum_prop": 0.6410026857654432, "repo_name": "liosha2007/temporary-groupdocs-python-sdk", "id": "dad9718d9c34394978eb02b70aa41a39c...
def greeting(): return "Welcome to twiOpinion 1.1.3!" def startingInfo(): with open ("../startingInfo.txt", "r") as myfile: data=myfile.read() return data
{ "content_hash": "3058f42c8fe1ed48c695e5305d623f01", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 53, "avg_line_length": 25.142857142857142, "alnum_prop": 0.625, "repo_name": "orangeYao/twiOpinion", "id": "7ddb43f1d8b8002061aa64435c6fabc324dc6225", "size": "176", "bina...
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 = "LinearTrend", cycle_length = 7, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "ec55812d81bee770b0ae8c154e879e3c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 169, "avg_line_length": 38.42857142857143, "alnum_prop": 0.7100371747211895, "repo_name": "antoinecarme/pyaf", "id": "a61ecfa3201f7963eb0e8d78992c4a4fd85e704d", "size": "269...
""" configuration management """ import json class ConfVar(object): """ The atomic unit of a Conf object """ def __init__(self, name, description, value): self._name, self._description, self.value = name, description, value @property def name(self): return self._name @pr...
{ "content_hash": "530d5288a9ecf14dbad74ee29d617d47", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 76, "avg_line_length": 26.25263157894737, "alnum_prop": 0.5252606255012029, "repo_name": "rgs1/xcmd", "id": "12fe06dea80aeeb1ec87e94283cb1656913df01c", "size": "2494", "b...
import os import json from subprocess import check_output, DEVNULL, CalledProcessError from .constants import ffmpeg ffprobe = os.path.join(os.path.split(ffmpeg)[0], 'ffprobe') if ffmpeg.endswith('.exe'): ffprobe += '.exe' def get_iframes(filename, read_interval=None): """ Args: filename: ...
{ "content_hash": "c07553ba470e24b43f6f4a920902d9e2", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 100, "avg_line_length": 26.93069306930693, "alnum_prop": 0.5426470588235294, "repo_name": "wlerin/showroom", "id": "e2cdb9a1b25556f1bfb7a50cf35bb0f7ec5907d6", "size": "272...
from a10sdk.common.A10BaseClass import A10BaseClass class StunTimeout(A10BaseClass): """Class Description:: Set STUN timeout for endpoint-independent filtering. Class stun-timeout supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module...
{ "content_hash": "81f919645f6f083ad515f353b83c8e3d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 191, "avg_line_length": 41.5, "alnum_prop": 0.6351118760757315, "repo_name": "a10networks/a10sdk-python", "id": "847e85ede66fdaac0074b72d4c83bb1a1d88d132", "size": "1743", ...
import autograd.numpy as np """ References: https://en.wikipedia.org/wiki/Activation_function """ def sigmoid(z): return 1.0 / (1.0 + np.exp(-z)) def softmax(z): # Avoid numerical overflow by removing max e = np.exp(z - np.amax(z, axis=1, keepdims=True)) return e / np.sum(e, axis=1, keepdims=True) ...
{ "content_hash": "610f1a4b95821380dd960b787f620987", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 18.098039215686274, "alnum_prop": 0.6338028169014085, "repo_name": "rushter/MLAlgorithms", "id": "949cdf75b7465714e30198599f5830e2587cbf6b", "size": ...
from django.contrib import admin from dv_apps.datafiles.models import Datafile, FileMetadata, DatafileTag,\ DatafileCategory, FilemetadataDatafileCategory class DatafileAdmin(admin.ModelAdmin): save_on_top = True search_fields = ('label',) list_display = ('dvobject', 'filesize', 'contenttype', 'inges...
{ "content_hash": "c099dc23dcae086da04322d9a789ec39", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 88, "avg_line_length": 35.78048780487805, "alnum_prop": 0.7280163599182005, "repo_name": "IQSS/miniverse", "id": "0bfc04c0762507d360e5da9829e9eba56f055a8d", "size": "1467",...
import logging import os import pipes import subprocess from shortcut.channel import const as C platform_whitelist = ['darwin'] TYPE = 'osx' TITLE = 'OSX Dictionary' DESCRIPTION = """You can lookup word definition through OSX's builtin dictionary.""" busy = False def lookup(word, channel=None, msg=None): glob...
{ "content_hash": "cff249d5b4499cd790f301f7fd49c114", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 85, "avg_line_length": 25.823529411764707, "alnum_prop": 0.5504935459377372, "repo_name": "yjpark/shortcut", "id": "ef293571a24ce989107ae01eb95b322752dd2d68", "size": "1317...
from context import * from settings.filemgmt import fileManager from settings.paths import MSD_MXM, MSD_TID_YEAR, CHARTED_TIDS, \ MXM, UNCHARTED, sep def loadSet(fileName): setName = '' with open(fileName) as lyricsFile: # to avoid the entire file from being read into memory for line in...
{ "content_hash": "6039c254395355a360be94391819cb17", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 69, "avg_line_length": 27.3, "alnum_prop": 0.5833333333333334, "repo_name": "kug3lblitz/Heat-Replay", "id": "5172cd50826b29c4cb335bb8acd5a47c83ad870f", "size": "1092", "b...
"""The islamic_prayer_times component.""" from datetime import timedelta import logging from prayer_times_calculator import PrayerTimesCalculator, exceptions from requests.exceptions import ConnectionError as ConnError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant....
{ "content_hash": "7bfc61564518026f011aa736ca3f1949", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 102, "avg_line_length": 33.092233009708735, "alnum_prop": 0.6364969928120874, "repo_name": "robbiet480/home-assistant", "id": "90a31890d162d043ec0c6138a9f4f01637edabec", "...
import logging from quantum.db import db_base_plugin_v2 from quantum.db import models_v2 from quantum.plugins.linuxbridge.db import l2network_db as cdb LOG = logging.getLogger(__name__) class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ LinuxBridgePlugin provides support for Quantum abstrac...
{ "content_hash": "528e907760856bfd3741c3ab1b5d428a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 36.43589743589744, "alnum_prop": 0.6213933849401829, "repo_name": "savi-dev/quantum", "id": "ffb52ba7173ccb986a3bd96ac807a18b7c929fd6", "size": "2006...
import concurrent.futures._base as futbase import execnet import inspect import textwrap def _worker(channel): """Pure function for running tasks on a host.""" import traceback while not channel.isclosed(): ident, source, call_name, args, kwargs = channel.receive() co = compile(source+'\n'...
{ "content_hash": "5ad2d8529c2116cf80774beacc903960", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 29.046728971962615, "alnum_prop": 0.5514800514800515, "repo_name": "sampsyo/execnet-futures", "id": "1388b19a037a4911ab2f871f403526c41aec6449", "siz...
"""Creates a GCE instance template for Forseti Security.""" def GenerateConfig(context): """Generate configuration.""" if context.properties.get('branch-name'): DOWNLOAD_FORSETI = """ git clone {}.git --branch {} --single-branch forseti-security cd forseti-security """....
{ "content_hash": "1ba8ebe06d635f2b7fdccbe42d0abe8f", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 116, "avg_line_length": 30.128865979381445, "alnum_prop": 0.5704020530367836, "repo_name": "felixbb/forseti-security", "id": "a5bc3676cab59cb6fa6c5f87a21a134d8e2892c9", "s...
import argparse import os import urllib import xml.etree.ElementTree as ET import tarfile import tempfile import json import re from glob import glob from shutil import copyfile gt_catalog_dir = '~/.local/share/gthumb/catalogs' gt_catalog_dir = os.path.expanduser(gt_catalog_dir) def get_cat_name(cat_file): m = re...
{ "content_hash": "4a8083a87c9bb06e5c171fefe5d08124", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 121, "avg_line_length": 34.570093457943926, "alnum_prop": 0.5601513922681806, "repo_name": "janis-lindholm/glide-slideshow", "id": "c26cdd9c623aa99b0beddfaf740e4a10789ed3a8"...
from recipe_engine import recipe_api from . import android from . import default """Chromecast flavor, used for running code on Chromecast""" class ChromecastFlavor(android.AndroidFlavor): def __init__(self, m): super(ChromecastFlavor, self).__init__(m) self._ever_ran_adb = False self._user_ip = '' ...
{ "content_hash": "8ebec93f42c1f222a4bba5b746f566d6", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 82, "avg_line_length": 37.453947368421055, "alnum_prop": 0.5803618478833655, "repo_name": "youtube/cobalt_sandbox", "id": "e0bbfb12d6f19ca0cfe4f674445be11bd83f6c9b", "size...
import os import json import datetime from indra import get_config # Before the import, we have to deal with the CLASSPATH to avoid clashes # with REACH. def _set_classpath(): clp = os.environ.get('CLASSPATH') eip = get_config('EIDOSPATH') rep = get_config('REACHPATH') clp_parts = clp.split(':') if cl...
{ "content_hash": "f762136ae08bd6a9b9a8e32941afc062", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 80, "avg_line_length": 34.19565217391305, "alnum_prop": 0.6094511549057003, "repo_name": "johnbachman/belpy", "id": "3c506ab37c27a94d22453c8027232bcd3f0c1d31", "size": "47...
import collections import logging from django.conf import settings from django.forms import ValidationError from django import http from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables from horizon import exceptions from horizon import forms from horizo...
{ "content_hash": "da936bd3d91a3fc5f083dba5549ee868", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 79, "avg_line_length": 43.28706624605678, "alnum_prop": 0.5370937181168925, "repo_name": "noironetworks/horizon", "id": "84507a645f6b7a25cf438eb98895ad0846718798", "size":...
import sys import traceback import uuid from pprint import pprint, pformat from biokbase.workspace.client import Workspace as workspaceService #END_HEADER class test: ''' Module Name: test Module Description: A KBase module: test This sample module contains one small method - filter_contigs. ...
{ "content_hash": "d64b7ca390daf9504731db8f92614ac4", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 114, "avg_line_length": 44.38388625592417, "alnum_prop": 0.5614522156967432, "repo_name": "msneddon/test_contig_filter", "id": "c5ca6c1515560762f7a1fb0ef9400303a76e0a14", ...
"""Gets filesize of a first level of directories and sends it to a CouchDB instance. Not using os.path.getsize neither os.stat.st_size since they report inaccurate filesizes: http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python """ # TODO: Manage depth of root (how many dir levels): ht...
{ "content_hash": "2a0a0581719290bbb359e31a29761b74", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 140, "avg_line_length": 32.90625, "alnum_prop": 0.5728869895536562, "repo_name": "jun-wan/scilifelab", "id": "0ff0b2e402af509f8b59b03f88fc6fa0d2bdea7c", "size": "4234", ...
import requests url = "https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&bounds=34.172684%2C-118.604794%7C34.236144%2C-118.500938&key=YOUR_API_KEY" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) # [END maps_http_geocode_winnetka_...
{ "content_hash": "f067fb2039d18231dc4d52bba652b137", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 148, "avg_line_length": 27.25, "alnum_prop": 0.7584097859327217, "repo_name": "googlemaps/openapi-specification", "id": "51d36028ff372edc04ba6c27db022ba483388673", "size": ...
__version__ = "$Revision$" import sys, os, imp, re, optparse from glob import glob from platform import machine as platform_machine import sysconfig from distutils import log from distutils import text_file from distutils.errors import * from distutils.core import Extension, setup from distutils.command.build_ext imp...
{ "content_hash": "1b31782638d5912a8d9afb7f0bf7f807", "timestamp": "", "source": "github", "line_count": 2237, "max_line_length": 112, "avg_line_length": 43.625838176128745, "alnum_prop": 0.513233802297343, "repo_name": "nzavagli/UnrealPy", "id": "6a6ad239f12780125c1f76795ebb3c5cc462aaca", "size": "...
""" Data Ingestion Example [REST API] --------------------------------- An example illustrating the data ingestion in FreeDiscovery """ from __future__ import print_function import requests import pandas as pd import json import os.path pd.options.display.float_format = '{:,.3f}'.format pd.options.display.expand_fr...
{ "content_hash": "506f92602e4babdc6392730b0b96ba02", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 93, "avg_line_length": 33.373831775700936, "alnum_prop": 0.5950714085690283, "repo_name": "kcompher/FreeDiscovUI", "id": "0dc7bf0f9c66ab6bd0dfbdc68df0eb61d613050d", "size"...
from .. import conf, drivers, ircmsgs, log from twisted.names import client from twisted.internet import reactor, error from twisted.protocols.basic import LineReceiver from twisted.internet.protocol import ReconnectingClientFactory # This hack prevents the standard Twisted resolver from starting any # threads, whic...
{ "content_hash": "79a279fb1d6c1290d882b5ca99705201", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 34.51968503937008, "alnum_prop": 0.6621806569343066, "repo_name": "frumiousbandersnatch/supybot-code", "id": "3acabc07a68aded19aa773f0e43601680975d7af...
"""Convert-related functions"""
{ "content_hash": "6e64af3b5b101dd5ba882a7586cbe651", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 32, "alnum_prop": 0.71875, "repo_name": "GoogleCloudPlatform/oozie-to-airflow", "id": "bcbf00db67c4e11a172fec273cde07cb14e4673d", "size": "626", "bi...
"""Dataset generation for simulation. """ from __future__ import division, absolute_import import abc from copy import deepcopy import numpy as np from scipy.stats import pearsonr from bcn.bias import BiasLowRank, BiasUnconstrained from bcn.redundant_signal import RedundantSignal from bcn.missing import Missing d...
{ "content_hash": "b7f8eb8e3b978d88104664fc89487f27", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 268, "avg_line_length": 38.5939226519337, "alnum_prop": 0.6215732588934221, "repo_name": "a378ec99/bcn", "id": "775adb1f3b9459e05511f681ec9ed289e7c1281c", "size": "13971",...
""" ******************************************************************************** * Name: workspace.py * Author: Nathan Swain & Scott Christensen * Created On: August 5, 2015 * Copyright: (c) Brigham Young University 2015 * License: BSD 2-Clause ***********************************************************************...
{ "content_hash": "ec96dff8bddb4c6efce31e769f3b3395", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 248, "avg_line_length": 30.864372469635626, "alnum_prop": 0.592313241949236, "repo_name": "tethysplatform/tethys", "id": "446f53a68b2d4d15ffa0aba72c23a6971720af06", "size"...
import ctypes import glob import os import subprocess if os.name == 'posix': if os.path.isdir('/sys/devices/system/node'): numa_nodes = glob.glob('/sys/devices/system/node/node*') numa_nodes.sort() print(int(os.path.basename(numa_nodes[-1])[4:]) + 1) else: subprocess.run(['sysct...
{ "content_hash": "43b7aa5f0a4b54b0208516a003ffadcd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 68, "avg_line_length": 28, "alnum_prop": 0.6517857142857143, "repo_name": "john-mcnamara-intel/dpdk", "id": "1b7787787f71c86e4e817ba95ca2112c5f85074a", "size": "666", "bi...
mass_kg = int(input("What is your mass in kilograms? ")) mass_stone = mass_kg * 2.2 / 14 print("You weigh", round(mass_stone, 2), "stone.")
{ "content_hash": "4852557da6bdf2a9e9f4d1c5eda671f6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 56, "avg_line_length": 46.666666666666664, "alnum_prop": 0.65, "repo_name": "zeroonegit/python", "id": "53c38e01ab30344925a3454cf7c4373df02ccd95", "size": "435", "binary":...
import numpy from chainer.backends import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check class Sqrt(function_node.FunctionNode): @property def label(self): return 'sqrt' def check_type_forward(self, in_types): type_check.expect( ...
{ "content_hash": "134b88d2821bd47bd75d7b7b4780f478", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 23.795698924731184, "alnum_prop": 0.5779484862178039, "repo_name": "ronekko/chainer", "id": "3b3f045378fc11bba832b8f7b3544923dcf01b9a", "size": "2213...
"""This module contains functions for handling requests in relation to disk offerings. """ from ec2stack import errors from ec2stack.providers import cloudstack def get_disk_offering(disk_name): """ Get the disk offering with the specified name. @param disk_name: Name of the disk offering to get. @r...
{ "content_hash": "9ac90792adc8650d9929e303772ba296", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 26.095238095238095, "alnum_prop": 0.7025547445255474, "repo_name": "terbolous/cloudstack-ec2stack", "id": "8c2de44df0f4b53dc150abf866e0c9bb8d29509a", ...
import vtk def ReadPolyData(filename): reader = vtk.vtkXMLPolyDataReader() reader.SetFileName(filename) reader.Update() return reader.GetOutput() def WritePolyData(input,filename): writer = vtk.vtkXMLPolyDataWriter() writer.SetFileName(filename) writer.SetInputData(input) writer.Write(...
{ "content_hash": "5836f2c5e05769a1b2f4fd20b1fd6939", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 25.52777777777778, "alnum_prop": 0.7780195865070729, "repo_name": "kayarre/Tools", "id": "b91ad69fb937b7c84cdeb706cb84cfbf593af743", "size": "919", ...
import copy import inspect import logging from django import forms from django import template from django.core import urlresolvers from django.template.defaultfilters import slugify from django.utils.encoding import force_unicode from django.utils.importlib import import_module from django.utils.translation import ug...
{ "content_hash": "ee6617911c45725abcd00f2fc666b730", "timestamp": "", "source": "github", "line_count": 829, "max_line_length": 79, "avg_line_length": 37.882991556091675, "alnum_prop": 0.5856392294220666, "repo_name": "99cloud/keystone_register", "id": "8ed1334ec5bd6df93e38fd0d1b1e1d8501842f0c", "s...
import logging from ibmsecurity.utilities import tools logger = logging.getLogger(__name__) uri = "/wga/apiac/credentials" requires_modules = ["wga"] requires_version = "9.0.7" def get(isamAppliance, check_mode=False, force=False): """ Retrieve the stored ISAM credential """ return isamAppliance.in...
{ "content_hash": "f5e72f73b6d3aa1a64637c43907dd54f", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 116, "avg_line_length": 37.59701492537314, "alnum_prop": 0.5716554188169909, "repo_name": "IBM-Security/ibmsecurity", "id": "b93e53727df6173b290259b09a8510f54cad5e76", "siz...
from bluebottle.fsm.state import register, Transition, AllStates from bluebottle.funding.states import BasePaymentStateMachine, BankAccountStateMachine from bluebottle.funding_flutterwave.models import FlutterwavePayment, FlutterwaveBankAccount from django.utils.translation import gettext_lazy as _ @register(Flutter...
{ "content_hash": "f51ff8ed020ed661a39e6cadba592ac7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 92, "avg_line_length": 33.69565217391305, "alnum_prop": 0.7858064516129032, "repo_name": "onepercentclub/bluebottle", "id": "e1df954de931863aa2bd58b8b739647d08ec03cd", "siz...
__authors__ = ("Al Korgun <alkorgun@gmail.com>", "John Smith <mrdoctorwho@gmail.com>") __version__ = "2.3" __license__ = "MIT" """ Implements a single-threaded longpoll client """ import select import socket import json import httplib import threading import time import vkapi as api import utils from __main__ impor...
{ "content_hash": "a2a9e2af25f4580e3405c1c735e666ae", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 122, "avg_line_length": 27.986301369863014, "alnum_prop": 0.6714635340186001, "repo_name": "mrDoctorWho/vk4xmpp", "id": "74cfcd9b16d5385b3060abd7271018e390d8a47e", "size":...
import sincfilter import numpy as np def indexOfOutliers(a, threshold_sigma=4, normFreq=.45): """Identify indices of outlier points in a timeseries Inputs: a (1d np array) Input data. a is assumed to represent equally spaced data Optional Inputs: threshold_sigma Ho...
{ "content_hash": "88d2b356e5e32ce52b7fbeed634df87c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 29.783783783783782, "alnum_prop": 0.6497277676950998, "repo_name": "barentsen/dave", "id": "d535194480f60a2908d293a9921083f532833668", "size": "1103"...
from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.db.models import Q from django.db import connection from api.api_views import APIView # noinspection PyProtectedMember from api.fields import get_boolean_value from api.status import HTTP_201_CREATED, HTTP_200_OK from ...
{ "content_hash": "d665305a4523ebff7856306c19b65b07", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 117, "avg_line_length": 40.6875, "alnum_prop": 0.5926546571707862, "repo_name": "erigones/esdc-ce", "id": "e16bf8a26d8d4429b424c805de6f1267c8453d89", "size": "7161", "bi...
import django.db.utils from django.db import transaction from rest_framework import viewsets, status from rest_framework.pagination import LimitOffsetPagination from rest_framework.response import Response from strichliste import settings from .serializers import TransactionSerializer from .serializers import Transact...
{ "content_hash": "005d69d8c683629fddcefbce002312e2", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 113, "avg_line_length": 37.97115384615385, "alnum_prop": 0.6362370220308939, "repo_name": "Don42/strichliste-django", "id": "1cc678ca9e6090d62dff6fdf3469642c8726f024", "si...
from ConfigParser import NoSectionError import cPickle from twisted.plugin import IPlugin, getPlugins from twisted.python import log from txzmq import ZmqFactory, ZmqEndpoint, ZmqPubConnection import zope.interface import zope.interface.verify from automatron.controller.router import DEFAULT_SUB_ENDPOINT from automatro...
{ "content_hash": "ea164040b72f2bb242ba71a8445c0fa7", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 119, "avg_line_length": 37.979166666666664, "alnum_prop": 0.6708721886999451, "repo_name": "automatron/automatron", "id": "ff0dd6f1f1aa11d08454ddb24d91feff913762d3", "size"...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UniversalCalendar' db.create_table('gtfs_universalcalendar', ( ('id', self.gf('django.db.models.fields....
{ "content_hash": "de757b38d90a0f83997d49c3e750e81a", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 166, "avg_line_length": 73.98461538461538, "alnum_prop": 0.53954391072295, "repo_name": "rcoup/traveldash", "id": "3abd2545fddd4460667dcd824d12fc7bc65ce97a", "size": "1444...
""" defines class :class:`mdecl_wrapper_t` that allows to work on set of declarations, as it was one declaration. The :class:`class <mdecl_wrapper_t>` allows user to not write "for" loops within the code. """ import os class call_redirector_t(object): """Internal class used to call some function of objects""" ...
{ "content_hash": "820bf2488f0a025a22766e88df6f8335", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 28.412844036697248, "alnum_prop": 0.5970293832741362, "repo_name": "CIBC-Internal/itk", "id": "abb096645aa3c5ba67f5bd0e8547af213b9f9714", "size": "3...
"""Support for LaMetric time services.""" from __future__ import annotations from collections.abc import Sequence from demetriek import ( AlarmSound, Chart, LaMetricError, Model, Notification, NotificationIconType, NotificationPriority, NotificationSound, Simple, Sound, ) impor...
{ "content_hash": "3e549d4ae88ff89e17c4690284ee7908", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 84, "avg_line_length": 27.83823529411765, "alnum_prop": 0.6378763866877971, "repo_name": "w1ll1am23/home-assistant", "id": "2cbdfff6fd8fe882e69a1fe45b098078db88965d", "siz...
import random print(random.randint(0,9))
{ "content_hash": "d8a034365d0f6c873101b6a17db895c0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 26, "avg_line_length": 14, "alnum_prop": 0.7619047619047619, "repo_name": "HarendraSingh22/Python-Guide-for-Beginners", "id": "4dfeb5c8335a224d7fb7e4a978c2fbeb5a4c743a", "si...
import time from flask import request from flask_restful import abort from funcy import project from peewee import IntegrityError import urllib2 import json from redash import models from redash.permissions import require_permission, require_admin_or_owner, is_admin_or_owner, \ require_permission_or_owner, require...
{ "content_hash": "fdfc7b5ea1f5275fb7c30a564c88e216", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 108, "avg_line_length": 32.9375, "alnum_prop": 0.6015180265654649, "repo_name": "guaguadev/redash", "id": "1df3d6ac0d56c8995a4c063469c4e1433c03ccf2", "size": "4743", "bi...
import collections import ConfigParser import io class Error(Exception): pass class InvalidConfigError(Error): """Indicates an error parsing a GreenPiThumb wiring config.""" pass class IllegalGpioPinNumberError(Error): """Indicates an attempt to parse a GPIO pin with an invalid value.""" class I...
{ "content_hash": "77be6968cc37019dc3d617523c362ffa", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 79, "avg_line_length": 32.801886792452834, "alnum_prop": 0.6371872303710094, "repo_name": "mtlynch/GreenPiThumb", "id": "ead257d3839283d7d71dcabd364723ada94aab9b", "size":...
import json from django.core.serializers.python import Deserializer as PythonDeserializer from django.core.serializers.json import Serializer as JSONSerializer from django.core.serializers.python import _get_model from django.utils import six from djmoney.models.fields import MoneyField from djmoney.utils import get_...
{ "content_hash": "49b69a56a0355911832eb184f7bad9cf", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 117, "avg_line_length": 38.24390243902439, "alnum_prop": 0.6352040816326531, "repo_name": "tsouvarev/django-money", "id": "9b905dc6cbfb3f0b8732cef4f38ffd7affcb12eb", "size"...
"""Utilities for handling nodes.""" import itertools as itt import logging from itertools import chain from typing import Set, Tuple, Type, Union from networkx import relabel_nodes from ..constants import ANNOTATIONS, CITATION, EVIDENCE, INCREASES, RELATION from ..dsl import BaseAbundance, BaseEntity, ListAbundance,...
{ "content_hash": "1c42f4b0d9b41a210b7d5f361bbe622f", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 115, "avg_line_length": 36.034749034749034, "alnum_prop": 0.5549126754526947, "repo_name": "pybel/pybel", "id": "58cde2ae6c481749f9af2bff0b055b0e49392fa4", "size": "9358",...
import collections.abc from html.parser import HTMLParser from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI from collections import OrderedDict from queue import Queue from kovot import Message, Response, Speaker from logging import Logger from typing import Iterator, List, Tuple __all__ = ['M...
{ "content_hash": "401ec493501930078dc1fbc8c8bc168b", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 109, "avg_line_length": 34.06622516556291, "alnum_prop": 0.5880637636080871, "repo_name": "kenkov/kovot", "id": "da5b9bdfca9b1e5f87ef0efdec8877a0e11563e8", "size": "5191",...
from random import random import requests import ray from ray import serve ray.init(num_cpus=8) serve.start() # Our pipeline will be structured as follows: # - Input comes in, the composed model sends it to model_one # - model_one outputs a random number between 0 and 1, if the value is # greater than 0.5, then the...
{ "content_hash": "c58bf9ff20a379e3b3a48fc6857de2d6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 73, "avg_line_length": 27.691176470588236, "alnum_prop": 0.6675517790759427, "repo_name": "pcmoritz/ray-1", "id": "0e4a15b459f2a37a5e1733a33aefc4899c1445b1", "size": "1883"...
import collections import time import threading from ._exceptions import ProtonException, ConnectionException, LinkException, Timeout from ._delivery import Delivery from ._endpoints import Endpoint, Link from ._events import Handler from ._url import Url from ._reactor import Container from ._handlers import Messagi...
{ "content_hash": "227b8e14bb11ca1300fd89215a4e90f6", "timestamp": "", "source": "github", "line_count": 614, "max_line_length": 121, "avg_line_length": 38.60749185667753, "alnum_prop": 0.6076355199325036, "repo_name": "ChugR/qpid-proton", "id": "f14db9f109a37dbd8225c335ee798b5b29cbbbc6", "size": "2...
from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class DatabaseAccountsOperations(object): """DatabaseAccountsOperations operations. :param client: Client for servi...
{ "content_hash": "526eebf03fee478bfc8e5b37d156a0ba", "timestamp": "", "source": "github", "line_count": 907, "max_line_length": 168, "avg_line_length": 46.99779492833517, "alnum_prop": 0.6451075609355573, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "2bb39b1f6839c8dfc8fbd165cd4df7840f018d2c"...
import re from pathlib import Path import nox @nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) def update_python_dependencies(session): session.install("pip-tools") session.run( "pip-compile", "--generate-hashes", "requirements.in", "--allow-unsafe", "...
{ "content_hash": "ff3d9aae8c04e5b746af0543dd1031b9", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 76, "avg_line_length": 28.647058823529413, "alnum_prop": 0.5687885010266941, "repo_name": "pypa/manylinux", "id": "1f7f165ec4f909863f5cf00e25c4b3df9e52efa2", "size": "1461"...
from statistics import mean from .items import RESONATOR_ENERGY class Portal(object): def __init__(self): self.resonators = [None] * 8 self.mods = [None] * 4 self._installed_multi_hacks = [] self._installed_heat_sinks = [] self._installed_link_amps = [] @property ...
{ "content_hash": "abb0f3be52c1a1179d2699738545aa10", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 82, "avg_line_length": 29.210526315789473, "alnum_prop": 0.5364864864864864, "repo_name": "kk6/ingress-portal-calculator", "id": "3b8df57e776334c25dc16b01635209dbba28fc09", ...
"""The multinic extension.""" import webob from webob import exc from nova.api.openstack import common from nova.api.openstack.compute.schemas.v3 import multinic from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api import validation from nova import compute from nova import exce...
{ "content_hash": "2b94240249b3b009abf428f81c49f400", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 33.77215189873418, "alnum_prop": 0.6619190404797601, "repo_name": "srajag/nova", "id": "b3218624567cb47f13ac7bc91efa537a26406154", "size": "3304", ...
import 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 'ViewQuestions.display_order' db.add_column('website_viewquestions', 'display_order', self.gf('...
{ "content_hash": "5f3bf59cd0e5f14562d0cd14cde0bdd9", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 200, "avg_line_length": 93.37562604340567, "alnum_prop": 0.5472180504898806, "repo_name": "solarpermit/solarpermit", "id": "259f003aa593c75c6f879b88d7959fd48b355dda", "siz...
import datetime import requests from django.test import TestCase from wikidata import wikidata from person.models import Person from person.util import parse_name_surname_initials, parse_surname_comma_surname_prefix class TestFindName(TestCase): @classmethod def setUpTestData(cls): cls.p1 = Person...
{ "content_hash": "7974a7817af765c441c6df9d9bc3cc57", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 121, "avg_line_length": 44.13899613899614, "alnum_prop": 0.6544786564030791, "repo_name": "openkamer/openkamer", "id": "154ad90a03c36b1254d6209b43d70202841798f5", "size": ...
from django.contrib import admin from oscar.apps.promotions.models import Image, MultiImage, RawHTML, HandPickedProductList, OrderedProduct, AutomaticProductList, TabbedBlock, \ PagePromotion, KeywordPromotion, SingleProduct class OrderProductInline(admin.TabularInline): model =...
{ "content_hash": "bb020ec841f0cc0207699ee28f886b9d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 144, "avg_line_length": 37.578947368421055, "alnum_prop": 0.7514005602240896, "repo_name": "saadbinakhlaq/django-oscar", "id": "a1f5674be9d95b29d5a15a26de3b93326d21c33e", "...
import sys import os if __name__ == "__main__": here = sys.path[0] sys.path.insert(0, os.path.join(here, '..', '..','libs')) sys.path.insert(0, os.path.join(here, '..', '..','external_libs')) #============================ define ========================================== #============================ impo...
{ "content_hash": "be466888dc995bb2f0bbc16071542dca", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 132, "avg_line_length": 45.192546583850934, "alnum_prop": 0.5260216236027121, "repo_name": "realms-team/solmanager", "id": "6b781a36d9d6d2cf3ff51cfaad177f43b1527484", "siz...
""" Mail (SMTP) notification service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.smtp/ """ import logging import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage...
{ "content_hash": "d8b55e4533c135147189bb9fe5d9ac5c", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 78, "avg_line_length": 32.617801047120416, "alnum_prop": 0.6178170144462279, "repo_name": "xifle/home-assistant", "id": "6ef9bc3299000bb6fa099759dea69edd06464741", "size":...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'FacebookAccessToken', fields ['app', 'account'] db.delete_unique('facebook_facebookaccessto...
{ "content_hash": "dbd7da216cc494b15fae77441ff7cf7d", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 162, "avg_line_length": 45.17741935483871, "alnum_prop": 0.6383434487682971, "repo_name": "uroslates/django-allauth", "id": "0032293446f5ce8f5c8af3c7193bad94ac6a5351", "siz...
import logging import sys import error as sb_err from twisted.internet import defer, reactor from twisted.internet.defer import inlineCallbacks from task import * from torrent import * from webclient import * from worker import * from log ...
{ "content_hash": "b0039268bf103adbf29dd2b181e8dbe1", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 135, "avg_line_length": 40.22704081632653, "alnum_prop": 0.5921111040649375, "repo_name": "srluge/DelugeSickbeardPlugin", "id": "edea38170d7449f38d6866f6d9e04e78a4a842f8", ...
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "PunisherCoin-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.replace...
{ "content_hash": "8616daa64c4e516f3b86a16450e119c6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 27.416666666666668, "alnum_prop": 0.7112462006079028, "repo_name": "P666Coin/P666", "id": "85cddb263f3c939ca4a074aca61a8907d177aaa7", "size": "905", ...
import requests import base64 import time import json URL = "http://localhost:8080" num_users = 3 #URL = "http://daranalysis-200000.appspot.com" #num_users = 10 def create_users(): url = URL + "/api/v1/submitted_user" usrPass = "superuser:password" b64Val = base64.b64encode(usrPass) userIds = [] ...
{ "content_hash": "fa01c184bee9fd04c8fdbc0112fe213a", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 27.76595744680851, "alnum_prop": 0.5547892720306513, "repo_name": "paddyvishnubhatt/cryptocurrency", "id": "1779fc96d563cb50044bc2f2f7ddb481744fdf3f", ...
""" Yet Another Django Profiler management command tests """ from __future__ import unicode_literals import platform import re import os import sys from tempfile import NamedTemporaryFile from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings ...
{ "content_hash": "668cc5734b96a7fe99ae2713e2b02c7d", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 111, "avg_line_length": 42.12230215827338, "alnum_prop": 0.6618274978650726, "repo_name": "AlexandreProenca/yet-another-django-profiler", "id": "a8d4b9c839cf2ff0616b7b7450ad...
class GameEvent: GAME_EVENT_DEFAULT = 1 MOVE_UP = 2 MOVE_DOWN = 3 MOVE_LEFT = 4 MOVE_RIGHT = 5 def __init__(self, eventType): self.eventType = eventType def setEventData(self, data): self.eventData = data
{ "content_hash": "3efdf83093dc68f9f7533a8cde441941", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 34, "avg_line_length": 19.307692307692307, "alnum_prop": 0.5896414342629482, "repo_name": "eott/procgen", "id": "f4e50ea767d0a0beba02789730137579cbdc1863", "size": "251", ...
""" IPIF (IP IC) interface is simple bus interface used as a service bus in FPGA designs * https://www.xilinx.com/support/documentation/ip_documentation/axi_lite_ipif/v3_0/pg155-axi-lite-ipif.pdf """
{ "content_hash": "322e2ca80a23756f998527e1c858a95b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 106, "avg_line_length": 40, "alnum_prop": 0.76, "repo_name": "Nic30/hwtLib", "id": "217e5d3a4f396b4f2badbe0083f8f41a2a384738", "size": "200", "binary": false, "copies": ...
""" WSGI config for tnp project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS...
{ "content_hash": "88603dd92d844b99553bb19211b3a98c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24, "alnum_prop": 0.765625, "repo_name": "aakashrana1995/svnit-tnp", "id": "758906899c6cde02e2c960379acc6cf699ae8500", "size": "384", "binary": fal...
from ._formats import (Bowtie2IndexFileFormat, Bowtie2IndexDirFmt) from ._types import Bowtie2Index __all__ = ['Bowtie2IndexFileFormat', 'Bowtie2IndexDirFmt', 'Bowtie2Index']
{ "content_hash": "ec936a9a26426de8b4cd5c315f4da6ad", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 74, "avg_line_length": 35.4, "alnum_prop": 0.7853107344632768, "repo_name": "qiime2/q2-types", "id": "ffdff72f961946ca59f24019ea0ef357d948ff25", "size": "527", "binary": f...
from ..models import Experiment, Component from toposort import toposort_flatten from ..ml_models import Classifier from rest_framework import viewsets from django.http import HttpResponse from collections import Counter # TODO: [refactor] this import statement should specify needed file instead of '*' from pandas impo...
{ "content_hash": "664fa35372402f24da6318671376a2db", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 110, "avg_line_length": 50.877245508982035, "alnum_prop": 0.47719649267345376, "repo_name": "CiscoSystems/cognitive", "id": "dbda4f2a5619248667e2255aa86161414772ff12", "si...
def grade(arg, key): if "backwards_text_rox" in key: return True, "!seod ti seY" else: return False, "Incorrect" def get_hints(): return [("10", "Need a mirror??"), ("10", "String Reversal")]
{ "content_hash": "a040a9c461ef77844d9c3efc46ad4eaa", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 64, "avg_line_length": 27.5, "alnum_prop": 0.5727272727272728, "repo_name": "mcpa-stlouis/mcpa-ctf", "id": "b3f6d64f49e937588eebd3abdc487c0a94420883", "size": "220", "bina...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('historias', '0006_auto_20150413_0001'), ] operations = [ migrations.CreateModel( name='Evoluciones', fields=[ ...
{ "content_hash": "adb7b91ec6eb46b9d22efeeb092f88e8", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 114, "avg_line_length": 31.178571428571427, "alnum_prop": 0.5372279495990836, "repo_name": "btenaglia/hpc-historias-clinicas", "id": "ae8f13fb8b9aa33193047179afe35986cb2b50fd...
"""High level ssh library. Usage examples: Execute command and get output: ssh = sshclient.SSH("root", "example.com", port=33) status, stdout, stderr = ssh.execute("ps ax") if status: raise Exception("Command failed with non-zero status.") print stdout.splitlines() Execute command with huge ...
{ "content_hash": "672ac5c112ebec45ed667b773c182c2d", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 79, "avg_line_length": 34.92170818505338, "alnum_prop": 0.5403036787934373, "repo_name": "HybridF5/hybrid-jacket", "id": "b430e7d0d67fc0d6458ff3e9143551b600c19ac7", "size"...
from core.domain import collection_services from core.domain import exp_services from core.domain import rating_services from core.domain import rights_manager from core.domain import search_services from core.domain import user_services from core.platform import models from core.tests import test_utils gae_search_ser...
{ "content_hash": "4c8242a7bbc23199bbc4bab5b1debc4c", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 78, "avg_line_length": 39.56115107913669, "alnum_prop": 0.6222040370976542, "repo_name": "himanshu-dixit/oppia", "id": "34c5f88da09a8f3a19e6a701200a8d0d5a530359", "size": ...
""" This is MIDAS' lightweight ORM """ import sqlite3 from helpers.utilities import to_ascii class TyORM(): """ This is Tripyarn's lightweight ORM class """ def __init__(self, filename): self.conn = sqlite3.connect(filename) self.cursor = self.conn.cursor() def __del__(self): ...
{ "content_hash": "accdeda9ede50219e4ffcffdb6a96c79", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 79, "avg_line_length": 32.8929889298893, "alnum_prop": 0.4544536683868073, "repo_name": "jaimeblasco/MIDAS", "id": "f313adf915594537117a3abbbd8d339e39827922", "size": "893...
from .base import (NullBrowser, # noqa: F401 certificate_domain_list, get_timeout_multiplier, # noqa: F401 maybe_add_args) from .webkit import WebKitBrowser # noqa: F401 from ..executors import executor_kwargs as base_executor_kwargs from ..executors.base impo...
{ "content_hash": "3f80d5f83301d6a6685dcc5d20df0d90", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 106, "avg_line_length": 39.821917808219176, "alnum_prop": 0.585827313381493, "repo_name": "chromium/chromium", "id": "912173a52e46ee141452cc98d1557c1c87a9adb4", "size": "29...
""" Copyright 2017 Peter Urda 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, software dis...
{ "content_hash": "7e8e6fab3e7767351e002e2b65bec875", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 28.25, "alnum_prop": 0.7669616519174042, "repo_name": "urda/mr.butler", "id": "b7cfc03aa2261be8e6928eba4b1d1cf3c1c2961a", "size": "678", "binary": ...
import testtools from quantumclient.common import exceptions from quantumclient.quantum import v2_0 as quantumV20 class CLITestArgs(testtools.TestCase): def test_empty(self): _mydict = quantumV20.parse_args_to_dict([]) self.assertEqual({}, _mydict) def test_default_bool(self): _spec...
{ "content_hash": "7693b12b32d77cceac8cca61921f5b72", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 78, "avg_line_length": 39.548780487804876, "alnum_prop": 0.5670675300647549, "repo_name": "wallnerryan/quantum_migrate", "id": "fcfff9331442dfb36e7a3e9e68abcf00cb28f3b1", "...
"""\ ============================= Wrapper for pygame components ============================= A wrapper for two dimensional pygame components that allows to display them on a Plane in 3D using OpenGL. This component is a subclass of OpenGLComponent and therefore uses the OpenGL display service. Example Usage ------...
{ "content_hash": "14f3dc03c711bbf41dd1843aa7efc3ca", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 117, "avg_line_length": 38.33797909407666, "alnum_prop": 0.606561846769063, "repo_name": "bbc/kamaelia", "id": "1976a9eaa27f3409ecc91da1cde0a59feebc5572", "size": "11909",...
""" Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. For example: addWord("bad") addWord("dad") addWord("mad") se...
{ "content_hash": "76d2c37f1e1d5e5f449909a09cd2fd5d", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 146, "avg_line_length": 22.15, "alnum_prop": 0.6772009029345373, "repo_name": "Ahmed--Mohsen/leetcode", "id": "ba21ae5058d1fbf1de28cc7a1e9762b7beeb3b86", "size": "2215", ...
from __future__ import absolute_import import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings') from django.conf import settings # noqa app = Celery('tests') # Using a string here means the worker will...
{ "content_hash": "a3d2fde94b14d72f196e1447d2c78380", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 25.863636363636363, "alnum_prop": 0.7557117750439367, "repo_name": "jlmadurga/permabots", "id": "248f7c127e9821f4266384cda84caf066275845d", "size": "...
""" Module for diffent connections. :author: Stefan Lehmann :email: stefan.st.lehmann@gmail.com """ import blinker import logging import threading from serial import Serial import socket logger = logging.getLogger(__name__) class Connection: pass class SerialConnection(Connection): def __init__(self, *a...
{ "content_hash": "44726533f2dc904cedb1b2598000f77f", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 71, "avg_line_length": 23.67479674796748, "alnum_prop": 0.5944368131868132, "repo_name": "MrLeeh/jsonwatch", "id": "bf875ae13090bc7ea5158ccb48c0369b5a4ab31f", "size": "293...
from __future__ import with_statement from p2ptracker import bencode import hashlib import binascii import urllib import logging import os import redis import socket import shutil from mocker import Mocker __author__ = 'ramon' log = logging.getLogger("hyves.%s" % __name__) def write_redis_config(port=6379, host='127...
{ "content_hash": "caa8e7c61adfe7fdd76956e279846ad2", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 104, "avg_line_length": 32.10344827586207, "alnum_prop": 0.6210168277837451, "repo_name": "TMG-nl/p2ptracker", "id": "b7b7a65f37e80d35fe91fe7adc1748349f61ba41", "size": "5...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView # Comment the next two lines to disable the admin: from django.contrib import admin admin.autodiscover()...
{ "content_hash": "3facf41e4645c65a062f332bd9e3447d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 91, "avg_line_length": 34.73076923076923, "alnum_prop": 0.7187153931339978, "repo_name": "aadu/theses", "id": "dfb54fe5bc7a49b077c67e5545192235b262025c", "size": "927", "...
"""Set up the environment for doctests This file is automatically evaluated by py.test. It ensures that we can write doctests without importing anything. The entire content for qnet, as well as numpy and sympy will be available in all doctests. """ import numpy import sympy import qnet from collections import OrderedD...
{ "content_hash": "fdd6fb86ea3e2ae3c2afbb659a908d46", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 28.2, "alnum_prop": 0.7602836879432624, "repo_name": "mabuchilab/QNET", "id": "23c3944e1512d1754a3bcb4647847e86d1dc2d10", "size": "705", "binary": ...