text
stringlengths
4
1.02M
meta
dict
import bandit from bandit.core.test_properties import * @checks('Call') def request_with_no_cert_validation(context): if ( 'requests' in context.call_function_name_qual and ( 'get' in context.call_function_name or 'post' in context.call_function_name) ): if context.che...
{ "content_hash": "fdcc24a73068911b42591a383a4acb97", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 31.666666666666668, "alnum_prop": 0.5729323308270676, "repo_name": "austin987/bandit", "id": "d0273bdbd123caa2912d781bf926c8b8d9ffd142", "size": "129...
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='Abode', fields=[ (...
{ "content_hash": "82daaebfbb9471907b246008ae9686d2", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 159, "avg_line_length": 41.861111111111114, "alnum_prop": 0.5491041804910418, "repo_name": "novafloss/populous", "id": "d8933a5459dc668d3788d51d6142a1b2ec7fddd0", "size": "...
""" Created on Tue Aug 20 18:13:37 2019. @author: tageldim """ import os import sys import pytest from imageio import imread from pandas import read_csv from histomicstk.annotations_and_masks.annotation_and_mask_utils import \ delete_annotations_in_slide from histomicstk.annotations_and_masks.masks_to_annotation...
{ "content_hash": "8f00267ad951c8e55748a763cde1f879", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 106, "avg_line_length": 39.68627450980392, "alnum_prop": 0.6009552042160737, "repo_name": "DigitalSlideArchive/HistomicsTK", "id": "fd7fb9ded6fa8a9061f3e496e6ceaa983cde8da3"...
__author__ = "Mateusz Kobos [email protected]" from vipe.oozie.reader.reader import read as oozie_read from vipe.oozie.converter.converter import convert as oozie_convert from vipe.oozie.converter.iis import IISPipelineConverter from vipe.graphviz.converter import Converter as PipelineConverter from vipe.graphviz.imag...
{ "content_hash": "bc817c8c5d579afb9fc7c015c1bb82da", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 80, "avg_line_length": 40.03703703703704, "alnum_prop": 0.6304347826086957, "repo_name": "openaire/vipe", "id": "6b8549a5800a2ee1b521ddf7b3d3535a39265a73", "size": "2752", ...
from hk2.types import enum, flags, flags_seq import unittest #=========================================================== @enum class DayOfWeek(object): Monday, Tuesday, Wednesday, \ Thursday, Friday, Saturday, Sunday = range(7) #=========================================================== class TestEnum(un...
{ "content_hash": "d83c1ea55cda83e4bb73035d790ab5db", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 65, "avg_line_length": 27.238636363636363, "alnum_prop": 0.5561118064246975, "repo_name": "mikhtonyuk/pyhk2", "id": "cca090d49879773779d91e7f9d0f7ca63eec4662", "size": "239...
import cherrypy import datetime import re import six from .. import base from girder import events from girder.constants import AccessType, SettingKey def setUpModule(): base.startServer() def tearDownModule(): base.stopServer() class UserTestCase(base.TestCase): def _verifyAuthCookie(self, resp): ...
{ "content_hash": "f4b79b7797bec06c34ddaa193ec37edd", "timestamp": "", "source": "github", "line_count": 651, "max_line_length": 80, "avg_line_length": 39.50230414746544, "alnum_prop": 0.5694898117903251, "repo_name": "chrismattmann/girder", "id": "e15b139777e51fc978fa8584ffc07f427f379847", "size": ...
from django.apps import AppConfig class AuthConfig(AppConfig): name = 'daiquiri.auth' label = 'daiquiri_auth' verbose_name = 'User Profiles' def ready(self): from . import handlers
{ "content_hash": "66aeffbd5cf9882fcac46cf7d687ecc7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 34, "avg_line_length": 20.8, "alnum_prop": 0.6682692307692307, "repo_name": "aipescience/django-daiquiri", "id": "977e85920f0c238c1d187199c8478da4b847d890", "size": "208", ...
""" Pyinvoke tasks.py file for automating releases and admin stuff. Author: Shyue Ping Ong """ import datetime import glob import json import os import re import subprocess import webbrowser import requests from invoke import task from monty.os import cd from pymatgen.core import __version__ as CURRENT_VER @task d...
{ "content_hash": "96e0cdf7e529f03f70bf303810478981", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 118, "avg_line_length": 29.443708609271525, "alnum_prop": 0.5467836257309941, "repo_name": "richardtran415/pymatgen", "id": "5d3257c7495bf0fed6bbef9a89b727bb23399714", "si...
import string from django.contrib import messages from django.shortcuts import render from django.views import generic from . import models from target.target import makeTarget from target.utils import saveTargetImage from django import forms from django.http import HttpResponseRedirect, Http404 from django.urls impor...
{ "content_hash": "7dbe7a7cc63c73b598ddfe97fb4e8373", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 83, "avg_line_length": 32.60406091370558, "alnum_prop": 0.5536353728787171, "repo_name": "groundupnews/gu", "id": "d41c886ad4ccf62c086fcaa613d954e342976ed9", "size": "6423...
from django import forms from OpenDataCatalog.suggestions.models import * class SuggestionForm(forms.Form): text = forms.CharField(widget=forms.Textarea(), max_length=255, label="My Nomination")
{ "content_hash": "15773775c204bec3f297fc4f4a3d7ea4", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 90, "avg_line_length": 29.428571428571427, "alnum_prop": 0.7621359223300971, "repo_name": "azavea/Open-Data-Catalog", "id": "5b0a7538f153758d4a1120c67b46d1d5b2d5113e", "size...
""" Utility functions for reading MITgcm mds files (.meta / .data) """ # python 3 compatiblity from __future__ import print_function, division import re import os import numpy as np import warnings from functools import reduce from dask import delayed import dask.array as dsa from dask.base import tokenize def parse_...
{ "content_hash": "162779fa97d819167d2c81ce31ff4d82", "timestamp": "", "source": "github", "line_count": 529, "max_line_length": 91, "avg_line_length": 37.25897920604915, "alnum_prop": 0.5636225266362253, "repo_name": "sambarluc/xmitgcm", "id": "dbabb2de3d48d8dfd2aa0d67ac103a6d89a9de69", "size": "19...
from microservice.tests.microservice_test_case import MicroserviceTestCase from microservice.core import settings from microservice.tests import microservices_for_testing class TestZeroMode(MicroserviceTestCase): @classmethod def setUpClass(cls): super(TestZeroMode, cls).setUpClass() settings...
{ "content_hash": "c0ada6e3fb8080604ca5865ecc716709", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 74, "avg_line_length": 33.875, "alnum_prop": 0.6369003690036901, "repo_name": "MartinHowarth/microservice", "id": "edd325cba1fd9d08556b3830c0a4c925a843e9f9", "size": "1355"...
__all__ = ['Project', 'Experiment', 'Result', 'Variation', 'Goal', 'Audience'] import json import urllib class ResourceGenerator(object): def __init__(self, client=None, resource=None): if client is None: raise ValueError('Must specify client.') if resource is None: raise...
{ "content_hash": "2f918ce2354638574763ce2d16922286", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 104, "avg_line_length": 30.081632653061224, "alnum_prop": 0.5527815468113976, "repo_name": "wlowry88/optimizely-client-python", "id": "1b114f10d8e57e33272e4052f2ec294aeb14b2...
from __future__ import unicode_literals import tensorflow as tf WIDTH = HEIGHT = 8 CHANNELS = 12 FILTERS = 10 KERNEL_SIZE = 3 STRIDES = [1, 1] PADDING = 'SAME' DENSE_HIDDEN_UNITS = 2048 KAPPA = 10.0 # Emphasizes f(p) = -f(q) class ChessConvolutionalNetwork(object): def __init__(self, learning_rate, adam_eps...
{ "content_hash": "ffac532c95afa084022ca726845ab90e", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 100, "avg_line_length": 36.92727272727273, "alnum_prop": 0.5950270802560315, "repo_name": "srom/chessbot", "id": "38f0752cac2d33e6e720468fc750c40f016c3d8a", "size": "4062"...
import numpy as np import time import tree_utils from Bio import Seq, SeqRecord from Bio.Align import MultipleSeqAlignment, AlignInfo from Bio.Alphabet import generic_dna, generic_protein from node_ranking import node_ranking verbose = True aa_codes = { 'A':('Ala', 'Alanine'), 'R':('Arg', 'Arginine'), 'N':('Asn', 'As...
{ "content_hash": "5f523e0d2d2060e1bc2797fef85952f6", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 111, "avg_line_length": 40.50566037735849, "alnum_prop": 0.5813303521520402, "repo_name": "rneher/FitnessInference", "id": "70bf00a6b66f1947eb716f5f3c192b91994f17ad", "siz...
from lucy.models import LucyObject class Binary(LucyObject): _type = 'binaries' def __init__(self, job, arch, suite, binaries, builder, **kwargs): from lucy.models.job import Job job = Job.load(job) if job['package_type'] != 'source': raise ValueError("Package from Job isn...
{ "content_hash": "13897d0c6e8ed5de4dd779fdd894677f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 33.333333333333336, "alnum_prop": 0.496, "repo_name": "paultag/lucy", "id": "fd545b71bbeb12e69fefb117ac32c3bd65a7c5af", "size": "1000", "binary": f...
from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset from django import forms from campaign.models.user import Squadron class SquadronForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(...
{ "content_hash": "30bef140b257bc7a665f7a2bcbf4287a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 60, "avg_line_length": 27.975609756097562, "alnum_prop": 0.5658238884045336, "repo_name": "sheepeatingtaz/hotac-tracker", "id": "87a045311e82243112f570223fabe75865aa0559", ...
from pprint import pprint from fo2.connections import db_cursor_so from base.views import O2BaseGetPostView import produto.forms as forms import produto.queries as queries class Custo(O2BaseGetPostView): def __init__(self, *args, **kwargs): super(Custo, self).__init__(*args, **kwargs) self.For...
{ "content_hash": "b7290f9d83eae6d601a3a2aa66c5f54c", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 78, "avg_line_length": 37.072463768115945, "alnum_prop": 0.5013682564503519, "repo_name": "anselmobd/fo2", "id": "6de8a0a6b7d4c987dae1a2867b179b70ad9cd527", "size": "5130"...
from __future__ import annotations import hashlib import json import os from typing import Sequence import pre_commit.constants as C from pre_commit.hook import Hook from pre_commit.languages import helpers from pre_commit.prefix import Prefix from pre_commit.util import CalledProcessError from pre_commit.util import...
{ "content_hash": "3f31436bd3e9d67df3dafa8ea07178a2", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 109, "avg_line_length": 32.20422535211268, "alnum_prop": 0.6374371309862235, "repo_name": "pre-commit/pre-commit", "id": "eea9f7682917928b78dd669d172f0bd8841c807a", "size"...
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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 a...
{ "content_hash": "78135234bb7d1df55c2fae89daa9068a", "timestamp": "", "source": "github", "line_count": 731, "max_line_length": 116, "avg_line_length": 37.16005471956225, "alnum_prop": 0.5653070240023561, "repo_name": "RNAcentral/rnacentral-webcode", "id": "b5e2163a099317c3c2f77c8ac70c681b4bc978b7", ...
import random from slackbot.bot import listen_to from plugins.parameters import EMOJI_NAME, ATSUMORI_PROBABILITY, NORMAL_PROBABILITY @listen_to('.*') def listen_func(message): if random.random() < ATSUMORI_PROBABILITY: message.react(EMOJI_NAME) if random.random() < NORMAL_PROBABILITY: ...
{ "content_hash": "10063f9a9e97c582d24120d615f0a116", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 83, "avg_line_length": 30.142857142857142, "alnum_prop": 0.6824644549763034, "repo_name": "yamasakih/atsumori-slack-bot", "id": "8a194612f6745012c2d7c4954adb480beedde255", ...
""" A Hyper-V Nova Compute driver. """ import platform from nova.virt import driver from oslo_log import log as logging from oslo_utils import excutils from hyperv.i18n import _ from hyperv.nova import eventhandler from hyperv.nova import hostops from hyperv.nova import livemigrationops from hyperv.nova import migra...
{ "content_hash": "592485a1ee5d0df7f4eba831089dbe17", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 79, "avg_line_length": 43.4236641221374, "alnum_prop": 0.5773050892150831, "repo_name": "adelina-t/compute-hyperv", "id": "8bb5aec4c77a2d5933d151b8eb9c5c01b82980a8", "size...
try: from cms.plugins.text.models import AbstractText except ImportError: from djangocms_text_ckeditor.models import AbstractText from django.db.models import CharField from django.utils.translation import ugettext_lazy as _ class Footnote(AbstractText): symbol = CharField(_('symbol'), max_length=10, blan...
{ "content_hash": "dbbcdc05e7cfdccb66234f3a79816273", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 73, "avg_line_length": 33.8125, "alnum_prop": 0.6876155268022182, "repo_name": "BertrandBordage/cmsplugin-footnote", "id": "9e3b5dc7a04a2c1c39314342037f2f89fba06b29", "size...
from django.test import TestCase from .models import Client, Contact class ClientTestCase(TestCase): def setUp(self): Client.objects.create(name='Test Starbucks', address='Felipe รngeles 225') Client.objects.create(name='Test OXXO', address='Reforma 190') def test_client_names(self): ...
{ "content_hash": "3e8c9f234cc266f79ba0f5708f280e9a", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 94, "avg_line_length": 40.20454545454545, "alnum_prop": 0.6529112492933861, "repo_name": "fernandolobato/balarco", "id": "c482b62acf6a8d200f996bb19349c403bc62087b", "size":...
import argparse import sys import warnings import numpy as np import skimage.io import skimage.color import skimage.util from sklearn.decomposition import PCA, NMF, FastICA, FactorAnalysis convOptions = { 'hed2rgb' : lambda img_raw: skimage.color.hed2rgb(img_raw), 'hsv2rgb' : lambda img_raw: skim...
{ "content_hash": "f2b5ef29f4cfe9b6a5f9477ec1d2e51b", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 142, "avg_line_length": 70.58620689655173, "alnum_prop": 0.6487542745481192, "repo_name": "BMCV/galaxy-image-analysis", "id": "b5141cb40f2ce3028d9b4dab1448b88f6ae72216", "s...
"""Views for Timeline. """ __authors__ = [ '"Sverre Rabbelier" <[email protected]>', '"Lennard de Rijk" <[email protected]>', '"Pawel Solyga" <[email protected]>', ] from django import forms from soc.logic import dicts from soc.logic.models import program as program_logic from soc.views.helpe...
{ "content_hash": "1d888a2b0be7ca67df9eea4be46654f7", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 73, "avg_line_length": 26.82857142857143, "alnum_prop": 0.6602768903088392, "repo_name": "SRabbelier/Melange", "id": "18b1b2c996ca87bfaaa50f02f433e7d2bfa98ab5", "size": "24...
__title__ = 'candemaker' __description__ = 'Tools for creating CANDE input files (.cid).' __url__ = 'https://github.com/Ricyteach/candemaker' __version__ = '0.0.1' __author__ = 'Rick Teachey' __author_email__ = '[email protected]' __license__ = 'BSD' __copyright__ = 'Copyright 2017 Rick Teachey' __keywords__ = 'ci...
{ "content_hash": "f32d80f52fa37838fdb490cafed4fc5f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 64, "avg_line_length": 37.333333333333336, "alnum_prop": 0.6517857142857143, "repo_name": "Ricyteach/candemaker", "id": "cc76941778c7afc80e7e2f4d521403ad3c2c60f7", "size": "...
""" Sponge Knowledge Base Action metadata Record type """ def createBookType(name): return RecordType(name, [ IntegerType("id").withNullable().withLabel("Identifier"), StringType("author").withLabel("Author"), StringType("title").withLabel("Title") ...
{ "content_hash": "1dd2692bafead202e8b578b865cb0a6f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 93, "avg_line_length": 32.464285714285715, "alnum_prop": 0.6072607260726073, "repo_name": "softelnet/sponge", "id": "c7353d3222d70c87a71f6b54ac09d2b7be9e1f0f", "size": "909...
import re import npc from npc.character.tags import TagContainer from npc.character import Werewolf from mako.template import Template from markdown import Markdown def template_output(character, header_level=3): template_path = str(npc.settings.InternalSettings().get('listing.templates.html.character.werewolf')) ...
{ "content_hash": "812205c6a3e76cf721a4fbcb07ab246f", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 114, "avg_line_length": 38.584158415841586, "alnum_prop": 0.6540928919681807, "repo_name": "aurule/npc", "id": "20fee8b1bc235a54472d6f20dd9fb046e744d23d", "size": "7794", ...
import json import os import sys import unittest from api_data_source import (_JSCModel, _FormatValue, _GetEventByNameFromEvents) from branch_utility import ChannelInfo from extensions_paths import CHROME_EXTENSIONS from fake_host_file_system_provider import Fa...
{ "content_hash": "bc07a70e0701bb86436864b504dee1b1", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 80, "avg_line_length": 35.94845360824742, "alnum_prop": 0.5758531689131058, "repo_name": "patrickm/chromium.src", "id": "e842576f633e2a6bdc6f37f6529fc99318ade7a0", "size":...
''' Simple pull of account info ''' import requests import datetime import pickle import json import time import sys account_url = 'https://api.toodledo.com/3/account/get.php?access_token=' tasks_get_url = 'https://api.toodledo.com/3/tasks/get.php?access_token=' ''' Fields you can use to filter when you get tasks: ht...
{ "content_hash": "6ca577f50f901418aa18f5f6303e260d", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 143, "avg_line_length": 32.567796610169495, "alnum_prop": 0.6885245901639344, "repo_name": "gadeleon/toodledo_cli_client", "id": "c923c871088626efd096d2ec8fe327555a5ee4ad", ...
from IPython.display import Image import sys # ## Weighting functions in the $CO_2$ 15 $\mu m$ absorption band # Below is a plot of radiance (or intensity) (left axis) and brightness temperature (right axis) vs. wavenumber near the main $CO_2$ absorption band. Wavenumber is defined as $1/\lambda$; the center of the...
{ "content_hash": "b84c76b3120ce33d9d789b95639994b4", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 914, "avg_line_length": 34.318548387096776, "alnum_prop": 0.6832334625778405, "repo_name": "a301-teaching/a301_code", "id": "30de6af0786a1330cedc66cd9cf159d820f502bd", "si...
from distutils.core import setup setup(name='nlcd', packages=['nlcd'], version='0.2', description='This library provides some helpers related to the National Land Cover Database (NLCD). The NLCD is created by the Multi-Resolution Land Characteristics Consortium (MRLC) and is available at: https://ww...
{ "content_hash": "04ae6d6395cf964041b6edd95c32c3d0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 234, "avg_line_length": 48.84615384615385, "alnum_prop": 0.6755905511811023, "repo_name": "jzmiller1/nlcd", "id": "4a4b7fb6c2c25d40555b47728da0cfd005106311", "size": "635",...
'''Jamenson Compiler Front End ''' from __future__ import absolute_import from __future__ import with_statement from hlab.pathutils import FilePath from optparse import OptionParser from .util import err, msg, vmsg, vemit, set_verbosity, get_prog_name, evaling_context from ..compiler.util import timing from ..compil...
{ "content_hash": "386520a415c0f51c7e557696e2950a23", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 94, "avg_line_length": 34.10434782608696, "alnum_prop": 0.5915349311575727, "repo_name": "matthagy/Jamenson", "id": "e1ee1204f8bf6b80a71430b8fb5cb1f6474037b2", "size": "39...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1Contain...
{ "content_hash": "9f3e89554406cb3becc8f9ce029bbddd", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 202, "avg_line_length": 29.261603375527425, "alnum_prop": 0.5674116798846431, "repo_name": "mbohlool/client-python", "id": "7f13e602d59322c507a71ad2a35c66750c1b37c7", "siz...
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import taggit.managers import django_extensions.db.fields import django_extensions.db.fields.json class Migration(migrations.Migration): dependencies = [ ('taggit', '0001_initial'), ] o...
{ "content_hash": "895a4b96b0ff6859c8bca072903c5076", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 182, "avg_line_length": 56.11851851851852, "alnum_prop": 0.5789334741288279, "repo_name": "shawnhermans/cyborgcrm", "id": "16d2746de3a91218b1dfd51bfa91147e8cf3735e", "size...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('members', '0013_merge_20170811_1500'), ] operations = [ migrations.AlterModelOptions( name='member', options={'permissions': (('api_...
{ "content_hash": "7801dc6b1912ddeed07f3d750cd5a270", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 394, "avg_line_length": 40.529411764705884, "alnum_prop": 0.6502177068214804, "repo_name": "onepercentclub/bluebottle", "id": "319a60e98faead39ec658108adce0b928750b6c5", "s...
import unittest import numpy as np import flavio import math s = 1.519267515435317e+24 ps = 1e-12*s class TestIntegrate(unittest.TestCase): def test_nintegrate(self): # integrate sin(x) from 0 to 2 xmin = 0 xmax = 2 val = 2*math.sin(1)**2 self.assertAlmostEqual(flavio.math...
{ "content_hash": "f2e05fe552d195947ddeac0edd4f3f14", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 112, "avg_line_length": 29.352941176470587, "alnum_prop": 0.6793587174348698, "repo_name": "flav-io/flavio", "id": "7d44e335e7873cdc8248702dee61dc9cedda19ee", "size": "499"...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: influxdb_user short_description: Manage InfluxDB users descr...
{ "content_hash": "4cfb2d1295b1b0dd7b5b031d2c881388", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 111, "avg_line_length": 31.19685039370079, "alnum_prop": 0.6091620393740536, "repo_name": "thaim/ansible", "id": "ed0728cbfa0cca7edc10a28b76f3c5aa5240ae1e", "size": "8172"...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PasswordReset' db.create_table('accounts_passwordreset', ( ('id', self.gf('django.db.models.fiel...
{ "content_hash": "68610273daea1473ec11481ba0226ce4", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 182, "avg_line_length": 62.018181818181816, "alnum_prop": 0.5696276751685723, "repo_name": "softak/webfaction_demo", "id": "c59837656e70bb0d95eb72abf7174b7bb84e1372", "siz...
from collections import namedtuple, OrderedDict from itertools import islice from allele import Allele import matplotlib.pyplot as plt import pandas as pd import numpy as np import matplotlib import os, argparse, gzip, csv, pprint """ Command line parsers """ parser = argparse.ArgumentParser() parser.add_argument("fil...
{ "content_hash": "4e8d6f91e865c7fe31848a37f6e16a23", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 101, "avg_line_length": 30.355704697986578, "alnum_prop": 0.5827990271943401, "repo_name": "ukirik/giggle", "id": "7e8d7cc243073d27b5556f334e817e8cc312b94c", "size": "4523...
import asyncio import contextlib import datetime import os # noqa import pathlib import pickle import re import warnings from collections import defaultdict from http.cookies import BaseCookie, Morsel, SimpleCookie from typing import ( # noqa DefaultDict, Dict, Iterable, Iterator, List, Mappin...
{ "content_hash": "82da8c95a90babdf7bb9e42215159d17", "timestamp": "", "source": "github", "line_count": 417, "max_line_length": 87, "avg_line_length": 32.798561151079134, "alnum_prop": 0.5396651312422315, "repo_name": "KeepSafe/aiohttp", "id": "f519fff8dd7cd76d5f4800d9b5dafd428cf19133", "size": "13...
""" MoinMoin - OpenID preferences @copyright: 2007 MoinMoin:JohannesBerg @license: GNU GPL, see COPYING for details. """ from MoinMoin import wikiutil, user from MoinMoin.widget import html from MoinMoin.userprefs import UserPrefBase import base64 class Settings(UserPrefBase): def __init__(self,...
{ "content_hash": "f0a8014f55bcfea95529ab49c8bc0686", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 97, "avg_line_length": 33.473214285714285, "alnum_prop": 0.5822886102960789, "repo_name": "RealTimeWeb/wikisite", "id": "4d7489c25395ac1d428884482040ea8c784e69a3", "size":...
import django.contrib.postgres.indexes import django.contrib.postgres.search from django.db import migrations from django.contrib.postgres.search import SearchVector def update_full_name_dni_host_name(apps, schema_editor): model = apps.get_model('visitors', 'Visitor') model.objects.update( full_name_d...
{ "content_hash": "6ab4fc3af17a53aaa6ca422d8531ac93", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 86, "avg_line_length": 31.2, "alnum_prop": 0.6355311355311355, "repo_name": "aniversarioperu/django-manolo", "id": "96e606a1dbd0696b673e9d77591766926981f726", "size": "1141...
import os import os.path import pickle import vincent DATA_DIR = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "data") ) DATA_FILE = os.path.join(DATA_DIR, "python-versions.pkl") JOB_NAME = os.path.splitext(os.path.basename(__file__))[0][5:] JSON_FILE = os.path.join(DATA_DIR, "{}.json".format...
{ "content_hash": "ca9947faa8835f27aae2c056d9718a44", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 20.966666666666665, "alnum_prop": 0.6629570747217806, "repo_name": "dstufft/pypi-stats", "id": "6388a2ca86ce831b0e13e78851fa9d45ab278563", "size": "1...
from __future__ import (absolute_import, division, print_function, unicode_literals) from collections import namedtuple import webcolors GdalFormat = namedtuple(typename='GdalFormat', field_names=['name', 'attributes', 'description', ...
{ "content_hash": "d3edee7d74f1ca98667d295d0e0a4a21", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 76, "avg_line_length": 32.06, "alnum_prop": 0.5274485339987524, "repo_name": "ecometrica/gdal2mbtiles", "id": "c03d94754523d8c7f0659076f7cb465a6014aa6f", "size": "3993", ...
""" Slactorbot - A Python Slack Bot with hot patch! """ import os import re from setuptools import find_packages, setup def fread(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def get_version(): VERSIONFILE = "slactorbot/_version.py" verstrline = fread(VERSIONFILE).strip() ...
{ "content_hash": "81ad14b98459a3c10ec375f599e10419", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 84, "avg_line_length": 28.192307692307693, "alnum_prop": 0.6186903137789904, "repo_name": "dataloop/slactorbot", "id": "3e43b0046d95a69aaf3e5d71b6b05845e2af5135", "size": "...
from django.db import models from django.conf import settings class Profile(models.Model): """ This model establishes the structure of the Profile model. """ def __str__(self): """ This will display in string format the name of the edu object """ fn = self.user.get_fu...
{ "content_hash": "7d5c085b9a1af1987f50e3fa43ce1228", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 74, "avg_line_length": 29.336633663366335, "alnum_prop": 0.6382045224434695, "repo_name": "ilikesounds/jt_portfolio", "id": "4d8724092aae216c1b56a680103773d86e56d225", "si...
class TypeRegistry: def __init__(self): self.data = {} def registry(self, model_cls, record_type): self.data[model_cls] = record_type def __iter__(self): return self.data.items().__iter__() def __getitem__(self, item): return self.data[item] def get_type(self, obj...
{ "content_hash": "5f2ae23be9620c393da7f65eef85f53a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 47, "avg_line_length": 22.428571428571427, "alnum_prop": 0.5796178343949044, "repo_name": "watchdogpolska/feder", "id": "60b00fd101d1d4b825849037f91280a27c76083b", "size": ...
from collections import OrderedDict import pytest from crosspm.helpers.output import Output from crosspm.helpers.package import Package @pytest.fixture(scope="function") def package(): params = {'arch': 'x86', 'osname': 'win', 'package': 'package'} params_found = {'repo': 'lib-cpp-release', 'version': '1.2....
{ "content_hash": "fdb483c27c549b827707684fb6f11b6f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 92, "avg_line_length": 35.0188679245283, "alnum_prop": 0.6330818965517241, "repo_name": "devopshq/crosspm", "id": "78f1f511888652ce62594ee6228900c874cde094", "size": "1856"...
from data_models import government_models from data_models.government_models import DonationRecipient from utils import entity_resolver resolver = entity_resolver.MasterEntitiesResolver() #test_entry = "Lord na Lester" #test_entry = "The Rt Hon Vincent Cable MP" #test_entry = "Michael Denzil Xavier Portillo" test_ent...
{ "content_hash": "e6784bd2bfcc39018bf5dce3b0dce0df", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 71, "avg_line_length": 30.102040816326532, "alnum_prop": 0.6827118644067797, "repo_name": "spudmind/undertheinfluence", "id": "b48dfd3388bb9afafb6695304525fa6dc4368034", "s...
import typing def find_missing_services( ecs, cluster: str, services: typing.Set[str] ) -> typing.Set[str]: """Return a set of service names which don't exist in AWS. We use `ECS.Client.describe_services` since we have a list of service names we want to check and instead of just retrieving all servic...
{ "content_hash": "514ae33c03d75d4b1263dcf2e3935296", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 35, "alnum_prop": 0.6739495798319328, "repo_name": "LabD/ecs-deplojo", "id": "136abe5e2d8e378abd95074c37462db0ec1cd429", "size": "1190", "binary": ...
""" Test TorchRankerAgent. """ import os import pytest import unittest import parlai.utils.testing as testing_utils from parlai.tasks.integration_tests.agents import CandidateTeacher class _AbstractTRATest(unittest.TestCase): """ Test upgrade_opt behavior. """ @classmethod def setUpClass(cls): ...
{ "content_hash": "c54cd4f4676a4ee5e815243d7f60e387", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 87, "avg_line_length": 33.8390243902439, "alnum_prop": 0.5975205420210465, "repo_name": "facebookresearch/ParlAI", "id": "b911713f2ab8400b7e3133f596ee3e54319eaec8", "size"...
from __future__ import absolute_import, division, print_function import sys import argparse import potsim def main(): parser = argparse.ArgumentParser(description='Run an audio file through ' 'a simulated POTS line') parser.add_argument('infile', type=str, help='Input file. Type inferred fr...
{ "content_hash": "7018eca7731177c224abdb4c83775ddc", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 77, "avg_line_length": 29.263157894736842, "alnum_prop": 0.637589928057554, "repo_name": "nicktimko/pots-sim", "id": "45895216e3c4439545238edf5dee4905ec59ada8", "size": "11...
class B: pass class C(B): pass class D(C): pass for c in [B, C, D]: try: raise c() except D: print "D" except C: print "C" except B: print "B" for c in [B, C, D]: try: raise c() except B as b: print "B ",str(b),str(B) # every excepti...
{ "content_hash": "00122d23bcecaf18802630db217f096e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 70, "avg_line_length": 17.771428571428572, "alnum_prop": 0.5321543408360129, "repo_name": "loafdog/loaf-src", "id": "ef9c6d8cdfc486f467a855476126907fbf14a657", "size": "641...
""" Author: Marco Dinacci <[email protected]> License: BSD World Editor TODO * to deal with entities I need an Entity Manager (see also multifiles). It's ok to have multiple references but there must be only a single place where to manage them. * (re)code everything to use an EventManager (see taskMgr) -...
{ "content_hash": "c8fd823cb4bfc54638cd37a462b7338a", "timestamp": "", "source": "github", "line_count": 655, "max_line_length": 91, "avg_line_length": 34.149618320610685, "alnum_prop": 0.6192328326180258, "repo_name": "mdinacci/rtw", "id": "28109bf120a3a5bcbce8bc8b8f1ae812c7925b5b", "size": "22392"...
""" This is a random gaussian noise generator module type 2. This module generates the signal with oversampling=1 and then oversamples the signal to the wanted representation sampling frequency. |br| The generator is able to generate N random signals with a given min and max frequency components. |br| *Examples*: ...
{ "content_hash": "5a6916f0f89395e4f2de1c94771996ab", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 105, "avg_line_length": 36.531120331950206, "alnum_prop": 0.578032712403453, "repo_name": "JacekPierzchlewski/RxCS", "id": "0414441bab0eae4fefb0727228c9b0245dfdde14", "siz...
import rospy from threading import Timer from flexbe_core.logger import Logger class ProxyPublisher(object): """ A proxy for publishing topics. """ _topics = {} def __init__(self, topics={}, _latch=False, _queue_size=100): """ Initializes the proxy with optionally a given set of ...
{ "content_hash": "90e66cd2fd01e5cd32d4e7fe6ed95f67", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 114, "avg_line_length": 33.90909090909091, "alnum_prop": 0.5956617109432123, "repo_name": "team-vigir/flexbe_behavior_engine", "id": "9503d795ed3752b0ccd2fbb08731f558541b3f6...
from setuptools import setup, find_packages setup( version='4.2.0', name='vcdriver', description='A vcenter driver based on pyvmomi, fabric and pywinrm', url='https://github.com/Lantero/vcdriver', author='Carlos Ruiz Lantero', author_email='[email protected]', license='MIT', ...
{ "content_hash": "deb79351847f62f1bcb2581783fd2319", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 36.93103448275862, "alnum_prop": 0.61531279178338, "repo_name": "Lantero/vcenter-driver", "id": "5a009e1d0f18cc26579a7dfb5f26dbb196060e7a", "size": "...
import json from flask import Blueprint from flask import current_app from flask import make_response from flask import request from flask import render_template from flask import url_for from discograph import exceptions from discograph import helpers blueprint = Blueprint('ui', __name__, template_folder='templates...
{ "content_hash": "d30b66f7a7eeef439dcd87fad4eabf47", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 77, "avg_line_length": 32.64601769911504, "alnum_prop": 0.6457034426673895, "repo_name": "josiah-wolf-oberholtzer/discograph", "id": "ac2a57286b4f5b8563bbb92c0f36dad3453fd35...
from . import methods from .registry import write_elem, read_elem, get_spec, _REGISTRY
{ "content_hash": "ccfb290023dfcf9999337d5edc8d6154", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 64, "avg_line_length": 43.5, "alnum_prop": 0.7701149425287356, "repo_name": "theislab/anndata", "id": "162ecd77552f7c32126ce5af02e170a82160f69b", "size": "87", "binary": f...
from bs4 import element import re def calculate_density(text, max_line=80): regexp = "[^\W\d_]+" sum_len = len(text) lines = int(sum_len / max_line) if lines > 0: r = max_line * lines reduced_text = text[0:r] found = re.findall(regexp, reduced_text, re.UNICODE) word_den...
{ "content_hash": "d1ad04c20855c3ce02c777db9c5223ec", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 60, "avg_line_length": 25.384615384615383, "alnum_prop": 0.5963636363636363, "repo_name": "tgodzik/automatic-segmentation-tool", "id": "ec6434c4be3c3b825d2badd9679401cfe9db30...
from org.myrobotlab.opencv import OpenCVFilterAffine affine = OpenCVFilterAffine("affine") affine.setAngle(180.0) leftPort= "/dev/cu.wchusbserial1450" i01 = Runtime.start("i01","InMoov") headTracking = i01.startHeadTracking(leftPort) eyesTracking = i01.startEyesTracking(leftPort,10,12) i01.headTracking.addPreFilter(...
{ "content_hash": "7483f6dd35cc5d2b8fc465884640b725", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 52, "avg_line_length": 31.071428571428573, "alnum_prop": 0.8137931034482758, "repo_name": "MyRobotLab/pyrobotlab", "id": "f6679a9438ace769e12392db8c1124a0324e1f4e", "size":...
def find_pandigital_products(): pandigital = set(range(1,10)) for multiplicand in range(1,100): # find min/max multipliers that will produce a product of only 4 digits max_multiplier = 10**4/multiplicand min_multiplier = 1000 if multiplicand < 10 else 100 for multiplier in range...
{ "content_hash": "36f6354e6ca8c72ddf75c6c042454d43", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 36.80952380952381, "alnum_prop": 0.6015523932729625, "repo_name": "piohhmy/euler", "id": "18e51a72a49cf62629c9c42b6d1989e8d4b9a2c0", "size": "774", ...
""" Copyright (c) 2012 Giacomo Bagnoli <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, mer...
{ "content_hash": "4fd78f59d6d66645e90e6101f702bf43", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 79, "avg_line_length": 27.04, "alnum_prop": 0.5497041420118344, "repo_name": "gbagnoli/varnish-py", "id": "84b6b62fbd4a091a94d16ad9caf90635069322c7", "size": "6806", "bi...
"""Code as found in notebooks/semantic_similarity.ipynb.""" # Computing basic semantic similarities between GO terms # Adapted from book chapter written by _Alex Warwick Vesztrocy and Christophe Dessimoz_ # How to compute semantic similarity between GO terms. # First we need to write a function that calculates the ...
{ "content_hash": "541a37b4b1e13411ee4103237e9d0e0d", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 98, "avg_line_length": 43.93650793650794, "alnum_prop": 0.7117052023121387, "repo_name": "lileiting/goatools", "id": "87b3356764a18172f8b8d0e8b8048818ebf28c1a", "size": "27...
import argparse import json import os import re import urllib.request _REPO_URL = 'https://repo.maven.apache.org/maven2' _GROUP_NAME = 'org/jetbrains/kotlin' _MODULE_NAME = 'kotlin-stdlib-jdk7' _FILE_EXT = 'jar' _OVERRIDE_LATEST = None _PATCH_VERSION = 'cr1' def do_latest(): if _OVERRIDE_LATEST is not None: ...
{ "content_hash": "8ceee3425f4a5fc21f14ce8f50aabfd0", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 31.6, "alnum_prop": 0.5949367088607594, "repo_name": "chromium/chromium", "id": "f3317e1e1dc2a0f9dafc2f16006cd50b44d14129", "size": "2479", "binary...
""" Created on Tue Mar 1 20:19:04 2016 @author: nadiablago """ import os import shutil import subprocess import numpy as np abspath = os.path.dirname(__file__) SEXCONFIG = os.path.abspath(os.path.join(abspath, '../../config/daofind.sex')) if os.path.isfile(SEXCONFIG): print ('Found sextractor configuration fi...
{ "content_hash": "0c7e795f8b0b867021fb850bad321b65", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 155, "avg_line_length": 36.091603053435115, "alnum_prop": 0.5425126903553299, "repo_name": "nblago/utils", "id": "d89187fa8931064a13f73e5780d3529f5c749fac", "size": "4752"...
"""Helper functions for XKNX.""" from __future__ import annotations import asyncio import ipaddress import logging import socket from typing import cast import ifaddr from xknx.exceptions import XKNXException from .const import DEFAULT_MCAST_GRP, DEFAULT_MCAST_PORT logger = logging.getLogger("xknx.log") async de...
{ "content_hash": "ab634a214d01daf651c2fb667aa3bdc7", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 97, "avg_line_length": 36.171875, "alnum_prop": 0.6600431965442765, "repo_name": "XKNX/xknx", "id": "f242662bb06098d0c9bf5860bc38e9e73c07d0a7", "size": "2315", "binary": ...
import re import os import sys try: import IDF except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, # we need to set environment variable `TEST_FW_PATH`, # then get and insert `TEST_FW_PATH` to sys path before import FW module test_fw_path...
{ "content_hash": "5348e8fa890e9650edfbbf901ddcc384", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 102, "avg_line_length": 47.31481481481482, "alnum_prop": 0.6688845401174168, "repo_name": "krzychb/rtd-test-bed", "id": "0d161da4c272c91d48aa2b80fb91e378738f3c83", "size": ...
from display.handlers.base import BaseHandler class ExamplesProfileHandler(BaseHandler): def get(self): title = 'ExamplesProfileHandler' self.render('examples/profile.html', title = title, **self.render_dict)
{ "content_hash": "ce227715e774677f1e6d002f9ef7398e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 79, "avg_line_length": 38.166666666666664, "alnum_prop": 0.7336244541484717, "repo_name": "owlsn/h_crawl", "id": "b43a80c6381df0b8724debe783c3a4f93b7f398b", "size": "229", ...
import os import sys import datetime import pytest from msl.equipment import Config, constants, Backend from msl.equipment.record_types import RecordDict ROOT_DIR = os.path.join(os.path.dirname(__file__), 'db_files') def teardown_module(): import cleanup_os_environ cleanup_os_environ.cleanup() def test_d...
{ "content_hash": "c3f8f9d7547a8d8277454e814be303ae", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 127, "avg_line_length": 44.995215311004785, "alnum_prop": 0.6379200340280732, "repo_name": "MSLNZ/msl-equipment", "id": "d43133f0891b5df8bc254ff25e22f5ab42c59eb8", "size":...
import json import random import datetime from flask.ext.admin.contrib.mongoengine import ModelView from flask.ext.admin.contrib.fileadmin import FileAdmin as _FileAdmin from flask.ext.admin.babel import gettext, ngettext from flask.ext.admin import AdminIndexView from flask.ext.admin import BaseView as AdminBaseView ...
{ "content_hash": "0bd6a5f1d0763e8ca7a0f29bc23570e3", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 79, "avg_line_length": 33.202492211838006, "alnum_prop": 0.5808782135485082, "repo_name": "felipevolpone/quokka", "id": "6738496ce4ba493cc18f67c1314200398bdd06d3", "size":...
class Node(object): def __init__(self, parent, contribution, perct): self._children = [] self._parent = parent self._contribution = contribution self._perct = perct @property def children(self): return self._children @property def parent(self): retur...
{ "content_hash": "3bd62d52f2d15be0d8de12e5755af6d8", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 66, "avg_line_length": 25.272727272727273, "alnum_prop": 0.5667466027178257, "repo_name": "mozafari/vprofiler", "id": "36962c330776ffbe603b5c1ef07c2d70309d814e", "size": "2...
from twisted.internet import reactor, defer, task from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver # System Imports from collections import namedtuple # Package Imports from ..machine import Machine, Component, Property, Stream, ui from ..util import now from ..protocol i...
{ "content_hash": "bf2c4589b2ad0be7ba3da62a94a199c7", "timestamp": "", "source": "github", "line_count": 811, "max_line_length": 143, "avg_line_length": 28.76572133168927, "alnum_prop": 0.6587509108834498, "repo_name": "rasata/octopus", "id": "56dd3504cdeb0f3fea586a7c1dfc9f8e358c957e", "size": "2334...
import os from django.conf import settings from django.contrib.staticfiles.finders import BaseFinder from django.core.files.storage import FileSystemStorage logo_paths = { 'header_logo': settings.HEADER_LOGO, 'favicon': settings.FAVICON, } logofinder_results = { os.path.join(prefix, os.path.basename(path...
{ "content_hash": "c0f9daa7ddb5fdaf93b9d24e7a074353", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 91, "avg_line_length": 30.517241379310345, "alnum_prop": 0.6468926553672316, "repo_name": "c3nav/c3nav", "id": "d14b368ae20492898f3cfbc679fd739be9f5c952", "size": "1770", ...
import json from flask_login import AnonymousUserMixin import slot.db_fieldbook as db from . import models def convert_user_dict_to_user_instance(user_dict): return models.User(user_dict['username'], user_dict['password']) def return_user_instance_or_anonymous(thing): if type(thing) == type(dict()): ...
{ "content_hash": "a4d766a3509e35418ff7d875c4ccb183", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 31.523809523809526, "alnum_prop": 0.6608761329305136, "repo_name": "nhshd-slot/SLOT", "id": "a094a62c2d8c5a43899ab3f1eb335601b7c318e4", "size": "132...
""" Script to run the experiments described in: Julian Hough and David Schlangen. Joint, Incremental Disfluency Detection and Utterance Segmentation from Speech. EACL 2017. """ import sys import subprocess import os import urllib import zipfile import tarfile THIS_DIR = os.path.dirname(os.path.realpath(__file__)) sys...
{ "content_hash": "2b732cb4ead85163ba2b074c290217b9", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 79, "avg_line_length": 39.46715328467153, "alnum_prop": 0.6191973367856483, "repo_name": "dsg-bielefeld/deep_disfluency", "id": "c0e176ea49be0a5093881f934d997108d50f62db", ...
"""modoboa-stats tests.""" import datetime import os import shutil import tempfile from django.core.management import call_command from django.urls import reverse from django.test import override_settings from modoboa.admin import factories as admin_factories from modoboa.core import models as core_models from modob...
{ "content_hash": "8ec4741adc496078e0725250d6eef790", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 35.904761904761905, "alnum_prop": 0.6205238726790451, "repo_name": "modoboa/modoboa-stats", "id": "1db987de2eaa8ad9af4e3fb886808113126c6da2", "size"...
""" Copyright (C) 2012 Legoktm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublic...
{ "content_hash": "cacfc38c830b9da84ec0c2d205a3b2e6", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 106, "avg_line_length": 36.38823529411765, "alnum_prop": 0.646944713870029, "repo_name": "legoktm/pywikipedia-scripts", "id": "b45aae02881b9f3d5f4374a78b8cd0f5257c34fa", "s...
from tools import cli, service_instance parser = cli.Parser() parser.add_required_arguments(cli.Argument.UUID) parser.add_custom_argument('--instance', required=False, action='store_true', help="Flag to indicate the UUID is an instance UUID") parser.add_custom_argument('--description', requi...
{ "content_hash": "e1b4139fab548e21a5e6056986d86db3", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 96, "avg_line_length": 36.1, "alnum_prop": 0.6821329639889196, "repo_name": "vmware/pyvmomi-community-samples", "id": "e74b97b64b3591e108a89f636988d0e78b2e3dff", "size": "2...
from __future__ import unicode_literals from django.db import migrations def create_site(apps, schema_editor): Site = apps.get_model('sites', 'Site') Site.objects.create( id=1, domain='schools.texastribune.org', name='Texas Public Schools Explorer') class Migration(migrations.Migra...
{ "content_hash": "6bb1ebb304a18f1723578ea57673206c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 45, "avg_line_length": 19.91304347826087, "alnum_prop": 0.6353711790393013, "repo_name": "texastribune/scuole", "id": "9362f2b4865d9aeab928d0f18c66b1fd83bc78b7", "size": "5...
import logging import os import subprocess from common import SDK_ROOT from common import GetHostArchFromPlatform from common import GetHostToolPathFromPlatform def BuildIdsPaths(package_paths): """Generates build ids paths for symbolizer processes.""" return [ os.path.join(os.path.dirname(package_path), ...
{ "content_hash": "e64bed688ae0dfd01c6856d2b869abb2", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 65, "avg_line_length": 31.48780487804878, "alnum_prop": 0.6615027110766848, "repo_name": "scheib/chromium", "id": "67f19667adac2c571bd04b0995b3f8b284970545", "size": "1454"...
from __future__ import unicode_literals from django.db import models, migrations import django_markdown.models class Migration(migrations.Migration): dependencies = [ ('disease', '0011_allelecolor_description'), ] operations = [ migrations.CreateModel( name='SNPMarkerArticle...
{ "content_hash": "ec7768e3414c3690ddbf8a26371964b0", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 143, "avg_line_length": 39.916666666666664, "alnum_prop": 0.6346555323590815, "repo_name": "jiivan/genoomy", "id": "4db9d68c03b58d50f10831962badcc2405791ca2", "size": "982"...
from typing import List from pylint.exceptions import InvalidMessageError, UnknownMessageError class MessageIdStore: """The MessageIdStore store MessageId and make sure that there is a 1-1 relation between msgid and symbol.""" def __init__(self): self.__msgid_to_symbol = {} self.__symbol_to...
{ "content_hash": "b28131d194bf9835a8848c4ae7905dc1", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 113, "avg_line_length": 41.278688524590166, "alnum_prop": 0.6185464654487689, "repo_name": "ruchee/vimrc", "id": "9f4d4fd2a30c1d256b2cf39b827340d8d9411864", "size": "5185"...
from django.conf import settings from syncrae.events.event import Event from webdnd.player.models.roll import roll_text import logging logging = logging.getLogger('') class Terminal(object): def __init__(self, web): self.web = web def __call__(self, data): full_cmd = data.get('cmd') ...
{ "content_hash": "0bd00e2a1545d41e85aa0049b7d7c968", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 103, "avg_line_length": 27.864077669902912, "alnum_prop": 0.5017421602787456, "repo_name": "Saevon/syncrae", "id": "510b088d1a050ab636a3fca6dfa156138f0c8a64", "size": "287...
from __future__ import unicode_literals from indico.modules.designer.controllers import (RHAddCategoryTemplate, RHAddEventTemplate, RHCloneCategoryTemplate, RHCloneEventTemplate, RHDeleteDesignerTemplate, RHDownloadTempla...
{ "content_hash": "943f8eea83fb5c19f0305be44e379b4c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 120, "avg_line_length": 58.2, "alnum_prop": 0.6354264292408622, "repo_name": "mic4ael/indico", "id": "e49a83d648257838f07411437f80362d7586a10d", "size": "3415", "binary":...
import tkinter as tk from tkinter import Button import time import numpy as np from PIL import ImageTk, Image PhotoImage = ImageTk.PhotoImage UNIT = 100 # ํ”ฝ์…€ ์ˆ˜ HEIGHT = 5 # ๊ทธ๋ฆฌ๋“œ์›”๋“œ ์„ธ๋กœ WIDTH = 5 # ๊ทธ๋ฆฌ๋“œ์›”๋“œ ๊ฐ€๋กœ TRANSITION_PROB = 1 POSSIBLE_ACTIONS = [0, 1, 2, 3] # ์ขŒ, ์šฐ, ์ƒ, ํ•˜ ACTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)] #...
{ "content_hash": "4df6d281777d4d2cfb2c136ab26c0f65", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 85, "avg_line_length": 40.77049180327869, "alnum_prop": 0.5341777241656614, "repo_name": "rlcode/reinforcement-learning-kr", "id": "c6f7b6f49a3dd6e53137049187e86999e2878f70"...
from flask import jsonify, Blueprint status = Blueprint('status', __name__) @status.route('/_status') def get_status(): return jsonify( status="ok", ), 200
{ "content_hash": "4051b21a47421ac2cf4f827a9d538b88", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 16, "alnum_prop": 0.6193181818181818, "repo_name": "alphagov/notifications-delivery", "id": "dd3b912bfea3733c144781ae33168c9d29a3af18", "size": "176"...
import uuid import os import argparse import boto3 import botocore boto3_session = boto3.Session(profile_name='serverless-meow') client = boto3_session.client('s3') BUCKET = os.getenv('BUCKET_NAME') REGION = 'us-east-2' def upload_photo(photo_path): try: client.head_object(Bucket=BUCKET, ...
{ "content_hash": "404f92594efa63fee6ec7c16d5aea93a", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 128, "avg_line_length": 43.57534246575342, "alnum_prop": 0.6045268783401446, "repo_name": "ashimaathri/serverless-meow", "id": "8bdf1905454123aefb56ff73b03e312b4401c673", "...
import goPyServer as GP # Step2: Create a sample "ADD" which returns the sum of 2 numbers passed in parameters def ADD(arg1,arg2): return arg1+arg2 # Step3: Initialise the object of goPyServer obj = GP.pyServ(TCP_IP="127.0.0.1",TCP_PORT=9001,Listen=4,buff=1024) # Step4: Register the ADD method to the RPC Server ...
{ "content_hash": "370946f60cf1f0941ea9852604b5c6cc", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 86, "avg_line_length": 27.72222222222222, "alnum_prop": 0.7334669338677354, "repo_name": "chawlanikhil24/gopy", "id": "87f5e6275ad69441930119eb6b1f6555533933e6", "size": "5...
import _plotly_utils.basevalidators class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="marker", parent_name="choropleth.selected", **kwargs ): super(MarkerValidator, self).__init__( plotly_name=plotly_name, parent_nam...
{ "content_hash": "e1dcc1ff39535b02628ac86d5bac2ec7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 30.85, "alnum_prop": 0.5429497568881686, "repo_name": "plotly/plotly.py", "id": "48a15eec4d84997f5482a6bb7952b3d0289dc2f3", "size": "617", "binary"...
"""The tests for the Scene component.""" import io import unittest from homeassistant.setup import setup_component from homeassistant.components import light, scene from homeassistant.util.yaml import loader as yaml_loader from tests.common import get_test_home_assistant from tests.components.light import common as c...
{ "content_hash": "5465771f831a54f98158625899877c3d", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 76, "avg_line_length": 32.520325203252035, "alnum_prop": 0.548, "repo_name": "jabesq/home-assistant", "id": "94746cce0f00dc7e05ba8922e9647738aa5fdcf5", "size": "4000", "...
from __future__ import absolute_import from .orbit import OrbitCamera __all__ = ['OrbitCamera']
{ "content_hash": "355b2a840fdab4850162ddf5d863bd8b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 19.4, "alnum_prop": 0.7216494845360825, "repo_name": "colour-science/colour-analysis", "id": "f7bc420dc4e3bbaab862529a9e85906a778386f7", "size": "122"...
"""Dag sub-commands""" import ast import errno import json import logging import signal import subprocess import sys from typing import Optional from graphviz.dot import Dot from sqlalchemy.sql.functions import func from airflow import settings from airflow.api.client import get_current_api_client from airflow.cli.si...
{ "content_hash": "65dec8b248c71dc680e4311470d0479b", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 110, "avg_line_length": 31.39387308533917, "alnum_prop": 0.6094653934620479, "repo_name": "mistercrunch/airflow", "id": "2e537fb86ce6f7e7534b1a5ffdb2e5566c0b8b9f", "size":...
from enum import Enum from simplads.simplad_monad.delta_type import DeltaType from simplads.simplad_monad.namedtuples.bind_args import BindArgs from simplads.simplad_monad.namedtuples.delta_overwrite import DeltaOverwrite from simplads.simplad_monad.simplad_base_helper import SimpladBaseHelper from .namedtuples.error_r...
{ "content_hash": "9488c8eeeccf88f21f2545a0dc5965a9", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 88, "avg_line_length": 31.109375, "alnum_prop": 0.6750376695128076, "repo_name": "Cogmob/simplads", "id": "e9c943bf0598796ffc68b5b6da2a09a3132c5eaf", "size": "1991", "bin...
from __future__ import print_function, division from sympy import Symbol, sympify from sympy.core.compatibility import is_sequence, range, string_types from sympy.geometry.entity import GeometryEntity from .plot_interval import PlotInterval from .plot_object import PlotObject from .util import parse_option_string cl...
{ "content_hash": "17212f13f1da8168da378f85681ece4e", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 82, "avg_line_length": 35.413965087281795, "alnum_prop": 0.5199633828603619, "repo_name": "kaushik94/sympy", "id": "f902d8aeef934d13d1f0515fede3cc15622496be", "size": "142...
"""__init__.py The resumepy package. """ from .exceptions import resumepyException # noqa from .exceptions import CreateDirError # noqa from .exceptions import CreateFileError # noqa from .exceptions import DirError # noqa from .exceptions import FileError # noqa from .process import create_parser_letter from ....
{ "content_hash": "e9fe39b791dbddb4413e1d4e8305e128", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 58, "avg_line_length": 32.12, "alnum_prop": 0.7397260273972602, "repo_name": "cstrelioff/resumepy", "id": "3d10d88effbd81485458aa28961e1812ef536092", "size": "991", "bina...
r""" From my blog post: <http://tanghaibao.blogspot.com/2010/02/getting-phylogeny-from-list-of.html> Example: >>> mylist = [3702, 3649, 3694, 3880] >>> t = TaxIDTree(mylist) >>> print t (((Carica_papaya,Arabidopsis_thaliana)Brassicales,(Medicago_truncatula,Populus_trichocarpa)fabids)rosids); >>> t.print_tree() <BLANKL...
{ "content_hash": "50161a7cec6a654830a83784bf18a7d2", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 106, "avg_line_length": 23.434343434343436, "alnum_prop": 0.5987068965517242, "repo_name": "tanghaibao/jcvi", "id": "50435dceb6140304dc1e9b73fc83e3801c9260d7", "size": "46...
import os import logging import shutil logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) base_dir = os.path.dirname((os.path.realpath(__file__))) def get_user_desktop(): """ Find the user's desktop folder. :return: Path to user's desktop as a string """ ...
{ "content_hash": "a023fb5a4b87b76337fff2b90f2e96af", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 105, "avg_line_length": 30.244897959183675, "alnum_prop": 0.6558704453441295, "repo_name": "btnpushnmunky/pygallerycreator", "id": "ac51d7b80fa23e9ffb0da46c890c5c0d230acd5f",...