text
stringlengths
4
1.02M
meta
dict
# encoding: utf-8 __author__ = "Nils Tobias Schmidt" __email__ = "schmidt89 at informatik.uni-marburg.de" ''' Utility for command-line interface ''' import sys from androlyze.log.Log import log, clilog from androlyze.model.script.ScriptUtil import dict2json from androlyze.error.AndroLyzeLabError import AndroLyzeLa...
{ "content_hash": "053e6f842e32b539a44311943d6e396e", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 137, "avg_line_length": 33.850515463917525, "alnum_prop": 0.5699710674585047, "repo_name": "nachtmaar/androlyze", "id": "115019e1ae29335493f953932c30a3b65c224a47", "size":...
""" WSGI config for todo_social project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo_social.settings") from djan...
{ "content_hash": "941eb258259dbc94b9d085125e14e5bd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 27.22222222222222, "alnum_prop": 0.789795918367347, "repo_name": "ViniciusCPSouza/labcodes_interview", "id": "83ad0fbde221107492990ee28155e0291b2bc7fa"...
__all__ = ['User','functools','time','Hash','LatLon','channel','ShardCounter'] import User import functools import time import Hash import LatLon import channel import ShardCounter
{ "content_hash": "8949f17da8761a6572c76f037fad54e9", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 20.11111111111111, "alnum_prop": 0.7569060773480663, "repo_name": "HunterLarco/Jiro", "id": "370e9fa5212c54131a5647d954bdd7538a31e751", "size": "181",...
# Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In simplest use, end each module M to be tested with: def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test() Then runni...
{ "content_hash": "8dcb35579460f2f9991c1e9b237ccc69", "timestamp": "", "source": "github", "line_count": 2812, "max_line_length": 79, "avg_line_length": 38.35348506401138, "alnum_prop": 0.5558831710709319, "repo_name": "Jeff-Tian/mybnb", "id": "07ea28b1c05e96a164e2426e63d926d984144a19", "size": "108...
"""Support for LCN devices.""" from __future__ import annotations from collections.abc import Callable from functools import partial import logging import pypck from homeassistant import config_entries from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE_ID, CONF_DOMAIN, CONF_IP_ADDRESS, C...
{ "content_hash": "688dc5153b1f72a73bae7ebec4a10432", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 109, "avg_line_length": 32.78217821782178, "alnum_prop": 0.6413973623275949, "repo_name": "nkgilley/home-assistant", "id": "d4a20c4d84926f1978692751bf892f35e965eddd", "siz...
def read_line_by_line(filepath): koleksi_nama = list() with open(filepath) as f: for line in f: koleksi_nama.append(line) koleksi_nama = [x.strip() for x in koleksi_nama] if type(koleksi_nama) is list: return koleksi_nama else: print("Data ...
{ "content_hash": "cff509da2fc4f1503994aaf5bf54f7d9", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 33.36363636363637, "alnum_prop": 0.547683923705722, "repo_name": "eufat/gender-ml", "id": "63d67bcdcea1151bda1e24fbd401591b52919ec2", "size": "367", ...
""" Driver for EMC ScaleIO based on ScaleIO remote CLI. """ import base64 import binascii import json import math from os_brick.initiator import connector from oslo_config import cfg from oslo_log import log as logging from oslo_utils import units import requests import six from six.moves import urllib from cinder i...
{ "content_hash": "b5d33d91cfdfd0772013b6ed5ebb8f60", "timestamp": "", "source": "github", "line_count": 1334, "max_line_length": 79, "avg_line_length": 43.29985007496252, "alnum_prop": 0.542519303348222, "repo_name": "bswartz/cinder", "id": "43412aec489e0e61ebc9988b21c9a5cd9ec3fc0b", "size": "58404...
"""Text formatting drivers for ureports""" from pylint.reporters.ureports import BaseWriter TITLE_UNDERLINES = ["", "=", "-", "`", ".", "~", "^"] BULLETS = ["*", "-"] class TextWriter(BaseWriter): """format layouts as text (ReStructured inspiration but not totally handled yet) """ def begin_format(...
{ "content_hash": "62136fdb93bd42c73bb30d25d036a951", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 34.03488372093023, "alnum_prop": 0.5633754697642638, "repo_name": "ruchee/vimrc", "id": "17272080beb4d05eb596c61bfca77ef04357a3ea", "size": "3419", ...
"""Tests the Tensorboard debugger data plugin.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import json import os import shutil import numpy as np from werkzeug import test as werkzeug_test from werkzeug import wrappers from tenso...
{ "content_hash": "190537df068d9146f128c6456f24a2d6", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 80, "avg_line_length": 35.67482517482517, "alnum_prop": 0.623542095462119, "repo_name": "abhitopia/tensorflow", "id": "f1cc2e06da2f8d3af8726c94f54ffb746d4c18a9", "size": "...
""" Unit Tests for cinder.volume.rpcapi """ import copy from oslo_config import cfg from oslo_serialization import jsonutils from cinder import context from cinder import db from cinder import objects from cinder import test from cinder.tests.unit import fake_snapshot from cinder.volume import rpcapi as volume_rpcapi...
{ "content_hash": "09c3b0161b5f76c88fa7951341d712d5", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 78, "avg_line_length": 40.57654723127036, "alnum_prop": 0.4654411174440074, "repo_name": "saeki-masaki/cinder", "id": "6cf41376ec3a2a97832ecb83f1f4e9e55bd43a20", "size": "...
__author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) DEBUG = True if __name__ == '__main__' else False class BasicCalculator: """All methods here have type checking in place so that bad inputs are auto...
{ "content_hash": "2f677db774a02ff3f6dd08013b4e1435", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 76, "avg_line_length": 27.866666666666667, "alnum_prop": 0.6154306220095693, "repo_name": "christabor/MoAL", "id": "ac305dd3d7e11f9a3681469ee2cb62af4647cd7a", "size": "1697...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import atexit import errno import os import shutil import stat import tempfile import threading import uuid from collections import defaultdict from contextlib import ...
{ "content_hash": "50d7f4ede95a2858a09e1c28becaa5a9", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 117, "avg_line_length": 33.638297872340424, "alnum_prop": 0.6855154965211891, "repo_name": "landism/pants", "id": "0eae524ed21fe159e71f915092b2a7727d6957dd", "size": "1595...
import json from collections import OrderedDict from datetime import datetime from typing import TYPE_CHECKING import humanize import transaction import yaml from pyramid.httpexceptions import ( HTTPBadRequest, HTTPConflict, HTTPException, HTTPFound, HTTPMovedPermanently, HTTPNotFound, HTTP...
{ "content_hash": "9bbb66f31dffbba73f447bc5b76aee4e", "timestamp": "", "source": "github", "line_count": 1029, "max_line_length": 120, "avg_line_length": 50.36734693877551, "alnum_prop": 0.5994250212240487, "repo_name": "Ouranosinc/Magpie", "id": "8a2a68fe551c715f481aaf3d7fb812c00620f56b", "size": "...
"""This example creates a product base rate. To determine which base rates exist, run get_all_base_rates.py. """ # Import appropriate modules from the client library. from googleads import ad_manager PRODUCT_ID = 'INSERT_PRODUCT_ID_HERE' RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE' def main(client, product_id, rate...
{ "content_hash": "69653585f34fe6beac30fbbf95ca66df", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 29.836734693877553, "alnum_prop": 0.6306429548563611, "repo_name": "Aloomaio/googleads-python-lib", "id": "96c38e7386656952066f8d84052dad78df7a5579", ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from flexget.api.app import base_message from flexget.api.plugins.tmdb_lookup import ObjectsContainer as oc from flexget.utils import json @pytest.mark.onl...
{ "content_hash": "51de7aaa080c9cab0defd7e42df721c8", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 36.5, "alnum_prop": 0.6186012977649603, "repo_name": "drwyrm/Flexget", "id": "d78bd6f7109fcdfd303759e6e6052ebf57036915", "size": "2798", "binary": ...
__author__ = 'Peter Zhu' #!/usr/bin/env python import subprocess, sys, os, re, json, codecs import shutil import xml.dom.minidom as dom from chameleon_gen import * from optparse import OptionParser import json def makeCfg(channelcfgroot, channel): icfg = dict([]) jcfg = json.loads('{"projectName":"sanguofire...
{ "content_hash": "f81d669ddf6aa8eda4f0caa34323c14b", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 380, "avg_line_length": 42.943396226415096, "alnum_prop": 0.6410369068541301, "repo_name": "ucloud/chameleon", "id": "61e9cd08b7ef91771fee9d8311198b94fe1ea5df", "size": "22...
from bs4 import BeautifulSoup import sys import requests import os def run_application(): page_in_html = download_page() images_links = find_images(page_in_html) download_images('images', images_links) def download_page(): address = r"http://www.filmweb.pl/ranking/film" response = requests.get(a...
{ "content_hash": "2a23bd62b3f4fe9c228a5db11f1ac24e", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 71, "avg_line_length": 24.48148148148148, "alnum_prop": 0.5975794251134644, "repo_name": "Adamage/python-training", "id": "2883a54371aa8378a64bc109a1192703e506dc0b", "size"...
import socket import socks import time import json import threading import string import random import sys import struct import re import os from OpenSSL import crypto import ssl from core.alert import * from core.targets import target_type from core.targets import target_to_host from core.load_modules import load_file...
{ "content_hash": "5f5879548c60740f7460a65fa0989008", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 467, "avg_line_length": 50.4311377245509, "alnum_prop": 0.5584184279268583, "repo_name": "viraintel/OWASP-Nettacker", "id": "98520870d17927c5d92f9355ed8042636ed623d5", "si...
from __future__ import absolute_import, unicode_literals, print_function import os from unittest import TestCase from speicher import Speicher, exceptions class SpeicherTest(TestCase): def setUp(self): host = os.environ.get(b'SERVER_HOST', b'localhost') port = int(os.environ.get(b'SERVER_PORT',...
{ "content_hash": "1da46d9b7be6de6219eba377e2d746a8", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 72, "avg_line_length": 33.813559322033896, "alnum_prop": 0.6325814536340852, "repo_name": "blackwithwhite666/speicher", "id": "8b4605344c523bae250701f742120908160b8bbb", "s...
"""DNN model with Mel spectrum and fully connected layers.""" from kws_streaming.layers import modes from kws_streaming.layers import speech_features from kws_streaming.layers import stream from kws_streaming.layers.compat import tf import kws_streaming.models.model_utils as utils def model_parameters(parser_nn): "...
{ "content_hash": "8663f2ea837cec4f0d569b5686de18d6", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 91, "avg_line_length": 37.24418604651163, "alnum_prop": 0.6955978769903216, "repo_name": "google-research/google-research", "id": "bf5ddb65a6d031142838f13d6dae372e658d0c54", ...
from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.utils.typechecks import assert_is_type from h2o.frame import H2OFrame from random import randrange import numpy as np import math def h2o_H2OFrame_trunc(): """ Python API test: h2...
{ "content_hash": "e4a5b0bd3520eacb42a6ac03eb09ec4b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 28.90625, "alnum_prop": 0.68, "repo_name": "h2oai/h2o-dev", "id": "50c60b1e3aa7eed793795b4984e08bd93dd2e366", "size": "925", "binary": false, "co...
import argparse import datetime import logging import os import re import subprocess import sys #-------------------------------------------------------------------------------------------------------------------------------------------------------------- class HeaderPrefix( object ): __template = ( '//\n' ...
{ "content_hash": "e9f2c3f3ac6b462bec91ba01c1f148e7", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 160, "avg_line_length": 32.204819277108435, "alnum_prop": 0.5193914453173712, "repo_name": "DTolm/VkFFT", "id": "e58e49ec776ac99f70905f6a51d769d07539e54b", "size": "8979",...
""" Created on Sun Feb 01 21:14:41 2015 @author: me@corytodd.us """ from threading import Thread import time class Monitor(object): """ Essentially a resetable stopwatch that acts like a timeout handler """ def __init__(self, interval, dead_fn): self.interval = interval self.dead_...
{ "content_hash": "b4d5d559af81ae10f9b856f69c4b9fc8", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 62, "avg_line_length": 16.864197530864196, "alnum_prop": 0.4773060029282577, "repo_name": "corytodd/soft-bill", "id": "d5dedcd5a4a769be14697000352b8e035d1fd5f8", "size": "1...
class TeachingHierarchy: def __init__(self, year): self.year = year def get_teaching_years(self): return self.year class SchoolYear: def __init__(self, name, classes): self.name = name self.classes = classes def get_teaching_classes(self): return self.classes def get_name(self): return self.name cla...
{ "content_hash": "30b69aa6fab48c00e6082f7ee6a7c274", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 51, "avg_line_length": 22.576923076923077, "alnum_prop": 0.7052810902896082, "repo_name": "varun-verma11/CodeDrill", "id": "f7738624f46050d7c74708cab51ce2b6c39f649d", "size...
import random def quicksort(integers): """Sorts a given array of integers using quicksort algorithm""" sort(integers, 0, len(integers)) print "final array: ", integers def sort(integers, start, stop): """Recursive function to split array in two parts""" if start != stop: ...
{ "content_hash": "792c1d0d69a78053da0c3e39d042bf98", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 59, "avg_line_length": 28.76595744680851, "alnum_prop": 0.5931952662721893, "repo_name": "agodi/Algorithms", "id": "bde32396a8dd68fcea4de11df50326467227effb", "size": "1352...
""" classify_task_wholebrain.py - classify task in openfmri data - train on run 1, test on run 2 """ ## Copyright 2011, Russell Poldrack. All rights reserved. ## Redistribution and use in source and binary forms, with or without modification, are ## permitted provided that the following conditions are met: ## 1. ...
{ "content_hash": "567811111e09b8e14b6cfe7c67f1ece6", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 95, "avg_line_length": 35.2125, "alnum_prop": 0.7447639332623358, "repo_name": "poldrack/openfmri", "id": "5d2f97aaa9b47deeee32c6c56c92bcca8c221c3b", "size": "2839", "bin...
from oslo_log import log as logging from oslo_utils import importutils from nova import exception from nova.i18n import _LW, _LI libosinfo = None LOG = logging.getLogger(__name__) # TODO(vladikr) The current implementation will serve only as a temporary # solution, due to it's dependency on the libosinfo gobject lib...
{ "content_hash": "82588ca1e61bf94f55377cb8fefc0855", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 76, "avg_line_length": 33.778688524590166, "alnum_prop": 0.5741324921135647, "repo_name": "hanlind/nova", "id": "f0d27968d7bae426faa4bb64a139ba99bbd083c5", "size": "4696",...
import os try: from nltk.corpus import stopwords stopset = set(stopwords.words('english')) except ImportError: print("Cannot use dbpedia without 'pip install nltk'") try: import ujson as json except ImportError: import json def generate_testables(words, stopword_set, n_grams=4): grams = set(...
{ "content_hash": "6436a9fa435186d4744f25edf346d605", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 78, "avg_line_length": 29.215686274509803, "alnum_prop": 0.5275167785234899, "repo_name": "bgarrels/sky", "id": "b0029faa435ce9e7b626c9463742aeee169e6735", "size": "1490", ...
from smv import * class X(SmvCsvStringData): """This is the test DS X's docstring It is multi lines. with "double" quotes and 'single' quote """ def schemaStr(self): return "k:String;v:Integer" def dataStr(self): return "a,1;b,2" class Y(SmvModule): def requiresDS(s...
{ "content_hash": "f9eeb99a2f3cdc8b32d613769d5a733a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 47, "avg_line_length": 21.72222222222222, "alnum_prop": 0.578005115089514, "repo_name": "TresAmigosSD/SMV", "id": "b5634cdf34f45014fc3440fb542ed89ebb004196", "size": "951",...
"""Simple HTTP Server for Brython Development. Files are served from subdirectory www, except cgi scripts that are served from subdirectory cgi-bin """ import os import sys from webbrowser import open_new_tab import argparse import email import datetime import urllib.parse from http import HTTPStatus import socketser...
{ "content_hash": "4ca0dc15294443c36b7c0734262d7a23", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 80, "avg_line_length": 38.41958041958042, "alnum_prop": 0.5738987986894795, "repo_name": "jonathanverner/brython", "id": "ac43f7cfef3bc4068d73afd1570ca19d3653cf14", "size"...
""" Provides code to morph a chunk of data to a given probability distribution. The class provides an interface to morph a network packet's length to a previously generated probability distribution. The packet lengths of the morphed network data should then match the probability distribution. """ import random impo...
{ "content_hash": "6ee20e33fe3c35b9bcf5da907ef2ba3b", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 32.6231884057971, "alnum_prop": 0.643269657929809, "repo_name": "NullHypothesis/obfsproxy", "id": "4a72f0b19ee3d0b3e9402a2903ecd3d461bf3371", "size":...
"""Sphinx extension for listing code contributors to a release. Usage:: .. contributors:: v0.23.0..v0.23.1 This will be replaced with a message indicating the number of code contributors and commits, and then list each contributor individually. """ from docutils import nodes from docutils.parsers.rst import Direc...
{ "content_hash": "90e245c03df06b8915efef20378efa7b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 73, "avg_line_length": 27.732142857142858, "alnum_prop": 0.5917578879587895, "repo_name": "cbertinato/pandas", "id": "7794a24dad89b7a5fb69651030190683a508c050", "size": "15...
"""Outputs the ordered list of the top 30 closest WiFi devices.""" import time import heapq __author__ = 'Caleb Madrigal' __email__ = 'caleb.madrigal@gmail.com' __version__ = '0.0.1' __apiversion__ = 1 TOP_N_TO_SHOW = 20 class Trigger: def __init__(self): # Maps from dev_id to last seen signal/power lev...
{ "content_hash": "669ff65bcd85e8c973f8ae67b35d9be1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 120, "avg_line_length": 33.12, "alnum_prop": 0.6123188405797102, "repo_name": "calebmadrigal/trackerjacker", "id": "0b6e4a99b51223b03505f9a7ca76702eaba916ae", "size": "828"...
""" Testing example in README.md """ import os import pytest from yass import command_line as cli @pytest.fixture def path_to_config_sample(): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config_sample.yaml') return path @pytest.fixture def path_to_output(): ...
{ "content_hash": "785748a76a3a1f2bc113564453861be2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 68, "avg_line_length": 22.153846153846153, "alnum_prop": 0.6440972222222222, "repo_name": "jinhyunglee/yass", "id": "ce0b23b7ccbac5348d5186ba75ee43a366817b05", "size": "576...
"""Default values. """ renormalization = 1 # Renormalization paramter (0 <= alpha <= 1). num_eigenpairs = 11 # Number of eigenvalue/eigenvectors to obtain. try: import pycuda.autoinit # noqa except ImportError: use_cuda = False # Use CPU code. else: use_cuda = Tru...
{ "content_hash": "00e5feab4526d525ea5f2cff364b3932", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 25.857142857142858, "alnum_prop": 0.5911602209944752, "repo_name": "jmbr/diffusion-maps", "id": "5f55852cdef34e0ea8dc3f3ca771521201cc0c56", "size": "...
""" ========================================== From raw data to dSPM on SPM Faces dataset ========================================== Runs a full pipeline using MNE-Python: - artifact removal - averaging Epochs - forward model computation - source reconstruction using dSPM on the contrast : "faces - sc...
{ "content_hash": "99b94f3a634fc991f01ffe2b687ce1e3", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 79, "avg_line_length": 34.82575757575758, "alnum_prop": 0.6349793343484882, "repo_name": "mne-tools/mne-tools.github.io", "id": "c0a0943a887bffd524beaa2d541f004834d1c8af", ...
import os from conans.client.build.compiler_flags import rpath_flags from conans.model import Generator """ PC FILE EXAMPLE: prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: my-project Description: Some brief but informative description Version: 1.2.3 Libs: -L${libdir} ...
{ "content_hash": "c9e968534cbfb119af0a9dcf4253c48c", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 98, "avg_line_length": 35.94174757281554, "alnum_prop": 0.5788762830902215, "repo_name": "birsoyo/conan", "id": "2878dbc05d5e29842b12c82a3ba6508198793363", "size": "3702",...
from sippy.SipGenericHF import SipGenericHF from functools import reduce class SipAllow(SipGenericHF): hf_names = ('allow',) methods = None def __init__(self, body = None, methods = None): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.m...
{ "content_hash": "dde0e305d5d9a89562672557f412e10e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 27.166666666666668, "alnum_prop": 0.5779141104294478, "repo_name": "sippy/b2bua", "id": "1c7814d71bdc8e6e69c32491b8d29deee1ec89b5", "size": "2246", ...
import unicodedata from fontTools.agl import AGL2UV from defcon.tools import unicodeTools from defcon.objects.base import BaseDictObject class UnicodeData(BaseDictObject): """ This object serves Unicode data for the font. **This object posts the following notifications:** =================== ==== ...
{ "content_hash": "8b0a4277d67c73c22876bbb972ddf2a5", "timestamp": "", "source": "github", "line_count": 1327, "max_line_length": 142, "avg_line_length": 36.4016578749058, "alnum_prop": 0.59602525618466, "repo_name": "typemytype/defcon", "id": "5e6db8d80b0d41aa5897ec9852a6d23b9aecfafd", "size": "483...
from oslo_config import cfg from kiloeyes.openstack.common import log LOG = log.getLogger(__name__) OPTS = [ cfg.StrOpt('index_name', default='', help='The pre-configured index name.'), ] cfg.CONF.register_opts(OPTS, group="fixed_strategy") class FixedStrategy(object): """Thi...
{ "content_hash": "bb5f1570624ca29e11ee4e9ee9cdffef", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 23.458333333333332, "alnum_prop": 0.6465364120781527, "repo_name": "litong01/python-monasca", "id": "97fb487bcae0f289e0854101644cddd87125f171", "size...
import doctest import unittest import httplib import oauth2 as oauth from sitebucket import SiteStream REAL_HTTPSConnection = httplib.HTTPSConnection REAL_HTTPConnection = httplib.HTTPConnection try: # Create a file called test_settings.py in the same dir as this file to # override the settings in the exce...
{ "content_hash": "f5361c207c90c2e86dead4eebca8feb1", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 78, "avg_line_length": 35.975806451612904, "alnum_prop": 0.6489576328177539, "repo_name": "thomasw/sitebucket", "id": "4657dbba85731401046b3ae19dccd7768c1bdddb", "size": "...
"""Generate an updated requirements_all.txt.""" import difflib import importlib import os from pathlib import Path import pkgutil import re import sys from homeassistant.util.yaml.loader import load_yaml from script.hassfest.model import Integration COMMENT_REQUIREMENTS = ( "Adafruit_BBIO", "Adafruit-DHT", ...
{ "content_hash": "704762c7143a947cf922b90f2e01096b", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 88, "avg_line_length": 27.401515151515152, "alnum_prop": 0.6109114367339415, "repo_name": "partofthething/home-assistant", "id": "94365be9a50f44741b2ac22e47283867fb0b0099", ...
__author__ = "Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ LSF job adaptor implementation """ import radical.utils.which import radical.utils.threads as sut import saga.url as surl import saga.utils.pty_shell import saga.adaptors.base import saga.adaptors.cpi.jo...
{ "content_hash": "a46fac06eb10d7df64d942c43643622f", "timestamp": "", "source": "github", "line_count": 1036, "max_line_length": 189, "avg_line_length": 35.69498069498069, "alnum_prop": 0.47509464575446186, "repo_name": "mehdisadeghi/saga-python", "id": "8b347f48bbaa87e34d6dc8694ba5c8568e04d6b1", "...
"""Simple encrypted enviroment variables Inspired by ansible's vault but simpler and with fewer dependencies (though not as featureful), mums encrypts environment variables to a file that you can store in your repository. The only thing you *have to* keep a secret ("mum's the word") is the keyfile. A keyfile can be a...
{ "content_hash": "0fd5039665e0437785923036e936510a", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 92, "avg_line_length": 29.437262357414447, "alnum_prop": 0.637173856884526, "repo_name": "pterk/mums", "id": "75624b20d1c41205bf49d17a38b27ef8e53cc8d5", "size": "7765", ...
import sys, os, time, re, sets import rrdtool import psutil RUNDIR = os.path.dirname(os.path.realpath(__file__)) #paths for rrd files RRDSDIR = os.path.join(RUNDIR, 'rrds') cpuRRDFile = os.path.join(RRDSDIR, 'cpustatus.rrd') cpuTempRRDFile = os.path.join(RRDSDIR, 'cputemp.rrd') pidsRRDFile = os.path.join(RRDSDIR, 'pid...
{ "content_hash": "898ced68faf2e8d284d8460e4ddbfdf2", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 119, "avg_line_length": 33.29694323144105, "alnum_prop": 0.5830819672131148, "repo_name": "dmitryikh/rpi-monitor", "id": "6b219a88c12521e8e65abefc6ecf11d8637ca0de", "size"...
''' Fileserver backend which serves files pushed to the Master The :mod:`cp.push <salt.modules.cp.push>` function allows Minions to push files up to the Master. Using this backend, these pushed files are exposed to other Minions via the Salt fileserver. To enable minionfs, :conf_master:`file_recv` needs to be set to ...
{ "content_hash": "180aa366318e48d579404f5a925e87b8", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 103, "avg_line_length": 33.23351648351648, "alnum_prop": 0.5783252045961809, "repo_name": "stephane-martin/salt-debian-packaging", "id": "0149ee98fe2e9b9ff21c49efa579a6ff9c0...
import bpy from bpy_extras.node_utils import find_node_input from bl_ui.utils import PresetPanel from bpy.types import Panel from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel class CYCLES_PT_sampling_presets(PresetPanel, Panel): bl_label = "Sampling Presets" preset_subdir = "cycles...
{ "content_hash": "ccea8337e9f28cd4ba25248a9c0fc44f", "timestamp": "", "source": "github", "line_count": 2429, "max_line_length": 136, "avg_line_length": 31.518731988472624, "alnum_prop": 0.6208936898339843, "repo_name": "tangent-opensource/coreBlackbird", "id": "e5b93230b19174a02d1e9d0a6c8bf943203d04...
""" byceps.blueprints.monitoring.metrics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Metrics export for `Prometheus <https://prometheus.io/>`_ :Copyright: 2014-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from flask import Response from ....services.metrics import service as metrics...
{ "content_hash": "c4343fd40b4e47c258750fcd97607686", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 26.153846153846153, "alnum_prop": 0.6911764705882353, "repo_name": "homeworkprod/byceps", "id": "8450a80ea7cf4eba2ad642ea53899268c3ed83a0", "size": "...
from django.conf.urls import patterns, url from django.contrib.auth.decorators import login_required from notes.views import (NoteCreateView, NoteDeleteView, NoteDetailView, NoteUpdateView) # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = pa...
{ "content_hash": "619c081475c903749a43085920be4494", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 35.19047619047619, "alnum_prop": 0.6806495263870095, "repo_name": "nadavge/notejam", "id": "8f12af5c5dedb1954a8b89b9435831b1a904e898", "size": "739",...
''' This module defines one class and one function: - Moves: a class for running MOVES. - getDefaultAgeDistribution: a function for retrieving a national-level default age distribution from MOVES How to Use this Module ====================== 1. Import the module: ``import movespy.moves`` 2. Construct the initiali...
{ "content_hash": "c0ef4ec3f0ec311c61684b8b5cf1ab23", "timestamp": "", "source": "github", "line_count": 613, "max_line_length": 118, "avg_line_length": 32.848287112561174, "alnum_prop": 0.5319825188716726, "repo_name": "ericstalbot/movespy", "id": "5a6594c5bc58d00cf85393857257867a852aa676", "size":...
from .stop_words import STOP_WORDS from ...language import Language, BaseDefaults class EstonianDefaults(BaseDefaults): stop_words = STOP_WORDS class Estonian(Language): lang = "et" Defaults = EstonianDefaults __all__ = ["Estonian"]
{ "content_hash": "858bf5bcd677a599ac6320f6dd35242c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 46, "avg_line_length": 17.928571428571427, "alnum_prop": 0.7131474103585658, "repo_name": "honnibal/spaCy", "id": "274bc13093024bec6e63b47e1171baf4ab10ee7c", "size": "251",...
import factory from django.contrib.auth.models import User from django.utils.timezone import now from shop.models import (Product, Stamp, Order, OrderDetails, Voucher) class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = User first_name = 'DRF' last_name = 'Test' username = 'drftest' pass...
{ "content_hash": "e9c226ae5c453fe3f4f1b59ccc775b38", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 70, "avg_line_length": 22.150943396226417, "alnum_prop": 0.7197614991482112, "repo_name": "andreagrandi/drf3-test", "id": "460acef1517ca7c1b2cd2008f00f277ef9d4143f", "size"...
import ucloudapi api = 'http://example.com:8080/client/api' apikey = 'API KEY' secret = 'API SECRET' cloudstack = CloudStack.Client(api, apikey, secret) job = cloudstack.deployVirtualMachine({ 'serviceofferingid': '2', 'templateid': '214', 'zoneid': '2' }) print "VM being deployed. Job...
{ "content_hash": "390bf57b2f27d5e5623e82d9762b1f6c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 24.9, "alnum_prop": 0.6204819277108434, "repo_name": "hongiiv/CloudStack_for_ucloudbiz", "id": "6503a4c0c7af473a56454f6594a4079607de83b6", "size": "5...
__author__ = 'eso' import sys sys.path.append('../../') import re import pywikibot from pywikibot import proofreadpage def add_zeros(number, digits): number_str = str(number) if number < 10: for members in range(digits-1): number_str = "0" + number_str elif number < 100: for mem...
{ "content_hash": "bd9bcd12af45757f03b1ace0df5e4631", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 116, "avg_line_length": 33.470588235294116, "alnum_prop": 0.6335676625659051, "repo_name": "the-it/WS_THEbotIT", "id": "65a8749a42b2e8171a46b5348f64a8c1ed848f68", "size": "...
from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, OAuthCallbackView) from allauth.socialaccount.models imp...
{ "content_hash": "c7c7ae4ae45e7066919edc4bbefe2d89", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 86, "avg_line_length": 39.12765957446808, "alnum_prop": 0.6389342033713975, "repo_name": "rawjam/django-allauth", "id": "6a1436a7eb08e5f7df3ebc9d54d22a623b47744a", "size": ...
""" test_plushcapclone ---------------------------------- Tests for `plushcapclone` module. """ import unittest from plushcapclone import plushcapclone class TestPlushcapclone(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(self): pass i...
{ "content_hash": "04da652f0d48f1283a8946b38d039585", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 43, "avg_line_length": 14.6, "alnum_prop": 0.5835616438356165, "repo_name": "devinrader/plushcapclone", "id": "e31f673845aecb5a5611968c8534a3db8553baf1", "size": "412", "...
"""ML training task.""" import glob import os import sys from clusterfuzz._internal.base import utils from clusterfuzz._internal.bot.fuzzers.ml.rnn import constants from clusterfuzz._internal.bot.tasks import ml_train_utils from clusterfuzz._internal.datastore import data_handler from clusterfuzz._internal.google_clo...
{ "content_hash": "72b4162be0f5c167aaca82d4751c8972", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 34.81297709923664, "alnum_prop": 0.7035412783685999, "repo_name": "google/clusterfuzz", "id": "31636c681e1bc95ff14b482fcbd0a47a975b385f", "size": "9...
''' Module for junk ads filtering based on keywords. Need upgrades if performance problem appears in the future. ''' from app import constant try: file = open(constant.KEYWORDS_FILE) except IOError: file = open(constant.KEYWORDS_FILE, 'x') file.close() file = open(constant.KEYWORDS_FILE) keywords = [k...
{ "content_hash": "b6a911d9bbe75bde491e361c2c7635f2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 25.05, "alnum_prop": 0.688622754491018, "repo_name": "hbprotoss/weii", "id": "b547bf155c9e9cea8f67960339aefa91af446641", "size": "517", "binary": f...
'''Peptide module.''' from ._sequence import Sequence class Peptide(object): '''Peptide sequence.''' def __init__(self, peptide, features=None, run_checks=True): ''' :param peptide: Input sequence (peptide). :type peptide: str :param run_checks: Check inputs / formats (disabli...
{ "content_hash": "1192f029880c95ac7b54ac971f38e7c3", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 78, "avg_line_length": 29.701923076923077, "alnum_prop": 0.5415992230495306, "repo_name": "klavinslab/coral", "id": "37c3038aaa740eb1eaf1cff99e5886dde0f75f67", "size": "30...
"""This module is deprecated. Please use `airflow.providers.microsoft.azure.sensors.azure_cosmos`.""" import warnings # pylint: disable=unused-import from airflow.providers.microsoft.azure.sensors.azure_cosmos import AzureCosmosDocumentSensor # noqa warnings.warn( "This module is deprecated. Please use `airflow...
{ "content_hash": "18733f8091196fe523966d8bb44c3115", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 102, "avg_line_length": 34.666666666666664, "alnum_prop": 0.78125, "repo_name": "DinoCow/airflow", "id": "3fdce37d55673928ff6fec008abfbd35bab28879", "size": "1203", "bina...
import pyinotify import os import subprocess wm = pyinotify.WatchManager() class Handler(pyinotify.ProcessEvent): def process_default(self,event): fn = event.pathname if not fn.endswith(".py"): return print("Running: "+fn) if os.access(fn, os.X_OK): # File is executable (presumably with a shebang). # Run...
{ "content_hash": "b1b63ccffe5e0889163db066b1cf5cce", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 58, "avg_line_length": 33.95454545454545, "alnum_prop": 0.7202141900937081, "repo_name": "Rosuav/shed", "id": "3e9d0174844fc7ed1d96d5adfa24559fec131ad3", "size": "842", "...
"""Support for LiteJet switch.""" import logging from homeassistant.components.switch import SwitchEntity from .const import DOMAIN ATTR_NUMBER = "number" _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass, config_entry, async_add_entities): """Set up entry.""" system = hass.data[DOMA...
{ "content_hash": "ed919392451ea7f46d187a6701cde701", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 85, "avg_line_length": 29.45263157894737, "alnum_prop": 0.6193709792709078, "repo_name": "jawilson/home-assistant", "id": "0feabfbf864ff351f51ce071ad9337b3a4cf8eab", "size"...
import time import picamera def take_and_save_photo(camera_settings, file_path_name): # Take a photo and save it in the given file path name # file_path_name includes a relative or absolute path to the file with picamera.PiCamera() as camera: camera.resolution = (camera_settings.horizontal_resolut...
{ "content_hash": "44fb6bd62d9607e95527fbb935689b5e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 33.77777777777778, "alnum_prop": 0.680921052631579, "repo_name": "tomhotch/timelapse", "id": "739be2cc5a20fe9727072a9aa046aa414e4ad242", "size": "608...
""" Helper to cal tsrc's main() function. Used by the `tsrc_cli` fixture. """ from typing import Any, Type import os from path import Path import pytest import cli_ui as ui import tsrc import tsrc.cli.main class CLI: def __init__(self) -> None: self.workspace_path = Path(os.getcwd()) def run(self...
{ "content_hash": "3f986fc8cf8283d936f8131911781789", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 83, "avg_line_length": 25.142857142857142, "alnum_prop": 0.6231060606060606, "repo_name": "TankerApp/tsrc", "id": "ca3ff722229f2ffba79df799374d60a4751c1354", "size": "1056"...
from numpy import * import random import time import csv def loadTrainData(): data = [] label = [] arr = [] with open('../train.csv', 'r') as fin: lines = list(csv.reader(fin)) for line in lines[1:]: if random.random() < 0.5: line = map(int, line) line[1:] = map(lambda x: x / 255.0, line[1...
{ "content_hash": "624bca53c504b82109de83339ddca1f5", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 50, "avg_line_length": 25.433962264150942, "alnum_prop": 0.634272997032641, "repo_name": "huangshenno1/algo", "id": "54370b830c82bb1fbcc3e58d106410193578e516", "size": "134...
""" VObject Overview ================ vobject parses vCard or vCalendar files, returning a tree of Python objects. It also provids an API to create vCard or vCalendar data structures which can then be serialized. Parsing existing streams ------------------------ Streams containing one or many L...
{ "content_hash": "d38e119500a2a2bd8f3b8646cc6a88bc", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 116, "avg_line_length": 37.395348837209305, "alnum_prop": 0.6638681592039801, "repo_name": "Kurmaev/vobject", "id": "30ba3f0b7bb11a2a1d822c69b1c450069da608ff", "size": "321...
class FakeModel(dict, object): def __getitem__(self, key, default=None): attr = getattr(self, key, default) return attr def get(self, key, default=None): return getattr(self, key, default) class FakeVIP(FakeModel): def __init__(self, pers="", vip_id="id1"): super(FakeVIP, ...
{ "content_hash": "d2163b135a76406e0291304f3d75df31", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 61, "avg_line_length": 28.73972602739726, "alnum_prop": 0.5481410867492851, "repo_name": "hthompson6/a10-neutron-lbaas", "id": "bc8549115879b41dc1e3758760c9c40b94659dec", "...
import importme import unittest from Location import Location from Module import Module from global_config import cultures from Team import Team class TestLocation(unittest.TestCase): def setUp(self): pass def test_constructor(self): location = Location('Dublin', "culture1", 30) self....
{ "content_hash": "80d11630cb44fdaa8cde0a6a74bfd2bd", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 112, "avg_line_length": 34.639830508474574, "alnum_prop": 0.6271559633027523, "repo_name": "ianfhunter/TeamCrab", "id": "2068a801ec6ea3a783dcbc37d0f2480cdfe4dc19", "size":...
from __future__ import unicode_literals from django.db import migrations, models import papertrail.fields class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='Entry', fields=[ ...
{ "content_hash": "2b7b6e5d3b7156f9b78b2901422964a2", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 118, "avg_line_length": 38.5, "alnum_prop": 0.5548996458087367, "repo_name": "FundersClub/django-papertrail", "id": "981e798891eaa2425979dfa877b8ae349e952582", "size": "171...
import io import unittest from pycoin.encoding.hexbytes import h2b from pycoin.message.make_parser_and_packer import ( make_parser_and_packer, standard_messages, standard_message_post_unpacks, standard_parsing_functions, standard_streamer ) from pycoin.message.PeerAddress import ip_bin_to_ip4_addr, ip_bin_to_i...
{ "content_hash": "cb983389bdbc298689f68374f2cce819", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 119, "avg_line_length": 35.98765432098765, "alnum_prop": 0.6291595197255575, "repo_name": "richardkiss/pycoin", "id": "f3b6e564fce1b80869e25a41dbd513c44fb73f17", "size": "2...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() requires = [ 'bokeh', 'gitpython', 'ipython', 'jsonschema', 'pyzmq', ] setup(name='bokeh-playground', version='...
{ "content_hash": "5ff39e164b69794a91a6872c0cc8a9fc", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 49, "avg_line_length": 22.848484848484848, "alnum_prop": 0.603448275862069, "repo_name": "abingham/bokeh-playground", "id": "591d273a52d13699b11ec57ded2a1f4218335163", "siz...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os im...
{ "content_hash": "fd26994b98b5322d570802dad79c088d", "timestamp": "", "source": "github", "line_count": 3808, "max_line_length": 457, "avg_line_length": 51.512867647058826, "alnum_prop": 0.5932066007004451, "repo_name": "djkonro/client-python", "id": "a90ba72f1e88a5a7ad387f3a7575bbd08cc87d41", "siz...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "3c5ddbbfce9053d489c8d8066e3580a2", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 115, "avg_line_length": 34, "alnum_prop": 0.5863003095975232, "repo_name": "onshape-public/onshape-clients", "id": "7c106e4fefdeef96de10032d2b462a65d02e54ff", "size": "518...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/container/general/shared_tech_bookcase.iff" result.attribute_template_id = -1 result.stfName("container_name","tech_bookcase") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "aa5fa93b772d2a9147b116a53a0359b4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 24.46153846153846, "alnum_prop": 0.7075471698113207, "repo_name": "anhstudios/swganh", "id": "448329fe9df0d66bf7b11a83a5e55009e326c5d0", "size": "463...
""" Copyright 2015 SYSTRAN Software, Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
{ "content_hash": "49dae37a47dbd5b6645f6dc28b7b2b46", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 101, "avg_line_length": 31.053571428571427, "alnum_prop": 0.60149511213341, "repo_name": "SYSTRAN/geographic-api-python-client", "id": "bcf281928aeb57ed18091bc9e55c453c88def7...
"""Controllers for the subtopic viewer page.""" from __future__ import annotations from core import feconf from core.constants import constants from core.controllers import acl_decorators from core.controllers import base from core.domain import subtopic_page_services from core.domain import topic_fetchers from typi...
{ "content_hash": "68986ebe5eabb857c22c1f57eeaadacb", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 79, "avg_line_length": 37.00909090909091, "alnum_prop": 0.5752886268730042, "repo_name": "oppia/oppia", "id": "54419295610cb65b3d03c100aab79667a808fa52", "size": "4676", ...
from designate.objects import base class PoolAttribute(base.DictObjectMixin, base.PersistentObjectMixin, base.DesignateObject): FIELDS = { 'pool_id': { 'schema': { 'type': 'string', 'description': 'Pool identifier', 'format': ...
{ "content_hash": "a346c0b8b1b3143a046fc6d4bb902c6c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 69, "avg_line_length": 24.8125, "alnum_prop": 0.4345088161209068, "repo_name": "cneill/designate", "id": "6d32655ae5c66c9735ec5ef6b2c534b799944267", "size": "1430", "bina...
__author__ = 'Sangmi' from features.extract_group_list import group_list def count_recipients(email): """ counts recipients * counts a group email address as 100 returns the number of recipients (int) * (e.g. 1 group email + 2 individual email = 1*100 + 2 = 102 (returns 102)) """ ...
{ "content_hash": "d31d4ddcb407817b483ccd0772d02c7d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 29.689655172413794, "alnum_prop": 0.627177700348432, "repo_name": "danzek/email-formality-detection", "id": "e83505b51b162675b6aace908c8c55facc880866",...
""" Tests for L{twisted.words.im.ircsupport}. """ from twisted.trial.unittest import TestCase from twisted.test.proto_helpers import StringTransport from twisted.words.im.basechat import Conversation, ChatUI from twisted.words.im.ircsupport import IRCAccount, IRCProto class StubConversation(Conversat...
{ "content_hash": "d0ca427f2a945a7b554542960195c396", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 80, "avg_line_length": 31.302325581395348, "alnum_prop": 0.5995542347696879, "repo_name": "hlzz/dotfiles", "id": "251322d6ea3de9a2390c20929f9b0a5cf8f91cc4", "size": "2766",...
""" Target for cleaning of build results. """ import os import shutil from distutils.cmd import Command from datafinder_distutils.configuration import BuildConfiguration __version__ = "$Revision-Id:$" class clean(Command): """ Cleans the build results. """ description = "Cle...
{ "content_hash": "311129ed52c98c588fbfe049dbd24e92", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 96, "avg_line_length": 34.2972972972973, "alnum_prop": 0.6012608353033885, "repo_name": "DLR-SC/DataFinder", "id": "9f8dc4584940fdc67452978bb74dfbaec4f4891f", "size": "4257...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifie...
{ "content_hash": "b175347a26f161dd9c6fa4b33daced02", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 134, "avg_line_length": 43.3671875, "alnum_prop": 0.6296162853539903, "repo_name": "Azure/azure-sdk-for-python", "id": "f6aea57b4072131dab26126b5ac995053434b66a", "size": ...
from shr import * def main(argv): generateMeshArray(argv[1], argv[2], argv[3]) def generateMeshArray(cfgPath, ppmPath, maPath): cfg = loadCfg(cfgPath) img = Image.fromPath(ppmPath) saveMeshArray(makeMeshArray(cfg, img), maPath) def makeMeshArray(cfg, img): sm = makeStaticMesh(cfg, img) dm ...
{ "content_hash": "b8726aa5a5d6ac95a0c04fab81d1f0d6", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 105, "avg_line_length": 26.897959183673468, "alnum_prop": 0.6555386949924128, "repo_name": "Mark-Weston/tabout", "id": "3bf6f5a2fc07b8d0c0ab1f906df0697b21fc43c4", "size": "...
from __future__ import absolute_import, division, print_function import math from cryptography import utils from cryptography.exceptions import ( InvalidSignature, UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ( Asymmet...
{ "content_hash": "93b90bea0a4df6c6a5f013eace7bc498", "timestamp": "", "source": "github", "line_count": 518, "max_line_length": 79, "avg_line_length": 39.472972972972975, "alnum_prop": 0.578275541644251, "repo_name": "ammarkhann/FinalSeniorCode", "id": "ba830dd95a6f63f663613217b19ff32f8b8ef706", "s...
""" P1 tests for reset SSH keypair """ #Import Local Modules from marvin.integration.lib.base import (VirtualMachine, SSHKeyPair, Account, Template, Servic...
{ "content_hash": "55124914a4794024eb41a2777e8e0d38", "timestamp": "", "source": "github", "line_count": 1497, "max_line_length": 117, "avg_line_length": 42.66332665330661, "alnum_prop": 0.4691781358134874, "repo_name": "mufaddalq/cloudstack-datera-driver", "id": "7530335e4a9f0dc480973f5193f39ea35e514...
#################################################################################### # Copyright 2022 Google LLC # # 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 # # https://www.apache.or...
{ "content_hash": "e9f00344497bd5e2f8ff0d42d1430f97", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 118, "avg_line_length": 33.7037037037037, "alnum_prop": 0.6502747252747253, "repo_name": "GoogleCloudPlatform/data-analytics-golden-demo", "id": "bc0b0ebd30ae1fecdd96b54a406...
from causalgraphicalmodels.cgm import CausalGraphicalModel from causalgraphicalmodels.csm import StructuralCausalModel import causalgraphicalmodels.examples as examples import causalgraphicalmodels.csm as csm
{ "content_hash": "32aaa0e0178d06032142c8a035552d90", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 59, "avg_line_length": 52.25, "alnum_prop": 0.9043062200956937, "repo_name": "ijmbarr/causalgraphicalmodels", "id": "4a5aea42a6554974298eee5aa44f6340b507c3a6", "size": "209"...
from msrest.serialization import Model class VirtualMachineScaleSetVMInstanceView(Model): """The instance view of a virtual machine scale set VM. Variables are only populated by the server, and will be ignored when sending a request. :param platform_update_domain: The Update Domain count. :type ...
{ "content_hash": "3dbfee74531a2c1ec0828b9e1dec49aa", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 113, "avg_line_length": 52.31578947368421, "alnum_prop": 0.6911468812877264, "repo_name": "lmazuel/azure-sdk-for-python", "id": "b5b91ca14be969253f3a6c9cbeeaf0447dc3bc2a", ...
import paddle.v2 as paddle from config.pascal_voc_conf import cfg def net_conf(mode): """Network configuration. Total three modes included 'train' 'eval' and 'infer'. Loss and mAP evaluation layer will return if using 'train' and 'eval'. In 'infer' mode, only detection output layer will be returned. "...
{ "content_hash": "a50f566eff6bb9688b2a67022031660d", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 80, "avg_line_length": 40.44107744107744, "alnum_prop": 0.5604862209641163, "repo_name": "kuke/models", "id": "9d7434acd5eea1453f282ce3e065810aed02f8e8", "size": "12011", ...
from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has an ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModifi...
{ "content_hash": "9907a61e33ba4e532a278d7fe136fb7a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 52.926829268292686, "alnum_prop": 0.6285714285714286, "repo_name": "diego-d5000/MisValesMd", "id": "59ca84ffb61eceb0843e8c60ef50371a4b919d47", "size"...
""" Contains a class to handle a validation result for a single VOTable file. """ # STDLIB from xml.parsers.expat import ExpatError import hashlib import os import shutil import socket import subprocess import warnings import pickle import urllib.request import urllib.error import http.client # VO from astropy.io.vo...
{ "content_hash": "d3d042d30344f22e0b8c0a7354908a7b", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 80, "avg_line_length": 31.49014084507042, "alnum_prop": 0.5227659003488684, "repo_name": "dhomeier/astropy", "id": "29310019d66184aabed096f8025bf9563a2ee473", "size": "112...
import contextlib import mock from oslo.config import cfg from neutron.agent.linux import ip_lib from neutron.agent.linux import ovs_lib from neutron.openstack.common import log from neutron.plugins.common import constants as p_const from neutron.plugins.openvswitch.agent import ovs_neutron_agent from neutron.plugins...
{ "content_hash": "440a2c71bb2bb51c340813c1f9808018", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 79, "avg_line_length": 45.61454545454546, "alnum_prop": 0.4879623724489796, "repo_name": "vijayendrabvs/hap", "id": "1940730fad152fce3f7c3ce8c917803dda05bcf9", "size": "25...
""" Run SfePy tests. All arguments are passed to pytest. """ from argparse import ArgumentParser, RawDescriptionHelpFormatter def main(): parser = ArgumentParser(description=__doc__, usage='sfepy-test [-h] [pytest options]', formatter_class=RawDescriptionHelp...
{ "content_hash": "a768f80eb40be5c947ecc4c42be56755", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 29.375, "alnum_prop": 0.6191489361702127, "repo_name": "rc/sfepy", "id": "98f78f54a08d402c232ce85b95a8146fbca9fa6f", "size": "492", "binary": false...
""" Author: Maneesh Divana <mdaneeshd77@gmail.com> Interpreter: Python 3.6.8 Merge Sort Worst Case: O(nlog n) Average Case: O(nlog n) Best Case: O(nlog n) """ from random import shuffle def msort(arr: list) -> None: """Recursive MergeSort implementation""" if len(arr) > 1: # Find the mid-point of the...
{ "content_hash": "3277874d84151be36791a3614c17255a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 66, "avg_line_length": 24.88135593220339, "alnum_prop": 0.5115803814713896, "repo_name": "maneeshd/Algorithms-and-Data-Structures", "id": "0cfbed3bb9eb93cf204b5ce8856c2ea2ad4...
iban = input("Ingresa IBAN, por favor: ") iban = iban.replace(' ','') if not iban.isalnum(): print("Has introducido caracteres no válidos.") elif len(iban) < 15: print("El IBAN ingresado es demasiado corto.") elif len(iban) > 31: print("El IBAN ingresado es demasiado largo.") else: iban = (iban[4:] + ib...
{ "content_hash": "343f26c5cecda9198917b37f0f2094c8", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 270, "avg_line_length": 48.233333333333334, "alnum_prop": 0.7166551485832757, "repo_name": "okijulian/oki1.0", "id": "fcb932dda56ba9d9d57216d1741ad6df4ac6796f", "size": "29...
from tornadotoad import my from tornadotoad import mixin from tornadotoad import api def register(api_key=None, environment="production", project_root=None, app_version=None, log_403=False, log_404=False, log_405=False, use_ssl=False): """Register a Airbrake API key along w...
{ "content_hash": "f25fadbc9db35fd605b7fe87e181fb2f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 32.666666666666664, "alnum_prop": 0.6588921282798834, "repo_name": "kanevski/tornadotoad", "id": "57bdab28a638a0475e02ca89fe0e7690caa87021", "size": ...
""" Create new shapefiles using Shapely and Fiona This exercise is designed to combine basic programming skills with a first attempt at processing geospatial gj_stack using the libraries, Shapely and Fiona. Remember, Shapely encapsulates the functionality of GEOS so it's useful in manipulating spatial objects, and Fio...
{ "content_hash": "4d9d7c1485c43dc13c40423043bc11b5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 333, "avg_line_length": 48.96666666666667, "alnum_prop": 0.7501701837985024, "repo_name": "d15123601/geotinkering", "id": "6e9fa6ef8e4dd4d2563c8e8b499b4caebbb9e9e3", "size"...
import math import random import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf import keras_cv from keras_cv.metrics import coco def produce_random_data(include_confidence=False, num_images=128, classes=20): """Generates a fake list of ...
{ "content_hash": "ca895e84e865b240a56b50e5e110b64b", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 82, "avg_line_length": 29.91, "alnum_prop": 0.6603142761618188, "repo_name": "keras-team/keras-cv", "id": "925f707d37dd26fabe3423dd56ec9b528bb3d345", "size": "2991", "bi...
"""Compares the text output to the expected text output while ignoring positions and sizes of elements/text. If the output doesn't match, returns FailureSimplifiedTextMismatch and outputs the diff files into the layout test results directory. """ import difflib import os.path import re from layout_package import tes...
{ "content_hash": "ab865d137570515408cea6ab9ed728ee", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 87, "avg_line_length": 38.554621848739494, "alnum_prop": 0.6301220575414124, "repo_name": "amyvmiwei/chromium", "id": "3767a43de2752b51c684f0070c886789a1a237dd", "size": "...
from __future__ import with_statement from __future__ import print_function import os from os import path import re from blazeutils.helpers import pprint import six from werkzeug.serving import run_simple from werkzeug import Client from werkzeug.wrappers.base_response import BaseResponse from blazeweb.globals import...
{ "content_hash": "efb69b711d2debba4a5d1641527d100f", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 92, "avg_line_length": 27.756281407035175, "alnum_prop": 0.576536616275912, "repo_name": "level12/blazeweb", "id": "20a94f4e12d8daffbf75a456643bbcf398f9bdf0", "size": "110...
import _plotly_utils.basevalidators class HistnormValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="histnorm", parent_name="histogram2d", **kwargs): super(HistnormValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
{ "content_hash": "e1888c4cd89cc04f6c74ead4139f9557", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 84, "avg_line_length": 37.9375, "alnum_prop": 0.5667215815485996, "repo_name": "plotly/python-api", "id": "28388bebe44fdae335b0e924494b3b395301d184", "size": "607", "bina...