text
stringlengths
4
1.02M
meta
dict
__all__ = ['NetfuzzTool'] import socket import urllib import base64 from xnet.tools import Tool def _tcp4_connect(addr): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(addr) return sock class Template(object): _ESCAPE_SEQUENCES = ( ('\\r', '\r'), ('\\n', '\...
{ "content_hash": "512f1c8c4b9ffe24ebdb6b68b68ff8c0", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 100, "avg_line_length": 29.973821989528794, "alnum_prop": 0.5390393013100436, "repo_name": "kristerhedfors/xnet", "id": "fcd4fd2d98feea1ec5b080b2d8e9e9bbe18531e0", "size":...
from __future__ import print_function import numpy as np import math from pyqtgraph.debug import Profiler import acq4.util.functions as utilFn from six.moves import range def convertPtsToSparseImage(data, params, spacing=5e-6): """Function for converting a list of stimulation spots and their associated values in...
{ "content_hash": "c4550d7439775fa69e65b93904b865b7", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 188, "avg_line_length": 47.21052631578947, "alnum_prop": 0.6221974482844048, "repo_name": "pbmanis/acq4", "id": "1b761d33de989ce5fa8c05c57f7a3a47e1a1b2ea", "size": "8073",...
from abc import ABCMeta, abstractmethod from ems.auth import AccessChecker as AbstractChecker class Permission(object): def __init__(self, code='', title='', access=1): super(Permission, self).__init__() self.code = code self.title = title self.access = access def __repr__(se...
{ "content_hash": "f832d639db5e42eb0e3ea54678afe8c4", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 97, "avg_line_length": 22.093023255813954, "alnum_prop": 0.6431578947368422, "repo_name": "mtils/ems", "id": "6736295f59fd7e9713a5ff53909503edbbaf2ffb", "size": "951", "b...
import os from java.awt import Font as JFont from java.awt import BasicStroke, RenderingHints, GraphicsEnvironment from java.awt.font import TextAttribute from java.text import AttributedString from java.lang import IllegalArgumentException from java.awt.image import BufferedImage from java.io import File from pyj2d.su...
{ "content_hash": "c6dadd0ad8efbded32d394ea4d9137e9", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 268, "avg_line_length": 29.64589235127479, "alnum_prop": 0.546201624462494, "repo_name": "jggatc/pyj2d", "id": "658e4063a1882363dc27620981e7ebc5608640c7", "size": "10596",...
default_app_config = 'danceschool.private_lessons.apps.PrivateLessonsConfig'
{ "content_hash": "4c1a2ef4ee5395077401c2943a30e6dc", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 76, "avg_line_length": 77, "alnum_prop": 0.8441558441558441, "repo_name": "django-danceschool/django-danceschool", "id": "416bad4cc6aade5d722d27b5a1dd2c27b7344ef9", "size": ...
""" Form Widget classes specific to the Django admin site. """ import copy from django import forms from django.forms.widgets import RadioFieldRenderer from django.forms.util import flatatt from django.utils.text import truncate_words from django.utils.translation import ugettext as _ from django.utils.safestring imp...
{ "content_hash": "ea0212e603d9d2d40010cf92dd191dde", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 157, "avg_line_length": 40.03928571428571, "alnum_prop": 0.6126126126126126, "repo_name": "dcramer/django-compositepks", "id": "e2cd2113f800a6f62e0160ba2afe4a75b215eab0", ...
# -*- coding: utf-8 -*- # default_application, default_controller, default_function # are used when the respective element is missing from the # (possibly rewritten) incoming URL # default_application = 'init' # ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific...
{ "content_hash": "f8e784b908b2dc3b2dccc20844def966", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 164, "avg_line_length": 40.69346733668342, "alnum_prop": 0.6159545566806619, "repo_name": "ccpgames/eve-metrics", "id": "b6a5531530337d39182116fbdb1e18d152c4306c", "size":...
import os import requests # pip install requests # The authentication key (API Key). # Get your own by registering at https://app.pdf.co API_KEY = "******************************************" # Base URL for PDF.co Web API requests BASE_URL = "https://api.pdf.co/v1" # Source PDF file SourceFile = ".\\sample.pdf" # Co...
{ "content_hash": "0ba97f54bd0fb2170840bf5380e08419", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 128, "avg_line_length": 32.25961538461539, "alnum_prop": 0.585096870342772, "repo_name": "bytescout/ByteScout-SDK-SourceCode", "id": "2911c5c3c9b1a0a6499bcf1910ab6aecadc672e...
import os from bf1.exceptions import EnvVarNotSet def get_token(): try: return os.environ['API_KEY'] except KeyError: raise EnvVarNotSet('API_KEY') API_KEY = get_token() METHOD = 'get'
{ "content_hash": "d312040c5052dafa6c3b802d7a514b12", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 39, "avg_line_length": 15.285714285714286, "alnum_prop": 0.6448598130841121, "repo_name": "Girbons/battlefield1-sdk", "id": "d1bda1a134a5071ea016f661f87ff6178cd46c9c", "siz...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons _python_ = TestSCons._python_ test = TestSCons.TestSCons() test.subdir('sub1') test.write('SConstruct', """\ env=Environment() Export('env') env.SConscript('SConscript', variant_dir='Build') """) test.write('SConscript', """\ Import('e...
{ "content_hash": "a6d7e53d21d28614aee742f8df80972e", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 73, "avg_line_length": 28.875706214689266, "alnum_prop": 0.7065153590295441, "repo_name": "azatoth/scons", "id": "e46a53534f1f1ce2c283460e8687ef7d92e7683e", "size": "6213"...
"""Module containing Hadoop installation and cleanup functions. For documentation of commands to run at startup and shutdown, see: http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/ClusterSetup.html#Hadoop_Startup """ import functools import logging import os import posixpath import re import tim...
{ "content_hash": "9035e62b10f468340b152adfcb6e4299", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 104, "avg_line_length": 32.69398907103825, "alnum_prop": 0.6770850743774026, "repo_name": "mateusz-blaszkowski/PerfKitBenchmarker", "id": "b3cc906fd9d15916921495290cfd497ff2...
import sys, requests, uuid url, filepath = sys.argv[1:3] if len(sys.argv) > 3: inp = sys.argv[3] else: inp = 'nexus' content = open(filepath, 'rU').read() data = {'inputFormat': inp, 'idPrefix': '', 'dataDeposit': 'http://example.org', 'content': content, } r = requests.post(url,...
{ "content_hash": "7242bf327467d493414599cdcb2536e2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 59, "avg_line_length": 25.03846153846154, "alnum_prop": 0.6006144393241167, "repo_name": "OpenTreeOfLife/opentree", "id": "cac24d21197e2c2b6ceecd158549c4714bc2985d", "size"...
from django.conf import settings def account(request): return { "CONTACT_EMAIL": getattr(settings, "CONTACT_EMAIL", "[email protected]") }
{ "content_hash": "efe0adbba2eeedd067f169a43067151f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 82, "avg_line_length": 26.333333333333332, "alnum_prop": 0.6772151898734177, "repo_name": "uroslates/django-allauth", "id": "95867b2ecfd1574a2ca5d41bdd247971f6df19e4", "size...
__copyright__ = """This code is licensed under the 3-clause BSD license. Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group. See LICENSE.txt for details. """ import pytest import scine_utilities as scine def test_ElementTypes(): # Test the string magic function assert str(scine.ElementType....
{ "content_hash": "6dbfcb3fe851724393b46cf43c915217", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 33.5, "alnum_prop": 0.7332089552238806, "repo_name": "qcscine/utilities", "id": "fcdc0a6244287979dce1a9e4fecb30f0a51599ed", "size": "536", "binary"...
import json import logging from django.shortcuts import render, redirect from django.views.decorators.http import require_http_methods from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponse from ims_lti_py.tool_config import ToolConfig...
{ "content_hash": "82009008f5c294afd82d0645536a9c88", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 105, "avg_line_length": 33.800904977375566, "alnum_prop": 0.6329317269076306, "repo_name": "penzance/edx-in-canvas", "id": "89005572d3a7872ee83de39d35965f4c575a6b8b", "siz...
import qiime2.core.archive.format.v0 as v0 class ArchiveFormat(v0.ArchiveFormat): PROVENANCE_DIR = 'provenance' @classmethod def write(cls, archive_record, type, format, data_initializer, provenance_capture): super().write(archive_record, type, format, data_initializer, ...
{ "content_hash": "2a0792330eb7a3a0fc2f1c710ee96cfb", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 31.565217391304348, "alnum_prop": 0.6377410468319559, "repo_name": "thermokarst/qiime2", "id": "6980762ecb57fe8607a1e9fd145f4ceb61b13597", "size": "1...
"""Library for getting system information during TensorFlow tests.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from tensorflow.tools.test import system_info_lib def main(unused_args): config = system_info_lib.gather_machine_c...
{ "content_hash": "5d1868b9e8d99bf4b8f2832f9f9ce55f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 25.529411764705884, "alnum_prop": 0.7327188940092166, "repo_name": "sarvex/tensorflow", "id": "4f1a1a49f188d80e5061b53c504026cc02eb8fc5", "size": "11...
from PyQt4 import QtCore from PyQt4.QtCore import pyqtSignal, pyqtSlot # 工作线程类型,用于统一处理返回信息时做判断 from src.strategy import strategy_macdCross, strategy_macdDiverse, strategy_maCross workerTypeDayRise = 1 workerTypePickup = 2 workerStop = False class WorkerDayRiseList(QtCore.QObject): """ 获取涨幅排行榜的工作线程 """ ...
{ "content_hash": "7d723ee37193d0dbe4880e303b345153", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 189, "avg_line_length": 34.127272727272725, "alnum_prop": 0.5623335109216835, "repo_name": "aslucky/StockHelper", "id": "6473e572dbd4d5dc44abbc59859fa26dbd8f38f2", "size":...
from threading import Thread from subprocess import Popen, PIPE class PlaySound(Thread): def __init__(self, filename, volume): Thread.__init__(self) self.filename = filename self.volume = volume def run(self): cmd = 'play -v ' + self.volume + ' ' + self.filename p = Popen(cmd, shell=True, std...
{ "content_hash": "d1694207aa695f85172369f914510618", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 29.666666666666668, "alnum_prop": 0.6441947565543071, "repo_name": "Nixsm/linux-clicky", "id": "ad2b692f10aa2877edb5ddd6405721f92ab30f17", "size": "6...
"""Defines the factory for creating monitors""" from __future__ import unicode_literals import logging logger = logging.getLogger(__name__) _SCANNERS = {} def add_scanner_type(scanner_class): """Registers a scanner class so it can be used for Scale Scans :param scanner_class: The class definition for a sc...
{ "content_hash": "a572dcf97fb4fb5dcef978ee4bdb9607", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 82, "avg_line_length": 28.8, "alnum_prop": 0.6975308641975309, "repo_name": "ngageoint/scale", "id": "83694752cdf6c6f464f91220c8a7a8f86c9563f3", "size": "1296", "binary":...
""" Functions for analyzing/parsing docstrings """ import logging import re log = logging.getLogger(__name__) def strip_rst(docs): """ Strip/replace reStructuredText directives in docstrings """ for func, docstring in docs.items(): log.debug("Stripping docstring for %s", func) if not ...
{ "content_hash": "8b27aebf6dfcd6fb4ddc954d50c8315e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 30.69333333333333, "alnum_prop": 0.5152041702867072, "repo_name": "saltstack/salt", "id": "9f80bc3337bb5edb05252aeb1553f7463fac3f6a", "size": "2302",...
from .models import EmployeeBadge, Star, Badge from categories.serializers import CategorySerializer, KeywordSerializer from employees.models import Employee, Position from rest_framework import serializers class PositionSerializer(serializers.ModelSerializer): class Meta(object): model = Position class...
{ "content_hash": "76493f511f773857b0b191201bb2be16", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 86, "avg_line_length": 33.81481481481482, "alnum_prop": 0.6974808324205914, "repo_name": "belatrix/BackendAllStars", "id": "64d44ff8ef52ec3b49e67bb6d2d93cde72826653", "siz...
""" base collection classes for building collections. Common functions such as pagination and such live in here. http://xkcd.com/353/ Josh Ashby 2013 http://joshashby.com [email protected] """ class baseCollection(object): """ Attempts to be a common ground for collections giving them all a similar ...
{ "content_hash": "4524544ede31be6bd988cb43929a4555", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 84, "avg_line_length": 29.106666666666666, "alnum_prop": 0.60879523591388, "repo_name": "JoshAshby/Fla.gr", "id": "1aa1703dc6eb8f0bc73709963fff6c0434e58102", "size": "4388...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserAccount' db.create_table(u'snappybouncer_useraccount', ( (u'id', ...
{ "content_hash": "8b7e6ffd795a7ad7d75590c9e216bfd3", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 158, "avg_line_length": 61.242105263157896, "alnum_prop": 0.6005500171880371, "repo_name": "praekelt/ndoh-control", "id": "0d0846a29ceb87a9e9182bbd9236d3caa6003077", "size"...
import geojson, json, random, time, os, datetime, feedparser from ingest import ingest_data from housepy import config, log, strings, util, net from mongo import db """ Grab Medium blog entries """ ACCOUNTS = [list(item.keys())[0] for item in config['twitter']['accounts']] # same handles MEMBERS = [list(item.va...
{ "content_hash": "8c1cb94c00e7664e707ab3119cbbe8f0", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 184, "avg_line_length": 40.8421052631579, "alnum_prop": 0.5287800687285223, "repo_name": "brianhouse/okavango_15", "id": "fe087111b53d2c8edf365550c75db5b7929188e2", "size":...
import copy from flask import request from flexget.config_schema import process_config from flexget.api import api, APIResource, ApiError, NotFoundError # Tasks API tasks_api = api.namespace('tasks', description='Manage Tasks') task_api_schema = { 'type': 'object', 'properties': { 'name': {'type': ...
{ "content_hash": "4c074f558b03b9b6a737d6740ac550f2", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 108, "avg_line_length": 34.006711409395976, "alnum_prop": 0.6046970594039865, "repo_name": "tsnoam/Flexget", "id": "83e333a2f6a9825d7f0378c282fad59812a2812f", "size": "506...
"""Base classes for our unit tests. Allows overriding of CONF for use of fakes, and some black magic for inline callbacks. """ import logging import os import fixtures import mock import testtools from testtools import matchers from brick.openstack.common import log as oslo_logging from oslo.utils import strutils ...
{ "content_hash": "38d29d72019b62b1db74f2b903ea4b3d", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 79, "avg_line_length": 35.92090395480226, "alnum_prop": 0.5410506448568733, "repo_name": "hemna/cinder-brick", "id": "789924f814c1f25ad0b1aa250539ff47cad697f5", "size": "7...
def g(): for a in range(3): yield a return 7 def h(): yield 4 yield 5 def f(): print("Yielded from returner", (yield from g())) print("Yielded from non-return value", (yield from h())) print( "Result", list( f() ) ) print( "Yielder with return value", list(g()) ) # This will raise ...
{ "content_hash": "73f0ec4bae018272531c9bf542c22a00", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 76, "avg_line_length": 23.83653846153846, "alnum_prop": 0.48527632109721663, "repo_name": "tempbottle/Nuitka", "id": "29f504b4f04dbe186259baae95d050405b3789ed", "size": "3...
''' "version" plugin for cocos2d command line tool ''' __docformat__ = 'restructuredtext' import re import os import cocos2d import inspect # # Plugins should be a sublass of CCJSPlugin # class CCPluginVersion(cocos2d.CCPlugin): @staticmethod def plugin_name(): return "version" @staticmethod ...
{ "content_hash": "fa63239551fc5db5e856814aa9d70548", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 90, "avg_line_length": 25.40909090909091, "alnum_prop": 0.6288014311270125, "repo_name": "meiry/Cocos2d-x-EarthWarrior3D-win-desktop-version", "id": "b44f543b3e6574cd52bffdfa...
''' Created on Sep 17, 2012 Copyright © 2013 The Board of Trustees of The Leland Stanford Junior University. 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.apa...
{ "content_hash": "3f497107ef0eb5acd3d5a84a7a6744bf", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 96, "avg_line_length": 33.83870967741935, "alnum_prop": 0.7273593898951383, "repo_name": "daStrauss/subsurface", "id": "5c3e48d88e0a7745628c73e56dce6b2889fc6cf6", "size": "...
import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import gapic_v1 from google.api_core import grpc_helpers_async from google.auth import credentials as ga_credentials from google.auth.transport.grpc import SslCredentials import grpc ...
{ "content_hash": "0d3ab95649fcd3f0912dadc620a48e67", "timestamp": "", "source": "github", "line_count": 953, "max_line_length": 104, "avg_line_length": 45.4700944386149, "alnum_prop": 0.6252048092677636, "repo_name": "quantumlib/Cirq", "id": "a01b7ceabd2a188455ed3ed36ac4b01ef85c0a08", "size": "4393...
import base64 import os import shutil import string import tempfile import unittest from datetime import timedelta from http import cookies from pathlib import Path from unittest import mock from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.contrib.sessions.back...
{ "content_hash": "1669fbb2818952628947c6d7c4e86757", "timestamp": "", "source": "github", "line_count": 936, "max_line_length": 88, "avg_line_length": 37.37713675213675, "alnum_prop": 0.6433042732599685, "repo_name": "felixxm/django", "id": "d13c485342e8f7c6240d4cbe54450599f552c070", "size": "34985...
import boto from boto.swf.exceptions import SWFResponseError from datetime import datetime, timedelta import sure # noqa # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises # noqa from moto import mock_swf from moto.core.utils import unix_time # Utils @mock_swf def ...
{ "content_hash": "92a5c0c453799431a7b2c0f506fe847d", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 95, "avg_line_length": 37.99581589958159, "alnum_prop": 0.6499284219799581, "repo_name": "IlyaSukhanov/moto", "id": "8e311a22c5afe8f388b2ec3c93c1007eb7254ff1", "size": "90...
"""Integration platform for recorder.""" from __future__ import annotations from homeassistant.const import ATTR_EDITABLE from homeassistant.core import HomeAssistant, callback from . import ATTR_MAX, ATTR_MIN, ATTR_MODE, ATTR_PATTERN @callback def exclude_attributes(hass: HomeAssistant) -> set[str]: """Exclude...
{ "content_hash": "d79086ee80c98b80587f5699116ec76f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 68, "avg_line_length": 26, "alnum_prop": 0.6862348178137652, "repo_name": "toddeye/home-assistant", "id": "0f4969270d00f6e4b84522ddd1dd4eae77f84995", "size": "494", "bina...
__author__ = 'thomasvangurp' import os from Bio import SeqIO import subprocess from scipy import stats from operator import itemgetter """Detect DMPs between all samples, calculate their abundance and distribution""" # Choose 2 most abundant individuals for DMP detection # How many DMP's are there per context? # def g...
{ "content_hash": "7975539c5e6ab9bec620e6c35bc0e2a5", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 125, "avg_line_length": 43.87543859649123, "alnum_prop": 0.5438442160822105, "repo_name": "thomasvangurp/epiGBS", "id": "df486e4aa5302964b643fa13a6f1f93e5f55fb5d", "size":...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_tapestry_tatooine.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "07e008869944616793b796d5814c3bad", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 73, "avg_line_length": 23.23076923076923, "alnum_prop": 0.6920529801324503, "repo_name": "anhstudios/swganh", "id": "65af8eb72f361692e4643fd793b65c79f7f0c59d", "size": "447...
#!/usr/bin/env python import re from itertools import chain from glob import iglob import sys import argparse # The set of Unicode code points greater than 127 that we # allow in the source code. box_drawing_chars = set(chr(cp) for cp in range(0x2500, 0x2580)) allowed = (set(['®', 'é', 'ö', 'λ', 'π', 'ω', '∫', '≠'])...
{ "content_hash": "3254c0df81ae708bb03a4e728e1c8044", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 79, "avg_line_length": 37.48148148148148, "alnum_prop": 0.4980237154150198, "repo_name": "nmayorov/scipy", "id": "6d1ef16eee85b0f8ce84831b756c14734b1ad263", "size": "3046",...
import os import sys BASE_APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.join(BASE_APP_DIR, 'src/')) sys.path.append(os.path.join(BASE_APP_DIR, 'venv/lib/python3.4/site-packages')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings") from django.core.wsgi im...
{ "content_hash": "f4017d580ad4333866be2187cddbdf7d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 79, "avg_line_length": 31.833333333333332, "alnum_prop": 0.7513089005235603, "repo_name": "Jafte/RTTTM", "id": "e9d1703c124d4cabc394bc6f35ee597843c6a769", "size": "404", ...
"""Handles all requests relating to volumes.""" import collections import datetime import functools from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils from oslo_utils import uuidutils import six from cinder.api import common from cinder i...
{ "content_hash": "80234e69e3733fc6ef7c6a48aa6a2416", "timestamp": "", "source": "github", "line_count": 1504, "max_line_length": 79, "avg_line_length": 44.89494680851064, "alnum_prop": 0.5271467077396996, "repo_name": "JioCloud/cinder", "id": "a958a0272529a8574ac942cb5ea0fbb7822e4b11", "size": "682...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.added_by' db.add_column('profiles_userprofile', 'added_by', self.gf('django.db.models.fields.rel...
{ "content_hash": "ab1b3e7c72f9fe8ed4bd07aee212ced1", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 204, "avg_line_length": 75.86666666666666, "alnum_prop": 0.5546280023432923, "repo_name": "chirilo/remo", "id": "fb8ae81ba08c1acb12c4a3ad9fa1c0aaae337456", "size": "6846", ...
import re import requests from lxml import html as lxml_html __all__ = ['TDClient'] def clear_text(text): text = text.replace('R$', '').replace('.', '').replace(',', '.') text = text.replace('\r', '').replace('\n', '').strip() try: return float(text) except ValueError: return text ...
{ "content_hash": "3d7baac999fa018f8ec8ae820cff3c70", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 78, "avg_line_length": 35.30601092896175, "alnum_prop": 0.5455811793839963, "repo_name": "herberthudson/tesouro-direto", "id": "1b8c677c21904fdd6ca83a3d8c3755343125a3e9", ...
from madpub.conf.settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('You', 'your@email'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(VAR_ROOT, 'dev.db'), } } ROOT_URLCONF = '%s.conf.local.urls' % PROJECT_MODU...
{ "content_hash": "8844ee46054b423cc0606c2cd26c7f32", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 57, "avg_line_length": 18.36, "alnum_prop": 0.6230936819172114, "repo_name": "malept/mad-mobileweb", "id": "fc867bf4f3cd0a99f8ae60cc596d4adb58ed16a5", "size": "459", "bin...
from __future__ import absolute_import from sentry.api.base import DocSection from sentry.api.bases.project import ProjectEndpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.serializers import serialize from sentry.models import TagKey, TagKeyStatus, TagValue class ProjectTagKeyValuesEndp...
{ "content_hash": "d901c2f5414952015ab14355ea9d2301", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 71, "avg_line_length": 31.072727272727274, "alnum_prop": 0.5985956699824458, "repo_name": "wong2/sentry", "id": "364ed90c44974cd33a77e76889d0c0fd91829c87", "size": "1709", ...
import json import os import re import tempfile from django.conf import settings from django.core.cache import cache from django.db.models import Q import mock from nose.tools import eq_ from PIL import Image from pyquery import PyQuery as pq from waffle.models import Flag import amo import amo.tests from amo.tests ...
{ "content_hash": "44347aa9f8454cc517b1bac497350808", "timestamp": "", "source": "github", "line_count": 1337, "max_line_length": 79, "avg_line_length": 39.58489154824233, "alnum_prop": 0.5861880018894662, "repo_name": "jbalogh/zamboni", "id": "b49c303e689b9de6f6ce609c46a71c6c28d6cf5f", "size": "529...
import os import sys import pyx import argparse import layouts import samplers import data_loader def main(arguments): parser = argparse.ArgumentParser(description='Generate clustering visualizations.') parser.add_argument( '--tables_dir', dest='tables_dir', default='input/tables', help='conte...
{ "content_hash": "c374fed32bfa7a1265575a87a1e79a33", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 101, "avg_line_length": 33.43283582089552, "alnum_prop": 0.6464285714285715, "repo_name": "alepulver/my-thesis", "id": "cfef7e9cdfb6e377e4765c73fb2d357e5e0e590f", "size": "...
from __future__ import absolute_import, unicode_literals from datetime import datetime from sqlalchemy import Column, DateTime, ForeignKey, Text, Integer from sqlalchemy.schema import Index, UniqueConstraint from freight.config import db LOG_CHUNK_SIZE = 4096 class LogChunk(db.Model): __tablename__ = 'logchun...
{ "content_hash": "2d35647e36dc453432e2fffb5d9ab259", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 88, "avg_line_length": 33.407407407407405, "alnum_prop": 0.7028824833702882, "repo_name": "jkimbo/freight", "id": "7492ac87b27370a478f1cdf21f72906c035db593", "size": "902",...
__file__ = '__init__.py' __date__ = '5/16/2016' __author__ = 'ABREZNIC' """ The MIT License (MIT) Copyright (c) 2016 Texas Department of Transportation Author: Adam Breznicky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
{ "content_hash": "4cea93fcb38c89e2a3c4459ffda3b4ee", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 77, "avg_line_length": 44.55555555555556, "alnum_prop": 0.7822111388196176, "repo_name": "adambreznicky/python", "id": "3f057776324a4fde05137f888a6bef88f9f15bd9", "size": "...
import time import mock from ceilometer.compute import manager from ceilometer.compute.pollsters import cpu from ceilometer.compute.virt import inspector as virt_inspector from . import base class TestCPUPollster(base.TestPollsterBase): def setUp(self): super(TestCPUPollster, self).setUp() @mock....
{ "content_hash": "edcae3fc8d002d0db7bf147e4d5889a4", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 37.49152542372882, "alnum_prop": 0.6265822784810127, "repo_name": "rickerc/ceilometer_audit", "id": "47002f8dc53c0b37172cd0c2cf8297dc8f381fee", "size...
""" """ from __future__ import unicode_literals, absolute_import, with_statement from contextlib import contextmanager import unittest # This env var tells the config loader to use the special test config located at: # $project_root/tests/fixtures/test_config.ini # This file must be created from the example config (te...
{ "content_hash": "df7f28326eab4061d03b41cc283fa95e", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 98, "avg_line_length": 27.65979381443299, "alnum_prop": 0.6757361162877376, "repo_name": "leighmacdonald/tranny", "id": "887e5bba243a642610f4f57d9a289bfd616dd6b7", "size": ...
from __future__ import print_function, absolute_import, division from argparse import ArgumentDefaultsHelpFormatter def func(args, parser): # delay import of the rest of the module to improve `osprey -h` performance from ..execute_worker import execute execute(args, parser) def configure_parser(sub_pars...
{ "content_hash": "debae12ce43e0aecc6f8b270fde2fec8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 42.55555555555556, "alnum_prop": 0.6840731070496083, "repo_name": "cxhernandez/osprey", "id": "1b03eaa75d1aee551f363fcba0197ce33eaa2183", "size": "76...
from django.contrib.auth.middleware import RemoteUserMiddleware from django.conf import settings import os #This middleware adds header REMOTE_USER with current REMOTE_USER from settings to every request. #This is required when running app with uwsgi locally (with runserver this is unnecessary) #In production, when FA...
{ "content_hash": "3bee67a8622a0d27c075a9741cde904d", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 97, "avg_line_length": 43.93333333333333, "alnum_prop": 0.7708649468892261, "repo_name": "futurice/schedule", "id": "3864ca3283798fbc44b523151dc1fbd173863b79", "size": "659...
import requests import json import sys if len(sys.argv) == 1: # print 'Options: \n -s : check services \n -h : check hosts \n -m : check # manager service' sys.exit(1) OUTPUT = '{0}: {1}' clusters = requests.get( 'http://admin:admin@{0}:7180/api/v9/clusters'.format( sys.argv[1]), auth=( ...
{ "content_hash": "56c92669279fa253ea1acec465f8365f", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 78, "avg_line_length": 22.37704918032787, "alnum_prop": 0.5505494505494506, "repo_name": "trustedanalytics/platform-ansible", "id": "eaa17e12ba9572973c06c20d5145915d06e48851...
from __future__ import print_function, division import os import logging from sys import stdout def change_dir(base_path, full_exp_name): path = os.path.join(base_path, full_exp_name) try: os.mkdir(path) except OSError as exception: if exception.errno == 17: print(path, "alread...
{ "content_hash": "1e88159c7dd9c3ded4857341fedd2898", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 72, "avg_line_length": 28.257142857142856, "alnum_prop": 0.5540950455005056, "repo_name": "mmottahedi/neuralnilm_prototype", "id": "929c10f249714508967faa7bfdeff22b89ad7376"...
import objc; objc.setVerbose(1) from AppKit import * from Foundation import * from PyObjCTools import AppHelper from MyDocument import * from LaunchServices import * from PreferencesWindowController import * PYTHON_EXTENSIONS = [u'py', 'pyw', u'pyc'] FILE_TYPE_BINDING_MESSAGE = u""" %s is not the default application ...
{ "content_hash": "31213fabcfc1166517baf7dfe998458b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 128, "avg_line_length": 35.5, "alnum_prop": 0.6416735708367854, "repo_name": "albertz/music-player", "id": "0059488adaf1751a281b3ad6c6cdfc69f01d2fc2", "size": "2414", "bi...
import os from os.path import join as pjoin import shutil import time import logging import matplotlib matplotlib.use('Agg', warn=False) import numpy as np import matplotlib.pyplot as plt import seaborn seaborn.set_style("dark") import pandas as pd from collections import OrderedDict from datetime import datetime impor...
{ "content_hash": "27daf3218f81f23bc0f8fe040e9fda61", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 129, "avg_line_length": 46.69230769230769, "alnum_prop": 0.5835490703694987, "repo_name": "dmd/stabilitycalc", "id": "20ceeedd243b8cc73522201c151e3b360e819ddf", "size": "8...
""" Matplotlib plotting backend wrapper. This module enables converting matplotlib plotting commands to vispy plotting commands. Support is experimental and incomplete, proceed with caution. """ __all__ = ['show'] try: from matplotlib.pyplot import * # noqa except ImportError: def show(): raise Impo...
{ "content_hash": "229b8af5c1d73f493da0aae711fccbad", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 64, "avg_line_length": 24.176470588235293, "alnum_prop": 0.7226277372262774, "repo_name": "jay3sh/vispy", "id": "ffa7134460bb740c0f81ad32a81a09cdff737bb4", "size": "556", ...
"""Converts the CuBERT VMR NC dataset (w/o output token copies) to PLUR.""" # TODO: Add a test for this dataset. from plur.stage_1 import cubert_variable_misuse_repair_dataset from plur.stage_1 import plur_dataset class CuBertVariableMisuseRepairNoCopyDataset( cubert_variable_misuse_repair_dataset.CuBertVariable...
{ "content_hash": "1cc8c8ad42cf1b1de590cb130fcf5d7b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 36.07142857142857, "alnum_prop": 0.6613861386138614, "repo_name": "google-research/plur", "id": "e59d4a4f066b952ffcd06720a219a85cba19f5e2", "size": "...
""" WSGI config for Quotes 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Quotes.settings") from django.core.wsg...
{ "content_hash": "acb3d10617aa24d13cf36abf96b93b98", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.642857142857142, "alnum_prop": 0.772609819121447, "repo_name": "GitSomeCode/Random-Quote", "id": "a78ff51599a44a48db828a0aedbe15b37726dc1d", "size...
from __future__ import annotations import logging import unittest from unittest.mock import MagicMock, patch import pytest from airflow.exceptions import AirflowException from airflow.models import Connection from airflow.models.dag import DAG from airflow.providers.apache.livy.hooks.livy import BatchState, LivyHook...
{ "content_hash": "8dba3af9cee9c06d430d7dcb2afb47d7", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 109, "avg_line_length": 38.59748427672956, "alnum_prop": 0.6488512302427897, "repo_name": "nathanielvarona/airflow", "id": "8f4e7e04f5b2397613195d7feb05b7c9cccff357", "siz...
import setuptools setuptools.setup( setup_requires=['pbr>=1.3'], pbr=True)
{ "content_hash": "dbd108d6efd1da8c2a89c6aef0e499e4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 16.8, "alnum_prop": 0.6666666666666666, "repo_name": "citrix-openstack/nodepool", "id": "4e7501ef5e0098e756e316fe07e9c1235372ca5e", "size": "717", "...
''' Lux extension for integrating SQL and NoSQL into applications. The extension create create a new application attribute called ``odm`` which can be used to access object data mappers for different backend. To access the ``sql`` mapper: sql = app.odm('sql') in a router handler: def get(self, request): ...
{ "content_hash": "bd9d56437abd9481288a808a51fb1a02", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 78, "avg_line_length": 24.360655737704917, "alnum_prop": 0.6318977119784657, "repo_name": "tazo90/lux", "id": "137f82302f85263794a411750a1f5d6c98aaba75", "size": "1486", ...
import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure...
{ "content_hash": "08fde9107ebf667f956040a6ea10e442", "timestamp": "", "source": "github", "line_count": 608, "max_line_length": 166, "avg_line_length": 42.26973684210526, "alnum_prop": 0.6383268482490272, "repo_name": "Azure/azure-sdk-for-python", "id": "3b5d3acc38c6c7ab2589c4eb0f49fa84a9b66a6b", "...
from msrest.serialization import Model class PolicykeyResource(Model): """Namespace/NotificationHub Regenerate Keys. :param policy_key: Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can be Primary Key/Secondary Key. :type policy_key:...
{ "content_hash": "c3bfca9a61be47e471d89237bb0bc721", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 76, "avg_line_length": 27.88888888888889, "alnum_prop": 0.6593625498007968, "repo_name": "rjschwei/azure-sdk-for-python", "id": "f7707d3d77613f041682501351efa0f8b17e8ca0", ...
from django.db import connection from apps.commons.control_model import SoftDeletionManager class MarketManager(SoftDeletionManager): def raw_as_qs(self, raw_query, params=()): """Execute a raw query and return a QuerySet. The first column in the result set must be the id field for the model. ...
{ "content_hash": "3b3bad290adc663c923d79c6dad1e31c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 35.526315789473685, "alnum_prop": 0.6266666666666667, "repo_name": "we-inc/mms-snow-white-and-the-seven-pandas", "id": "87e921538b8e38012e888582346d6c7...
from slicc.ast.ExprAST import ExprAST from slicc.symbols import Func, Type class FuncCallExprAST(ExprAST): def __init__(self, slicc, proc_name, exprs): super(FuncCallExprAST, self).__init__(slicc) self.proc_name = proc_name self.exprs = exprs def __repr__(self): return "[FuncCa...
{ "content_hash": "970e42baf947552fc323f748fdb83b6b", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 112, "avg_line_length": 37.63235294117647, "alnum_prop": 0.5550345186921974, "repo_name": "xiaoyaozi5566/DiamondCache", "id": "ab6261de270a0d036b9753bf5d74797f5b1c0774", "...
from django.utils.translation import ugettext_lazy as _ import horizon from horizon.test.test_dashboards.dogs import dashboard class Puppies(horizon.Panel): name = _("Puppies") slug = "puppies" dashboard.Dogs.register(Puppies)
{ "content_hash": "40607ad1ca9766f3764ae02474ba41f4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 18.53846153846154, "alnum_prop": 0.7510373443983402, "repo_name": "zestrada/horizon-cs498cc", "id": "a660436d9454cff7785e18fa9f9d0cf1d2f41748", "size...
class Entity: def __init__(self, name): self.name = name self._ports = [] self._generics = [] def add_port(self, port): self._ports.append(port) def get_ports(self): for port in self._ports: yield port
{ "content_hash": "1f17f4eabcffb3784581e19a13e833f8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 32, "avg_line_length": 20.692307692307693, "alnum_prop": 0.5130111524163569, "repo_name": "popas90/vhdl-parser", "id": "a9734ebc23ced5a0c959d853ec40b69297d52fd0", "size": "...
from pywps.tests import WpsClient, WpsTestResponse class WpsTestClient(WpsClient): def get(self, *args, **kwargs): query = "?" for key, value in kwargs.iteritems(): query += "{0}={1}&".format(key, value) return super(WpsTestClient, self).get(query) def client_for(service): ...
{ "content_hash": "01ca33e19dcfbd110f50e88e5a67ba2c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 52, "avg_line_length": 26.428571428571427, "alnum_prop": 0.6513513513513514, "repo_name": "bird-house/birdhouse-workshop", "id": "c0eba7c842056032a736815d4dad7f9964477880", ...
''' hdf5 viewer to dispay images, tables, attributes and trees of a hdf5 file. ''' import os,sys import wx,h5py import wx.py from hdfTree import * from hdfGrid import * from hdfAttrib import * from hdfImage import * try: from hdfImageGL import * except ImportError as e: print 'ImportError: '+e.message try: from...
{ "content_hash": "0dd429e0ed09ef1663095eb1839f109c", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 221, "avg_line_length": 34.08545034642032, "alnum_prop": 0.6561420150416695, "repo_name": "ganymede42/h5pyViewer", "id": "1bfbaf331745cbf634b316f646cb10266ceb26e1", "size"...
""" MIT License Copyright (c) 2017 Kartik Arora Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ...
{ "content_hash": "be0dad399f11b35fd182cc52e70bcfcd", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 111, "avg_line_length": 37.060344827586206, "alnum_prop": 0.6943475226796929, "repo_name": "kartikarora/android-permissions", "id": "3e9ee1f77c167cf8d76632043b098a3301fe01a6...
from ctypes import * from pyglet.gl import * class GLSLException(Exception): pass def glsl_log(handle): if handle == 0: return '' log_len = c_int(0) glGetObjectParameterivARB(handle, GL_OBJECT_INFO_LOG_LENGTH_ARB, byref(log_len)) if log_len.value == 0: ...
{ "content_hash": "1d8337a4777ff2076d1c6b915cd04e16", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 78, "avg_line_length": 27.06909090909091, "alnum_prop": 0.5638097796883396, "repo_name": "bitcraft/pyglet", "id": "5568cb698812e8ffa656791bce9d8915eb68ced7", "size": "7444...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from textwrap import wrap from colors import blue, cyan, green, red from pants.help.help_info_extracter import HelpInfoExtracter class HelpFormatter(object): def...
{ "content_hash": "6426819c2099e31516d06e6ef03472a1", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 97, "avg_line_length": 35.78947368421053, "alnum_prop": 0.6136029411764706, "repo_name": "qma/pants", "id": "bbbc57d49eab42debf02175da17d7d438e88b350", "size": "2867", "b...
from django import forms from datetime import datetime from django.db import connection EXP_TYPE = ( ('Temporary', 'Temporary'), ('Permanent', 'Permanent'), ('Recurrent', 'Recurrent'), ) TAG_ID = ( ('1', 'AED'), ('2', 'Free Food'), ('3', 'Event'), ('4', 'Restroom'), ('5', 'Vaccines'), ('6', 'Health Check-ups'...
{ "content_hash": "67f76512c0d5de27e70790809247b4ff", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 225, "avg_line_length": 69.11538461538461, "alnum_prop": 0.6736227045075125, "repo_name": "CraigRhodes/fs_site", "id": "f55c888b247a89dd8a8e50d590f58c5f7c770bb5", "size": "...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: vultr_server short_description: Manages virtual servers on...
{ "content_hash": "5008b85a0a3140cd659635f30d786a08", "timestamp": "", "source": "github", "line_count": 909, "max_line_length": 126, "avg_line_length": 34.31793179317932, "alnum_prop": 0.5354704279531977, "repo_name": "SergeyCherepanov/ansible", "id": "9f6cc7a267d76c04f0433d17d67e9ad17d23ee6c", "si...
import logging import json import sys from django.urls import reverse from nose.tools import assert_equal, assert_not_equal, assert_true, assert_false from desktop.lib.django_test_util import make_logged_in_client from desktop.lib.connectors.models import Connector from useradmin.models import User if sys.version_in...
{ "content_hash": "4d09bae8f42375e858084e43fef3f9b1", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 130, "avg_line_length": 39.55421686746988, "alnum_prop": 0.5540664026804751, "repo_name": "kawamon/hue", "id": "01e486d1b0e3dad79feebe7c5fc21a347e0ca62d", "size": "7382", ...
from scrapy.item import Item, Field class Car(Item): title = Field() year = Field() price = Field() miles = Field() color = Field() transmission = Field() vin = Field() url = Field()
{ "content_hash": "8e4161ac2f750db97e89cc13d3660a20", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 35, "avg_line_length": 18.083333333333332, "alnum_prop": 0.5668202764976958, "repo_name": "JeffPaine/subaru_search", "id": "a330b66728b310b04698a83de2c02693b1e625c6", "size...
""" Django settings for atcui project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
{ "content_hash": "b965a6940e95f4626a9236c0b91f2919", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 71, "avg_line_length": 25.445378151260503, "alnum_prop": 0.6743725231175693, "repo_name": "duydb2/ZTC", "id": "ff02ab0011466e8d00e347e5c2b24ecea3e15574", "size": "3028", ...
from tempest.api.volume import base from tempest.common.utils import data_utils from tempest import config from tempest import test CONF = config.CONF class SnapshotsActionsV2Test(base.BaseVolumeAdminTest): @classmethod def skip_checks(cls): super(SnapshotsActionsV2Test, cls).skip_checks() if...
{ "content_hash": "648131a71f2b0c2d7fd1d10911d4d111", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 76, "avg_line_length": 42.26190476190476, "alnum_prop": 0.6492018779342723, "repo_name": "nuagenetworks/tempest", "id": "f2bf613a1a75442d40ab8ea385a2136f6f7f647f", "size":...
import warnings import mmcv import numpy as np import torch from torch.nn.modules.utils import _pair from .builder import PRIOR_GENERATORS @PRIOR_GENERATORS.register_module() class AnchorGenerator: """Standard anchor generator for 2D anchor-based detectors. Args: strides (list[int] | list[tuple[int...
{ "content_hash": "3e0fb1a45c46d72ae82d82b3e3574b2b", "timestamp": "", "source": "github", "line_count": 865, "max_line_length": 79, "avg_line_length": 42.95606936416185, "alnum_prop": 0.5461151330839411, "repo_name": "open-mmlab/mmdetection", "id": "20886fbda65dbf0737565ec6dba59e9fc7bb73ff", "size"...
import unittest class TestImporters(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(self): pass if __name__ == '__main__': unittest.main()
{ "content_hash": "bf8fb2f2c8aae5bd37a142c18577a9fe", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 39, "avg_line_length": 13.9375, "alnum_prop": 0.57847533632287, "repo_name": "rbrecheisen/pyminer", "id": "4a1710697b925371de3b8906bdedb7da489b5bb9", "size": "223", "bina...
import pandas as pd from shapely.geometry import MultiLineString, MultiPoint, MultiPolygon from shapely.geometry.base import BaseGeometry _multi_type_map = { "Point": MultiPoint, "LineString": MultiLineString, "Polygon": MultiPolygon, } def collect(x, multi=False): """ Collect single part geomet...
{ "content_hash": "ccabb4dfb2219e66b1b309fb80a61a99", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 32.333333333333336, "alnum_prop": 0.6529209621993127, "repo_name": "jorisvandenbossche/geopandas", "id": "c42c921a07bb36442513a2866e91b6a029a91dcd", ...
from __future__ import unicode_literals import asyncore import email from email.mime.text import MIMEText import os import shutil import smtpd import sys import tempfile import threading from smtplib import SMTPException from ssl import SSLError from django.core import mail from django.core.mail import (EmailMessage,...
{ "content_hash": "925604b696e22760e85473f525e30095", "timestamp": "", "source": "github", "line_count": 932, "max_line_length": 216, "avg_line_length": 46.32081545064378, "alnum_prop": 0.6340367376247944, "repo_name": "adambrenecki/django", "id": "bb57ca37ff5bf9b689d6508d4db60419f171dec7", "size": ...
"""Module containing the views for GSoC documents page. """ from django.conf.urls.defaults import url as django_url from soc.logic.exceptions import AccessViolation from soc.logic.exceptions import NotFound from soc.models.document import Document from soc.views import document from soc.views.base_templates import P...
{ "content_hash": "d67ad84bd6604a386250ef216331001f", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 80, "avg_line_length": 27.988826815642458, "alnum_prop": 0.6708582834331337, "repo_name": "adviti/melange", "id": "99be5b73f9a460d81a7d9b2b7b6a4e82a0acff06", "size": "5620...
import os import yaml from flask import Config class SkeletonConfig(Config): def from_yaml(self, filename): """Reads the given yml file and imports all values""" if not os.path.exists(filename): raise Exception('Config file \"{}\" does not exist'.format(filename)) with open(filename) as...
{ "content_hash": "aba88cc3a089599dd46d5bdeab8fb8a0", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 28.377777777777776, "alnum_prop": 0.6147220046985121, "repo_name": "ryakad/flask-skeleton", "id": "188569404e3deb5d63c9f97c0f3eb23693422011", "size":...
from django.contrib import admin # Methodmint from testimonials.models import * admin.site.register(Testimonial)
{ "content_hash": "9a2d75ee4e729eb2e43e88b0920dbf80", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 33, "avg_line_length": 14.625, "alnum_prop": 0.8034188034188035, "repo_name": "mfitzp/django-golifescience", "id": "ec02bcdf536c82ea56c42bb96730c5c58323f5a8", "size": "117",...
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._type import TypeValidator from ._title import TitleValidator from ._tickvalssrc import TickvalssrcValidator from ._tickvals import TickvalsValidator from ._ticktextsrc import TicktextsrcValidator f...
{ "content_hash": "8782033d60754f1104b6506f4e86b5b4", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 72, "avg_line_length": 46.661417322834644, "alnum_prop": 0.7013162335470806, "repo_name": "plotly/plotly.py", "id": "73da7a7073553d4e4abc35764ec6d5fdef5e4b92", "size": "59...
""" .. module: security_monkey.watchers.github.team :platform: Unix :synopsis: Watcher for GitHub Organization Teams. .. version:: $$VERSION$$ .. moduleauthor:: Mike Grima <[email protected]> """ from security_monkey import app from security_monkey.common.github.util import get_github_creds, iter_org, strip...
{ "content_hash": "bbd37fba4f4a9f64ac9a598d725e7b32", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 95, "avg_line_length": 33.830357142857146, "alnum_prop": 0.555027711797308, "repo_name": "Netflix/security_monkey", "id": "1a5d0d468c5fb88ebb94ecf679924d8450603691", "size...
import RPi.GPIO as GPIO import time import os from daemon import runner class FanControl(): # Return CPU temperature as float def getCPUtemp(self): cTemp = os.popen('vcgencmd measure_temp').readline() return float(cTemp.replace("temp=","").replace("'C\n","")) def __init__(self): s...
{ "content_hash": "9581d665d73c77a70702ac29c02988fa", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 66, "avg_line_length": 29.894736842105264, "alnum_prop": 0.5625, "repo_name": "jpoirier/stratux-setup", "id": "584ffc98469fad46ac3ef6a30ca8f29d8d29eb3c", "size": "1327", ...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "c4f0ea3ca0a417f2623dcfc8ccc59e93", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 375, "avg_line_length": 38.096969696969694, "alnum_prop": 0.5777919185491569, "repo_name": "napalm-automation/napalm-yang", "id": "d5a84bbc8aca23d5a6a16b5cb3d761b3ec6b3b20",...
import six from kmip.core.attributes import CertificateType from kmip.core import enums from kmip.core.enums import Tags from kmip.core import exceptions from kmip.core.misc import CertificateValue from kmip.core import objects from kmip.core.objects import Attribute from kmip.core.objects import KeyBlock from kmi...
{ "content_hash": "e01c94630f59ab932494fb0108dd839d", "timestamp": "", "source": "github", "line_count": 754, "max_line_length": 79, "avg_line_length": 35.07161803713528, "alnum_prop": 0.5997579791256996, "repo_name": "OpenKMIP/PyKMIP", "id": "1b0ceace0ffb76e5c1875070b0b73e0b28ba05c5", "size": "2709...
from openstack.tests.functional import base class TestResource(base.BaseFunctionalTest): def test_list(self): ids = [o.resource_id for o in self.conn.telemetry.resources()] self.assertNotEqual(0, len(ids))
{ "content_hash": "901a42d069ee778e87cb5e5ca4699da1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 70, "avg_line_length": 28.625, "alnum_prop": 0.7117903930131004, "repo_name": "mtougeron/python-openstacksdk", "id": "0fcaf865a0c0cf117602cb46b248925c267d0de6", "size": "775...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0028_remove_postmortem'), ] operations = [ migrations.AddField( model_name='event', name='offer_help_email_sent', ...
{ "content_hash": "685271469c52059a207e642e5273b163", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 62, "avg_line_length": 27.107142857142858, "alnum_prop": 0.5744400527009222, "repo_name": "patjouk/djangogirls", "id": "6b301ba680c4775820a916081a50ce8c1956bedd", "size": "...
from pathlib import Path from subprocess import Popen # nosec from time import sleep from typing import IO def _dialer_is_connected(log_path: str) -> bool: with open(log_path, 'rb') as fobj: for line in fobj: if line.startswith(b'--> secondary DNS address'): return True re...
{ "content_hash": "6c58a6cd4f54485875ba20b80c78206d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 90, "avg_line_length": 30.942857142857143, "alnum_prop": 0.605724838411819, "repo_name": "ascoderu/opwen-webapp", "id": "182fa3a6de79a647d67d8f91bccdb4a727de30ed", "size": ...
import pwnlib.tubes def handle_pow(r): print(r.recvuntil(b'python3 ')) print(r.recvuntil(b' solve ')) challenge = r.recvline().decode('ascii').strip() p = pwnlib.tubes.process.process(['kctf_bypass_pow', challenge]) solution = p.readall().strip() r.sendline(solution) print(r.recvuntil(b'Cor...
{ "content_hash": "60ea463c05c771d496eeede34881240f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 68, "avg_line_length": 28.1, "alnum_prop": 0.6637010676156584, "repo_name": "google/google-ctf", "id": "e6014f2e63bd2102258ccec3bf00554538ede661", "size": "1185", "binary...
""" Training various Deep Learning Algorithms using Keras with Tensorboard backend This module takes paths to the location of images to be used for Image classification. As of now it is used for cognitive radio spectrum awareness based on the DySpan2017 Challenge spectrum setup, but it can be used for any multiclass i...
{ "content_hash": "e1a5656bebd4804c072fee6bdd10a622", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 80, "avg_line_length": 31.518828451882847, "alnum_prop": 0.6110447364927651, "repo_name": "primercuervo/cognitive_radio_ml", "id": "8d8c7a16c0cd37b3ab06c8e3c7bceba4491b9c83"...
""" Given a rectangular matrix of characters, add a border of asterisks(*) to it. """ def addBorder(picture): picture = [''.join(('*',i,'*')) for i in picture] for item in picture: border = '*'*len(item) indx = [0,(len(picture)+1)] for item in indx: picture.insert(item,border) ...
{ "content_hash": "64c3e57a68cd467eb33979a4a43dc996", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 77, "avg_line_length": 21.789473684210527, "alnum_prop": 0.572463768115942, "repo_name": "mayababuji/MyCodefights", "id": "a07f101cbe39a152841953694eaab3e1a4e05f04", "size"...
import configparser import copy import datetime from functools import cmp_to_key import getpass import logging from io import StringIO import os import re import sys import traceback import types import textwrap from optparse import OptionGroup from optparse import OptionParser from packstack.installer import basedef...
{ "content_hash": "9082112529d9f88cb8b266a2cec73f69", "timestamp": "", "source": "github", "line_count": 1065, "max_line_length": 147, "avg_line_length": 37.95399061032864, "alnum_prop": 0.5974369758293956, "repo_name": "fr34k8/packstack", "id": "dbb421034e3c3fa355d677c92bbc3906cf4de8a9", "size": "4...
import unittest class TestEventProducerLastUpdate(unittest.TestCase): pass
{ "content_hash": "693458f32f86494d96c9a625736d4d96", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 53, "avg_line_length": 15.6, "alnum_prop": 0.8461538461538461, "repo_name": "yashodhank/frappe", "id": "ccdea6c694b86877e791c8c34bbc7923007f5b40", "size": "181", "binary":...
def extractDjurasicoBlogspotCom(item): ''' Parser for 'djurasico.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Common Sense of a Dukes daughter', 'Common S...
{ "content_hash": "bac166e0d925145da5900cf72b2462fc", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 135, "avg_line_length": 55.74074074074074, "alnum_prop": 0.5295681063122923, "repo_name": "fake-name/ReadableWebProxy", "id": "4a036fcc7580adc8169e67d3bc7d84632d8ceb59", "s...
""" MLine (:mod:`skrf.media.MLine`) ======================================== .. autosummary:: :toctree: generated/ MLine """ import numpy as npy from numpy import log, log10, tanh, sqrt, exp, real, imag, cosh, \ ones, zeros, arctan from scipy.constants import epsilon_0, mu_0, c, pi...
{ "content_hash": "24eb18f0b6b6408bdcd796e68481153d", "timestamp": "", "source": "github", "line_count": 719, "max_line_length": 118, "avg_line_length": 41.21418636995828, "alnum_prop": 0.5188809772888334, "repo_name": "scikit-rf/scikit-rf", "id": "8f567103fd19d1225cff0c61e29bfc5bf7747c99", "size": ...