text
stringlengths
4
1.02M
meta
dict
import pymysql as sql import platform,re, os, shutil, signal, sys, _thread as thread, time, urllib, socketserver as SocketServer, subprocess, codecs if "-judge" not in sys.argv: print("\nArgus Online Judge : Execution Protocol (Linux Version 1.0)") print("\nCommand Line Options :") print(" -judge : Connect to...
{ "content_hash": "8df46dadf59e00e43807bf939c36c444", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 396, "avg_line_length": 43.610169491525426, "alnum_prop": 0.6717839098328799, "repo_name": "pushkar8723/Aurora", "id": "b26bc3616bd23a8cd1947b1037763d324262314f", "size": ...
""" A minimal front end to the Docutils Publisher, producing Docutils XML. """ try: import locale locale.setlocale(locale.LC_ALL, '') except: pass from docutils.core import publish_cmdline, default_description description = ('Generates Docutils-native XML from standalone ' 'reStructuredTe...
{ "content_hash": "dbfa5b6549a2187734a52e56013a1285", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 70, "avg_line_length": 24.647058823529413, "alnum_prop": 0.7255369928400954, "repo_name": "burzillibus/RobHome", "id": "b96dc7d53d302f8da48899990a06dbc3fe2c0b16", "size": "...
from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import SJISDistributionAnalysis from .jpcntx import SJISContextAnalysis from .mbcssm import SJISSMModel from . import constants import sys from .constants import eStart, eError, eItsMe class SJ...
{ "content_hash": "f684035b1ba1eb63b55055b5171e777f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 108, "avg_line_length": 40.69491525423729, "alnum_prop": 0.6014160766347355, "repo_name": "Branlala/docker-sickbeardfr", "id": "a515c5768e929464ebd7e5b0faa6820b219ca053", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Actualizacion', fields=[ ('id', models.AutoField(au...
{ "content_hash": "0953b6403c1d7cfb7eb0b82e605c3515", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 114, "avg_line_length": 32.296875, "alnum_prop": 0.4929850024189647, "repo_name": "ErickMurillo/aprocacaho", "id": "b6c2d0dc24c606298c21d99b5fb317a520be4673", "size": "2139...
""" A portmanteau word is a blend of two or more words, like 'mathelete', which comes from 'math' and 'athelete'. You will write a function to find the 'best' portmanteau word from a list of dictionary words. Because 'portmanteau' is so easy to misspell, we will call our function 'natalie' instead: natalie(['word...
{ "content_hash": "c4935252c94606c8df516b5c40f62d0b", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 169, "avg_line_length": 50.96190476190476, "alnum_prop": 0.6544571108204074, "repo_name": "feredean/cs313", "id": "c8a90a5839653ba143b11e808ec36f54b2606896", "size": "5377...
import numpy import pickle from nutils import matrix, sparse, testing, warnings @testing.parametrize class backend(testing.TestCase): n = 100 complex = False def setUp(self): super().setUp() try: self.enter_context(matrix.backend(self.backend)) except matrix.BackendNo...
{ "content_hash": "785252a5c5df9b17f3b11d523b4c6444", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 146, "avg_line_length": 43.87843137254902, "alnum_prop": 0.5685047814818125, "repo_name": "wijnandhoitinga/nutils", "id": "f8e580c582ffef45ed34753904c1991d8d41ae31", "size...
import image_search import pickle import imlist import numpy as np import os from numpy import * def read_features_from_file(filename): f = loadtxt(filename,dtype="string") return f[:,:] # feature locations, descriptors images=imlist.get_imlist("/home/ashish/dip/chap7/images_test/") features_path="/home/ashish/dip...
{ "content_hash": "10ca9c6b30b8bc9d5d964bf9016f497d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 24.636363636363637, "alnum_prop": 0.7355473554735548, "repo_name": "ashishchopra778/Content-Based-Image-Retrieval", "id": "83b28c4b3364bf4c616acb9e35e7...
from setuptools import setup, find_packages setup( name='Hugh', version='0.1', packages=find_packages(), install_requires = [ 'Werkzeug', ], )
{ "content_hash": "4a3b763ebced3eefc987fea56b7f4d18", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 43, "avg_line_length": 17.2, "alnum_prop": 0.5930232558139535, "repo_name": "mgood/hugh", "id": "f5554d555c9ceb7ddd6ea448c5914ba3c2c85f36", "size": "194", "binary": false...
from wpilib import * from math import pi as PI from sys import stderr from time import time from PidDrive import EncoderDrive class RobotMap: """ The RobotMap is a mapping from the ports sensors and actuators are wired into to a variable name. This provides flexibility changing wiring, makes checking th...
{ "content_hash": "61398e2c0018a03b4f8d48b1ac2547b9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 105, "avg_line_length": 35.476190476190474, "alnum_prop": 0.7241610738255033, "repo_name": "guineawheek/team-2785-frc2015", "id": "e1c8495c7215661efa909b74e038dd28e47a82fe", ...
""" Object-oriented filesystem path representation. """ from __future__ import division, absolute_import import os import sys import errno import base64 from os.path import isabs, exists, normpath, abspath, splitext from os.path import basename, dirname, join as joinpath from os import listdir, utime, stat from sta...
{ "content_hash": "d237fecbcaaa58468f7afb60f677f5f0", "timestamp": "", "source": "github", "line_count": 1762, "max_line_length": 80, "avg_line_length": 33.341657207718505, "alnum_prop": 0.6035779941444815, "repo_name": "whitehorse-io/encarnia", "id": "3f12a03f6c664dbd69547759ecc3e902e7c1ca73", "siz...
from django.shortcuts import render from django.http import HttpResponseRedirect from .forms import EmailForm from django.core.mail import send_mail, BadHeaderError from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, redirect def email(request): if request.method == 'P...
{ "content_hash": "64145b92cda13527bfa8b22377faa1ea", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 29.5, "alnum_prop": 0.6214689265536724, "repo_name": "torchmed/torchmed", "id": "97299c2f5e33e17d006151d9d4a3d70d3d9aeff8", "size": "1062", "binary...
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns = [ url(r'^admin_tools/', include('admin_tools.urls')), url(r'^admin/', include...
{ "content_hash": "5d446f38a0e52bbca2ee0be5a6bcaccd", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 115, "avg_line_length": 33.8, "alnum_prop": 0.7266272189349112, "repo_name": "modelbrouwers/modelbouwdag.nl", "id": "077b252b4dc79e8db4180965986198b3bc08d389", "size": "845...
from __future__ import print_function, unicode_literals import codecs import base64 import json import sys import os import re import time import shutil import random import requests import bs4 import urlparse sys.path.insert(1, os.path.dirname( os.path.dirname(os.path.realpath(__file__)))) from lib import commons...
{ "content_hash": "bae88cfccdd60095685ae3616584e92d", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 105, "avg_line_length": 28.352941176470587, "alnum_prop": 0.6369294605809128, "repo_name": "mcxiaoke/python-labs", "id": "7b10a1e0a320ede7335fb4173821837c20da3dcd", "size":...
"""py-mstorrent Demo Helper Script""" import signal import time import sys import os import os.path START_TIME = time.time() SCRIPT_DIR = os.path.dirname(os.path.realpath( __file__ )) MY_WORKING_DIR = os.getcwd() WORKING_DIR = os.path.realpath( os.path.join( MY_WORKING_DIR, '..' ) ) SRC_DIR = os.path.realpath(os.path...
{ "content_hash": "d4a3496e0cbe0949b73b5be06e771e43", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 70, "avg_line_length": 25.131147540983605, "alnum_prop": 0.5694716242661448, "repo_name": "skgrush/py-mstorrent", "id": "190fa904d812e03130935e175691112395e40dfa", "size": ...
""" S3 Storage object. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os from boto.s3.key import Key from boto.s3.connection import S3Connection from io import BytesIO from django.conf import settings from tempfile import SpooledTemporaryFile from...
{ "content_hash": "67066c3882809478ab143a35f7c7a02d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 111, "avg_line_length": 39.7125, "alnum_prop": 0.6188227887944602, "repo_name": "leukeleu/django-dbbackup", "id": "28f1ccffa85b64c5669d408b93d4a4b329711633", "size": "3177"...
from rest_framework import serializers from data.models import Cartoon class SearchSerializer(serializers.ModelSerializer): characters = serializers.SerializerMethodField(read_only=True) class Meta: model = Cartoon fields = [ 'id', 'title', 'date', ...
{ "content_hash": "186d901ea0a8b1ba59d46d82cef803ab", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 25.5, "alnum_prop": 0.6264705882352941, "repo_name": "zaubermaerchen/imas_cg_api", "id": "f9cb83cf1e436fc52a50af8be30fd9f3f82b0a7e", "size": "1036", ...
import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '../libs')) # -- stdlib -- import json import socket import time # -- third party -- # -- own -- # -- code -- ts = int(time.time()) FIELDS = [ # "pxname", # [LFBS]: proxy name # "svname", # [LFBS]: service name (FRO...
{ "content_hash": "dc41d342ec2f1ee7ab0aabbf07d41a7b", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 133, "avg_line_length": 46.94656488549618, "alnum_prop": 0.5549593495934959, "repo_name": "kadashu/satori", "id": "c2154abe4c8fcd1726dd4c6fc4634bdd8399bd76", "size": "6212...
from oslo_policy import policy from keystone.common.policies import base mapping_policies = [ policy.DocumentedRuleDefault( name=base.IDENTITY % 'create_mapping', check_str=base.RULE_ADMIN_REQUIRED, description=('Create a new federated mapping containing one or ' 'more...
{ "content_hash": "8db941d654d1bd740174113db0597508", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 72, "avg_line_length": 39.97560975609756, "alnum_prop": 0.6070774862721171, "repo_name": "rajalokan/keystone", "id": "ff2778030006db86534c33d0a0848647a49c05a0", "size": "21...
num1 = int(input("digite o primeiro numero: ")) num2 = int(input("digite o segundo numero: ")) print("A soma de {first} + {second} eh igual a {soma}".format(first = num1, second = num2, soma = num1+num2))
{ "content_hash": "c0114cfe2c02e1ba3932de86a367c681", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 109, "avg_line_length": 51.5, "alnum_prop": 0.6650485436893204, "repo_name": "henriquejensen/Python_Zumbis", "id": "b3d7bee06f3b4c1a9c7579ec6c083529593b4538", "size": "206",...
from . import base from subprocess import call class Canto(base.ThreadedPollText): """ Display RSS feeds updates using the canto console reader. """ orientations = base.ORIENTATION_HORIZONTAL defaults = [ ("fetch", False, "Whether to fetch new items on update"), ("feeds", [], "...
{ "content_hash": "59882f7c103b423cbe41bc7f4818984c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 70, "avg_line_length": 32.611111111111114, "alnum_prop": 0.5229982964224872, "repo_name": "himaaaatti/qtile", "id": "fa11c4befde4359299d0eab152b84c83365ac9dd", "size": "243...
from flask import Flask, Response, request from twilio.twiml.voice_response import VoiceResponse app = Flask(__name__) @app.route("/voice", methods=['POST']) def get_voice_twiml(): """Respond to incoming calls with a simple text message.""" resp = VoiceResponse() if "To" in request.form: resp.di...
{ "content_hash": "57d338e461cf0a5110d33cf67a18be9a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 63, "avg_line_length": 25, "alnum_prop": 0.6476190476190476, "repo_name": "TwilioDevEd/api-snippets", "id": "a1b0ebed485904a9b5d6e382645a7c1dcd099fe6", "size": "525", "bi...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('mentha', '0003_budget'), ] operations = [ migrat...
{ "content_hash": "ec7a88a73272af3c84d7fa362e83b515", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 114, "avg_line_length": 33.82142857142857, "alnum_prop": 0.5776135163674763, "repo_name": "ateoto/django-mentha", "id": "443cd134c505bf34c3b52e17b2447d217fa4c650", "size": ...
''' Created on 5 cze 2014 @author: Przemek ''' from src.parser.measurable import Measurable from src.items.code_item import CodeItem, Instruction from src.items.bytes import Bytes class CodeItemSection(Measurable): ''' classdocs ''' def append(self, code_item): self.data.insert(len(self.data...
{ "content_hash": "2fa59218dc01c246939cbe5c13d894df", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 55, "avg_line_length": 30.605263157894736, "alnum_prop": 0.6096302665520207, "repo_name": "PrzemekBurczyk/dalvik-compiler", "id": "e692d2146615401c90b4f90b52a0e6394d2a68a9", ...
from metakernel import Magic, option try: from calysto_scheme import scheme except: scheme = None class SchemeMagic(Magic): def __init__(self, kernel): super(SchemeMagic, self).__init__(kernel) self.retval = None def line_scheme(self, *args): """ %scheme CODE - evaluat...
{ "content_hash": "c3d1f36d7749efb19a33988728314258", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 88, "avg_line_length": 26.947916666666668, "alnum_prop": 0.568225744105141, "repo_name": "Calysto/metakernel", "id": "2d1e7695cbd8c585af9728cd84a0617918e52281", "size": "26...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "caa5a6b0d35abaef01a58577aec126ab", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 178, "avg_line_length": 45.967032967032964, "alnum_prop": 0.6643557255558212, "repo_name": "radicalbit/ambari", "id": "008a1e7516d02cdc2c75727746b68fa8066bb2f2", "size": "4...
"""Binary for training translation models and decoding from them. Running this program without --decode will download the WMT corpus into the directory specified as --data_dir and tokenize it in a very basic way, and then start training a model saving checkpoints to --train_dir. Running with --decode starts an interact...
{ "content_hash": "a2fc3ef075ef8fafe2956948e122ee14", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 102, "avg_line_length": 50.34615384615385, "alnum_prop": 0.6143184546545891, "repo_name": "mlwithtf/mlwithtf", "id": "c86dd6995bf81875051408a2e9f85573e2b736ce", "size": "9...
from __future__ import annotations import collections import os import pathlib import procrunner import pytest from cctbx import uctbx from dxtbx.model import ExperimentList from dxtbx.serialize import load from dials.array_family import flex def unit_cells_are_similar( uc1, uc2, relative_length_tolerance=0.0...
{ "content_hash": "3ad34874261666227a35feaafe0dc262", "timestamp": "", "source": "github", "line_count": 836, "max_line_length": 93, "avg_line_length": 33.53349282296651, "alnum_prop": 0.6307341085824356, "repo_name": "dials/dials", "id": "3d38e512619df6c61f60fd748f3a421499c6b58b", "size": "28034", ...
""" Classes and utilities for addresses of various types. """ from __future__ import print_function import struct import socket # Slightly tested attempt at Python 3 friendliness import sys if 'long' not in sys.modules['__builtin__'].__dict__: long = int """ # Unfinished oui name stuff formerly from packet librar...
{ "content_hash": "1aeae40c75c3a499820a58cdf77bf972", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 79, "avg_line_length": 29.13978494623656, "alnum_prop": 0.5853874538745387, "repo_name": "damomeen/pox-datapath", "id": "bd31090f0b047880747e9c16959ff642e1c03e65", "size":...
import socket # Networking support import signal # Signal support (server shutdown on signal receive) import time # Current time import os.path import shutil import re import gvar class websock: """ Class describing a simple HTTP server objects.""" def __init__(self, port = 8080, host = ''):...
{ "content_hash": "5d9bd55845abccdb1d9dc1cfc7634d38", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 154, "avg_line_length": 40.91316526610644, "alnum_prop": 0.48623853211009177, "repo_name": "Gabrielcarvfer/TR22015FS", "id": "699df18ac11e8bec6f2149b7a71c07b596ce9bca", "s...
import os import sys import unittest import httmock sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import clever from clever import importer json = importer.import_json() import requests from httmock import response, HTTMock def functional_test(auth): class FunctionalTests(CleverTestCase): ...
{ "content_hash": "8db5ce8bd78ead621d979ed00b360dea", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 99, "avg_line_length": 33.642857142857146, "alnum_prop": 0.6955060155697098, "repo_name": "kvigen/test-drone-hook", "id": "699badad3caab31067e86df484c4fa3bbba7cae0", "size...
import os import commands import sys import shutil import time import glob from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_TMP = "/tmp" def buildHelloMap(key): if not os.path.exists(BUILD_TMP): os.mkdir(BUILD_TMP) os.chdir(BUILD_TMP) bu...
{ "content_hash": "0e28733b2572596ed72218c8ea52b753", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 185, "avg_line_length": 43.40594059405941, "alnum_prop": 0.625, "repo_name": "wanghongjuan/crosswalk-test-suite", "id": "45cae2dc84e5a9df5e967c225c5fe6fb3be4af29", "size":...
import json import urllib2 KUBELET_DEFAULT_PORT = 10255 KUBELET_DEFAULT_HOST = "localhost" class Kubelet(object): def list_pods(self): url = "http://{}:{}/pods".format(KUBELET_DEFAULT_HOST, KUBELET_DEFAULT_PORT) try: response = urllib2.urlopen(url) except urllib2.HTTPError as...
{ "content_hash": "2aa3fb134609ff17e7494d3f324f6c4b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 84, "avg_line_length": 24.3, "alnum_prop": 0.6069958847736625, "repo_name": "Yelp/fullerite", "id": "723b0c5e266a2e0237074174c88ec8ad91840350", "size": "486", "binary": f...
import pylab as PL import ttk from Tkinter import * from ttk import Notebook class GUI: ## GUI variables titleText = 'PyCX Simulator' # window title timeInterval = 0 # refresh time in milliseconds running = False modelFigure = None stepSize = 1 currentStep...
{ "content_hash": "86b139a7cbf413b81da3c00f922c0aef", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 189, "avg_line_length": 45.620535714285715, "alnum_prop": 0.6234465211860261, "repo_name": "nalyd88/modeling-and-simulation", "id": "489cd9aba3797310f6d67e5d2fb143ec3580e6fc...
from tempest.lib.services.compute import assisted_volume_snapshots_client from tempest.tests.lib import fake_auth_provider from tempest.tests.lib.services import base class TestVolumesClient(base.BaseServiceTest): FAKE_SNAPSHOT = { "id": "bf7b810c-70df-4c64-88a7-8588f7a6739c", "volumeId": "59f17c...
{ "content_hash": "833eae7c29c9863c55202dba913ce72d", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 77, "avg_line_length": 43.38461538461539, "alnum_prop": 0.6778959810874704, "repo_name": "openstack/tempest", "id": "79855ea25cf91f2832ddf371138b6ae348a0cc56", "size": "229...
import github from github_accounts import accounts token = accounts["social"] client = github.Github(token, per_page=100) screen_name = "torvalds" repository_name = "linux" user = client.get_user(screen_name) repo = user.get_repo(repository_name) user_count = 0 for user in repo.get_stargazers(): print(user_co...
{ "content_hash": "63589cebc04d4658f044745c777d3133", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 43, "avg_line_length": 18, "alnum_prop": 0.6944444444444444, "repo_name": "bmtgoncalves/TorinoCourse", "id": "096c4d90ad2d1f0082be385ff4c8305b7af79f6c", "size": "396", "b...
from datetime import timedelta from django.contrib.auth.models import Group from django.test.utils import get_runner from django.utils import six from django_performance_testing import test_runner as djpt_test_runner_module from django_performance_testing.serializer import Reader from freezegun import freeze_time impor...
{ "content_hash": "00d6e75daa1aa146501fbf256819f17c", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 174, "avg_line_length": 36.03243243243243, "alnum_prop": 0.6231623162316232, "repo_name": "PaesslerAG/django-performance-testing", "id": "fccc5af1b343d9014abf5f13c55fe4698e2...
import requests class JsonParser(object): def __init__(self, json_cont=None, url=None): if url is not None: self.url = url self.json_cont_dictionary = requests.get(url).json() self.json_cont_dictionary = json_cont def parse(self, json_cont_dict=None): if json...
{ "content_hash": "8c7bf8dc13e8f45033986fdfff38eb5c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 34.717948717948715, "alnum_prop": 0.5576070901033974, "repo_name": "guanxin0206/dice_crawler", "id": "b8c3589e5d5a17b0b6c28f5c647225c912a1f2b0", "siz...
from . import base from . import mixins from datetime import date from .. import cleaver class TransformedRecord(mixins.GenericCompensationMixin, mixins.GenericDepartmentMixin, mixins.GenericIdentifierMixin, mixins.GenericJobTitleMixin, mixins.GenericPersonMixin, mixins.MembershipMixin, mixin...
{ "content_hash": "d7bca887019fb42e6bec6564643264ea", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 28.921259842519685, "alnum_prop": 0.5624829839368364, "repo_name": "texastribune/tx_salaries", "id": "b8d2a260d7f2808612ec0fc80b0fbc97beffa89e", "si...
import importlib import logging import os import pkgutil import sys import appdirs from neon.util.compat import pickle, pickle_load logger = logging.getLogger(__name__) def get_cache_dir(subdir=None): """ Function for getting cache directory to store reused files like kernels, or scratch space for autot...
{ "content_hash": "fb9ecadf7c22922deb6eb132dfa9c996", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 93, "avg_line_length": 29.583783783783783, "alnum_prop": 0.6230586515622145, "repo_name": "Jokeren/neon", "id": "9bc3ed655be711b6569c4f884b235716676eec7e", "size": "6219",...
""" .. module: lemur.pending_certificates.models Copyright (c) 2018 and onwards Netflix, Inc. All rights reserved. .. moduleauthor:: James Chuong <[email protected]> """ from datetime import datetime as dt from sqlalchemy import ( Integer, ForeignKey, String, DefaultClause, func, Co...
{ "content_hash": "8a0834b8ba1da4e678ef3ddc01c71d3d", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 92, "avg_line_length": 32.6045197740113, "alnum_prop": 0.6302200658464737, "repo_name": "Netflix/lemur", "id": "ee3e5e97763a7e9942747645352cdec87ede239f", "size": "5771", ...
"""Process the ImageNet Challenge bounding boxes for TensorFlow model training. Associate the ImageNet 2012 Challenge validation data set with labels. The raw ImageNet validation data set is expected to reside in JPEG files located in the following directory structure. data_dir/ILSVRC2012_val_00000001.JPEG data_di...
{ "content_hash": "27c2495580c1c3e634a75b4b03d64010", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 34.14705882352941, "alnum_prop": 0.7390180878552972, "repo_name": "mlperf/training_results_v0.6", "id": "54270f0886d70947d45396ee9c1550912bd6d537", "...
from awsdaleks import chaser, warrior, dalek import boto3 def exterminate(target): iot = boto3.client('iot', region_name=target["region"]) policyName = target["names"][0] targets = iot.list_targets_for_policy(policyName=policyName)["targets"] for targetName in targets: iot.detach_policy( ...
{ "content_hash": "dadabda33563104ac79e5bc7d5541eb0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 29.75, "alnum_prop": 0.6911764705882353, "repo_name": "jfaerman/aws-daleks", "id": "228d3e2657184e3b5dc882abc66ed1a72a39630c", "size": "476", "bina...
import unittest from BlockServer.config.ioc import IOC class TestContainersSequence(unittest.TestCase): def test_ioc_to_dict(self): ioc = IOC("SIMPLE1") macros = {"macro1": {'value': 123}, "macro2": {'value': "Hello"}} ioc.macros = macros d = ioc.to_dict() self.assertTrue(...
{ "content_hash": "a35ea60586244cda8aa1faed805a354d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 34.470588235294116, "alnum_prop": 0.5938566552901023, "repo_name": "ISISComputingGroup/EPICS-inst_servers", "id": "c4fa32ed3c36820e5860c311fa396da6acb7...
from sys import argv script, user_name = argv prompt = '>' print "Hi %s, I'm the %s script." % (user_name, script) print "I'd like to ask you a few questions." print "Do you like me %s?" % user_name likes = raw_input(prompt) print "Where do you live %s?" % user_name lives = raw_input(prompt) print "What kind of com...
{ "content_hash": "6053d5dd3479f8ce1724b266b341432d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 55, "avg_line_length": 25, "alnum_prop": 0.68, "repo_name": "michsien/Learning_python", "id": "d6c6fc374e95184d7677a71dac354251e3819f9c", "size": "525", "binary": false, ...
import bpy import bmesh import numpy as np from typing import List import sys from pathlib import Path UTILS_PATH = Path.home() / "Documents/python_workspace/data-science-learning" sys.path.append(str(UTILS_PATH)) import importlib import ds_utils.blender_utils importlib.reload(ds_utils.blender_utils) from ds_utils.b...
{ "content_hash": "d75703609f85923b3811df023c57257a", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 105, "avg_line_length": 32.24285714285714, "alnum_prop": 0.6315906070004431, "repo_name": "5agado/data-science-learning", "id": "3247903855f2267e122cfb4ee9018fa4abbea276", ...
""" Utility methods for working with WSGI servers """ import errno import json import logging import os import signal import sys import time import eventlet from eventlet.green import socket from eventlet.green import ssl import eventlet.greenio import eventlet.wsgi from oslo.config import cfg from oslo.utils import ...
{ "content_hash": "5f6b43c53a942a33fa6c86cac79692aa", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 79, "avg_line_length": 37.31464530892448, "alnum_prop": 0.6029190813479287, "repo_name": "redhat-openstack/heat", "id": "b8dc36c0150b9f45ef8a74708a8985559b9c9c22", "size":...
from google.cloud.bigquery import datapolicies_v1beta1 async def sample_list_data_policies(): # Create a client client = datapolicies_v1beta1.DataPolicyServiceAsyncClient() # Initialize request argument(s) request = datapolicies_v1beta1.ListDataPoliciesRequest( parent="parent_value", ) ...
{ "content_hash": "5124f228606cd2cfe0acfec60714662c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 85, "avg_line_length": 29, "alnum_prop": 0.7396551724137931, "repo_name": "googleapis/python-bigquery-datapolicies", "id": "94a0fa2a4a2ecf7630d283f53a745b711bcd9ac8", "size...
import pickle import pytest from pyrsistent import CheckedPMap, InvariantException, PMap, CheckedType, CheckedPSet, CheckedPVector, \ CheckedKeyTypeError, CheckedValueTypeError class FloatToIntMap(CheckedPMap): __key_type__ = float __value_type__ = int __invariant__ = lambda key, value: (int(key) == v...
{ "content_hash": "99733523c9247896e66f29289967de2b", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 105, "avg_line_length": 25.901315789473685, "alnum_prop": 0.6332232664465329, "repo_name": "tobgu/pyrsistent", "id": "aae07ed470dfa83bf814b70972d1fef528228343", "size": "3...
''' Linux accelerometer --------------------- ''' from plyer_lach.facades import Accelerometer import os import glob import re class LinuxAccelerometer(Accelerometer): def _enable(self): pass def _disable(self): pass def _get_acceleration(self): try: pos = glob.glob...
{ "content_hash": "0b56844d00848906833fabc6ce80a4be", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 24.583333333333332, "alnum_prop": 0.5864406779661017, "repo_name": "locksmith47/turing-sim-kivy", "id": "804d92993beac318748b9d5f40319b1f4e9dfdc2", "...
import logging import platform import subprocess import sys import warnings from pathlib import Path from pytest import raises, mark from twisted import version as twisted_version from twisted.internet import defer from twisted.python.versions import Version from twisted.trial import unittest import scrapy from scrap...
{ "content_hash": "65a99f27af376e07a48d48914cebe05e", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 119, "avg_line_length": 42.417004048582996, "alnum_prop": 0.6645509210651904, "repo_name": "scrapy/scrapy", "id": "c09f1a6f2c0218e86d4e6c76fbd732fbd10bbcb8", "size": "2095...
''' Created on Nov 17, 2013 @author: leoreyes ''' from google import search from Crawler import findContactPage if __name__ == '__main__': inputFileName = raw_input("Enter name of input file: ") writeFileName = raw_input("Enter name of output file: ") writeFile = open(writeFileName, "a") with open(inp...
{ "content_hash": "7ef90b24f1270cbfc365b5f502a5f19c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 75, "avg_line_length": 33.23684210526316, "alnum_prop": 0.5534441805225653, "repo_name": "LeoYReyes/GoogleSearchAutomator", "id": "797bfecbcf9f82e5b47b8720501faf59111d52a7", ...
import unittest from pyobjus import autoclass, dereference, ObjcInt from pyobjus.dylib_manager import load_dylib from pyobjus.objc_py_types import NSRange Car = car = None class DereferenceTest(unittest.TestCase): def setUp(self): global Car, car load_dylib('testlib.dylib', usr_path=False) ...
{ "content_hash": "67d833b3bb4f6d9283e62a78d3cc3a89", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 55, "avg_line_length": 30.16, "alnum_prop": 0.6671087533156499, "repo_name": "kivy/pyobjus", "id": "4fedfb50f3c979c365706b9095ddb0f7ade9417a", "size": "754", "binary": fa...
import logging from google.appengine.api import users from vendors import models class RequestUserMiddleware(object): """Middleware to add a user and a user_account to each request. The cached current account class variable is also updated. """ def process_request(self, request): user = us...
{ "content_hash": "d2fe1ccedb23183b34e425262ff746e8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 67, "avg_line_length": 29.19047619047619, "alnum_prop": 0.6769983686786297, "repo_name": "tectronics/engayged", "id": "0088088976a0e75379806bb1815fbf49521ff68f", "size": "1...
import os from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from mimetypes import guess_type from email.encoders import encode_base64 from smtplib import SMTP class Email: """ Classe utilitaire permettant de construire la forme du courriel ...
{ "content_hash": "1bc763fe12715b93d5f6fe07f6a03926", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 118, "avg_line_length": 32.077777777777776, "alnum_prop": 0.6127467959819882, "repo_name": "ClubReflets/ImageMailer", "id": "74c53f75129f7237e8faad1e5ed3d24eccb8a329", "siz...
import unittest import numpy as np from laserchicken import keys from laserchicken.feature_extractor.feature_extraction import compute_features from laserchicken.test_tools import create_point_cloud, create_points_in_xy_grid from laserchicken.volume_specification import InfiniteCylinder class TestExtractSigmaZ(unit...
{ "content_hash": "22b8f6079190486206916c687a0dda13", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 117, "avg_line_length": 35.08695652173913, "alnum_prop": 0.6716232961586122, "repo_name": "eEcoLiDAR/eEcoLiDAR", "id": "e47acadd8453a92a5ab4310b3446220522a18a24", "size": "...
from rest_framework import serializers from cats.models import Breed class BreedSerializer(serializers.ModelSerializer): """Breed Serializer Class""" class Meta: model = Breed fields = ('id', 'name',)
{ "content_hash": "86bee4f9dae38a410d9f41140450dcf2", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 51, "avg_line_length": 22.8, "alnum_prop": 0.6842105263157895, "repo_name": "OscaRoa/api-cats", "id": "ae8f77a0e8450f6bfdf2574053fcfd6e46b2f3e7", "size": "228", "binary":...
class no_update(object): _model = None def __init__(self, model, fire_update_needed=True): self._model = model self._fire_update_needed = fire_update_needed def __enter__(self): if self._model: self._model._no_update = True def __exit__(self, _type, value, _traceba...
{ "content_hash": "64fd8cb7b342a9d22a574c97c5bf41c0", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 32.1578947368421, "alnum_prop": 0.4909983633387889, "repo_name": "UManPychron/pychron", "id": "92c34b66013cf5700af63d2dbc3b880a852a2d04", "size": "15...
import re import logging class Nucleotide(object): """The Nucleotide class represents DNA changes in the COSMIC database. The Nucleotide class follows the syntax of HGVS (http://www.hgvs.org/mutnomen/recs-DNA.html). """ def __init__(self, hgvs='', occurrence=1, len5ss=2, len3ss=...
{ "content_hash": "d336069a463d6a9ed96132c84a764e67", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 106, "avg_line_length": 41.300411522633745, "alnum_prop": 0.5195296931048227, "repo_name": "KarchinLab/2020plus", "id": "d8c74443349140304040e108f36e80652d148a08", "size":...
import view view.main()
{ "content_hash": "2f5ac2be81f16f683d7a0e7c004814fa", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 11, "avg_line_length": 13, "alnum_prop": 0.6923076923076923, "repo_name": "surru/Three-Musketeers-Game", "id": "adb2178f58e69c6351de9a57e5248ceec430955d", "size": "26", "b...
import logging import os import shutil import socket from jinja2 import Environment, FileSystemLoader from cekit import tools from cekit.descriptor import Env, Image, Label, Module, Overrides, Repository from cekit.errors import CekitError from cekit.version import version as cekit_version from cekit.template_helper ...
{ "content_hash": "6e8e8c3fe86672558ebeadd0b018e439", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 115, "avg_line_length": 40.8768115942029, "alnum_prop": 0.5673934881522189, "repo_name": "jboss-container-images/concreate", "id": "dad5d06c3cb91beb89ae5e0ab40b1e7dacc1ece7"...
from __future__ import absolute_import import os import shutil import tempfile import unittest from .client_api import CodeSearch, XrefNode from .messages import KytheNodeKind, CompoundResponse, NodeEnumKind, \ CallGraphResponse, Node from .testing_support import InstallTestRequestHandler, LastRequest, \ Test...
{ "content_hash": "8387c64b7c314fba2a7458fcbcf108d8", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 80, "avg_line_length": 40.09183673469388, "alnum_prop": 0.6138966658182744, "repo_name": "chromium/codesearch-py", "id": "622d6513320e57cf6b23dc4074f115d92f87aff3", "size"...
import sqlalchemy def upgrade(migrate_engine): meta = sqlalchemy.MetaData() meta.bind = migrate_engine event = sqlalchemy.Table('event', meta, autoload=True) event.c.logical_resource_id.alter(name='resource_name') def downgrade(migrate_engine): meta = sqlalchemy.MetaData() meta.bind = migrat...
{ "content_hash": "4f952ae4585780f4ec6b8329ae086c58", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 59, "avg_line_length": 29.866666666666667, "alnum_prop": 0.7142857142857143, "repo_name": "redhat-openstack/heat", "id": "02cdd87d1ee6cdd7b54add61adad104edc8caf47", "size":...
"""Tests for the HomeKit component.""" from __future__ import annotations import asyncio import os from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patch from pyhap.accessory import Accessory from pyhap.const import CATEGORY_CAMERA, CATEGORY_TELEVISION import pytest from homeassistant import config as hass...
{ "content_hash": "8d4918503a800c744dc96ef84aa9e3f5", "timestamp": "", "source": "github", "line_count": 1715, "max_line_length": 114, "avg_line_length": 33.9667638483965, "alnum_prop": 0.6441899987983452, "repo_name": "sander76/home-assistant", "id": "4976985fa156de4e0717748fd5cf2cf7af7b3276", "siz...
from flask.ext.script import Manager from flask.ext.assets import ManageAssets from portfolio import create_app manager = Manager(create_app) manager.add_command("assets", ManageAssets) if __name__ == "__main__": manager.run()
{ "content_hash": "243de0f8fb516de1be3c8d2ef8dbfd94", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 43, "avg_line_length": 23.4, "alnum_prop": 0.7393162393162394, "repo_name": "timesqueezer/portfolio", "id": "f2c39b4c17a671b2ac7b1140735826bdd668b99d", "size": "251", "bi...
""" Utilities for NetApp FAS drivers. This module contains common utilities to be used by one or more NetApp FAS drivers to achieve the desired functionality. """ import json import socket from oslo_config import cfg from oslo_log import log from cinder import exception from cinder.i18n import _ from cinder import ...
{ "content_hash": "923f85ba617d04337c909581a5fa8d8d", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 79, "avg_line_length": 33.19047619047619, "alnum_prop": 0.6760401721664275, "repo_name": "phenoxim/cinder", "id": "dc9a6d30d976929c64e5488af2aab2dc4132917b", "size": "4057...
toolkit = 'choose' family = None class ToolKitError(Exception): pass def use(name): """ Set the name of the GUI toolkit we should use. """ global toolkit, family name = name.lower() if name.startswith('choose'): pass elif name.startswith('qt') or name.startswith('pyside'):...
{ "content_hash": "b839873701a3080c7373ccfadf6f6149", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 70, "avg_line_length": 22.904109589041095, "alnum_prop": 0.5496411483253588, "repo_name": "pllim/ginga", "id": "c8d1f01c5696568bf24b6b0da761b6bc1ee96ba6", "size": "1852", ...
import string, cgi, time import sys sys.path.insert(0, 'PyWebPlug') from wsserver import * from time import sleep def setupMessages(): return class Client: def __init__(self, socket): self.socket = socket self.needsConfirmation = True def handle(self): if (self.socket): ...
{ "content_hash": "f51301a132fb08f091790cfd631b18d7", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 96, "avg_line_length": 26.074285714285715, "alnum_prop": 0.5084374315143546, "repo_name": "ChrisFadden/PartyTowers", "id": "de3244435c09cafe6d132fa82bccb0ac8be6a1bc", "siz...
import argparse from typing import Optional from drillsrs import db, util from drillsrs.cmd.command_base import CommandBase class CreateTagCommand(CommandBase): names = ["add-tag", "create-tag"] description = "add a new tag to a deck" def decorate_arg_parser(self, parser: argparse.ArgumentParser) -> Non...
{ "content_hash": "af8ded9bc05ff3a173c044712db69989", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 75, "avg_line_length": 30.487179487179485, "alnum_prop": 0.5668629100084104, "repo_name": "rr-/drill", "id": "b6993f90c06b46207307bef15bf3841ace0d2979", "size": "1189", "...
import pytest, sys, os sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../") from unittest import TestCase from pylogic.knowledge_base import KnowledgeBase from pylogic.decorators import case from pylogic.exceptions import ArityError from pylogic.functions import _ def add_parent_strain(base): @ca...
{ "content_hash": "d54256bc080304a3bafe623a8371a65e", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 102, "avg_line_length": 28, "alnum_prop": 0.6009475218658892, "repo_name": "fran-bravo/pylogic-module", "id": "98bc2045df6fb1f32c84f57eb3e9666dff70687a", "size": "2744", ...
from django.db import models # Create your models here. class Messages(models.Model): state = models.CharField('State', max_length=64) city = models.CharField('City', max_length=64) username = models.CharField('User', max_length=64) message = models.TextField('Message') create_time = models.DateTi...
{ "content_hash": "e80db05b734919acf11646b5c55ee745", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 32.53846153846154, "alnum_prop": 0.6808510638297872, "repo_name": "jasonrhaas/ducking-adventure", "id": "63f50af5a4a418ab54ccc9f44c066105bae62d6d", "...
import test_collective_api_base as test_base import paddle import paddle.distributed as dist import paddle.fluid as fluid class TestCollectiveIsendIrecvAPI(test_base.TestCollectiveAPIRunnerBase): def __init__(self): self.global_ring_id = 0 def get_model(self, main_prog, startup_program, rank, indata...
{ "content_hash": "4c0714e12e0b28262bdeccb37ff08851", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 119, "avg_line_length": 37.35294117647059, "alnum_prop": 0.5645669291338583, "repo_name": "PaddlePaddle/Paddle", "id": "3637a6f4343b53b54418de99265ae191eca125fd", "size": "...
from openturns import * TESTPREAMBLE() try: hermite = HermiteFactory() print "hermite=", hermite for i in range(10): print "hermite(", i, ")=", hermite.build(i) roots = hermite.getRoots(10) print "hermite(10) roots=", repr(roots) nodes, weights = hermite.getNodesAndWeights(10) prin...
{ "content_hash": "253e4144169ef0faa80609d5a80b46eb", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 64, "avg_line_length": 28.9375, "alnum_prop": 0.6565874730021598, "repo_name": "sofianehaddad/ot-svn", "id": "ae5316fcfb9aa889daa2136b7fe3e9bad9ab6581", "size": "487", "b...
import logging import ibmsecurity.utilities.tools logger = logging.getLogger(__name__) # URI for this module uri = "/core/update_servers" requires_modules = None requires_version = None def get_all(isamAppliance, check_mode=False, force=False): """ Get all Update Servers """ return isamAppliance.inv...
{ "content_hash": "e54a5b9888f851d39b1c63d28fd3f43f", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 120, "avg_line_length": 40.89719626168224, "alnum_prop": 0.591636197440585, "repo_name": "IBM-Security/ibmsecurity", "id": "898fd64bd9fa187589ef4b60630c54fdfe955982", "siz...
"""Create a CSV file from the JSON output of sunlight.go.""" import json import os import sys import codecs def main(): if len(sys.argv) != 3: sys.exit("Usage: " + sys.argv[0] + " <certs.json> <output_file.csv>") f_in = open(sys.argv[1], "r") #f_out = codecs.open(sys.argv[2], "w", encoding='utf8') f_out...
{ "content_hash": "25cbfe2de6737653bb56034c85e51827", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 149, "avg_line_length": 36.184615384615384, "alnum_prop": 0.5705782312925171, "repo_name": "mozkeeler/sunlight", "id": "e616d32b8abad2aafd8c6458eb9bdf15fab2a301", "size": "...
from PyQt5 import QtCore, QtWidgets class ProgressDialog(QtWidgets.QDialog): def __init__(self, parent=None): QtWidgets.QDialog.__init__(self, parent) self.finished = False self.initUI() def initUI(self): hbox = QtWidgets.QVBoxLayout() self.label = QtWidgets.QLabel('st...
{ "content_hash": "3993626a2260cbe8e3cd980e6813f4df", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 123, "avg_line_length": 29.5, "alnum_prop": 0.6264908976773383, "repo_name": "sciapp/pyMolDyn", "id": "1eb7abbc4e3ff95a57fe970411bd9cb532e0686b", "size": "1593", "binary"...
import pyglet from .physics import Circle TEXTURE_PLAYER = pyglet.resource.texture('char.png') TEXTURE_PLAYER.anchor_x = TEXTURE_PLAYER.width / 2 TEXTURE_PLAYER.anchor_y = TEXTURE_PLAYER.height / 2 class Actor: """ Base class for all actors """ _x = 0 _y = 0 _last_x = 0 _last_y = 0 ...
{ "content_hash": "33bc18ad47a8b61546e850113de7e3d9", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 66, "avg_line_length": 21.983193277310924, "alnum_prop": 0.525611620795107, "repo_name": "paeronskruven/pyweek22", "id": "bcbc9a90e1eccda936f710f1e97f35cfe7ba2e73", "size"...
""" Project management classes and functions """ from PyQt5 import QtWidgets, QtCore from views.message_dialog import Ui_message_dialog class MessageHelper(QtWidgets.QDialog): def __init__(self, parent): super(MessageHelper, self).__init__(parent) self.ui = Ui_message_dialog() self.ui.set...
{ "content_hash": "afc04705c7a1b0916839cd1a29d1de42", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 25.379310344827587, "alnum_prop": 0.6494565217391305, "repo_name": "santosfamilyfoundation/SantosGUI", "id": "569cf20ebed99baa3cfa78dd9ee2afee9f823b2d"...
"""A script that will rewrite audiotest* metadata to match their filenames.""" from __future__ import print_function, division, absolute_import, unicode_literals from builtins import * # noqa from glob import glob import os import mutagen for fname in glob(u'audiotest*'): audio = mutagen.File(fname, easy=True) ...
{ "content_hash": "c249baf797ecfb927f6cc3705d5d2344", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 82, "avg_line_length": 26.266666666666666, "alnum_prop": 0.6510152284263959, "repo_name": "thebigmunch/gmusicapi", "id": "c5e8f4aa3f36f93481010b61de4bb8d60abd07db", "size":...
from django.shortcuts import render from django.shortcuts import render_to_response from django.shortcuts import render from django.template.context import RequestContext from django.contrib.auth.decorators import login_required from models import Cytology @login_required(login_url='/', redirect_field_name='') def re...
{ "content_hash": "6f8407d46e052d131663e343135ff47d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 67, "avg_line_length": 32.13793103448276, "alnum_prop": 0.7124463519313304, "repo_name": "msfernandes/anato-hub", "id": "96ed757f42ab326b8b546da0402ba85c6487a776", "size": ...
""" Tests for the Inspur InStorage volume driver. """ import re from oslo_concurrency import processutils from oslo_utils import units import six from cinder import exception from cinder import utils from cinder.volume.drivers.inspur.instorage import instorage_const from cinder.volume.drivers.inspur.instorage impor...
{ "content_hash": "cd7fae5977da59aec485c363acdfec50", "timestamp": "", "source": "github", "line_count": 2195, "max_line_length": 79, "avg_line_length": 40.84829157175399, "alnum_prop": 0.4801699716713881, "repo_name": "phenoxim/cinder", "id": "f58cd63cbb1f2827a9884095a3f39632bc6207c2", "size": "902...
import rx import tx import led class Target(object): def __init__(self): # our UART consists of a RX and TX path as seen from the target self.TX_FIFO_PATH = "../../appl/run/spike/tx_pipe" self.RX_FILE_PATH = "../../appl/run/spike/rx_file" self.RX_TMP_FILE_PATH = "../../appl/ru...
{ "content_hash": "831b0036a8f0664ce48b784d0f57973b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 33.794117647058826, "alnum_prop": 0.5648389904264578, "repo_name": "minth/riscv-security-tutorial", "id": "1e43e50f283e262b693d17d224f8415be42a5b45", ...
from base import * DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'testing_{{cookiecutter.project_name}}', 'HOST': '', 'USER': '', 'PASSWORD': '', 'CONN_MAX_AGE': 600, } } TEMPLATE_LOADERS = ( ...
{ "content_hash": "2c3ba745c0d37d2a7c8b65a2b7a3c2fa", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 118, "avg_line_length": 23, "alnum_prop": 0.5709382151029748, "repo_name": "uhuramedia/cookiecutter-django", "id": "a92bccd6e07101e555717e46b3eb7ea6bd412641", "size": "874"...
from canari.maltego.utils import debug from canari.framework import configure from canari.maltego.entities import URL, Phrase from common.entities import Actor, Case, CoursesOfAction, Incident, Indicator, TTP from canari.maltego.message import Label, UIMessage from common.client import search, encode_to_utf8, lower, Th...
{ "content_hash": "ae59ce939622dd56c2a745153f6ee384", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 108, "avg_line_length": 38.97849462365591, "alnum_prop": 0.5401379310344827, "repo_name": "ThreatCentral/blackberries", "id": "bf5e24306efa994444ddc01669698463d3f550d2", "s...
""" Fake Manhattan device (65 qubit). """ import os from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeManhattanV2(fake_backend.FakeBackendV2): """A fake Manhattan backend.""" dirname = os.path.dirname(__file__) conf_filename = "conf_manhattan.json" props_filename ...
{ "content_hash": "fa3149f3d1e50c1e6f499a4d3e87232e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 27.96153846153846, "alnum_prop": 0.7015130674002751, "repo_name": "QISKit/qiskit-sdk-py", "id": "13e39360ad17b25a599e2569aeb2306c1f1cb907", "size": "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('donor', '0001_initial'), ] operations = [ migrations.AlterField( model_name='profile', name='address', field=mod...
{ "content_hash": "b5e4422cee7d5f411a9bea28a07292b8", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 63, "avg_line_length": 27.68421052631579, "alnum_prop": 0.5475285171102662, "repo_name": "markeasterling/donormatch", "id": "1af3feacc13cab73a4d09e274f949bec8e36e549", "siz...
import os import six import copy import struct import signal import logging import multiprocessing import hmac from hashlib import sha1 from hashlib import sha256 from Crypto.Cipher import AES try: from setproctitle import setproctitle except ImportError: def setproctitle(title): pass from bucky.erro...
{ "content_hash": "da7f918259b0af6cedfa67a83f6157bf", "timestamp": "", "source": "github", "line_count": 638, "max_line_length": 93, "avg_line_length": 35.843260188087775, "alnum_prop": 0.5405807241560259, "repo_name": "JoseKilo/bucky", "id": "d1b555c8ed47e3806809a0ca9a9f4d051882fa75", "size": "2343...
from JumpScale import j OsisBaseObject=j.core.osis.getOsisBaseObjectClass() class Group(OsisBaseObject): """ identifies a node in the grid @param netaddr = {mac:[ip1,ip2]} """ def __init__(self, ddict={}): if ddict <> {}: self.load(ddict) else: self.id = "...
{ "content_hash": "fc5e12282cb8e840d246dd2e06673142", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 65, "avg_line_length": 23.5609756097561, "alnum_prop": 0.5279503105590062, "repo_name": "Jumpscale/jumpscale6_core", "id": "9350e37aa2d030edc213aae32f40cb650a6d2ebb", "size...
"""Support for NZBGet switches.""" from __future__ import annotations from typing import Callable from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME from homeassistant.helpers.entity import Entity from homeassistant.h...
{ "content_hash": "ba94c850ee08613b4994abd6c90e9694", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 86, "avg_line_length": 30.41891891891892, "alnum_prop": 0.6628165259884495, "repo_name": "adrienbrault/home-assistant", "id": "4f0eae17c23dc1383bc8bfbf479b528e297ff40c", "s...
from django.core import exceptions from django.db import connection, DataError from django.test.utils import override_settings from olympia.access.models import Group from olympia.amo.fields import HttpHttpsOnlyURLField, CIDRField from olympia.amo.tests import TestCase class HttpHttpsOnlyURLFieldTestCase(TestCase): ...
{ "content_hash": "7a2e811ead17cd80bda7b4be69e5e65f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 85, "avg_line_length": 36.48717948717949, "alnum_prop": 0.6446474584211759, "repo_name": "mozilla/olympia", "id": "0a15983c2baf3c92dabf95e6cfe29f637f09dc8c", "size": "4269...
from django.conf import settings def admin_media_prefix(request): ''' Starting from django 1.4, the static files belonging to django admin follow the standard conventions. ''' return {'ADMIN_MEDIA_PREFIX': settings.STATIC_URL + 'admin/' }
{ "content_hash": "90e305b1a069817db241fad8fa6605f3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 28.88888888888889, "alnum_prop": 0.7, "repo_name": "alixedi/django_popcorn", "id": "237280cacaa3ee473cd1bc820e0bc32a77ba98d9", "size": "260", "binar...
"""Download modules for built-in datasets. Download functions accept two arguments: * `save_directory` : Where to save the downloaded files * `clear` : If `True`, clear the downloaded files. Defaults to `False`. """ from fuel.downloaders import binarized_mnist from fuel.downloaders import cifar10 from fuel.downloade...
{ "content_hash": "58705303654e1518a30dd31e35271e21", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 31.833333333333332, "alnum_prop": 0.7452006980802792, "repo_name": "lamblin/fuel", "id": "f848b104ad2381cf32408287e92c31d1f86659de", "size": "573", ...
from __future__ import annotations import logging from collections import OrderedDict import scipy.sparse import numpy as np from typing import ( Any, Dict, Text, List, Tuple, Callable, Set, Optional, Type, Union, ) from rasa.engine.graph import ExecutionContext, GraphComponent...
{ "content_hash": "3c8bc53128c5380e1eac8679f517f5db", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 88, "avg_line_length": 40.46111111111111, "alnum_prop": 0.5976017209025585, "repo_name": "RasaHQ/rasa_nlu", "id": "2c3d5e91f107fb2bd9981a869307c9606fa68721", "size": "2184...
from c7n.utils import yaml_load from .common import BaseTest import logging from pprint import pformat logger = logging.getLogger(name="c7n.tests") class PutMetricsTest(BaseTest): record = False EXAMPLE_EC2_POLICY = """ policies: - name: track-attached-ebs resource: ...
{ "content_hash": "8c7819c9a565a4846c92d39acd596daf", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 96, "avg_line_length": 34.822429906542055, "alnum_prop": 0.5501878690284487, "repo_name": "capitalone/cloud-custodian", "id": "737a934e078b420738e987611da5965acb4d88b3", "...
""" conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ from datetime import datetime import endpoints from protorpc import messages from protorpc import message_types...
{ "content_hash": "d48716f681e39f7fa8ecb973818f031a", "timestamp": "", "source": "github", "line_count": 1142, "max_line_length": 112, "avg_line_length": 38.98949211908932, "alnum_prop": 0.5934959349593496, "repo_name": "koox00/scalable-py", "id": "10b5c3263d68f8b22e99866f420c229b2a9fd062", "size": ...
from __future__ import unicode_literals import logging import os from mopidy import config, ext __version__ = '0.1.0' # TODO: If you need to log, use loggers named after the current Python module logger = logging.getLogger(__name__) class Extension(ext.Extension): dist_name = 'Mopidy-SerialPort' ext_nam...
{ "content_hash": "d62b00ffaa90e4782e58d53d6bb55324", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 77, "avg_line_length": 27.692307692307693, "alnum_prop": 0.6416666666666667, "repo_name": "prayerslayer/mopidy-serialport", "id": "86ac67a0d5ec90c526d9c8ccafa449e5263b6281", ...
import sys import logging import datetime from modularodm import Q from dateutil.relativedelta import relativedelta from scripts import utils as scripts_utils from website.app import init_app from website.oauth.models import ExternalAccount from website.addons.base.exceptions import AddonError from website.addons.box...
{ "content_hash": "216336fbca643c5be77a06d7d3d1f2e8", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 69, "avg_line_length": 28.352941176470587, "alnum_prop": 0.6355463347164592, "repo_name": "njantrania/osf.io", "id": "e366a4b6e57124c37d33839ee976e40f1138a41e", "size": "14...
from ....testing import assert_equal from ..preprocess import AutoTcorrelate def test_AutoTcorrelate_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), eta2=dict(argstr='-eta2', ), ignore_exception=dict(nohash=True, usedefault=True, ...
{ "content_hash": "7f8e17049ff05e9fbcb4294b057484d4", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 26.50943396226415, "alnum_prop": 0.6199288256227758, "repo_name": "carolFrohlich/nipype", "id": "31216252a474ce21c2656970a3f26698737a92e1", "size": "...
from sqlalchemy.testing import eq_, is_, assert_raises, \ assert_raises_message, expect_warnings import decimal import datetime import os from sqlalchemy import ( Unicode, MetaData, PickleType, Boolean, TypeDecorator, Integer, Interval, Float, Numeric, Text, CHAR, String, distinct, select, bindparam, an...
{ "content_hash": "ef13e35f6ff5f05302d8db0f11c757d3", "timestamp": "", "source": "github", "line_count": 2028, "max_line_length": 79, "avg_line_length": 33.08481262327416, "alnum_prop": 0.5491981638249672, "repo_name": "EvaSDK/sqlalchemy", "id": "d562c83ce6f7c9123f7510a7056a4a0e2a8e9616", "size": "6...
from __future__ import unicode_literals import uuid from datetime import datetime from random import random, randint import pytz from moto.core import BaseBackend, BaseModel from moto.ec2 import ec2_backends from copy import copy class BaseObject(BaseModel): def camelCase(self, key): words = [] ...
{ "content_hash": "6f632dfaaf99e3287376b4d365a27b22", "timestamp": "", "source": "github", "line_count": 772, "max_line_length": 134, "avg_line_length": 43.770725388601036, "alnum_prop": 0.6056642301204462, "repo_name": "kefo/moto", "id": "bc847b32e70f1f9f7912cc157294393f85ee4c2d", "size": "33791", ...
"""Breadcrumb module for Zinnia""" import re from functools import wraps from datetime import datetime from django.utils.dateformat import format from django.utils.timezone import is_aware from django.utils.timezone import localtime from django.core.urlresolvers import reverse from django.utils.translation import uget...
{ "content_hash": "9ec41826ed47a472f08af60f62f3b3d1", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 79, "avg_line_length": 31.961783439490446, "alnum_prop": 0.5603826225587883, "repo_name": "1844144/django-blog-zinnia", "id": "8f4d3c8030334993cc1899f9e462a1445eb02641", "...