text
stringlengths
4
1.02M
meta
dict
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, Resourc...
{ "content_hash": "d488a232e49deb6acc819af0e043e6ef", "timestamp": "", "source": "github", "line_count": 914, "max_line_length": 264, "avg_line_length": 48.7691466083151, "alnum_prop": 0.6522938867077959, "repo_name": "Azure/azure-sdk-for-python", "id": "28205c6250ea568f9de842ccabac2c6375097994", "s...
from frappe.model.document import Document class WorkflowActionMaster(Document): pass
{ "content_hash": "5c2af89d8bf97a11530c6a4e018f7fe1", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 42, "avg_line_length": 17.8, "alnum_prop": 0.8314606741573034, "repo_name": "frappe/frappe", "id": "95c7aa7cee704624e0a3a5385e1c832bcce4252f", "size": "177", "binary": fal...
''' DEMONYMS FUNCTIONS OF MAI-ANLP DEMONYM PROJECT AUTHORS: DAVID SANCHEZ & ALEX PARDO ''' # IMPORTS import csv import re from string import * import sys from nltk import * import locale from wikitools import wiki from wikitools import api from wikitools import page from wikitools import category import nump...
{ "content_hash": "1adc0d88f4efb509aa2676a5c01e2513", "timestamp": "", "source": "github", "line_count": 436, "max_line_length": 197, "avg_line_length": 29.889908256880734, "alnum_prop": 0.5950736648250461, "repo_name": "alex-pardo/ANLP-PROJECT", "id": "063c29df5f6be0f3323433e35ab05130f62366e5", "si...
import os import numpy as np import json import itertools from collections import defaultdict from scipy.optimize import linear_sum_assignment from ..utils import TrackEvalException from ._base_dataset import _BaseDataset from .. import utils from .. import _timing class TAO_OW(_BaseDataset): """Dataset class for...
{ "content_hash": "8f0d67030a40cea6590374d529fdbcfe", "timestamp": "", "source": "github", "line_count": 652, "max_line_length": 120, "avg_line_length": 52.035276073619634, "alnum_prop": 0.5707548560143838, "repo_name": "JonathonLuiten/TrackEval", "id": "40f80d7876ed9f27fb108b732315c4f8c6fc0984", "s...
import os hostname = "www.google.com" #example response = os.system("ping -c 1 " + hostname) #and then check the response... if response == 0: print (hostname, 'is up!') else: print (hostname, 'is down!')
{ "content_hash": "478d0cfacf65a142a317e4b28e021f33", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 45, "avg_line_length": 21.1, "alnum_prop": 0.6587677725118484, "repo_name": "mikestebbins/openapsdev", "id": "e17754fa2e89e952fdaaa2b8af14dbf738d6278a", "size": "439", "b...
from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest i...
{ "content_hash": "43f191bf4cc5294d1ed731939db8233c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 55, "avg_line_length": 29.224489795918366, "alnum_prop": 0.6075418994413407, "repo_name": "disqus/disqus-python", "id": "61dfdd89ee6ed944cf64c9b004fb8bf3fbc95c9c", "size": ...
from __future__ import annotations import datetime as dt import html import random import re import typing as t import aiosql import bbcode from htmlslacker import HTMLSlacker from psycopg2.extensions import connection from gargbot_3000 import config forum_queries = aiosql.from_path("sql/post.sql", "psycopg2") msn_...
{ "content_hash": "2850635700b4d97e8d881cdf834d813a", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 87, "avg_line_length": 33.262135922330096, "alnum_prop": 0.5846468184471687, "repo_name": "eirki/gargbot_3000", "id": "b704c2179ef54c74b3da924e6f2bec891b8839a9", "size": "...
import BaseHTTPServer import json import urlparse __author__ = 'umairghani' class SimpleTCPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """ Base class for HTTP request handler """ def do_GET(self): """ Handle the HTTP GET request :return: Serve a GET request ...
{ "content_hash": "b5c8c31ca587cd43d9050e19b70afb05", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 28.95959595959596, "alnum_prop": 0.5235437739797698, "repo_name": "umairghani/py-jrpc", "id": "d0f2a51af665dd2c30b43137d71879d0276660ac", "size": "28...
''' Created on 10 nov 2014 @author: rogerlarsson The MIT License (MIT) Copyright (c) 2014 rogerlarsson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without lim...
{ "content_hash": "4fee8c1ff7563691edbdb19fef4029eb", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 34.26086956521739, "alnum_prop": 0.7315989847715736, "repo_name": "rogerlarsson/passwordGenerator", "id": "a5e5729b1bdca696b8421547e4cd5cdaf57eab9f", ...
from __future__ import absolute_import from collections import OrderedDict from re import compile as re_compile from sys import version_info from unicodedata import category from .compat import ustr if version_info >= (3,): number = (int, float) string = (bytes, str) unicode = str unichr = chr else:...
{ "content_hash": "160c911240c538fa1d9e8b61821e3a41", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 125, "avg_line_length": 34.2246835443038, "alnum_prop": 0.5815071659731854, "repo_name": "technige/cypy", "id": "95fa772c12f483931bf5849c83d4a515f3daa509", "size": "11441"...
import m5 from m5.objects import * from m5.defines import buildEnv from .Ruby import create_topology def define_options(parser): parser.add_argument("--chi-config", action="store", type=str, default=None, help="NoC config. parameters and bindings. " ...
{ "content_hash": "05edff0657b3f887aa163cfa3434dc9a", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 79, "avg_line_length": 37.24242424242424, "alnum_prop": 0.643728931767988, "repo_name": "gem5/gem5", "id": "c94dc943f9ea424660435c815a3a57cd888d8ba3", "size": "10673", "...
from django.conf.urls import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^fake-login$', 'tests.views.fake_login', name='sentry-fake-login'), url(r'^trigger-500$', 'tests.views.raise_exc', name='sentry-raise-exc'), ...
{ "content_hash": "42ba748e9f11ec6bf23eb7e1a83b24e1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 104, "avg_line_length": 49.666666666666664, "alnum_prop": 0.6859060402684564, "repo_name": "primepix/django-sentry", "id": "2a45d69b6b8b8530923f49d336468fc8426dfdf8", "size...
r"""Infers detections on a TFRecord of TFExamples given an inference graph. Example usage: ./infer_detections \ --input_tfrecord_paths=/path/to/input/tfrecord1,/path/to/input/tfrecord2 \ --output_tfrecord_path_prefix=/path/to/output/detections.tfrecord \ --inference_graph=/path/to/frozen_weights_inferenc...
{ "content_hash": "648cdafc4c4ce1cd4d7ee838ae25817f", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 43.58536585365854, "alnum_prop": 0.682988248461108, "repo_name": "cshallue/models", "id": "a251009ef0d415e08395be038dbc4ed42d804ff7", "size": "4263",...
import numpy as np def load(fileno, training=True): """ takes the training file no and return training and test data Ex. fileno = 1 for u1.base and u1.test fileno = 5 for u5.base and u5.test """ # userid songid user-rating basedir = "ml-100k/u%s." % (fileno) with open(basedir + 'bas...
{ "content_hash": "10f6e4e4a12112b3a62a35e1eb6d0aea", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 64, "avg_line_length": 34.31818181818182, "alnum_prop": 0.5947019867549669, "repo_name": "chandan5/Music-Recommendation-System", "id": "cc928a49d6fcaec0d7c9bef8876f3cb8a7e5b1...
import hackarena.constants from hackarena.constants import Classes from hackarena.game_objects import BaseGameObject class Player(BaseGameObject): def __init__( self, username, character_class, team, hp=0, last_death=0, ): self.MAX_HP = Classes.MAX_HP[c...
{ "content_hash": "709383255985cde0704662dba94cdacc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 88, "avg_line_length": 30.580645161290324, "alnum_prop": 0.6170886075949367, "repo_name": "verekia/hackarena", "id": "8ea08fd6b1ed9b9ae2942e6f142e280e71f6bc8b", "size": "97...
import logging import numpy as np import paddle __all__ = [] def _simple_network(): """ Define a simple network composed by a single linear layer. """ input = paddle.static.data( name="input", shape=[None, 2, 2], dtype="float32" ) weight = paddle.create_parameter( shape=[2, 3...
{ "content_hash": "e40a57985bf2ec5ef6a601f049c4d888", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 161, "avg_line_length": 32.37074829931973, "alnum_prop": 0.5953556793107072, "repo_name": "luotao1/Paddle", "id": "c9cc1bb7a49e274e45f4ed07803ea21e6f416ada", "size": "1012...
from __future__ import unicode_literals import frappe import os, base64, re import hashlib import mimetypes from frappe.utils import get_hook_method, get_files_path, random_string, encode, cstr, call_hook_method, cint from frappe import _ from frappe import conf from copy import copy from six.moves.urllib.parse import ...
{ "content_hash": "e85369653effb60a34e3692da77f85d2", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 130, "avg_line_length": 31.303896103896104, "alnum_prop": 0.6913375373382011, "repo_name": "maxtorete/frappe", "id": "822b63e240ca96384eda2c04dbdb633e95977b26", "size": "1...
"""Tests for normalization layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python import keras from tensorflow.python.keras import testing_utils from tensorflow.python.platform import test class Normalization...
{ "content_hash": "e5e0ce9ebe66608892b9a741271e958b", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 80, "avg_line_length": 34.61943319838057, "alnum_prop": 0.6123260437375746, "repo_name": "girving/tensorflow", "id": "ff705183ef1aa5298030c0dbd630c23baffb4203", "size": "9...
from nose.tools import * # flake8: noqa from urlparse import urlparse from framework.auth.core import Auth from website.models import NodeLog from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase from tests.factories import ( ProjectFactory, RegistrationFactory, AuthUserFact...
{ "content_hash": "51f41fc56df5d55d724115c5f21d6f50", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 128, "avg_line_length": 42.01449275362319, "alnum_prop": 0.5458532498891243, "repo_name": "haoyuchen1992/osf.io", "id": "34ac186da35bf571f0edf28ccbf40eb530ffdfc2", "size":...
import sys import os import shlex from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer from pygments.lexers.data import YamlLexer from pygments.lexers.data import JsonLexer from pygments.lexers.templates import TwigHtmlLexer from pygments.lexers.templates import CheetahHtmlLexer lexers['php...
{ "content_hash": "34fed612f46fcd67b67f308b3f368665", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 89, "avg_line_length": 28.362068965517242, "alnum_prop": 0.7319148936170212, "repo_name": "robfrawley/polymer-bundle", "id": "7da22bf619b5608c583f53d332be0216bd9ba372", "si...
from django.conf import settings FTS_BACKEND = getattr(settings, 'FTS_BACKEND', 'simple://')
{ "content_hash": "810708f051cff3e91a8414f00f3deb9f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 59, "avg_line_length": 32.333333333333336, "alnum_prop": 0.711340206185567, "repo_name": "ryszard/django-fts", "id": "04c854fa63a903de2272fa4df8aa7c642b16d8bc", "size": "97"...
import collections import time import pytest import requests import verta from verta.dataset import Path class TestMetadata: def test_description(self, client, created_entities, strs): first_desc, second_desc = strs[:2] dataset = client.create_dataset(desc=first_desc) created_entities.a...
{ "content_hash": "999998957b9f97a2110c3656871036ef", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 96, "avg_line_length": 36.66, "alnum_prop": 0.6330241862156756, "repo_name": "mitdbg/modeldb", "id": "713fa6f362ce22bb3f16ed91021229b10f14ef82", "size": "5499", "binary"...
import logging import logging.handlers import os import shutil import sys import time import traceback from argparse import ArgumentParser from collections import defaultdict from Bio import Entrez, SeqIO # Parse command-line def parse_cmdline(args): """Parse command-line arguments""" parser = ArgumentParser...
{ "content_hash": "0521a6aa33c6b0b688e858d1ba579611", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 79, "avg_line_length": 41.11400651465798, "alnum_prop": 0.5964189510378703, "repo_name": "widdowquinn/scripts", "id": "7979ea142a14815de65c8cb0bf02470194a6079f", "size": "...
from oslo_config import cfg from dragonflow._i18n import _ df_snat_app_opts = [ cfg.BoolOpt('enable_goto_flows', default=True, help=_("Enable install of common goto flows to ingress/egress " "NAT tables or re-use goto flows installed by " ...
{ "content_hash": "69ed4ae0afbc19ac151a396951b99dc2", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 79, "avg_line_length": 30.391304347826086, "alnum_prop": 0.5851216022889842, "repo_name": "openstack/dragonflow", "id": "a6ae786baf3aa54b3a264e50166fb915825bb75e", "size": ...
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import Normalizer from .data import StandardScaler from .data import add_dummy_feature ...
{ "content_hash": "85a0777d22506f7a0e84cfda60e908b6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 68, "avg_line_length": 22.674418604651162, "alnum_prop": 0.7323076923076923, "repo_name": "treycausey/scikit-learn", "id": "5585a976a83a30e4544e28e6db56525c4954bafd", "size...
""" Todoist to Airmail """ #!/usr/bin/python # encoding: utf8 import sys import os from workflow import Workflow3 from Foundation import * from ScriptingBridge import * __version__ = '1.0.0' LOG = None API_KEY = None def create_task(content): """ """ todo = todoist.TodoistAPI(API_KEY) if not wf....
{ "content_hash": "f40ca278baad650a981e04e668326cc8", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 100, "avg_line_length": 21.625, "alnum_prop": 0.6017983301220295, "repo_name": "markgrovs/alfred-airmail-to-todoist", "id": "1d276de26e8cbdd346565361f40d6cf60243ec4f", "siz...
from datetime import datetime import pytest import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy_norm import Normalizable @pytest.fixture def User(Base): class User(Base, Normalizable): __tablename__ = 'users' id = sa.Column(...
{ "content_hash": "4f388a9144049c63d4ef36c283098543", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 78, "avg_line_length": 31.21764705882353, "alnum_prop": 0.5939325419257584, "repo_name": "haruair/sqlalchemy-norm", "id": "1920aa8a699f9383aabcfe9ea2d062cfb434ab2d", "size...
import amazon from setuptools import setup, find_packages try: long_description=open('READMxE.md', 'r').read() except IOError: long_description="" setup(name='python-amazon-simple-product-api', version=amazon.__version__, description="A simple Python wrapper for the Amazon.com Product Advertising A...
{ "content_hash": "57fb54c2fe8b019ed5962eb3c8441da8", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 87, "avg_line_length": 38.38095238095238, "alnum_prop": 0.6228287841191067, "repo_name": "yoavaviram/python-amazon-simple-product-api", "id": "1b77dcd42797aa31c63b1e84f34607a...
import os import random import string from ..models import ServerListResult from ..models import Server from ..models import MailosaurException class ServersOperations(object): """ServersOperations operations. """ def __init__(self, session, base_url, handle_http_error): self.session = session ...
{ "content_hash": "8efddeef663223e9cdf1d6951b42b2e2", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 104, "avg_line_length": 30.869565217391305, "alnum_prop": 0.6004024144869216, "repo_name": "mailosaur/mailosaur-python", "id": "123277310be6a2a875336772aaf668dbb9578e1b", ...
import datetime from time import sleep from flask import Flask import model from model import db EXECUTOR_TIMEOUT_MINS = 1 def reset_overdue_runs(): """give overdue runs another chance""" runs = model.Run.query.filter(model.Run.finished_execing_time == None)\ .filter(model.Run.started_execing...
{ "content_hash": "6331c23e351e9de44a4ea346993958f4", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 76, "avg_line_length": 27.113636363636363, "alnum_prop": 0.597652975691534, "repo_name": "spacetag/code_court", "id": "c7674665871390a5660b3a7fbbd1c16a612d90fc", "size": "1...
import os import shlex from oslo_config import cfg from oslo_privsep import priv_context from neutron._i18n import _ from neutron.common import config EXTERNAL_PROCESS_OPTS = [ cfg.StrOpt('external_pids', default='$state_path/external/pids', help=_('Location to store child pid file...
{ "content_hash": "a0876a0f85474ff28fc43433f2214a48", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 79, "avg_line_length": 34.89795918367347, "alnum_prop": 0.6004678362573099, "repo_name": "huntxu/neutron", "id": "34027f99366ff019a8a5ed6051fa8a57e0366f2f", "size": "9186"...
import pandas as pd import numpy as np import os from a02a_word_count_evaluation import clean_text from a01c_feature_engineering import tokenize_and_stem from unidecode import unidecode from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from sklearn.metr...
{ "content_hash": "260512a4c02f2791d3df0156e5b27abc", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 101, "avg_line_length": 30.548571428571428, "alnum_prop": 0.6041900486344931, "repo_name": "Iolaum/Phi1337", "id": "a1bc515ecbe89b7955e2cd5d86af456ac50758e7", "size": "534...
''' Created on 13.07.2015 @author: Aaron Klein ''' import DIRECT import numpy as np from robo.maximizers.base_maximizer import BaseMaximizer class Direct(BaseMaximizer): def __init__(self, objective_function, X_lower, X_upper, n_func_evals=400, n_iters=200): """ Interface for...
{ "content_hash": "192326a01a0af5d8423d1685d0a5ffb7", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 28.76271186440678, "alnum_prop": 0.5380082498526813, "repo_name": "aaronkl/RoBO", "id": "584f30679f663076ad0657fdf7f29a7abc8de86a", "size": "1697", ...
"""mod_vnflcm_subscription Revision ID: d25c7c865ce8 Revises: 2c5211036579 Create Date: 2020-10-15 14:27:04.946002 """ # revision identifiers, used by Alembic. revision = 'd25c7c865ce8' down_revision = '2c5211036579' from alembic import op import sqlalchemy as sa from tacker.db import types from tacker.db import m...
{ "content_hash": "ae47a4d33c73dfc2d8b37da8b3e478bf", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 75, "avg_line_length": 31.28787878787879, "alnum_prop": 0.6430992736077482, "repo_name": "openstack/tacker", "id": "ff144d75fe38a914cf18608dc3bc2141d7fb1094", "size": "2702...
""" Views which allow users to create and activate accounts. """ from django.shortcuts import redirect from django.shortcuts import render_to_response from django.template import RequestContext from registration.backends import get_backend def activate(request, backend, template_name='registration/ac...
{ "content_hash": "22b0b73886cc6f1859143a69d52f3c59", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 88, "avg_line_length": 36.229268292682924, "alnum_prop": 0.6562542076208429, "repo_name": "jnns/django-registration", "id": "9fef172b36733833e03c7ab65fdf127b13c28cd7", "si...
def not_a_filter(data): return data
{ "content_hash": "2049b59de7619e190690bcb68eeb749e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 23, "avg_line_length": 10.5, "alnum_prop": 0.6428571428571429, "repo_name": "jstacoder/flask-manage", "id": "abc718f2cf8b02e8ece9d995c9f3db0f38202b3a", "size": "97", "bina...
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_AUTOML_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, provide_gcp_context, skip_gcp_system from tests.test_utils.system_tests_class import SystemTest @skip_gcp_system(GCP_AUTOML_KEY, require_local_executor=True, long_lasting=T...
{ "content_hash": "0d7257b78be5e580adc8fc3813b66a67", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 102, "avg_line_length": 47, "alnum_prop": 0.7759699624530664, "repo_name": "wileeam/airflow", "id": "e54f7f694888d7b23b5cfaf33f479db9c2f48dd9", "size": "1588", "binary": ...
"""GATK variant calling -- HaplotypeCaller and UnifiedGenotyper. """ from distutils.version import LooseVersion import toolz as tz from bcbio import bam, broad, utils from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import config_utils from bcbio.pipeline.shared import subset_variant_reg...
{ "content_hash": "7f402d3defdf1adfd8c85406b2e8372c", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 110, "avg_line_length": 48.79047619047619, "alnum_prop": 0.5988678508686317, "repo_name": "guillermo-carrasco/bcbio-nextgen", "id": "fdee8fe6b9101a89ffaebdd22d2d335c3a723de3...
""" __built_traceability_for_rule_MDL.py_____________________________________________________ Automatically generated AToM3 Model File (Do not modify directly) Author: levi Modified: Sat Aug 24 20:49:41 2013 _________________________________________________________________________________________ """ from stickylink i...
{ "content_hash": "ff3a493f4132d7239e0d240cf6b645b2", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 747, "avg_line_length": 57.01634877384196, "alnum_prop": 0.6277180406212665, "repo_name": "levilucio/SyVOLT", "id": "4b2c91a4546fce4c0c68363d4eee1062089b1aa8", "size": "20...
a = r'''this is some more stuff
{ "content_hash": "8aa2b57bf9c3ae1893560aab09e39edf", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 20, "avg_line_length": 11, "alnum_prop": 0.6363636363636364, "repo_name": "ArcherSys/ArcherSys", "id": "f0df304376c361c0f0250b0449b8c580d4eacf2b", "size": "33", "binary": ...
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def template_test(): return render_template("template.html", my_string="Wheeee!", my_list=[0, 1, 2, 3, 4, 5], my_dict=dict(name="Nitin", ...
{ "content_hash": "0d3a553800d490297cca550694d2e857", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 119, "avg_line_length": 27.928571428571427, "alnum_prop": 0.45012787723785164, "repo_name": "nitin-cherian/LifeLongLearning", "id": "37ac079237fec14c672e5adf35f12dd8d17163d7"...
"""Serves content for "script" handlers using the Java runtime.""" import google import os import os.path import threading from google.appengine.api import appinfo from google.appengine.tools.devappserver2 import http_runtime from google.appengine.tools.devappserver2 import instance from google.appengine.tools.devap...
{ "content_hash": "dc5fd0b12c704ca9717c17603083864f", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 80, "avg_line_length": 35.57142857142857, "alnum_prop": 0.6772088353413654, "repo_name": "yencarnacion/jaikuengine", "id": "6b4d31965e4b12438e2bc700a064b782b2f94ca4", "siz...
import os, sys from django.core.management import execute_manager # dirty hack to get the backend working. #sys.path.insert(0, os.path.abspath('./..')) #sys.path.insert(0, os.path.abspath('./../..')) #example_dir = os.path.dirname(__file__) #sys.path.insert(0, os.path.join(example_dir, '..')) try: import settings #...
{ "content_hash": "182d4a51fe559fa3098b95c5fb2e80e5", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 299, "avg_line_length": 47.9375, "alnum_prop": 0.7001303780964798, "repo_name": "aparo/django-elasticsearch", "id": "fb48d9fbcdcd240f56e16fff13999be742d0e8c5", "size": "789...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize( {'learn_W': True, 'bias_term': False, 'bias_shape':...
{ "content_hash": "d1b1620bff13887073ce1bef308c49c7", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 78, "avg_line_length": 32.11971830985915, "alnum_prop": 0.5698311773733831, "repo_name": "pfnet/chainer", "id": "bd75690deedaff8fc647fa51a433fbc4d029e534", "size": "4561",...
import pytest import numpy as np import sklearn.datasets as datasets import sklearn.cluster as cluster import sklearn.preprocessing as pp import sklearn.metrics as m import pandas_ml as pdml import pandas_ml.util.testing as tm class TestCluster(tm.TestCase): def test_objectmapper(self): ...
{ "content_hash": "c828ccc8b27d48a488e343648cf25905", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 90, "avg_line_length": 40.18650793650794, "alnum_prop": 0.6283203317863139, "repo_name": "sinhrks/expandas", "id": "c992a8f45baf5fa92a8cce1b73b9321c2751f3c3", "size": "101...
import json from django.contrib.auth.models import Group from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404 from django.template.response import TemplateResponse from . import models from .utils import Form def form(request, form_slug, data=None): form_spec...
{ "content_hash": "538386da80390e21e57a44adea05ffd7", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 82, "avg_line_length": 31.353846153846153, "alnum_prop": 0.6766437684003925, "repo_name": "Kvoti/ditto", "id": "509e9607471e43bbb4ac9d8ae039313bfabb0207", "size": "2038", ...
from __future__ import print_function import os from django.db.models.fields import SlugField import re from django.template.loader import get_template from django.template import Context class Baker(object): """ Given a dictionary of apps and models, Baker will bake up a bunch of files that will help get...
{ "content_hash": "2ebe5f5dfd17ea20eab8a4cfeb2859be", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 119, "avg_line_length": 49.348684210526315, "alnum_prop": 0.564591387814958, "repo_name": "ojengwa/django-baker", "id": "ff04ef3142f9cd91616e6d4b29563996ad52d04b", "size":...
""" Created on Mon Dec 14 22:25:49 2016 Preprocessing Utilities for cleaning and processing of data @author: Rupak Chakraborty """ import pandas as pd from nltk.corpus import stopwords import string from nltk.stem import PorterStemmer stopword_list = set(stopwords.words("english")) punctuation_list = list(string.pun...
{ "content_hash": "bcd5d1f1261ba323bb35532b8fc86126", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 204, "avg_line_length": 22.375598086124402, "alnum_prop": 0.61434833743184, "repo_name": "rupakc/Kaggle-Compendium", "id": "1e3f166073469fa7fb4a77b5a2aca897df8ad907", "siz...
import numpy as np from dipy.reconst.dti import (design_matrix, decompose_tensor, from_lower_triangular, lower_triangular) from dipy.reconst.vec_val_sum import vec_val_vect from dipy.core.ndindex import ndindex import scipy.optimize as opt # ---------------------------------------------...
{ "content_hash": "d7fd9bf8b36e9e461130085bf0e559ae", "timestamp": "", "source": "github", "line_count": 709, "max_line_length": 79, "avg_line_length": 40.44428772919605, "alnum_prop": 0.5873757628596338, "repo_name": "RafaelNH/Reproduce-Hoy-et-al-2014", "id": "f9f395aa27445a09952db3646778c14cd1254c01...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "2b57cf15c04978f125bdee9f27c3e383", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 571, "avg_line_length": 42.92714025500911, "alnum_prop": 0.5671489795052403, "repo_name": "napalm-automation/napalm-yang", "id": "9fe7cf3e42e99b8c3d8d9c7d3f48467d68dad8e1", ...
import Command import recalboxFiles from generators.Generator import Generator import advMameControllers import shutil import os.path class AdvMameGenerator(Generator): # Main entry of the module def generate(self, system, rom, playersControllers): romName = os.path.basename(os.path.splitext(rom)[0]) ...
{ "content_hash": "630b910b498d79708ea4de4ad81a67a9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 113, "avg_line_length": 41.592592592592595, "alnum_prop": 0.6821015138023152, "repo_name": "digitalLumberjack/recalbox-configgen", "id": "7e149daa574f9f023a9de8fbd2491bf5dcdd...
import dork_compose.plugin import os from compose.config.config import VolumeSpec from docker.api.client import APIClient import logging log = logging.getLogger(__name__) import time from docker.errors import APIError class Plugin(dork_compose.plugin.Plugin): def get_hotcode_volumes(self, service): root...
{ "content_hash": "c7d3d93164b381fde6f3bbd2d517f944", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 114, "avg_line_length": 34.71523178807947, "alnum_prop": 0.520030522701259, "repo_name": "iamdork/compose", "id": "843b9020ec1a1758f7856f08c723a14a76809a20", "size": "5242...
from distutils.core import setup DESCRIPTION = "General tools for Astronomical Time Series in Python" LONG_DESCRIPTION = """ gatspy: General tools for Astronomical Time Series in Python ============================================================ Gatspy (pronounced as F. Scott Fitzgerald might pronounce it) is a coll...
{ "content_hash": "b6917824a3abc82c503984ead07233e4", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 136, "avg_line_length": 33.19230769230769, "alnum_prop": 0.6176129779837776, "repo_name": "bsipocz/gatspy", "id": "4667c11240f4356dba86ca8790231558b420cf7e", "size": "1726"...
import mock from neutron.agent.common import ovs_lib from neutron.agent.linux import ovsdb_monitor from neutron.tests import base class TestOvsdbMonitor(base.BaseTestCase): def test___init__(self): ovsdb_monitor.OvsdbMonitor('Interface') def test___init___with_columns(self): columns = ['col...
{ "content_hash": "b2cdecef9d2a6ca8e41b63288244329c", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 41.0609756097561, "alnum_prop": 0.6186516186516187, "repo_name": "JianyuWang/neutron", "id": "dc41c96e009f5a93d102735be1bbba015ec38163", "size": "397...
from selenium import webdriver from pages.admin_panel_login_page import AdminPanelLoginPage from pages.add_to_cart_page import AddToCartPage from pages.main_page import MainPage from pages.select_product_page import SelectProductPage from pages.shopping_page import ShoppingPage from pages.add_to_user_page import AddToU...
{ "content_hash": "88a78a3680b5f47b2f493f6b6453db6f", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 86, "avg_line_length": 46.5531914893617, "alnum_prop": 0.746800731261426, "repo_name": "skostya64/Selenium_tasks", "id": "4a6c56030fc4f3b84c79e7a58f8da0df6bd639f9", "size":...
import smtplib import pystache import os import html.parser from email.mime.text import MIMEText from werkzeug.utils import secure_filename from flask import url_for from truecraft.database import db from truecraft.objects import User from truecraft.config import _cfg, _cfgi def send_confirmation(user): if _cfg("...
{ "content_hash": "a9d1de6633a8cae7018e6f26f14eaf9a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 118, "avg_line_length": 38.458333333333336, "alnum_prop": 0.628385698808234, "repo_name": "MaxLeiter/truecraft.io", "id": "04b7eabd87cd527cbba9b59e423887aaf62c4518", "size"...
import ujson as json from peachbox.task import Task """Copyright 2015 D. Britzger, P. Pahl, S. Schubert 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...
{ "content_hash": "1a1b1b6b5bdb4a70ed23c1ad3904f16a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 99, "avg_line_length": 34.35897435897436, "alnum_prop": 0.7082089552238806, "repo_name": "PeachstoneIO/peachbox", "id": "58353db8480274ea7d8a598be2063bdcce78cf4c", "size": ...
from moto.core.responses import BaseResponse from moto.core.utils import tags_from_query_string from .models import eb_backends from .exceptions import InvalidParameterValueError class EBResponse(BaseResponse): def __init__(self): super().__init__(service_name="elasticbeanstalk") @property def ba...
{ "content_hash": "f9819596c6a9ba30da989ee60452f391", "timestamp": "", "source": "github", "line_count": 1389, "max_line_length": 136, "avg_line_length": 41.176385889128866, "alnum_prop": 0.645854460258069, "repo_name": "spulec/moto", "id": "74d345a6c6bd187b622bb6b068b05ead13ad6036", "size": "57194"...
from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured from django_odesk.conf import settings # DESIGN NOTE: # We could do something like this in the default settings: # ODESK_USER_MODEL = 'auth.User' # But we need to be sure that we are using `...
{ "content_hash": "3195845dbc7d7dba0805fe53278ff216", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 37.28, "alnum_prop": 0.7188841201716738, "repo_name": "reputation/django-odesk", "id": "2725935238d706fa5bd7c1dc6ad2d1af144e6bd0", "size": "932", "...
from django.test import TestCase from django.urls import reverse from django.contrib import auth class ExtTestCase(TestCase): def create_and_log_in_user(self): user = auth.models.User.objects.create(username='test_user', email='tuser@iki.fi') user.set_password('password') user.save() ...
{ "content_hash": "8c9a4e3885198dd25231151accf5b941", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 100, "avg_line_length": 36.214285714285715, "alnum_prop": 0.6666666666666666, "repo_name": "jarnoln/cvdb", "id": "8d902d8af1d4451baefcaa172cebfa6b985f4648", "size": "507", ...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_tool_demagnetizer.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "4f147116962eec802e40d77d06ee369a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 73, "avg_line_length": 23.23076923076923, "alnum_prop": 0.6920529801324503, "repo_name": "anhstudios/swganh", "id": "f4577dac4d1ef17ade96ea876f65cd6bdd7473f6", "size": "447...
from linear_plot import linear_plot from scatter_plot import scatter_plot from dr_v_r import dr_v_r_plot from dr_r_v_r import dr_r_v_r_plot from semilog_plot import semilog_plot from semilogy_plot import semilogy_plot, semilogy_scatter
{ "content_hash": "fd1cf1876e97afa085c7deb02ddcc06c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 57, "avg_line_length": 39.166666666666664, "alnum_prop": 0.8042553191489362, "repo_name": "chrisjdavie/ws_cross_project", "id": "1b693987f4f7dd917ae79efbe726ebbb482369f5", "...
"""Tests for the step limit wrapper.""" from acme import wrappers from acme.testing import fakes import numpy as np from absl.testing import absltest ACTION = np.array(0, dtype=np.int32) class StepLimitWrapperTest(absltest.TestCase): def test_step(self): fake_env = fakes.DiscreteEnvironment(episode_length=5...
{ "content_hash": "4cbd7b7763e6f26ffe94a7f015af469c", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 59, "avg_line_length": 27.683333333333334, "alnum_prop": 0.7025888019265503, "repo_name": "deepmind/acme", "id": "78fbc47856677e1ab3818220bdb6a0e2b444fd84", "size": "2277",...
"""Downsample strategies. Contains all of the downsample strategies. Use downsample(), and secondary_downsample() for downsampling records stored in files. """ from math import ceil FLOAT_PRECISION = 4 SECOND_TO_MICROSECOND = 1E6 STRATEGIES = ['max', 'min', 'avg'] def _max_min_downsample(records, is_max, downsamp...
{ "content_hash": "ae5ae6ab414977cd8538a010e725231f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 85, "avg_line_length": 31.33050847457627, "alnum_prop": 0.5929131728428455, "repo_name": "googleinterns/power-data-graphing-intern-2020", "id": "ce05b79b57ae39cb833d4fe157bd...
def mapper(book): def checker(page, element): width=int(element.get('WIDTH')) height=int(element.get('HEIGHT')) x=int(element.get('HPOS')) y=int(element.get('VPOS')) area=width*height fracarea=area/(page.width*page.height) return page, [width, height, x, y, fr...
{ "content_hash": "5cca3b794c5f69c386c675bbe43d368f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 52, "avg_line_length": 27, "alnum_prop": 0.6172839506172839, "repo_name": "UCL-dataspring/cluster-code", "id": "576e8a572a418da8df6de95ed4b8bcdf32220a04", "size": "405", ...
""" TCP support for IOCP reactor """ from twisted.internet import interfaces, error, address, main, defer from twisted.internet.abstract import isIPAddress from twisted.internet.tcp import _SocketCloser, Connector as TCPConnector from twisted.persisted import styles from twisted.python import log, failure, reflect, ut...
{ "content_hash": "a72fcce473f8738aa81b672e14176702", "timestamp": "", "source": "github", "line_count": 507, "max_line_length": 83, "avg_line_length": 31.007889546351084, "alnum_prop": 0.5729915399783729, "repo_name": "hortonworks/hortonworks-sandbox", "id": "d40a0919d8df4de36b568963111756ea9e615437"...
from abc import ABCMeta, abstractmethod class CloudAdapter(metaclass=ABCMeta): """ defines an interface which should be used to implement functionality for a cloud provider """ class CloudConnectionException(Exception): """ raised if something goes wrong, while communicating with the c...
{ "content_hash": "ad69af09261b59cc12b5a18b80e8099a", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 108, "avg_line_length": 31.583333333333332, "alnum_prop": 0.6115508648490179, "repo_name": "jdepoix/goto_cloud", "id": "2fbd5acb2767654e481f66b0900fb1189cba7f71", "size": ...
import os import datetime import re import codecs from south.db import db from south.v2 import DataMigration from django.db import models from django.conf import settings from sqp import models as sqp_models class Migration(DataMigration): def forwards(self, orm): try: sql = 'ALTER TABLE sqp...
{ "content_hash": "e31ee7a9ac24c1dbb9e1d6b0ac06d4fe", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 182, "avg_line_length": 64.72916666666667, "alnum_prop": 0.5200193112327004, "repo_name": "recsm/SQP", "id": "13eb17bda92b9103a5650139181fcce2080844f3", "size": "31088", ...
from django.db import models from .base import Pessoa, UF_SIGLA class Transportadora(Pessoa): class Meta: verbose_name = "Transportadora" class Veiculo(models.Model): transportadora_veiculo = models.ForeignKey( 'cadastro.Transportadora', related_name="veiculo", on_delete=models.CASCADE) ...
{ "content_hash": "a36803ad2523375225f06c4e6e618b91", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 84, "avg_line_length": 31.869565217391305, "alnum_prop": 0.6439290586630286, "repo_name": "thiagopena/djangoSIGE", "id": "835ebfd2ae304d5eee0cc2133c36f700c81e442e", "size":...
try: import textile except ImportError: pass try: import markdown2 except ImportError: pass from django import template from django.conf import settings from django.utils.safestring import mark_safe from ccgallery import settings as c_settings from ccgallery.models import get_model register = template....
{ "content_hash": "14cb9a6923b79f528cf219f073df7847", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 58, "avg_line_length": 24.752808988764045, "alnum_prop": 0.6259645937358148, "repo_name": "designcc/django-ccgallery", "id": "7d65f897537770f0f8f93baf92e2bf133fe577a7", "si...
from lib.action import St2BaseAction import s3 __all__ = [ 'UploadToS3' ] class UploadToS3(St2BaseAction): def run(self, file_name, remote_file, bucket): remote_name = s3.S3Name(remote_file, bucket=bucket) connection = s3.S3Connection(**self.config['s3']) storage = s3.Storage(connect...
{ "content_hash": "cad2a7e1a75d2ffd65ec424f859ed4cd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 59, "avg_line_length": 23.571428571428573, "alnum_prop": 0.6, "repo_name": "lmEshoo/st2contrib", "id": "66dc1d4bd57d041147794451e0d306f1934fa436", "size": "495", "binary"...
import time import datetime import traceback import multiprocessing import urllib2 import xml.sax import redis import random import pymongo import re import requests import dateutil.parser import isodate import urlparse from django.conf import settings from django.db import IntegrityError from django.core.cache import ...
{ "content_hash": "0ecb49d9b7a44bfdf4f879a7f8b32e79", "timestamp": "", "source": "github", "line_count": 802, "max_line_length": 212, "avg_line_length": 48.84538653366584, "alnum_prop": 0.50298667483535, "repo_name": "Suninus/NewsBlur", "id": "1be57bf69e65d885822f1afb2377b4b9f6c8769b", "size": "3917...
#!/usr/bin/env python """ Show Botan module dependencies as a list or graph. Requires graphviz from pip when graphical output is selected: https://pypi.python.org/pypi/graphviz (C) 2015 Simon Warta (Kullo GmbH) Botan is released under the Simplified BSD License (see license.txt) """ # global import argparse import...
{ "content_hash": "895922c15154fc788779065a2a86c553", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 102, "avg_line_length": 29.881516587677726, "alnum_prop": 0.6177636796193497, "repo_name": "Rohde-Schwarz-Cybersecurity/botan", "id": "937626a8640628aa56ff619d80a6c1684032cb...
from setuptools import setup setup ( name = 'HoverSpace', version = '1.0,' description = '', long_description = '', author = 'HoverSpace Developers', author_email = '', maintainer = 'Shubham Gupta, Vidhan Jain, Prashant Sharma, Shashwat Shalvi, Mohit Kumar', main...
{ "content_hash": "27581d6756f1ecc048abedd69e2ef848", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 97, "avg_line_length": 31.055555555555557, "alnum_prop": 0.5366726296958855, "repo_name": "LNM-HoverSpace/HoverSpace", "id": "c2e3266d6f78fe86a6c74fc52961c80d4e01b5bd", "si...
''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' from config import DEFAULT_CONFIG as CONFIG from metric_mock import MetricMock # metrics libraries import mixpanel import librato import Queue...
{ "content_hash": "19392f5d976eff1448bbcb23c807bdca", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 137, "avg_line_length": 32.464646464646464, "alnum_prop": 0.6369788425637835, "repo_name": "nkhuyu/SFrame", "id": "f66341e6757fa515f909c99fab01d7571c8f7f92", "size": "1285...
""" Call NRL MSISE-00 using f2py from Python Michael Hirsch, Ph.D. Original fortran code from http://nssdcftp.gsfc.nasa.gov/models/atmospheric/msis/nrlmsise00/ """ from __future__ import annotations import typing as T import os import logging import importlib.resources from datetime import datetime, date import xarra...
{ "content_hash": "42a259802620c0f77370b8e1d1571727", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 100, "avg_line_length": 28.19178082191781, "alnum_prop": 0.5573372206025268, "repo_name": "scienceopen/msise00", "id": "97b1bad899e576253e11305cb2b5d74c8d8794e9", "size": ...
"""Tests for tensor2tensor.data_generators.algorithmic_math.""" # TODO(rsepassi): This test is flaky. Disable, remove, or update. from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import sympy from tensor2tensor.data_generators import algorithmic_ma...
{ "content_hash": "8b69ce11309c6df20b97fc6ef236ead6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 36.23529411764706, "alnum_prop": 0.6728896103896104, "repo_name": "tensorflow/tensor2tensor", "id": "b9d89a575a267574026767a1de6cc4612de3d39d", "size...
from piston.handler import BaseHandler, rc from systems.models import SystemRack import re try: import json except: from django.utils import simplejson as json from django.test.client import Client from settings import API_ACCESS class SystemRackHandler(BaseHandler): #allowed_methods = API_ACCESS allo...
{ "content_hash": "cb4cb8cde56eb57c721154ed7944e427", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 224, "avg_line_length": 38.417391304347824, "alnum_prop": 0.5135808057944772, "repo_name": "rtucker-mozilla/inventory", "id": "93bde49a638cca44a39a29ec6d83b20bc0cfcd76", "...
"""Echo WebSocket handler for real time collaboration with Yjs""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import uuid import time from tornado.ioloop import IOLoop from tornado.websocket import WebSocketHandler from enum import IntEnum ## The y-protocol d...
{ "content_hash": "644b71b8b8f5b037c98aa00ca397e000", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 152, "avg_line_length": 43.52892561983471, "alnum_prop": 0.6217960888551357, "repo_name": "jupyter/jupyterlab", "id": "a9bbd7b90a1c14873029dcdb7c38f470f61e9556", "size": "...
from diasporapy.engine import handlers import firenado.core class PodComponent(firenado.core.TornadoComponent): def get_handlers(self): return [ (r'/', handlers.IndexHandler), (r'/stream', handlers.StreamHandler), ] def install(self): import diasporapy.pod.mod...
{ "content_hash": "9bd869121063cdda9cd9f7bb8e354534", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 83, "avg_line_length": 27.04255319148936, "alnum_prop": 0.6270653029110936, "repo_name": "candango/socialspider", "id": "5181f605d6ac42c018a3d9b1f40aa02373e8a72a", "size": ...
"""Implementation of Inspector abstraction for Hyper-V""" import collections import functools import sys from os_win import exceptions as os_win_exc from os_win import utilsfactory from oslo_utils import units import six from ceilometer.compute.pollsters import util from ceilometer.compute.virt import inspector as v...
{ "content_hash": "ee4582d70ca62624773a29af93846b70", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 78, "avg_line_length": 37.35616438356164, "alnum_prop": 0.6338467180051338, "repo_name": "idegtiarov/ceilometer", "id": "38409295405d7fc566986d2d06ce949283944553", "size":...
import os import csv import bz2 import gzip import re import urllib2 import socket from apache_reader import ApacheLogReader # dictionary key structure: filename, user_agent, package_name class LocalStats(object): """Base class that writes the log file """ def _get_logs(self, logfile, file_urls): ...
{ "content_hash": "bbbbf3ea9d24a80cb631e0168bd7fe9a", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 76, "avg_line_length": 36.2512077294686, "alnum_prop": 0.5611673773987207, "repo_name": "techtonik/pydotorg.pypi", "id": "1142fcee0f8407974a87e4743f85f6657c5cdca3", "size"...
""" Make REST API requests """ from typing import Any, Dict, Iterable, Optional, Protocol import aiohttp from gcpdiag.queries import apis_utils class Creds(Protocol): def update_headers(self, headers: Dict[str, str]) -> None: pass class Sleeper(Protocol): async def sleep(self, seconds: float) -> None: ...
{ "content_hash": "a4641f3966392ed74b35b395b118992d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 66, "avg_line_length": 27.446428571428573, "alnum_prop": 0.5972674040338322, "repo_name": "GoogleCloudPlatform/gcpdiag", "id": "d11db9a1b1abf61fa86091816f9a568547ec8a49", "...
""" The Pygments reStructuredText directive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This fragment is a Docutils_ 0.5 directive that renders source code (to HTML only, currently) via Pygments. To use it, adjust the options below and copy the code into a module that you import on initialization....
{ "content_hash": "b55288bbac20b10f32fac3c72a9d5245", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 73, "avg_line_length": 31.31764705882353, "alnum_prop": 0.6652892561983471, "repo_name": "wummel/wok", "id": "de0a03f360ca8996164e08701f76922648d65fb9", "size": "2691", "...
""" Wicked hack to get .pyc files to do bytecode tracing instead of line tracing. """ import marshal, new, opcode, sys, types from lnotab import lnotab_numbers, lnotab_string class PycFile: def read(self, f): if isinstance(f, basestring): f = open(f, "rb") self.magic = f.read(4) ...
{ "content_hash": "225552112df47a8c0a1e64227362d985", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 32.13414634146341, "alnum_prop": 0.6060721062618596, "repo_name": "nedbat/coveragepy", "id": "60b8459b54bfa7b189cbbc3ea668e2d96e70bd5f", "size": "279...
import scrapy from scrapy.linkextractors import LinkExtractor from scrapy_splash import SplashRequest class QuotesSpider(scrapy.Spider): name = "quotes" allowed_domains = ["toscrape.com"] start_urls = ['http://quotes.toscrape.com/'] # http_user = 'splash-user' # http_pass = 'splash-password' ...
{ "content_hash": "8351d73cbb63d8215333691a31d699bb", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 56, "avg_line_length": 28.6875, "alnum_prop": 0.5555555555555556, "repo_name": "Ertinfagor/ScrapySplash", "id": "ed8fb65f5c294b1aa80fa30bddf3b0fbdfc12631", "size": "942", ...
from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from babik_shadow_accounts import get_shadow_account_model @receiver(post_save, sender=settings.AUTH_USER_MODEL) def user_created(sender, instance, created, raw, using, update_fields, ...
{ "content_hash": "95aa02187be7b217ff08aa9f6421186d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 76, "avg_line_length": 36.607142857142854, "alnum_prop": 0.6497560975609756, "repo_name": "aubreystarktoller/django-babik-shadow-accounts", "id": "6d55c0b45ca74ff2f7e30ddbe90...
""" Overview ======== The multiprocess plugin enables you to distribute your test run among a set of worker processes that run tests in parallel. This can speed up CPU-bound test runs (as long as the number of work processeses is around the number of processors or cores available), but is mainly useful for IO-bound te...
{ "content_hash": "0e3d3fdb9991bc06f95090f5ae79f70d", "timestamp": "", "source": "github", "line_count": 909, "max_line_length": 168, "avg_line_length": 44.34983498349835, "alnum_prop": 0.5366870069950885, "repo_name": "jdsika/TUM_HOly", "id": "02833c30528c127146f1643065f559dc562ec6d1", "size": "403...
import abc from enum import Enum from .method import wrap_method from .base import weak_method from .device import Device from .stateMachine import StateMachine from .attribute import Attribute class DState(Enum): # These are the states that our machine supports Fault, Idle, Configuring, Ready, Running, Pau...
{ "content_hash": "838a1618512fc537bf4ca2007f9301eb", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 82, "avg_line_length": 38.82231404958678, "alnum_prop": 0.6373602980308675, "repo_name": "ulrikpedersen/malcolm", "id": "6e9383fb1d0ae694b95b303ea727ccb45cd41bcf", "size":...
from tests.testcase import TestCase from edmunds.globals import _request_ctx_stack from edmunds.http.visitor import Visitor class TestHttpServiceProvider(TestCase): """ Test the Http Service Provider """ def test_visitor(self): """ Test visitor :return: void """ ...
{ "content_hash": "65e1fe9e0f57813eb0beeaef072fe853", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 96, "avg_line_length": 30.205882352941178, "alnum_prop": 0.6124634858812074, "repo_name": "LowieHuyghe/edmunds", "id": "8657f5a6d28901f0810eaab8d59d84ce6794425b", "size": "...
"""Module for working with EOS VRRP resources The Vrrp resource provides configuration management of interface specific vrrp resources on and EOS node. It provides the following class implementations: * Vrrp - Configure vrrps in EOS Vrrp Attributes: - enable (boolean): The shutdown state of the vrrp - pr...
{ "content_hash": "f60fbf830f3d0835d15cd4812203c89c", "timestamp": "", "source": "github", "line_count": 1370, "max_line_length": 79, "avg_line_length": 39.9978102189781, "alnum_prop": 0.542383707137252, "repo_name": "mith1979/ansible_automation", "id": "a63af216d794e31bdc6c8c14b165d59ad8f4d927", "s...
import numbers from collections import defaultdict import numpy as np from astropy.utils import isiterable from astropy.utils.decorators import lazyproperty from ..low_level_api import BaseLowLevelWCS from .base import BaseWCSWrapper __all__ = ['sanitize_slices', 'SlicedLowLevelWCS'] def sanitize_slices(slices, n...
{ "content_hash": "c67db95b0d1fd3b2399f7d8efaf9d69f", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 110, "avg_line_length": 37.282467532467535, "alnum_prop": 0.6007140991030219, "repo_name": "saimn/astropy", "id": "21169377f0015e5a4676248da7e5bf4dffd3030d", "size": "1148...
from cosmo_tester.framework.testenv import bootstrap, teardown def setUp(): bootstrap() def tearDown(): teardown()
{ "content_hash": "884f98bb1c977d688e02d942f5611980", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 62, "avg_line_length": 14.11111111111111, "alnum_prop": 0.7086614173228346, "repo_name": "isaac-s/cloudify-system-tests", "id": "ee6fe3f6146737d2a80f26a2cabfd6974bc2146c", "...
from django.test import TestCase from hnotebook.accounts.factories import ProfileFactory from .factories import NotebookFactory, HousingFactory from .models import Notebook, Housing, Review, Note class NotebookModelTestCase(TestCase): def setUp(self): pass def test_notebook_private_field_is_false_as_...
{ "content_hash": "930e18a36f634697e0aca0ce4eda3a0b", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 63, "avg_line_length": 31.476190476190474, "alnum_prop": 0.6388048411497731, "repo_name": "marcwebbie/hnotebook", "id": "0cb4b3f4b3e3a905ddac43d6b4b34a44e822fc8c", "size": ...
"""This app contains the views and models for expression data Expression Objects ------------------ For microarray results (metadata in :class:`~experiments.models.MicroArrayExperiment`) there is only *gene* level data, as specified by the specific probe used. For RNAseq results (metadata in :class:`~experiments.mode...
{ "content_hash": "319d67e09d583ad0e0dd36d037f0c745", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 185, "avg_line_length": 47.94117647058823, "alnum_prop": 0.7521472392638037, "repo_name": "davebridges/expression-data-server", "id": "24fa6daee42e83a11bfb3a089f57778b3b32c23...
from __future__ import print_function import sys if sys.version >= '3': long = int from pyspark.sql import SparkSession # $example on$ from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml.recommendation import ALS from pyspark.sql import Row # $example off$ if __name__ == "__mai...
{ "content_hash": "20c23214d5d748889df8b8f8c1e0dc75", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 96, "avg_line_length": 36.03921568627451, "alnum_prop": 0.6414581066376496, "repo_name": "wangyixiaohuihui/spark2-annotation", "id": "dede3f39431678277ddefa853c1efdc84d603616...
from flask_restful_swagger import swagger from sqlalchemy import bindparam from manager_rest import manager_exceptions from manager_rest.rest import ( resources_v1, rest_decorators, ) from manager_rest.storage.models_base import db from manager_rest.storage.resource_models import ( Deployment, Executio...
{ "content_hash": "c44a0b1a3c14179b0bea356da0c7d9b4", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 78, "avg_line_length": 34.61363636363637, "alnum_prop": 0.5838804990151018, "repo_name": "isaac-s/cloudify-manager", "id": "a44b77a2fd7bdad054b33bb1f2ad95bf50fdab7a", "siz...
from threading import Thread, Lock, Semaphore # current_thread for python 2.6, currentThread for python 2.5 try: from threading import current_thread except ImportError: from threading import currentThread as current_thread # Queue for python 2, queue for python 3 try: from Queue import Queue, Empty excep...
{ "content_hash": "1ce2f55db01776b51046e9d5885e40a6", "timestamp": "", "source": "github", "line_count": 1012, "max_line_length": 114, "avg_line_length": 36.45059288537549, "alnum_prop": 0.570212535241813, "repo_name": "DeathPoison/tinker-cnc", "id": "f2535ce580bc6bf7e6e9efb0a57f8d54889c2453", "size...
""" Throughout my travels I've discovered that most people, including myself, do not realise many things about our Planet's size. For example, the latitude and longitude of certain regions (South America is much further east than the US) or the relative size of countries (Japan is surprisingly long). Thus, I've create...
{ "content_hash": "6704ad1ba64763207c1effd94ce0fbb2", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 91, "avg_line_length": 43.61349693251534, "alnum_prop": 0.7266844844563229, "repo_name": "AleksanderLidtke/XKCD", "id": "0289963af258cded39c2b0dcfaad0d26f59c24b0", "size":...
import logging from .base import BaseResource from .map import MapCollection from .layer import LayerCollection class User(BaseResource): def __init__(self, *args): super(User, self).__init__(*args) self.username = None self.maps = MapCollection() self.layers = LayerCollection() ...
{ "content_hash": "90f2228f74332eb4afe04eb9dcbaca14", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 65, "avg_line_length": 32.56521739130435, "alnum_prop": 0.5874499332443258, "repo_name": "rjw57/foldbeam", "id": "27cbd6ea71aecca7e14fc2423354cc1c16871509", "size": "749", ...