text
stringlengths
4
1.02M
meta
dict
from collections import defaultdict from threading import local from django.core.cache import caches from django.db import DEFAULT_DB_ALIAS from .settings import cachalot_settings from .signals import post_invalidation from .transaction import AtomicCache class CacheHandler(local): @property def atomic_cach...
{ "content_hash": "11cbc107670bf6759eafd37dfb20b4ce", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 75, "avg_line_length": 37.089285714285715, "alnum_prop": 0.6398651901781416, "repo_name": "BertrandBordage/django-cachalot", "id": "6acde16114672a8acfc7b3880494de2c535698cb",...
from molluscs.v1 import molluscclient def sample_classify(video, location): # Create a client client = molluscclient.MolluscServiceClient() # Initialize request argument(s) classify_target = molluscclient.ClassifyTarget() # video = "path/to/mollusc/video.mkv" with open(video, "rb") as f: ...
{ "content_hash": "ff8f00a23b03438bab6a577b1d91834a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 56, "avg_line_length": 25.964285714285715, "alnum_prop": 0.6905089408528198, "repo_name": "googleapis/gapic-generator-python", "id": "d8f4cb53cbad3e77c9e7c08030bd829824f8e17b...
import os import numpy as np import matplotlib.pyplot as plt import tbmodels as tb import pymatgen as mg import pymatgen.symmetry.analyzer import pymatgen.symmetry.bandstructure import symmetry_representation as sr def compare_bands_plot(model1, model2, structure): path = mg.symmetry.bandstructure.HighSymmKpath(...
{ "content_hash": "8f88fb6f552105aaa706e950d65b0ae6", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 88, "avg_line_length": 39.734848484848484, "alnum_prop": 0.6144899904671115, "repo_name": "Z2PackDev/TBmodels", "id": "8c905a7eeb8166ab5e0073b1c212012e57e9b731", "size": "...
""" A wrapper class for Spark DataFrame to behave similar to pandas DataFrame. """ from collections import defaultdict, namedtuple from collections.abc import Mapping import re import warnings import inspect import json import types from functools import partial, reduce import sys from itertools import zip_longest, cha...
{ "content_hash": "1079224948d0aba184e244886baf74e0", "timestamp": "", "source": "github", "line_count": 13260, "max_line_length": 100, "avg_line_length": 36.13808446455505, "alnum_prop": 0.5059235252748904, "repo_name": "zero323/spark", "id": "72913bc17d3062c83aa1efa8c2dcc7a1e9c68d78", "size": "480...
from wtforms import Form, TextField, TextAreaField, BooleanField, IntegerField, DateField, DecimalField, validators #Team Form model class TeamForm(Form): teamName = TextField('teamName') sp1Name = TextField('sp1Name') sp1Novice = BooleanField('sp1Novice') sp1ESL = BooleanField('sp1ESL') sp2Name = TextField('sp2N...
{ "content_hash": "505dafa7135001d9919da271f0474f27", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 115, "avg_line_length": 35.78666666666667, "alnum_prop": 0.7529806259314457, "repo_name": "sarrionandia/tournatrack", "id": "b13adbfa92e436617c2e6251c0a7f5eb2071603b", "siz...
from __future__ import absolute_import import math import uproot3.interp.interp import uproot3.interp.numerical class _JaggedArrayPrep(object): def __init__(self, counts, content): self.counts = counts self.content = content def _destructive_divide(array, divisor, awkward0): if divisor == 1:...
{ "content_hash": "11ceab44c783a12eba4ad21624aea01f", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 208, "avg_line_length": 45.45038167938932, "alnum_prop": 0.6424252603291905, "repo_name": "scikit-hep/uproot", "id": "72e6d1aeac15caed9ec0573f0a6534836c55bc5d", "size": "6...
"""Run the first page of one benchmark for every module. Only benchmarks that have a composable measurement are included. Ideally this test would be comprehensive, however, running one page of every benchmark would run impractically long. """ import os import sys import unittest from telemetry import benchmark as be...
{ "content_hash": "115743cb77a4f8e5f5b660f25205b011", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 79, "avg_line_length": 38.254901960784316, "alnum_prop": 0.728515291303605, "repo_name": "js0701/chromium-crosswalk", "id": "3fa90291f5c08d39fd4a70e403d81ec99a275ccb", "si...
""" Factories """ import pkg_resources ENTRY_POINT = 'cabalgata.factories' def load_factory(name, directory, configuration=None): """ Load a factory and have it initialize in a particular directory :param name: the name of the plugin to load :param directory: the directory where the factory will reside ...
{ "content_hash": "e29b5797267e1e761f53235213fab2aa", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 30.789473684210527, "alnum_prop": 0.6923076923076923, "repo_name": "cabalgata/cabalgata-silla-de-montar", "id": "183cda8ad7c2f772e40199f80f3041b90fa05e...
import random import nltk def get_features(name): return {'first letter' : name[0], 'second letter': name[1], 'last letter': name[-1], } def get_label(female_file, male_file): list = [] with open(female_file, 'r') as f: for line in f: list.append(lin...
{ "content_hash": "43c724333070e9a71f46a8801cbab2c3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 87, "avg_line_length": 33.644444444444446, "alnum_prop": 0.6149273447820344, "repo_name": "Korotkikh/TwitterSentimentAnalysis", "id": "60bdddb54d319aab523e3112c7c79ba1b53b692...
import unittest import datetime import operator import pytz import recurly recurly.API_KEY = 'blah' import mocurly.core import mocurly.backend class TestAccount(unittest.TestCase): def setUp(self): self.mocurly_ = mocurly.core.mocurly() self.mocurly_.start() self.base_account_data = { ...
{ "content_hash": "39935f3d3cae2ecee435bc2f1525468c", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 124, "avg_line_length": 53.38507462686567, "alnum_prop": 0.653377320509953, "repo_name": "Captricity/mocurly", "id": "fa483947f68c13519894986f1c20ba9af6252c7b", "size": "1...
"""" Append list and reverse """" def append_list(): count = 10**5 nums = [] for i in range(count): nums.append(i) nums.reverse() """ In [23]: profile.run('append_list()') 200005 function calls in 3.520 CPU seconds """ """ Now implement the same using insert instead of append. No...
{ "content_hash": "fdbfe87e2805417c61b798d4d3897b5b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 89, "avg_line_length": 18.032258064516128, "alnum_prop": 0.6028622540250447, "repo_name": "manoharp/algo", "id": "301be2f30fa92331254e27080a855ecca0de7374", "size": "559", ...
from __future__ import annotations import csv import logging import os.path from functools import wraps from html import escape from io import StringIO from json import dumps from itertools import chain from time import time from typing import TYPE_CHECKING, Optional, Any, Dict, List import gevent from flask import Fl...
{ "content_hash": "e1f55324416ac9ac2f1548625208796b", "timestamp": "", "source": "github", "line_count": 581, "max_line_length": 128, "avg_line_length": 42.714285714285715, "alnum_prop": 0.5644920820405367, "repo_name": "locustio/locust", "id": "673317ff096c277c12fe9a04bfe96cc51b841852", "size": "24...
""" Display tasks in thunderbird calendar. Configuration parameters: cache_timeout: how often we refresh usage in seconds (default 120) err_exception: error message when an exception is raised (default 'error: calendar parsing failed') err_profile: error message regarding profile path and read acce...
{ "content_hash": "1571f7347eb379570d5ec31c652d5383", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 76, "avg_line_length": 32.10227272727273, "alnum_prop": 0.6173451327433628, "repo_name": "alexoneill/py3status", "id": "24e2ead4fdb6a0467a2335f0232ddaeaae7adf8e", "size": "...
import os from kaira.app import App from kaira.response import response app = App() app.static('/static/', os.path.join(os.path.dirname(__file__), "static")) @app.route("/") def hello_world(request): return response.html('<h1>Hello World!</h1> <p><img src="/static/photo2.png" width="400" height="300" /></p>') ...
{ "content_hash": "45804526b211e35b5652b95fe74fd236", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 114, "avg_line_length": 23.529411764705884, "alnum_prop": 0.6375, "repo_name": "mulonemartin/kaira", "id": "ea1fcae27b9f0c8d70e789a8c7d5d1890900eb0a", "size": "400", "bin...
""" A library of plugins which other plugins can activate by importing. Can also be activated directly By adding it as a plugin package. """
{ "content_hash": "5e4f1685c6b4a7b9eb863a41fff49b8e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 98, "avg_line_length": 35.25, "alnum_prop": 0.7659574468085106, "repo_name": "lahwran/crow2", "id": "1878c6415ba44c81fe761eea6e2276a7fe5ba21a", "size": "141", "binary": fa...
import MySQLdb class mysqldb(): def __init__(self): self.conn = MySQLdb.connect( host='localhost', user='root', passwd='passwd') self.cursor = self.conn.cursor() self.conn.select_db('test') self.cursor.execute("SET NAMES 'utf8'") self.conn.commit() def cre...
{ "content_hash": "b9347422fa8fe1228ff8c85ff463906e", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 30.147540983606557, "alnum_prop": 0.5486677542142468, "repo_name": "quchunguang/test", "id": "3c600640cc054031c3fab72e0344d0cb2d5961e9", "size": "189...
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
{ "content_hash": "39f8319105c8fce0b8ee6f54ae02fb0d", "timestamp": "", "source": "github", "line_count": 996, "max_line_length": 87, "avg_line_length": 38.31325301204819, "alnum_prop": 0.608045073375262, "repo_name": "nelango/ViralityAnalysis", "id": "6171fcec020d8666987350ac05a12373c261b8dc", "size...
import os from setuptools import setup # from distutils.core import setup name = "dyconnmap" rootdir = os.path.abspath(os.path.dirname(__file__)) packages = [] for dirname, dirnames, filenames in os.walk(name): if "__init__.py" in filenames: packages.append(dirname.replace("/", ".")) data_files = [] for...
{ "content_hash": "1460b60a5f6948de0e56ada4edc11bfd", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 71, "avg_line_length": 32.166666666666664, "alnum_prop": 0.6082901554404145, "repo_name": "makism/dyfunconn", "id": "68703b042df4baaafe54d26df3eba52f3845168b", "size": "203...
from __future__ import absolute_import import os import re import sys import six import time import logging import posixpath from symsynd.demangle import demangle_symbol from sentry.models import Project, EventError from sentry.plugins import Plugin2 from sentry.lang.native.symbolizer import Symbolizer, Symbolicatio...
{ "content_hash": "75efeacf6e7c5e687caa7a26a8ebc10b", "timestamp": "", "source": "github", "line_count": 466, "max_line_length": 84, "avg_line_length": 34.15450643776824, "alnum_prop": 0.5412163860266399, "repo_name": "zenefits/sentry", "id": "9287aa87947e0f28389d7e641bfc8159dfb2ae2b", "size": "1591...
"""Module containing update resource class.""" from goodreads_api_client.exceptions import OauthEndpointNotImplemented from goodreads_api_client.resources.base import Resource class Update(Resource): def friends(self): raise OauthEndpointNotImplemented('update.friends')
{ "content_hash": "2627c65f43762380c2f20d9d327e08bb", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 31.77777777777778, "alnum_prop": 0.7937062937062938, "repo_name": "mdzhang/goodreads-api-client-python", "id": "414889097c003c2525960c1be5b69689c28171e6...
import operator from django.db import models from datetime import datetime from django.db.models import Q from filebrowser.fields import FileBrowseField from tinymce import models as tinymce_models from photologue.models import ImageModel, Photo # Create your models here. SPEECH_TYPE_CHOICES = ( ('recorded', 'Rec...
{ "content_hash": "6df6f2fc51a8061daf0419fecc4b7f59", "timestamp": "", "source": "github", "line_count": 773, "max_line_length": 147, "avg_line_length": 32.2496765847348, "alnum_prop": 0.6328372578121866, "repo_name": "ACECentre/SpeechBubblev1", "id": "23c70b5d25ae1856a434b29ba954571bde86c1d3", "siz...
class GameObject: def __init__(self, game, physics=None, renderable=None): self.game = game self.physics = physics self.renderable = renderable def update(self): print(self.getGamePosition()) def render(self, renderer): pass def getGamePosition(self): ...
{ "content_hash": "53360d503b7a3f300051b78a19202d3c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 60, "avg_line_length": 26.285714285714285, "alnum_prop": 0.6032608695652174, "repo_name": "jadmz/pygame-box2d-template", "id": "ebbd2ad0ec3b9f1d8ffdc29f54ed2990b5f5f3c7", "...
"""Confirms subscription to a topic. This is used to confirm a subscription of an HTTP(S) endpoint to a topic created on AWS Simple Notification Service (SNS). It is supposed to run on the endpoint that is being subscribed. Usage: ./confirm_subscription.py [options] """ import BaseHTTPServer import json import o...
{ "content_hash": "645960c359ab10566071c7d0eaed1d49", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 77, "avg_line_length": 30.015625, "alnum_prop": 0.6158250910983862, "repo_name": "ezhuk/aws-tools", "id": "3e84391ad35d095e76e8bc530b0c13d73a736d47", "size": "3997", "bi...
import csv from django.core.exceptions import PermissionDenied from django.http import HttpResponse from openslides.agenda.models import Speaker from openslides.utils.views import View class CSVExportView(View): """ View to export the lists of speakers of all agenda items as csv. """ def get(self, re...
{ "content_hash": "43f8dc287b0809233c1efa882539b6ca", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 93, "avg_line_length": 40.1, "alnum_prop": 0.6176226101413134, "repo_name": "normanjaeckel/openslides-csv-export", "id": "bef904584db54feb6e4a530f1045b9905402eb21", "size":...
import re re_number = re.compile(r'\d') #re_string = re.compile(r'["\'][^"\']*["\']') #"[^"]*"|'[^']*' re_string = re.compile(r'"[^"]*"|\'[^\']*\'') def regex_labels(document, l): """ Add a list of (regex, label) to the labeling of document """ for regex, label in l: matches = regex.finditer(document....
{ "content_hash": "38cf8abd9dd75af5b362a493b0bc4ea7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 33.61538461538461, "alnum_prop": 0.562929061784897, "repo_name": "Chiel92/fate", "id": "f7b5303f76f23581a70a6ca04299d64c49164c3e", "size": "437", "...
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User # Create your models here. class Blog(models.Model): STATUS_CHOICES = ( ('d', "draft"), ('p', "published"), ) title = models.CharField("Title", max_length=128, db_index=True, ...
{ "content_hash": "d9d79d20df53cfaeb90794d0608eaecb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 107, "avg_line_length": 34.16129032258065, "alnum_prop": 0.6789423984891407, "repo_name": "wenxuan-xia/niv_blog", "id": "953b95357227f8a13cb8da34aaf32593d9df903f", "size": ...
from dnload.glsl_block import GlslBlock ######################################## # GlslBlockDefault ##################### ######################################## class GlslBlockDefault(GlslBlock): """Default 'fallback' GLSL block.""" def __init__(self, content): """Constructor.""" GlslBlock....
{ "content_hash": "3057afca6122d912609662e8dafc8f51", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 82, "avg_line_length": 30.75, "alnum_prop": 0.45709123757904246, "repo_name": "trilkk/dnload", "id": "048990f009452bea2b5a66c8655e7b10bdc96129", "size": "1107", "binary":...
import os, argparse import tensorflow as tf # The original freeze_graph function # from tensorflow.python.tools.freeze_graph import freeze_graph dir = os.path.dirname(os.path.realpath(__file__)) def freeze_graph(model_dir, output_node_names,export_dir): """Extract the sub graph defined by the output nodes and ...
{ "content_hash": "3ba447ec4ec7be0f53cfbc88e0f2f06c", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 150, "avg_line_length": 43.970588235294116, "alnum_prop": 0.676923076923077, "repo_name": "dedoogong/asrada", "id": "867c24d5771a0815871bc1113fe14b38937dba92", "size": "299...
from django.contrib import admin from models import Tileset class TilesetAdmin(admin.ModelAdmin): fields = ['name', 'created_by', 'server_url', 'server_service_type', 'server_username', 'server_password', 'layer_name', 'layer_zoom_start', 'layer_zoom_stop', 'geom'] list_display = ('name', 'layer_name', 'serve...
{ "content_hash": "dff6201420ae19ea098d1a3b09302838", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 171, "avg_line_length": 42.8, "alnum_prop": 0.6985981308411215, "repo_name": "ROGUE-JCTD/django-tilebundler", "id": "f1d6e330e86735717aed50c1e9fe9e59da126655", "size": "428...
from prolog.interpreter.parsing import parse_file, TermBuilder from prolog.interpreter.term import Atom, Number, Term, Callable, \ specialized_term_classes, NumberedVar, MutableCallable from prolog.interpreter.test.tool import parse from prolog.interpreter.heap import Heap import py def parse(inp): t = par...
{ "content_hash": "5d63a16758cc796f98dd872b3335dc8e", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 67, "avg_line_length": 30.203703703703702, "alnum_prop": 0.6204782342121398, "repo_name": "cosmoharrigan/pyrolog", "id": "c3f80152111b0392b04e7a0fdac04108e08bc17e", "size"...
from subprocess import check_output print(check_output(['hostname', '-I']))
{ "content_hash": "585967b4a90b669c95aa79c54efe913e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 38, "alnum_prop": 0.7368421052631579, "repo_name": "cazacov/InternetOfThings", "id": "98e6aa5c37808029db2f7bbb5b481ae6db1678e1", "size": "76", "bina...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('articles', '0011_seriespage_subtitle'), ] operations = [ migrations.RenameField( model_name='seriespage', old_name='image', ...
{ "content_hash": "f4d2d5c5c4d4badb2311a478e6131b79", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 49, "avg_line_length": 20.666666666666668, "alnum_prop": 0.5860215053763441, "repo_name": "albertoconnor/website", "id": "1556db0eaefbda518b91f4c0e9731298ba5e0109", "size":...
''' Models (mostly base classes) for the various kinds of renderer types that Bokeh supports. ''' from __future__ import absolute_import import logging logger = logging.getLogger(__name__) from ..core.enums import RenderLevel from ..core.has_props import abstract from ..core.properties import Auto, Bool, Either, Enu...
{ "content_hash": "e49d0c80eb7c63f65227c728f511891a", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 109, "avg_line_length": 29.67195767195767, "alnum_prop": 0.6551355206847361, "repo_name": "schoolie/bokeh", "id": "6021c457ba2db03147c8b49ae0dc1774c5e413b8", "size": "5608...
import spectral as sp import os import numpy as np import Classifier_SAM as SAM from glob import glob testOxi = 1 normalize_button = 0 # do nothing to testing data SP array. def dataProcess_alg_pass(SP): return SP #exclude the background pixel, into an array(spectrum) and return T/F, True: background; False: n...
{ "content_hash": "d381563604b9c04b60f59be78e2f45d6", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 181, "avg_line_length": 42.52654867256637, "alnum_prop": 0.580168556861929, "repo_name": "Vincentyao1995/Globalink2017-UBC", "id": "e41c1785dfce9f21acf5156999428bc06d65bb31"...
from collections import defaultdict from collections import OrderedDict import copy import functools import logging import types from django.conf import settings from django import shortcuts from django.template.loader import render_to_string from django import urls from django.utils.functional import Promise from dja...
{ "content_hash": "2f614f78be57e4e44292e7143389d7a1", "timestamp": "", "source": "github", "line_count": 951, "max_line_length": 80, "avg_line_length": 40.09358569926393, "alnum_prop": 0.6130504340528207, "repo_name": "noironetworks/horizon", "id": "1011bdaa3be747ab486f6161b6c5066896c581b8", "size":...
import re from eventlet import greenthread import powervc.common.config as cfg from powervc.common.gettextutils import _ from nova.compute import flavors from nova import exception from nova import db from oslo_log import log as logging from nova.openstack.common import loopingcall from powervc.nova.driver.compute imp...
{ "content_hash": "d03914bc5fe3a1acb9ce257fb356e8ad", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 79, "avg_line_length": 38.422330097087375, "alnum_prop": 0.5648768161718256, "repo_name": "openstack/powervc-driver", "id": "3b720b3cda2410bd66a17fe450e76fd30cb40336", "si...
#!/usr/bin/env python __author__ = 'Darrien' # sys is needed to skip the python script when updating # os is needed for changing the working directory, and making folders import sys import os # Kills the script in order to return to the bash script that called it. def update_kill(): print "Killing m...
{ "content_hash": "9a5122cded498a1b8a508308718ce443", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 127, "avg_line_length": 39.246511627906976, "alnum_prop": 0.5854467883384689, "repo_name": "DarrienG/Server-Automation", "id": "5c6b69e85eed0a2957276c5ba9e106c2af57c9e8", ...
''' Author : Oguzhan Gencoglu Contact : oguzhan.gencoglu@tut.fi Created : 11.07.2015 Latest Version : 13.10.2015 Train a classifier for breath detection ''' from __future__ import absolute_import from __future__ import print_function from get_file_locs import get_file_locs import librosa import ...
{ "content_hash": "57590542a82c47a4469d96a5701c31cc", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 96, "avg_line_length": 37.37, "alnum_prop": 0.6141289804656141, "repo_name": "ogencoglu/BreathDetection", "id": "377286d9ec33569b502794a50bd8dd935c9c11ab", "size": "3737",...
import pytest import numpy as np import murraylab_tools.echo as mt_echo @pytest.mark.skip(reason="tests not yet implmented") class TestEchoSourceMaterial(): def test_implement_me(self): assert 0
{ "content_hash": "4f60057272ec80beb5ac34a2d8902153", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 52, "avg_line_length": 23.22222222222222, "alnum_prop": 0.7464114832535885, "repo_name": "smsaladi/murraylab_tools", "id": "c7dcd5c9fa96e9bb38cffd586bed6ebc52477605", "size"...
from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import os import sys import errno import logging from tldp.ldpcollection import LDPDocumentCollection from tldp.utils import md5files, stem_and_ext from tldp.typeguesser import guess, knownextensions logger = lo...
{ "content_hash": "4fbac1ce701eb3434f2b66f4a037eab3", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 79, "avg_line_length": 39.03603603603604, "alnum_prop": 0.633856450496192, "repo_name": "tLDP/python-tldp", "id": "90846d0469c9ae0f3296ac696171ba842fcffef7", "size": "8760...
from __future__ import absolute_import import os import re import subprocess from pex.common import is_exe from pex.tracer import TRACER from pex.typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Iterable, Iterator, Optional, Tuple import attr # vendor:skip else: from pex.third_party imp...
{ "content_hash": "97ebb70d491d707b94a36054db30bda6", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 100, "avg_line_length": 39.71291866028708, "alnum_prop": 0.5178313253012048, "repo_name": "pantsbuild/pex", "id": "0a99a1e2cab02ea7fe5242e95c9a2118fbce5798", "size": "8432...
from ij import IJ from ij.gui import Roi, ShapeRoi import os import os.path as op import glob import string import shutil as sh import fnmatch as fn import errno print ["%s\n"%i for i in dir(IJ)] IJ.run("Close All"); """ Power=getTag("DAC2_561-Volts"); Gain=getTag("Hamamatsu_DCAM-EMGain"); AcqTime=getTag("Exposure-ms")...
{ "content_hash": "464ac98ec09a5790460fefc81914c2f6", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 50, "avg_line_length": 22.048780487804876, "alnum_prop": 0.5929203539823009, "repo_name": "moosekaka/macros-for-imageJ", "id": "48a10e6e71ee807e203934aa0cd33c3caa042f1b", "...
import six import unittest import bmemcached from bmemcached.exceptions import MemcachedException if six.PY3: from unittest import mock else: import mock class TestMemcachedErrors(unittest.TestCase): def testGet(self): """ Raise MemcachedException if request wasn't successful and w...
{ "content_hash": "7dd512353e448974e7e7681ef2e947f7", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 95, "avg_line_length": 42.66129032258065, "alnum_prop": 0.6264650283553875, "repo_name": "xmonster-tech/python-binary-memcached", "id": "fedd9dabd5d2480793668eaf317b7c0d5fa36...
""" Copyright 2012 Ali Ok (aliokATapacheDOTorg) 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 wr...
{ "content_hash": "ee390bc49758be9afe803d44d80d35ab", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 201, "avg_line_length": 47.04929577464789, "alnum_prop": 0.7747343212093998, "repo_name": "aliok/trnltk", "id": "3b729949134ea98c4fbba75bca15fd8570289491", "size": "6696",...
# Form implementation generated from reading ui file 'LearningSetup.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dial...
{ "content_hash": "30c788e49248dc0343ca6d11444f9c46", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 120, "avg_line_length": 79.67357512953367, "alnum_prop": 0.7511543213890876, "repo_name": "CODEJIN/HNet_on_Tensorflow", "id": "ee48de9428dbe265f004cdb96d888e57b25a184d", "...
"""Generate Graph Embedding using Node2Vec.""" import os from absl import app from absl import flags from absl import logging import utils # pylint: disable=g-bad-import-order import utils_gcs # pylint: disable=g-bad-import-order FLAGS = flags.FLAGS flags.DEFINE_string('gcs_path_in', None, 'gcs bucket input dir...
{ "content_hash": "e0a73fa32317f82aad33de0af61869ac", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 76, "avg_line_length": 38.733333333333334, "alnum_prop": 0.6970740103270223, "repo_name": "google-research/social_cascades", "id": "0e65e6471564d108bd5e0edf11006e7d0fee93ac",...
import os import unittest from microflack_common.test import FlackTestCase os.environ['FLASK_CONFIG'] = 'test' from app import app class UITests(FlackTestCase): def setUp(self): self.ctx = app.app_context() self.ctx.push() self.client = app.test_client() def tearDown(self): ...
{ "content_hash": "0844dd7c80623b161e7b68ad87766e04", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 66, "avg_line_length": 21.04, "alnum_prop": 0.6216730038022814, "repo_name": "miguelgrinberg/microflack_ui", "id": "4d1c24f7d5afd389c42edfda34943ffec79fdb6a", "size": "548"...
import traceback from cStringIO import StringIO from lxml import etree as ET from lxml import etree import datetime import logging.handlers import logging from foam.config import LOGDIR, LOGLEVEL, LOGFORMAT lhandle = logging.handlers.RotatingFileHandler('%s/gapi-actions.log' % (LOGDIR), maxBytes=1000000) lhandle.setL...
{ "content_hash": "7ba4b8991172c8c52b29ed8266998ee5", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 119, "avg_line_length": 31.180505415162454, "alnum_prop": 0.6535255296978117, "repo_name": "dana-i2cat/felix", "id": "519929b3b929f9fd0f5a751f7d493b2d0b5792a6", "size": "1...
""" Run all test cases. """ import sys import unittest from test.test_support import requires, verbose, run_suite # When running as a script instead of within the regrtest framework, skip the # requires test, since it's obvious we want to run them. if __name__ <> '__main__': requires('bsddb') verbose = False if '...
{ "content_hash": "5675cf1e26aaed9f6b5fdae254662bc6", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 24.393939393939394, "alnum_prop": 0.5850931677018634, "repo_name": "MalloyPower/parsing-python", "id": "cd6ccc6053ccb467d6a54864a79e0c5aad59887a", "s...
from __future__ import print_function from builtins import range #!/usr/bin/env python #--------------------------------------------------------------------------- # Copyright 2013 The Open Source Electronic Health Record Agent # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this f...
{ "content_hash": "f64ae707c4ed3acc04ef8c7256cf9880", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 76, "avg_line_length": 32.54545454545455, "alnum_prop": 0.6443202979515829, "repo_name": "josephsnyder/VistA", "id": "457219f8d4dfd94b8e86c6a8570abcae5525b62d", "size": "21...
""" Example of using ImageIndicator class. """ from ggame.mathapp import MathApp from ggame.indicator import ImageIndicator from ggame.inputpoint import InputImageButton from ggame.asset import Frame BUTTON = InputImageButton( "images/button-round.png", None, (40, 105), positioning="physical", fra...
{ "content_hash": "8d309543eb5123f8a6e075f81a5ff7a4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 58, "avg_line_length": 20.666666666666668, "alnum_prop": 0.6806451612903226, "repo_name": "tiggerntatie/ggame", "id": "78de0e54909e18443c6363059723b2a3d496ce87", "size": "6...
import sys, os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.append(os.path.abspath('.')) # General configuration # --------------------- # Add any Sphinx extension module nam...
{ "content_hash": "e9160f1f6cc1126888a99036c6157ebb", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 81, "avg_line_length": 31.166666666666668, "alnum_prop": 0.717315139221833, "repo_name": "fluidinfo/flimp", "id": "17999a682f345e9af05cfa455e11716a922263db", "size": "6002...
import json from urllib.request import urlopen from bs4 import BeautifulSoup from request_handler import RequestHandler # Takes in a url and returns a soup def get_soup(url): html = urlopen(url).read() return BeautifulSoup(html, 'html.parser') # Takes a string and returns the substring after pre and befor...
{ "content_hash": "7eacc240877ec5a89b5c21f360430967", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 109, "avg_line_length": 29.78787878787879, "alnum_prop": 0.6683621566632757, "repo_name": "BenjaminLang/cpen_321", "id": "7553fafecb99e6e4f67e7cbf38a170545909cfa8", "size":...
""" Django settings for file_upload 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 ...
{ "content_hash": "3b15849efc1e7c763b7b5cd94c13b39b", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 95, "avg_line_length": 25.04635761589404, "alnum_prop": 0.6181914331041777, "repo_name": "grschafer/django-meetup-fileupload", "id": "9bf261817735da80e95c1cb1d739e1916c8f86a...
import tensorflow as tf filename_queue = tf.train.string_input_producer([ "hdfs://hdfs:9000/hdfs/file1.csv", "hdfs://hdfs:9000/hdfs/file2.csv", ]) reader = tf.TextLineReader() key, value = reader.read(filename_queue) # Default values, in case of empty columns. Also specifies the type of the # decoded result. rec...
{ "content_hash": "539e87e88a3d39efba505c359b3cb66a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 28.689655172413794, "alnum_prop": 0.6935096153846154, "repo_name": "Resly/pipeline", "id": "8165d6252957c9ba7fac5321b9ea62bb6c48345c", "size": "832",...
import json import math import numpy as np import pandas as pd from sklearn.metrics import mean_squared_error, mean_absolute_error import google.datalab.bigquery as bq from . import _util class Metrics(object): """Represents a Metrics object that computes metrics from raw evaluation results.""" def __init__(se...
{ "content_hash": "a0f0b1f36593af9a59f873a24158780b", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 97, "avg_line_length": 34.49234135667396, "alnum_prop": 0.6092114445219818, "repo_name": "googledatalab/pydatalab", "id": "0d93ec439896d95a4b1de06e1fe25d184cbd4413", "size...
from unit_test_common import execute_csv2_command, initialize_csv2_request, ut_id, sanity_commands, parameters_commands from sys import argv # lno: UV - error code identifier. def main(gvar): if not gvar: gvar = {} if len(argv) > 1: initialize_csv2_request(gvar, selections=argv[1]) ...
{ "content_hash": "0fa1e64d28b7799e1b1d9baf90f227a3", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 181, "avg_line_length": 40.678082191780824, "alnum_prop": 0.5633945108604143, "repo_name": "hep-gc/cloudscheduler", "id": "72260d03aae52dbdec3aec3e31cbc3fbe9a2f079", "size...
"""generate_gradient.py ~~~~~~~~~~~~~~~~~~~~~~~ Use network2 to figure out the average starting values of the gradient error terms \delta^l_j = \partial C / \partial z^l_j = \partial C / \partial b^l_j. """ #### Libraries # Standard library import json import math import random import shutil import sys sys.path.appe...
{ "content_hash": "9fc760e02725d1d7d6a11ef3997552c8", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 75, "avg_line_length": 32.33613445378151, "alnum_prop": 0.6273388773388774, "repo_name": "seanpquig/study-group", "id": "296aa95c918bfa5e0508836afcbd400eb23be435", "size":...
from numpy import * import matplotlib.pyplot as plt from csv import DictReader def getData(path): out = [] reader = DictReader(open("./DATA/Video_Games_Sales_as_at_22_Dec_2016.csv", "rt", encoding="utf-8")) for row in reader: out.append(row) #print(row) return out def joinData(rawDAT...
{ "content_hash": "0000dad3bad6cd3410f8fdb6c7215de2", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 133, "avg_line_length": 30.673596673596673, "alnum_prop": 0.5410736071573811, "repo_name": "klemenStanic/PR17KSLK", "id": "c10603c7f3f266c9a3ecd6b674b5b47fb60f0e24", "size...
from __future__ import print_function from six.moves import range import numpy as np __all__ = [ 'predict_RAM_usage', 'convert_to_num', 'convert_to_bin' ] def binarization(array): # Takes a binary-class datafile and turn the max value (positive class) # into 1 and the min into 0 array = np.a...
{ "content_hash": "d03dec8722563d3a2e0b93dedbe08ad0", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 30.02857142857143, "alnum_prop": 0.6289248334919124, "repo_name": "hmendozap/auto-sklearn", "id": "dd95a0be4015a441630cf74312328e3725014388", "size":...
import os.path import json import platform import re import uuid import helix.depcheck import helix.logs import helix.proc import helix.saferequests from helix.cmdline import command_main from helix.io import fix_path, zip_directory, add_file_to_zip from helix.platformutil import is_windows from helix_test_execution ...
{ "content_hash": "b021a1c57809a765aac1a012572f7552", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 119, "avg_line_length": 46.564625850340136, "alnum_prop": 0.581300219138057, "repo_name": "joperezr/buildtools", "id": "ccd65182f0107217b8607b920c6a86aabb2280d0", "size": ...
from tests import clear_staging_env, staging_env, eq_, ne_, is_, staging_directory from tests import _no_sql_testing_config, env_file_fixture, script_file_fixture, _testing_config from alembic import command from alembic.script import ScriptDirectory from alembic.environment import EnvironmentContext from alembic impor...
{ "content_hash": "84b026a84ac7b82d29074ed2803f48f7", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 96, "avg_line_length": 32.73717948717949, "alnum_prop": 0.5641276679067946, "repo_name": "shadowmint/py-test-watcher", "id": "fd9a7ed74aeb4eb06e52a7491a94df1657479031", "s...
""" Created on Wed Jan 6 12:01:11 2021 @author: akeeste I'm creating this script to serve as a parsed down version of the CASE.py + call_capy.py scripts. Hopefully this better highlights the necessities for running Capytaine without the wrapper, which is convenient but harder to read through. Also see: Capytain...
{ "content_hash": "c8310f7303a4da58e7eb11e38dc045e7", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 84, "avg_line_length": 36.666666666666664, "alnum_prop": 0.6217008797653959, "repo_name": "WEC-Sim/WEC-Sim", "id": "7e9db176584c53d442acbb5a9b92c723d05489ef", "size": "3434...
from flask import jsonify from . import api @api.errorhandler (403) def not_found (e): response = jsonify ({'error': 'forbidden'}) response.status_code = 403 return response
{ "content_hash": "8122c26fffc4c6efb81ba19bc559a1fd", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 21, "alnum_prop": 0.6825396825396826, "repo_name": "lanig35/flask-app", "id": "ea0bdfba89189e63f376401339a2ace094d77188", "size": "231", "binary": f...
import config import gettext import os import re import shlex import subprocess import sys from Cheetah.Template import Template from ovirt_engine import configfile, java, service def _(m): return gettext.dgettext(message=m, domain='ovirt-engine') class Daemon(service.Daemon): _JBOSS_VERSION_REGEX = re.co...
{ "content_hash": "751c292b07e80c3b7109de3cef708729", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 79, "avg_line_length": 31.348088531187123, "alnum_prop": 0.47586649550706034, "repo_name": "yingyun001/ovirt-engine", "id": "10b82c18e3ec7088e0c7d05d2fdee946c8a07f5b", "si...
from glance.api import CONF import glance.db.registry.api from glance.db.sqlalchemy import api from glance.db.sqlalchemy import models as db_models import glance.tests.functional.db as db_tests from glance.tests import functional from glance.tests.functional.db import base def get_db(config): config(sql_connectio...
{ "content_hash": "11d7644d98f43a767bcbc24fb7db03e3", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 70, "avg_line_length": 31.708333333333332, "alnum_prop": 0.6434515987735436, "repo_name": "SUSE-Cloud/glance", "id": "8ada2f0c0a2795a31851c329f218d4de75dbae60", "size": "29...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Clinic_history', fields=[ ...
{ "content_hash": "65b9be7206ea13cdb162ce33b696c7c0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 153, "avg_line_length": 42.95744680851064, "alnum_prop": 0.5720653789004457, "repo_name": "nanomolina/JP", "id": "314f1ec2b1bf70258ccf3fe70a354b0be89aca26", "size": "2091",...
"""A program to train a tensorflow neural net parser from a conll file.""" import base64 import os import os.path import random import time import tensorflow as tf from tensorflow.python.framework import errors from tensorflow.python.platform import gfile from tensorflow.python.platform import tf_logging as loggin...
{ "content_hash": "5af49164bf266d79a6882b8f138296bf", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 80, "avg_line_length": 37.45989304812834, "alnum_prop": 0.6922198429693076, "repo_name": "jiaphuan/models", "id": "3952d62e891d56df6e4859df53c79d6615211802", "size": "7682...
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ # While this couples the geographic forms to the GEOS library, # it decouples from database (by not importing SpatialBackend). from django.contrib.gis.geos import GEOSException, GEOSGeometry, froms...
{ "content_hash": "734564d53af62e1072fe62fd98974356", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 111, "avg_line_length": 34.99212598425197, "alnum_prop": 0.6266876687668766, "repo_name": "ZhaoCJ/django", "id": "55b887a445232bb8672dee16aa70ed8be173ca36", "size": "4444"...
from runner.koan import * # # Package hierarchy of Python Koans project: # # contemplate_koans.py # koans/ # __init__.py # about_asserts.py # about_attribute_access.py # about_class_attributes.py # about_classes.py # ... # a_package_folder/ # __init__.py # a_module.py class...
{ "content_hash": "1a63bcdaacdd1bac0dd908c18452984a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 81, "avg_line_length": 35.535714285714285, "alnum_prop": 0.6422110552763819, "repo_name": "dewaka/python-koans", "id": "934abc34fb8916bf804ebb086dc52bc091b6e969", "size": "...
import requests from bs4 import BeautifulSoup from time import sleep import pdfkit import os.path url = r'https://automatetheboringstuff.com' path=r'./wkhtmltopdf.exe' extrapath = r"C:\Users\lenovo\Documents\Vinay Python\github\Automate with python/" config = pdfkit.configuration(wkhtmltopdf=path) f = open('...
{ "content_hash": "9fa2b40a8e174490b6de0f01c60ece70", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 82, "avg_line_length": 31.70967741935484, "alnum_prop": 0.6103763987792472, "repo_name": "Vinay26k/python", "id": "0a8fd9938baff0a587df94cca8dd0ae29ebcb174", "size": "1011"...
from __future__ import absolute_import, division, print_function, \ with_statement import os import sys import hashlib import logging from shadowsocks.common import ord def create_obfs(method): return plain(method) obfs_map = { 'plain': (create_obfs,), 'origin': (create_obfs,), } class plai...
{ "content_hash": "3ee0225106e8061dcfc0436a949b7d74", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 80, "avg_line_length": 22.295454545454547, "alnum_prop": 0.5861365953109072, "repo_name": "Cherrysaber/shadowsocksr", "id": "2b943ac2607ee0b5f4ab39d2419d3c336a85b2c1", "siz...
""" WSGI config for budget_tracker project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "budget_tracker.settings") from...
{ "content_hash": "351e1f368783a38eca7d8f55277a4063", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.785714285714285, "alnum_prop": 0.7766749379652605, "repo_name": "Codeidea/budget-tracker", "id": "bfd63741045b8da0c9f78527cc3a47ab026426bc", "size...
""" The framework plugin. """ import json from cli.exceptions import CLIException from cli.mesos import get_frameworks from cli.plugins import PluginBase from cli.util import Table PLUGIN_NAME = "framework" PLUGIN_CLASS = "Framework" VERSION = "v0.1.0" SHORT_HELP = "Interacts with the Mesos Frameworks" class Fr...
{ "content_hash": "b962f742c24641a76564f3229bc7f957", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 78, "avg_line_length": 27.148936170212767, "alnum_prop": 0.5270376175548589, "repo_name": "reneploetz/mesos", "id": "5ba04ef88a67cf1716bf2e72ef1cfe43fdf956e8", "size": "333...
from dart.engine.redshift.mappings import mapped_column_definition from dart.engine.redshift.metadata import RedshiftActionTypes def get_target_schema_and_table_name(action, dataset): schema_name = action.data.args.get('target_schema_name') or 'public' table_name = action.data.args.get('target_table_name') or...
{ "content_hash": "aed73d0d24b935804f0054562df6d0f3", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 141, "avg_line_length": 50.74603174603175, "alnum_prop": 0.6912730685017203, "repo_name": "RetailMeNotSandbox/dart", "id": "082c6296437c6d7f6cfbd53114506c3096e45f99", "size...
from __future__ import division from django.conf import settings from django.db import models from django.db import transaction from django.db.models import Q from django.template import defaultfilters from django.utils import timezone from datetime import datetime from uchicagohvz.overwrite_fs import OverwriteFileSys...
{ "content_hash": "ca297391dcee299cf4ef9b1fe4a8e58d", "timestamp": "", "source": "github", "line_count": 613, "max_line_length": 183, "avg_line_length": 32.20554649265905, "alnum_prop": 0.703424171816432, "repo_name": "kz26/uchicago-hvz", "id": "e9539ec213c15342ae924701f100018c32bce7b3", "size": "19...
import numpy as np import unittest import GPyOpt from GPyOpt.util.general import samples_multidimensional_uniform from base_test_case import BaseTestCase class TestInputWarpedGP(BaseTestCase): ''' Unittest for the InputWarpedGP functions ''' def setUp(self): ## # -- methods configu...
{ "content_hash": "0cd54e29aa3c0177a0befd4601e87e85", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 134, "avg_line_length": 39.674698795180724, "alnum_prop": 0.44397206194959005, "repo_name": "SheffieldML/GPyOpt", "id": "2691524f18ff42446f75534ddfddd0135f49044d", "size": ...
import kfp import json import copy from kfp import components from kfp import dsl from kfp.aws import use_aws_secret sagemaker_workteam_op = components.load_component_from_file('../../../../components/aws/sagemaker/workteam/component.yaml') sagemaker_gt_op = components.load_component_from_file('../../../../components/...
{ "content_hash": "98c6fff232c13269044e7a5ca5200866", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 134, "avg_line_length": 45.210144927536234, "alnum_prop": 0.6986696585991344, "repo_name": "kubeflow/kfp-tekton-backend", "id": "cba865328f65b4385a5ee9df3132febe4c035ba7", ...
import mock from oslo_serialization import jsonutils from requests import Response from vbclient.common import display from vbclient.common import manager from vbclient.common import resource as r from vbclient.common import utils from vbclient.v1 import job_mgr from vbclient.v2 import backup_mgr # fake request id fr...
{ "content_hash": "db063791e03da605e7ac4a2c96d4a5c9", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 28.12280701754386, "alnum_prop": 0.670617592014972, "repo_name": "Huawei/OpenStackClient_VBS", "id": "abad1233096688ceb2b98f76ab6d786557567f83", "si...
def main (): # User inputs her first last mother madian city name firstName = (input("Please enter you First name: ")) lastName = (input("Please enter you Last name: ")) madName = (input ("Please enter your mothers maiden name: ")) city = (input("Please enter you City name: ")) # Program prints s...
{ "content_hash": "e5d69b906f82a436030a374d87d7a48b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 31.3125, "alnum_prop": 0.6307385229540918, "repo_name": "cynthiacarter/Week-Three-Assignment", "id": "3c57e2535072c78ad493c613d0025d6a359e398b", "siz...
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import logging import threading import voluptuous a...
{ "content_hash": "6fae674548a287c68b6bd26d6122c9b1", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 79, "avg_line_length": 30.54368932038835, "alnum_prop": 0.6443102352193262, "repo_name": "Duoxilian/home-assistant", "id": "b8999ee2c43b739c3302f252e345f4bba1333836", "siz...
import random import time class User: def __init__(self): self.identifier = str(random.randrange(2**64)) self.timestamp = time.time()
{ "content_hash": "ff8951d38e46cf071f7accb9c66b6658", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 54, "avg_line_length": 25.5, "alnum_prop": 0.6405228758169934, "repo_name": "analogbit/barbatus", "id": "c6683b3aba413c7d9bee5dfd4372dda2185d2e16", "size": "153", "binary"...
"""Contains the definition for inception v2 classification network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from nets import inception_utils slim = tf.contrib.slim trunc_normal = lambda stddev: tf.truncated_normal_initia...
{ "content_hash": "81470dad71959358372d7b02bbdd3585", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 90, "avg_line_length": 51.123161764705884, "alnum_prop": 0.4940850742511956, "repo_name": "fisheess/modular_SSD_tensorflow", "id": "0bb2832695acd7d0cfdf6ee22cb8d968a979a8f7"...
from __future__ import print_function from future.utils import viewitems import itertools import csv import exampleIO import dedupe import os import time import random import optparse import logging from collections import defaultdict optp = optparse.OptionParser() optp.add_option('-v', '--verbose', dest='verbose', a...
{ "content_hash": "d97ed372375b2e501152cc0b03b1c6c7", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 75, "avg_line_length": 28.182608695652174, "alnum_prop": 0.6417772292502314, "repo_name": "tfmorris/dedupe", "id": "55a6f98d51a8a7a522ae6fb87797ad5abae08f4d", "size": "328...
from __future__ import absolute_import from django import template register = template.Library() @register.filter(name='abs') def absolute_value(value): try: return abs(int(value)) except (ValueError, TypeError): return ''
{ "content_hash": "5985a76f447e839d4bdece464cb0016f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 38, "avg_line_length": 18, "alnum_prop": 0.6746031746031746, "repo_name": "littleweaver/django-argus", "id": "321635ac4435517c46e8023625cf576619516b0b", "size": "252", "b...
import os from functools import lru_cache from django.core.checks import Warning, register from willow.image import Image @lru_cache() def has_jpeg_support(): wagtail_jpg = os.path.join(os.path.dirname(__file__), 'check_files', 'wagtail.jpg') succeeded = True with open(wagtail_jpg, 'rb') as f: ...
{ "content_hash": "9a6e61cf490925317a2f043e42a06165", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 92, "avg_line_length": 23.964912280701753, "alnum_prop": 0.5834553440702782, "repo_name": "torchbox/wagtail", "id": "9f8311d0094410dbe502c8daca5b0df252ce7e14", "size": "136...
"""The tests for the TTS component.""" from http import HTTPStatus from unittest.mock import PropertyMock, patch import pytest import voluptuous as vol from homeassistant.components import media_source, tts from homeassistant.components.demo.tts import DemoProvider from homeassistant.components.media_player import ( ...
{ "content_hash": "69a68345904a81206cfe5934485b58da", "timestamp": "", "source": "github", "line_count": 792, "max_line_length": 112, "avg_line_length": 33.08838383838384, "alnum_prop": 0.6359612302526139, "repo_name": "mezz64/home-assistant", "id": "f521cbda58d516c1b2aa67e3a768045262b0da3c", "size"...
from __future__ import annotations from django.test import TestCase from hc.lib.string import replace class StringTestCase(TestCase): def test_it_works(self): result = replace("$A is $B", {"$A": "aaa", "$B": "bbb"}) self.assertEqual(result, "aaa is bbb") def test_it_ignores_placeholders_in_...
{ "content_hash": "b9615f2e83dabd76c9aaec364467d3a1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 64, "avg_line_length": 32.69565217391305, "alnum_prop": 0.5930851063829787, "repo_name": "healthchecks/healthchecks", "id": "a20280144d339aa9512678fb601a14d9056d76a2", "siz...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = ''' author: NetApp Ansible Team (@carchi8py) <ng-ansibleteam@netapp.com> des...
{ "content_hash": "14daa77a38ad76bb142112a5a3cca5a0", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 118, "avg_line_length": 42.97594501718213, "alnum_prop": 0.6349752118982889, "repo_name": "SergeyCherepanov/ansible", "id": "4bf15982084dba59c079cc2696b2f2f11235cab9", "si...
from __future__ import print_function import os import shutil import sys class WrongExtension(Exception): pass def splitext(filename): # not using os.path.splitext as it would return .gz instead of .tar.gz for ext in ".tar.gz", ".exe": if filename.endswith(ext): return filename[:-len...
{ "content_hash": "b224b7c2a426581034caa2de4c201496", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 29.209302325581394, "alnum_prop": 0.6337579617834395, "repo_name": "cloudify-cosmo/cloudify-manager", "id": "317e69110ca93c3e270dca6e354bf7668a14e320",...
from __future__ import print_function import os from catkin_tools.argument_parsing import add_cmake_and_make_and_catkin_make_args from catkin_tools.argument_parsing import add_context_args from catkin_tools.context import Context def prepare_arguments(parser): parser.description = "This verb is used to config...
{ "content_hash": "fd36267d218e09026d19b594a1cb2bea", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 117, "avg_line_length": 49.08108108108108, "alnum_prop": 0.6897944199706314, "repo_name": "xqms/catkin_tools", "id": "dd9bd26b39fbd6b9fdc260fb4d0b40c49d3d907f", "size": "6...
import mock from ec2api.tests.unit import base from ec2api.tests.unit import fakes from ec2api.tests.unit import matchers from ec2api.tests.unit import tools class SnapshotTestCase(base.ApiTestCase): def test_describe_snapshots(self): self.cinder.volume_snapshots.list.return_value = [ fakes....
{ "content_hash": "088c2e97ae7e97fb72a4b479dddd3388", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 74, "avg_line_length": 40.84057971014493, "alnum_prop": 0.6022001419446416, "repo_name": "vishnu-kumar/ec2-api", "id": "1f6b590d5cf66f19299b827e6ee371421c19bf9c", "size": ...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "06b0c20d798650f534ee2d626aa0fe4f", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 88, "avg_line_length": 32.816326530612244, "alnum_prop": 0.5677860696517413, "repo_name": "onshape-public/onshape-clients", "id": "e1afa5739f4a836e8a2c4d2b0e1eab5f309bcc9c",...
''' Wrapper for ark-tweet-nlp ''' import subprocess import shlex import os from django.conf import settings import logging class POSTagger(object): def __init__(self, callback): self._log = logging.getLogger("POSTagger") self.tagger_command = os.path.expanduser(settings.POS_TAGGER['command']) ...
{ "content_hash": "910f4c4e32c84746951b75d7216e6fd6", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 114, "avg_line_length": 33.59756097560975, "alnum_prop": 0.5720508166969147, "repo_name": "FrankGrimm/text-insights", "id": "dded78cff0185c0c96b65ae8a6bee92d3354d7b2", "siz...
from __future__ import unicode_literals from __future__ import absolute_import import datetime import json import logging import os import random import re import sys import time import Queue import threading import shelve import uuid import urllib2 from geopy.geocoders import GoogleV3 from pgoapi import PGoApi from ...
{ "content_hash": "bff9003aa739b35781035beba8eca1dd", "timestamp": "", "source": "github", "line_count": 1778, "max_line_length": 188, "avg_line_length": 36.70809898762655, "alnum_prop": 0.5105796191030689, "repo_name": "goedzo/PokemonGo-Bot", "id": "accc1ffc419dd8b4ffe4848bae32daf73d1df1b6", "size"...
"""Test file to display the error message and verify it with FileCheck.""" # RUN: %p/saved_model_error | FileCheck %s from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys from absl import app import tensorflow.compat.v2 as tf if hasattr(tf, 'enable_...
{ "content_hash": "aed7c7d0549bb9d0c4ae4e3a3a2353c4", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 114, "avg_line_length": 32.22222222222222, "alnum_prop": 0.6719827586206897, "repo_name": "arborh/tensorflow", "id": "322330f1b9b945ecc6db42d49434dace5c5b8fb3", "size": "30...
"""Migration for a given Submitty course database.""" def up(config, database, semester, course): """ Run up migration. :param config: Object holding configuration details about Submitty :type config: migrator.config.Config :param database: Object for interacting with given database for environme...
{ "content_hash": "6885323494c7d1afcf272c2ac686162f", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 110, "avg_line_length": 36.083333333333336, "alnum_prop": 0.7205542725173211, "repo_name": "Submitty/Submitty", "id": "491699f8e4d47893e3e5ee5661274f798a5ac2d2", "size": "1...
__version__ = '0.1.3' try: import uwsgi except ImportError: uwsgi = None try: import cPickle as pickle except ImportError: import pickle default_app_config = 'django_uwsgi.apps.DjangoUwsgiConfig'
{ "content_hash": "fca447cff08c557657ba83d8023cb84e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 15.428571428571429, "alnum_prop": 0.6990740740740741, "repo_name": "brente/django-uwsgi", "id": "de8fad83c6e05c70bb92f7046b4f2ce2b7a0c476", "size": "...
import logging from string import split from Functions import all, formatIntList, formatInt def ipAdrStrToInt( adrStr ): """ Convert a dotted ip address to 32 bit integer. """ adrParts = split( adrStr, ".", 3 ) return (int(adrParts[0]) << 24) + (int(adrParts[1]) << 16) + (int(adrParts[2]) << 8) +...
{ "content_hash": "0bfb5ba3bded99389c038a75becf7f0d", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 108, "avg_line_length": 31.838541666666668, "alnum_prop": 0.6100114510060527, "repo_name": "tectronics/admiral-jiscmrd", "id": "f032f1e069fb1062355126868be608876bf4c590", ...
'''active twoq mixins''' from collections import deque from contextlib import contextmanager from stuf.utils import clsname from twoq.queuing import ThingsMixin, ResultMixin __all__ = ('AutoQMixin', 'ManQMixin', 'AutoResultMixin', 'ManResultMixin') class BaseQMixin(ThingsMixin): '''base active things''' ...
{ "content_hash": "417e5afcd926ea1973719a9248c9e595", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 79, "avg_line_length": 30.846153846153847, "alnum_prop": 0.48794679966749793, "repo_name": "lcrees/twoq", "id": "3987655b1c5c41aca9e543a745c425673ab03479", "size": "9648",...