text
stringlengths
4
1.02M
meta
dict
""" MoinMoin - ReStructured Text Parser @copyright: 2004 Matthew Gilbert <gilbert AT voxmea DOT net>, 2004 Alexander Schremmer <alex AT alexanderweb DOT de> @license: GNU GPL, see COPYING for details. REQUIRES docutils 0.3.10 or later (must be later than December 30th, 2005) """ impor...
{ "content_hash": "3f9a5e817168842a6c49dc814b920d85", "timestamp": "", "source": "github", "line_count": 635, "max_line_length": 129, "avg_line_length": 41.344881889763776, "alnum_prop": 0.5939666336558239, "repo_name": "RealTimeWeb/wikisite", "id": "6851dc22c9d708af948e1f9cd2cf47338161250e", "size"...
"""Simple script for xvfb_unittest to launch. This script outputs formatted data to stdout for the xvfb unit tests to read and compare with expected output. """ from __future__ import print_function import os import signal import sys import time def print_signal(sig, *_): # print_function does not guarantee its ...
{ "content_hash": "9a196d9fdfd4aedf93c8b86d1c672e98", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 30.34375, "alnum_prop": 0.713697219361483, "repo_name": "nwjs/chromium.src", "id": "4feb330a98f05ee846ec09c72e3556354a81deb6", "size": "1134", "bin...
import auth from novaclient.client import Client import novaclient import time def createServer(name): print "Enter createServer" nova_credentials = auth.get_nova_credentials_v2() nova = Client(**nova_credentials) serversList = nova.servers.list() print("List of VMs: %s" % serversList) ...
{ "content_hash": "3456c87ad81de5c1231d795b8ae7ec57", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 88, "avg_line_length": 30.71698113207547, "alnum_prop": 0.5927518427518428, "repo_name": "Will1229/learnOpenstack", "id": "962469a5683439d8a11a23024ff66d0ce0835fe2", "size"...
"""Required modules""" import re import csv import sys import numpy as np import scipy.io as sio import xlrd import numexpr as ne DATE = xlrd.XL_CELL_DATE TEXT = xlrd.XL_CELL_TEXT BLANK = xlrd.XL_CELL_BLANK EMPTY = xlrd.XL_CELL_EMPTY ERROR = xlrd.XL_CELL_ERROR NUMBER = xlrd.XL_CELL_NUMBER def read_excel(filename, sh...
{ "content_hash": "feabd35f32403acadee6947d7853cfbe", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 79, "avg_line_length": 29.015432098765434, "alnum_prop": 0.6305712158281034, "repo_name": "macklenc/coslib", "id": "8141923faa53d6db4168fd35c3b769fc7f70948f", "size": "940...
testcases = int(raw_input()) for testcase in xrange(testcases): input_str = raw_input() input_length = len(input_str) % 2 if input_length == 1: print -1 continue input_half = len(input_str) / 2 first_half = input_str[0: input_half] second_half = input_str[input_half: ]...
{ "content_hash": "343c1fe82291f8f2958d6dc58229d414", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 58, "avg_line_length": 26.333333333333332, "alnum_prop": 0.6044303797468354, "repo_name": "avenet/hackerrank", "id": "637c63990574d9a9740e485b667c9c06584ee22c", "size": "63...
from PyQt4 import QtCore, QtGui from spreadsheet_helpers import CellHelpers from spreadsheet_registry import spreadsheetRegistry from spreadsheet_tab import (StandardWidgetSheetTab, StandardWidgetSheetTabInterface) ###########################################################################...
{ "content_hash": "c45933c5c3946b5790e3fb2f7b5388e7", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 80, "avg_line_length": 39.64233576642336, "alnum_prop": 0.5758607991161848, "repo_name": "Nikea/VisTrails", "id": "79aa8df7ef8d6a365b6195fd60ed6f1bc82fd4c9", "size": "1308...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import numpy as np import roslaunch import rosparam import subprocess import imageio from core.env import Env from core.minisim.minisim_client import MinisimClient from utils....
{ "content_hash": "696687631c6474339710c99816d3c7aa", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 119, "avg_line_length": 44.20996441281139, "alnum_prop": 0.579892135555019, "repo_name": "AlekseyZhelo/pytorch-rl", "id": "97675a385f3f24b51a7e8db4e30d3ee7edccf674", "size...
import netaddr def check_subnet_ip(cidr, ip_address): """Validate that the IP address is on the subnet.""" ip = netaddr.IPAddress(ip_address) net = netaddr.IPNetwork(cidr) # Check that the IP is valid on subnet. This cannot be the # network or the broadcast address return (ip != net.network an...
{ "content_hash": "ac2eb7525e50b88edc6014ab2550b977", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 35.21212121212121, "alnum_prop": 0.6617900172117039, "repo_name": "NeCTAR-RC/neutron", "id": "74927769ad765ab3e0ad056a46a0c10e2d4f8e47", "size": "179...
""" polling utilities -- general polling for condition, polling for file to appear in a directory """ import os import glob from threading import Thread from gevent.event import Event from putil.logging import log from Queue import Queue class ConditionPoller(Thread): """ generic polling mechanism: every inter...
{ "content_hash": "d74913dd0f0270c3121c4e9e66ee188c", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 129, "avg_line_length": 37.05555555555556, "alnum_prop": 0.6096951524237881, "repo_name": "mkl-/scioncc", "id": "b1635177d047d10f848c32285533673fc90811d1", "size": "4002",...
import numpy as np import sys import cv2 def write_pfm(path, image, scale=1): """Write pfm file. Args: path (str): pathto file image (array): data scale (int, optional): Scale. Defaults to 1. """ with open(path, "wb") as file: color = None if image.dtype.name ...
{ "content_hash": "def5f2b33c7744486acb945af37efb84", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 88, "avg_line_length": 25.5609756097561, "alnum_prop": 0.5438931297709924, "repo_name": "intel-isl/MiDaS", "id": "ff9a54bd55f5e31a90fad21242efbfda5a6cc1a7", "size": "2096",...
from mqtt_as import MQTTClient import uasyncio as asyncio import ubinascii from machine import Pin, PWM, unique_id import urequests import secrets import topic _CLIENT_ID = ubinascii.hexlify(unique_id()) # Pin constants _BUZZER = 14 # GPIO14, D5 _LED1 = 16 # GPIO16, D0, Nodemcu led _LED2 = 2 # GPIO2, D4, ESP8...
{ "content_hash": "9793331dba850996bec5ece52d6cd664", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 69, "avg_line_length": 22.762886597938145, "alnum_prop": 0.6571557971014492, "repo_name": "chrisb2/gate-alarm", "id": "2b5b9be7c4c2c6fabbce6d8daf9c84c44f3872f9", "size": "2...
import os import sys def color(text, color_code, readline=False): """Colorize text. @param text: text. @param color_code: color. @return: colorized text. """ # $TERM under Windows: # cmd.exe -> "" (what would you expect..?) # cygwin -> "cygwin" (should support colors, but doesn't work s...
{ "content_hash": "f82ebea832490fdac42ffd68c4d7d421", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 74, "avg_line_length": 27.46938775510204, "alnum_prop": 0.6552748885586924, "repo_name": "S2R2/viper", "id": "fef05904f3c2d5a357978e3c9edf12e91e65e107", "size": "1468", "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/components/shield_generator/shared_shd_kse_mk4.iff" result.attribute_template_id = 8 result.stfName("space/space_item","shd_kse_mk4_n") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### r...
{ "content_hash": "31ec17b959f461f775b15406702024d7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 92, "avg_line_length": 25.53846153846154, "alnum_prop": 0.7048192771084337, "repo_name": "obi-two/Rebelion", "id": "a07b4ddd047ced4dc756689c664c1a31df11f06a", "size": "477"...
from django.apps import AppConfig class UserAccountConfig(AppConfig): name = 'user_account'
{ "content_hash": "64f33bba773c46e52665d7b60869817c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 35, "avg_line_length": 19.6, "alnum_prop": 0.7653061224489796, "repo_name": "MahdiZareie/VersionMonitoring", "id": "05d4def5abef1fd5e99afbc82e8c3b611beb8a8f", "size": "98", ...
import unittest from webkitpy.common.system import filesystem_mock from webkitpy.common.system import filesystem_unittest class MockFileSystemTest(unittest.TestCase, filesystem_unittest.GenericFileSystemTests): def setUp(self): self.fs = filesystem_mock.MockFileSystem() self.setup_generic_test_...
{ "content_hash": "00328ad089902f344d98b0e615df2d5c", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 124, "avg_line_length": 32.41379310344828, "alnum_prop": 0.39787234042553193, "repo_name": "heke123/chromium-crosswalk", "id": "561959ad5610989b637af3d5c0ee344c251afb2b", "...
""" Unit Tests for volume types extra specs code """ from cinder import context from cinder import db from cinder import exception from cinder import test class VolumeGlanceMetadataTestCase(test.TestCase): def setUp(self): super(VolumeGlanceMetadataTestCase, self).setUp() self.ctxt = context.get...
{ "content_hash": "de97ab2717edfc85e414855141d829fe", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 77, "avg_line_length": 44.758620689655174, "alnum_prop": 0.5650231124807396, "repo_name": "JioCloud/cinder", "id": "96297fc4484621357b5ffe52ceb7438cf5d5da8d", "size": "719...
import cmd import queue import time from somnMesh import * TxQ = queue.Queue() RxQ = queue.Queue() class somnIf(cmd.Cmd): def do_send(self, s): line = s.split() if len(line) != 2: print("*** invalid number of arguments ***") return packet = somnData(int(line[0], 16),line[1]) TxQ.put(pa...
{ "content_hash": "89f76ad541a7d2aa93ef16c82eb4c023", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 50, "avg_line_length": 18.571428571428573, "alnum_prop": 0.6, "repo_name": "squidpie/somn", "id": "7179ac142120f634bf0484508af750310627e8e1", "size": "672", "binary": fal...
from django.db import models from django.utils import timezone class Category(models.Model): name = models.CharField(max_length=50) number = models.CharField(max_length=50, unique=True) def __str__(self): return str(self.name) + ":" + str(self.number) def subs(self): sub_list = [] ...
{ "content_hash": "a1514f69e2bbaa4fa788eded1f0b19ea", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 88, "avg_line_length": 27.52054794520548, "alnum_prop": 0.6102538576406172, "repo_name": "m1k3r/gvi-accounts", "id": "47460819dbe5ada965bfb363ca852bd2965a63aa", "size": "20...
from distutils.core import setup import sys #sys.path.append('validatingconfigparser') import validatingconfigparser setup(name='validatingconfigparser', version='0.1', author='Markus Juenemann', author_email='markus.at.juenemann@gmail.com', url='http://code.google.com/p/validatingconfigparser...
{ "content_hash": "59cb253e361bbf20ca73454fe94f82f8", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 84, "avg_line_length": 43.357142857142854, "alnum_prop": 0.6375617792421746, "repo_name": "techdragon/validatingconfigparser", "id": "536dd1c370574c72ad88f1ad573f27e05cfc2974...
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 'Article.active' db.add_column('feedback_article', 'active', self.gf('django.db.models.fields.B...
{ "content_hash": "a8b37fc272112e626956f2fb6aae02fc", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 182, "avg_line_length": 70.23584905660377, "alnum_prop": 0.5442578912021491, "repo_name": "jaycrossler/geo-events", "id": "e72e2d6fa1ea6422f6409bafa066cf9f8492cf8f", "size...
from copy import deepcopy import httplib as http import time import mock import pytest import pytz import datetime from nose.tools import * # noqa from tests.base import OsfTestCase, fake from osf_tests.factories import ( UserFactory, NodeFactory, ProjectFactory, AuthUserFactory, RegistrationFactory ) from a...
{ "content_hash": "3dfc15dc6c16bd6c68904f1e1cf585b8", "timestamp": "", "source": "github", "line_count": 1421, "max_line_length": 139, "avg_line_length": 43.88106966924701, "alnum_prop": 0.623253949162056, "repo_name": "binoculars/osf.io", "id": "7df849841b2d6d717ee6792729f618c045323c4d", "size": "6...
"""Computes the arc distance between a collection of points This code is challenging because it requires efficient vectorisation of trigonometric functions that are note natively supported in SSE/AVX. The numpy version makes use of numpy.tile and transpose, which proves to be challenging too. See also http://en.wikip...
{ "content_hash": "61b03eaf28cba85e2c5654063209df03", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 28.22222222222222, "alnum_prop": 0.734251968503937, "repo_name": "numfocus/python-benchmarks", "id": "b4eb763839171db189f612659fd47b277eedbc2c", "siz...
from django.db import models class Article(models.Model): """ Article to test ckeditor """ title = models.CharField(max_length=60) content = models.TextField()
{ "content_hash": "3e056ae51b1ef98aa02eed9062d0e94b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 43, "avg_line_length": 20.22222222222222, "alnum_prop": 0.6648351648351648, "repo_name": "arkanister/django-flickr-gallery", "id": "9cb584b08fab8a477bca0e636af1b8ef7ac37300", ...
""" sync_wikipedia.py superlachaise_api Created by Maxime Le Moine on 09/06/2015. Copyright (c) 2015 Maxime Le Moine. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http:www.apache.org/li...
{ "content_hash": "71f5c9dd822744b4d5b564be228c3e25", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 171, "avg_line_length": 40.55211267605634, "alnum_prop": 0.5430675187552098, "repo_name": "MaximeLM/superlachaise_api", "id": "d464cf251b8f35de664fe95ff4181f4965ab945c", "...
from keras.models import Model from keras.layers import Input, Dense from keras.optimizers import SGD class FeedForwardNN(): def __init__(self, x_train, y_train, hidden_units=20, activation='sigmoid', loss_func='mean_squared_error', learning_rate=0.01, epochs=2000): self....
{ "content_hash": "af9b1ce93fff26028e65ce1000de98df", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 38.28125, "alnum_prop": 0.6024489795918367, "repo_name": "HPCC-Cloud-Computing/press", "id": "46e4160195e76ea1144001694a8ab4c127641d59", "size": "122...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
{ "content_hash": "e6a6756c04ceb257cd770df5835d1a0e", "timestamp": "", "source": "github", "line_count": 1256, "max_line_length": 248, "avg_line_length": 49.27388535031847, "alnum_prop": 0.6403987849017581, "repo_name": "Azure/azure-sdk-for-python", "id": "e1c98ec9a63f5fb3d8223235ccfec9fcdaf60390", ...
from django.test import TestCase from zords import constants from zords.models import Zord class ZordTestCase(TestCase): fixtures = ['zords.json'] def test_zord(self): zord = Zord.objects.get(pk=18) self.assertIsInstance(zord, Zord) self.assertEqual(zord.name, 'Unicorn Thunderzord') ...
{ "content_hash": "577a462f4d673f56495787d7be52d0ac", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 85, "avg_line_length": 33.44827586206897, "alnum_prop": 0.6731958762886598, "repo_name": "reiniervdwindt/power-rangers-api", "id": "9e10a3ccb3883ac6507259f33878123af9affc81",...
""" Name: u6.py Desc: Defines the U6 class, which makes working with a U6 much easier. All of the low-level functions for the U6 are implemented as functions of the U6 class. There are also a handful additional functions which improve upon the interface provided by the low-level functions. To learn a...
{ "content_hash": "020fe727489d6852b94bbd43485d5ed4", "timestamp": "", "source": "github", "line_count": 2299, "max_line_length": 305, "avg_line_length": 36.359721618094824, "alnum_prop": 0.5693077005897764, "repo_name": "Alwnikrotikz/smap-data", "id": "adad8b591300c58269456567b408703ad4e0abd7", "si...
import json import os from django.core.management.base import BaseCommand from reports import models CONFIG_DIR_PATH = os.path.expanduser('~/.jetere') CONFIG_FILE_PATH = os.path.join(CONFIG_DIR_PATH, 'config.json') def load_jenkins_configuration_from_file(): if os.path.exists(CONFIG_FILE_PATH): with op...
{ "content_hash": "2b9e7922e3836584317672af4539fb7c", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 76, "avg_line_length": 34.55072463768116, "alnum_prop": 0.5704697986577181, "repo_name": "idanmo/jetere", "id": "39999f625c3d5f53d1c593ca83fbbf086007e10d", "size": "2384", ...
import sys import pathlib import logging from logging import handlers class WurbLogging(object): """ Log module for the CloudedBats recording unit. Two target log files are used. Both are implemented as rotation logs. 1. Internal log stored on the Raspberry Pi micro SD card. 2. External log...
{ "content_hash": "c8a4135570c551f0d5692e0640a96539", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 114, "avg_line_length": 45.575, "alnum_prop": 0.5375754251234229, "repo_name": "cloudedbats/cloudedbats_wurb", "id": "7137820af67293743c5767fe75a85cdbbe155f52", "size": "38...
""" salt.serializers.plist ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 3001 Implements plist serializer. Wrapper around plistlib. """ import logging import plistlib from salt.serializers import DeserializationError, SerializationError log = logging.getLogger(__name__) __all__ = ["deserialize"...
{ "content_hash": "4622d972bafe724636e4d6672e84d930", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 30.34285714285714, "alnum_prop": 0.652542372881356, "repo_name": "saltstack/salt", "id": "a833b4e7897ecc755c804745225adfda06694da3", "size": "2124", ...
from rest_framework.authentication import ( TokenAuthentication, SessionAuthentication) from rest_framework.decorators import ( authentication_classes, permission_classes) from rest_framework.parsers import FormParser, MultiPartParser from rest_framework.viewsets import GenericViewSet from rest_framework.mixins...
{ "content_hash": "ab2a654077e9ce386c44034f9048b686", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 72, "avg_line_length": 36.96907216494845, "alnum_prop": 0.6829336307863916, "repo_name": "J1bz/ecoloscore", "id": "cd18ba034232e70e8affcf6a5ed50a27c2fec1f0", "size": "3611"...
""" ======================================= Read and plot an image from a FITS file ======================================= This example opens an image stored in a FITS file and displays it to the screen. This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open the file, and `matplotlib....
{ "content_hash": "0e84cd4fde2d6d238dfea5cac372138e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 86, "avg_line_length": 31.796610169491526, "alnum_prop": 0.5303837953091685, "repo_name": "pllim/astropy", "id": "eed6f6b7273f47b83ca373265533b37ee5502883", "size": "1876",...
import datetime from flask import Flask from flask import redirect from flask import render_template from flask import request from flask import url_for from flask.ext.login import LoginManager from flask.ext.login import login_required from flask.ext.login import login_user from flask.ext.login import logout_user fr...
{ "content_hash": "c48d9ffd1685900ae49c711995c649d8", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 146, "avg_line_length": 31.884057971014492, "alnum_prop": 0.7088636363636364, "repo_name": "nikitabrazhnik/flask2", "id": "20921b71678347dfaa07d3f3b9d45594df02860b", "size...
"""A set of functions that are used for visualization. These functions often receive an image, perform some visualization on the image. The functions do not return a value, instead they modify the image itself. """ import collections import functools # Set headless-friendly backend. import matplotlib; matplotlib.use(...
{ "content_hash": "d0ce0397e2f286c87e2c738b73ed4d9e", "timestamp": "", "source": "github", "line_count": 718, "max_line_length": 80, "avg_line_length": 40.26323119777159, "alnum_prop": 0.6297346847002664, "repo_name": "tombstone/models", "id": "7a7aeb50561dba9f8713d12a184ddd824c3c0e19", "size": "295...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0059_machine_report_format'), ] operations = [ migrations.AddField( model_name='machine', name='broken_client', field=models.BooleanField(defau...
{ "content_hash": "18172328afad58737edb31e02ee59b64", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 21.75, "alnum_prop": 0.5833333333333334, "repo_name": "salopensource/sal", "id": "f9dadbc26e3645c7e0e9023082f22867cdc5a079", "size": "397", "binary...
from pants.testutil.jvm.nailgun_task_test_base import NailgunTaskTestBase class JarTaskTestBase(NailgunTaskTestBase): """Prepares an ephemeral test build root that supports jar tasks. :API: public """
{ "content_hash": "39dfab78858f5945e12c3942f53b35ed", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 73, "avg_line_length": 27, "alnum_prop": 0.7592592592592593, "repo_name": "tdyas/pants", "id": "3f0928a517872d5da1399b9c15b4468cfba8b2cc", "size": "348", "binary": false, ...
"""Implementation of RootOf class and related tools. """ from sympy.core import S, Basic, Expr, Integer, Float, I, Add, Lambda, symbols, sympify from sympy.polys.polytools import Poly, PurePoly, factor from sympy.polys.rationaltools import together from sympy.polys.polyfuncs import symmetrize, viete from sympy.polys...
{ "content_hash": "1873e28f63f862738995af0dc08a3529", "timestamp": "", "source": "github", "line_count": 664, "max_line_length": 101, "avg_line_length": 28.89909638554217, "alnum_prop": 0.5471363802178332, "repo_name": "minrk/sympy", "id": "a583c79dd3536aa65dd46610c08dea6f6edcabb9", "size": "19189",...
"""Auto-generated file, do not edit by hand. CM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_CM = PhoneMetadata(id='CM', country_code=237, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[2368]\\d{7,8}', possible_length=(8, 9))...
{ "content_hash": "d681f17da53b622bc406136361d745e0", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 145, "avg_line_length": 96.3, "alnum_prop": 0.6614745586708204, "repo_name": "gencer/python-phonenumbers", "id": "c06d55edc2a71beb9a62445039ca0a232a366a97", "size": "963", ...
""" Computes matrix-matrix products via specialization. The C configuration inside ctree.cfg should include the -mavx flag in the cflags section. For example: [c] cc = gcc-4.9 cflags = -mavx -O3 -mmacosx-version-min=10.6 -std=c99 This program also requires the current ucb-sejits fork of opentuner: https://github.com/...
{ "content_hash": "6a619158c4d65c47bc4397b94fcb53aa", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 100, "avg_line_length": 33.07277628032345, "alnum_prop": 0.5247758761206194, "repo_name": "ucb-sejits/ctree", "id": "2c99d45d64ca7314a9506ae5d2b1d52ec17d74e1", "size": "12...
from threaded_messages.models import cached_inbox_count_for def inbox(request): if request.user.is_authenticated(): return {'messages_inbox_count': cached_inbox_count_for(request.user)} else: return {}
{ "content_hash": "85156013690a37e572588d36182c6ea9", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 77, "avg_line_length": 28.5, "alnum_prop": 0.6929824561403509, "repo_name": "GreatBizTools/django-threaded-messages", "id": "41b7d80bf812279597e3cc75022cf0f2c63f4ef2", "size...
import os import seafileapi import unittest from contextlib import contextmanager from tests.utils import randstring SERVER = os.environ.get('SEAFILE_TEST_SERVER_ADDRESS', 'http://127.0.0.1:8000') USER = os.environ.get('SEAFILE_TEST_USERNAME', 'test@seafiletest.com') PASSWORD = os.environ.get('SEAFILE_TEST_PASSWORD', ...
{ "content_hash": "0be9ffdbc1015d5cc1494e6fbe5c8840", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 93, "avg_line_length": 33.97435897435897, "alnum_prop": 0.6784905660377358, "repo_name": "cloudcopy/python-seafile", "id": "7e4f8ff96044bb8ef1f51709b50f01c8897ccd0f", "size...
import SimpleITK as sitk import sys import os def command_iteration(method): print(f"{method.GetOptimizerIteration():3} = {method.GetMetricValue():10.5f}") if len(sys.argv) < 4: print("Usage:", sys.argv[0], "<fixedImageFilter> <movingImageFile>", "<outputTransformFile>") sys.exit(1) fixed = s...
{ "content_hash": "b0b1a7d5f6903ed5595d08b567fcddf1", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 82, "avg_line_length": 32.233333333333334, "alnum_prop": 0.704756980351603, "repo_name": "richardbeare/SimpleITK", "id": "54c32787d13ab2866d94addc000147d567c02be3", "size":...
import collections from unittest import mock from oslo_serialization import jsonutils from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils import uuidutils from oslo_versionedobjects import base as ovo_base from nova import context from nova import exception from nova.network import model as network_m...
{ "content_hash": "0cc306d5d58206bbe733b51b1013ebba", "timestamp": "", "source": "github", "line_count": 1862, "max_line_length": 79, "avg_line_length": 42.07733619763695, "alnum_prop": 0.5691913003522745, "repo_name": "openstack/nova", "id": "d91015a699be6a9206b5cff440701be218ff966d", "size": "7895...
import re import uuid as py_uuid from common_fixtures import * # NOQA from test_volume import VOLUME_CLEANUP_LABEL TEST_IMAGE = 'ibuildthecloud/helloworld' TEST_IMAGE_LATEST = TEST_IMAGE + ':latest' TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'", ...
{ "content_hash": "91df0783ba3dac15f55698997e7c3425", "timestamp": "", "source": "github", "line_count": 971, "max_line_length": 79, "avg_line_length": 35.86508753861998, "alnum_prop": 0.5767695620961952, "repo_name": "jimengliu/cattle", "id": "a6ea10681738e4179af2d50f1c9d2af4ed210ab6", "size": "348...
import re from . import TestCase from server import Router, IndexHandler class TestRouter(TestCase): def setUp(self): """ Create an instance each time for testing. """ self.instance = Router({ '/': IndexHandler(), '': IndexHandler(), '/test/loc...
{ "content_hash": "8fd763b99b9177ea18738b8e21ec26ec", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 33.676923076923075, "alnum_prop": 0.5495660118775697, "repo_name": "RHInception/talook", "id": "1b8afe4993af42ac7ab910c928d3bc4e5df626d7", "size": "2...
import os from os.path import join import subprocess from os.path import join import numpy as np import pyopencl as cl with open('build/bin/cocl', 'r') as f: for line in f: if line.strip().startswith('export CLANG_HOME='): CLANG_HOME = line.strip().split('=')[1] # CLANG_HOME = f.read().spl...
{ "content_hash": "363a50ec235475263f50a9c1538bd448", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 104, "avg_line_length": 30.671779141104295, "alnum_prop": 0.5681568156815682, "repo_name": "hughperkins/cuda-on-cl", "id": "c1fab6c2539415212e1b012cb1e88069b5cea985", "siz...
import datetime VERSION=({{ version.major }}, {{ version.minor }}, {{ version.patch }}) COMPILATION_DATE = datetime.datetime.fromtimestamp({{ compile_timestamp }})
{ "content_hash": "f815ae63d8f33b7a956beb438cbf017f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 41, "alnum_prop": 0.7134146341463414, "repo_name": "NazarethCollege/wharf", "id": "1414a8c4465e637b5955e7cbdef3ccffb53b5a00", "size": "164", "binary...
"""Tests for the management commands `send_message_digest`.""" from django.core import mail from django.core.management import call_command from django.test import TestCase from django.utils.timezone import now, timedelta from mixer.backend.django import mixer class SendMessageDigestTestCase(TestCase): longMessa...
{ "content_hash": "a677362e2afccb71f521eb8f1623cf05", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 63, "avg_line_length": 38.67741935483871, "alnum_prop": 0.6663886572143453, "repo_name": "bitmazk/django-conversation", "id": "ef69feb2ec43cb7848010443c26973623f9948c0", "s...
import os import subprocess import tempfile import unittest import lightgbm as lgb import numpy as np from sklearn.datasets import load_breast_cancer, dump_svmlight_file from sklearn.model_selection import train_test_split class TestBasic(unittest.TestCase): def test(self): X_train, X_test, y_train, y_t...
{ "content_hash": "57ecf4cdfd42538f4de217338d79f208", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 117, "avg_line_length": 41.06666666666667, "alnum_prop": 0.6168831168831169, "repo_name": "olofer/LightGBM", "id": "45dce45f8371538fad78e05ba15a515b79eb368b", "size": "2500...
import pygame from pygame.sprite import Sprite from pygame.sprite import Group from block import Block class Explosion(Sprite): """A class representing an explosion.""" def __init__(self, settings, screen, x, y, ship_shot, invader_shot, ship, invader, mystery): super(Explosion, self).__init__() self.settings ...
{ "content_hash": "db94b58e1ebe2bc4db880b7a70c3a152", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 106, "avg_line_length": 35.46666666666667, "alnum_prop": 0.6973684210526315, "repo_name": "hlynurstef/Space_Invaders", "id": "c26622af9161668bd4e99777b04b75971220ad78", "si...
"""Tests for saving/loading function for keras Model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil from absl.testing import parameterized import numpy as np from tensorflow.contrib.saved_model.python.saved_model import keras_s...
{ "content_hash": "46a00124708f163f8ffb8db037c53272", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 80, "avg_line_length": 37.87228915662651, "alnum_prop": 0.6559139784946236, "repo_name": "girving/tensorflow", "id": "060c5045235ced50adf38222a0152a1700a252e8", "size": "1...
import factory from datetime import date, timedelta from django.contrib.auth.models import User from core.models import Contacto, Profesional, Persona class UserFactory(factory.django.DjangoModelFactory): first_name = factory.Faker('first_name', locale='es') last_name = factory.Faker('last_name', locale='es...
{ "content_hash": "cd1e85eb4936d0716335904263d7aa5a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 110, "avg_line_length": 32.97674418604651, "alnum_prop": 0.7038081805359662, "repo_name": "mava-ar/sgk", "id": "154854dc60581c91f8f08cf96f3d07c2912c12f2", "size": "1418", ...
import sys from setuptools import setup, find_packages needs_pytest = {"pytest", "test"}.intersection(sys.argv) pytest_runner = ["pytest_runner"] if needs_pytest else [] needs_wheel = {"bdist_wheel"}.intersection(sys.argv) wheel = ["wheel"] if needs_wheel else [] with open("README.rst", "r") as f: long_descripti...
{ "content_hash": "7873972c01288310159a304469b38c72", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 73, "avg_line_length": 38.236363636363635, "alnum_prop": 0.6286257727056586, "repo_name": "googlei18n/glyphsLib", "id": "08be0e502951581ee2497805085dbac888e07da2", "size": ...
import math import scipy.ndimage import numpy as np from PIL import Image def MakeGaussian(mean, variance): ''' Returns a callable which takes a 2-tuple (an x,y coordinate point), and returns the value of a gaussian function with the given parameters at the given point. Args: mean: 2-tuple; mu pa...
{ "content_hash": "8e7be158e7300a4f6bbeb2ab6a1725a5", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 80, "avg_line_length": 35.64356435643565, "alnum_prop": 0.6547222222222222, "repo_name": "cookyt/teastain", "id": "f1910e6b789d1ddeeb1a3c9f747be38135493e95", "size": "3600...
from __future__ import print_function import sys print(*xrange(1,int(raw_input().strip())+1),sep='')
{ "content_hash": "1da6de8b23ef7545099bded796d48c78", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 51, "avg_line_length": 20.6, "alnum_prop": 0.6796116504854369, "repo_name": "nabin-info/hackerrank.com", "id": "4089f74e6e0b476650e727e1a89ea4f1773d3029", "size": "122", "...
""" Module containing Axes3D, an object which can plot 3D objects on a 2D matplotlib figure. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import math from matplotlib.externals import six from matplotlib.externals.six.moves import map, xrange, zip, red...
{ "content_hash": "76c2800a3000be65d8b155e6cf14b1d7", "timestamp": "", "source": "github", "line_count": 2648, "max_line_length": 130, "avg_line_length": 35.09214501510574, "alnum_prop": 0.5213830657311351, "repo_name": "rbalda/neural_ocr", "id": "b1032f45091e97587956f11b78bad38c591edff5", "size": "...
''' This file defines the functions that check Models to their Meta-Meta-Model. ''' __author__ = 'William Emfinger' __copyright__ = 'Copyright 2016, ROSMOD' __credits__ = ['William Emfinger', 'Pranav Srinivas Kumar'] __license__ = 'GPL' __version__ = '0.4' __maintainer__ = 'William Emfinger' __email__ = 'emfinger@isis...
{ "content_hash": "977b872002a7712ece84eb911675a9e4", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 81, "avg_line_length": 32.817142857142855, "alnum_prop": 0.5559811944976493, "repo_name": "finger563/editor", "id": "67c325906f12efd8ca3b51a566d3e0084c8d29cf", "size": "57...
""" Gridded data is already aggregated by month therefore we don't have daily gridded data, but this is importing to the same basic table type as if it were daily. So: Don't make a daily table Record what monthly aggregations are available We only use monthly aggregations on the map and chart so Some statistics won...
{ "content_hash": "91f747d04c019aaaa5ccd84aaeddbe35", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 133, "avg_line_length": 31.03174603174603, "alnum_prop": 0.5767263427109974, "repo_name": "flavour/cert", "id": "d612241519de8d18e1878da8e7f8aaba1b0c63d3", "size": "7821",...
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils def fiftycatGBM(): # Training set has only 45 categories cat1 through cat45 #Log.info("Importing 50_cattest_train.csv data...\n") train = h2o.import_file(path=pyunit_utils.locate("smalldata/gbm_test/50_cattest_train.csv...
{ "content_hash": "677e4702f2732de61af86aff631a7baf", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 113, "avg_line_length": 30.5625, "alnum_prop": 0.6843899113837764, "repo_name": "madmax983/h2o-3", "id": "b4878d958abe42ee06b899bdc8ec0da7389f93d1", "size": "1467", "bina...
class Solution(object): def wordPattern(self, pattern, strs): """ :type pattern: str :type str: strs :rtype: bool """ if not pattern and not strs: return True strlist=strs.split(" ") if len(strlist)!=len(pattern): r...
{ "content_hash": "d96d3884dd50b8df2b2d37ccac4edf84", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 28.666666666666668, "alnum_prop": 0.4755813953488372, "repo_name": "Tanych/CodeTracking", "id": "d8cff43f74d5110e9f754da90d549719e16ebaca", "size": "...
""" Client side of the cert manager RPC API. """ from nova import flags import nova.rpc.proxy FLAGS = flags.FLAGS class CertAPI(nova.rpc.proxy.RpcProxy): '''Client side of the cert rpc API. API version history: 1.0 - Initial version. ''' RPC_API_VERSION = '1.0' def __init__(self): ...
{ "content_hash": "093186d1f5ebe684f6a6138d23629dd9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 34.96363636363636, "alnum_prop": 0.514820592823713, "repo_name": "usc-isi/extra-specs", "id": "d062026da4b7890dd763664399f11c28a68cdb9a", "size": "25...
from __future__ import print_function from rospkg.os_detect import OS_CYGWIN from .source import SOURCE_INSTALLER from ..installers import PackageManagerInstaller from ..shell_utils import read_stdout APT_CYG_INSTALLER = 'apt-cyg' def register_installers(context): context.set_installer(APT_CYG_INSTALLER, AptC...
{ "content_hash": "7c4faae98b515793bc29b086cfe9f471", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 119, "avg_line_length": 30.0188679245283, "alnum_prop": 0.6851037083595223, "repo_name": "ros-infrastructure/rosdep", "id": "2808f1dc36a937a8f1d0a1f4a3f0e49a76eb3b4b", "siz...
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozures...
{ "content_hash": "d03ec109fded8b9adc74da7efd54dff4", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 201, "avg_line_length": 33.627737226277375, "alnum_prop": 0.7271543303668331, "repo_name": "sanjaymandadi/mozu-python-sdk", "id": "9b75922f54de63df2fb4feb3d5fb13a53a023d7c",...
import subprocess import serial #------------------------------------------------------------------------------ # Bluetooth stack #------------------------------------------------------------------------------ #Run a System command and return its output lines as tuple def RunCommand(command): p = subprocess.Popen(co...
{ "content_hash": "03915fb332f1ec775170e09e4f7e994f", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 92, "avg_line_length": 29.5, "alnum_prop": 0.6081025217031831, "repo_name": "webmaster442/prog-elektonikak", "id": "32d3a203157dea377da4f4500144f3a8378fee15", "size": "2618...
from setuptools import setup, find_packages import twocode import os ROOT = os.path.abspath(os.path.dirname(__file__)) codebase_files = [ os.path.abspath(os.path.join(root, file))[len(ROOT):].lstrip(os.path.sep) for root, dirs, files in os.walk(os.path.join(ROOT, "code")) for file in files] codebase_file...
{ "content_hash": "8b153122047b87b31c762fba5b4c26e6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 179, "avg_line_length": 39.44444444444444, "alnum_prop": 0.6405633802816901, "repo_name": "MrCoft/twocode", "id": "abaab2f313f8af2e604bea03d79098f9dd5375d8", "size": "1802"...
""" ============================================================== Compute spatial resolution metrics to compare MEG with EEG+MEG ============================================================== Compute peak localisation error and spatial deviation for the point-spread functions of dSPM and MNE. Plot their distributions...
{ "content_hash": "22c213927ea4fe8acf18497a08d46965", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 79, "avg_line_length": 40.68789808917197, "alnum_prop": 0.5464934251721979, "repo_name": "mne-tools/mne-tools.github.io", "id": "3a7c90050af7622d2943d466f967205e7aeba936", ...
from typing import TYPE_CHECKING, List from django.utils.translation import pgettext_lazy from saleor.extensions import ConfigurationTypeField from saleor.extensions.base_plugin import BasePlugin from . import ( GatewayConfig, authorize, capture, get_client_token, list_client_sources, process...
{ "content_hash": "f8c3cc39a332ad042b555800bf69d58a", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 83, "avg_line_length": 36.257894736842104, "alnum_prop": 0.5819422267382784, "repo_name": "maferelo/saleor", "id": "3393b73aec32c390daf3619f16a5db494ef2ccc6", "size": "688...
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from forum_app.models import Profile, Category, Thread, Post, Conversation, Pm class CategoryForm(forms.ModelForm): image = forms.FileField(required=False) slug = forms.CharField(widget...
{ "content_hash": "6f800d1a20ef22b91326abd450f5c5cc", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 78, "avg_line_length": 34.34567901234568, "alnum_prop": 0.6232925952552121, "repo_name": "JD-666/wwsc", "id": "e010555232ff463339e343073d302e5d5f1efd00", "size": "2782", ...
from django.shortcuts import render from dynamicForms import views from formularios.models import Usuario, Club, Country from formularios.serializer import UsuarioSerializer, CountrySerializer, ClubSerializer from rest_framework import generics from rest_framework import permissions from rest_framework import status ...
{ "content_hash": "65dbfa85031213d6a56ca28b41ae0a0c", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 87, "avg_line_length": 31.96923076923077, "alnum_prop": 0.7396535129932628, "repo_name": "trea-uy/django-survey-sample", "id": "70e059bb8fa2bab00db92c6997f05c08cd583e3a", "...
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 model 'User' db.create_table(u'custom_auth_user', ( (u'id', self.gf('django.db.models.fields.AutoField')(primar...
{ "content_hash": "dd341404f91ce66c77cc9c8a94233514", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 187, "avg_line_length": 62.56842105263158, "alnum_prop": 0.5883243606998654, "repo_name": "stfc/cvmfs-stratum-uploader", "id": "3900659d1dc9d7844b2f1315468da62ee9d7cec5", "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/faction_perk/faction_base_item/shared_alarm_hack_no_sound.iff" result.attribute_template_id = -1 result.stfName("faction_perk","alarm_hack_n") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### ...
{ "content_hash": "3085dcec566e8bf3e5b17e3ad4ba872e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 98, "avg_line_length": 25.692307692307693, "alnum_prop": 0.7035928143712575, "repo_name": "obi-two/Rebelion", "id": "11378d990c4d9b8cbd6624245eae4848c85ceaa1", "size": "479...
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy._lib.six import string_types __all__ = ['periodogr...
{ "content_hash": "85825dc75efd43888e081f7be040cf98", "timestamp": "", "source": "github", "line_count": 954, "max_line_length": 87, "avg_line_length": 36.66771488469602, "alnum_prop": 0.6136759955404363, "repo_name": "kalvdans/scipy", "id": "6a901932283349c90c3b666bd600da946e806234", "size": "34981...
import threading class StringFolderDevice(object): """Device plugin that allows getting and setting a file-backed string""" def __init__(self, default_value=''): self.lock = threading.Lock() self.value1 = default_value self.value2 = default_value self.value3 = default_value ...
{ "content_hash": "7163645518c0e1abac88b20a026b1f5b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 76, "avg_line_length": 27.789473684210527, "alnum_prop": 0.476010101010101, "repo_name": "intel-ctrlsys/actsys", "id": "f169f697d8b5d35478966f96f626f36defffce46", "size": "...
""" @brief test log(time=1s) """ import unittest from code_beatrix.faq.faq_python import instruction_pass class TestPass(unittest.TestCase): def test_pass(self): instruction_pass() if __name__ == "__main__": unittest.main()
{ "content_hash": "4da9d156e818f9da51638406dc76f600", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 56, "avg_line_length": 16.666666666666668, "alnum_prop": 0.644, "repo_name": "sdpython/code_beatrix", "id": "82eb3ebaebd2ad3cf2b91fa5866af1cadd645b23", "size": "250", "bi...
typo_dict = { 'steele stake': 'steel stake', 'gas mowe': 'gas mower', 'metal plate cover gcfi': 'metal plate cover gfci', 'lawn sprkinler': 'lawn sprinkler', 'ourdoor patio tile': 'outdoor patio tile', '6 teir shelving': '6 tier shelving', 'storage shelve': 'storage shelf', 'American Sta...
{ "content_hash": "14c0cebd6064d3ff6359359d13cfe475", "timestamp": "", "source": "github", "line_count": 3366, "max_line_length": 133, "avg_line_length": 54.69815805109923, "alnum_prop": 0.6907187937908035, "repo_name": "dnc1994/Kaggle-Playground", "id": "dac7dbc945ac1ce6c195944b3ae731363a7e36da", "...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V2alpha1C...
{ "content_hash": "43eecf3abf35c81bbc783fc052669118", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 112, "avg_line_length": 29.333333333333332, "alnum_prop": 0.5657467532467533, "repo_name": "skuda/client-python", "id": "9bf180ead63f3a99d312d331280ccf9ce34cdd97", "size":...
from __future__ import unicode_literals from django.db import migrations import share.robot class Migration(migrations.Migration): dependencies = [ ('share', '0001_initial'), ('djcelery', '0001_initial'), ] operations = [ migrations.RunPython( code=share.robot.RobotU...
{ "content_hash": "cce41dbc126686059a36081f3124b643", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 25.166666666666668, "alnum_prop": 0.6225165562913907, "repo_name": "zamattiac/SHARE", "id": "656796955d1e041e2de128dc38117037706e5861", "size": "676"...
import base64 import datetime import uuid from oslo.config import cfg from oslo.serialization import jsonutils from nova.api.openstack.compute import plugins from nova.api.openstack.compute.plugins.v3 import servers from nova.api.openstack.compute.plugins.v3 import user_data from nova.compute import api as compute_ap...
{ "content_hash": "eb4e84d5e4a97e907c741b267afcc5b6", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 77, "avg_line_length": 37.88826815642458, "alnum_prop": 0.6001179593040401, "repo_name": "badock/nova", "id": "9ee2c5022a2671a74dfaf3246372ebb965a41f97", "size": "7445", ...
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division import argparse from tabulate import tabulate from pyafm.roll_up import transaction_to_student_step from pyafm.models import afm from pyafm.models import afms def read...
{ "content_hash": "5d4b5ee6c9bf40830010145110cf0b11", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 99, "avg_line_length": 37.01428571428571, "alnum_prop": 0.5189116171362408, "repo_name": "cmaclell/pyAFM", "id": "441c087f365b6372f63425f864124db58507bd6c", "size": "5182"...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.manager import Session from flexget.utils.imdb import make_url as make_imdb_url try: from flexget.plugins.filter.movie_queue im...
{ "content_hash": "dc0b9b3f319915ad40f92806db0e8c58", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 119, "avg_line_length": 39.09574468085106, "alnum_prop": 0.5376870748299319, "repo_name": "cvium/Flexget", "id": "65cc3438f2cb7d03b5d7ce1f7de809896444261c", "size": "3675",...
from unittest import TestCase from mock import Mock from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim from cloudshell.cp.vcenter.commands.connect_dvswitch import VirtualSwitchConnectCommand from cloudshell.cp.vcenter.common.vcenter.task_waiter import SynchronousTaskWaiter from cloudshell.cp.v...
{ "content_hash": "9c8f13d18e82ef69d7682a8d72d60e3c", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 114, "avg_line_length": 53.95918367346939, "alnum_prop": 0.6467473524962178, "repo_name": "QualiSystems/vCenterShell", "id": "0db028a8fed59ae9bff8e82e94ef95af12dcb2a7", "si...
c = get_config() #------------------------------------------------------------------------------ # NbConvertApp configuration #------------------------------------------------------------------------------ # This application is used to convert notebook files (*.ipynb) to various other # formats. # # WARNING: THE COM...
{ "content_hash": "51de30a30dca1249db03f54288cce303", "timestamp": "", "source": "github", "line_count": 969, "max_line_length": 562, "avg_line_length": 39.99484004127967, "alnum_prop": 0.6820539285253515, "repo_name": "scollis/high_resolution_hydrology", "id": "cea881056555adf208b57995b271029b300ea35...
import argparse import threading import socket import queue import enum DEFAULT_LOCAL_IP_ADDRESS = '0.0.0.0' DEFAULT_LOCAL_PORT_NUMBER = 8888 DEFAULT_REMOTE_IP_ADDRESS = 'localhost' DEFAULT_REMOTE_PORT_NUMBER = 9999 DEFAULT_BUFFER_SIZE = 1024 class LocalStatus(enum.Enum): SERVER_INITIALIZED = 'Local socket ini...
{ "content_hash": "d10ea4b8a854459901c53b5e13951b4d", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 90, "avg_line_length": 38.07051282051282, "alnum_prop": 0.6033002188920694, "repo_name": "MSU-NASA-RMC/client", "id": "1463022f5ee8e656d8bc595a46d7b4ad25cc25df", "size": "...
import hashlib import json from keystone.common import controller from keystone import exception class CredentialV3(controller.V3Controller): collection_name = 'credentials' member_name = 'credential' def __init__(self): super(CredentialV3, self).__init__() self.get_member_from_driver = ...
{ "content_hash": "d5cdaaa8d9ef97093c4521d549bfc32a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 39.11290322580645, "alnum_prop": 0.6251546391752577, "repo_name": "cloudbau/keystone", "id": "bddd64e7ab17db5db28e1cec0c1342e9fcdacc97", "size": "305...
class Bot(object): pass
{ "content_hash": "983ff36eb9e2f4c8d52c78d3c3aebd35", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 18, "avg_line_length": 14, "alnum_prop": 0.6428571428571429, "repo_name": "instagrambot/instapro", "id": "087b317fadc6ecec6c1480db5b84e7ee2acd1119", "size": "28", "binary"...
from cocos.actions import * import cocos import pyglet class TextLayer(cocos.layer.Layer): """ Layer that setups text labels and apply some actions on these labels """ def __init__(self): super(TextLayer, self).__init__() window_width, window_height = cocos.director.director.get_...
{ "content_hash": "2dd4b6c5b1875c8b21593dcfa9d49777", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 79, "avg_line_length": 36.93827160493827, "alnum_prop": 0.5220588235294118, "repo_name": "adoankim/python-vigo-gamedev", "id": "ecfc41a0c6e71c091f6622bec08237a3c0fc2b03", "...
from django.shortcuts import render from rest_framework import viewsets from .models import Job from .serializers import JobSerializer class JobViewSet(viewsets.ModelViewSet): """ API endpoint that allows jobs to be viewed or edited. """ queryset = Job.objects.all() serializer_class = JobSerializ...
{ "content_hash": "2b7bd617bb58f273388d3d947910a5df", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 24.846153846153847, "alnum_prop": 0.7492260061919505, "repo_name": "hamster-dev/hamster-core", "id": "ba48492a7d4a6f37478a9d45998c930590820690", "siz...
from django.conf.urls import patterns, url from .views import EventList, EventDetail from .feeds import EventFeed urlpatterns = patterns('', url(r'^$', view=EventList.as_view(), name="event_list"), url(r'^ical/$', view=EventFeed(), name="event_list_ical"), url(r'^(?P<slug>[\w\d-]+)-(?P<pk>\d+)/$', view=E...
{ "content_hash": "4561a0ca6298f7bf7fc5366cd96f4a64", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 95, "avg_line_length": 33.27272727272727, "alnum_prop": 0.6502732240437158, "repo_name": "rva-data/connector-events", "id": "52d9670721572c29bde1b43f0f7c00ae63b3f010", "siz...
DOCUMENTATION = ''' --- module: xattr version_added: "1.3" short_description: set/retrieve extended attributes description: - Manages filesystem user defined extended attributes, requires that they are enabled on the target filesystem and that the setfattr/getfattr utilities are present. options: name: ...
{ "content_hash": "d1aa197ae4d92657e5cfadcf33b40d47", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 125, "avg_line_length": 29.026315789473685, "alnum_prop": 0.6054397098821396, "repo_name": "marcusramberg/dotfiles", "id": "94115ae3b51fb6f200bb81c5f42a8e279f4ef765", "siz...
import sys from PyQt4 import QtGui, QtCore, Qt import math class QtGauge(QtGui.QWidget): value = 1 def __init__(self): super(QtGauge, self).__init__() self.initUI() def setValue(self,value): self.value = value def getValue(self): return self.value def init...
{ "content_hash": "f506473112273c568ac82eccacd36ffb", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 92, "avg_line_length": 27.46511627906977, "alnum_prop": 0.5829805249788315, "repo_name": "3WiseMen/python", "id": "eb26f8c06bdfb0e1c6be6890318f8bf112866e3b", "size": "2362"...
import os import shutil import hashlib import json import stat import six from git.repo import Repo from lockfile import LockFile from st2actions.runners.pythonrunner import Action from st2common.util.green import shell ALL_PACKS = '*' PACK_REPO_ROOT = 'packs' MANIFEST_FILE = 'pack.yaml' CONFIG_FILE = 'config.yaml' ...
{ "content_hash": "0d21cd30761c0d19334fcc9c4e801f94", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 99, "avg_line_length": 38.32214765100671, "alnum_prop": 0.5854640980735552, "repo_name": "alfasin/st2", "id": "a8a6f33312cf391f132927432ae2633ca2655798", "size": "12200", ...
import logging LOG = logging.getLogger(__name__) try: from spark.job_server_api import get_api as get_spark_api except ImportError, e: LOG.exception('Spark is not enabled') from notebook.connectors.base import Api class SparkBatchApi(Api): def execute(self, notebook, snippet): api = get_spark_api(self...
{ "content_hash": "e45c7301a28de98c31353488628e2864", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 95, "avg_line_length": 27.951219512195124, "alnum_prop": 0.5815881326352531, "repo_name": "xq262144/hue", "id": "01ed31cee89667623efb9f0cc58047d519dbd5b3", "size": "3084", ...
from AlgorithmImports import * ### <summary> ### This algorithm shows how to set a custom security initializer. ### A security initializer is run immediately after a new security object ### has been created and can be used to security models and other settings, ### such as data normalization mode ### </summary> ### <m...
{ "content_hash": "e7ca1647675f202e22f779345d74d54e", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 132, "avg_line_length": 43.628571428571426, "alnum_prop": 0.7066142763588736, "repo_name": "jameschch/Lean", "id": "366972507cc0540db954100071cf04e59c15ed35", "size": "3742...
class shapes_index(): SPHERE = 0 ELLIPSOID = 1 BOX = 2 CYLINDER = 3 CONVEXHULL = 4 TRIANGLEMESH = 5 BARREL = 6 CAPSULE = 7 CONE = 8 ROUNDEDBOX = 9 ROUNDEDCYL = 10 ROUNDEDCONE = 11 BEZIER = 12 def import_shapes(filepath): shapes_data = [] with open(file...
{ "content_hash": "fd3ed02d1a4c07e68ee5e1532acfbd09", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 163, "avg_line_length": 38.174418604651166, "alnum_prop": 0.4907097167225099, "repo_name": "rserban/chrono", "id": "e3ce65790506fb57725a725af9e1be0d5270e80b", "size": "3283...
""" Nearly identical to xrange.py, by Dan Crosta, from https://github.com/dcrosta/xrange.git This is included here in the ``future`` package rather than pointed to as a dependency because there is no package for ``xrange`` on PyPI. It is also tweaked to appear like a regular Python 3 ``range`` object rather than...
{ "content_hash": "6c064b536d16483ae452d3e03fb8e697", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 74, "avg_line_length": 32.77840909090909, "alnum_prop": 0.5768764083896689, "repo_name": "krischer/python-future", "id": "2438d20536355f1b0199fcd99aaa5c9f1677e6be", "size"...
import binascii from sqlalchemy import event from sqlalchemy import Table from sqlalchemy.sql import expression from sqlalchemy.sql import type_coerce from sqlalchemy.types import UserDefinedType # Python datatypes class GisElement(object): """Represents a geometry value.""" def __str__(self): ret...
{ "content_hash": "5262f458f8a758f95511f1c31f589738", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 76, "avg_line_length": 28.00864553314121, "alnum_prop": 0.5563329560654389, "repo_name": "cloudera/hue", "id": "868d3d055da030ae30173c7a6253b5a29219c850", "size": "9719", ...
from collections import OrderedDict import cms from .subcommands.base import SubcommandsCommand from .subcommands.check import CheckInstallation from .subcommands.copy import CopyCommand from .subcommands.delete_orphaned_plugins import DeleteOrphanedPluginsCommand from .subcommands.list import ListCommand from .subco...
{ "content_hash": "6ce9fe298cb9e7de0f84f6979bc65b06", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 86, "avg_line_length": 33.97142857142857, "alnum_prop": 0.7266610597140454, "repo_name": "rsalmaso/django-cms", "id": "864f657d8e13d85190ee29f18815e27707ec0fcc", "size": "1...
"""Test Home Assistant Cast.""" from unittest.mock import patch from homeassistant.components.cast import home_assistant_cast from homeassistant.config import async_process_ha_core_config from tests.common import MockConfigEntry, async_mock_signal async def test_service_show_view(hass, mock_zeroconf): """Test ...
{ "content_hash": "d55f5be2597fc71df95f855782ad439a", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 83, "avg_line_length": 32.86725663716814, "alnum_prop": 0.6470113085621971, "repo_name": "jawilson/home-assistant", "id": "67b5454b6e1391a4ff38f9251b3691ba2d6ac5db", "size...
""" This module is pending deprecation as of Django 1.6 and will be removed in version 1.8. """ from importlib import import_module import json import re import unittest as real_unittest import warnings from django.apps import apps from django.test import _doctest as doctest from django.test import runner from django...
{ "content_hash": "0dc247ad7395f5f24f6075b892711c2e", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 79, "avg_line_length": 34.63492063492063, "alnum_prop": 0.6043767186067828, "repo_name": "wfxiang08/django178", "id": "a60735de0ad9d9341a284e6f20d1faadb6b1cf7c", "size": "...