text stringlengths 4 1.02M | meta dict |
|---|---|
import _plotly_utils.basevalidators
class SeparatethousandsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="separatethousands",
parent_name="scatter.marker.colorbar",
**kwargs,
):
super(SeparatethousandsValidator, self).__init__... | {
"content_hash": "c5ce9043b351630b31debee1b60e1fe6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 30.5,
"alnum_prop": 0.6086065573770492,
"repo_name": "plotly/plotly.py",
"id": "0db06d828e6d858a8560090d527e25cdb3ba0a7e",
"size": "488",
"binary":... |
"""
Copyright (c) 2013 Clarinova. This file is licensed under the terms of the
Revised BSD License, included in this distribution as LICENSE.txt
"""
from ..dbexceptions import DependencyError
from relational import RelationalWarehouse #@UnresolvedImport
from ..library.database import LibraryDb
class PostgresWarehous... | {
"content_hash": "8541b70dc9b1679ef2f9336212903977",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 118,
"avg_line_length": 31.027397260273972,
"alnum_prop": 0.5918322295805739,
"repo_name": "kball/ambry",
"id": "2069457079653a125d1cbd679d67c229e4b2060f",
"size": "4530",... |
from django.db import models
class Book(models.Model):
"""
My first book model
"""
title = models.CharField(
max_length=255,
verbose_name=u'Book Title')
abstract = models.TextField(
verbose_name=u'Abstract')
price_net = models.DecimalField(
max_digits=8,
... | {
"content_hash": "900113c7318a2567adb5ef90be3d59a4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 38,
"avg_line_length": 21.88,
"alnum_prop": 0.5776965265082267,
"repo_name": "stephanpoetschner/django-vienna",
"id": "11c81885746e153b893319d1dfc56ad7f2a75796",
"size": "5... |
from collections import OrderedDict
import ctypes
import random
import pickle
import warnings
import numba
import numpy as np
from numba import (float32, float64, int16, int32, boolean, deferred_type,
optional)
from numba import njit, typeof
from numba.core import types, errors
from numba.core.disp... | {
"content_hash": "9fac8bcac13b7d3fb925c12b2609fca9",
"timestamp": "",
"source": "github",
"line_count": 1046,
"max_line_length": 80,
"avg_line_length": 28.161567877629064,
"alnum_prop": 0.5191635264962488,
"repo_name": "sklam/numba",
"id": "87f11657f1b5635b2943eba81fb1ddddcb96d8c2",
"size": "29457"... |
"""Stateless random ops which take seed as a tensor input.
Instead of taking `seed` as an attr which initializes a mutable state within
the op, these random ops take `seed` as an input, and the random numbers are
a deterministic function of `shape` and `seed`.
WARNING: These ops are in contrib, and are not stable. T... | {
"content_hash": "3df8a813276c6a62c048e78a83293fbb",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 76,
"avg_line_length": 32.57692307692308,
"alnum_prop": 0.7804014167650531,
"repo_name": "snnn/tensorflow",
"id": "30d0a7ab6ae1ebca44df9cba788674fcad69d538",
"size": "1536"... |
import unittest
from vodem.api import unlock_nck_time
class TestUnlockNckTime(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.valid_response = {
'unlock_nck_time': '',
}
def test_call(self):
resp = unlock_nck_time()
self.assertEqual(self.valid_respo... | {
"content_hash": "a75e7451f2305d99da44f0ed7681a29a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 20.6875,
"alnum_prop": 0.6253776435045317,
"repo_name": "alzeih/python-vodem-vodafone-K4607-Z",
"id": "2bca0f84b370fc6ee5995ec3a8d46540f9fd0324",
"si... |
from django.conf.urls import include, url
from . import api
from django.views.generic import RedirectView, TemplateView
urlpatterns = [
url(r'^$', view=RedirectView.as_view(url='/model_example/')),
url(r'^model_example/', view=TemplateView.as_view(template_name='yaat_examples/model_example.html'), name='model... | {
"content_hash": "76a01bc4218a4f69f0992023e1809f8e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 154,
"avg_line_length": 55,
"alnum_prop": 0.7287878787878788,
"repo_name": "pombredanne/django-yaat",
"id": "7c6286f4a41418c257757b476cec9c29c2763090",
"size": "677",
"bi... |
from unittest import TestCase
from ..modulos import cargar_datos, cargar_credenciales
import logging
log = logging.getLogger('justine')
class Creacion(TestCase):
"""
NOTA: Sobre la validación de datos, testar directamente nuestra pequeña clase
"""
@classmethod
def setUp(self):
# Cargamo... | {
"content_hash": "9b1d20ea056cd7a39941c73d398feac1",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 98,
"avg_line_length": 33.44642857142857,
"alnum_prop": 0.6422851041110518,
"repo_name": "VTacius/justine",
"id": "15c1d94df43c455feac9bcae96c0b96eec3980ae",
"size": "1895"... |
from django.core.management.base import BaseCommand
from taiga.base.utils.iterators import iter_queryset
from taiga.projects.notifications.models import HistoryChangeNotification
from taiga.projects.notifications.services import send_sync_notifications
class Command(BaseCommand):
def handle(self, *args, **option... | {
"content_hash": "e34c39f26f9fc9dd86fbce05fe852bbc",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 73,
"avg_line_length": 42.083333333333336,
"alnum_prop": 0.7821782178217822,
"repo_name": "curiosityio/taiga-docker",
"id": "bb259cdeda4fc02762f43f9c4baa161e0d5a544d",
"siz... |
'''
compare
-------
Contains code necessary to evaluate the objective function,
.. math:: \chi^2 = w^2 (x_r - x_c)^2
where :math:`w` is a weight, :math:`x_r` is the reference data point's value,
and :math:`x_c` is the calculated or force field's value for the data point.
'''
from __future__ import print_function
fro... | {
"content_hash": "f0a17b94104b7d7a0ab31d0bba99438d",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 95,
"avg_line_length": 41.92248062015504,
"alnum_prop": 0.5467825443786982,
"repo_name": "ericchansen/q2mm",
"id": "20e71dbc8046d2bfc78c15a73721dce0c98bd38e",
"size": "162... |
"""Dictionary to keep track of pit information."""
import os
from clusterfuzz._internal.metrics import logs
from clusterfuzz._internal.system import environment
def get_path(grammar):
"""Return the path of the peach pit for the given grammar. Return None if the
Pit does not exist or the grammar is None."""
p... | {
"content_hash": "94a1e73578626176f0aed6803afec27d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 29.818181818181817,
"alnum_prop": 0.6798780487804879,
"repo_name": "google/clusterfuzz",
"id": "dc4699c6a1175a36ebc0f74401a182875f5a6b21",
"size": "1... |
from flask_security import Security, SQLAlchemyUserDatastore
from src.user import models
user_data_store = SQLAlchemyUserDatastore(models.db, models.User, models.Role)
security = Security(datastore=user_data_store)
| {
"content_hash": "0d13b5fca525f65b4b43a7d3e19ff2b9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 78,
"avg_line_length": 36.166666666666664,
"alnum_prop": 0.8248847926267281,
"repo_name": "saurabh1e/FlaskStructure",
"id": "c60e84de205d133a5f0ca11fe4794daa04d841ee",
"size... |
"""
Copyright 2016, Michael DeHaan <michael.dehaan@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | {
"content_hash": "6d4d188d5286bd19d9e309084d5cc2fa",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 33.075268817204304,
"alnum_prop": 0.5770481144343304,
"repo_name": "mpdehaan/camp",
"id": "8d8bda3276adb42a57fb9d24a2998b236be61a0b",
"size": "3076",... |
from setuptools import setup, find_packages
from setuptools.extension import Extension
import os.path as path
from distutils.version import LooseVersion as Version
import numpy as np
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'pypolycomp', 'version.py'), encoding='utf-8') as f:
exec(f.r... | {
"content_hash": "246dc02957ca0fc271abeefcf425f02a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 87,
"avg_line_length": 31.671641791044777,
"alnum_prop": 0.6314797360980208,
"repo_name": "ziotom78/polycomp",
"id": "79701ada39c1d12a08e8a174970799f6abf5a9e9",
"size": "21... |
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8'
# The master toctree document.
master... | {
"content_hash": "6d974db19d1a2678917b242fc0bf358a",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 79,
"avg_line_length": 31.24848484848485,
"alnum_prop": 0.7119860356865787,
"repo_name": "a25kk/tam",
"id": "af5c556c885287db0accfb2032c1bcd0eb44daa9",
"size": "5991",
"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module: dellos9_config
version_added: "2.2"
author: "Dhivya P (@dhi... | {
"content_hash": "31735805ca44746b2a6ba9bf56c98ada",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 98,
"avg_line_length": 39.411764705882355,
"alnum_prop": 0.6469402985074627,
"repo_name": "SergeyCherepanov/ansible",
"id": "01a944a9b4d76a3222ad96393f67f7ea1370388b",
"si... |
import sys
sys.dont_write_bytecode = True
sys.path.append( 'devices' )
sys.path.append( 'libs' )
import getopt
# connection
from libArdySer import ArdySer
################################################################################
# signal stuff
import signal
def signal_handler( signal, frame ):
print( "BRE... | {
"content_hash": "d7257d221a3b19cc62b7d0d20f76a987",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 80,
"avg_line_length": 18.744897959183675,
"alnum_prop": 0.5617855198693522,
"repo_name": "BleuLlama/LlamaPyArdy",
"id": "60aea805ac46d82c04f9705ea52321c8b45c98e3",
"size":... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from absl.testing import parameterized
import numpy as np
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.eager import backprop
from tensorflow.python.eager import cont... | {
"content_hash": "a713ee7ca7b696e0f3ef8879bd815b12",
"timestamp": "",
"source": "github",
"line_count": 1760,
"max_line_length": 80,
"avg_line_length": 32.47386363636364,
"alnum_prop": 0.6366308569828883,
"repo_name": "ppwwyyxx/tensorflow",
"id": "23cfbd44972db8ec4322220bb48f84c6c5e14f46",
"size": ... |
"""Account settings blueprint for oauthclient."""
from __future__ import absolute_import
from operator import itemgetter
import six
from flask import Blueprint, current_app, render_template, request
from flask_babelex import gettext as _
from flask_breadcrumbs import register_breadcrumb
from flask_login import curre... | {
"content_hash": "2eda5afe8ae36fca3e3c3742c0c7bba0",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 75,
"avg_line_length": 29.093333333333334,
"alnum_prop": 0.6416131989000916,
"repo_name": "tiborsimko/invenio-oauthclient",
"id": "91268a4e7201acf1f1fa34a391a9d57e0cf741cb",
... |
import os
import sys
import xmlrpclib
from shutil import rmtree
from subprocess import check_call
TEMP_DIR = 'tmp'
PROJECT_NAME = 'cctrl'
DIST_DIR = os.path.join(TEMP_DIR, 'dist')
def main():
if is_current_version():
sys.exit("Version is not updated. Aborting release.")
dist()
cleanup()
def i... | {
"content_hash": "81a0f3f917edffadfbd8f89a5fbc1910",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 63,
"avg_line_length": 20.431818181818183,
"alnum_prop": 0.5539488320355951,
"repo_name": "cloudControl/cctrl",
"id": "54e378193baa421a6894ada59125644968c2a09f",
"size": "8... |
"""Verify the setchplenv.* script correctly set the environment for using chpl,
et al.
Also verify there are the correct setchplenv.* scripts and error if new ones
show up without updating this test.
"""
from __future__ import print_function
import distutils.spawn
import glob
import os
import os.path
import shlex
im... | {
"content_hash": "29e5bfbc218cf91b66c960481723191c",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 92,
"avg_line_length": 38.90594059405941,
"alnum_prop": 0.6088560885608856,
"repo_name": "chizarlicious/chapel",
"id": "8a269c91f24c5ea3921149332c0092489843c60e",
"size": ... |
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import Prefetch, QuerySet
from django.db.models.query import get_prefetcher, prefetch_related_objects
from django.db.models.s... | {
"content_hash": "d8eec59d60dcc5df31352a708f2e9f50",
"timestamp": "",
"source": "github",
"line_count": 1570,
"max_line_length": 119,
"avg_line_length": 43.55796178343949,
"alnum_prop": 0.5958090837305882,
"repo_name": "georgemarshall/django",
"id": "5b944a456bad1d8cb566c9c425462ffdba6b6ba9",
"size... |
from vis import cvmgr
import simplejson as json
imgpath = "/home/deepak/work/ml-api/data/__vision/demo/people.jpg"
print(cvmgr.detectfaces(imgpath))
imgpath = "/home/deepak/work/ml-api/data/__vision/demo/ocr.jpg"
print(cvmgr.extracttext(imgpath, "blur")) | {
"content_hash": "34870a566ddfa914ab6d3f3ad117051c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 66,
"avg_line_length": 32,
"alnum_prop": 0.76171875,
"repo_name": "deepakkumar1984/sia-cog",
"id": "fcf628e7dc5877f2ab800bcb5cea38c95da313b2",
"size": "256",
"binary": fal... |
"""Analyzes a text file and computes metrics"""
import os
import unittest
def analyze_text(filename):
lines = 0
chars = 0
with open(filename, mode='rt', encoding='utf-8') as file:
for line in file:
lines += 1
chars += len(line)
return lines, chars
class TextAnaly... | {
"content_hash": "01249a91b76ee9c3560ad27d885bc308",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 70,
"avg_line_length": 30.833333333333332,
"alnum_prop": 0.5962162162162162,
"repo_name": "kentoj/python-fundamentals",
"id": "1ba1a790fad5e9515c3ad5ce4aabd2e20fad37d9",
"s... |
"""Tests for tensorflow.ops.math_ops.matrix_inverse."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gra... | {
"content_hash": "6b521bc0e03e76087316c40a7b23fd4d",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 87,
"avg_line_length": 39.59782608695652,
"alnum_prop": 0.5811144660993687,
"repo_name": "brchiu/tensorflow",
"id": "32c97a7b1914b02169246fed90b486e610743c34",
"size": "11... |
import getpass
import logging
import os
import sys
import paramiko
from msshcopyid.constants import DEFAULT_SSH_CONFIG, DEFAULT_SSH_PORT
import msshcopyid
logger = logging.getLogger(__name__)
def get_password(from_stdin_only=False):
"""
Get a password either from STDIN or by prompting the user.
:retur... | {
"content_hash": "dc89a0dc94a6b784539c9da41774bbad",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 86,
"avg_line_length": 28.38095238095238,
"alnum_prop": 0.6182885906040269,
"repo_name": "samuel-phan/mssh-copy-id",
"id": "31444a83deade5bc1ba550bde08cecf24140061e",
"size... |
import os
from utils import DotDict, namedtuple_with_defaults, zip_namedtuple, config_as_dict
RandCropper = namedtuple_with_defaults('RandCropper',
'min_crop_scales, max_crop_scales, \
min_crop_aspect_ratios, max_crop_aspect_ratios, \
min_crop_overlaps, max_crop_overlaps, \
min_crop_sample_coverages, m... | {
"content_hash": "7deea9076b120ed3394f164b8d80b432",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 85,
"avg_line_length": 34.10294117647059,
"alnum_prop": 0.6994394135403191,
"repo_name": "lxn2/mxnet",
"id": "278b770febe97b6cb489e4b8ec23baebd5d0784a",
"size": "2319",
"... |
'''@file dnn.py
The DNN neural network classifier'''
import tensorflow as tf
from nabu.neuralnetworks.classifiers import classifier, layer, activation
class DNN(classifier.Classifier):
'''a DNN classifier'''
def _get_outputs(self, inputs, input_seq_length, targets=None,
target_seq_length... | {
"content_hash": "55e8d622a493d18caef8290429b00c57",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 36.0253164556962,
"alnum_prop": 0.5801124385101898,
"repo_name": "JeroenBosmans/nabu",
"id": "7b70be50e967870a231c1992443ee3138946195f",
"size": "284... |
"""
Setup file for zipline_poloniex.
This file was generated with PyScaffold 2.5.7, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import sys
from setuptools import setup
def setup_package():
needs_sphinx = {'build_sphi... | {
"content_hash": "4a1768b5cf2acf0c651c8e197a3c1067",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 73,
"avg_line_length": 26.761904761904763,
"alnum_prop": 0.6619217081850534,
"repo_name": "FlorianWilhelm/zipline-poloniex",
"id": "b8c16d364867931687f45ad0f0597ea3670eb0c1",... |
"""
Django settings for foos project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | {
"content_hash": "4340e0203589862d9008840bbc74ff0f",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 71,
"avg_line_length": 25.699029126213592,
"alnum_prop": 0.6894597657725727,
"repo_name": "alexkau/foos",
"id": "62c3779b434587d0dc96ea57bac9a07e068f0bb0",
"size": "2647",... |
""" Utilities
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: (c) 2010-2012 Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Soft... | {
"content_hash": "ee5f9000c21fcc100785d57eaca7bdf3",
"timestamp": "",
"source": "github",
"line_count": 3347,
"max_line_length": 177,
"avg_line_length": 37.12100388407529,
"alnum_prop": 0.4704693989246966,
"repo_name": "madhurauti/Map-Polygon",
"id": "54e8112e16e3e774f5d91fe4411c94995cf6dd6e",
"siz... |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | {
"content_hash": "fd176bda2484bb144cb94c5372aa0f8f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 73,
"avg_line_length": 39,
"alnum_prop": 0.717948717948718,
"repo_name": "rysson/filmkodi",
"id": "72e020642e9fbb7274e8637fad6cc9f12a9e0033",
"size": "741",
"binary": fal... |
"""Runs all unit tests."""
__author__ = 'Pavel Simakov (psimakov@google.com)'
import sys
import unittest
import appengine_config
from common import caching
from common import xcontent
from controllers import sites
from models import config
from models import content
from models import courses
from models import vfs
f... | {
"content_hash": "fab532f5167babc6487737274daed3e2",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 79,
"avg_line_length": 36.27272727272727,
"alnum_prop": 0.6135651629072681,
"repo_name": "wavemind/gcb17ml",
"id": "128f51d47f771dd2a9e04ff519e1b212cdab1528",
"size": "134... |
"""Methods related to test expectations/expectation files."""
from __future__ import print_function
import collections
import datetime
import logging
import os
import re
import subprocess
import sys
from typing import Iterable, List, Optional, Set, Tuple, Union
import six
from typ import expectations_parser
from un... | {
"content_hash": "09f7ebb9a6e90a7812210f85169d7401",
"timestamp": "",
"source": "github",
"line_count": 559,
"max_line_length": 80,
"avg_line_length": 39.02325581395349,
"alnum_prop": 0.6507288897038599,
"repo_name": "nwjs/chromium.src",
"id": "8a9997c75cffe6348fac00e8a3e23e0ea3e49b69",
"size": "21... |
"""Client actions related to administrating the client and its configuration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import time
import traceback
import cryptography
from cryptography.hazm... | {
"content_hash": "8fca4d0fe66da4462e47dce809364c22",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 80,
"avg_line_length": 31.288888888888888,
"alnum_prop": 0.6976207386363636,
"repo_name": "demonchild2112/travis-test",
"id": "bf61628aa907bee07793e45714bedfedbc5ad6d4",
"... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection # noqa: F401,E501
from tapi_server.models.tapi_c... | {
"content_hash": "707fb4e797833ae11174b29d02690a81",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 124,
"avg_line_length": 37.265957446808514,
"alnum_prop": 0.7071081929774479,
"repo_name": "karthik-sethuraman/ONFOpenTransport",
"id": "7610cdfd2a0124450c5253a68e9aa7eb8b0ae... |
'''Trains a simple deep NN on the MNIST dataset.
Gets to 98.40% test accuracy after 20 epochs
(there is *a lot* of margin for parameter tuning).
2 seconds per epoch on a K520 GPU.
'''
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.lay... | {
"content_hash": "d0794c39f159c589b0b1b3b5ff7e08cd",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 60,
"avg_line_length": 29.178571428571427,
"alnum_prop": 0.682374541003672,
"repo_name": "antoniosehk/keras-tensorflow-windows-installation",
"id": "1be71e771d7f917b18ae03bc2... |
import six
import inflection
from schematics import types
from schematics import models
class BetfairModelMeta(models.ModelMeta):
"""Set default `serialized_name` and `deserialize_from` of Schematics types
to camel-cased attribute names.
"""
def __new__(meta, name, bases, attrs):
for name, att... | {
"content_hash": "578bc3f09451fbdf8d66c70fdc08b215",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 83,
"avg_line_length": 37,
"alnum_prop": 0.668918918918919,
"repo_name": "Taketrung/betfair.py",
"id": "08856bf52a1e1066848e0566f455496c8a1d4d86",
"size": "1061",
"binary... |
import wx
import wx.wizard
import os, sys #for lib test
#from textconf import appen # lets import the configuration file editor
class TitledPage(wx.wizard.WizardPageSimple):
def __init__(self, parent, title):
wx.wizard.WizardPageSimple.__init__(self, parent)
self.sizer = wx.BoxSizer(wx.VERTICAL)
... | {
"content_hash": "b4cfd86b924f131cbf4a593e4c15098a",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 107,
"avg_line_length": 28.864077669902912,
"alnum_prop": 0.5882946518668012,
"repo_name": "flipchan/LayerProx",
"id": "5cef94e2fcf0f8f170c19eaf803ffdc7af33962b",
"size": ... |
import io
import os
from contexts.plugin_interface import TEST_FOLDER, TEST_FILE
class FileSpecIdentifier:
def __init__(self):
self._specs = None
def setup_parser(self, parser):
parser.add_argument(
'--filespec',
action='store',
dest='specs',
d... | {
"content_hash": "6a01d85a3a9b87c5a82227550477ddbe",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 88,
"avg_line_length": 30.350877192982455,
"alnum_prop": 0.5670520231213872,
"repo_name": "benjamin-hodgson/Contexts",
"id": "ce02898147cc9e0bf67fc51d972545013e78f3e1",
"si... |
from setuptools import setup
setup(
name='ldsconf',
version='1.0.1',
description='LDS General Conference Study Plan Generator',
url='https://github.com/burnhamup/ldsconf',
author='Chris Burnham',
author_email="chris@burnhamup.com",
license='MIT',
packages=['ldsconf'],
install_requir... | {
"content_hash": "d2d85ec370ba1fa7c9226ebb6ffa4ede",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 26.57894736842105,
"alnum_prop": 0.6138613861386139,
"repo_name": "burnhamup/ldsconf",
"id": "f686ba9429d7abfb6196b7a9e04898b70482d903",
"size": "505... |
import json
data = {}
data[('Allow deletion of hypervisor nodes via nova-manage', 'Administrative')] = ['94536']
data[('Add a new nova service which pre-caches images on hypervisor nodes', 'Administrative')] = ['85768']
data[('Add support for monitoring the number of free IPs in a given fixed-ip block', 'Administrat... | {
"content_hash": "67e98ee5ce4a8f5889654b959d3e9bfe",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 169,
"avg_line_length": 74.43,
"alnum_prop": 0.7163778046486632,
"repo_name": "rcbau/hacks",
"id": "b659580651d3a4b7807d1b3891375132081b1bb4",
"size": "7462",
"binary": ... |
from unittest import TestCase
from cypy.graph import FrozenGraph, Node, relationship_type, graph_order, graph_size
from cypy.graph.store import PropertyDict
alice = Node("Person", "Employee", name="Alice", age=33)
bob = Node("Person")
carol = Node("Person")
dave = Node("Person")
KNOWS = relationship_type("KNOWS")
L... | {
"content_hash": "1c8871695844f47c29eb473c1fbb62ac",
"timestamp": "",
"source": "github",
"line_count": 611,
"max_line_length": 109,
"avg_line_length": 39.749590834697216,
"alnum_prop": 0.5784987853584223,
"repo_name": "technige/cypy",
"id": "fd5c974feeb2ddebe60510861feb1a9bb52b2a1e",
"size": "2491... |
import os
import sys
import urllib
from optparse import OptionParser
from twisted.internet import reactor
from twisted.python import failure
import coil
from nagcat import errors, graph, log, plugin
# Attempt to retry after failures 6 times at 20 second intervals
RETRY_INTERVAL = 20
RETRY_LIMIT = 6
# Which templa... | {
"content_hash": "44ec1b9204bef98b7fda8a3fbfcc884e",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 78,
"avg_line_length": 28.477326968973745,
"alnum_prop": 0.5542239356352665,
"repo_name": "marineam/nagcat",
"id": "d63b286b75fc85920aed27177157e9a1fffa707a",
"size": "125... |
"""
Attempt 1 (2 May 2020) at building an automatic
PDF builder for NAMS hybrid Markdown and Jupyter files
"""
import nbformat
import yaml
from pyprojroot import here
with open(here() / "mkdocs.yml", "r+") as f:
f = "".join(l for l in f.readlines())
mkdocs_config = yaml.safe_load(f)
nav = mkdocs_config["nav... | {
"content_hash": "4773a5d5bca50c5ce5756c492442305d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 75,
"avg_line_length": 24.5,
"alnum_prop": 0.6640502354788069,
"repo_name": "ericmjl/Network-Analysis-Made-Simple",
"id": "aa59f8a440fba062e2214616188b3f6d0e3702ea",
"size"... |
from django import forms
from vesper.django.app.clip_set_form import ClipSetForm
from vesper.singleton.preset_manager import preset_manager
import vesper.django.app.form_utils as form_utils
_FORM_TITLE = 'Export clip metadata to CSV file'
_TABLE_FORMAT_FIELD_LABEL = 'Clip table format preset'
def _get_field_defaul... | {
"content_hash": "d76fdc167a36cda20a20589f644cbe5f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 31.457142857142856,
"alnum_prop": 0.6630336058128974,
"repo_name": "HaroldMills/Vesper",
"id": "1554a00deef7a4c726a2f879c1b844939799278c",
"size": "1... |
import os
import subprocess
from Bio import SeqIO
#%%#############################################################################
### User-defined files and folder structure
################################################################################
# Define data folders
genomeFolder = '../genomes/faa'
outputFol... | {
"content_hash": "ce61fdf201dcbda2e8a435529d0e3b2a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 80,
"avg_line_length": 38.67307692307692,
"alnum_prop": 0.43560417702635507,
"repo_name": "joshamilton/Hamilton_acI_2017",
"id": "d7cab7b56d8a6d5a60752a71176e6d7c7b767092",
... |
"""Hooks function definitions.
Hooks are functions that are called in different parts of the codebase,
and used to execute some functionality that might be only required in
certain environments.
"""
def set_lint_args_hook(args):
"""Called after lint command arguments were parsed."""
try:
# This is for Google... | {
"content_hash": "fcc216e5d9ee8b71223685fc9faa33b9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 34.18181818181818,
"alnum_prop": 0.7351063829787234,
"repo_name": "GoogleCloudPlatform/gcpdiag",
"id": "73f8b40f99804a7c8967018fdeda097918321c4f",
"s... |
import string
import types
import Tkinter
import Pmw
class MainMenuBar(Pmw.MegaArchetype):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('balloon', None, None),
('hotkeys', 1, ... | {
"content_hash": "da2cf6527fdfc6dc771d3e2b5208e702",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 79,
"avg_line_length": 35.83856502242153,
"alnum_prop": 0.5516766766766766,
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"id": "8d2ca404367d7a86b1e17c94cd76eae9ccdc... |
from rest_framework import serializers
class UploadResult(serializers.Serializer):
url = serializers.URLField()
thumb = serializers.URLField()
| {
"content_hash": "0e09caad1e4e0db92b308a56f5c07716",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 43,
"avg_line_length": 30.4,
"alnum_prop": 0.7763157894736842,
"repo_name": "popara/jonny-api",
"id": "89e4977fe18d9c3a232afa0575f11acf685193dd",
"size": "152",
"binary": ... |
from django.shortcuts import get_object_or_404
from django.views.generic import CreateView
from .forms import MindMapComponentForm
from .models import MindMap
from utils.class_based_views_helper import JSONResponseMixin
class MapComponentAddView(CreateView, JSONResponseMixin):
form_class = MindMapComponentForm
... | {
"content_hash": "0ad6b44779ba1508db754a94f94d6b1f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 84,
"avg_line_length": 35.4,
"alnum_prop": 0.7109227871939736,
"repo_name": "ierror/BeautifulMind.io",
"id": "d2407536af5bc5693cf03c965244a8ba2970202f",
"size": "1086",
"... |
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extension... | {
"content_hash": "4ca4744956e7eaac4abbc17bf54a516a",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 80,
"avg_line_length": 28.37846153846154,
"alnum_prop": 0.6875203296107557,
"repo_name": "Ray-SunR/woeid",
"id": "de5b0d08d649518ce1d4d1aca8cf16c0061310bf",
"size": "9881"... |
from msrest.serialization import Model
class PowerShellTabCompletionResults(Model):
"""An array of strings representing the different values that can be selected
through.
:param results:
:type results: list[str]
"""
_attribute_map = {
'results': {'key': 'results', 'type': '[str]'},
... | {
"content_hash": "d55f61f42400fedd9d29918d9c610653",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 81,
"avg_line_length": 27.055555555555557,
"alnum_prop": 0.6344969199178645,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e0c7c8c3cb55f55f7b776249aad0b85eb420910b",
"s... |
import os
import tempfile
import string
class File:
# constractor
def __init__(self, absolute_path):
self.apath = absolute_path
# returns file type of the classes path
def get_ftype(self):
if os.path.lexists(self.apath):
if os.path.islink(self.apath):
... | {
"content_hash": "5debba04b57b272e64f98fdfe692eedf",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 76,
"avg_line_length": 34.57377049180328,
"alnum_prop": 0.4973921289710763,
"repo_name": "dkoudlo/py-manage-server",
"id": "94e8241c1765f4506d4805589ab36353043c83c8",
"siz... |
from docutils.parsers.rst import Directive, directives
from docutils import nodes
from sphinx import addnodes
from sphinx.roles import XRefRole
from sphinx.domains import Domain, ObjType, Index
from sphinx.util.nodes import make_refnode
class uplink_placeholder(nodes.General, nodes.Element):
def __init__(self, na... | {
"content_hash": "85bfafad6635ff66ddff06c0e697a70e",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 156,
"avg_line_length": 33.37410071942446,
"alnum_prop": 0.565100237120069,
"repo_name": "kfractal/envytools",
"id": "2f2b8c28a0c5df1f8b16278ee97e3ff4edb71b6e",
"size": "9... |
"""## Functions for copying elements from one graph to another.
These functions allow for recursive copying of elements (ops and variables)
from one graph to another. The copied elements are initialized inside a
user-specified scope in the other graph. There are separate functions to
copy ops and variables.
There is a... | {
"content_hash": "35240101a946cb5ce860ea11860613df",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 79,
"avg_line_length": 33.13168724279836,
"alnum_prop": 0.6801639547882251,
"repo_name": "xodus7/tensorflow",
"id": "6c9ab6aeb87fd39b22ab4f28d69b432b15899a13",
"size": "87... |
import os
import requests
import urllib.request, urllib.error, urllib.parse
import json
import sys
import time
import webbrowser
from stravalib import Client
from stravalib.exc import AccessUnauthorized
# we need the files "client_id", "auth_code" and "client_secret" inside this path
# if you change the path, dont for... | {
"content_hash": "a1f90eafed6a0dffa4ae82d750cf2783",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 117,
"avg_line_length": 33.75,
"alnum_prop": 0.628322440087146,
"repo_name": "rotti/grava",
"id": "6af170db5272153fa9294d43da292da57fcce8fd",
"size": "4613",
"binary": f... |
from decimal import Decimal
from django.db import models
from django.conf import settings
from django_extensions.db.fields import AutoSlugField
from model_utils import Choices
from abs_models import Abs_titulado_slugfy
from Corretor.utils import get_corretor_choices, get_corretor_por_id
from Corretor.base import Corre... | {
"content_hash": "ae8389ef60bb1e23bed0ed8bf8fef9b0",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 144,
"avg_line_length": 36.016129032258064,
"alnum_prop": 0.6860725481415136,
"repo_name": "arruda/amao",
"id": "fe6f7704fe8eb3a9fbe385efee308126702ccc74",
"size": "4503",... |
from maya import cmds
import pymel.core as pymel
import json
from plugin_json import export_json
from plugin_json import export_json_file
from plugin_json import import_json
from plugin_json import import_json_file
__all__ = (
'export_json_maya',
'export_json_file_maya',
'import_json_maya',
'import_json... | {
"content_hash": "9297a6b16bfa1e3583e00b7a0aa3cb27",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 105,
"avg_line_length": 42.338235294117645,
"alnum_prop": 0.6144494616186176,
"repo_name": "renaudll/libSerialization",
"id": "9f6fbe93f4cd5973b7ad2e9b0935bbec67fbca12",
"s... |
"""Lit runner site configuration."""
import os
import platform
import lit.llvm
# Handle the test srcdir for platforms. On windows, things are weird with bazel.
if platform.system() == 'Windows':
srcdir = os.environ['TEST_SRCDIR']
real_test_srcdir = srcdir[:srcdir.find('tensorflow/compiler/mlir')]
external_srcdi... | {
"content_hash": "3c0b8e09a1d0946ec27d46bda6815d2b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 80,
"avg_line_length": 39.50704225352113,
"alnum_prop": 0.706951871657754,
"repo_name": "paolodedios/tensorflow",
"id": "4907eaa6135ba17a591deb2fa211faf171704e65",
"size": ... |
from uservalid import get_user
import gconfig
import json
def useradd(username,password,telephone,mail,usertel,name,adminrole):
user_list1=get_user()
for user in user_list1:
if username == user['username']:
return False
useradd_f=open(gconfig.USER_FILE,'rb')
useradd_info=u... | {
"content_hash": "e36b8b9354d645ac40545c47e6192de3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 151,
"avg_line_length": 34.4,
"alnum_prop": 0.6787790697674418,
"repo_name": "51reboot/actual_09_homework",
"id": "cb9ef86533c983e3c4d0b603324d49ba61156633",
"size": "705",... |
"""Fichier contenant le paramètre 'relâcher' de la commande 'rames'."""
from primaires.interpreteur.masque.parametre import Parametre
class PrmRelacher(Parametre):
"""Commande 'rames relâcher'.
"""
def __init__(self):
"""Constructeur du paramètre"""
Parametre.__init__(self, "relâcher", ... | {
"content_hash": "d99057cb22a4d0bdb2770d6e7de9fd89",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 71,
"avg_line_length": 31.714285714285715,
"alnum_prop": 0.5891891891891892,
"repo_name": "vlegoff/tsunami",
"id": "116790e8f5e366e5aee759b5769a7ad792190a6c",
"size": "2688... |
import j3.jone | {
"content_hash": "adc1645de1e03f41d339671910886691",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 14,
"avg_line_length": 14,
"alnum_prop": 0.8571428571428571,
"repo_name": "jskDr/jamespy",
"id": "3e921ab09ab3f861a8b6a03df9896bbf5ba50dfe",
"size": "14",
"binary": false,... |
import os
import unittest
import pytest
from sparknlp.annotator import *
from sparknlp.base import *
from test.util import SparkContextForTest
@pytest.mark.fast
class DependencyParserConllUTestSpec(unittest.TestCase):
def setUp(self):
self.data = SparkContextForTest.spark \
.createDataFrame... | {
"content_hash": "a1d578cf28c5ce66ec482c7396b37734",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 121,
"avg_line_length": 40.592233009708735,
"alnum_prop": 0.5967471896675437,
"repo_name": "JohnSnowLabs/spark-nlp",
"id": "96a9178f098a023807ca30f0fb8e926a0392bdcb",
"siz... |
"""
This is the interface for interacting with a SMS service.
"""
import re
from restclients.dao import SMS_DAO
from restclients.exceptions import InvalidPhoneNumber, PhoneNumberRequired
class SMSService(object):
"""
This creates a SMS message to be sent to a destination phone number.
"""
def create_m... | {
"content_hash": "8bc8be8a8ed35f84467e8d7913ec02bc",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 87,
"avg_line_length": 29.323529411764707,
"alnum_prop": 0.6208625877632898,
"repo_name": "UWIT-IAM/uw-restclients",
"id": "31e0d0f0235830b2818aa2a74332167c70193967",
"size... |
import random
import numpy as np
import marshal
def generate_room(dim=(13, 13), p_change_directions=0.35, num_steps=25, num_boxes=3, tries=4, second_player=False):
"""
Generates a Sokoban room, represented by an integer matrix. The elements are encoded as follows:
wall = 0
empty space = 1
box targ... | {
"content_hash": "f43196e91682296c455f32e6f4461ba9",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 115,
"avg_line_length": 30.701704545454547,
"alnum_prop": 0.5942444711760896,
"repo_name": "mpSchrader/gym-sokoban",
"id": "1d33685764367d2831bc79da47270fdd5cf41bd8",
"siz... |
"""
Console
=======
.. versionadded:: 1.9.1
Reboot of the old inspector, designed to be modular and keep concerns
separated. It also has an addons architecture that allow you to add a button,
panel, or more in the Console itself.
.. warning::
This module works, but might fail in some cases. Please contribute!
... | {
"content_hash": "ef335ddfb415f238f837cf50636ebba1",
"timestamp": "",
"source": "github",
"line_count": 1058,
"max_line_length": 79,
"avg_line_length": 32.460302457466916,
"alnum_prop": 0.5856506420522377,
"repo_name": "LogicalDash/kivy",
"id": "6d5c46f785108043b54a46e29301fb23228d13fd",
"size": "3... |
import util
import base
import tempfile
import os
class ReopenableTempFile(base.BaseAttribute):
_known_options = set(('mode', 'bufsize', 'suffix', 'prefix', 'dir'))
def __init__(self, **kwargs):
super(ReopenableTempFile, self).__init__()
self._file = None
self.attr(kwarg... | {
"content_hash": "596e969c8327f9e3867f9bb97d3d8145",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 72,
"avg_line_length": 27.329896907216494,
"alnum_prop": 0.5330064126744625,
"repo_name": "codefortokyo/data-processing-tools",
"id": "7f1e15dfee4d0769dea7210aa45bafaed950297... |
"""Generate Java targets from Antlr3 and Antlr4.
See https://www.antlr.org.
"""
from pants.backend.codegen.antlr.java.antlr_java_gen import AntlrJavaGen
from pants.backend.codegen.antlr.java.java_antlr_library import (
JavaAntlrLibrary as JavaAntlrLibraryV1,
)
from pants.backend.codegen.antlr.java.target_types im... | {
"content_hash": "5464b79ff97743a1960af72a5b1f7a15",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.7835195530726257,
"repo_name": "tdyas/pants",
"id": "087787c20df7efd19d0588c0cc5edac3a9f0cde4",
"size": "848",
... |
from django.shortcuts import render
from django.views.generic import View, TemplateView
from .models import *
import datetime
class MainView(View):
template_name="about/main.html"
@classmethod
def sort_date(cls, item):
key = item.end_date
if not key:
key = datetime.date.tod... | {
"content_hash": "4615bc12dabfa27c12e127666f8f1415",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 94,
"avg_line_length": 35.142857142857146,
"alnum_prop": 0.6544715447154471,
"repo_name": "m-clark/mclarkpw",
"id": "e191f3ee1316be624b684564c14336d6618e9b94",
"size": "738... |
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the file specified on the command line.
Do a simple split() on whitespace to obtain all the words in the file.
Rather than read the file line by line, it's easier to read
it into one giant string and split it once.
Build a "mimic" dic... | {
"content_hash": "107d12003cbb675d736fb54bc994bb1e",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 78,
"avg_line_length": 29.382022471910112,
"alnum_prop": 0.6841300191204589,
"repo_name": "hugonomura/google-python-exercises",
"id": "b5ff5f9d2963b80fae14de57106346e1085bd5b... |
"""Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | {
"content_hash": "082edc4242e6fb5281a0cacdc8e692d9",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 31.964285714285715,
"alnum_prop": 0.7508379888268156,
"repo_name": "google/pinject",
"id": "2d8910fc08d659ee7fbbf2c53b878ac6b1f51996",
"size": "895",... |
from google.cloud import datastream_v1
def sample_list_stream_objects():
# Create a client
client = datastream_v1.DatastreamClient()
# Initialize request argument(s)
request = datastream_v1.ListStreamObjectsRequest(
parent="parent_value",
)
# Make the request
page_result = client... | {
"content_hash": "307bba48542f482236959d0d03befad5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 65,
"avg_line_length": 25.45,
"alnum_prop": 0.7092337917485265,
"repo_name": "googleapis/python-datastream",
"id": "9c58e250f60963e446f763f10d612fa5248815f3",
"size": "1905... |
"""Check internal peering forwarding limits which affect GKE.
Internal Load Balancer creation can fail due to VPC internal forwarding rules limits.
"""
from gcpdiag import lint, models
from gcpdiag.lint.gke import util
from gcpdiag.queries import apis, gke, logs
MATCH_STR_1 = 'INTERNAL_FORWARDING_RULES_WITH_PEERING_... | {
"content_hash": "22d7a68b64dbf121a015bbfb5f3b78e8",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 85,
"avg_line_length": 31.056603773584907,
"alnum_prop": 0.6931956257594167,
"repo_name": "GoogleCloudPlatform/gcpdiag",
"id": "1140a3177fb9255349d11beefbe28e0643172112",
"... |
import os
import sys
import unittest
import logging
APP_ROOT = os.getenv('APP_ROOT')
sys.path.insert(0, '%s/currypy/src' % APP_ROOT)
sys.path.insert(0, '%s/pypatterns/src' % APP_ROOT)
import pypatterns.filter as FilterModule
class Resource(object):
def name(self, value=None):
if value is not None:
... | {
"content_hash": "da095ff4aa1cd7000c887844c6e34943",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 93,
"avg_line_length": 33.62587412587413,
"alnum_prop": 0.6018508890506394,
"repo_name": "mjpan/pypatterns",
"id": "76684bf7ea0d634c07a216c02810f1f4a01c765e",
"size": "961... |
def main():
print("Hello world!")
| {
"content_hash": "7895e910276237731b352db8276c80a7",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 25,
"avg_line_length": 19,
"alnum_prop": 0.5789473684210527,
"repo_name": "hahcho/pytroid",
"id": "46b4ca549d1608ae3d562b5d3c19f01a0942cde0",
"size": "38",
"binary": false... |
"""remove infra_driver column
Revision ID: 8f7145914cb0
Revises: 0ae5b1ce3024
Create Date: 2016-12-08 17:28:26.609343
"""
# revision identifiers, used by Alembic.
revision = '8f7145914cb0'
down_revision = '0ae5b1ce3024'
from alembic import op
def upgrade(active_plugins=None, options=None):
op.drop_column('vnf... | {
"content_hash": "ebc1c43e871d58678b2b584dcecab7ed",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 47,
"avg_line_length": 20,
"alnum_prop": 0.7470588235294118,
"repo_name": "zeinsteinz/tacker",
"id": "7dd252f3edb66b254b3e86d08dd34c289d236b09",
"size": "955",
"binary": ... |
import atexit
import errno
import os
import shutil
import sys
import tempfile
import time
import pywatchman
from . import path_utils as path
global_temp_dir = None
class TempDir(object):
"""
This is a helper for locating a reasonable place for temporary files.
When run in the watchman test suite, we c... | {
"content_hash": "7e5bf627a11c47ddc00ae6cd3ff6d415",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 88,
"avg_line_length": 32.91509433962264,
"alnum_prop": 0.6311263972484953,
"repo_name": "nodakai/watchman",
"id": "aba87793a109274fb644552fef366fcfa203e58b",
"size": "367... |
from __future__ import unicode_literals
import abc
from monty.json import MSONable, MontyDecoder
import six
"""
Defines an abstract base class contract for Transformation object.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping... | {
"content_hash": "df12d3e62038628f45f64d4295b7c703",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 32.292682926829265,
"alnum_prop": 0.6401057401812689,
"repo_name": "czhengsci/pymatgen",
"id": "e585994d7ac77db8e3af92ac4f47eebdf2332858",
"size": "2... |
from sqlalchemy import create_engine
from sqlcell.db import DBSessionHandler, EngineHandler
import pandas as pd
class HookHandler(EngineHandler):
"""input common queries to remember with a key/value pair. ie,
%%sql hook
\d=<common query>"
\dt=<another common query>"""
def __init__(self, en... | {
"content_hash": "d387c192dc81d8e695a582e9c7a133b8",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 32.10344827586207,
"alnum_prop": 0.5440386680988185,
"repo_name": "tmthyjames/SQLCell",
"id": "e1966bc3f800ae157eda168ff7d6d105530048d0",
"size": "18... |
import copy
import testtools
from sahara.conductor import manager
from sahara import context
from sahara import exceptions as ex
import sahara.tests.unit.conductor.base as test_base
SAMPLE_CLUSTER = {
"plugin_name": "test_plugin",
"hadoop_version": "test_version",
"tenant_id": "tenant_1",
"is_transi... | {
"content_hash": "44f6d589d0cde88bd81c87580edce45b",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 76,
"avg_line_length": 32.79197080291971,
"alnum_prop": 0.5496939343350028,
"repo_name": "mapr/sahara",
"id": "1898b4daf296c7dfbf27caad54633c3d32918c37",
"size": "9568",
... |
"""
In this module you will find PyGridSizer and PyFlexGridSizer. Please
note that these sizers have since been ported to C++ (as wx.GridSizer
and wx.FlexGridSizer) and those versions are now exposed in the regular
wxPython wrappers. However I am also leaving them here in the library
so they can serve as an ... | {
"content_hash": "6314128b582e8ec91e9d98bfa5ae5ef3",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 73,
"avg_line_length": 30.974545454545453,
"alnum_prop": 0.49624324958910543,
"repo_name": "ktan2020/legacy-automation",
"id": "bfa9578aa1ff6cca643446d7b5c56149c28a1ac1",
... |
'''
docscore-util - Lexicon-Based Sentiment Analysis Library
Utility methods for lexicon based sentiment analysis
'''
from __future__ import absolute_import
from . import sentlex
import re
import math
import os
from . import negdetect
from . import stopwords
# Score adjustment functions
def scoreSimple(sco... | {
"content_hash": "7799ed6b3561b0f144a4918bb0bae44a",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 113,
"avg_line_length": 31.658536585365855,
"alnum_prop": 0.5946511116002642,
"repo_name": "bohana/sentlex",
"id": "aa03e39f6a4efd76c6a9556eaf1f5358784376b1",
"size": "908... |
"""Fichier définissant les files d'attente des contextes :
- La classe Filecontexte modélisant une file d'attente des contextes
- L'exception fileVide
"""
from abstraits.obase import BaseObj
class FileContexte(BaseObj):
"""Cette classe définie une file d'attente des contextes.
C'est une classe envelopp... | {
"content_hash": "f4793c7e38e4081b73daef373c54d718",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 77,
"avg_line_length": 29.110576923076923,
"alnum_prop": 0.5919075144508671,
"repo_name": "stormi/tsunami",
"id": "2d475a1a250106c17336c89eb8a983a1a4c53e20",
"size": "7674... |
"""
AUTHOR: Gabriel Bassett
DATE: 12-17-2013
DEPENDENCIES: a list of modules requiring installation
Copyright 2014 Gabriel Bassett
LICENSE:
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
... | {
"content_hash": "94ce3b5e98b85bb663362f4b9beee15d",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 169,
"avg_line_length": 37.932330827067666,
"alnum_prop": 0.5879088206144698,
"repo_name": "vz-risk/Verum",
"id": "b19ce53e839eed80387eecc14d73fc1d854c289b",
"size": "1011... |
import time
import shlex
from hurry.filesize import size
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
FileTransferSpeed, FormatLabel, Per... | {
"content_hash": "445dbff65b9efd3ba5a0cface4f22fe8",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 171,
"avg_line_length": 44.44524236983842,
"alnum_prop": 0.5891904992729036,
"repo_name": "emuus/hammr",
"id": "372b293724ef7ffc0b661e7311b17844f3529f58",
"size": "25391",... |
import time
from database.dict_converters.converter_base import ConverterBase
class MatchConverter(ConverterBase):
SUBVERSIONS = { # Increment every time a change to the dict is made
3: 5,
}
@classmethod
def _convert(cls, matches, dict_version):
CONVERTERS = {
3: cls.matc... | {
"content_hash": "2878d85222bf1a57b3211de396b06ac5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 106,
"avg_line_length": 36.872727272727275,
"alnum_prop": 0.5956607495069034,
"repo_name": "nwalters512/the-blue-alliance",
"id": "0299081d73247b01a1a776625dd482db6a289a51",
... |
"""This example illustrates how to get all campaigns and log details to
Google Cloud Logging using a custom logging interceptor.
"""
import argparse
import sys
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from cloud_logging_interceptor import Clou... | {
"content_hash": "53edfe3c1fde375f575fd25fda7110cf",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 31.458333333333332,
"alnum_prop": 0.6388520971302428,
"repo_name": "googleads/google-ads-python",
"id": "24849b13241572696fbd2cd0df6c98cac7d04d0d",
"... |
"""
Contains the logic for:
finding the 'ini' file, generating a configuration object
setting up a logging object
"""
from __future__ import print_function, division, unicode_literals, absolute_import
import ast
import sys
import logging
import os.path
try:
import ConfigParser
except ImportError:
import co... | {
"content_hash": "009af665d544b30efb08fbc626802ea4",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 123,
"avg_line_length": 31.684466019417474,
"alnum_prop": 0.5929217098207445,
"repo_name": "willnx/alarmer",
"id": "8418d7b3bc515faa17e15ff5d0ae6818c666169c",
"size": "655... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/reactor/shared_rct_kessel_imperial_sds_secret_ops.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","rct_kessel_imperial_sds_secret_ops_n")
#### BEGIN MODIFICATIONS ###... | {
"content_hash": "dcc2681921e7e3f113132de20762d250",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 106,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.7208672086720868,
"repo_name": "obi-two/Rebelion",
"id": "ae723522e515d39cba43008d5c41c588f15c5e75",
"size": "51... |
from .dataops import *
__all__ = ['dataops']
| {
"content_hash": "ed3a24a4c9f606e05d3341a8f61f0383",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 22,
"avg_line_length": 15.333333333333334,
"alnum_prop": 0.5869565217391305,
"repo_name": "get9/ml-test",
"id": "476add6cdb523bde8155e9c29c9298c9a8194a2c",
"size": "46",
"... |
"""Command for restarting instances of managed instance group."""
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.compute.instance_groups import flags as instance_groups_flags
from googlecloudsdk.command_lib.compute.instance_groups.manage... | {
"content_hash": "121ba43c388aa791e934b62342691424",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 109,
"avg_line_length": 37.27906976744186,
"alnum_prop": 0.7292576419213974,
"repo_name": "Sorsly/subtle",
"id": "0bb7a0c6a50839273027bab2a46260549d2a1338",
"size": "2198",... |
'''
Candlestick pattern functions not in class type.
'''
import numpy as np
import pandas as pd
import json
import pandas.io.data as web
from datetime import date, datetime, timedelta
from collections import defaultdict
start = datetime(2010, 1, 1)
end = date.today()
df1 = pd.read_csv('data/companylist.csv')
df2 = pd... | {
"content_hash": "328ead57ebed41218dfb8d13414d9ae2",
"timestamp": "",
"source": "github",
"line_count": 1494,
"max_line_length": 198,
"avg_line_length": 43.74029451137885,
"alnum_prop": 0.6082665115994369,
"repo_name": "kennethcc2005/yahoo_finance_stocks",
"id": "29d3060001fd6912828a6382e64bdde4391e0... |
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class helloApp(CMSApp):
name = _("Hello App") # give your app a name, this is required
urls = ["helloApp.urls"] # link your app to url configuration(s)
apphook_pool.register(hel... | {
"content_hash": "134663953f833da7163ae76306f2e159",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 69,
"avg_line_length": 34.8,
"alnum_prop": 0.735632183908046,
"repo_name": "samirasnoun/django_cms_gallery_image",
"id": "88dd8513d79510a3e6c39bcfce04287065cffa95",
"size":... |
from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import AuditLogEntry, AuditLogEntryEvent, Project
BLANK_CHOICE = [("", "")]
class AddProjectForm(forms.ModelForm):
name = forms.CharField(label=_('Name'), max_length=200,
... | {
"content_hash": "9eaf162702688f6e5264415a9ce6fa0a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.6271338724168913,
"repo_name": "daevaorn/sentry",
"id": "a17ca62553d6ed681d1600ddb60d6206f2a803c3",
"size": "1113"... |
''' Sample usage of function 'inventory_unmounted' to show which devices in the configuration are not mounted.
Print the function's documentation then invoke the function and print the output.
'''
from __future__ import print_function as _print_function
from basics.inventory import inventory_unmounted
from pydoc ... | {
"content_hash": "c13ea96b963672bbe23bec78d09fd221",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 110,
"avg_line_length": 31,
"alnum_prop": 0.7399193548387096,
"repo_name": "tbarrongh/cosc-learning-labs",
"id": "81bf09aadb40904c8598602377eb9b5d761fa7ae",
"size": "1099",... |
from __future__ import absolute_import, unicode_literals
import logging
import os
import mopidy_test
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, exceptions, ext
__author__ = 'Andrew Jackson'
__email__ = 'andrewderekjackson@gmail.com'
__version__ = '0.1.0'
# If you need ... | {
"content_hash": "05ac42e61015f8733e73d838d7877b8b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 71,
"avg_line_length": 22.76,
"alnum_prop": 0.6546572934973638,
"repo_name": "andrewderekjackson/mopidy_webradio",
"id": "9c80199597fefa2870e9fcd7e175e08b0d52df9f",
"size":... |
"""Utilities for loading datasets for training."""
import functools
from typing import Dict, Any, Tuple
from absl import logging
import jax.numpy as jnp
import ml_collections as collections
import tensorflow as tf
import data as cpdata
def apply_cifar_augmentation(
config: collections.ConfigDict, ds: tf.data.Da... | {
"content_hash": "fe0c1fe361021baf6f6c70a3f021e065",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 80,
"avg_line_length": 36.929577464788736,
"alnum_prop": 0.6425629290617849,
"repo_name": "deepmind/conformal_training",
"id": "7b87a27a1ae8c80c4816fe61bea4ccc38e372f1c",
... |
import os
def prtcl():
result=os.popen('iptables -L INPUT |grep -iv "chain"|grep -iv "prot"| awk \'{print $2}\'',"r").read()
return result
def src():
result=os.popen(' iptables -L INPUT|grep -iv "chain"|grep -iv "prot" | awk \'{print $4}\'',"r").read()
return result
def des():
result=os.popen('iptables -L INP... | {
"content_hash": "57b13c60c20dd23ed5fb8375db0202d0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 103,
"avg_line_length": 27.916666666666668,
"alnum_prop": 0.6149253731343284,
"repo_name": "d4rkl0rd3r3b05/Firewall",
"id": "3b43214faac763e98798a65000f8b99c897b7565",
"siz... |
"""
WSGI config for job_scheduler_web project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("D... | {
"content_hash": "334cf458b56e638b3154b2ab1f2a5e35",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.75,
"alnum_prop": 0.7718446601941747,
"repo_name": "ewerkema/job-scheduler",
"id": "9890706e5ffa3a56287a5e1844dd87573c5d66b6",
"size": "412",
"b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.