text
stringlengths
4
1.02M
meta
dict
""" pygaarst.hyperionutils Utility functions for processing Hyperion datasets Created by Chris Waigl on 2014-04-25. """ from __future__ import division, print_function import os import numpy as np def gethyperionbands(): """ Load Hyperion spectral band values into Numpy structured array. Source: http:/...
{ "content_hash": "6fc933e27684aa74c619322b6aeaa943", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 78, "avg_line_length": 28.253521126760564, "alnum_prop": 0.6390827517447657, "repo_name": "chryss/pygaarst", "id": "111599d9273627c031b0f62eedc39507aeab71cf", "size": "2022...
from PyQt4 import QtGui, uic import sys qtCreatorFile = "assetdetailW.ui" Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile) class AssetDetail(QtGui.QMainWindow, Ui_MainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) ...
{ "content_hash": "0c5956d239be73546a412f0b73c9956d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 77, "avg_line_length": 28.5, "alnum_prop": 0.6578947368421053, "repo_name": "nealchenzhang/EODAnalyzer", "id": "4c649f2e10ed9a70d84ef97c61e1faf53ea08d68", "size": "607", ...
"""Futures for long-running operations returned from Google Cloud APIs. These futures can be used to synchronously wait for the result of a long-running operation using :meth:`Operation.result`: .. code-block:: python operation = my_api_client.long_running_method() result = operation.result() Or asynchrono...
{ "content_hash": "68d5c0b21be00a4bcf514e404d7d8d90", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 79, "avg_line_length": 37.38275862068966, "alnum_prop": 0.6520616179319251, "repo_name": "jonparrott/gcloud-python", "id": "a97a137398a38764f323a82aa01861d6464a7fc7", "siz...
from __future__ import print_function from __future__ import absolute_import # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # import khmer...
{ "content_hash": "727990b60d3e6f1b21ff082557bb2827", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 74, "avg_line_length": 26.85593220338983, "alnum_prop": 0.564952140528032, "repo_name": "jas14/khmer", "id": "5afcb92671976e65885f23985db8a57b2974f44c", "size": "9507", ...
import numpy as np from astropy.modeling.models import Ellipse2D from astropy.stats import circvar import astropy.units as u from skimage.measure import find_contours import scipy.ndimage as nd from utils import ceil_int, eight_conn, robust_skewed_std from masking_utils import smooth_edges # from contour_orientation i...
{ "content_hash": "ea6c6fc047a79f1ae54455fe3392671b", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 79, "avg_line_length": 36.09657320872274, "alnum_prop": 0.5241218607059636, "repo_name": "e-koch/BaSiCs", "id": "86cedf2aa723a1a8a043bf0f35559e6c8f339016", "size": "11588"...
import webapp2 import cgi form=""" <form method="post"> What is your birthday? <br /> <label> Month <input type="text" name="month" value="%(month)s"> </label> <label> Day <input type="text" name="day" value="%(day)s"> </label> <label> Year <input type="text" name="year" value="%(year)s"> </label> <br ...
{ "content_hash": "cc7373e85758ea93e6becf590fce5f61", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 93, "avg_line_length": 22.294117647058822, "alnum_prop": 0.6131926121372032, "repo_name": "JaimeLynSchatz/project-stash", "id": "7b843c468b564f473a460eba36bfe8240ca517fc", ...
""" ========================================== Author: Tyler Brockett Username: /u/tylerbrockett Description: Alert Bot ========================================== """ from utils.env import env, BOT_USERNAME, DEV_USERNAME, SUBREDDIT GITHUB_HOME = 'https://github.com/tylerbrockett/Alert-Bot...
{ "content_hash": "2f350d1c7bc5a878f62243d6ba5956ee", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 126, "avg_line_length": 42.67279411764706, "alnum_prop": 0.5928319117773757, "repo_name": "tylerbrockett/reddit-bot-buildapcsales", "id": "cc8239bd4477accc544897652c0c3cdc93...
import constants class Topology: """ Represents the topology provided by the Cloud Controller """ def __init__(self): self.service_map = {} """ :type : dict[str, Service] """ self.initialized = False """ :type : bool """ self.json_str = None """ :type...
{ "content_hash": "4e232bc105146cd4100d6d14ab9b164c", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 119, "avg_line_length": 30.778675282714055, "alnum_prop": 0.5777346210371614, "repo_name": "asankasanjaya/stratos", "id": "fd40511756b9e6a0f9f989fcde6d9424b87fb9cb", "size...
import six from dns import zone as dnszone from webtest import TestApp from oslo_config import cfg from designate.api import admin as admin_api from designate.api import middleware from designate.tests.test_api.test_v2 import ApiV2TestCase cfg.CONF.import_opt('enabled_extensions_admin', 'designate.api.admin', ...
{ "content_hash": "112268e32e20360c9452d35ca49ec784", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 78, "avg_line_length": 41.66393442622951, "alnum_prop": 0.6283690733818611, "repo_name": "cneill/designate-testing", "id": "97493279e16248478326e7c49f678d124bd17018", "siz...
""" Tests for the archive subsys. With each configured driver. """ import os import pytest from anchore_engine.subsys import logger, object_store from anchore_engine.subsys.object_store import get_manager from anchore_engine.subsys.object_store.config import ( ALT_OBJECT_STORE_CONFIG_KEY, DEFAULT_OBJECT_STOR...
{ "content_hash": "9a194e424a622247978e2760ea4b986e", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 171, "avg_line_length": 30.863247863247864, "alnum_prop": 0.5414705067848241, "repo_name": "anchore/anchore-engine", "id": "3542cf1ef620bdf4afcb148863b333551b9d2ddd", "siz...
import collections import struct from supriya.tools.systemtools.SupriyaObject import SupriyaObject class SynthDefCompiler(SupriyaObject): ### CLASS VARIABLES ### __documentation_section__ = 'SynthDef Internals' ### PUBLIC METHODS ### @staticmethod def compile_synthdef(synthdef, name): ...
{ "content_hash": "e5a3ab5af76fd2c06b9e04cad1d4267d", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 90, "avg_line_length": 40.1044776119403, "alnum_prop": 0.6462597692593971, "repo_name": "andrewyoung1991/supriya", "id": "b6ec76317165d3fb85c333cbeeb64816847750ae", "size"...
u""" This module contains unsorted simple helper functions used in currency converter. """ __author__ = u"Pavol Vargovčík" __copyright__ = u"Copyright (c) 2017 Pavol Vargovčík" __credits__ = [u"Pavol Vargovčík"] __license__ = u"MIT" __version__ = u"0.1.0" __maintainer__ = u"Pavol Vargovčík" __email__ ...
{ "content_hash": "6c8ad76d4f4b548037bd9ccead2e304d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 25.303030303030305, "alnum_prop": 0.6455089820359281, "repo_name": "p4l1ly/currency_converter", "id": "4f5cc64dd4595c6c98ec10fe39a3a47db1aca828", "si...
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
{ "content_hash": "713973ae791e16052cfb9107e029cfaa", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 208, "avg_line_length": 30.692307692307693, "alnum_prop": 0.8074352548036758, "repo_name": "Kiesum/tfrs-1", "id": "1996b7b7dd7e4dde85e917c95b8ae503b6e31b5d", "size": "2394"...
import os.path, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) from time import sleep from PySiQ import Queue # ************************************************************************ # Initialize queue # *********************************************************************...
{ "content_hash": "4f8174f3ede7882ac99bd206baf51a94", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 85, "avg_line_length": 24.35820895522388, "alnum_prop": 0.5214460784313726, "repo_name": "fikipollo/PySiQ", "id": "2d5b0874f7b2b8b60e9ddde2f3275549dc50c00e", "size": "1632"...
from nfsn import NearlyFreeSpeechService from webfaction import WebFactionService services= [WebFactionService, NearlyFreeSpeechService] services_by_name= dict(((s.__name__,s) for s in services))
{ "content_hash": "bf54d34bbe9e84656a468b7923dbd16f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 58, "avg_line_length": 39.4, "alnum_prop": 0.8121827411167513, "repo_name": "bkonkle/update-ip", "id": "24f0c6c494f81e8ebac822ae3156cf6a71fdea70", "size": "197", "binary":...
import decimal import os from contextlib import contextmanager from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from unittest.mock import patch from configurations.values import (Value, BooleanValue, IntegerValue, FloatValue, DecimalValue, Li...
{ "content_hash": "81e7574236ba51a63580f94119bdc2bf", "timestamp": "", "source": "github", "line_count": 517, "max_line_length": 112, "avg_line_length": 41.59574468085106, "alnum_prop": 0.5622878400372007, "repo_name": "jezdez/django-configurations", "id": "2547e509e2e4ecf859e2b522e867d39fcf1cbaef", ...
#!/usr/bin/env python import sys import os import struct from collections import namedtuple import io import argparse parser = argparse.ArgumentParser() parser.add_argument('rootdir', type=str, help='the path to rootfs') parser.add_argument('output', type=argparse.FileType('wb'), nargs='?', help='output file name') ...
{ "content_hash": "556476365f574091df9775d65bc5e3a6", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 105, "avg_line_length": 30.913857677902623, "alnum_prop": 0.4986673128180276, "repo_name": "armink/rt-thread", "id": "9f4f24d0d67953ec783bccf4ff2a8d861682ace2", "size": "8...
import unittest from dataclasses import dataclass from pathlib import Path from typing import Any, Callable, List, Optional, Union from huggingface_hub.utils import filter_repo_objects @dataclass class DummyObject: path: Path DUMMY_FILES = ["not_hidden.pdf", "profile.jpg", ".hidden.pdf", ".hidden_picture.png"]...
{ "content_hash": "f3deb19c1cbed12bc360fa650cc41700", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 85, "avg_line_length": 33.55339805825243, "alnum_prop": 0.5439814814814815, "repo_name": "huggingface/huggingface_hub", "id": "8c968ad0f3d1755b2463898e9f8390727820bc64", "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('occurrence', '0003_auto_20181022_1215'), ] operations = [ migrations.AlterModelOptions( name='areaencounter', options={'ordering': ['-northern_extent', 'name'], 'ver...
{ "content_hash": "b0357ec1fb12e6db12621885d1c660c0", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 218, "avg_line_length": 36.8, "alnum_prop": 0.623641304347826, "repo_name": "parksandwildlife/wastd", "id": "aeb9e128b13c883d71d4de59445e768ae7bd5028", "size": "785", "bi...
''' Set manipulation routines for the LEMON parser generator. ''' size = 0 def SetSize(n): '''Set the set size.''' global size size = n + 1 return def SetNew(): '''Allocate a new set.''' return [False] * size def SetAdd(s, e): '''Add a new element to the set. Return True if the eleme...
{ "content_hash": "381b022c613988966836ca0c42c574bd", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 68, "avg_line_length": 17.65909090909091, "alnum_prop": 0.5521235521235521, "repo_name": "probcomp/bayeslite", "id": "38e9feb54e848e324827de4a913b3cb7b40dc3dc", "size": "77...
""" Criado em 08 de Novembro de 2016 Descricao: este codigo reune todas as bibliotecas responsaveis para a caracterizacao do ganho do CCD, sao elas: plotGraph, logfile, makeList_imagesInput e Gain_processesImages. O codigo ira criar duas listas de imagens: flat e bias, realizando o calculo da instensi...
{ "content_hash": "342b4dc5a0e3f2ea0546af7c81727565", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 130, "avg_line_length": 38.31147540983606, "alnum_prop": 0.730423620025674, "repo_name": "DBernardes/ProjetoECC", "id": "e9cb6deca9817965a4ae07ac1657dc59c6ef5c27", "size": ...
"""URL constructor class to generate valid API request URLs.""" from __future__ import absolute_import, division, print_function class URLBuilder(object): """Handles generating valid URLs to requests resources from DevRant.""" # pylint: disable=too-many-instance-attributes,too-many-function-args def __i...
{ "content_hash": "dc6be959bae2bf8ade7111eddcf401b1", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 84, "avg_line_length": 41.25757575757576, "alnum_prop": 0.625413147264047, "repo_name": "aayush26/pirant", "id": "b4337942f6d17b6e9ed8583f22b34d68d71f9bf7", "size": "2723",...
""" ============================== Generate simulated evoked data ============================== """ # Author: Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt impo...
{ "content_hash": "8ce521fbafe4282d40e004460b26848f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 35.85333333333333, "alnum_prop": 0.5868352547415396, "repo_name": "wronk/mne-python", "id": "0fab94f95b6d2672d2923d2392f183c87121744b", "size": "2689...
import multiprocessing as mp, numpy as np import signal def doit(func, queuein, queout, kw): signal.signal(signal.SIGINT, signal.SIG_IGN) while True: inp = queuein.get() if inp is None: break i, p = inp res = func(p, **kw) queout.put((i, res)) class pool: def __init__(self, func, kw={}, nthreads=1): ...
{ "content_hash": "7cd463260afb5cc8cd83a2f29376b4e7", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 58, "avg_line_length": 21.507462686567163, "alnum_prop": 0.6176266481609993, "repo_name": "plasidu/phoenix4iraf", "id": "7e107a8029c1067e5947c3b7288048c28d26cf7a", "size": ...
import contextlib import io import os import sys import importlib.util import time import struct import zipfile import unittest from tempfile import TemporaryFile from random import randint, random, getrandbits from test.support import (TESTFN, findfile, unlink, rmtree, requires_zlib, requi...
{ "content_hash": "faaeaaa012688aacb849c69eca85cf25", "timestamp": "", "source": "github", "line_count": 2068, "max_line_length": 92, "avg_line_length": 39.749032882011605, "alnum_prop": 0.573508838091994, "repo_name": "juanyaw/python", "id": "67e85704aabfee6e3bdf94293b01cdc79a7812f6", "size": "8220...
import unittest import testRObject import testVector import testArray import testDataFrame import testFormula import testFunction import testEnvironment import testRobjects import testMethods import testPackages # wrap this nicely so a warning is issued if no numpy present import testNumpyConversions def suite(): ...
{ "content_hash": "86cfb63ea4e1ead9820d34b336983629", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 67, "avg_line_length": 31.80392156862745, "alnum_prop": 0.5561035758323057, "repo_name": "lbouma/Cyclopath", "id": "79c47a65f0fa9c126569ca56da5de2ff5e1b13e0", "size": "1622...
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='lioncore', version=...
{ "content_hash": "0a4c0eda8ee2286d1997319c2f21074b", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 78, "avg_line_length": 33.26315789473684, "alnum_prop": 0.615506329113924, "repo_name": "Leo2807/lioncore", "id": "6a64396736582ab17e9d54461fca108f97dabec7", "size": "1264"...
from __future__ import unicode_literals from operator import attrgetter from django.apps import apps from django.core import checks from django.db import connection, connections, router, transaction from django.db.backends import utils from django.db.models import signals, Q from django.db.models.deletion import SET_...
{ "content_hash": "9699f0d61904dc49111708e546ed2e27", "timestamp": "", "source": "github", "line_count": 2346, "max_line_length": 228, "avg_line_length": 45.21227621483376, "alnum_prop": 0.5696345740468379, "repo_name": "dhoffman34/django", "id": "1dc5ff9b1db9ae0f9c8c5c4f8143d234052ab1ff", "size": "...
import os import sys import bz2 import gzip as gz from zipfile import ZipFile from tarfile import TarFile from rarfile import RarFile change_coding = 'utf-8' def getpath(file): """\ Get file's path, if failed it will return current working directory's path file: the name of the file which needs to pr...
{ "content_hash": "479a69b33a289e76062eedc0dcf34717", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 89, "avg_line_length": 25.469135802469136, "alnum_prop": 0.5419292292777509, "repo_name": "catonlyonce/Py-uncompress", "id": "92b3355a5044ae59efd3bcf1aef38c6cf814142f", "si...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineRes...
{ "content_hash": "7235bfbe414482932f5f4c574291946a", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 149, "avg_line_length": 43.1, "alnum_prop": 0.6549747509212501, "repo_name": "Azure/azure-sdk-for-python", "id": "d770f914a8e9fd6ed65853347eba4dc7853f770f", "size": "7827"...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = "ucldc-iiif", version = "0.0.1", description...
{ "content_hash": "070177b14afd18f66a3481f1e9467ee5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 118, "avg_line_length": 31.517241379310345, "alnum_prop": 0.6575492341356673, "repo_name": "barbarahui/ucldc-iiif", "id": "2f0f88663011d4eebb3d274f9fc9324eba5fd874", "size"...
import os from os.path import join from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('utils', parent_package, top_path) config.add_subpackage('sparsetools') ...
{ "content_hash": "b57df42adfe8a7629c3c83d0915b98ce", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 70, "avg_line_length": 34.64473684210526, "alnum_prop": 0.5074060007595899, "repo_name": "JT5D/scikit-learn", "id": "e617b95e1aa135436c883d4a7488b60b4273bc1e", "size": "263...
from django.db import models # Create your models here. class Ranking(models.Model): nth = models.PositiveSmallIntegerField() nyear = models.PositiveSmallIntegerField() rank = models.PositiveSmallIntegerField() previous_rank = models.PositiveSmallIntegerField(null=True) first_appearance = models.PositiveSmallIn...
{ "content_hash": "34d07d2758f5543ff872ae27541eb352", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 78, "avg_line_length": 48.22222222222222, "alnum_prop": 0.7769585253456222, "repo_name": "hustyuantao/hpc", "id": "f7a35b4288351eb78fc99017dde237231893a8a7", "size": "2170"...
import argparse import csv from tables import parameters from .. import pairs from ..db import FragmentsDb from ..frozen import FrozenSimilarityMatrix from ..hdf5 import SimilarityMatrix def make_similarities_parser(subparsers): """Creates a parser for similarities sub commands Args: subparsers (arg...
{ "content_hash": "d7701cbdfdac94f83def9756e39c004d", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 122, "avg_line_length": 42.205357142857146, "alnum_prop": 0.6321133911571821, "repo_name": "3D-e-Chem/python-modified-tanimoto", "id": "36764815fa60854d25f5cf6f5acb2f74c7f10...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('achat', '0006_achat_taxable'), ] operations = [ migrations.AlterModelOptions( name='achat', options={'ordering': ['-date', '...
{ "content_hash": "bc9fb884719bf596b172b449afb1fbf8", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 51, "avg_line_length": 20.294117647058822, "alnum_prop": 0.5739130434782609, "repo_name": "kilisimba/gluten-free-tax", "id": "434626f2e5c596991b8f59107c5eb47c4736e936", "si...
""" This package contains all the tests of the nstl.sema subpackage. """ __all__ = ['test_scope'] if __name__ == "__main__": pass
{ "content_hash": "cbc646b3e12ae8bec809038ab353c7e9", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 64, "avg_line_length": 15.222222222222221, "alnum_prop": 0.5766423357664233, "repo_name": "ldionne/nstl-lang", "id": "74a89645f9a9c82ca2f94dd32db8bd379ab776d6", "size": "138...
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
{ "content_hash": "b10208b5e19734d9576a0cd330d29729", "timestamp": "", "source": "github", "line_count": 1698, "max_line_length": 235, "avg_line_length": 41.957597173144876, "alnum_prop": 0.5764836337095054, "repo_name": "SWENG500-Team1/FitnessForSplunk", "id": "7b9aa8426a121f049adf40412b5834b0dcf249a...
""" Data structures for sparse float data. Life is made simpler by dealing only with float64 data """ # pylint: disable=E1101,E1103,W0231 import warnings import numpy as np import pandas._libs.index as libindex import pandas._libs.sparse as splib from pandas._libs.sparse import BlockIndex, IntIndex import pandas.co...
{ "content_hash": "fd0f982e56c8ff031604fbc98175ddc3", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 79, "avg_line_length": 34.65878378378378, "alnum_prop": 0.5670630665756896, "repo_name": "GuessWhoSamFoo/pandas", "id": "db4d3e876dec57fd24f346a9740b545a2cd911d1", "size":...
AF_CHOICES = ( (4, 'IPv4'), (6, 'IPv6'), ) # Prefix statuses PREFIX_STATUS_CONTAINER = 0 PREFIX_STATUS_ACTIVE = 1 PREFIX_STATUS_RESERVED = 2 PREFIX_STATUS_DEPRECATED = 3 PREFIX_STATUS_CHOICES = ( (PREFIX_STATUS_CONTAINER, 'Container'), (PREFIX_STATUS_ACTIVE, 'Active'), (PREFIX_STATUS_RESERVED, 'Res...
{ "content_hash": "07ae59dfcd3f55443fda4b9dfc3bf69c", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 70, "avg_line_length": 23.59375, "alnum_prop": 0.6635761589403973, "repo_name": "lampwins/netbox", "id": "eeb17eddd4b8d25441280ef6e5833de4f52bc492", "size": "2288", "bina...
import re import unicodedata from django.template.defaultfilters import stringfilter, register from django.utils import six from django.utils.functional import allow_lazy from django.utils.safestring import mark_safe def _slugify(value): """ django.utils.text.slugify that allows to use dot(.) in a slug field...
{ "content_hash": "3226ae53e938c9d5c786db55bb77d1d6", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 90, "avg_line_length": 29.68, "alnum_prop": 0.7008086253369272, "repo_name": "stasiek/rfdocs", "id": "912a832ebdfa98dcd855d68a1c6cd4ac5d95849d", "size": "789", "binary": ...
import hashlib from social_core.exceptions import AuthAlreadyAssociated, AuthException def auto_logout(*args, **kwargs): """Do not compare current user with new one""" return {'user': None} def check_email_present(backend, uid, user=None, *args, **kwargs): if not kwargs['details'].get('email'): ...
{ "content_hash": "872805a01709eed55e88caf7d292a866", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 102, "avg_line_length": 35.14, "alnum_prop": 0.614114968696642, "repo_name": "crowd-course/scholars", "id": "35166c5e9887d63bb9da0af6d8e3815f44c27d43", "size": "1757", "b...
from django.views.generic import TemplateView from userprofiles.contrib.accountverification.models import AccountVerification from userprofiles.settings import up_settings class RegistrationActivateView(TemplateView): template_name = 'userprofiles/registration_activate.html' def get_context_data(self, **kwa...
{ "content_hash": "1b9a17c200e3fc7096072d60817610fb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 34.1578947368421, "alnum_prop": 0.7411402157164869, "repo_name": "tripathy/django-userprofiles", "id": "00dd9fd937c31594ec4961093ffa9b27ffed66b9", "s...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import get_request_site_address, encode from frappe.model.document import Document from six.moves.urllib.parse import quote from frappe.website.router import resolve_route from frappe.website.doctype.website_theme.website_theme...
{ "content_hash": "a387b425ceca40e0e2dc9a804b5766d0", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 111, "avg_line_length": 32.73426573426573, "alnum_prop": 0.6851100192266609, "repo_name": "vjFaLk/frappe", "id": "64558e751aa416bd3f39403cafa61bf1af971c2e", "size": "4782"...
from ingresso import ControllerIngresso def IngressoMeia(): cod_sessao = int(input("Código Sessão: ")) ControllerIngresso.IngressoMeia(cod_sessao) def Ingresso(): cod_sessao = int(input("Código Sessão: ")) ControllerIngresso.Ingresso(cod_sessao) def ListarIngressoVendidos(): cod_sessao = ...
{ "content_hash": "4f37bc32adb6a4ae1035d12bf682397e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 57, "avg_line_length": 31.115384615384617, "alnum_prop": 0.7330037082818294, "repo_name": "ygorclima/apd", "id": "15fc0d6860f7026b55efdb90d4d55037c60d8e53", "size": "817", ...
"Functions that help with dynamically creating decorators for views." # For backwards compatibility in Django 2.0. from contextlib import ContextDecorator # noqa from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps class classonlymethod(classmethod): def __get__(self, instance, cls=None): if...
{ "content_hash": "40e5dabf7ffa1362371b8e059a9202f3", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 97, "avg_line_length": 38.63068181818182, "alnum_prop": 0.5705250772172378, "repo_name": "bak1an/django", "id": "87a20cf23b7f07168c1948280e82d1a334eecbde", "size": "6799",...
"""Helpers for tests.""" import json import pytest from .common import MQTTMessage from tests.async_mock import patch from tests.common import load_fixture @pytest.fixture(name="generic_data", scope="session") def generic_data_fixture(): """Load generic MQTT data and return it.""" return load_fixture("ozw/...
{ "content_hash": "91c90e60d79cc929ddb97b23b0495bc2", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 85, "avg_line_length": 33.12, "alnum_prop": 0.68756038647343, "repo_name": "titilambert/home-assistant", "id": "3e30b60129be1cea8268a019feb9381e6daf8d32", "size": "8280", ...
import json from flask import Response """ Import shared GCP helper modules """ # TODO: Add pubsub to import list from quiz.gcp import datastore, pubsub # END TODO """ Gets list of questions from datastore - Create query - Filter on quiz - Call the datastore helper to get back JSON - Pretty print JSON - Set header...
{ "content_hash": "f4fa861e159a1433bbef4e5fbc791bf4", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 76, "avg_line_length": 30.105263157894736, "alnum_prop": 0.6429195804195804, "repo_name": "GoogleCloudPlatform/training-data-analyst", "id": "44a01944ffd3d8f64e2e6e1065bc5701...
import _plotly_utils.basevalidators class BoxpointsValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="boxpoints", parent_name="box", **kwargs): super(BoxpointsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "6c9e340951a139d0be47e7696f81398c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 77, "avg_line_length": 37.357142857142854, "alnum_prop": 0.5869980879541109, "repo_name": "plotly/plotly.py", "id": "448f9d16c4de2b149f229ac2f1852e565d139d6d", "size": "523...
import random from twisted.trial import unittest from .. import logic from .. import mathematics from ...workspace import Workspace, Block from .... import data class CompareBlockTestCase (unittest.TestCase): def setUp(self): self.workspace = Workspace() self.block: Block = logic.logic_compare...
{ "content_hash": "3bb572cbe24597d73479141e22072dbc", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 78, "avg_line_length": 31.8375, "alnum_prop": 0.6497840596780526, "repo_name": "richardingham/octopus", "id": "f0454632d28021d2be9ef3aa115f41ae03d40b30", "size": "2548", ...
import ftplib import os # noqa: F401 import shutil import time import unittest from configparser import ConfigParser from os import environ import requests from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import ThreadedFTPServer import threading impor...
{ "content_hash": "e6daa5a6432e4c360e7ce8c6650549a9", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 101, "avg_line_length": 44.074829931972786, "alnum_prop": 0.5980089519987652, "repo_name": "kbaseapps/kb_uploadmethods", "id": "cdb09bf6ec9cf2ee3d3eafe32099362841bb0d1c", ...
"""Test the Pentair ScreenLogic config flow.""" from unittest.mock import patch from screenlogicpy import ScreenLogicError from screenlogicpy.const import ( SL_GATEWAY_IP, SL_GATEWAY_NAME, SL_GATEWAY_PORT, SL_GATEWAY_SUBTYPE, SL_GATEWAY_TYPE, ) from homeassistant import config_entries, setup from ...
{ "content_hash": "d381d8eb569c8bbea6d445abfb0a3cfd", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 84, "avg_line_length": 32.87068965517241, "alnum_prop": 0.6160503540519277, "repo_name": "Danielhiversen/home-assistant", "id": "a24ce36e7a1abc6327e95c3f437e1dfcae03dcd8", ...
BOT_NAME = 'spojCrawler' SPIDER_MODULES = ['crawler.spiders'] NEWSPIDER_MODULE = 'crawler.spiders' ITEM_PIPELINES = { 'crawler.pipelines.UserscrawlerPipeline': 300, } LOG_LEVEL = 'INFO' DEFAULT_REQUEST_HEADERS = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Langu...
{ "content_hash": "23ee7f2178ee3a42db4916ceda3fc5d7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 80, "avg_line_length": 27.772727272727273, "alnum_prop": 0.7266775777414075, "repo_name": "ederfmartins/spojrec", "id": "3a4002080e456639e3169bdd549f747b6b8a7703", "size": ...
"""plist module tests.""" import base64 import datetime import pprint import mox import stubout from google.apputils import app from google.apputils import basetest from simian.mac.munki import plist class PlistModuleTest(mox.MoxTestBase): def setUp(self): mox.MoxTestBase.setUp(self) self.stubs = stubou...
{ "content_hash": "93d029121962694cf1dfff040c62359d", "timestamp": "", "source": "github", "line_count": 1297, "max_line_length": 111, "avg_line_length": 32.55050115651503, "alnum_prop": 0.6176986119664598, "repo_name": "googlearchive/simian", "id": "04b08d114a53272aee8279e0759af44feedb0ecb", "size"...
import json from pprint import pprint def get_duration_pitches(): segment_list = [] with open('paint_it_black.json') as data_file: data = json.load(data_file) segments = data["segments"] for segment in segments: segment_list.append((segment["duration"], segment["pitches"])) return(segment_list) def get_...
{ "content_hash": "76b69aa2338daf55272ed41e2d88fd21", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 25.795454545454547, "alnum_prop": 0.6607929515418502, "repo_name": "HackOutWest15/synthetic-music-group", "id": "3b53f8d6c53a33c5239bc30f61be4c54036824...
from sys import exit from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #imp...
{ "content_hash": "1ddd87a57bcb16f7cefa491afe291113", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 75, "avg_line_length": 27.967741935483872, "alnum_prop": 0.583044982698962, "repo_name": "SanketDG/dpaste", "id": "ae3eb0ad5f9d74b177e9c78378d3fabeb83e0042", "size": "1756"...
"""Tools for working with MongoDB `ObjectIds <http://dochub.mongodb.org/core/objectids>`_. """ import binascii import calendar import datetime try: import hashlib _md5func = hashlib.md5 except ImportError: # for Python < 2.5 import md5 _md5func = md5.new import os import random import socket import st...
{ "content_hash": "7b82cc544cb1452c758020e550cc213c", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 79, "avg_line_length": 30.545161290322582, "alnum_prop": 0.5676417784348928, "repo_name": "initNirvana/Easyphotos", "id": "bb38497a2a28ce324462fe80113d6dbc461349a7", "size...
from django.db import models from core.utils import create_slug from core.models import BaseModel from payments.models import Customer class ReactionEvent(BaseModel): customer = models.ForeignKey(Customer) name = models.CharField(max_length=255) url = models.CharField(max_length=2048, blank=True, null=T...
{ "content_hash": "cbd43e648aee1efd0f25d6c58442e727", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 36.38461538461539, "alnum_prop": 0.6730091613812544, "repo_name": "makaimc/txt2react", "id": "12ee2e4ea6640d81a09e883cca5f2e5f5361536b", "size": "141...
from rest_framework import serializers from tenancy.models import Tenant, TenantGroup # # Tenant groups # class TenantGroupSerializer(serializers.ModelSerializer): class Meta: model = TenantGroup fields = ['id', 'name', 'slug'] class TenantGroupNestedSerializer(TenantGroupSerializer): cl...
{ "content_hash": "ec7141ed9fdd8ee1a55db10872209411", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 60, "avg_line_length": 18.789473684210527, "alnum_prop": 0.6904761904761905, "repo_name": "rfdrake/netbox", "id": "30a4a3ca1a80ca98f211dba5018f340ba20fe9fc", "size": "714",...
import os import datetime import re import codecs from south.db import db from south.v2 import DataMigration from django.db import models from django.conf import settings from sqp import models as sqp_models class Migration(DataMigration): def forwards(self, orm): try: sql = 'ALTER TABLE sq...
{ "content_hash": "36cb6b59102949c2b5e5d6205eff6d8e", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 182, "avg_line_length": 64.91489361702128, "alnum_prop": 0.5191412651589643, "repo_name": "recsm/SQP", "id": "2e4b0776aa562371b0b5e9a2d2fded13ab91c59c", "size": "30530", ...
import xbmcaddon import notification import xbmc import source class Service(object): def __init__(self): self.database = source.Database() self.database.initialize(self.onInit) def onInit(self, success): if success: self.database.updateChannelAndProgramListCaches(self.onC...
{ "content_hash": "f3646d2d8e7a5f975280a9d3ac830d42", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 94, "avg_line_length": 29, "alnum_prop": 0.6677115987460815, "repo_name": "aplicatii-romanesti/allinclusive-kodi-pi", "id": "31b88eb95b8876cbd6c3ca3dfe7435e6adff0904", "siz...
import time from datetime import timedelta, datetime from logging import getLogger from .compat import TO_UNICODE from .constants import is_timestamp_type_name from .converter import (SnowflakeConverter, ZERO_EPOCH) from .sfbinaryformat import (binary_to_python, SnowflakeBinaryFormat) from .sfdatetime import (Snowflak...
{ "content_hash": "d00fc2cd522674db00c9d40a7898d343", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 84, "avg_line_length": 33.58064516129032, "alnum_prop": 0.5726865193723983, "repo_name": "mayfield/snowflake-connector-python", "id": "bab90cba26cf0efddeae5259b2ed5d03386545...
""" Hello world AWS lambda function """ def handler(event, context): message = 'Hello World!' return { 'message' : message }
{ "content_hash": "1e43d8ee0eebc7fe8339bbabf07f53f0", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 36, "avg_line_length": 19.428571428571427, "alnum_prop": 0.6323529411764706, "repo_name": "xmementoit/practiseSamples", "id": "3da56190b66ee71f387c1d24ec0b45795b04f3c1", "si...
from __future__ import annotations import hashlib from pathlib import Path if __name__ not in ("__main__", "__mp_main__"): raise SystemExit( "This file is intended to be executed as an executable program. You cannot use it as a module." f"To execute this script, run ./{__file__} [FILE] ..." ) ...
{ "content_hash": "d22239de9dad59e06393185dfd2a9ffb", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 103, "avg_line_length": 37.170212765957444, "alnum_prop": 0.659988551803091, "repo_name": "nathanielvarona/airflow", "id": "ffa368477c563e2cd382b2a537d00da291cf6a32", "size...
from rest_framework import serializers from rest.models import * class CourtSerializer(serializers.Serializer): class Meta: resource_name = 'courts' class CitationSerializer(serializers.ModelSerializer): class Meta: model = Citations resource_name = 'citations' class ViolationSerializ...
{ "content_hash": "bf40776656787f4e7bfb1ab40044e8da", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 244, "avg_line_length": 35.06896551724138, "alnum_prop": 0.7069813176007866, "repo_name": "xHeliotrope/injustice_dropper", "id": "c6b6ac2762724e254dc02c93ffb98db73060ec6b", ...
""" PlugIn for Nexus OS driver """ import logging from quantum.common import exceptions as exc from quantum.openstack.common import importutils from quantum.plugins.cisco.common import cisco_constants as const from quantum.plugins.cisco.common import cisco_credentials_v2 as cred from quantum.plugins.cisco.common impo...
{ "content_hash": "fc644ed95cb0de710d8c525cb76a22b4", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 78, "avg_line_length": 41.13833992094862, "alnum_prop": 0.5326671790930054, "repo_name": "yamt/neutron", "id": "a5873965aa2aba1e6b171f378c40ad49284e8294", "size": "11249",...
from pynlpl.formats import folia tweets_doc = folia.Document(id="tweetlist1") tweets_doc.declare(folia.Event, "https://raw.githubusercontent.com/ahurriyetoglu/sinfexfolia/master/sinfex-event.foliaset.xml") tweets_doc.declare(folia.Entity, "https://raw.githubusercontent.com/ahurriyetoglu/sinfexfolia/master/sinfex-entit...
{ "content_hash": "fb3b2d1747ba79f79bdc82dda2999f84", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 131, "avg_line_length": 42.9375, "alnum_prop": 0.7496360989810772, "repo_name": "ahurriyetoglu/sinfexfolia", "id": "323d6470eaa099b981701b1cdd3a1b8e54162075", "size": "687"...
from __future__ import unicode_literals from django.db import models from django.utils import six # The models definitions below used to crash. Generating models dynamically # at runtime is a bad idea because it pollutes the app registry. This doesn't # integrate well with the test suite but at least it prevents regr...
{ "content_hash": "7864c48cc7ab7589cf1d969efcd565a3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 32, "alnum_prop": 0.74875, "repo_name": "cloudera/hue", "id": "7a6b1145162f5bcf76e6093db08e7d2cf16b38e9", "size": "800", "binary": false, "copies...
import os from django.core.management.base import BaseCommand, CommandError from raven import Client class SentryCommand(BaseCommand): def execute(self, *args, **options): try: return super(SentryCommand, self).execute(*args, **options) except Exception as e: if not isins...
{ "content_hash": "b6f587f68284aa22746320733d12d176", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 30.894736842105264, "alnum_prop": 0.575809199318569, "repo_name": "kyleconroy/speakers", "id": "aeaf153e1c5c92bee0210fcba512170d4ed6d4de", "size": "5...
from bambou import NURESTFetcher class NUSSHKeysFetcher(NURESTFetcher): """ Represents a NUSSHKeys fetcher Notes: This fetcher enables to fetch NUSSHKey objects. See: bambou.NURESTFetcher """ @classmethod def managed_class(cls): """ Return NUSSHKey cl...
{ "content_hash": "970ac1ed861869bcae0806642ac9c137", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 59, "avg_line_length": 19.28, "alnum_prop": 0.5809128630705395, "repo_name": "nuagenetworks/vspk-python", "id": "91ffae199ad820c1e5a7dbbbfee3d985c36cc160", "size": "2093", ...
""" An example plugin for spockbot Demonstrates the following functionality: - Receiving chat messages - Sending chat commands - Using inventory - Moving to location - Triggering a periodic event using a timer - Registering for an event upon startup - Placing blocks - Reading blocks """ import logging # Import any mo...
{ "content_hash": "f9a5a5a1edde26f0f461d27dbaa51986", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 36.92307692307692, "alnum_prop": 0.6703125, "repo_name": "Gjum/SpockBot", "id": "fa7d3664b1a5650224e5b2d49d32c8a5f0f31def", "size": "3840", "binar...
import os import re import codecs from setuptools import setup from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding option to open return codecs.open(os.path.join(here, *parts), 'r').read() def read_filelines(file...
{ "content_hash": "74fcd88f967f4c568d89332534ac7b62", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 68, "avg_line_length": 26.313725490196077, "alnum_prop": 0.6549925484351714, "repo_name": "chuijiaolianying/robotx", "id": "bebeceec76de694ee1575bf710fb3b530b5f51ae", "size...
from setuptools import setup, find_packages import os from cacheback import __version__ PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) os.chdir(PACKAGE_DIR) setup(name='django-cacheback', version=__version__, url='https://github.com/codeinthehole/django-cacheback', author="David Winterbot...
{ "content_hash": "0dc577d502edb3a0c276620948e17156", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 37.06060606060606, "alnum_prop": 0.588716271463614, "repo_name": "bharling/django-cacheback", "id": "4277891dc662c4a255401ff76688fde8da63d2d4", "size...
import pygraph.classes.graph import pygraph.classes.exceptions import sys import logging import md5 logging.basicConfig() logger = logging.getLogger('guiraldelli.master.unification.algorithms') logger.setLevel(logging.INFO) def graphs_unification(graphs_universe): '''Compose a final graph by the 'selected edges' ...
{ "content_hash": "db437b534dede8444c00c95387abc5a1", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 113, "avg_line_length": 43.354838709677416, "alnum_prop": 0.6469494047619048, "repo_name": "guiraldelli/MSc", "id": "7341b901c46405766958df81162349ff14493d2c", "size": "268...
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
{ "content_hash": "91d1565b8d29d5976cd9fa77c596c0a0", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 41.80769230769231, "alnum_prop": 0.6954921803127875, "repo_name": "PyZim/indaba", "id": "4a079d00be42452cfcd46cb3733f8992f4f236d0", "size": "1087", ...
import copy import json import re from crispy_forms.bootstrap import InlineField from crispy_forms.helper import FormHelper from crispy_forms import layout as crispy from crispy_forms import bootstrap as twbscrispy from corehq.apps.style import crispy as hqcrispy from django.core.urlresolvers import reverse from django...
{ "content_hash": "ea409045f769e8ebb2345ceefb48b352", "timestamp": "", "source": "github", "line_count": 2668, "max_line_length": 140, "avg_line_length": 37.643178410794604, "alnum_prop": 0.5201131113589295, "repo_name": "qedsoftware/commcare-hq", "id": "389285a4f3c106ced532199ca0627c20d92b1d02", "s...
def get_peak_range(pre_line): line = pre_line.strip() colon = line.find(':') hyphen = line.find('-') chro = line[:colon] start = int(line[(colon+1):hyphen]) end = int(line[(hyphen+1):]) return (chro,start,end) import sys import math print 'Expanding peaks!' if len(sys.argv)<3: sys.exi...
{ "content_hash": "86f305065f6a6d7cf4169e0c6a053d52", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 55, "avg_line_length": 26.22222222222222, "alnum_prop": 0.6257062146892656, "repo_name": "corcra/tf2", "id": "c4e127ae01c2b52db8290bd52ad46ed90811db2e", "size": "821", "b...
"""Support for the MaryTTS service.""" import asyncio import logging import re import aiohttp import async_timeout import voluptuous as vol from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.helpers.aiohttp_client impor...
{ "content_hash": "dd8b766e0a8b98f31c01b0740cb1a2d4", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 77, "avg_line_length": 30.471698113207548, "alnum_prop": 0.591640866873065, "repo_name": "jnewland/home-assistant", "id": "294383cb4dd99e94afdd97ec3192cb7cf325b19f", "size...
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from models import FriendshipRequest, Friendship, UserBlocks class FriendshipRequestAdmin(admin.ModelAdmin): date_hierarchy = 'created' list_display = ('from_user', 'to_user', 'accepted', 'created') list_filter = ('ac...
{ "content_hash": "30a1d8f3cfa2ab12721d23fc0d3b7f35", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 40.92307692307692, "alnum_prop": 0.6666666666666666, "repo_name": "softak/webfaction_demo", "id": "1e1bd791fe304e7309e942d0a725eb62c9625a24", "size":...
import datetime from sqlalchemy import Column, ForeignKey from sqlalchemy.types import DateTime, Date, String, Integer, Float, Boolean from intranet3.models import Base class TimeEntry(Base): __tablename__ = 'time_entry' id = Column(Integer, primary_key=True, index=True) user_id = Column(Integ...
{ "content_hash": "2f5f24aa0d4de3045d0bb3e8d28cf601", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 86, "avg_line_length": 32.72, "alnum_prop": 0.6008557457212714, "repo_name": "stxnext/intranet-open", "id": "a9284cfe1b5c5c7ee27fe0fee24671d3200e941d", "size": "1636", "b...
import numpy as np import pytest import scipy.stats as st from sklearn.decomposition import PCA from Starfish.emulator._utils import ( get_w_hat, get_phi_squared, get_altered_prior_factors, Gamma, ) class TestEmulatorUtils: @pytest.fixture def grid_setup(self, mock_hdf5_interface): fl...
{ "content_hash": "76362a90c73eeb83ba28ff8602e33900", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 74, "avg_line_length": 31.620689655172413, "alnum_prop": 0.6063249727371864, "repo_name": "iancze/Starfish", "id": "137c5cac7b2c73ffdaac8e016c85ea648122b40b", "size": "1834...
import logging import warnings import inspect from sqlalchemy.orm.attributes import InstrumentedAttribute from sqlalchemy.orm import joinedload, aliased from sqlalchemy.sql.expression import desc, ColumnElement from sqlalchemy import Boolean, Table, func, or_ from sqlalchemy.exc import IntegrityError from sqlalchemy.s...
{ "content_hash": "68a099071f3730bcb4d32766e82597de", "timestamp": "", "source": "github", "line_count": 1115, "max_line_length": 125, "avg_line_length": 34.7372197309417, "alnum_prop": 0.5247857069090158, "repo_name": "jschneier/flask-admin", "id": "323ca294fb8b4b363d0ffeea68efc368ac52e4ab", "size"...
import defs import thirdparty.gzipinputstream as gzis import logging import numbers import os import platform import re import socket import ssl import sys import vector3 if sys.version_info >= (3, 0): import urllib.parse import urllib.request import urllib.error else: import urllib2 import urllib import u...
{ "content_hash": "66339b6015019e835f305ac332bfb926", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 122, "avg_line_length": 29.38388625592417, "alnum_prop": 0.6456451612903226, "repo_name": "KayJohnston/jackies-map", "id": "68da84140a7c464e2b3bcd7b06411a1437b83a91", "siz...
import itertools import re import requests from tuneharvest.common import Link from collections.abc import Callable, Iterable from argparse import Namespace TOPIC_RE = re.compile(r'.+/t/[^\./]+') def register(subparsers): from_discourse_parser = subparsers.add_parser('discourse', help='Read links from discours...
{ "content_hash": "58a85ea3d9d5ae3aea7fd549de4a7a85", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 96, "avg_line_length": 26.434782608695652, "alnum_prop": 0.6274671052631579, "repo_name": "kcsaff/tuneharvest", "id": "d3077e6a56892c79e6548a32dd14646a39678187", "size": "1...
from sanic.response import text from sanic.router import RouteExists import pytest @pytest.mark.parametrize( "method,attr, expected", [ ("get", "text", "OK1 test"), ("post", "text", "OK2 test"), ("put", "text", "OK2 test"), ("delete", "status", 405), ], ) def test_overload_...
{ "content_hash": "3f725f796e1167090d31606b4c3547f9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 32.02325581395349, "alnum_prop": 0.6172839506172839, "repo_name": "lixxu/sanic", "id": "6a5c57c68cf28f2267377acc4354c0bdfbc4b187", "size": "1377", ...
from typing import Any, Callable, Optional from zerver.models import get_user_profile_by_id from zerver.lib.rate_limiter import client, max_api_calls, max_api_window, \ RateLimitedUser from django.core.management.base import BaseCommand, CommandParser from django.conf import settings import logging import time ...
{ "content_hash": "70cd58ba40e470d01388df813220ab00", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 124, "avg_line_length": 39.76315789473684, "alnum_prop": 0.5625413633355394, "repo_name": "amanharitsh123/zulip", "id": "7b670c1b43ef922fe8689d7e65a584efc3269508", "size": ...
import os import platform import shlex import subprocess import sys import time from core.api.Status import Status from core.exceptions import UnsupportedPlatformException class Executor(object): def __init__( self, cwd: str ): self.process = None self.cwd = cwd d...
{ "content_hash": "6628de359d27d6568920d0c1ef30b901", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 92, "avg_line_length": 25.957894736842107, "alnum_prop": 0.5277777777777778, "repo_name": "adyasha/dune", "id": "7732f5c126565acdf87743cc5c78a102df37d551", "size": "4932",...
import os import subprocess import sys import tempfile import objdump_parser import test_format class RdfaTestRunner(test_format.TestRunner): SECTION_NAME = 'dis' def CommandLineOptions(self, parser): parser.add_option('--objdump', help='Path to objdump') def GetSectionContent(self...
{ "content_hash": "c682a8dc9b0d241c645e5813bc11d1e9", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 70, "avg_line_length": 22.862745098039216, "alnum_prop": 0.6149228130360206, "repo_name": "Lind-Project/native_client", "id": "120e0477ecad56733232686ba6d02f696549a4d1", "s...
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from contentblocks.views import contentblock_view, contentblock_edit from .views import home, events_preview, about_contact urlpatterns = [ # Main site url(r'^$',...
{ "content_hash": "319498ea32e172dcbadb47847b037eb6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 96, "avg_line_length": 35.294117647058826, "alnum_prop": 0.7033333333333334, "repo_name": "Alofoxx/club-websystem", "id": "d5d70a8b33ee6cccf95467021e1727194a85599f", "size"...
from factory import Factory class DjangoModelFactory(Factory): ABSTRACT_FACTORY = True @classmethod def _create(cls, target_class, *args, **kwargs): """Create an instance of the model, and save it to the database.""" obj = target_class(*args, **kwargs) obj.save() return o...
{ "content_hash": "354c3e783e271fee550d6ef392ac4bfa", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6346749226006192, "repo_name": "RedBulli/MemberRegister", "id": "5d99ed7076ea291d0656d845f002019565ead99f", "size...
from .basicpage import BasicPage from .templatesettings import TemplateSettings
{ "content_hash": "5ab8ca3171aa357e21c2e397c3de1b3d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 46, "avg_line_length": 39.5, "alnum_prop": 0.8860759493670886, "repo_name": "tracon/dragontail", "id": "60d9d8e681dd1cd26b67776b7bc47f2e8854bf3f", "size": "79", "binary": ...
class Element(dict): fields = {} def __init__(self, fields=None, element=None, keys=None): if fields is None: fields={} self.element = element dict.__init__(self, dict.fromkeys(self.fields)) if not keys: keys = fields.keys() for key in keys: if k...
{ "content_hash": "b4aed2de3ee937983ddf385952c646cd", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 76, "avg_line_length": 30.863636363636363, "alnum_prop": 0.5449189985272459, "repo_name": "yippeecw/sfa", "id": "36ad12f73b43870fea8d4ee2cd7342f5fd98b290", "size": "679", ...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ARB_uniform_buffer_object' def _f( function ): return _p.createFunction( function,_p.GL,'GL_ARB_uniform_buffer_object',False) _p.un...
{ "content_hash": "b295d4fb868e2050afe391a1c15cb9be", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 103, "avg_line_length": 46.35897435897436, "alnum_prop": 0.8017146017699115, "repo_name": "frederica07/Dragon_Programming_Process", "id": "9e753da46b0ed98113f65ff34a1e67332be...
from .common import * from av.codec import Codec from av.video.format import VideoFormat class TestCodecs(TestCase): def test_codec_mpeg4(self): c = Codec('mpeg4') self.assertEqual(c.name, 'mpeg4') self.assertEqual(c.long_name, 'MPEG-4 part 2') self.assertEqual(c.type, 'video') ...
{ "content_hash": "aa7d5e59bdaf4f778749add7d46babb5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 66, "avg_line_length": 29.523809523809526, "alnum_prop": 0.646774193548387, "repo_name": "danielballan/PyAV", "id": "d9f73bcd0a34d29503f034d3199e6d5a2172f9d8", "size": "620...
""" Match API endpoints - list matches and get replays/error logs. """ import io import flask import sqlalchemy import google.cloud.exceptions as gcloud_exceptions import google.cloud.storage as gcloud_storage from .. import model, util from .blueprint import web_api from . import util as api_util def get_match_he...
{ "content_hash": "f1efea02304090f13542797c21f16d50", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 76, "avg_line_length": 35.327510917030565, "alnum_prop": 0.5644004944375772, "repo_name": "HaliteChallenge/Halite-II", "id": "303c9f87e84834a1133b96f8db10b2e2094dc096", "s...
from setuptools import setup, find_packages from healthcheck import __version__ setup( name="tsuru-hcaas", version=__version__, description="Healthcheck as a service API for Tsuru PaaS", author="Tsuru", author_email="tsuru@corp.globo.com", classifiers=[ "Programming Language :: Python...
{ "content_hash": "2ad4d198a4b283348e3a34b435db6b5a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 27.38888888888889, "alnum_prop": 0.6490872210953347, "repo_name": "tsuru/healthcheck-as-a-service", "id": "7dadf7fb0c57407e80fbe81c8ee6df324765a3c9", ...
""" Copyright (c) 2010 ICRL 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, sublicens...
{ "content_hash": "b2ab80244d6f2cd689af96786dd3b376", "timestamp": "", "source": "github", "line_count": 602, "max_line_length": 216, "avg_line_length": 44.77242524916944, "alnum_prop": 0.6030126516528772, "repo_name": "EnerNOC/smallfoot-sleekxmpp", "id": "6f7289e56b0b46c9b86e46174ba0106ab5e59abc", ...
from __future__ import print_function import cx_Oracle import db_config con = cx_Oracle.connect(db_config.user, db_config.pw, db_config.dsn) cur = con.cursor() cur.execute("select * from dept order by deptno") res = cur.fetchall() for row in res: print(row) cur.close() con.close()
{ "content_hash": "6e883d33dd71b8abe7554b56d0032470", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 19.333333333333332, "alnum_prop": 0.7103448275862069, "repo_name": "cloudera/hue", "id": "64d565d9264b186e14f3436689261bad1d77e09a", "size": "712", ...
from __future__ import division, unicode_literals """ This module has been moved pymatgen.io.gaussian. This sub module will be removed in pymatgen 4.0. """ __author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2013, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp...
{ "content_hash": "23002cfabcaeb63b94f611032dce2bd9", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 28.94736842105263, "alnum_prop": 0.6909090909090909, "repo_name": "Bismarrck/pymatgen", "id": "b0c05ce4cfe934262a48b092c486b29429a8ac22", "size": "68...
import spotipy_twisted import sys import pprint if len(sys.argv) > 1: search_str = sys.argv[1] else: search_str = 'Radiohead' sp = spotipy_twisted.Spotify() result = sp.search(search_str) pprint.pprint(result)
{ "content_hash": "3ae6de23a19f9a598048d5a84e61e9fe", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 30, "avg_line_length": 18.333333333333332, "alnum_prop": 0.7136363636363636, "repo_name": "jimcortez/spotipy_twisted", "id": "e29fdac4e2b4a950d9b771942b48c8878a73b929", "si...
import sys, os, string, argparse import pyfits import numpy as np from PySpectrograph import Spectrum from PySpectrograph.Utilities.fit import interfit from redshift import xcor_redshift, loadtext, loadiraf, loadsdss import pylab as pl def redshift_all(infile, z1=0.0001, z2=1.200, plot_result=True, show=False): ...
{ "content_hash": "5786b89210128d6917c374f540c06f3d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 100, "avg_line_length": 33.74025974025974, "alnum_prop": 0.6393379522709777, "repo_name": "crawfordsm/zSALT", "id": "10985af3c5dc7d0d9e3eac44ff84914c0f7833ff", "size": "259...