text
stringlengths
4
1.02M
meta
dict
"""This module contains the MessageSet class, which is a special kind of protocol message which can contain other protocol messages without knowing their types. See the class's doc string for more information.""" from google.net.proto import ProtocolBuffer import logging try: from google3.net.proto import...
{ "content_hash": "a719c97725704ffcf6225b29294aca58", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 78, "avg_line_length": 19.77979797979798, "alnum_prop": 0.6479419875395772, "repo_name": "gauribhoite/personfinder", "id": "9a9bfd56a47efde2a00a5db7e81bbe108a34fc23", "siz...
from llvm.core import * from llvm.passes import * from llvm.ee import * # A helper class. class strstream(object): def __init__(self, s): self.s = s def read(self): return self.s # Create a module. asm = """ define i32 @test() nounwind { ret i32 42 } define i32 @test1() nounwind { entry...
{ "content_hash": "8850b7557d63b9133a1ca5dc4ac24a15", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 71, "avg_line_length": 19.52, "alnum_prop": 0.6598360655737705, "repo_name": "mmcminn/llvm-py", "id": "43f54948f7e0196cd9fe4abbb77526b77fc8bfe1", "size": "1487", "binary"...
from cities_light.models import City, Country, Region from django import shortcuts from django.contrib.auth.models import Group, User from django.db.models import Q def navigation_autocomplete(request, template_name='navigation_autocomplete/autocomplete.html'): q = request.GET.get('q', '') context = {'q'...
{ "content_hash": "b23d488bfe9545f1d977f66d67418b1f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 34.629629629629626, "alnum_prop": 0.679144385026738, "repo_name": "dsanders11/django-autocomplete-light", "id": "993fa8d0416de312685a7cbe2a5524bde94925...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ldap3_sync', '0002_auto_20170214_1935'), ] operations = [ migrations.RenameField( model_name='ldapconnection', old_name='sas...
{ "content_hash": "3b12b755a1663ac54fab2ef7e4e6263a", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 371, "avg_line_length": 48.93055555555556, "alnum_prop": 0.5926766959977292, "repo_name": "PGower/django-ldap3-sync", "id": "54cd71b20c2687addd0ea191366f8a8c5840ca36", "siz...
import itertools import re import json import sys import yaml from thirdparty import networkx from google.appengine.ext import ndb ARTIFACT_STORE_KEY = ndb.Key("ArtifactStore", "default") INTERPOLATED_REGEX = re.compile(r"%%([^%]+?)%%") class Artifact(ndb.Model): filename = ndb.StringProperty() content = ndb....
{ "content_hash": "a4e00316f9056db96f0d1f8c879fb77b", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 80, "avg_line_length": 34.467948717948715, "alnum_prop": 0.6360424028268551, "repo_name": "destijl/forensicartifacts", "id": "58cee9b6c39ef67aedb657df7b220328873f4bfc", "s...
""" Single site config. Set site id, domain name, default emails and allowed hosts. """ from __future__ import absolute_import, division, print_function, unicode_literals from configurations import values class SingleSite(object): #: https://docs.djangoproject.com/en/dev/ref/settings/#site-id SITE_ID = va...
{ "content_hash": "22b5604a3d4c624993493403d510316a", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 93, "avg_line_length": 30.098360655737704, "alnum_prop": 0.6034858387799564, "repo_name": "nigma/django-common-configs", "id": "17e7daf410d27a278715d925728bb68fd7f4e0a0", "...
import cherrypy import contextlib import pytest import unittest.mock from girder import config from girder.api import access from pytest_girder.assertions import assertStatus @contextlib.contextmanager def serverMode(mode): old, config.getConfig()['server']['mode'] = config.getConfig()['server']['mode'], mode ...
{ "content_hash": "afd70b20fdd8e1a89dd391227973de2b", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 96, "avg_line_length": 33.26984126984127, "alnum_prop": 0.691793893129771, "repo_name": "manthey/girder", "id": "86753ebe45b0a2120db4d1d34b7b5ea742d2484a", "size": "2096", ...
from octopus.core.framework import WSAppFramework from octopus.worker import settings from octopus.worker.worker import Worker from octopus.worker.workerwebservice import WorkerWebService def make_worker(): '''Returns an instance of the worker application.''' return WSAppFramework(Worker, WorkerWebService, se...
{ "content_hash": "b53fcc478fb3ebcd55315e43f32b6554", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 66, "avg_line_length": 37, "alnum_prop": 0.8138138138138138, "repo_name": "mikrosimage/OpenRenderManagement", "id": "124799096f784aaa3bf9fc93b22cb697072995e9", "size": "333"...
import pytest from kriegspiel.models import User @pytest.fixture def user(db): user = User.objects.create( email='test@test.com', username='test', # password hash for 'test' password='pbkdf2_sha256$30000$hrV5EM0C6B5O$KAfbHEJbiiuaYyZUZmWQSf3t5KA5/rg9B48cickmrxk=', ) return u...
{ "content_hash": "65f0aff278400ddb26d3c85a5ecd563a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 97, "avg_line_length": 24.923076923076923, "alnum_prop": 0.6820987654320988, "repo_name": "Kriegspiel/ks-python-api", "id": "b4f3e26585f45bda547d8d37d4ae595ef60eb28c", "siz...
import os # import ycm_core # return the filename in the path without extension def findFileName(path, ext): name = '' for projFile in os.listdir(path): # cocoapods will generate _Pods.xcodeproj as well if projFile.endswith(ext) and not projFile.startswith('_Pods'): name= projFile[:-len(ext):] retu...
{ "content_hash": "677c9b2f4bcca1a6e9e914af35baa87b", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 186, "avg_line_length": 38.117302052785924, "alnum_prop": 0.7078012001846438, "repo_name": "haifengkao/RACProgressSubject", "id": "27a4ac760fdef69ae2c08ea2e588b17c22fbc015",...
""" mothership.serverinfo Collects and displays information about servers """ # import some modules import sys import mothership import mothership.kv from mothership.mothership_models import * from sqlalchemy import or_, desc, MetaData class ServerInfoError(Exception): pass def get_host(cfg, hw_tag=Non...
{ "content_hash": "548d8803941dffa39c6625abf6ce8d4d", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 116, "avg_line_length": 33.388625592417064, "alnum_prop": 0.5866572036905607, "repo_name": "robinbowes/mothership", "id": "ca13ddea210e7a46e6e72f56d4d6789405ff37b8", "size...
import argparse import atexit import configparser import getpass import hashlib import logging import logging.handlers import math import multiprocessing import os import requests import re import sys from collections import defaultdict try: from json.decoder import JSONDecodeError except ImportError: class JSO...
{ "content_hash": "9a20302b172422121326dab75f7165a0", "timestamp": "", "source": "github", "line_count": 690, "max_line_length": 93, "avg_line_length": 36.32753623188406, "alnum_prop": 0.5755206255485519, "repo_name": "unt-libraries/py-wasapi-client", "id": "238e78cc93a96188e3761096bf15868efb9f0135", ...
""" @brief test log(time=1000s) """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import get_temp_folder, ExtTestCase from code_beatrix.art.video import video_save, video_modification, video_replace_audio, video_extract_audio from code_beatrix.art.video import video_c...
{ "content_hash": "0c89805dcc27e3ef5003bcb77d5f5482", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 107, "avg_line_length": 36.1764705882353, "alnum_prop": 0.6447154471544716, "repo_name": "sdpython/code_beatrix", "id": "4eb0f36561a3e5aee52d90a259612c188d45e78d", "size": ...
print('"Осел готов сносить все тяготы и огорчения. А упрямым его величает всяк, кому самому недостает выдержки и терпения."') print("Леонардо Да Винчи") input("Нажмите Enter для выхода.")
{ "content_hash": "4700e70d313b70f5645989a3c9681ca1", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 126, "avg_line_length": 47.25, "alnum_prop": 0.7671957671957672, "repo_name": "Mariaanisimova/pythonintask", "id": "96e4dcd0ff5796273619b892e836f5cc953302ab", "size": "316",...
import argparse import os import shutil import subprocess import sys from lib.config import enable_verbose_mode from lib.util import electron_gyp, execute_stdout, rm_rf if sys.platform == 'linux2': # On Linux we use python-dbusmock to create a fake system bus and test # powerMonitor interaction with org.free...
{ "content_hash": "366f7ec0ab8f4675545268b406304caf", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 79, "avg_line_length": 36.41428571428571, "alnum_prop": 0.607885445272656, "repo_name": "Floato/electron", "id": "67292997348b8e066e39f154cbbe053315c97e27", "size": "5121"...
import traceback from flask import url_for from dashboards import Dashboard import itertools import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Output, Input, State from dash.exceptions import PreventUpdate from dashboards.das...
{ "content_hash": "549d8ebab35bd4b8b7c006afa9682058", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 127, "avg_line_length": 49.727586206896554, "alnum_prop": 0.5307537618750433, "repo_name": "BiRG/Omics-Dashboard", "id": "128a3419e02d1102c35cde092510a22f796bf575", "size"...
import subprocess from ..installers import PackageManagerInstaller from .source import SOURCE_INSTALLER ARCH_OS_NAME = 'arch' PACMAN_INSTALLER = 'pacman' def register_installers(context): context.set_installer(PACMAN_INSTALLER, PacmanInstaller()) def register_platforms(context): context.add_os_installer_key...
{ "content_hash": "850526d715a04db785fffbd7aab8f335", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 99, "avg_line_length": 32.357142857142854, "alnum_prop": 0.6880058866813834, "repo_name": "spaghetti-/rosdep", "id": "8c1f6763ba3cf9b01cd6dd2d8d0eff1344b9358e", "size": "30...
"""A middleware that turns exceptions into parsable string. Inspired by Cinder's faultwrapper. """ import sys import traceback from oslo_config import cfg from oslo_utils import reflection import six import webob from heat.common import exception from heat.common import serializers from heat.common import wsgi cl...
{ "content_hash": "30dfb15fcb7bc473d03985a837b5a81a", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 75, "avg_line_length": 37.5, "alnum_prop": 0.6445045045045045, "repo_name": "cwolferh/heat-scratch", "id": "8fa839f0d793cc88de7b440553557a34dea8ab47", "size": "6161", "b...
import os import cPickle # Change this to the directory where the code is stored os.chdir('D://Stephen/Documents/Code/wormtracker-matlab/python') import wormtracker as wt import wormtracker.parallel as wtp import multiprocessing """ This script runs a performance test for the serial analysis on a single region of a vi...
{ "content_hash": "39f35db264f8ad3d949fb625afc79a84", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 74, "avg_line_length": 29.015873015873016, "alnum_prop": 0.7407002188183808, "repo_name": "stephenhelms/WormTracker", "id": "6116e3d68c90facc4fb91eb059cd0dc3a99bf45b", "siz...
import json def flat_to_tree_dict_helper(dictionary, split_symbol='.'): """ Gets a flat dictionary in the following format: {"name.first_name": 'Martin', "name.last_name": "Rusev"} and converts it to: {"name": {"first_name": "Martin", "last_name": "Rusev" }} It converts deeper ...
{ "content_hash": "c9374194ce79ff00453cdb2de40544b5", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 74, "avg_line_length": 26.213333333333335, "alnum_prop": 0.5213631739572736, "repo_name": "martinrusev/amonone", "id": "1cfe5e59b84d2c98d74f5e2a0e11325578e3b135", "size": "...
import os import Tkinter def _load_tkdnd(master): tkdndlib = os.environ.get('TKDND_LIBRARY') if tkdndlib: master.tk.eval('global auto_path; lappend auto_path {%s}' % tkdndlib) master.tk.eval('package require tkdnd') master._tkdnd_loaded = True class TkDND(object): def __init...
{ "content_hash": "4dd741ad51ff39fae9901dff90708cc2", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 120, "avg_line_length": 42.69832402234637, "alnum_prop": 0.5889048802826116, "repo_name": "iiduane/veffectsys", "id": "29e26689ac18aaab5c2e154507e7174c45c2ec27", "size": "...
import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configuration.items()], key=lambda e: e[0]) return '_'....
{ "content_hash": "7aae9698785ea224dbdd7bc11ad4d024", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 179, "avg_line_length": 35.246153846153845, "alnum_prop": 0.5608904408555216, "repo_name": "uclmr/inferbeddings", "id": "848e7d5891ee22b69d0e91bc2c38460036358ed6", "size":...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "60b0fbed82daeee67dafc669fefc74b6", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 95, "avg_line_length": 33.241610738255034, "alnum_prop": 0.5838885523924894, "repo_name": "onshape-public/onshape-clients", "id": "182240d153ee6df84fddb93e5e4963bb98f8ca73",...
""" Data sources classes and their associated functions for mlab. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Prabhu Ramachandran # Copyright (c) 2007-2010, Enthought, Inc. # License: BSD Style. import numpy as np from traits.api import Bool, HasTraits, Instance, on_trait_change from tvtk....
{ "content_hash": "3f8e263921023c004581534cb0eb0dfc", "timestamp": "", "source": "github", "line_count": 1427, "max_line_length": 79, "avg_line_length": 34.665031534688154, "alnum_prop": 0.5304344310348313, "repo_name": "dmsurti/mayavi", "id": "9e89009d95c97f03149ece7fdd2788975b438b0a", "size": "494...
"""A tff.aggregator for collecting summed histograms of client model weights.""" import tensorflow as tf import tensorflow_federated as tff class HistogramWeightsFactory(tff.aggregators.UnweightedAggregationFactory): """Aggregator reporting a histogram of client weights as a metric. The created tff.templates.Ag...
{ "content_hash": "63b08c24a8eaf11c01ba498efda2639f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 80, "avg_line_length": 39.171875, "alnum_prop": 0.7080175508575988, "repo_name": "google-research/federated", "id": "4259ad21b2adda261d82630f947e87dcfcc37278", "size": "308...
import sys from io import BytesIO as IO from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from webob import Response import cgi import json import base64 import zipfile import uuid import urllib import ast import sh...
{ "content_hash": "807c6bd032e58b7dcf1ec46de03fdef4", "timestamp": "", "source": "github", "line_count": 1244, "max_line_length": 303, "avg_line_length": 35.78456591639871, "alnum_prop": 0.446446221583251, "repo_name": "awalkaradi95moc/pfioh", "id": "ea0fa43b9bac9513298c2ba551485157d1c525a8", "size"...
def extractLamiadaughterBlogspotCom(item): ''' Parser for 'lamiadaughter.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('...
{ "content_hash": "7896897077dba39a12c6b8d261d0011c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 26.80952380952381, "alnum_prop": 0.6376554174067496, "repo_name": "fake-name/ReadableWebProxy", "id": "456e881686e7ef12ac14b5ebb3147940ec1eb615", "s...
from django.contrib import admin from apps.session.models import UserProfile, Message,\ GroupMessage, Block, Group class UserProfileAdmin(admin.ModelAdmin): list_display = ('user', 'nickname', 'points') class MessageAdmin(admin.ModelAdmin): list_display = ('content', 'sender', 'receiver') class GroupM...
{ "content_hash": "21bc93b6d4bf6cc60ef192952e747b51", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 69, "avg_line_length": 28.46875, "alnum_prop": 0.7310647639956093, "repo_name": "sparcs-kaist/araplus", "id": "1b76be72cd482703fc654dc811f93dfcf81bc1a1", "size": "911", "...
from south.db import db from south.v2 import SchemaMigration from zinnia.migrations import user_name from zinnia.migrations import user_table from zinnia.migrations import user_orm_label from zinnia.migrations import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding f...
{ "content_hash": "82b2313d44bec58e82af75444aeeda1d", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 182, "avg_line_length": 74.84615384615384, "alnum_prop": 0.5635919835560124, "repo_name": "1844144/django-blog-zinnia", "id": "f8a977512aa07f0897b1705fe75c163e790b406b", "...
""" homeassistant.components.switch.wemo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for WeMo switches. """ import logging from homeassistant.components.switch import SwitchDevice # pylint: disable=unused-argument def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return ...
{ "content_hash": "6a3eaaebd0f9aba2bb008e31a3ac4ad2", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 76, "avg_line_length": 28.97752808988764, "alnum_prop": 0.6114773167894533, "repo_name": "teodoc/home-assistant", "id": "eb55e0662b7888a35b2796683ae2a3ce062bd74a", "size": ...
import argparse import sys import tak from tak import mcts from xformer import loading from tak.model import wrapper, grpc import torch import time def main(argv): parser = argparse.ArgumentParser() parser.add_argument( "--simulations", dest="simulations", type=int, default=1...
{ "content_hash": "6e73bc81d6a3179c35eef3898720409c", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 75, "avg_line_length": 22.23404255319149, "alnum_prop": 0.5583732057416267, "repo_name": "nelhage/taktician", "id": "b110037d6361e28f20e83bc8820a9085579b02c6", "size": "209...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' import requests import traceback from typing import Dict, Optional, List, Any, Callable, Collection # Disable insecure warnings requests.packages.urllib3.disable_warnings() ''' CONSTANTS ''' # Integrat...
{ "content_hash": "d3b3ed0a7ed8365b2adc4fed683e6126", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 128, "avg_line_length": 37.98186528497409, "alnum_prop": 0.6383602755610122, "repo_name": "demisto/content", "id": "309e58746333fda0c2433503e512b035c1ea03d8", "size": "146...
from __future__ import division from entity import Entity class MashupEntity(Entity): type_id = 5 def __init__(self, mashup=None): Entity.__init__(self) self.id = None self.update(mashup) @staticmethod def create(*args): entity = MashupEntity() entity.load(*ar...
{ "content_hash": "6a4d85f3147fa34f94ec6d1add0ec7c4", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 67, "avg_line_length": 27.970588235294116, "alnum_prop": 0.5699263932702419, "repo_name": "VisTrails/VisTrails", "id": "0d06b1d3c2abfdc3a5bac1ab1bc2f96da2241a9d", "size": "...
import uuid from webob import exc from murano.db.catalog import api from murano.openstack.common.db import exception as db_exception from murano.tests.unit import base from murano.tests.unit import utils class CatalogDBTestCase(base.MuranoWithDBTestCase): def setUp(self): super(CatalogDBTestCase, self)...
{ "content_hash": "bac196aba60ef116446e820bac21d7ed", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 69, "avg_line_length": 30.276315789473685, "alnum_prop": 0.596697088222512, "repo_name": "ativelkov/murano-api", "id": "d95169d42f0ce4ad228335e512c93d1ea8063d05", "size": "...
from __future__ import unicode_literals import socket import multiprocessing import logging logger = logging.getLogger(__name__) def start_proxy(): from .handler.client import handle_client from .conf import settings PROXY_BIND = settings.get("PROXY_BIND") sock = socket.socket(socket.AF_INET, sock...
{ "content_hash": "dd51e25b6ca6e7db37ab2f427058a205", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 85, "avg_line_length": 28.035714285714285, "alnum_prop": 0.6802547770700637, "repo_name": "mrcrgl/gge-storage", "id": "f988fec721045145f6c86a090ba00059f042fccd", "size": "7...
import sensor, image, pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. pyb.LED(RED_LED_PIN).o...
{ "content_hash": "0461a6979573464435b9e2ada53ce628", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 66, "avg_line_length": 27.444444444444443, "alnum_prop": 0.6612685560053981, "repo_name": "iabdalkader/openmv", "id": "46e5c3b104b1c77ce51edfd80608af10ef01d4f8", "size": "8...
from __future__ import absolute_import, division, print_function, unicode_literals import datetime from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from test_haystack.core.models import AFifthMockModel, AnotherMockModel, CharPKMockModel, MockModel from ...
{ "content_hash": "90766231deda1e70f2be67e1b4062f59", "timestamp": "", "source": "github", "line_count": 888, "max_line_length": 893, "avg_line_length": 42.236486486486484, "alnum_prop": 0.6397376419772837, "repo_name": "comandrei/django-haystack", "id": "c02edb20c58c5a781c4acba25aca55a2a0f5807b", "...
import unittest from pyspark.rdd import PythonEvalType from pyspark.sql import Row from pyspark.sql.functions import array, explode, col, lit, mean, sum, \ udf, pandas_udf, PandasUDFType from pyspark.sql.types import ArrayType, TimestampType from pyspark.sql.utils import AnalysisException from pyspark.testing.sqlu...
{ "content_hash": "5d89de351dcd03289f12954b89829a8c", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 98, "avg_line_length": 39.86166007905138, "alnum_prop": 0.5287555775904809, "repo_name": "wangmiao1981/spark", "id": "0c78855cd9123da03708c97bfe0c2720f86da7ed", "size": "2...
from distutils.core import setup, Extension; # matey extension module matey_module = Extension( "_matey", extra_compile_args=["-Wno-unused-variable"], sources=["src/mateymodule.c", "src/matrix.c"] ); # distribution setup(name="matey", version="0.0", description="Numerical linear algebra for pyrates, aaarrggh...
{ "content_hash": "013d831ab0d3e733fd32ece00d7f41e4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 26.647058823529413, "alnum_prop": 0.6975717439293598, "repo_name": "benrbray/matey", "id": "e659fa554e3c56cab7cdf36143ecb3ed2793298f", "size": "453",...
"""Utility functions for X509. """ import calendar import datetime import errno import logging import re import time import OpenSSL from ganeti import errors from ganeti import constants from ganeti import pathutils from ganeti.utils import text as utils_text from ganeti.utils import io as utils_io from ganeti.uti...
{ "content_hash": "b70bc92f7bddd9b7e1b244d32d102a38", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 80, "avg_line_length": 32.272930648769574, "alnum_prop": 0.688201857756828, "repo_name": "yiannist/ganeti", "id": "2e4aa818400af51fdf4162591450832a4c990692", "size": "1579...
''' Created by auto_sdk on 2015.01.20 ''' from top.api.base import RestApi class UmpPromotionGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.channel_key = None self.item_id = None def getapiname(self): return 'taobao.ump.promotio...
{ "content_hash": "3ed9d341cf7afa02e6195e1d4b575c9a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 27.333333333333332, "alnum_prop": 0.6859756097560976, "repo_name": "colaftc/webtool", "id": "3d2c6c7fbb510bf20f1bc6f0a0867978ccbc910f", "size": "328"...
""" This defines the cmdset for the red_button. Here we have defined the commands and the cmdset in the same module, but if you have many different commands to merge it is often better to define the cmdset separately, picking and choosing from among the available commands as to what should be included in the cmdset - t...
{ "content_hash": "ab7f2b980cc2c5783413e15661f4a4ae", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 104, "avg_line_length": 31.105431309904155, "alnum_prop": 0.5873048479868529, "repo_name": "TaliesinSkye/evennia", "id": "ba7c61b17cdccae6e62717929d6a23d840f864d0", "size"...
import pickle import numpy as np """ Implementation of time and energy averaged responses from 2-d transfer functions. """ class TransferFunction(object): """ Create or retrieve a transfer function, and form time and energy averaged responses. Parameters ---------- data : numpy 2-d array / 2-...
{ "content_hash": "a1c9b51126b81ab5e5aac21ed2f501b1", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 84, "avg_line_length": 27.656346749226007, "alnum_prop": 0.5652076570021269, "repo_name": "StingraySoftware/stingray", "id": "5dd577251c93a4e130b232fdaea4b7c98d1611df", "s...
from django.views import generic from django.shortcuts import redirect class IndexView(generic.ListView): template_name = 'Dashboard.html' def get_queryset(self): pass def home(request): return redirect('/privacy/')
{ "content_hash": "4ed8ba74d0974a64bd9e750115f1dfd5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 37, "avg_line_length": 20.272727272727273, "alnum_prop": 0.7713004484304933, "repo_name": "JiaMingLin/de-identification", "id": "f7de6ca651b4c265ec76a0917b323e1517f7c925", ...
"""Implementation of gcloud genomics datasets update. """ from googlecloudsdk.api_lib import genomics as lib from googlecloudsdk.api_lib.genomics import genomics_util from googlecloudsdk.calliope import base from googlecloudsdk.core import log class Update(base.Command): """Updates a dataset name. """ @static...
{ "content_hash": "d4a2893cb862a37c52e978179d90a161", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 29.915254237288135, "alnum_prop": 0.6492917847025496, "repo_name": "flgiordano/netcash", "id": "e99de266c62b7fd60450b3601461fe2b63215728", "size": "2...
from booster import app, db import bcrypt class User(db.Model): ''' The only user is an administrator, so there aren't roles ''' id = db.Column(db.Integer, primary_key=True) login = db.Column(db.String(128), unique=True) email = db.Column(db.String(256), unique=True) smash = db.Column(db.Strin...
{ "content_hash": "bbf7669a9e1ad072daaf8f8ffd2bea68", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 93, "avg_line_length": 32.25, "alnum_prop": 0.6317829457364341, "repo_name": "zknight/booster", "id": "2c47e656030a8d61c3517671ef56d45a6eee7e53", "size": "774", "binary":...
from PyQt5.QtCore import QSettings from PyQt5.QtCore import QTextCodec class QmSetting(QSettings): def __init__(self, *args, **kwargs): super(QmSetting, self).__init__(*args, **kwargs) """ def ## settings code = QTextCodec.codecForName('utf-8') self.settings = QSettings('.tmp/settings.in...
{ "content_hash": "fbdf4f60cb06fcd717b7b811d5b11304", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 23.884615384615383, "alnum_prop": 0.6827697262479872, "repo_name": "kilfu0701/linne-tool", "id": "35468affdcd76fc76cff8477db4b1faad634a66e", "size": ...
import time import json import requests from threading import Thread from adnpy.models import (SimpleValueModel, Post, User, Channel, Message, Token, File, StreamingMeta) class StreamListener(object): """ The StreamListener Object for every message type (post, star, user_follow, mute, block, stream_mark...
{ "content_hash": "8e53a6d7d5238569a9c192d38ce888ef", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 120, "avg_line_length": 30.100401606425702, "alnum_prop": 0.5607738492328219, "repo_name": "appdotnet/ADNpy", "id": "5b8d800bc79d4f11ef6de650acbd7e5575ccc43a", "size": "74...
from __future__ import with_statement from hashlib import md5 import os from urllib import urlopen, urlencode, quote, unquote from django.contrib import admin from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.sites.models import Site from django.core.files import File from django.core.files.stora...
{ "content_hash": "f332f9c67e364a2229acc9f0a7d8c8c3", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 79, "avg_line_length": 35.51452282157676, "alnum_prop": 0.6004790279238229, "repo_name": "sachingupta006/Mezzanine", "id": "5dd8e64ffc6b41c80ebd4a7738717881c4d8638c", "siz...
import numpy as np def parse_raw_data(path): input_sentences = [] target_sentences = [] with open(path) as f: in_sentence = [] target_sentence = [] for line in f: if line != "\n": in_target = line.split('\t') in_sentence.append(in_target[...
{ "content_hash": "8750b90ebcd8617858b81e843e629ebf", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 99, "avg_line_length": 43.5, "alnum_prop": 0.5219827586206897, "repo_name": "Lucklyric/NLP-NER-CNN", "id": "b21b84758ee4c8ef717ef56ffacf71a79f61f787", "size": "6960", "b...
from __future__ import absolute_import, print_function # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache...
{ "content_hash": "725085389c396b25f6194f76aba10eec", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 78, "avg_line_length": 35.38823529411765, "alnum_prop": 0.6944813829787234, "repo_name": "snithish/spark-testing-base", "id": "cd622d85aa469b86dd0eb2133647f926e78476ab", "s...
from unittest import skipIf from django.conf import settings skipIfSpatialite = skipIf('spatialite' in settings.DATABASES['default']['ENGINE'], "Spatialite not supported")
{ "content_hash": "3ca2f4b31494a0f884787677364986f6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 110, "avg_line_length": 43.25, "alnum_prop": 0.7976878612716763, "repo_name": "ocadotechnology/django-tastypie", "id": "264785d147c1498f06fca561010e3a400e23d505", "size": "1...
import os.path import shutil import tempfile import lmdb import numpy as np from . import analyze_db from digits import test_utils # Must import after importing digits.config import caffe.io import caffe_pb2 test_utils.skipIfNotFramework('none') class BaseTestWithDB(object): SAME_SHAPE = True PASS_DEFAUL...
{ "content_hash": "9fb829201181651f0ac17a8bc07f2f88", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 94, "avg_line_length": 23.984126984126984, "alnum_prop": 0.6254136333553938, "repo_name": "TimZaman/DIGITS", "id": "ddf7356fa83a6c5e6a43f26cbd12bb0fe4e403f8", "size": "1581...
import numpy as np import visvis as vv from visvis.pypoints import Pointset, is_Point, is_Pointset from visvis import PolarLine def makeArray(data): if isinstance(data, np.ndarray): return data else: # create numpy array try: l = len(data) a = np.empty((l, 1)) ...
{ "content_hash": "94d21e933c34c1582846f64ce068f990", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 78, "avg_line_length": 32.042857142857144, "alnum_prop": 0.5706642888987963, "repo_name": "chiluf/visvis.dev", "id": "417c7b23d64ea7e584865ea9fd24cc236e76ac7a", "size": "6...
"""WebHelpers used in tgapp-stroller2.""" #from webhelpers import date, feedgenerator, html, number, misc, text from markupsafe import Markup from tgext.pluggable import plug_url def bold(text): return Markup('<strong>%s</strong>' % text) def stroller2_product_url(product): return plug_url('stroller2', '/p...
{ "content_hash": "c08a367528f303d59778f8ab624eab7b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 28.625, "alnum_prop": 0.7248908296943232, "repo_name": "gasbasd/tgapp-stroller2", "id": "7424b077f1bdb42496f96baca2ea9f9159c1ab9b", "size": "483", ...
conf_neutron_conf = """[DEFAULT] # Print more verbose output (set logging level to INFO instead of default WARNING level). verbose = True # =========Start Global Config Option for Distributed L3 Router=============== # Setting the "router_distributed" flag to "True" will default to the creation # of distributed tenant...
{ "content_hash": "7a0dca9bf87fe62686c4c01826aaf29a", "timestamp": "", "source": "github", "line_count": 1156, "max_line_length": 118, "avg_line_length": 34.24134948096886, "alnum_prop": 0.744132582169113, "repo_name": "jiasir/playback", "id": "89858f1a3c790c1b55823b30a5949f98ef9f87d1", "size": "395...
import json import random f = open('databases/reviewsAll.json', 'r') reviewers = json.loads(f.read()) print "Analyzing results" #----------------BASIC STATS------------------------------ duplicates = {} train_size = 22000 train_reviews = [] test_reviews = [] total_set = [] for reviewer in reviewers: for review ...
{ "content_hash": "0b264b000f2b1cd9f6349698adba5144", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 106, "avg_line_length": 22.48, "alnum_prop": 0.6914590747330961, "repo_name": "danShumway/Game-Review-Analyzation", "id": "19788e8318eb6d2f0f3099ae1295f3c1ec3d7cac", "size...
import os import sys import json import time import logging import threading import logging.config import numpy as np from datetime import datetime from collections import defaultdict from .io import discover_hosts, io_from_host, Ws from .modules import name2mod from anytree import AnyNode, RenderTree def run_from...
{ "content_hash": "828d9acd25ea338c0c91ea1c96e790c5", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 115, "avg_line_length": 32.665399239543724, "alnum_prop": 0.5133279012920499, "repo_name": "pollen/pyrobus", "id": "25bef08bd19409f19a96c78f80ece9e16b4109c5", "size": "859...
import os from converter.avcodecs import video_codec_list, audio_codec_list, subtitle_codec_list from converter.formats import format_list from converter.ffmpeg import FFMpeg, FFMpegError, FFMpegConvertError class ConverterError(Exception): pass class Converter(object): """ Converter class, encapsulate...
{ "content_hash": "abaff9ebd87669064fccb308f3121603", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 104, "avg_line_length": 38.22932330827068, "alnum_prop": 0.590520208476743, "repo_name": "Filechaser/sickbeard_mp4_automator", "id": "5036b350f6aed880dabe861d8c5dcb600b624a7...
import json import logging as log import urllib, urllib2 from httplib import HTTPException from cookielib import CookieJar from bs4 import BeautifulSoup from google.appengine.api import urlfetch from pprint import pprint class Binary(): def __init__(self, auto_login): urlfetch.set_default_fetch_deadline(6...
{ "content_hash": "c3dc457f239cb5bacb43851884fa76de", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 132, "avg_line_length": 37.29644268774704, "alnum_prop": 0.5292496820686732, "repo_name": "Tjorriemorrie/trading", "id": "307a9d64554f902b62ba7d9c491b10928b311b4f", "size"...
import functools from django.http import Http404 from django.views.defaults import page_not_found, server_error from django.views.generic import TemplateView from .data import EXTRA_DATA from .utils import ( TemplateExistanceStatusResponse, collect_language_codes, ) class IndexView(TemplateView): templa...
{ "content_hash": "3ca8e33b7d62e0a93e334acb8f22e401", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 75, "avg_line_length": 30.307692307692307, "alnum_prop": 0.6324027072758037, "repo_name": "uranusjr/pycontw2016", "id": "edfad4c9183726ea2795ba80e3a351cb8f4db84e", "size": ...
import json import networkx as nx import matplotlib.pyplot as plt def get_structures(fname): with open(fname) as struct_files: structures = json.loads(struct_files.read()) return structures def get_colors(): colors = { 'blood_pressure' : '#57B4E6', 'blood_glucose' : '#57B4E6', ...
{ "content_hash": "d6105953a166a32a28bbc775a379d25b", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 73, "avg_line_length": 32.21176470588235, "alnum_prop": 0.5774287801314828, "repo_name": "lucalianas/pyEHR", "id": "bb1077ca56721c2bad5df420a2c5ab0b054c9c30", "size": "2738...
import os import shutil import zipfile from prefs.zippref import ZipPref from log import logger log = logger.getLogger(__name__) class ZipBuild: __zipPref = ZipPref() def __init__(self): # init logger self.__logger = log def setPref(self, pref): self.__zipPref = pref def __g...
{ "content_hash": "7204c0eceebd7e193ff94c5fe4e211a2", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 91, "avg_line_length": 34, "alnum_prop": 0.5850727387729285, "repo_name": "yu757371316/MySQL", "id": "0bfcdc2d229ae168612708056181f1c4a44e7ec5", "size": "3264", "binary":...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HM5_then2_CompleteLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HM5_then2_CompleteLHS. """ # Fla...
{ "content_hash": "e2b608ca91e2fdd6df394e32d23b17c0", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 125, "avg_line_length": 52.58536585365854, "alnum_prop": 0.4653679653679654, "repo_name": "levilucio/SyVOLT", "id": "2a3c40f8f07cbe43e2dcb5af636b99fd4c95d6f3", "size": "12...
import unittest import logging from airflow.exceptions import AirflowException try: from airflow.operators.docker_operator import DockerOperator from airflow.hooks.docker_hook import DockerHook from docker import APIClient except ImportError: pass from tests.compat import mock class DockerOperatorTe...
{ "content_hash": "162d740615839d050cff56e885802a1f", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 99, "avg_line_length": 45.28947368421053, "alnum_prop": 0.5588943305387233, "repo_name": "owlabs/incubator-airflow", "id": "ca4709ab9b1aace9d3ab53f61ffe140cf33f24f2", "siz...
from ._service_operations import ServiceOperations from ._file_system_operations import FileSystemOperations from ._path_operations import PathOperations from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk ...
{ "content_hash": "a855317f6b8976de2c09accfa3b8170b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 32.2, "alnum_prop": 0.7204968944099379, "repo_name": "Azure/azure-sdk-for-python", "id": "1ecb9f322a1b7bad4dadc1b00b4f4b170d54e4dd", "size": "951", ...
import os import sys import shutil import tempfile import subprocess from distutils.core import setup, Command from distutils.dir_util import remove_tree MODULE_NAME = "binwalk" SCRIPT_NAME = MODULE_NAME # Python2/3 compliance try: raw_input except NameError: raw_input = input # cd into the src directory, no...
{ "content_hash": "fa6f606731646ee835e5f4dac1a6a1d7", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 145, "avg_line_length": 31.59259259259259, "alnum_prop": 0.6131301289566237, "repo_name": "cappiewu/binwalk", "id": "6673f36e3ae2387c17882a57c95116227c833b49", "size": "68...
from __future__ import absolute_import from pdbuddy.matchers.base import BaseMatcher class AnyMatcher(BaseMatcher): """A Matcher that matches any trace""" def __call__(self, context): return True
{ "content_hash": "d50471457eace04378cf2cd6ec1b3285", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 45, "avg_line_length": 21.6, "alnum_prop": 0.6990740740740741, "repo_name": "emou/pdbuddy", "id": "32ef61f18b9a125e4969fa900314c5a96f0b937b", "size": "216", "binary": fal...
import pytest from f5_openstack_agent.lbaasv2.drivers.bigip.esd_filehandler import \ EsdTagProcessor @pytest.fixture(scope='session') def bigips(mgmt_root): return [mgmt_root] class TestEsd(object): def test_invalid_esd_name(self, bigips): processor = EsdTagProcessor('tests/functional/esd/json/...
{ "content_hash": "23708eea614397c8695861d703bd5a85", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 74, "avg_line_length": 33.58620689655172, "alnum_prop": 0.6570841889117043, "repo_name": "richbrowne/f5-openstack-agent", "id": "62d5c8c11a5123338a6c5a610b18c6ddee67d006", ...
from .function_base import * from .stride_tricks import * from .shape_base import * from .scimath import * from .type_check import *
{ "content_hash": "9358824a721b5166dd4dd9b265b842a8", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 28, "avg_line_length": 26.6, "alnum_prop": 0.7443609022556391, "repo_name": "daurer/afnumpy", "id": "cbbfa18c83824f398e810c51de463d64a733e1dc", "size": "133", "binary": fa...
from mcinfo import cli, normal_info, nbt, recipes __all__ = ["cli", "normal_info", "nbt", "recipes"]
{ "content_hash": "d761c464d156264aa2efff3b63370ecc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 50, "avg_line_length": 34, "alnum_prop": 0.6372549019607843, "repo_name": "randomdude999/mcinfo", "id": "70a7c3bb1ef7e4791df77bff38a16e9ea90df0cf", "size": "102", "binary"...
import datetime from django.contrib.auth import get_user_model from factory import DjangoModelFactory, Sequence, \ SubFactory, fuzzy, PostGenerationMethodCall, post_generation, compat from arctic.models import Role, UserRole from articles.models import Article, Category, Tag class CategoryFactory(DjangoModelFac...
{ "content_hash": "ec8609771d4dea4a23f9c77d1495ce85", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 28.395833333333332, "alnum_prop": 0.6588407923697726, "repo_name": "dgbc/django-arctic", "id": "4a46dc38677656e0003419d2bc84a4769d0b3427", "size": "1...
""" Handles all requests relating to volumes. """ import collections import datetime import functools from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils from oslo_utils import uuidutils import six from cinder import context from cinder.db...
{ "content_hash": "7cb47e91e31b6cd2cadd943a87fb9cb2", "timestamp": "", "source": "github", "line_count": 1473, "max_line_length": 79, "avg_line_length": 44.57841140529531, "alnum_prop": 0.5293311403508771, "repo_name": "rakeshmi/cinder", "id": "d4bde31fc1a3afe1d4c27fd4b6c5cf0d422ddd40", "size": "663...
''' Created on Oct 4, 2013 @author: athiessen ''' from brisa.core.network import parse_url from brisa.core.threaded_call import run_async_function from brisa.upnp.control_point.control_point import ControlPoint service = ('u', 'urn:schemas-upnp-org:service:SwitchPower:1') binary_light_type = 'urn:schemas-upnp-org:...
{ "content_hash": "028c0b87e082c948e5b5292f0a239966", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 63, "avg_line_length": 18.576923076923077, "alnum_prop": 0.6625258799171843, "repo_name": "AlanDThiessen/atha", "id": "391a27a45723bcce209eb387cdbb461f9f4cb11c", "size": "4...
from ..core import WesternCalendar from ..registry_tools import iso_register @iso_register('ES') class Spain(WesternCalendar): 'Spain' # Christian holidays include_epiphany = True include_good_friday = True include_assumption = True include_all_saints = True include_immaculate_conception ...
{ "content_hash": "c4e84f773e49fec907a0f14bfb46b5b7", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 63, "avg_line_length": 25.575, "alnum_prop": 0.6439882697947215, "repo_name": "novapost/workalendar", "id": "77fc5bb342073f55c723e2857339344fe41b2213", "size": "5138", "...
from rest_framework import serializers from journal.models import Student, Advisor, Coordinator, School class StudentSerializer(serializers.ModelSerializer): """Student model serializer""" class Meta: model = Student fields = ('first_name', 'last_name', 'personal_code', 'student_id', ...
{ "content_hash": "9192a6424506aee69782f5b316ca25d4", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 80, "avg_line_length": 33.83870967741935, "alnum_prop": 0.6491897044804575, "repo_name": "WildCAS/CASCategorization", "id": "ee9583d41df56069913ca14264028716a8a4c779", "siz...
from flask import current_app from flask.ext.celery import CELERY_LOCK import pytest from redis.exceptions import LockError from pypi_portal.extensions import db, redis from pypi_portal.models.pypi import Package from pypi_portal.models.redis import POLL_SIMPLE_THROTTLE from pypi_portal.tasks import pypi class FakeD...
{ "content_hash": "c7f1b52b979e4ab13c53e78cfe695ad6", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 94, "avg_line_length": 35.325, "alnum_prop": 0.6551073366359991, "repo_name": "Robpol86/Flask-Large-Application-Example", "id": "27394594cc76c8ccde073c14c83e1f2757b0f036", ...
from rctk.tests.base import BaseTest from rctk.task import Task from rctk.widgets import StaticText, Control class BaseContainerTest(BaseTest): """ Test basic container type behaviour """ container = None def create_widgets(self): c = self.container(self.tk) w = StaticText(...
{ "content_hash": "d8f3481b75847b6d2861f79ead51e8c7", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 71, "avg_line_length": 30.653061224489797, "alnum_prop": 0.5702396804260985, "repo_name": "rctk/rctk", "id": "5c3693705138d51489c65de9981de82e903b2c15", "size": "3004", "...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings_test") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "e55bcb98dfd4751c84b4ab5c2f5d9741", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 68, "avg_line_length": 25, "alnum_prop": 0.7066666666666667, "repo_name": "foundertherapy/django-users-plus", "id": "6808838e56ab3964d2ffc02ec1a1467aec2f0448", "size": "247"...
import arcpy, os #variables directory = "C:\\TxDOT\\CountyRoadInventory" #issue list issues = [] def re_source_admin(): #walk through each directory for root, dirs, files in os.walk(directory): #ignore file and personal geodatabases specDir = root.split("\\")[-1] dbsuffix = spec...
{ "content_hash": "4043ec235fd37c75a11ec4f19f520c61", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 120, "avg_line_length": 50.04477611940298, "alnum_prop": 0.43155383238890543, "repo_name": "adambreznicky/python", "id": "3156267f47ecdd5514eb28258349ffae93803b34", "size":...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import colors from scipy import misc import argparse import os parser = argparse.ArgumentParser(description='Display recorded Kinect data', fromfile_prefix_chars="@") parser.add_argument('-p', dest='recording_path', action='s...
{ "content_hash": "656c6b965a562efd00f4d6ef3d35ef06", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 134, "avg_line_length": 33.953125, "alnum_prop": 0.6916705016106764, "repo_name": "dotKokott/KinectV2Recorder", "id": "2e0823debe71f68add68083c5e2d38be772d5b46", "size": "2...
import datetime import pickle import unittest import uuid from collections import namedtuple from copy import deepcopy from decimal import Decimal from unittest import mock from django.core.exceptions import FieldError from django.db import DatabaseError, NotSupportedError, connection from django.db.models import ( ...
{ "content_hash": "cef5c9e0894733589e5b77381c0da1f7", "timestamp": "", "source": "github", "line_count": 2569, "max_line_length": 88, "avg_line_length": 38.43090696769171, "alnum_prop": 0.5738536802763119, "repo_name": "dsanders11/django", "id": "39e6c18b1a126fabfc17881655ed57de9187bf2f", "size": "9...
from __future__ import unicode_literals import curses from collections import OrderedDict import six import pytest from rtv import __version__ from rtv.subreddit_page import SubredditPage from rtv.packages.praw.errors import NotFound, HTTPException from requests.exceptions import ReadTimeout try: from unittest ...
{ "content_hash": "768c5170a93827d15c4241d1ec99f04f", "timestamp": "", "source": "github", "line_count": 639, "max_line_length": 106, "avg_line_length": 36.05790297339593, "alnum_prop": 0.6882079770843279, "repo_name": "michael-lazar/rtv", "id": "f6d57399ee88f6479dec45f53f8214026ecb3bc3", "size": "2...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0040_page_draft_title'), ('wagtailredirects', '0006_redirect_increase_max_length'), ('wagtailmenus', '0022_auto_20170913_2125'), ('wagtailforms', '0003_capitalizeverbo...
{ "content_hash": "98739c581927d5b1e0dbcb9a4bf5d5e5", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 86, "avg_line_length": 30.25925925925926, "alnum_prop": 0.5452876376988984, "repo_name": "sussexstudent/falmer", "id": "e51dab265d16b7f678d8f5ec9477ac90a055d154", "size": "...
from __future__ import absolute_import from __future__ import print_function from .version import __version__
{ "content_hash": "68aecaa7236970531affc09f74c6d077", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 27.75, "alnum_prop": 0.7477477477477478, "repo_name": "blubberdiblub/eztemplate", "id": "15c87f7fd5ae965bacc64ca7e2bf0c5d9b6e8e85", "size": "134", "...
""" This is part of WebScout software Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en Docs RU: http://hack4sec.pro/wiki/index.php/WebScout License: MIT Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Class with common functions for Spider module """ import copy import t...
{ "content_hash": "d5fcefde9c36ac70435741d162a88c23", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 116, "avg_line_length": 33.915841584158414, "alnum_prop": 0.5064224200846592, "repo_name": "hack4sec/ws-cli", "id": "7726c5045bf620123c880b07901423efb810124e", "size": "13...
def setup_module(module): module.TestStateFullThing.classcount = 0 class TestStateFullThing(object): def setup_class(cls): cls.classcount += 1 def teardown_class(cls): cls.classcount -= 1 def setup_method(self, method): self.id = eval(method.__name__[5:]) def test_42(self...
{ "content_hash": "f3b6f5db6ee405fa0c97f2f904296f07", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 63, "avg_line_length": 29.952380952380953, "alnum_prop": 0.6629570747217806, "repo_name": "flub/pytest", "id": "100effa499f3e4ba8e42c95f50ec11288ca5c0f3", "size": "1258", ...
""" :mod:`sense` -- Word Sense Annotation ------------------------------------------------ See: - :class:`on.corpora.sense.on_sense` - :class:`on.corpora.sense.sense_bank` - :class:`on.corpora.sense.on_sense_type` Word sense annotation consists of specifying which sense a word is being used in. In the ``.sense``...
{ "content_hash": "8ea61b06cf289f5750a56d1863da2643", "timestamp": "", "source": "github", "line_count": 1636, "max_line_length": 409, "avg_line_length": 35.613691931540345, "alnum_prop": 0.5401105313744337, "repo_name": "Juicechuan/AMR_graph", "id": "1d3834d67eb5372419544c766d9a20739ac5403a", "size...
from django.core.exceptions import ImproperlyConfigured try: # Django < 2.0 from django.core.urlresolvers import RegexURLPattern as URLPattern, RegexURLResolver as URLResolver, get_callable except: # Django >= 2.0 from django.urls import URLPattern, URLResolver, get_callable from django.utils import si...
{ "content_hash": "f44c94fe445c79eae9ad08d05c790358", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 117, "avg_line_length": 35.21818181818182, "alnum_prop": 0.6339700567888488, "repo_name": "mjtamlyn/django-cbvpatterns", "id": "a657d0128d101cbbd5da278fa7796303552abdfa", "...
from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.core import serializers from django.core.urlresolvers import reverse from django.contrib.auth import authenticate, login, logout from django.contrib.auth.de...
{ "content_hash": "82607fac561c0bd1e6b0ca37c7e1634b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 79, "avg_line_length": 34.65217391304348, "alnum_prop": 0.7440401505646174, "repo_name": "drfrink/adminLTE_Django", "id": "391380a7d582986a6c4b8f7bcda7c88a27875e8d", "size"...
from __future__ import print_function import os import sys import time import google.auth.credentials from google.auth.environment_vars import CREDENTIALS as TEST_CREDENTIALS # From shell environ. May be None. CREDENTIALS = os.getenv(TEST_CREDENTIALS) ENVIRON_ERROR_MSG = """\ To run the system tests, you need to se...
{ "content_hash": "0cf4a04c09f923a85ceb90186d1a36fe", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 73, "avg_line_length": 29.074626865671643, "alnum_prop": 0.6442505133470225, "repo_name": "calpeyser/google-cloud-python", "id": "44914d7ce29ab5a1f5c70444fc1bfe6e566edbe1", ...
"""SCons.Scanner.IDL This module implements the depenency scanner for IDL (Interface Definition Language) files. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy o...
{ "content_hash": "c79acc9af0db5fcb9100504c2fcc8cac", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 113, "avg_line_length": 39, "alnum_prop": 0.6960470085470085, "repo_name": "jjenki11/blaze-chem-rendering", "id": "13a0226b91df318893966c1139dcd0e615864ef6", "size": "1872"...
import cv2 import numpy as np from matplotlib import pyplot as plt import matplotlib # imports import os import random import sys HeadBias = 15 changeFactor = 5 #return def Difference(a,b): return np.abs(a - b) def tiltShift(frame, center,heights): blurIterations = 8 focus = frame.shape[0]...
{ "content_hash": "f2c6355c24d376e196c134d7f30ad4d8", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 113, "avg_line_length": 28.04945054945055, "alnum_prop": 0.6186092066601371, "repo_name": "JasonKraft/CVFall2017", "id": "a5350a074994c76847c1d47b260d1812cec2bae2", "size"...
""" Fabric's own fabfile. """ import nose from fabric.api import abort, local, task @task(default=True) def test(args=None): """ Run all unit tests and doctests. Specify string argument ``args`` for additional args to ``nosetests``. """ # Default to explicitly targeting the 'tests' folder, bu...
{ "content_hash": "339f79dadc23c0514e3b1eb505ac596e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 24.458333333333332, "alnum_prop": 0.6388415672913118, "repo_name": "xLegoz/fabric", "id": "5f9e5f69678ffdc36455b3b9c0fb321b4619980f", "size": "587", ...
"""MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explaination. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 Contents: - par...
{ "content_hash": "f622a73dedd343219efd43edd78327a6", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 130, "avg_line_length": 47.58181818181818, "alnum_prop": 0.6112597121385811, "repo_name": "ramusus/django-authopenid", "id": "ca304772d2824f1aa7088b4bd37264eb65ac235d", "s...
import logging from django.core.management.base import BaseCommand from osf.features import switches, flags from waffle.models import Flag, Switch logger = logging.getLogger(__name__) def manage_waffle(delete_waffle=False): file_switches = list(switches.values()) current_switches = Switch.objects.values_lis...
{ "content_hash": "174a7b2ee99e72c67920d4fcef3afea6", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 90, "avg_line_length": 36.66, "alnum_prop": 0.668303327877796, "repo_name": "baylee-d/osf.io", "id": "186ef15e6828daa6d1077b51629d6e314aefd808", "size": "1857", "binary":...
"""The Migrate command.""" from googlecloudsdk.api_lib.app import appengine_api_client from googlecloudsdk.api_lib.app import operations_util from googlecloudsdk.api_lib.app import service_util from googlecloudsdk.api_lib.app import util from googlecloudsdk.api_lib.util import exceptions as api_exceptions from googlec...
{ "content_hash": "249b241a51ccd45551d19876841cf000", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 78, "avg_line_length": 38.83673469387755, "alnum_prop": 0.6374146085128745, "repo_name": "KaranToor/MA450", "id": "d16cf1392f9b08edffde82d52090c0b6b54b51ac", "size": "4402"...
import io import shutil from unittest import mock from mitmproxy.test import tflow from mitmproxy.test import taddons from mitmproxy.test import tutils from mitmproxy.addons import dumper from mitmproxy import exceptions from mitmproxy.tools import dump from mitmproxy import http def test_configure(): d = dumpe...
{ "content_hash": "bbfd8f8837428e706aa5a26e28ee435c", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 90, "avg_line_length": 31.994594594594595, "alnum_prop": 0.6181787464098666, "repo_name": "dwfreed/mitmproxy", "id": "8fa8a22a0841ca18dbb93bba4e67f21e59fa2e01", "size": "5...
""" All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA. Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. Exam...
{ "content_hash": "0a7e8a8d8c761bd2df1cf1c6859b9891", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 193, "avg_line_length": 30.875, "alnum_prop": 0.6194331983805668, "repo_name": "franklingu/leetcode-solutions", "id": "a377f7c23a2a655558ad515a301bcff2e53f4985", "size": "7...
"""Tests for batch_fuzzer_jobs.""" import unittest from google.cloud import ndb from clusterfuzz._internal.datastore import data_types from clusterfuzz._internal.tests.test_libs import test_utils from handlers.cron import batch_fuzzer_jobs @test_utils.with_cloud_emulators('datastore') class TestBatchingFuzzerJobs(...
{ "content_hash": "cafde47ab1c011b1ac65a3fb65e273a0", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 72, "avg_line_length": 32.76470588235294, "alnum_prop": 0.6576900059844405, "repo_name": "google/clusterfuzz", "id": "f14e6d35dea554056a21702699fb013c8bde7065", "size": "22...