text
stringlengths
4
1.02M
meta
dict
import webapp2 import json import logging from google.appengine.api import users from google.appengine.ext import ndb from serializers import clone_for_json from models import Frame, Photo from logic.streams import get_stream_photos, get_photo class PublicApi(webapp2.RequestHandler): def get(self, id): ...
{ "content_hash": "df1eacff2821866e466ef29e5615e46e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 72, "avg_line_length": 30.38888888888889, "alnum_prop": 0.6160877513711152, "repo_name": "ido-ran/ran-smart-frame2", "id": "4fec984120f961e037df579bf29d05944d06c1b1", "size...
"""Tests for `ribodesigner` package.""" import filecmp from pathlib import Path from click.testing import CliRunner from sequana.ribodesigner import RiboDesigner from sequana.scripts.main import ribodesigner from . import test_dir resources_dir = Path(test_dir) / "data" / "ribodesigner" def test_ribodesigner(tmp_...
{ "content_hash": "9a6dfa3700f35f3dba19188b3fbe492a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 115, "avg_line_length": 30.756756756756758, "alnum_prop": 0.6678383128295254, "repo_name": "sequana/sequana", "id": "bda5817f9fbf8ce14fa425eab886fc74f0fdd4e5", "size": "113...
__author__ = "Mari Wahl" __copyright__ = "Copyright 2014, The Cogent Project" __credits__ = ["Mari Wahl"] __license__ = "GPL" __version__ = "2.0" __maintainer__ = "Mari Wahl" __email__ = "marina.w4hl@gmail.com" import os import numpy as np from sklearn import preprocessing # CONSTANTS INPUT...
{ "content_hash": "a2d81a5ae2736668026beb864f96e33e", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 26.61904761904762, "alnum_prop": 0.5882528324388789, "repo_name": "bt3gl/MLNet-Classifying-Complex-Networks", "id": "1318d4ea21b2c63386f0668ab5a6892f7...
import os import json from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.contrib.auth.decorators import login_required from django.utils.encoding import smart_unicode from django.conf import settings from django.db import connections, transaction from dajax.core import Dajax from django.co...
{ "content_hash": "107ece9ee3c5e73a1dd367406358116a", "timestamp": "", "source": "github", "line_count": 1334, "max_line_length": 423, "avg_line_length": 56.26386806596702, "alnum_prop": 0.5360131102110425, "repo_name": "solarpermit/solarpermit", "id": "5c545931ab08ca76fda26a87950cadd5da0f994b", "si...
"""Takes a screenshot from an Android device.""" import argparse import logging import os import sys if __name__ == '__main__': sys.path.append( os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..', '..'))) from devil.android import device_utils from devil.android.tools import script_...
{ "content_hash": "4b5a657b70280a6a7e1b24e5685c7d30", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 73, "avg_line_length": 27.163636363636364, "alnum_prop": 0.6365461847389559, "repo_name": "endlessm/chromium-browser", "id": "5ab2419f0ebb7c54b76a5ff4c6eb06d43f5f1e0b", "si...
def dhh_to_halakhim(days, hours, halakhim): return halakhim + 1080 * (hours + 24 * days) def halakhim_to_wdhh(total_halakhim): total_hours = total_halakhim / 1080 halakhim = total_halakhim % 1080 total_days = total_hours / 24 hours = total_hours % 24 total_weeks = total_days / 7 days = tota...
{ "content_hash": "e4181833e920b940c02798767c7afde6", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 79, "avg_line_length": 32.91869918699187, "alnum_prop": 0.6517658681155841, "repo_name": "jleen/antikythera", "id": "ff686c3a3dfb313825811dd6efc609905d3d5920", "size": "50...
from nipype.interfaces.ants import N4BiasFieldCorrection from src.utils import splitext from nipype.interfaces.ants.segmentation import BrainExtraction from src.arg_parser import icbm_default_template, file_dir from nipype.interfaces.base import CommandLine, CommandLineInputSpec from nipype.interfaces.base import (Tra...
{ "content_hash": "26dc0f2f3f5009519b9036b3b255a891", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 190, "avg_line_length": 45.10526315789474, "alnum_prop": 0.6557759626604434, "repo_name": "APPIAN-PET/APPIAN", "id": "fb25d5ec76a806d131db738f0620a471971c6d22", "size": "1...
"""Time manipulation functions and variables. This module contain common methods that can be used to convert timestamps from various formats into number of micro seconds since January 1, 1970, 00:00:00 UTC that is used internally to store timestamps. It also contains various functions to represent timestamps in a mor...
{ "content_hash": "53b75affcbc140729f888e8acbd16e57", "timestamp": "", "source": "github", "line_count": 914, "max_line_length": 80, "avg_line_length": 33.4507658643326, "alnum_prop": 0.6578792438019232, "repo_name": "dc3-plaso/plaso", "id": "b770edb229c5ce414cc3b81233653d3a2b80242e", "size": "30598...
from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER , MAIN_DISPATCHER, DEAD_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_3 import time max_entry_num=16384 max_port_id=52 max_vlan_id=4093 l2_m...
{ "content_hash": "9469635540eb92ed7e0d4aa2e0686e3f", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 159, "avg_line_length": 46.166666666666664, "alnum_prop": 0.5944121801914927, "repo_name": "macauleycheng/AOS_OF_Example", "id": "c24eaccf1c0278e4b954a055d2b634c647e66ce8", ...
__source__ = 'https://leetcode.com/problems/implement-stack-using-queues/' # https://github.com/kamyu104/LeetCode/blob/master/Python/implement-stack-using-queues.py # Time: push: O(n), pop: O(1), top: O(1) # Space: O(n) # # Description: Leetcode # 225. Implement Stack using Queues # # Implement the following operations...
{ "content_hash": "a46715acd51e1462a804e6ca90b0217d", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 89, "avg_line_length": 22.652996845425868, "alnum_prop": 0.5513159727057513, "repo_name": "JulyKikuAkita/PythonPrac", "id": "29727ba2bd817a5640200f317700f8c4815a7eb6", "si...
from manager_rest.security import ( MissingPremiumFeatureResource, ) try: from cloudify_premium.secrets_provider.secured_secrets_provider_resource \ import ( SecuredSecretsProviderResource, SecuredSecretsProviderKeyResource, ) except ImportError: SecuredSecretsProvid...
{ "content_hash": "5175e812b7c725647e4eae4cdc2af0da", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 78, "avg_line_length": 27.19047619047619, "alnum_prop": 0.7810858143607706, "repo_name": "cloudify-cosmo/cloudify-manager", "id": "13983559b3331494545697756a26a11a960f07aa", ...
import pandas as pd import sys import numpy as np import scipy as sp import os import itertools def pickle2df(datadir, filePath = 'wifi_passenger_count_10.pkl'): ''' 读取pickle格式数据,并将其转为dataframe ''' data = pd.read_pickle(os.path.join(datadir,filePath)) # data.info() print 'read pickle and transform to dataframe...
{ "content_hash": "1656bf85dae51bd48bfbdb29afc4a6ab", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 110, "avg_line_length": 24.283783783783782, "alnum_prop": 0.6733444629938787, "repo_name": "d2Code/Prediction-of-the-spatial-and-temporal-distribution-of-airport-passenger-flow...
from __future__ import (absolute_import, unicode_literals) """ =========================== Flux Balance Analysis Model =========================== :Authors: Moritz Emanuel Beber Alexandra Mirela Grigore Nils Kölling Nikolaus Sonnenschein :Date: 2011-03-28 :Copyright: Copyright(c) 2011 Jacobs ...
{ "content_hash": "a1c54f5ec12bc955ab62e715c27bd541", "timestamp": "", "source": "github", "line_count": 597, "max_line_length": 82, "avg_line_length": 31.2964824120603, "alnum_prop": 0.5905052451295226, "repo_name": "Midnighter/pyorganism", "id": "4118faf83528d6259075b9a838b83038c086a65d", "size": ...
import mysql.connector import sqlite3 import json target = sqlite3.connect('data.db') tc = target.cursor() #source = mysql.connector.connect(user = 'garba1', host = 'localhost', database = 'reactome_simple') #sc = source.cursor() source = mysql.connector.connect(user = 'garba1', host = 'localhost', database = 'react...
{ "content_hash": "9e4fadc8f4119be64a522cd90930dee2", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 100, "avg_line_length": 33.44421052631579, "alnum_prop": 0.5886944479415838, "repo_name": "garba1/GraphMirrors", "id": "3a36fef21c4549f11b2753c5d71daea4d5d60b2d", "size": ...
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_equal) import pytest from mne.fixes import is_regressor, is_classifier from mne.utils import requires_version from mne.decoding.base import (_get_inverse_funcs, LinearModel, get_coef, ...
{ "content_hash": "fb6ae173244ab7dd57730d94311df66d", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 79, "avg_line_length": 36.9349593495935, "alnum_prop": 0.6222760290556901, "repo_name": "teonlamont/mne-python", "id": "7f6263e1de344778ec73734661f9861fb33c4391", "size": ...
"""Encode and decode BASE58, P2PKH and P2SH addresses.""" from .script import hash256, hash160, sha256, CScript, OP_0 from .util import bytes_to_hex_str, hex_str_to_bytes from . import segwit_addr chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' def byte_to_base58(b, version): result = '' ...
{ "content_hash": "9a7fce92eb44f644c250a1247bd43dfa", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 74, "avg_line_length": 31.759036144578314, "alnum_prop": 0.6498482549317147, "repo_name": "doriancoins/doriancoin", "id": "b24d5455f1b4e7e2278de82265452959c914dff4", "size"...
""" A module with implemented quaternion arithemtics. Author: Jernej Kovacic """ import math import exception from instance_checker import InstanceCheck class QuaternionException(exception.IException) : """Exception raised at illegal quaternion operations""" pass class Quaternion() : """ T...
{ "content_hash": "40001028fd7cafb700289f641ddf752b", "timestamp": "", "source": "github", "line_count": 504, "max_line_length": 149, "avg_line_length": 30.628968253968253, "alnum_prop": 0.5085184945261385, "repo_name": "jkovacic/py-quat-rotation", "id": "0e7c8f4ca46da77b3bff5c9e1e77429187a6d9e5", "...
import numpy, bpy, sys ## Checkalive Function ## --------------------------------------------------------- ## Desc: Given a 3D matrix and a point in said matrix, ## run a modified game of life simulation, inspecting ## all the points around point x,y,z ## ---------------------------------------------------...
{ "content_hash": "8f3ceb4b7031cd09d98468093107d2c9", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 88, "avg_line_length": 31.832335329341316, "alnum_prop": 0.5349887133182845, "repo_name": "databard/Life-3D", "id": "0bc29e37b001cfc90d97446229b1fc72c378a1e0", "size": "53...
from collections import OrderedDict import tornado.web from .exceptions import ForecastError, SettingsError from .middlewares import Middlewares from .utils import import_object from .environment import Environment from .settings import Settings from .manager import Manager from .routes import Routes class Project(...
{ "content_hash": "0fbfbdb680a00a98304639f30174ccf8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 101, "avg_line_length": 36.924050632911396, "alnum_prop": 0.6739801165581076, "repo_name": "osantana/forecast", "id": "72129ca5e98f33b04cc054fea2209b79fc7c39e6", "size": "2...
import click import globus_sdk from globus_cli.login_manager import LoginManager from globus_cli.parsing import ( ENDPOINT_PLUS_REQPATH, command, delete_and_rm_options, synchronous_task_wait_options, task_submission_options, ) from globus_cli.termio import Field, display, err_is_terminal, term_is_i...
{ "content_hash": "dbe027901ee7ea6239723bc764f2fb99", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 83, "avg_line_length": 27.671641791044777, "alnum_prop": 0.6426645091693636, "repo_name": "globus/globus-cli", "id": "d940b45fe3634ec1114d417183796999bae4c0c0", "size": "3...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0001_initial'), ] operations = [ migrations.AlterField( model_name='hello', name='identifier', f...
{ "content_hash": "d9279acfd3104ff8e620747ff57ab4be", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 122, "avg_line_length": 29.285714285714285, "alnum_prop": 0.5841463414634146, "repo_name": "acreations/rockit", "id": "f8bc59b09b4ee81fa135e5b28c7a59a016633d65", "size": "8...
import os import sys import sphinx_rtd_theme src_paths = [ os.path.abspath('src/mercury-common'), os.path.abspath('src/mercury-inventory'), os.path.abspath('src/mercury-log'), os.path.abspath('src/mercury-rpc') ] sys.path += src_paths # -- General configuration -------------------------------------...
{ "content_hash": "7b56b1fea229dcb8cea9f314d0f31259", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 78, "avg_line_length": 29.092105263157894, "alnum_prop": 0.6612392582541836, "repo_name": "jr0d/mercury", "id": "3e2a8e9b72985803e28c092ed0bfcef99d4df3b7", "size": "5106",...
"""Host a class that controls the way we interact with quick pannel.""" import logging import sublime from ..error_vis.popup_error_vis import MIN_ERROR_SEVERITY log = logging.getLogger("ECC") class ErrorQuickPanelHandler(): """Handle the quick panel.""" ENTRY_TEMPLATE = "{type}: {error}" def __init__...
{ "content_hash": "1790b0d55bf8517a5e4e4d686726f708", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 79, "avg_line_length": 31.634920634920636, "alnum_prop": 0.5132965378825891, "repo_name": "niosus/EasyClangComplete", "id": "0d488ec192244e3666b083ee268ddf0ca873fa4a", "siz...
""" esky.bdist_esky.f_py2exe: bdist_esky support for py2exe """ from __future__ import with_statement import os import sys import imp import time import zipfile import marshal import struct import shutil import inspect import zipfile import ctypes from py2exe.distutils_build_exe import py2exe import esky fro...
{ "content_hash": "a32ccc204c1a5709f1e27b7f3f8bef19", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 97, "avg_line_length": 40.31198347107438, "alnum_prop": 0.6340013325816206, "repo_name": "kinnarr/esky", "id": "3b52a3eaee97fbfbc5d607008484a1d67bd58af4", "size": "19632",...
from __future__ import unicode_literals # Third-party imports from mock import patch # Local imports from .. import topic from ...tests import TestGCP @patch('cloudify_gcp.utils.assure_resource_id_correct', return_value=True) @patch('cloudify_gcp.gcp.ServiceAccountCredentials.from_json_keyfile_dict') @patch('cloudi...
{ "content_hash": "896533cb8eaf561e6960e5a3529f11c3", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 31.571428571428573, "alnum_prop": 0.6866515837104072, "repo_name": "cloudify-cosmo/cloudify-gcp-plugin", "id": "4ec498f773e0ccd6f8892d6292ee75ac41ac2d9...
from gluon import current #from gluon.html import * from gluon.storage import Storage from s3 import S3CustomController THEME = "historic.CRMT" # ============================================================================= class index(S3CustomController): """ Custom Home Page """ def __call__(self): ...
{ "content_hash": "154771b2a9bfdfbba31acdfad3842efb", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 81, "avg_line_length": 37.18072289156626, "alnum_prop": 0.4147764095917045, "repo_name": "flavour/eden", "id": "ce6ca4b6a0703c8994daf4685f615b4ef37a372b", "size": "3111", ...
import _plotly_utils.basevalidators class HovertemplatesrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="hovertemplatesrc", parent_name="scattergl", **kwargs ): super(HovertemplatesrcValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "4381bf619a824c645d832aa8e32d877c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 33.61538461538461, "alnum_prop": 0.6247139588100686, "repo_name": "plotly/plotly.py", "id": "23f214e92356ba6738a79c11db0558d8d756041e", "size": "437"...
"""Apache Beam SDK version information and utilities.""" import re __version__ = None def get_version(): global __version__ if not __version__: __version__ = get_version_from_pom() return __version__ # Read the version from pom.xml file def get_version_from_pom(): with open('pom.xml', 'r') as f: ...
{ "content_hash": "1a440d64325347bf449bc061736e3b14", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 56, "avg_line_length": 23.060606060606062, "alnum_prop": 0.5663600525624178, "repo_name": "chamikaramj/incubator-beam", "id": "ef07dbf99f99c49a467f1de8c6e64b51b5311894", "s...
import abc import re import unidecode from learning_text_transformer import spoken_word_to_number # expandk should work on lowercase k e.g. 30k too? # TransformExtractNumber should extract multiple numbers! # TransformRemoveWords needs to be hardcoded with a list of terms, should learn # terms from input text # spoke...
{ "content_hash": "4bee8c4ed2881fc8371a93b730ae2167", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 104, "avg_line_length": 27.54368932038835, "alnum_prop": 0.5786041593232287, "repo_name": "ianozsvald/learning_text_transformer", "id": "fe045f6e739305eb350f61aeacf5acdd1222...
from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_SimCartesianTransformOperator_3D_Uniform', [dirname(__file__)]) except ImportEr...
{ "content_hash": "a5cc5d1ae7168c214aa3bd83c67781f9", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 169, "avg_line_length": 45.29007633587786, "alnum_prop": 0.7134670487106017, "repo_name": "EnEff-BIM/EnEffBIM-Framework", "id": "67648e33f544d66b95b2ffb8503fecf7738f3824", ...
from datetime import datetime import itertools import math import time def shift(seq, n): n = n % len(seq) return seq[n:] + seq[:n] starttime = datetime.now() letters = [] for i in range(42, 127): letters.append(chr(i)) key = "asklx" total = 0 for char in key: total += ord(char) shift(key, ((total * len(...
{ "content_hash": "167d67f752a98f9a89390fa84619f380", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 436, "avg_line_length": 27.040816326530614, "alnum_prop": 0.6203773584905661, "repo_name": "theXbit/PyEncrypt", "id": "069d3d1dfe8c62c77d43c706410eb3b0423bbb2a", "size": "1...
import sys from abc import ABC, abstractmethod from enum import Enum from io import BytesIO from typing import TypeVar, Generic, Iterable, Collection from pyflink.common.serializer import TypeSerializer from pyflink.datastream.functions import RuntimeContext, InternalWindowFunction from pyflink.datastream.state import...
{ "content_hash": "82a4c9c9251a51ba0e4d7b7c9b32e30b", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 100, "avg_line_length": 35.076771653543304, "alnum_prop": 0.6189460688029631, "repo_name": "tillrohrmann/flink", "id": "058311bf6e75882c34e9270cd0417196b692f17d", "size": ...
from Util import Util import mailbox import json from errors import * DEFAULT_MAIL_VIEW_COUNT = 20 MAIL_SIZE_UNLIMITED = -1 class Mail: @staticmethod def GET(svc, session, params, action): if (session is None): raise Unauthorized('login first') if not session.CheckScope('bbs'): raise NoPerm("o...
{ "content_hash": "b17147746dd71c8efbdf9eb37dae6648", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 87, "avg_line_length": 38.425, "alnum_prop": 0.5415311212318369, "repo_name": "HenryHu/pybbs", "id": "319de5549d4ea66993202e36cff7fcd3c1f10a58", "size": "4633", "binary"...
import gal_uvw, cv_coord, euler import numpy as np def get_uvw_sun(vlsr=220): usun, vsun, wsun = -8.5, 13.38 + vlsr, 6.49 # the signs are in the coord system of gal_uvw # e.g. U points toward anticenter return usun,vsun,wsun def correct_pm(ra, dec, pmra, pmdec, dist, vlsr=220): """Corrects the proper...
{ "content_hash": "ee68044f5afff93374494cf81c6c4dc1", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 98, "avg_line_length": 31.047619047619047, "alnum_prop": 0.656441717791411, "repo_name": "plasidu/phoenix4iraf", "id": "6481bcbf7ca21a5f7663e1bc5b9c70fb57ed210d", "size": "...
from __future__ import absolute_import, division, print_function import operator from operator import add, getitem import inspect from numbers import Number from collections import Iterable from bisect import bisect from itertools import product, count from collections import Iterator from functools import partial, wr...
{ "content_hash": "0c72d706c727ab5b2f232cfcd95723e8", "timestamp": "", "source": "github", "line_count": 1779, "max_line_length": 107, "avg_line_length": 31.19673974142777, "alnum_prop": 0.5583163660606497, "repo_name": "esc/dask", "id": "2ed778ebdd97a2ac13cde12109901982e6bb93df", "size": "55499", ...
from typing import Optional, Tuple, Union import torch from ...pipeline_utils import DiffusionPipeline, ImagePipelineOutput from ...utils import deprecate class DDIMPipeline(DiffusionPipeline): r""" This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods th...
{ "content_hash": "986e08098097b6e1392745a488813c97", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 119, "avg_line_length": 45.580357142857146, "alnum_prop": 0.602154750244858, "repo_name": "huggingface/diffusers", "id": "b9e590dea64621ea9eada0fd5d962e58943a2775", "size"...
from __future__ import with_statement import warnings from django.conf import settings, UserSettingsHolder from django.core import mail from django.test.signals import template_rendered, setting_changed from django.template import Template, loader, TemplateDoesNotExist from django.template.loaders import cached from d...
{ "content_hash": "6a8b9411d1f42b611844d45df0a530d4", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 86, "avg_line_length": 32.174107142857146, "alnum_prop": 0.6567226307756348, "repo_name": "mixman/djangodev", "id": "87f23118971aea50bd781dbc956bd1bcf8ad7692", "size": "72...
""" @brief test log(time=1s) You should indicate a time in seconds. The program ``run_unittests.py`` will sort all test files by increasing time and run them. """ import os import unittest from pyquickhelper.loghelper import fLOG from pyensae.sql import TextFileColumns class TestFileColumns (unittest.TestCase):...
{ "content_hash": "8588f4cf0acc95ad5583b7be607c9e40", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 24.83783783783784, "alnum_prop": 0.5560391730141458, "repo_name": "sdpython/pyensae", "id": "b83ba371ad2f9184f8bfaf3274f7c04a897b4599", "size": "919"...
"""Knowledge in learning, Chapter 19""" from random import shuffle from math import log from utils import powerset from collections import defaultdict from itertools import combinations, product from logic import (FolKB, constant_symbols, predicate_symbols, standardize_variables, variables, is_defin...
{ "content_hash": "3994975e55d9c4f35561b0c3fd9aecb4", "timestamp": "", "source": "github", "line_count": 409, "max_line_length": 99, "avg_line_length": 30.941320293398533, "alnum_prop": 0.5574081390754643, "repo_name": "SnShine/aima-python", "id": "6fe09acd2f7d73b6696ba9a17fd33f9da123d737", "size": ...
import unittest from captaincloud.processes.task_runner import TaskRunner from captaincloud.task import Task, TaskImpl, field from captaincloud.task.registry import TaskRegistry class TestTaskRunner(unittest.TestCase): """Test task runner""" def setUp(self): self.task_runner = TaskRunner() ...
{ "content_hash": "063e45310179dc6579be15be83318eb4", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 33.784615384615385, "alnum_prop": 0.6220400728597449, "repo_name": "bpsagar/captaincloud", "id": "d20adb6621c33a9c2ee536acdf6e92cd2617b114", "size": ...
"""Unit tests for the OWASP Dependency Check source up-to-dateness collector.""" from datetime import datetime, timedelta, timezone from .base import OWASPDependencyCheckTestCase class OWASPDependencyCheckTest(OWASPDependencyCheckTestCase): """Unit tests for the OWASP Dependency Check source up-to-dateness coll...
{ "content_hash": "19bfb3dff865e9497b80f32883263e8c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 119, "avg_line_length": 43.72222222222222, "alnum_prop": 0.7255400254129606, "repo_name": "ICTU/quality-time", "id": "e245724721f29553110e24fd0d3bfec81ef03ffc", "size": "78...
import os import sys import django from django.conf import settings DEFAULT_SETTINGS = { "INSTALLED_APPS": ( "cassava", ), "DATABASES": { "default": { "ENGINE": "django.db.backends.sqlite3" } }, } def runtests(): if not settings.configured: settings.c...
{ "content_hash": "3a7066cb1238b73ac79d8ee75c3ffe15", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 22.369565217391305, "alnum_prop": 0.6229348882410107, "repo_name": "tomkingston/django-cassava", "id": "e68ab9e566b9647d7f11917777a547778acfda5a", "s...
import scene, pygame, sys isLinux = sys.platform.startswith("linux") if(isLinux): try: from gi.repository import Gtk import sugar3.activity.activity from sugar3.graphics.toolbarbox import ToolbarBox from sugar3.activity.widgets import ActivityToolbarButton from sugar3.graphic...
{ "content_hash": "caa5d1e426bf180a22c6bb1914e17964", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 66, "avg_line_length": 35.48936170212766, "alnum_prop": 0.6264988009592326, "repo_name": "ColdSauce/golems", "id": "053a8803d82562be0fcd86e9bcbea054dc137c22", "size": "1668...
""" Slack interface. """ __author__ = "Alex Drlica-Wagner" import os import logging from datetime import datetime import pandas as pd from obztak.utils.database import Database def post_message(text, token=None, channel=None): """Post text to slack.""" from slackclient import SlackClient slack_token = ...
{ "content_hash": "56b93fb952b46874cccb5f06b4ff48de", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 83, "avg_line_length": 28.948051948051948, "alnum_prop": 0.6576940331987439, "repo_name": "kadrlica/obztak", "id": "59a34a837f707f1f736c11b4a9d1e5459bbd5b12", "size": "2251...
""" Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types from .util import parse_requirement __all__ = ['NormalizedVersion', 'NormalizedMatcher', 'LegacyVersion', 'LegacyMa...
{ "content_hash": "398c3c14a026b530c936f2b113e58885", "timestamp": "", "source": "github", "line_count": 734, "max_line_length": 78, "avg_line_length": 31.85558583106267, "alnum_prop": 0.5250620135146694, "repo_name": "sonntagsgesicht/regtest", "id": "86c069a7c2afbd54954452fb3a417a842cbdd24f", "size...
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(635, 400) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self...
{ "content_hash": "a884d66506d0567f19c7640307dd6075", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 102, "avg_line_length": 47.21951219512195, "alnum_prop": 0.6967975206611571, "repo_name": "mgotz/EBT_evaluation", "id": "5c24be9c8f225a302dbdf72005d01c176e162578", "size": ...
import factory from fjord.base import browsers from fjord.feedback.models import ( Product, Response, ResponseContext, ResponseEmail, ResponsePI ) USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Firefox/17.0' class ProductFactory(factory.DjangoModelFactory): class Meta: ...
{ "content_hash": "8a98c49c0b5c884b6ee6dd9b431e387f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 24.194805194805195, "alnum_prop": 0.6768652710681696, "repo_name": "DESHRAJ/fjord", "id": "5670c4021e130a2e6f977d9dcf05ccee638ffa3d", "size": "1863",...
import os import base64 import urllib local_file = lambda x: os.path.join(os.path.dirname(__file__), x) def read_from_local(img_name): img_file = open(local_file(img_name), 'rb') img_content = img_file.read() return img_content def read_from_remote(url): img_resource = urllib.urlopen(url) img_c...
{ "content_hash": "98577182610cfaf1db5d55d6161b4b58", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 80, "avg_line_length": 25.941176470588236, "alnum_prop": 0.6621315192743764, "repo_name": "catroll/clipboard", "id": "520538cb035c83087444a742b5a22e9764008466", "size": "88...
from bug import Bug, BugException, Comment # noqa from bugsy import Bugsy, BugsyException, LoginException # noqa from search import Search # noqa
{ "content_hash": "6eb26720d6b7a0d1e1d8a451bafd65e6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 63, "avg_line_length": 49.666666666666664, "alnum_prop": 0.785234899328859, "repo_name": "parkouss/Bugsy", "id": "4bc0c9fe7c19bbef6c55e2d6cc5fd13813be00ab", "size": "149", ...
"""Python file with invalid syntax, used by scripts/linters/ python_linter_test. This file is using unquote() which is not allowed. """ from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules import urlparse import p...
{ "content_hash": "f61299651d1e54df36152c0d87cb7b92", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 28.5, "alnum_prop": 0.6654135338345865, "repo_name": "prasanna08/oppia", "id": "5ba781be46b9647d0c4dad9aeb236100998fe6ae", "size": "1421", "binary"...
"""Support for Tuya Smart devices.""" import asyncio from datetime import timedelta import logging from tuyaha import TuyaApi from tuyaha.tuyaapi import TuyaAPIException, TuyaNetException, TuyaServerException import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const impo...
{ "content_hash": "b34485e2506b709c970438be528be2f8", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 88, "avg_line_length": 31.28148148148148, "alnum_prop": 0.600757755150367, "repo_name": "robbiet480/home-assistant", "id": "4a522b76b8ec561bfe725632d6427ad26ead070e", "siz...
"""test_restconf_session.py RestconfSession test """ from __future__ import absolute_import import os import unittest from ydk.path.sessions import RestconfSession from ydk.types import EncodingFormat from ydk.path import Repository from ydk.path import Codec class SanityTest(unittest.TestCase): @classmethod ...
{ "content_hash": "b231fca81d9f5672f4c8c4fd1fa812d9", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 135, "avg_line_length": 37.850746268656714, "alnum_prop": 0.666403785488959, "repo_name": "psykokwak4/ydk-gen", "id": "cba5436771422d6feb7c93ee6150d1559e8f3210", "size": "3...
''' Author: John D. Anderson Email: jander43@vols.utk.edu Problem Statement: You have 20 bottles of pills. 19 bottles have 1.0 gram pills, but on has pills of 1.1 grams. Given a scale that provides an exact measurement, how would you find the heavy bottle? You can only use the scale once. Complexity: O(N) Usage: th...
{ "content_hash": "119d952c0de8cb98e5d32b3df2b4b57c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 76, "avg_line_length": 19.375, "alnum_prop": 0.6483870967741936, "repo_name": "RagingTiger/CodingInterview", "id": "e0db2a2111e22eae1a18227852dc8ac00eef8714", "size": "953"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gem', '0032_remove_gem_profiles'), ] operations = [ migrations.AlterField( model_name='commentcountrule', name='operator', ...
{ "content_hash": "f3f1df415b77f815910ffa866f94838d", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 629, "avg_line_length": 56.54794520547945, "alnum_prop": 0.6308139534883721, "repo_name": "praekelt/molo-gem", "id": "bbaa147721ae2f93797104e345d9b5fe0336eaa9", "size": "42...
import csv from io import StringIO import queue import threading from cdrgen.sources import UniformSource from cdrgen.utils import asterisk_like, csv_to_cdr, time_of_day class CDRStream(threading.Thread): def __init__(self, formatter, source): self.formatter = formatter self.output = StringIO() ...
{ "content_hash": "25465faeca6d57145f83cb4fd93ecf8d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 83, "avg_line_length": 28.058823529411764, "alnum_prop": 0.6153039832285115, "repo_name": "rrader/cdr-tools", "id": "3c976606c7881f0aa9c80a95d926bcbe18016019", "size": "954...
import torch from typing import Union, Optional from os import PathLike from allennlp.fairness.bias_mitigators import ( HardBiasMitigator, LinearBiasMitigator, INLPBiasMitigator, OSCaRBiasMitigator, ) from allennlp.fairness.bias_direction_wrappers import BiasDirectionWrapper from allennlp.fairness.bias...
{ "content_hash": "483f72685ed32d5a294652dcc2112bd6", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 100, "avg_line_length": 36.00751879699248, "alnum_prop": 0.6500313217790771, "repo_name": "allenai/allennlp", "id": "6351a6cceac778609067b7c8ec3a17382f00e5fc", "size": "95...
import copy import datetime from django.forms import Select from django.test import override_settings from django.utils.safestring import mark_safe from .base import WidgetTest class SelectTest(WidgetTest): widget = Select nested_widget = Select(choices=( ('outer1', 'Outer 1'), ('Group "1"',...
{ "content_hash": "1642c7482abad9f44865c249bdd6b8bd", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 93, "avg_line_length": 35.984693877551024, "alnum_prop": 0.49262725081525593, "repo_name": "schinckel/django", "id": "fd4c1fb34c4effebb101ef4a47ab09ab76e5b832", "size": "1...
import logging import weakref from king_phisher import find from king_phisher import utilities from king_phisher.client import dialogs from king_phisher.client import export from king_phisher.client import graphs from king_phisher.client import gui_utilities from king_phisher.client.widget import extras from king_phis...
{ "content_hash": "2517baef488906ae5dbfa6392be20f28", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 169, "avg_line_length": 38.15882352941176, "alnum_prop": 0.7441035917989826, "repo_name": "hdemeyer/king-phisher", "id": "b118c3b6b7d857491740c406230a961cc9ed3a12", "size"...
from bs4 import BeautifulSoup import urllib #csv is for the csv writer import csv #initiates the dictionary to hold the output holder = {} #opens the input doc txt = open("adder.txt") #is the contents of the doc #opens the output doc output_txt = open("adder_output.txt", "w") print txt def headliner(url): ...
{ "content_hash": "ed8f72f02f9cf05975945723e86f5d0f", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 100, "avg_line_length": 25.03370786516854, "alnum_prop": 0.5619389587073609, "repo_name": "mwweinberg/china-daily-email", "id": "8f194b1ba9bea51c90402a0e46efd1637fa062b3", ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('initiatives', '0005_initiative_hasorganization'), ] operations = [ migrations.RenameField( model_name='initiative', old_name='hasOrg...
{ "content_hash": "0fdc301e4d4fcc10edfb8506572d13bd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 59, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6102564102564103, "repo_name": "onepercentclub/bluebottle", "id": "672aac3d61aa742b3485d51f572293e4df880535", "si...
from jax import lax import numpy as np from distla_core.analysis.errors import errors_polar from distla_core.utils import pops if __name__ == "__main__": local_rows = np.array([128, 256, 512, 1024, 2048]) OUT_ROWS = tuple(pops.NROWS * local_rows) OUT_COLS = (None, ) DTYPES = (np.float32,) # dtype of the mat...
{ "content_hash": "da0fb62001a0ed4e3bd26c4120ae20b7", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 80, "avg_line_length": 52.73170731707317, "alnum_prop": 0.669750231267345, "repo_name": "google/distla_core", "id": "d4c43c8c36c9053bcc3ee093b20f3ea97222099b", "size": "284...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name = 'reflectrpc', packages = ['reflectrpc'], version = '0.7.6', description = 'Self-describing JSON-RPC services made easy', long_description=read('CHANGELOG...
{ "content_hash": "c1669d7280158d2fa2ba214c437749b2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 81, "avg_line_length": 36.935483870967744, "alnum_prop": 0.5982532751091703, "repo_name": "aheck/reflectrpc", "id": "d0334b6a37313ebb08e5ce8df1e29ce463c72b3c", "size": "114...
import functools import re from typing import Dict, Sequence import looker_sdk from looker_sdk import methods, models, error LOOKER_GROUP_PREFIX = "Looker_Hack: " # simple caching mechanism until we have a true class for retaining these IDs HACKATHON_ATTR_ID = None HACKATHON_ROLE = None def try_to(func): """Wr...
{ "content_hash": "178e5017eb969a76a75d9c96b5e7d2aa", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 86, "avg_line_length": 30.77102803738318, "alnum_prop": 0.6192862566438876, "repo_name": "looker-open-source/sdk-examples", "id": "48e39664778d2a4be5b6207ddebaec4019fd1cf5",...
import os, platform, shutil from optparse import OptionParser def main(): desc = "builds starbound using pyqt5 and python3" if platform.system() == "Windows": desc += " (with cx_freeze if --with-exe is passed)" parser = OptionParser(description=desc) parser.add_option("-p", "--prefix", "-b", "-...
{ "content_hash": "34a19c1c695af5d55d48bb3878855b13", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 117, "avg_line_length": 45.086021505376344, "alnum_prop": 0.5883615549725734, "repo_name": "wizzomafizzo/starcheat", "id": "5dfb9504bb445a296aee609e3c097bd3c6692433", "size...
from contact_form.views import ContactFormView from .forms import BeyondContactForm class BeyondContactFormView(ContactFormView): form_class = BeyondContactForm
{ "content_hash": "2cb7faead01a4a5f94c331d657d8e3e3", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 46, "avg_line_length": 27.666666666666668, "alnum_prop": 0.8433734939759037, "repo_name": "gfavre/beyondthewall.ch", "id": "ee74fb81021da7307eeaa19bbf3339dcd7a6a9dd", "size"...
import argparse import gzip import minify_html import jsmin import mimetypes import pathlib parser = argparse.ArgumentParser(description="Generate displayio resources.") parser.add_argument("--output_c_file", type=argparse.FileType("w"), required=True) parser.add_argument("files", metavar="FILE", type=argparse.FileTyp...
{ "content_hash": "adba68f5a15c4cd86921480de101ea56", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 92, "avg_line_length": 36.05, "alnum_prop": 0.6608876560332871, "repo_name": "adafruit/circuitpython", "id": "172a80dac034a91b99ff5238ebcddf3f6abc91f4", "size": "1612", "...
from runner.koan import * class AboutAttributeAccess(Koan): class TypicalObject(object): pass def test_calling_undefined_functions_normally_results_in_errors(self): typical = self.TypicalObject() try: typical.foobar() except Exception as exception: se...
{ "content_hash": "9a5701837dc593a6aae3317d26518069", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 119, "avg_line_length": 33.65610859728507, "alnum_prop": 0.5599623554719011, "repo_name": "febinstephen/python_koans_solutions", "id": "ac139b057608969a4c396805e2ad64e93413c...
from datetime import datetime, timedelta import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, DatetimeIndex, Index, NaT, Period, PeriodIndex, RangeIndex, Series, Timedelta, TimedeltaIndex, Timestamp, date_range, isna,...
{ "content_hash": "2c4ad18b84d0789743c8d60e8cccd91c", "timestamp": "", "source": "github", "line_count": 1424, "max_line_length": 88, "avg_line_length": 33.24087078651685, "alnum_prop": 0.5477764867434245, "repo_name": "jreback/pandas", "id": "cb64b2423696f52a68984b81e39c90af0fdca566", "size": "4733...
from argparse import ArgumentParser from ..ui import input_bool from .base import CommandMixin class User(CommandMixin): """Interact with your profile and check your stats.""" def __print_stats(self, opts): building_count = 0 per_second_income = 0 for coord, planet in self.engine.use...
{ "content_hash": "1f924a1563206ffa5cb5ac2ee290d7c0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 77, "avg_line_length": 38.27272727272727, "alnum_prop": 0.5843230403800475, "repo_name": "fretboardfreak/space", "id": "ea0bb7d0742aff47575ca957ffa44c0a88ea20af", "size": "...
from Myro import * # Connect to the robot init() # This is the array that will hold all the pictures as Scribbler spins gif_images = [] # Set camera modes to make capturing faster setPicSize("small") autoCamera() # Now have Scribbler spin in a circle and take a picture with each small turn for i in range(34): s...
{ "content_hash": "a23bfbbaa9b3643f49bda26e4ca8f726", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 89, "avg_line_length": 31.625, "alnum_prop": 0.691699604743083, "repo_name": "CSavvy/python", "id": "737a0e65bfa4c2c50ae4c6f601c99b150052c6ac", "size": "1038", "binary": ...
import sys, getopt, requests, json def printusertext(p_message): #prints a line of text that is meant for the user to read #do not process these lines when chaining scripts print('@ %s' % p_message) def printhelp(): #prints help text printusertext('') printusertext('This is a script to claim a dev...
{ "content_hash": "12b1c5b94efd062690121ebb0effa85e", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 322, "avg_line_length": 36.59340659340659, "alnum_prop": 0.6720720720720721, "repo_name": "meraki/automation-scripts", "id": "c41c43b213bb887bb8cb3c45fdfd6f5d5b58ff22", "s...
import os, sys, shutil from datetime import date import glob from PIL import Image root_path = os.environ["HOME"] ############ # Parameters ############ raw_images_dir = f"{root_path}/ladvien.github.io/raw_images" images_dir = f"{root_path}/ladvien.github.io/images" max_size = 1800 max_file_size_kb = 400 compression...
{ "content_hash": "c3670908d4d3345794e5b6b773402b4b", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 161, "avg_line_length": 29.422764227642276, "alnum_prop": 0.5871787786681404, "repo_name": "Ladvien/ladvien.github.io", "id": "9e83db3f2387495bd0371a241cbe24952dc8157e", "...
from Metric import Metric class RPM(Metric): def __init__(self, name, value): Metric.__init__(self, name) self.value = value
{ "content_hash": "27efb43b9d03818b69385a84ae2dc98c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 36, "avg_line_length": 29, "alnum_prop": 0.6068965517241379, "repo_name": "USCSolarCarStrategyTeam/telemetry-pi", "id": "5b341fe9e6cef53f539a08f901ade9c9cb0d5e88", "size": "...
import sys import os from datetime import datetime as dt import re from glob import glob import numpy as np import json import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt ##------------------------------------------------------------------------- ## Main Program ##---------------------------...
{ "content_hash": "6b9bd6bfac2e5ffad53e86a2b5f3dde8", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 123, "avg_line_length": 42.07909604519774, "alnum_prop": 0.46415145005370567, "repo_name": "joshwalawender/KeckUtilities", "id": "d4efcf3ab215dbb474212af2764a0bfd8e3a0cc1", ...
from rest_framework import viewsets from .serializers import WineSerializer from .models import Wine class WineViewSet(viewsets.ReadOnlyModelViewSet): queryset = Wine.objects.all() serializer_class = WineSerializer
{ "content_hash": "681d41464e36a760e851958940b1ea8a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 49, "avg_line_length": 25.11111111111111, "alnum_prop": 0.8008849557522124, "repo_name": "ctbarna/cellar", "id": "ae69ea2d5f35ab3ee596aca98db999cfe124e9ab", "size": "226", ...
from pymongo import MongoClient from pymongo import ReadPreference import os import mysql.connector as mysql import time import datetime metrics_mysql_password = os.environ["METRICS_MYSQL_PWD"] sql_host = os.environ["SQL_HOST"] query_on = os.environ["QUERY_ON"] def upload_user_orcid_count(): """ Populates th...
{ "content_hash": "87bf7b2d6f6af2c73a423e6380f7a41e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 88, "avg_line_length": 30.692307692307693, "alnum_prop": 0.6441102756892231, "repo_name": "kbase/metrics", "id": "b801eefd6d45ec7437d7713168bbd8dc7bfd9aec", "size": "1596",...
""" Miscellaneous utility functions shared across all games. """ import random import readline from lib import term def Delay(): """Used as a delay instead of the traditional BASIC busy-wait.""" term.Write(term.RESET, '\n[Press Enter to continue.]') raw_input() def Hello(title, version): """Displays...
{ "content_hash": "6787bd03a08028d8839e66d6c758a9e8", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 69, "avg_line_length": 29.541666666666668, "alnum_prop": 0.614950634696756, "repo_name": "chaosotter/python-101-games", "id": "492a8cf63da835d1ee0083de0cdfe2e4b507013d", "s...
import os import sys import json import SocketServer import socket import time from datetime import datetime, timedelta from logsparser.lognormalizer import LogNormalizer as LN from threading import Thread, Lock from collectornetflow import find_flow, print_flow import collector_config import Queue from correlator imp...
{ "content_hash": "7fef2090b194c2bccf38a61f93709e59", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 134, "avg_line_length": 34.241379310344826, "alnum_prop": 0.5460221550855991, "repo_name": "ilmarh/collectors", "id": "af46b93ff2f716bf3e46cd68a3a72324462fe6e0", "size": "...
""" Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTfu...
{ "content_hash": "243302f5c850c5cb31fb618dec4ebfad", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 984, "avg_line_length": 30.98994974874372, "alnum_prop": 0.5949408140100535, "repo_name": "Chaffelson/whoville", "id": "e70d5a24680fcb1d36e4e008ba535550e239bddb", "size": ...
import os import xmltodict # sudo easy_install xmltodict import subprocess import zipfile class PackAndroid(object): def __init__(self, root, project_folder, project, input_apk, destination, keystore, keystore_alias, apk_name=None, zipalign=None, jarsigner=None, configuration='Release', keystore_password=None):...
{ "content_hash": "81c28c533207407fb592f3388734fc87", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 199, "avg_line_length": 38.837606837606835, "alnum_prop": 0.589018485915493, "repo_name": "skela/r", "id": "7909e7a1e55e682a2b4294c7b151519f39f02483", "size": "9111", "b...
import itertools import logging import numpy import operator import pprint import theano import theano.tensor as TT from theano.ifelse import ifelse import groundhog.utils as utils from groundhog.datasets import PytablesBitextIterator from groundhog.layers import \ Layer, \ MultiLayer, \ SoftmaxLayer, \ ...
{ "content_hash": "adc948014319680506ea3020c59c1686", "timestamp": "", "source": "github", "line_count": 1552, "max_line_length": 120, "avg_line_length": 40.22422680412371, "alnum_prop": 0.5380438264881143, "repo_name": "Komzpa/GroundHog", "id": "762b1fec70127219c8e667894370a0efd0086c2a", "size": "6...
from rest_framework import response, permissions from rest_framework.renderers import CoreJSONRenderer from rest_framework.views import APIView from drf_openapi.codec import OpenAPIRenderer, SwaggerUIRenderer from drf_openapi.entities import OpenApiSchemaGenerator class SchemaView(APIView): renderer_classes = (C...
{ "content_hash": "2efbf4af2dd81446a37be4b3c8e07a70", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 33.80952380952381, "alnum_prop": 0.7323943661971831, "repo_name": "limdauto/drf_openapi", "id": "c9cf8c04661671227d57d0628e7602d8f8966065", "size": "...
from pymongo import MongoClient from bson import ObjectId import os client = MongoClient('localhost', 27017) root = client.root print("Connected to db") basedir = os.getcwd() for dir in os.listdir(basedir): if dir != 'insert-image-names.py': print(dir) dbQuery1 = root.grounds.find({'_id': ObjectId(dir)}) gr...
{ "content_hash": "3b1dde5027334eedf1b9cfacd7e92ef0", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 54, "avg_line_length": 19.973684210526315, "alnum_prop": 0.6337285902503293, "repo_name": "nishank-jain/profile", "id": "fa31c8ac3096c124914e786458742080a5d1df0f", "size": ...
import unittest from typing import cast from pyspark.rdd import PythonEvalType from pyspark.sql import Row from pyspark.sql.functions import ( array, explode, col, lit, mean, sum, udf, pandas_udf, PandasUDFType, ) from pyspark.sql.types import ArrayType, TimestampType from pyspark.s...
{ "content_hash": "936e16c3c3d787388fd2e35bb2973f67", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 100, "avg_line_length": 36.0462962962963, "alnum_prop": 0.548831235550989, "repo_name": "xuanyuanking/spark", "id": "e67190fa58896db0de815181490c9dc22c67db2e", "size": "20...
__all__ = ['general', 'utils', 'movies', 'tv', 'library']
{ "content_hash": "e2e2fe3987ee441b7ed1e26199e5aea2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 57, "avg_line_length": 57, "alnum_prop": 0.5263157894736842, "repo_name": "Zo0x/hedhes", "id": "3b34406a8f716f25d8ef046bec49c10a26840a6b", "size": "57", "binary": false, ...
""" This module implements OpenFlow 1.3.x. This module also implements some of extensions shown in "OpenFlow Extensions for 1.3.X Pack 1". Namely, the following extensions are implemented. - EXT-236 Bad flow entry priority error Extension - EXT-237 Set async config error Extension - EXT-256 PBB UCA header...
{ "content_hash": "4ad723803b29105e4222c760e23630fe", "timestamp": "", "source": "github", "line_count": 6046, "max_line_length": 80, "avg_line_length": 36.19765133972874, "alnum_prop": 0.5336781645960037, "repo_name": "jalilm/ryu", "id": "cc2f3299ef23964df3fb30d7b22968a149445aa7", "size": "219534",...
import geopy.exc as exc import geopy.geocoders as geocoders class BaseError(Exception): pass class GeolocationFailure(BaseError): pass class GeolocationError(BaseError): pass class TemporaryError(BaseError): pass class Geolocator(object): def __init__(self): self._geocoder = geocod...
{ "content_hash": "6091e58289b3eb517ed91725be93c5d8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 27.217391304347824, "alnum_prop": 0.6006389776357828, "repo_name": "pyjobs/web", "id": "8a0f1e4af08ad618ee53ceb5ec02409012d3cc27", "size": "1276", ...
from neutron.extensions import providernet as provider from neutron.i18n import _LI from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) class Plumlib(object): """ Class PLUMgrid Fake Library. This library is a by-pass implementation for the PLUMgrid Library. This class i...
{ "content_hash": "eafe96a08feccf423bc22b9a5780bb50", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 76, "avg_line_length": 27.232323232323232, "alnum_prop": 0.6057121661721068, "repo_name": "cloudbase/neutron-virtualbox", "id": "a0f81fd53919763e089a618a17ef9d1bf2d818e7", ...
import random import pandas from sklearn.cross_validation import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score from sklearn.preprocessing import LabelEncoder from sklearn.utils import check_array import tensorflow as tf from tensorflow.contrib import la...
{ "content_hash": "5fbeeb0dd2c6138782da84aa153449be", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 102, "avg_line_length": 38.29761904761905, "alnum_prop": 0.7105999378302766, "repo_name": "ilblackdragon/tf_examples", "id": "2cd6c2493c3b94d0891c400b35f9c8e035e724cd", "si...
r""" I/O utils (:mod:`skbio.io.util`) ================================ .. currentmodule:: skbio.io.util This module provides utility functions to deal with files and I/O in general. Functions --------- .. autosummary:: :toctree: generated/ open_file open_files """ # ----------------------------------...
{ "content_hash": "3093e8ad477426ea6aa225a7de32d7e9", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 78, "avg_line_length": 26.838383838383837, "alnum_prop": 0.550621001129093, "repo_name": "JWDebelius/scikit-bio", "id": "362d19d264a67118ff15f296e11960d369653ccc", "size": ...
from gui.widgets.frames.notebooks import Notebook from gui.widgets.frames.tabs import TargetsTab, ExtractionTab, PlotTab import constants as c class SameTabsNotebook(Notebook.Notebook): def __init__(self, parent, name, row, column, **kwargs): Notebook.Notebook.__init__(self, parent, name, row, column, **k...
{ "content_hash": "72c42066a1856080abdebdec86ac0ee8", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 161, "avg_line_length": 36.84615384615385, "alnum_prop": 0.6586638830897703, "repo_name": "kahvel/VEP-BCI", "id": "603450369c987507b595bbe1cc43f70f802de0e1", "size": "4790...
import datetime from typing import Dict, List, Optional, TYPE_CHECKING, Union from ... import _serialization if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from .. import models as _models class AddressSpace(_serialization.Model): """AddressSpace contains an array of IP address rang...
{ "content_hash": "da94ab8ef25438719e9554222ddc7b53", "timestamp": "", "source": "github", "line_count": 16010, "max_line_length": 540, "avg_line_length": 45.1892567145534, "alnum_prop": 0.6541272737325151, "repo_name": "Azure/azure-sdk-for-python", "id": "2c64277facbc30bb4a26dea7c6e2dfeffdb754fe", ...
from elasticsearch import Elasticsearch from random import randint from collections import defaultdict import scipy.stats as stats import requests import time import re import subprocess import config import gzip import argparse import os import json #globals timeout=300 es = Elasticsearch( [{'host': config.elastic...
{ "content_hash": "68abb97782354ec855aaef1bc26f4b77", "timestamp": "", "source": "github", "line_count": 443, "max_line_length": 415, "avg_line_length": 35.12415349887133, "alnum_prop": 0.6422879177377891, "repo_name": "MRCIEU/melodi", "id": "ae0069de8637dec4732950ca143539e0ec1a5907", "size": "15560...
"""Service to cache specific Titan files in appserver memory. Documentation: http://code.google.com/p/titan-files/wiki/MemoryFilesService """ import os from titan.common import datastructures from titan.common import hooks from titan.files import files SERVICE_NAME = 'memory-files' # The default size of the MRU d...
{ "content_hash": "cd717d52c4f34ffe7184f6360b3da790", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 80, "avg_line_length": 37.714285714285715, "alnum_prop": 0.7175039872408293, "repo_name": "paulftw/titan-files", "id": "8aba4660d7d8ed1bb4fba65522458e88def80e45", "size": ...
import asyncio import sys def main(): """ Initialize the event loop and clean up when exitting. """ try: from .panel import start loop = asyncio.get_event_loop() loop.run_until_complete(start()) except KeyboardInterrupt: sys.exit(130) finally: pending =...
{ "content_hash": "f6a6d54ecc7b4f6789163f2b463fc975", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 57, "avg_line_length": 21, "alnum_prop": 0.554531490015361, "repo_name": "arianon/panel", "id": "333089cd788e4e3e95125ae51cf5288ed4039185", "size": "677", "binary": false...
from google.appengine.ext import ndb from flask.ext import wtf import flask import wtforms import auth import config import model import util from main import app import random # Generate useful random data from faker import Factory ############################################################################### #...
{ "content_hash": "8789d64122dffa270939605f0e6a1a4b", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 354, "avg_line_length": 35.65191146881288, "alnum_prop": 0.5949545685422428, "repo_name": "wodore/wodore-gae", "id": "b01d5fa89347bbb243bd9d39c140ad1875fc3b03", "size": "1...
from PyQt4 import QtGui, QtCore from ..ramps import KeyFrameList from CommonWidgets import MyDoubleSpinBox import rampage.format as fmt import rampage.server as server from DictEditor import DictEditor all_hooks_dict = dict(server.Hooks.default_mesgs) class QEditKeyFrameDialog(QtGui.QDialog): def __init__(self,...
{ "content_hash": "56346b7a7d9abd39a4cdb0137df2c405", "timestamp": "", "source": "github", "line_count": 473, "max_line_length": 82, "avg_line_length": 39.36363636363637, "alnum_prop": 0.5726408507438638, "repo_name": "shreyaspotnis/rampage", "id": "cd556f7a770726054e0e7d558ff0e9a6b451e173", "size":...
""" STARBURST ACC/FEANTA Server Runner Author: Lokbondo Kung Email: lkkung@caltech.edu """ import os import sys import time import signal import feanta_server import pdu_worker import brick_worker import bb_worker import cryostat_worker from daemon import runner def instantiate(pid_file, log_file): # ...
{ "content_hash": "68e7d49b638836dcb612ebb844cd1885", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 49, "avg_line_length": 22.10144927536232, "alnum_prop": 0.6065573770491803, "repo_name": "lokokung/Starburst-Front-End-Control-System", "id": "1e9da2d796f0170b3b027af2b227f3e...
"""Tests for tensorflow.ops.parsing_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import itertools import numpy as np from google.protobuf import json_format from tensorflow.core.example import example_pb2 from tensorflow.core.examp...
{ "content_hash": "7c84fd5ca2c9a3a6ac77808a3f645b61", "timestamp": "", "source": "github", "line_count": 1836, "max_line_length": 80, "avg_line_length": 35.007625272331154, "alnum_prop": 0.524566698820674, "repo_name": "ghchinoy/tensorflow", "id": "672f571fb96b42e274a70d376bea425c40f98ca7", "size": ...
from passrotate.provider import Provider, ProviderOption, PromptType, register_provider from passrotate.forms import get_form, get_form_data from bs4 import BeautifulSoup from urllib.parse import urlparse import requests class Linode(Provider): """ [linode.com] username=Your Linode username expires=Opt...
{ "content_hash": "72bdf6a0d138241f16122b1cc4f1708b", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 109, "avg_line_length": 39.68354430379747, "alnum_prop": 0.5830940988835726, "repo_name": "SirCmpwn/pass-rotate", "id": "e38c822917b7b3347c03287d6c2cc59f6f631309", "size": ...