text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals import frappe import unittest class TestBlogCategory(unittest.TestCase): pass
{ "content_hash": "d5a6a273f17c5a2ce6aecbef8436da10", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 42, "avg_line_length": 17.285714285714285, "alnum_prop": 0.8099173553719008, "repo_name": "saurabh6790/frappe", "id": "fe8f4544cd8dc8f8b5c7abab6960f58330e0a20c", "size": "22...
"""Astroid hooks for the Python 2 standard library. Currently help understanding of : * hashlib.md5 and hashlib.sha1 """ import functools import sys from textwrap import dedent from astroid import ( MANAGER, UseInferenceDefault, inference_tip, BoundMethod, InferenceError, register_module_extender) from astr...
{ "content_hash": "5d548047ac621adf2ea4e31b633d28c9", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 82, "avg_line_length": 34.63559322033898, "alnum_prop": 0.5929165647173966, "repo_name": "axbaretto/beam", "id": "ad395a27912ae38cf68c862babe432a3c0548dfa", "size": "16349...
""" Overlay crime costs on roads """ import pandas as pd import numpy as np import overpass import geopandas as gpd import matplotlib.pyplot as plt from ast import literal_eval as make_tuple import psycopg2 import ipdb import sys import cost_models import sys import json import matplotlib as mpl import folium dbname ...
{ "content_hash": "7cb516e14a34b80de01b9586dc0b86f0", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 274, "avg_line_length": 36.92553191489362, "alnum_prop": 0.661768942667819, "repo_name": "NahsiN/SafeWalk", "id": "79da594aa3a0261ae409b248d47e6a9665b5b6de", "size": "3471"...
import glanceclient.exc import novaclient.exceptions as nova_exc from oslo_utils import timeutils import pecan from pecan import rest import wsme from wsme import types as wtypes from magnum.api.controllers import base from magnum.api.controllers import link from magnum.api.controllers.v1 import collection from magnum...
{ "content_hash": "c0d9d67df7756f171cfff24c3e68110f", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 79, "avg_line_length": 39.16710182767624, "alnum_prop": 0.5965602293180454, "repo_name": "dimtruck/magnum", "id": "f174f879b9d92d658183bffb31a042b956a662f0", "size": "1559...
from celery.schedules import crontab import os _every_20s = 20 _every_1min = crontab(minute='*') _every_5min = crontab(minute='*/5') _every_1h = crontab(minute=0) BROKER_URL = os.getenv('BROKER_URL', "redis://localhost:6379/0") CELERY_RESULT_BACKEND = os.getenv('RESULT_BACKEND', "redis://localhost/0") CELERY_TASK_SE...
{ "content_hash": "964db0468739d52ca409896398f24816", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 31.310344827586206, "alnum_prop": 0.6685022026431718, "repo_name": "futurice/vimma2", "id": "e7285caa6d7cd7655f324bb854e29a306187f62a", "size": "908"...
""" inspector """ from __future__ import absolute_import, division, print_function import logging import traceback from PySide import QtGui from mcedit2.command import SimpleRevisionCommand from mcedit2.rendering.scenegraph import scenenode from mcedit2.rendering.selection import SelectionBoxNode from mcedit2.wid...
{ "content_hash": "c2201e001c82b74136fa5e98926b3f2f", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 117, "avg_line_length": 38.82008368200837, "alnum_prop": 0.6384996766544514, "repo_name": "vorburger/mcedit2", "id": "1bd0c6f822005be06573da8b4ce9d88a0e940da0", "size": "9...
from __future__ import division import sys import numpy as np import scipy.signal as signal import scipy.stats as stats import scipy.interpolate as intr import deriv import abc class BinConverter(object): """ `BinConverter` converts data binned according to one scheme into a different binning scheme. Con...
{ "content_hash": "d96b810d04e8eedb0c9eb67118c93ca0", "timestamp": "", "source": "github", "line_count": 467, "max_line_length": 80, "avg_line_length": 36.49464668094218, "alnum_prop": 0.5520154902305932, "repo_name": "phil-mansfield/gotetra", "id": "f1f1b365f3cf936206622c084667bfb7386152a7", "size"...
"""Print an AST tree in a form more readable than ast.dump.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gast import six import termcolor class PrettyPrinter(gast.NodeVisitor): """Print AST nodes.""" def __init__(self, color, noanno): ...
{ "content_hash": "ee7f82123c47066fe944deb347ccd58b", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 79, "avg_line_length": 29.65573770491803, "alnum_prop": 0.5248756218905473, "repo_name": "arborh/tensorflow", "id": "d6e8f86c85415b55a9725659fd441ec7d1d804a2", "size": "43...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="edalize", version="0.4.0", packages=["edalize", "edalize.tools", "edalize.flows"], package_data={ "edalize": [ "templates/yosys/edalize_yosy...
{ "content_hash": "a0251123910e97ded4c12023ca2654b1", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 116, "avg_line_length": 35.13953488372093, "alnum_prop": 0.586035737921906, "repo_name": "lowRISC/edalize", "id": "35ce8446ce52c11056098b8ff4c9f64bd8cd746a", "size": "3164"...
""" Various network validation utilities """ import re import socket import salt.utils.platform if salt.utils.platform.is_windows(): from salt.ext import win_inet_pton # pylint: disable=unused-import def mac(addr): """ Validates a mac address """ valid = re.compile( r""" ...
{ "content_hash": "8d953f75764debac57dee8709ac16d7a", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 22.88888888888889, "alnum_prop": 0.5706090026478376, "repo_name": "saltstack/salt", "id": "a58fb2b2d70bd947a750c74b66cec3e536f9b833", "size": "2266",...
__license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by...
{ "content_hash": "332670676008f7b7ebf1cd6773e1d5d9", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 34.19565217391305, "alnum_prop": 0.680864589955499, "repo_name": "JeyZeta/Dangerous", "id": "ce2912b7468818b5dd0796598a0885c1bba2e0ed", "size": "1620...
"""Provides 'odometry', which loads and parses odometry benchmark data.""" import datetime as dt import glob import os from collections import namedtuple import numpy as np import pykitti.utils as utils __author__ = "Lee Clement" __email__ = "lee.clement@robotics.utias.utoronto.ca" class odometry: """Load and...
{ "content_hash": "f85c7da78a76d5d269eb73f8df56cd8d", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 79, "avg_line_length": 37.295698924731184, "alnum_prop": 0.5753207438373937, "repo_name": "zaqwes8811/micro-apps", "id": "86f01d625b0d2796fcca1130e7a0fdd69f6a44bc", "size"...
"""Copyright 2014 Cyrus Dasadia 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 distr...
{ "content_hash": "a944eb5b38a3d1c8201f869b99174b2b", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 87, "avg_line_length": 36.4375, "alnum_prop": 0.6497427101200686, "repo_name": "CitoEngine/cito_engine", "id": "f2ef0116a6ac8234b5f9dda8947f75754d138895", "size": "2915", ...
import asyncio from gear import Database from hailtop.utils import ( rate_gib_hour_to_mib_msec, rate_cpu_hour_to_mcpu_msec ) async def main(): # https://cloud.google.com/compute/all-pricing rates = [ ('compute/n1-nonpreemptible/1', rate_cpu_hour_to_mcpu_msec(0.031611)), ('memory/n1-no...
{ "content_hash": "9c5342584d8abcb3e0a65633ae4059dd", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 22.107142857142858, "alnum_prop": 0.6268174474959612, "repo_name": "hail-is/hail", "id": "86239a790f8c9173bd022cebfc7c5c07b33a0f2b", "size": "619", ...
""" Django settings for basicincome project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import enviro...
{ "content_hash": "1efa8920fdaf6a6d5bd811ba4e3e712a", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 98, "avg_line_length": 35.93392070484582, "alnum_prop": 0.6076989089125904, "repo_name": "aparamo/basicincome", "id": "444fff8abd448eb338c808a74ffc8b6c0a23dac3", "size": "...
import serial import shlex import subprocess pub_cmd = "mosquitto_pub -t cc128/raw -l -q 2" pub_args = shlex.split(pub_cmd) pub = subprocess.Popen(pub_args, stdin=subprocess.PIPE) usb = serial.Serial(port='/dev/ttyUSB0', baudrate=57600) running = True try: while running: line = usb.readline() pub.stdin.write(l...
{ "content_hash": "3ba2e0bb669653db309039a533a2865c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 56, "avg_line_length": 17.708333333333332, "alnum_prop": 0.72, "repo_name": "adamvr/mosquitto-homebrew-mods", "id": "f0679459aa87266adf755d2922bb666e435c4f78", "size": "447...
import unittest from integrationtest_support import IntegrationTestSupport class Test(IntegrationTestSupport): def test(self): self.write_build_file(""" from pybuilder.core import init from pybuilder.core import task from pybuilder.core import use_plugin use_plugin("python.pyfix_unittest") name = "inte...
{ "content_hash": "e28240c11d8545bbdc93a6d6fb97321e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 99, "avg_line_length": 30.307692307692307, "alnum_prop": 0.6865482233502538, "repo_name": "esc/pybuilder", "id": "73fe5c928c811fe8abdc4202e20376f788a5f690", "size": "2245",...
import os, cookielib, urllib2, urllib, json, getpass from time import sleep # ################################# # ### libraries' initialization ### # ################################# urlopen = urllib2.urlopen cj = cookielib.MozillaCookieJar() Request = urllib2.Request opener = urllib2.build_opener(urllib2.HTTPCooki...
{ "content_hash": "55d278d6d0d2def39d6daa58163f7811", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 124, "avg_line_length": 32.81228668941979, "alnum_prop": 0.6301227376742251, "repo_name": "madhav123/gkmaster", "id": "def5875be5528e6d34f918fb211e39787bf797dc", "size": "...
"""settings.py Udacity conference server-side Python App Engine app user settings $Id$ created/forked from conference.py by wesc on 2014 may 24 """ # Replace the following lines with client IDs obtained from the APIs # Console or Cloud Console. WEB_CLIENT_ID = '158163602478-nakjmhtfu5nk8rdvr3podku3h98j5bhn.apps.go...
{ "content_hash": "a90025048a752964e5f0ee342c677aba", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 90, "avg_line_length": 29.4375, "alnum_prop": 0.7876857749469215, "repo_name": "mrrobeson/Project-4---Conference-App", "id": "2734e00fd25e52d0802d579116d3a48a157cb362", "si...
from mock import Mock from cushion.api import RequestBuilder, WriteDocumentRequest #test cases created using http://wiki.apache.org/couchdb/HTTP_Document_API def test_request_can_create_a_new_document_with_a_document_id(): """Test that request can create a document with a document id""" http_client = Mock() ...
{ "content_hash": "0aa7ee99b0ef8703f0874dd195d3eaaf", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 83, "avg_line_length": 25.392857142857142, "alnum_prop": 0.5879043600562588, "repo_name": "shey/cushion", "id": "a00d633b4e1b801757820e60562c50c2e7523f20", "size": "2133", ...
from fiber_properties import (baseline_image, FiberImage, plot_fft, save_plot, create_directory, plot_modal_noise, join_paths, true_path) import csv import os import numpy as np DEFAULT_NUM = 10 DEFAULT_START = 0 def image_list(folder, cam, num=10,...
{ "content_hash": "f900ca3b8d142ec91a7f1b38c66ad3ee", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 107, "avg_line_length": 43.83443708609271, "alnum_prop": 0.5627738329052727, "repo_name": "rpetersburg/fiber_properties", "id": "933441810cc74acae01f4502d234b02de8e356af", ...
import PyKDL import numpy as np import urdf_parser_py from urdf_parser_py.urdf import URDF import pykdl_utils.kdl_parser as kdl_urdf # this hack in for fixed torso_1_joint def kdl_tree_from_urdf_model_velma(urdf, js_inactive_names_vector, js_pos): segment_map = {} segment_id = 0 segment_name_id_map = {} ...
{ "content_hash": "43915139bca0f2b9ed37c364a6c790dc", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 208, "avg_line_length": 43.3475, "alnum_prop": 0.5540688621027741, "repo_name": "dseredyn/velma_scripts", "id": "fc90e4135d51062ffefb202cc9868024a53363c0", "size": "18991"...
from api import ApiManager import logging import requests logger = logging.getLogger(__name__) class RecastManager(ApiManager): def __init__(self, user_slug, bot_slug, token, language, fallback_name, strictness=50): ApiManager.__init__(self, fallback_name) self._base_url = 'https://api.recast....
{ "content_hash": "b62725b8d887153d605fc96575185a4a", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 92, "avg_line_length": 30.181818181818183, "alnum_prop": 0.5341365461847389, "repo_name": "zelros/bunt", "id": "ce03d0e297d3b343aaeb7679069f0c48abcd2574", "size": "4035", ...
""" Downloads the latest Polymer v1 iconset version for materialdesignicons.com """ import os import re import requests import sys GETTING_STARTED_URL = ('https://raw.githubusercontent.com/Templarian/' 'MaterialDesign/master/site/getting-started.savvy') DOWNLOAD_LINK = re.compile(r'(/api/downlo...
{ "content_hash": "26632d2e7ae1b71370c192ab95d4cffc", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 75, "avg_line_length": 28.967032967032967, "alnum_prop": 0.633535660091047, "repo_name": "badele/home-assistant", "id": "f7899be3964a3afacb86204ce70aa7ad65c9cf63", "size": ...
import os import sys import subprocess import shutil from setuptools import setup def _read(fn): path = os.path.join(os.path.dirname(__file__), fn) return open(path).read() def build_manpages(): # Go into the docs directory and build the manpage. docdir = os.path.join(os.path.dirname(__file__), 'doc...
{ "content_hash": "8144f557ba7288aa8e7eee69374afbf4", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 77, "avg_line_length": 28.810126582278482, "alnum_prop": 0.5331722319859402, "repo_name": "beetbox/beets", "id": "d49ed65b27e4460ca9c5c33707aa43d5bb6f8652", "size": "5223"...
from setuptools import setup import sys import versioneer # package required install_packages = ["openpyxl", # to manage excel spreadsheets ] develop_packages = ["pytest-cov", "pep8", "coverage"] print("Installing auxiclean, the following packages are required:", install_packages) if "de...
{ "content_hash": "2e347e43071c0e75710ffd92cd10a9f4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 30.115384615384617, "alnum_prop": 0.6973180076628352, "repo_name": "fgoudreault/auxiclean", "id": "7622fdf1b58ca543bc6666850ed23ae6bd9cec96", "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 'Language' db.create_table(u'people_language', ( (u'id', self.gf('django.db.models.fields.AutoField')(pri...
{ "content_hash": "48d3c44236ea3c49c76c8aa66a82d395", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 187, "avg_line_length": 70.11678832116789, "alnum_prop": 0.540807828440558, "repo_name": "ChimeraCoder/GOctober", "id": "35460ba32df99448718f4cb10cfb2b3bd269940e", "size":...
""" Starts an interactive JIRA session in an ipython terminal. Script arguments support changing the server and a persistent authentication over HTTP BASIC. """ import sys try: import configparser except: from six.moves import configparser from six.moves import input from six.moves.urllib.parse import par...
{ "content_hash": "625566d6e016657b92c5c8f6e03f348f", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 114, "avg_line_length": 34.56420233463035, "alnum_prop": 0.6015985590453675, "repo_name": "VikingDen/jira", "id": "2c2489293a489077681dd9b90cbc93c3fae2417f", "size": "8906...
""" Support for the PRT Heatmiser themostats using the V3 protocol. See https://github.com/andylockran/heatmiserV3 for more info on the heatmiserV3 module dependency. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/thermostat.heatmiser/ """ import loggin...
{ "content_hash": "d446f640f3cdea9afd302caa721394a7", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 78, "avg_line_length": 29.482142857142858, "alnum_prop": 0.6247728649303452, "repo_name": "Julian/home-assistant", "id": "2fe9f1fa0a15a5edbab91ab113484d9afb7ae181", "size"...
from tempest import auth from tempest.common import negative_rest_client from tempest import config from tempest import manager from tempest.openstack.common import log as logging from tempest.services.baremetal.v1.client_json import BaremetalClientJSON from tempest.services import botoclients from tempest.services.com...
{ "content_hash": "fdbab2cb6e1848d746021fbf59ceda54", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 79, "avg_line_length": 51.07116104868914, "alnum_prop": 0.7604869463185685, "repo_name": "afaheem88/tempest_neutron", "id": "8d5974201c10d8e1ef0704032e3e6573762d1737", "si...
from torch import nn from transformers import AutoModel, AutoTokenizer, AutoConfig, T5Config, MT5Config import json from typing import List, Dict, Optional, Union, Tuple import os class Transformer(nn.Module): """Huggingface AutoModel to generate token embeddings. Loads the correct class, e.g. BERT / RoBERTa ...
{ "content_hash": "a6fe6ba07f2640e4c29a6a1089fb6087", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 255, "avg_line_length": 47.03333333333333, "alnum_prop": 0.6433734939759036, "repo_name": "UKPLab/sentence-transformers", "id": "68d2d8f972b7f297d0f0548a1de8807998d91b73", ...
from collections import OrderedDict from copy import deepcopy from functools import partial import glob import json import os import os.path as op from pathlib import Path import shutil import tempfile import numpy as np from .io.constants import FIFF, FWD from .io._digitization import _dig_kind_dict, _dig_kind_rev, ...
{ "content_hash": "05290e85f3475dddaf17bb5638ce07cf", "timestamp": "", "source": "github", "line_count": 2427, "max_line_length": 81, "avg_line_length": 37.04903172641121, "alnum_prop": 0.5685402255388242, "repo_name": "larsoner/mne-python", "id": "ea0e516149d2675db42aa19e73da5d9761ff5d26", "size": ...
from datetime import datetime from flask.ext.restful.representations import json from sqlalchemy.orm.session import _SessionClassMethods __author__ = 'hoangnn' from flask import Blueprint, render_template, redirect, url_for, request, flash, session from flask.ext.login import current_user, login_required, login_user,...
{ "content_hash": "75023322520a9b0996a45b4422c164a9", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 88, "avg_line_length": 35.43269230769231, "alnum_prop": 0.6602442333785618, "repo_name": "hoang89/fmbone", "id": "cfb553d80e57e3811cbe6ed0de10fae6b7b18ab1", "size": "3685"...
import collections from varappx.common.genotypes import decode_int from varappx.constants.filters import ALL_VARIANT_FILTER_NAMES from varappx.main.filters.sort import Sort from varappx.models.gemini import Variants, GeneDetailed # For export to frontend _variant_genotype_expose = {0: [0,0], 1: [0,1], 2: [None,None], ...
{ "content_hash": "ba839aaca92bd4efa16c82fe589f223c", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 116, "avg_line_length": 36.57754010695187, "alnum_prop": 0.6239766081871345, "repo_name": "444thLiao/VarappX-flask", "id": "8d0bfef0f4238bd5589018fc94143b9202e9e105", "siz...
import os import shlex import six from subprocess import Popen, PIPE, STDOUT from psutil import AccessDenied, Process, TimeoutExpired from .. import logs from ..conf import settings def _kill_process(proc): """Tries to kill the process otherwise just logs a debug message, the process will be killed when thefu...
{ "content_hash": "356018a5ba559b0a0ee6134e8751f2d9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 82, "avg_line_length": 28.22222222222222, "alnum_prop": 0.6195866141732284, "repo_name": "nvbn/thefuck", "id": "b7ffe249d2397b46f6c50eb87d61797fa7a908ae", "size": "2032", ...
"""Utility functions for efficiently processing with the job API """ # pytype: skip-file from __future__ import absolute_import import json import logging from google.protobuf import json_format from google.protobuf import struct_pb2 def dict_to_struct(dict_obj): # type: (dict) -> struct_pb2.Struct try: r...
{ "content_hash": "34338108967d72d6047f28d772865337", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 64, "avg_line_length": 23.384615384615383, "alnum_prop": 0.7302631578947368, "repo_name": "iemejia/incubator-beam", "id": "7bde57735df99939df2b6e677d9578727dc0b42c", "size"...
import string import unittest import netaddr import routes import webob.exc from melange import ipv6 from melange import tests from melange.common import config from melange.common import exception from melange.common import utils from melange.common import wsgi from melange.ipam import models from melange.ipam impor...
{ "content_hash": "25ff4e9b7978afacc9271a5a64b8b13a", "timestamp": "", "source": "github", "line_count": 3057, "max_line_length": 79, "avg_line_length": 45.21033693163232, "alnum_prop": 0.52852946283862, "repo_name": "rackerlabs/melange", "id": "376cec93927e14f6cb5cf61e11d163233a67433d", "size": "13...
from threading import Thread import os class Worker(Thread): def __init__(self, file_path, verbose): Thread.__init__(self) self.done = False self.verbose = verbose self.path = file_path self.file = open(self.path, 'r') def run(self): content = self.file.read()...
{ "content_hash": "f133c1dfc175c30e56e1411e5b24ebdd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 128, "avg_line_length": 34.17142857142857, "alnum_prop": 0.4908026755852843, "repo_name": "snaiperskaya96/pRestore", "id": "8eafb1b1783e97bb2747dbcf4ed546c880289e80", "size...
import os from django.test import TransactionTestCase from django.contrib.auth.models import Group from django.conf import settings from hs_core import hydroshare from hs_core.models import BaseResource from hs_core.hydroshare.utils import resource_file_add_process, resource_file_add_pre_process from hs_core.views.ut...
{ "content_hash": "e771c68d9670e9e3a33b3971e807dd71", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 99, "avg_line_length": 51.474137931034484, "alnum_prop": 0.6690671579299949, "repo_name": "hydroshare/hydroshare", "id": "99836274fdeb1a301fb986cb83e4c14f939f9b63", "size"...
from unittest import TestCase from unittest.mock import MagicMock from pyga import Candidate from pyga import Population from pyga import Probability from pyga import Random from pyga import StringMutation class StringMutationOperatorTestCase(TestCase): def test_apply_one(self): alphabet = 'abcd' ...
{ "content_hash": "1973d07318c035d40770520c7800c9df", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 35.61538461538461, "alnum_prop": 0.6637868970482361, "repo_name": "Eyjafjallajokull/pyga", "id": "3242f311310c3e89416be6b4d33988cad2584132", "size": ...
from game.utils import config import os import logging import json import django.core.handlers.wsgi from django.conf import settings from tornado import ioloop import tornado.ioloop import tornado.web import tornado.wsgi import tornado.httpserver import django.utils.importlib import django.contrib.auth from django.con...
{ "content_hash": "4fa6f58d938fef7183f38e45ec1cc52c", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 145, "avg_line_length": 34.734375, "alnum_prop": 0.645748987854251, "repo_name": "piotrlewalski/birdstorm", "id": "61b01f8e67775aabd265f66fc736f4279b8e6b7f", "size": "4446...
from flask import Blueprint # Create Logs Blueprint logs = Blueprint('logs', __name__) from . import routes
{ "content_hash": "2820b66a102a04a277c697df72d5c2d4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 21.6, "alnum_prop": 0.7407407407407407, "repo_name": "google/co-op-4-all", "id": "7782e529f7d9b33c44cd303006cef8b8198cde17", "size": "684", "binary"...
""" Record objects for the Simple Data Package format. """ # default metadata file DEFAULT_METATAB_FILE = 'metadata.csv' LINES_METATAB_FILE = 'metadata.txt' IPYNB_METATAB_FILE = 'metadata.ipynb' from .parser import * from .exc import * from .doc import MetatabDoc from .resolver import WebResolver from pkg_resources ...
{ "content_hash": "eb4361aafabbc4d37bd3ccc975f7851f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 64, "avg_line_length": 23.523809523809526, "alnum_prop": 0.7510121457489879, "repo_name": "Metatab/metatab", "id": "e76660ea11fc7828b71b7556c76e5f34b5a2ac3e", "size": "641"...
from flask import Flask, make_response, redirect, render_template, request, url_for import names app = Flask(__name__) @app.route("/") def index(): return render_template('index.html') @app.route("/esi/content") def content(): return render_template('content.html') @app.route("/esi/status") def status(): ...
{ "content_hash": "dac8442f519c8e2dad9bfe34f16fc7e6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 83, "avg_line_length": 21.142857142857142, "alnum_prop": 0.6527027027027027, "repo_name": "shawnsi/esi-demo", "id": "b432de6e95adc668e24cc44a63ba449e2de2d0e5", "size": "763...
"""Tests for `tf.data.experimental.map_and_batch()`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math from absl.testing import parameterized import numpy as np from tensorflow.python import pywrap_sanitizers from tensorflow.python.data.experi...
{ "content_hash": "b8a4f1ec03ce2cad219f561855d87786", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 80, "avg_line_length": 39.51307847082495, "alnum_prop": 0.6471127406049496, "repo_name": "frreiss/tensorflow-fred", "id": "12c961ccac084292083626498e86cd7a1012164c", "size...
import factory from factory import SubFactory from presentation.models import Presentation from warp.users.models import User class UserFactory(factory.django.DjangoModelFactory): username = 'jellyms' email = 'chm073@sh8.email' password = 'P@$$w0rD' class Meta: model = User django_ge...
{ "content_hash": "2a5aea43c06da01a13b6fc9393bd1a4d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 61, "avg_line_length": 22.08, "alnum_prop": 0.7028985507246377, "repo_name": "SaturDJang/warp", "id": "596e0ee4bd06ae8a912af80470439455daadbdef", "size": "552", "binary":...
from pfrock_static_plugin.index import PfrockStaticPlugin __version__ = '0.2.7' __register__ = PfrockStaticPlugin
{ "content_hash": "91354cf96430dc2d9a9173be726cf88f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 57, "avg_line_length": 23.2, "alnum_prop": 0.75, "repo_name": "knightliao/pfrock", "id": "48b6b9b80db150b32b68b8f86245bb192c11ce71", "size": "116", "binary": false, "cop...
from plenum.common.batched import Batched from plenum.test.testing_utils import FakeSomething import pytest @pytest.fixture() def message_size_limit(): return 10 @pytest.fixture() def batched(message_size_limit): b = Batched(FakeSomething(MSG_LEN_LIMIT=message_size_limit, TRANSPORT_BATCH_ENABLED=True)) ...
{ "content_hash": "d9d3f98d7925ee09e8e4bc4fb5fb2757", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 94, "avg_line_length": 30.163265306122447, "alnum_prop": 0.6874154262516915, "repo_name": "evernym/zeno", "id": "ce149260e56c8e4db640fa53abe0f63dc3b8841f", "size": "1478", ...
import unittest import os import time import json import subprocess from fam.database import SyncGatewayWrapper from fam.mapper import ClassMapper from fam.tests.test_sync_gateway.config import * from fam.tests.models.acl import Car, Bike, Boat from fam.acl.writer import write_sync_function, _requirements_from_mapper f...
{ "content_hash": "a52cdf07788c5c3d09eb46223a42ec64", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 93, "avg_line_length": 31.492857142857144, "alnum_prop": 0.535268768428215, "repo_name": "paulharter/fam", "id": "3e43c032c4c4541dd7186d6cfd00cb07eaa7676b", "size": "4409"...
from .base import * DEBUG = True TEMPLATE_DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': get_secret("DATABASE_NAME"), 'USER': get_secret("DATABASE_USER"), 'PASSWORD': get_secret...
{ "content_hash": "440e6fc82611e4c71954d3badfdc97bc", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 64, "avg_line_length": 25.88235294117647, "alnum_prop": 0.6113636363636363, "repo_name": "cdDiaCo/myGarage", "id": "264446930d3fe86ade82c140538bb60ab8feb342", "size": "440"...
from __future__ import absolute_import import datetime import calendar from django.utils.timezone import utc def timestamp_to_datetime(timestamp): # type: (float) -> datetime.datetime return datetime.datetime.utcfromtimestamp(float(timestamp)).replace(tzinfo=utc) def datetime_to_timestamp(datetime_object): ...
{ "content_hash": "2645ce352a99ee7303f4d4eeea4818d5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 31.846153846153847, "alnum_prop": 0.7632850241545893, "repo_name": "ahmadassaf/zulip", "id": "1349bcbe24c630ae2624af36714a9a1abe5f7b5d", "size": "414...
import unittest from transformers import MPNetConfig, is_tf_available from transformers.testing_utils import require_tf, slow from ...test_configuration_common import ConfigTester from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask if is_tf_available(): import tensorflow...
{ "content_hash": "ca6bbc6f7132af965b975c88da478a65", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 117, "avg_line_length": 39.9390243902439, "alnum_prop": 0.64793893129771, "repo_name": "huggingface/transformers", "id": "a0a4964d57e95ae7e1eaf035bcab928477250d80", "size"...
import collections import page_sets import re from telemetry import benchmark from telemetry.core import util from telemetry.page import page_test from telemetry.timeline import async_slice as async_slice_module from telemetry.timeline import slice as slice_module from telemetry.value import scalar from measurements ...
{ "content_hash": "40fb805a69bbf5ef69a70def189285ca", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 78, "avg_line_length": 38.12935323383085, "alnum_prop": 0.7036795407098121, "repo_name": "ltilve/chromium", "id": "e9d4f095ae1861b8ba6a9998530995d4887d89e4", "size": "7827...
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer, String, ForeignKey, Float, DateTime) from sqlalchemy.orm import sessionmaker, mapper, relationship from sqlalchemy.ext.horizontal_shard import ShardedSession from sqlalchemy.sql import operators, visitors import datetime # step 2. databases ...
{ "content_hash": "bb4b0a0927e77eca52096c9c8295476c", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 104, "avg_line_length": 34.454198473282446, "alnum_prop": 0.6586905948820206, "repo_name": "simplegeo/sqlalchemy", "id": "1a39f5de32c488c1917936547a0035ebafb93869", "size"...
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "django-macaddress-ng", version = "1.1.1", url = 'http://github.com/kra3/django-macaddress', license = 'BSD', description = "MAC address model...
{ "content_hash": "2efc06e3a1da49285c3b5a146535159b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 31.806451612903224, "alnum_prop": 0.6146044624746451, "repo_name": "kra3/django-macaddress-ng", "id": "752486a472fb0f045d98f234979a6f0de3aeb0e5", "si...
import os from bdbcontrib.verify_notebook import run_and_verify_notebook from util import session from bdbcontrib.population import OPTFILE INDEX_DIR=os.path.join(os.path.dirname(os.path.dirname(__file__))) # TODO: I want to check that all the links in markup cells are non-broken. # The standard cell check only gets ...
{ "content_hash": "d4b1ea05a2872bda5ff5358d7401c70b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 77, "avg_line_length": 36.45, "alnum_prop": 0.7146776406035665, "repo_name": "probcomp/bdbcontrib", "id": "7925d40316a69e12670c5be18a986ba267087f96", "size": "1384", "bin...
"""Config flow for Traccar.""" from homeassistant.helpers import config_entry_flow from .const import DOMAIN config_entry_flow.register_webhook_flow( DOMAIN, "Traccar Webhook", {"docs_url": "https://www.home-assistant.io/components/traccar/"}, )
{ "content_hash": "a5c73f95628ab90ec73a95ac88cf2bcd", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 70, "avg_line_length": 26, "alnum_prop": 0.7192307692307692, "repo_name": "Cinntax/home-assistant", "id": "cc3f1f2372771e3e60ba1c7da775285ea87ad0b2", "size": "260", "bina...
from ex.exception import NotUnderstoodException from ex.exception import ConnectionLostException from pydub import AudioSegment import tempfile import requests import json import os class Google: """ Use the Google Speech-to-Text service to translate voice input into text so that it can be parsed by the program....
{ "content_hash": "37df5b370d376584a0b6d652c48a2e02", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 71, "avg_line_length": 27.5, "alnum_prop": 0.7230769230769231, "repo_name": "anmolks/Jarvis", "id": "39775d854a56c22c239d10c69236e404ef8b4fff", "size": "1430", "binary": ...
from __future__ import annotations import os def copy_docker_compose(app, exception): """Sphinx "build-finished" event handler.""" from sphinx.builders import html as builders if exception or not isinstance(app.builder, builders.StandaloneHTMLBuilder): return # Replace `|version|` in the do...
{ "content_hash": "c206e5fb773fdf3a7d572df8e368d039", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 38.675, "alnum_prop": 0.6528765352294764, "repo_name": "cfei18/incubator-airflow", "id": "e3e3f2d6b1b7c258545783bccd763a20b30099c3", "size": "2332",...
from nova.compute import api as compute_api from nova.db import base from nova import exception from nova.network import api as network_api from nova.network import model as network_model from nova.network import quantumv2 from nova.openstack.common import cfg from nova.openstack.common import excutils from nova.openst...
{ "content_hash": "0cee6992a7cc2a6b9ab0ec526f504e3c", "timestamp": "", "source": "github", "line_count": 765, "max_line_length": 79, "avg_line_length": 43.77908496732026, "alnum_prop": 0.5611358275357559, "repo_name": "maoy/zknova", "id": "704ed5cef8ad38878a36c80fe4998900722e7da5", "size": "34203", ...
import demistomock as demisto HTTP_REQUEST_MOCK = {'ServiceRequestId': 'ServiceRequestId', 'ServiceRequestStatus': 'ServiceRequestStatus', 'Priority': 'Priority', 'Created': {'When': {'Time': 'Time', 'Date': 'Date'}}, 'Details': 'Detai...
{ "content_hash": "2086b27ef3d5dfd864a7588143b1b505", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 121, "avg_line_length": 52.586666666666666, "alnum_prop": 0.48656186612576063, "repo_name": "VirusTotal/content", "id": "0f34f4d60ee8031cfb2f830ada6e346b4d42a088", "size": ...
""" parseli ~~~~~~~ Setup ````` $ sudo pip install . """ from distutils.core import setup import os setup( name='parseli', version='0.0.5', url='', author='mek', author_email='michael.karpeles@gmail.com', packages=[ 'parseli', ], platforms='any', sc...
{ "content_hash": "95cebfa5468e9af44d8e7caa6fa3a01b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 87, "avg_line_length": 20.193548387096776, "alnum_prop": 0.5638977635782748, "repo_name": "mekarpeles/parseli", "id": "35a9367d7d80976b0b014e3d73ec94d0508d3d84", "size": "6...
"""Metaclass infrastructure. Provides a metaclass Iterable which has the following properties: * Iterable is iterable over all classes for which it is the metaclass, provided they have not defined `_skip_iterate_'. Iterable classes (that is, classes for which Iterable is the metaclass) are iterable over their inst...
{ "content_hash": "02049bdc8829c948404d2771361adbfa", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 71, "avg_line_length": 29.59722222222222, "alnum_prop": 0.7022524636320976, "repo_name": "tectronics/yellowbox", "id": "259383b4496f62c1e73cbb67f3ba38e9c2df3eec", "size": ...
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Entry', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, ...
{ "content_hash": "6b69b8126840f0add33a66ae7a54ca5f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 26.72, "alnum_prop": 0.47904191616766467, "repo_name": "Marpop/daily-log", "id": "f53a73cd816ff48c28fec3722e6ec2cac4f33b9d", "size": "668", "binary...
""" =============================== Nearest Centroid Classification =============================== Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import pylab as pl from matplotlib.colors import ListedColormap from sklearn i...
{ "content_hash": "0819469c3767c9b4cb7fbc20fae834f2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 74, "avg_line_length": 31.839285714285715, "alnum_prop": 0.6135726303982053, "repo_name": "jmargeta/scikit-learn", "id": "0c6343b335b359f709f168c002c087dfac68db9a", "size":...
"""Facilities for printing Python objects.""" import cStringIO import difflib import json import sys from googlecloudsdk.third_party.apitools.base.py import encoding from googlecloudsdk.third_party.apitools.base.protorpclite import messages from googlecloudsdk.third_party.py27 import py27_collections as collections ...
{ "content_hash": "a438f141c96131b5d96ceb3b76a8f5bf", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 78, "avg_line_length": 28.570230607966458, "alnum_prop": 0.6444085705899618, "repo_name": "flgiordano/netcash", "id": "f200e6782d53cbf19fd266464ffc770eadfc19c3", "size": "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/hair/zabrak/shared_hair_zabrak_male_s04.iff" result.attribute_template_id = -1 result.stfName("hair_name","hair") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "e5ff601326b8b36e5d269055bf1e00ea", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 23.46153846153846, "alnum_prop": 0.6918032786885245, "repo_name": "anhstudios/swganh", "id": "fa053a1fca9d3438ae66740f639ad91ef924fc0b", "size": "450...
import pytest from tests.test_utils.amazon_system_helpers import ( AWS_DAG_FOLDER, AWS_EKS_KEY, AmazonSystemTest, provide_aws_context, ) @pytest.mark.system("amazon.aws") @pytest.mark.backend("mysql", "postgres") @pytest.mark.credential_file(AWS_EKS_KEY) class ExampleDagsSystemTest(AmazonSystemTest):...
{ "content_hash": "ebc0738646353b83e7837cda0299e41b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 30.73170731707317, "alnum_prop": 0.6880952380952381, "repo_name": "Acehaidrey/incubator-airflow", "id": "29bbe160fbae21e8e00cefa9a11ed51325c7d7a0", "...
from msrest.serialization import Model class AdditionalUnattendContent(Model): """Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied...
{ "content_hash": "1c030960421fea3ea78f9d00d5a6691d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 81, "avg_line_length": 49.5609756097561, "alnum_prop": 0.6953740157480315, "repo_name": "lmazuel/azure-sdk-for-python", "id": "ddbc9f5f506fab78f0a1c8ba2ed265ffde49eb93", "s...
""" WSGI config for wifi_attendance 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.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJA...
{ "content_hash": "1a1b63b9001aed2b6dc0a5c770f89843", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.5, "alnum_prop": 0.7745098039215687, "repo_name": "elvinzeng/wifi-attendance", "id": "2482de4a74627fb54c70c90e2fdc63d4872f11d7", "size": "408", ...
import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@prot...
{ "content_hash": "362eaa744992c5576ec25e54b99ef6b2", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 885, "avg_line_length": 51.950248756218905, "alnum_prop": 0.6607929515418502, "repo_name": "FederatedAI/FATE", "id": "e455fe959c67c35a27530cf6fe4632e8d06fb8e7", "size": "1...
from flask import Blueprint, redirect, url_for, current_app, request,\ flash, render_template, g, session, send_from_directory home = Blueprint('home', __name__) @home.route("/") @home.route("/index") @home.route("/home") def index(): return render_template("home/index.html", home="active")
{ "content_hash": "d0f55bd81183e861049cc37715554054", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 73, "avg_line_length": 31.5, "alnum_prop": 0.6571428571428571, "repo_name": "Taceor/EggZlist", "id": "4ca5a23dbf688b7a2565db832d937d52064de615", "size": "339", "binary": ...
""" Qt Model classes for widget registry. """ import bisect from xml.sax.saxutils import escape from urllib.parse import urlencode from AnyQt.QtWidgets import QAction from AnyQt.QtGui import QStandardItemModel, QStandardItem, QColor, QBrush from AnyQt.QtCore import QObject, Qt from AnyQt.QtCore import pyqtSignal as ...
{ "content_hash": "0e65c5eec61a66b6bf5b180996332a28", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 77, "avg_line_length": 30.8, "alnum_prop": 0.6293364170076499, "repo_name": "cheral/orange3", "id": "e2bbfdcc5f67b026eb55ac22e84a1bdf256f51d5", "size": "11242", "binary"...
from django.conf.urls import url from myblogapp import views urlpatterns = [ url(r'^post/(?P<slug>[^\.]+)/$', views.PostDetailView.as_view(), name='post_detail'), url(r'^tag/(?P<slug>[^\.]+)/$', views.tag_detail, name='tag_detail'), url(r'^post-list/$', views.PostListView.as_view(), name='post-list'), ...
{ "content_hash": "069a04a4b2148394d172035a3cc744ba", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 89, "avg_line_length": 41.81818181818182, "alnum_prop": 0.6108695652173913, "repo_name": "TomGijselinck/mywebsite", "id": "d95a7922a180625453d44ae8ee89a5d9ec103dca", "size"...
__version__ = '2.0a1' import os from distutils.util import strtobool from openstackx.api.connection import ApiConnection from openstackx.api.config import Config from openstackx.compute.backup_schedules import (BackupSchedule, BackupScheduleManager, BACKUP_WEEKLY_DISABLED, BACKUP_WEEKLY_SUNDAY, BACKUP_WEEKLY_M...
{ "content_hash": "bf421a1cc8a6f04958d0a38ceef2558a", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 87, "avg_line_length": 36.575, "alnum_prop": 0.6784005468215994, "repo_name": "rcbops/openstackx-buildpackage", "id": "1f0b6dfc9eed332c3016773828514797151809e0", "size": "2...
""" celery.worker.mediator ~~~~~~~~~~~~~~~~~~~~~~ The mediator is an internal thread that moves tasks from an internal :class:`Queue` to the worker pool. This is only used if rate limits are enabled, as it moves messages from the rate limited queue (which holds tasks that are allowed to be...
{ "content_hash": "c7775d7d5d6a4740ebb6b0fc38c38c35", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 30.908045977011493, "alnum_prop": 0.5593157307549275, "repo_name": "softak/webfaction_demo", "id": "ff7cbac48748f586ea495bf79e085f3412592a43", "size"...
"""JSON support for message types. Public classes: MessageJSONEncoder: JSON encoder for message objects. Public functions: encode_message: Encodes a message in to a JSON string. decode_message: Merge from a JSON string in to a message. """ __author__ = 'rafek@google.com (Rafe Kaplan)' import cStringIO import ...
{ "content_hash": "7a21cbda0b9a76c692b233eafd26446d", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 80, "avg_line_length": 29.715942028985506, "alnum_prop": 0.6614319157237613, "repo_name": "ychen820/microblog", "id": "60ed4aadc5456fc9fde0235252e5facd6972c75e", "size": "...
import re import sys MAPPING = { 'core_read.cpp': 'core_io.cpp', 'core_write.cpp': 'core_io.cpp', } # Directories with header-based modules, where the assumption that .cpp files # define functions and variables declared in corresponding .h files is # incorrect. HEADER_MODULE_PATHS = [ 'interfaces/' ] de...
{ "content_hash": "cc662d32274114f81e693dc9664d1114", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 105, "avg_line_length": 32.61538461538461, "alnum_prop": 0.605121293800539, "repo_name": "cculianu/bitcoin-abc", "id": "2edee2cad4ee713219e4a38134ed3a3dee581f2e", "size": "...
""" /images endpoint for Glance v1 API """ import copy import glance_store as store import glance_store.location from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import strutils from webob.exc import HTTPBadRequest from webob.exc import HTTPConflict from ...
{ "content_hash": "25a3281045c28bea58673e48afe31155", "timestamp": "", "source": "github", "line_count": 1258, "max_line_length": 79, "avg_line_length": 42.69793322734499, "alnum_prop": 0.5552556130617716, "repo_name": "JioCloud/glance", "id": "c0b136e5c9d5d0f6f5911ded84271f6975af5698", "size": "543...
from app.common.countries import countries from django import template register = template.Library() @register.filter def multiply(x, y): return float(x) * float(y) @register.filter def country_id_to_name(country_id): country_id = str(country_id) return countries[country_id] @register.filter def miss...
{ "content_hash": "e98ee9343ed112f725ae7e9572c23f62", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 42, "avg_line_length": 19.653846153846153, "alnum_prop": 0.6301369863013698, "repo_name": "egenerat/flight-manager", "id": "4d8610223deedcdf3331bc1d7ea2b70a3ac182a2", "size...
import os from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.digitaltwins.core import DigitalTwinsClient # Simple example of how to: # - create a DigitalTwins Service Client using the DigitalTwinsClient constructor # - list all relationships using the pagin...
{ "content_hash": "32ca904a61099c52ddd95b661bc27556", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 106, "avg_line_length": 45.6, "alnum_prop": 0.7669172932330827, "repo_name": "Azure/azure-sdk-for-python", "id": "4da7ac0470dcbc75688d9868178c2959a1b3a128", "size": "1747",...
from Util import ListRedirect class ParsedFilter(object): def __init__(self,filter): self.filter = filter def __repr__(self): return "FILTER %s"%self.filter class ParsedExpressionFilter(ParsedFilter): def __repr__(self): return "FILTER %s"%(isinstance(self.filter,ListRedirect) and...
{ "content_hash": "479a4702ebee35f464055a554ebf5324", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 105, "avg_line_length": 27.266666666666666, "alnum_prop": 0.6919315403422983, "repo_name": "alcides/rdflib", "id": "965b180d8d118b2d17f5d450e41d0d51edeecaa1", "size": "409"...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Like' db.create_table(u'catalog_like', ( (u'abstractlike_ptr', self.g...
{ "content_hash": "fdd5b29a1a4a6d82f5892ebe6284ab90", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 231, "avg_line_length": 85.1438127090301, "alnum_prop": 0.5678372220912876, "repo_name": "Makeystreet/makeystreet", "id": "f00d78e2dbc9cbf19de7dc0be00cb21c455dc311", "size...
from typing import Pattern, Dict from recognizers_text.utilities import RegExpUtility from recognizers_number.number.extractors import BaseNumberExtractor from recognizers_number.number.parsers import BaseNumberParser from recognizers_number.number.french.extractors import FrenchCardinalExtractor from recognizers_numb...
{ "content_hash": "b1abe1a867f03602d7f212b2fb3ad7c4", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 119, "avg_line_length": 38.43055555555556, "alnum_prop": 0.7202746657029273, "repo_name": "matthewshim-ms/Recognizers-Text", "id": "8f6bfe543a6108f495ed2faa5d2d4b96ebc2da61",...
from fabric.api import * from fabric.colors import * env.roledefs = { 'production': [], 'staging': [], } @task def install(): local('createdb {{ cookiecutter.repo_name }}') local('python manage.py migrate') local('python manage.py load_initial_data') with settings(warn_only=True): b...
{ "content_hash": "046125a99bc688f67d38a1420e88bbab", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 77, "avg_line_length": 28.46153846153846, "alnum_prop": 0.6736486486486486, "repo_name": "niceguydave/wagtail-cookiecutter-foundation", "id": "3fe4a92ec6e522a280332945f447dae...
import numpy as np from quadpy.helpers import get_all_exponents def check_degree(quadrature, exact, dim, max_degree, tol): exponents = get_all_exponents(dim, max_degree) # flatten list exponents = np.array([item for sublist in exponents for item in sublist]) flt = np.vectorize(float) exact_vals ...
{ "content_hash": "f48301a03012dd794ae41b652c861207", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 86, "avg_line_length": 33.738853503184714, "alnum_prop": 0.5229375117991316, "repo_name": "nschloe/quadpy", "id": "00bb69af29896273b85377fdb94ba24703426cfd", "size": "5297...
from pysync_redmine.repositories.redmine import RedmineRepo from pysync_redmine.repositories.ganttproject import GanttRepo class RepoFactory: @staticmethod def create(class_key): if class_key == 'RedmineRepo': return RedmineRepo() if class_key == 'GanttRepo': return G...
{ "content_hash": "88e62d2fabd0c764141c2302be8ecd3b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 62, "avg_line_length": 25.46153846153846, "alnum_prop": 0.6827794561933535, "repo_name": "sruizr/pysync_redmine", "id": "a50c02b085c3d8bfb49cfcbb6edf260357815d3b", "size": ...
from keras.models import Model from keras.layers.core import Flatten, Dense, Dropout, Activation, Lambda from keras.layers.recurrent import SimpleRNN from keras.layers.convolutional import Convolution2D from keras.layers.pooling import AveragePooling2D, GlobalAveragePooling2D from keras.layers import Input, merge from ...
{ "content_hash": "a669879b84131d903fec2e124331e530", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 79, "avg_line_length": 34.955555555555556, "alnum_prop": 0.5791481246026701, "repo_name": "ChampionZP/DeepLearningImplementations", "id": "bb53ffe05a8f4129639a8e74608bd6ac58...
""" sentry.web.frontend.admin ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import datetime import logging import pkg_resources import sys import uuid from django.conf import settings from django.core.context_proc...
{ "content_hash": "d908af60472dbd1d8f12594536ca3bbc", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 111, "avg_line_length": 29.973045822102424, "alnum_prop": 0.6055755395683453, "repo_name": "SilentCircle/sentry", "id": "5a1ba81b9cfe35ed9ddcecef7bd6604ba3ecc59a", "size":...
import sys from lldb import LLDB_INVALID_ADDRESS from lldb import SBValue, SBData, SBError from lldb import eBasicTypeLong, eBasicTypeUnsignedLong, eBasicTypeUnsignedChar, eBasicTypeChar ################################################################################################################# # This file conta...
{ "content_hash": "5f10f1a839c5f2c487fead356e6edbbe", "timestamp": "", "source": "github", "line_count": 707, "max_line_length": 114, "avg_line_length": 33.96181046676096, "alnum_prop": 0.6045978926325434, "repo_name": "Undin/intellij-rust", "id": "f067e253b73d70f6865e5607b381035db89e2182", "size": ...
import hashlib from urllib.parse import urlencode from allauth.account.models import EmailAddress from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class FrontierAccount(ProviderAccount): def get_profile_url(self): ...
{ "content_hash": "3b79dbe60dc4418a981201334b39f2eb", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 78, "avg_line_length": 28.20689655172414, "alnum_prop": 0.6069682151589242, "repo_name": "rsalmaso/django-allauth", "id": "94a3546403ccfdd454e83c79d2d8ac380740de57", "size"...
from django.test import TestCase from unittest2 import skipIf from django.db import connection from time import sleep from multiprocessing import Process import json import re import os from sqlshare_rest.util.db import get_backend, is_mssql, is_mysql, is_sqlite3, is_pg from sqlshare_rest.dao.query import create_query ...
{ "content_hash": "fa4607d93050e653c38cbf5cf4c51706", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 139, "avg_line_length": 37.16867469879518, "alnum_prop": 0.5927066450567261, "repo_name": "uw-it-aca/sqlshare-rest", "id": "b6f22182fe9f69c3303665c8a287489beb547b8e", "siz...
"""A middleware class to support logging of interactions with logged in users.""" import traceback #import datetime from django.core.signals import got_request_exception from django.dispatch.dispatcher import receiver import re # Filter out requests to media and site_media. from apps.managers.log_mgr import log_mgr ...
{ "content_hash": "4f9e0d4cb093d8e481345287f23c45cb", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 33.27272727272727, "alnum_prop": 0.6823770491803278, "repo_name": "jtakayama/ics691-setupbooster", "id": "c3bacf9e9400ebf4bf31004fed129e096ed73d3e", ...
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: Huan Yu <huanyu@tencent.com> # Feng Chen <phongchen@tencent.com> # Yi Wang <yiwang@tencent.com> # Chong Peng <michaelpeng@tencent.com> # Date: October 20, 2011 """ This is the scons rules genearator module which invokes al...
{ "content_hash": "acd5c4579c9d8996998b71babb55b98e", "timestamp": "", "source": "github", "line_count": 637, "max_line_length": 119, "avg_line_length": 42.409733124018835, "alnum_prop": 0.5861188228761799, "repo_name": "huahang/typhoon-blade", "id": "b92cc5d04987a718aeada2f4b5c1a5bb012ed6ca", "size...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('voucher', '0007_auto_20181115_1953'), ] operations = [ migrations.AlterModelOptions( name='voucher', options={'get_latest_by': 'date_created', 'ordering': ['-date_cr...
{ "content_hash": "87938dcdbbf80056fdff8ecacc944478", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 153, "avg_line_length": 37.71052631578947, "alnum_prop": 0.584089323098395, "repo_name": "django-oscar/django-oscar", "id": "395858948afc064145740dae7077a7e5fe6a63bb", "siz...
import io import os import sys from path import Path def common_setup(app): app.add_stylesheet('custom.css') app.add_javascript('custom.js') app.add_javascript('https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.js') app.add_javascript('https://cdn.rawgit.com/showdownjs/showdow...
{ "content_hash": "27df67981c28f0742f9a6461d2223c6f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 103, "avg_line_length": 29.32456140350877, "alnum_prop": 0.6718516302722106, "repo_name": "tylerbutler/Office-Online-Test-Tools-and-Documentation", "id": "ebc7dc004d1ff8b4ad...
def to_integer(value, default=None): try: return int(value) except: return default
{ "content_hash": "f82e73aafa3dd31d887beba2a344a5e2", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 36, "avg_line_length": 21.4, "alnum_prop": 0.5981308411214953, "repo_name": "fuzeman/stash.py", "id": "33de42f680d168deb247e36024f9f57585ed220e", "size": "107", "binary": ...
import unittest import test.all_tests import sys,os sys.path.insert(0, os.path.dirname(__file__)+"/oneserver") testSuite = test.all_tests.create_test_suite() text_runner = unittest.TextTestRunner().run(testSuite)
{ "content_hash": "7305ba25f6d3a91e51869f93fb409926", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 30.571428571428573, "alnum_prop": 0.7616822429906542, "repo_name": "1Server/OneServer", "id": "3d15fa71b2fa04243decc8b6e9ef3c39d591163a", "size": "236...
import threading from typing import Generic, TypeVar, Callable, Optional _Client = TypeVar("_Client") _MAX_CLIENT_USES = 75 # GRPC channels are limited to 100 concurrent streams. class ClientCache(Generic[_Client]): _ClientFactory = Callable[[], _Client] _factory: _ClientFactory _latest: Optional[_Clie...
{ "content_hash": "cdd2bac82c8e2614d7f2a599801a5e76", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 29.535714285714285, "alnum_prop": 0.6082224909310762, "repo_name": "googleapis/python-pubsublite", "id": "6221e8881d3879ca2fee6b1f8900acca98da1cd3", ...
""" WSGI config for signpi 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTIN...
{ "content_hash": "0a4d0157cdc5b067f8c5e191b195a324", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.3125, "alnum_prop": 0.7686375321336761, "repo_name": "canance/signpi-server", "id": "1e7062923fb615994ca54acfd778a46f731f962b", "size": "389", "...