text
stringlengths
4
1.02M
meta
dict
""" Wyoming offers XLS files containing precinct-level results for each county for all years except 2006. Elections in 2012 and 2010 are contained in zip files on the SoS site and These are represented in the dashboard API as the `direct_links` attribute on elections. Zip files for 2000, 2002, 2004 and 2008 elections w...
{ "content_hash": "af4bef561cbd288c2d7d0c56d3143e67", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 150, "avg_line_length": 47.98076923076923, "alnum_prop": 0.5370741482965932, "repo_name": "openelections/openelections-core", "id": "3acacb1a521e951de90c3fdb61e7532de84eca33...
""" Django settings for es-graphite-shim project For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Quick-start development settings - unsuitable for production # Se...
{ "content_hash": "480b2dfdd19e398a19f089fe014e7e1a", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 79, "avg_line_length": 29.806818181818183, "alnum_prop": 0.6995806328631338, "repo_name": "distributed-system-analysis/es-graphite-shim", "id": "45ae87f56f0fa4cc1032fd34a63a...
""" Tests - Deuce Client - Common - Validation - Instances """ import mock from unittest import TestCase from stoplight import validate import deuceclient.api as api import deuceclient.common.validation_instance as val_instance import deuceclient.common.errors as errors from deuceclient.tests import * from deuceclien...
{ "content_hash": "c8fdc0c1e1d6d940e73815f87b90ab9b", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 29.776315789473685, "alnum_prop": 0.6800707026071586, "repo_name": "rackerlabs/deuce-client", "id": "d842e283760a49a5f2f10c988e15a05bf75275bc", "size...
"""hypothesis2 This package contains a variety of helpers for property testing using hypothesis, e.g. additional decorators, strategies, etc. """ from tests.hypothesis2.core import examples
{ "content_hash": "b24501d351b7b9b07493670eeb3a84e7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 27.428571428571427, "alnum_prop": 0.796875, "repo_name": "lidatong/dataclasses-json", "id": "86809fce8dc9515f03358c2b897bbe9d1e49604b", "size": "192",...
import os from smda.utility.PeFileLoader import PeFileLoader from smda.utility.ElfFileLoader import ElfFileLoader from smda.utility.MachoFileLoader import MachoFileLoader from smda.utility.DelphiKbFileLoader import DelphiKbFileLoader class FileLoader(object): _file_path = None _map_file = False _data = b"...
{ "content_hash": "ad98abcd747747fdad1d5ea871993954", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 85, "avg_line_length": 31.42105263157895, "alnum_prop": 0.6063651591289783, "repo_name": "danielplohmann/smda", "id": "45a0145b55f8fd489a0bae94d5f4e6354db24d4b", "size": "1...
import os import argparse keywords = {\ "mac":[\ "brew install",\ "brew cask install",\ "port install"\ ],\ "linux":[\ "apt-get install",\ "aptitude install",\ "yum install",\ "pacman install",\ "dpkg -i",\ "dnf install",\ "zypper in",\ "make install",\ "tar "\ ],\ "lua":[\ "luarocks ins...
{ "content_hash": "f5c36a59f714c60966c07d43c12a2be0", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 135, "avg_line_length": 22.75, "alnum_prop": 0.6188186813186813, "repo_name": "AlexMili/WhatInstalled", "id": "4b0b5911156215dc62e2a9ee8449bf5d4d203a5f", "size": "1456", ...
import pandas as pd import csv r = pd.read_csv('DropOutRatePrimary.csv') dropOut = pd.DataFrame(r) r2 = pd.read_csv('Countries.csv') countries = pd.DataFrame(r2) countries = countries.drop(countries.columns[[2,3,4,5,6,7,8,9,10]], axis=1) countries.columns = ['Continent','Reference Area'] result = pd.merge(dropOut, ...
{ "content_hash": "cfd6dea9384f7e94ae103c03e7ff9965", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 81, "avg_line_length": 26.40909090909091, "alnum_prop": 0.7039586919104991, "repo_name": "caHaber/caHaber.github.io", "id": "71f5958c699199fe5d6e978924b8223680e9f742", "siz...
""" WSGI config for WY CTF Website project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICA...
{ "content_hash": "1e98b1d8d7a34be4e24499ec6826fcd1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 42.6764705882353, "alnum_prop": 0.7932460372157133, "repo_name": "pattyjogal/wy_ctf_website", "id": "d708e97db641d8e81730dedb8c71053d59755419", "size...
from django import db from django.conf import settings from django.core.management.base import NoArgsCommand from data.models import AnnualStateEnergyExpenditures import csv # National Priorities Project Data Repository # import_energy_consumption_state_annual.py # Updated 1/14/2010, Joshua Ruihley, Sunlight Foundati...
{ "content_hash": "094c177d51cf2e7ca0ac9095916eeded", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 119, "avg_line_length": 40.916666666666664, "alnum_prop": 0.5570264765784114, "repo_name": "npp/npp-api", "id": "f0fddd4d50db06711c8ef8bcd5a176b40794d936", "size": "1964", ...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('manutencao', '0006_0006_fo2_man_user_tipo_maq'), ] operations = [ migrations.AddField( model_name='maquina', ...
{ "content_hash": "51436e3e1ae63afdbf8400a6630cbc9a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 112, "avg_line_length": 25.35, "alnum_prop": 0.6193293885601578, "repo_name": "anselmobd/fo2", "id": "b13c4452269f4cf09b5334fe3bcbe65024ab07a8", "size": "581", "binary": ...
from .service_principal_base import ServicePrincipalBase class ServicePrincipalCreateParameters(ServicePrincipalBase): """Request parameters for creating a new service principal. All required parameters must be populated in order to send to Azure. :param account_enabled: whether or not the service princ...
{ "content_hash": "984270005a7800f39c2a4dd212ed9c99", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 95, "avg_line_length": 43.520833333333336, "alnum_prop": 0.6792723791287697, "repo_name": "Azure/azure-sdk-for-python", "id": "ec6daf3704143337c54d5691ef15f05d5d5d8d6b", "s...
from pyspark.tests import ReusedPySparkTestCase, PySparkTestCase from cleaning.run import run from pyspark.ml import clustering class TestRun(PySparkTestCase): def test_run(self): print(clustering.__all__) self.fail() def test_parse_algorithm_variables(self): self.fail()
{ "content_hash": "53503392047feb3cf0c606f2575fec98", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 64, "avg_line_length": 20.6, "alnum_prop": 0.7119741100323624, "repo_name": "mssalvador/WorkflowCleaning", "id": "b5f0b870bff63e4d763f5cabc58fc90fab534961", "size": "309", ...
import os import ConfigParser import Leap from Leap import CircleGesture, SwipeGesture class GestureListener(Leap.Listener): def __init__(self): super(GestureListener, self).__init__() self.config = ConfigParser.ConfigParser() self.gestures_stopped = { "circleleft": 0, ...
{ "content_hash": "99febf05f803576711e666b47759ec69", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 154, "avg_line_length": 33.05882352941177, "alnum_prop": 0.5245551601423487, "repo_name": "dylian94/LeapGestureControl", "id": "205287fcddaeb22722edbeb3e2e1724e47de8373", ...
""" test_django-excel-to-model ------------ Tests for `django-excel-to-model` models module. """ from django.test import TestCase # from unittest import TestCase from django_excel_to_model.openpyxl_reader import OpenpyxlExcelFile from sap_asset_master_data20191224.models import mapping class TestOpenpyxl(TestCase)...
{ "content_hash": "6f0dcaceb433b54d79cb9069a2eda2dc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 93, "avg_line_length": 23.035714285714285, "alnum_prop": 0.6697674418604651, "repo_name": "weijia/django-excel-to-model", "id": "b078190b27e28c76e2f6312fda29c3c87dbe3e12", ...
import sys import time import pymongo import numpy.random as npr from abstractdb import AbstractDB from spearmint.utils.compression import compress_nested_container, decompress_nested_container class MongoDB(AbstractDB): def __init__(self, database_address='localhost', database_name='spearmint'):...
{ "content_hash": "d523932c3aa181201c2b2fec202e96cc", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 103, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6318807339449541, "repo_name": "fmaguire/BayeHem", "id": "28ab540774a13bb4f41fa1a3eda3e50d327def0b", "size": "12...
import os from multiprocessing import cpu_count from typing import List import numpy as np import tensorflow as tf from sklearn import datasets from sklearn.model_selection import train_test_split from ._base import ImageDataset def make_halfmoons(n_samples_per_factors=200, image_size=64, ...
{ "content_hash": "62cfca5b21e242840482654c4f8991bd", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 80, "avg_line_length": 31.445714285714285, "alnum_prop": 0.565328002907505, "repo_name": "imito/odin", "id": "80d15a1b246a82bafd95e0f851bac60aea5a8cca", "size": "5503", ...
__author__ = 'buec' import modgrammar import sys from pyspeechgrammar import model class JavaIdentifier(modgrammar.Grammar): grammar_whitespace_mode = 'explicit' grammar = (modgrammar.WORD("A-Za-z$", "A-Za-z0-9_$")) def grammar_elem_init(self, session_data): self.value = self[0].string class ...
{ "content_hash": "1c5152ee66b9b0c473561295f69f44cc", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 121, "avg_line_length": 33.3133514986376, "alnum_prop": 0.5956976934402094, "repo_name": "ynop/pyspeechgrammar", "id": "7ec168dc04ecd5200f81bb19120bdf3b88910147", "size": ...
""" ======================================== Cell Tracking (:mod:`tracking.core`) ======================================== .. currentmodule:: tracking.core TITAN cell tracking ================ .. autosummary:: :toctree: generated/ Cell_tracks """ #from .cell_tracking import Cell_tracks from .tracks import Cel...
{ "content_hash": "d7369c29d95afac6765cc3c50a434d51", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 23.27777777777778, "alnum_prop": 0.5322195704057279, "repo_name": "mhpicel/tracking", "id": "90eb0aa773644deec03de82ec4a099bae81c6e7f", "size": "466"...
from flask import Flask, render_template from datetime import datetime, timedelta import sqlite3 import json import random app = Flask(__name__) def randomRGB(): r, g, b = [random.randint(0,255) for i in range(3)] return r, g, b, 1 @app.route('/') def index(): conn = sqlite3.connect("ruuvitag.db") conn.ro...
{ "content_hash": "049b69c95d033b18c7776522fbdce5f3", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 175, "avg_line_length": 29.15, "alnum_prop": 0.6512292738707833, "repo_name": "dimamedia/RuuviTag-logger", "id": "261377b5b0ce53f47483caa30edb4ff38103ed25", "size": "1769",...
import sys, os, unittest, manageconfigs as mc from optparse import OptionParser ########################################## def eval1(x,y,z): return x*y+z def eval2(x,y,z): return x+y+z @mc.manageConfigs def sampleFunction(x, y, z=5, func=eval1, cat='test.cat'): return cat, func(x,y,z) @mc.manageConfigs def samp...
{ "content_hash": "91147e7892cc833ccb883dd53b332880", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 126, "avg_line_length": 25.184971098265898, "alnum_prop": 0.617282533853569, "repo_name": "deapplegate/wtgpipeline", "id": "056a02dbdd8d60d5ee286aa0493b5216319e304d", "siz...
from django.contrib import admin from django import forms from django.contrib.auth.models import User from mezzanine.core.admin import TabularDynamicInlineAdmin, SingletonAdmin from mezzanine.pages.admin import PageAdmin from models import SiteConfiguration, HomePage, IconBox, UserQuota, QuotaMessage class IconBoxI...
{ "content_hash": "5d24af347ec34ea4eefbdb497daa9180", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 82, "avg_line_length": 31.037735849056602, "alnum_prop": 0.7082066869300911, "repo_name": "ResearchSoftwareInstitute/MyHPOM", "id": "2ed01a3f01d11016c5befb6367ac07553c35ff70"...
"""This file contains code for use with "Think Bayes", by Allen B. Downey, available from greenteapress.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division from thinkbayes2 import Suite class M_and_M(Suite): """Map from ...
{ "content_hash": "d174f2020078ff4945ca6760adbb0a5d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 68, "avg_line_length": 22.89830508474576, "alnum_prop": 0.533678756476684, "repo_name": "AllenDowney/ThinkBayes2", "id": "25482cd62624a966df02882c2c55934e0963177d", "size":...
import antlr import LexedParser import LexedLexer from iterablefromtokenstream import IterableFromTokenStream class PepperTokenStreamFromFile( antlr.TokenStream, IterableFromTokenStream ): def __init__( self, fl ): self.lexed_parser = LexedParser.Parser( LexedLexer.Lexer( fl ) ) def next...
{ "content_hash": "2c9094e7c78e7ba23baab65a04f58597", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 26.36842105263158, "alnum_prop": 0.6646706586826348, "repo_name": "andybalaam/pepper", "id": "580363b094bd306f6c8b8552dfa030d40c11a6fa", "size": "640...
"""Basic test of tone synthesis with `muser.live.Synth`""" import muser.live as live import math import time synth = live.Synth(channels=2) def synth_on(synth, duration, pause=0): """Activate synth's tone generation for a time, then pause.""" synth.toggle() time.sleep(duration) synth.toggle() tim...
{ "content_hash": "e764f3638b0c4b35dcf9d21363c89620", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 68, "avg_line_length": 27.026315789473685, "alnum_prop": 0.688412852969815, "repo_name": "laporte-m/muser", "id": "3214d68fa38d19f38614b0c9ae58e997676b1446", "size": "1027"...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Logit'] , ['Lag1Trend'] , ['BestCycle'] , ['MLP'] );
{ "content_hash": "537eb17aec6aa51e80287f1122836698", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 37, "alnum_prop": 0.6959459459459459, "repo_name": "antoinecarme/pyaf", "id": "e82818715f07add59aa63fd0c3c435a1372270df", "size": "148", "binary": f...
from pyravendb.connection.requests_factory import HttpRequestsFactory from pyravendb.custom_exceptions import exceptions from pyravendb.d_commands import database_commands from pyravendb.data.document_convention import DocumentConvention from pyravendb.hilo.hilo_generator import HiloGenerator from pyravendb.data.databa...
{ "content_hash": "3d6e6d05a22a1945b89627f05e4dc489", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 115, "avg_line_length": 48.92941176470588, "alnum_prop": 0.6576100024044241, "repo_name": "IdanHaim/RavenDB-Python-Client", "id": "53b4613fea95d97b13c7d0716c46ee376da9675d", ...
from collections import defaultdict import torch import pyro.distributions as dist from pyro import poutine from pyro.distributions.util import sum_leftmost from pyro.poutine.messenger import Messenger from pyro.poutine.util import site_is_subsample def _make_cls(base, static_attrs, instance_attrs, parent_linkage=N...
{ "content_hash": "37e8df10b3c2ab326b2669324784f936", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 91, "avg_line_length": 37.27800829875519, "alnum_prop": 0.6342386464826358, "repo_name": "uber/pyro", "id": "e1332eb652c26bf88f94e941116bbdc2fefc6cb6", "size": "9073", "...
import sys import os class Path: """Implementation of the PATH programming language in Python.""" # This class uses the following data attributes: # x: current x position # y: current y position # p: current memory cell pointer # d: current direction # s: whether the next cell is being ski...
{ "content_hash": "61b4f3bd306080222fbbc451310fd07b", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 91, "avg_line_length": 35.90376569037657, "alnum_prop": 0.5280270364759352, "repo_name": "mruffalo/path", "id": "52730e6f1dd262aede8560ada89b1a567dcfc07a", "size": "9698",...
from flask import Flask from bugsnag.flask import handle_exceptions import bugsnag.notification from tests.utils import IntegrationTest class SentinelError(RuntimeError): pass class TestFlask(IntegrationTest): def setUp(self): super(TestFlask, self).setUp() bugsnag.configure(use_ssl=False, ...
{ "content_hash": "64c5bc9961f1eca646b5a87063c68428", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 78, "avg_line_length": 34.362694300518136, "alnum_prop": 0.5604644149577804, "repo_name": "overplumbum/bugsnag-python", "id": "5a2fac5665fdb7848b035cac80a383feed2cd7e4", "...
from __future__ import unicode_literals, division import os import re import urllib2 import random from django.core.files.base import File, ContentFile from django.core.files.storage import Storage, default_storage from django.utils.functional import LazyObject, empty from sorl.thumbnail import default from sorl.thumb...
{ "content_hash": "b10d3b02743067a5c6801b9ec1c499ea", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 89, "avg_line_length": 27.53061224489796, "alnum_prop": 0.5774647887323944, "repo_name": "chriscauley/sorl-thumbnail", "id": "f66b340386d8bf094dbf8ba39693a31360f707c7", "s...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0002_auto_20171201_0344'), ] operations = [ migrations.RemoveField( model_name='profile', ...
{ "content_hash": "ba2bbfeed49ccd2ef7a1372f2e95954a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 112, "avg_line_length": 28.06896551724138, "alnum_prop": 0.5872235872235873, "repo_name": "AShedko/kicktravel", "id": "5f08ea2e9e30c34ae234ee18ee176f96d50c87b9", "size": "8...
import logging from config import ACCOUNTING_MAIL_RECIPIENT, LOG_LEVEL, REDIS_URL, TIMEZONE, UPDATE_STRIPE_FEES from datetime import datetime, timedelta from pytz import timezone from celery import Celery import redis from charges import amount_to_charge, calculate_amount_fees, charge, ChargeException from npsp impor...
{ "content_hash": "52d2e97181fb069f1be9960d6f3affc0", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 199, "avg_line_length": 25.313513513513513, "alnum_prop": 0.618193465727098, "repo_name": "MinnPost/salesforce-stripe", "id": "55243ca057ad381738d29afb149c7f6878990f46", "...
import logging log = logging.getLogger(__name__) import os import uuid from flask import ( render_template, request, send_from_directory, abort, jsonify, Response, redirect, url_for ) from six import string_types from bokeh import protocol from bokeh.exceptions import DataIntegrityException from bokeh.resour...
{ "content_hash": "39fa9ac6740eb03000903bc323f6335a", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 112, "avg_line_length": 34.579754601226995, "alnum_prop": 0.6280493213873858, "repo_name": "jakevdp/bokeh", "id": "18a08ade4975480dc003391d250d1dc57371ec70", "size": "1127...
import datetime import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.extend([ os.path.abspath("../.....
{ "content_hash": "7f378d7c13f0e7169f7fca86451b1296", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 80, "avg_line_length": 31.443089430894307, "alnum_prop": 0.6947640594699418, "repo_name": "pandeyop/rally", "id": "d92550e705f3b9cb28aab1e290e4829cebacb22e", "size": "8151...
import os import inspect import tempfile from logbook import Logger from contextlib import contextmanager modules = set() from typing import List, Dict, TypeVar, Any, Callable T = TypeVar("T") def get_logger(name: str) -> Logger: """ Returns a logging provider :param name: name for logger :return: lo...
{ "content_hash": "04a5cf1f6c385939a4018884818a254f", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 90, "avg_line_length": 22.436046511627907, "alnum_prop": 0.5871987561544442, "repo_name": "zaibacu/wutu-compiler", "id": "0f3c1acd3b63037f44d349e3d87a6d8cca351d37", "size"...
import os DEBUG = False ALLOWED_HOSTS = ['*'] LANGUAGE_CODE = 'en-us' ROOT_URLCONF = 'urls' SECRET_KEY = '12345abcd' SITE_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../') SITE_ID = 1 TIME_ZONE = 'UTC' USE_I18N = True UMANAGE_BASE_TEMPLATE = 'base_umanage.html' UMANAGE_BASE_UNAUTHENTICATED_TEMP...
{ "content_hash": "66c00681dc1963999132518a212ba1b2", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 25.754716981132077, "alnum_prop": 0.6857142857142857, "repo_name": "InfoAgeTech/django-umanage", "id": "aab2021f97b510ea58bbe8a046e6ccf0fb5791a9", "s...
from django.template import Context, Library register = Library() @register.simple_tag(takes_context=True) def section(context, section_name): try: data = context['infos'][section_name].items() except KeyError as e: accepted = ",".join(context['infos'].keys()) raise KeyError("Section ...
{ "content_hash": "ed8424edb59c8f4dfa7c2ceac690bd0e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 78, "avg_line_length": 27.636363636363637, "alnum_prop": 0.6299342105263158, "repo_name": "saxix/django-sysinfo", "id": "06e9725caf1281b8fbaa973e702ad0321fcb9378", "size": ...
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "Torrentcoin-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.replace(...
{ "content_hash": "c04a32ff075d5309c42e6f708d985cc3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 27.375, "alnum_prop": 0.710806697108067, "repo_name": "torrentcointeam/torrentcoin", "id": "d8fa40e5b23e3f22c2dc73fa6565d88ac8b62206", "size": "903",...
"""Base class for sparse matrices""" from __future__ import division, print_function, absolute_import import numpy as np from .sputils import (isdense, isscalarlike, isintlike, get_sum_dtype, validateaxis, check_reshape_kwargs, check_shape, asmatrix) __all__ = ['spmatrix',...
{ "content_hash": "656be6e0e6cccee76a8ba391198bd2eb", "timestamp": "", "source": "github", "line_count": 1220, "max_line_length": 80, "avg_line_length": 33.84918032786885, "alnum_prop": 0.545597636574971, "repo_name": "arokem/scipy", "id": "4db1522952cb14d0209fbdfddb4a8d64b48b64b1", "size": "41296",...
import scrapy import unicodedata import re from locations.items import GeojsonPointItem regex = r"(^\D)" regex_time = r"(1[0-2]|0[1-9]|[1-9]):[0-5]\d\s?[AaPp][Mm]" regex_am = r"\s?([Aa][Mm])" regex_pm = r"\s?([Pp][Mm])" class MonicalsSpider(scrapy.Spider): name = 'monicals' allowed_domains =['www....
{ "content_hash": "d7fcdcf785ab870dc97e1a9113fd5ebb", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 79, "avg_line_length": 38.652482269503544, "alnum_prop": 0.44403669724770645, "repo_name": "iandees/all-the-places", "id": "8f2235b007e39bd61780356a1e0a73f5482ba296", "siz...
import unittest,AmConfig.appconf,AmConfig.domainconfig,os class TestConfigReader(unittest.TestCase): def test_readappconf(self): conf = AmConfig.appconf.AppConf(self._mainConfig) self.assertIsNotNone(conf.MonitorInterval) self.assertEqual(conf.MonitorInterval,20) self.assertEqual(co...
{ "content_hash": "14dbf5995fabac2b4aadbba1754d98fa", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 43.34615384615385, "alnum_prop": 0.6903283052351376, "repo_name": "jinhong666/Python", "id": "f81786ded9d156f2edd8d984f597a62d7e738773", "size": "112...
''' Copyright 2012 Upverter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
{ "content_hash": "2cdc292d96e264d0fd11294608a398ad", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 169, "avg_line_length": 34.66831683168317, "alnum_prop": 0.6487219762958732, "repo_name": "Beanstream-DRWP/beanstream-python", "id": "2d94a8b48aa0b5dc97d39bfaddc154bd5e8b008...
import sys reload(sys) sys.setdefaultencoding('utf-8') import os import time import json from functools import wraps from flask import Flask from flask import render_template from flask import request from flask import redirect from flask import session from flask import flash import gconf import user import logscoun...
{ "content_hash": "39dbf6446b25386a7b855675f9e16953", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 123, "avg_line_length": 31.3125, "alnum_prop": 0.6790419161676646, "repo_name": "51reboot/actual_09_homework", "id": "1aaee2a3487f4a4e6fd479973aecac344316a489", "size": "5...
import win32api import win32con import time import math def move(x, y): """ Moves the cursor to (x, y) :param x: target x-ordinate :param y: target y-ordinate :return: None """ win32api.SetCursorPos((x, y)) def move_line(x, y, speed = 1): """ Moves the cursor in a straight line...
{ "content_hash": "346fc4b069c5c66e0ecac8b5073f116e", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 112, "avg_line_length": 30.00763358778626, "alnum_prop": 0.5779699821928262, "repo_name": "EwilDawe/typy", "id": "24aac63613caca110c84edc623235057ec683b23", "size": "3933"...
from pyro.contrib.funsor.handlers.primitives import to_data from pyro.poutine.replay_messenger import ReplayMessenger as OrigReplayMessenger class ReplayMessenger(OrigReplayMessenger): """ This version of :class:`~ReplayMessenger` is almost identical to the original version, except that it calls :func:`~p...
{ "content_hash": "fd5fc76dc06d580b8744a48e98a03fed", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 97, "avg_line_length": 45.23684210526316, "alnum_prop": 0.6009307737056429, "repo_name": "uber/pyro", "id": "2f6a76033aaccfe1f983b79fe8643c75b31736ff", "size": "1804", "b...
DOCUMENTATION = ''' --- module: dircopy short_description: copies directories recursively. Intended to bypass the slowness problem with Ansible copy module. description: - Using the C tar create one file to transfer it to the target host(s) (using Ansible built-in copy module) and to check/update the...
{ "content_hash": "4e48fe646539046bbb4f2be21e50f51a", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 120, "avg_line_length": 37.38074398249453, "alnum_prop": 0.5547620441374466, "repo_name": "namondo/ansible-dircopy", "id": "c38a1328946e58708e4f7360d15dcc16f3cf093d", "siz...
""" This module contains functions for solving for the steady state density matrix of open quantum systems defined by a Liouvillian or Hamiltonian and a list of collapse operators. """ # The only substantial change is the use of my liouvillian function! __all__ = ['steadystate', 'steady', 'build_preconditioner', ...
{ "content_hash": "392034e52313c0195904445d8280f4df", "timestamp": "", "source": "github", "line_count": 1059, "max_line_length": 102, "avg_line_length": 38.25023607176582, "alnum_prop": 0.5801713284123732, "repo_name": "diego-bernal/quantum", "id": "45a9935188f9859457092b314576102cea0acd7e", "size"...
"""Input layer code (`Input` and `InputLayer`). """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import context from tensorflow.python.framework import tensor_shape from tensorflow.python.keras import backend as K from tensorf...
{ "content_hash": "9ae2b0345bef47eff720854ceaa56994", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 85, "avg_line_length": 34.27906976744186, "alnum_prop": 0.6316146540027137, "repo_name": "nburn42/tensorflow", "id": "b04dc3c60be2a9e13cb1bc56ef12f0de36ed105c", "size": "8...
import sys from oslo.config import cfg from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.v2 import attributes from neutron.common import constants as q_const from neutron.com...
{ "content_hash": "a24cee52afbad9fd82d5e71b28232bf3", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 79, "avg_line_length": 46.26047358834244, "alnum_prop": 0.5712091979367642, "repo_name": "CiscoSystems/quantum", "id": "b98892966d746d102748ffe7a5d842ddc61e43c7", "size": ...
import unittest from tests.FileHandleContainerTestBase import FileHandleContainerTestBase from splitviewfuse.filehandlecontainers.VirtualFileSegmentFileHandleContainer import VirtualFileSegmentFileHandleContainer class TestVirtualFileSegmentFileHandleContainer(FileHandleContainerTestBase, unittest.TestCase): def...
{ "content_hash": "56c36f77ef96a25e8e9575a98cc64823", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 122, "avg_line_length": 38.7, "alnum_prop": 0.7803617571059431, "repo_name": "seiferma/splitviewfuse", "id": "437a49b2ad80b7a03aec49bcc55f6b4c6172475c", "size": "774", "b...
from __future__ import absolute_import, division, print_function import warnings from os.path import basename from collections import OrderedDict from glue.core.coordinates import coordinates_from_header, WCSCoordinates from glue.core.data import Component, Data from glue.config import data_factory, qglue_parser __...
{ "content_hash": "653f1b812b8a0887119bc3fe5c35de32", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 112, "avg_line_length": 30.028985507246375, "alnum_prop": 0.5928249678249679, "repo_name": "stscieisenhamer/glue", "id": "53e3a44fd6a80b952f4413d6dbb8183ca5b322cf", "size"...
"""Tests for DancingCatch.""" from absl.testing import absltest from absl.testing import parameterized from csuite.environments import dancing_catch class DancingCatchTest(parameterized.TestCase): def test_environment_setup(self): """Tests environment initialization.""" env = dancing_catch.DancingCatch() ...
{ "content_hash": "86f646311f6a0e06e392ecd784b1b68f", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 74, "avg_line_length": 32.41, "alnum_prop": 0.6590558469608145, "repo_name": "deepmind/csuite", "id": "89cc24fa789fcd53fba335756f283f71c94033b8", "size": "3938", "binary...
import os import keras import numpy as np from sklearn import preprocessing from sklearn.model_selection import train_test_split from lang_config import * def count_chars(text): """ Counts number of chars in text based on given alphabet. """ alphabet_counts = [0] * len(alphabet) for char in text:...
{ "content_hash": "6641351224f17d916cba4b1be6a70f87", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 108, "avg_line_length": 27.70469798657718, "alnum_prop": 0.6327519379844961, "repo_name": "MaKToff/SPbSU_Homeworks", "id": "0ad03df7e2ff6637eedee1d23642f1a7f6d75cca", "siz...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.stanza import Error from sleekxmpp.stanza.rootstanza import RootStanza from sleekxmpp.xmlstream import StanzaBase, ET class Mes...
{ "content_hash": "fa6e60f1075c6e629036f540faa6b48d", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 78, "avg_line_length": 30.64968152866242, "alnum_prop": 0.6084788029925187, "repo_name": "Petraea/jsonbot", "id": "19d4d9e27c1353ce81b69affa35c68fd323683ac", "size": "4812...
import unittest import random import sys from types import IntType, DictType, ListType, StringType, FloatType # import classes import analytics.utils.misc as misc import analytics.exceptions.exceptions as ex from analytics.core.dataitem import DataItem from analytics.core.cluster import Cluster from analytics.core.elem...
{ "content_hash": "b7a36c43d7c5b3544b7115731bbc6991", "timestamp": "", "source": "github", "line_count": 576, "max_line_length": 81, "avg_line_length": 39.68402777777778, "alnum_prop": 0.565228803919853, "repo_name": "sadikovi/pulsar", "id": "5c3545646f909f41125624dfc1114d071cdc009a", "size": "22895...
""" sphinx.builders.latex.transforms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Transforms for LaTeX builder. :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from typing import cast from docutils import nodes from sphinx import addnodes from sp...
{ "content_hash": "8cbc80ccfe88fd4c4455f1d0df5c3897", "timestamp": "", "source": "github", "line_count": 641, "max_line_length": 93, "avg_line_length": 31.282371294851796, "alnum_prop": 0.5269798523838021, "repo_name": "lmregus/Portfolio", "id": "52d5bc9ea544d6d2780c529c698d7b4b7ef1904c", "size": "2...
"""Sonnet module information, stored in the graph collections.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections # Dependency imports import six from sonnet.protos import module_pb2 from sonnet.python.modules import base_errors import te...
{ "content_hash": "e578b27182b4622dd2213c3f099a9e76", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 80, "avg_line_length": 36.34453781512605, "alnum_prop": 0.6957996146435452, "repo_name": "rakshit-agrawal/sonnet", "id": "127ada8a91d3b2be33f01d1d77a6d447162a382e", "size"...
from locust import HttpLocust, TaskSet, task class WebsiteTasks(TaskSet): @task def debug(self): self.client.get("/debug") class WebsiteUser(HttpLocust): task_set = WebsiteTasks # min_wait = 5000 # max_wait = 15000
{ "content_hash": "ec4d84774b8a172ec4fbabbaeb002280", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 44, "avg_line_length": 22.272727272727273, "alnum_prop": 0.6653061224489796, "repo_name": "2peppers/shot", "id": "805f88c61dc34e0b112d2ea8f5f73d46675437a8", "size": "245", ...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_get_deleted_service_by_name.py Before run the sample, please set the values of th...
{ "content_hash": "bb9f30bacccd71bb55069274c56ee387", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 159, "avg_line_length": 33.515151515151516, "alnum_prop": 0.7377938517179023, "repo_name": "Azure/azure-sdk-for-python", "id": "e0456001a1d339153e195c57f810bc7b25201c0f", "...
import sys import logging logging.basicConfig(level=logging.DEBUG) def load_data(filename): with open(filename) as f: n = int(f.readline()) #logging.debug('n is {n}'.format(n=n)) get_line = lambda : f.readline().replace('\n','').replace('\r','') dna = '' gene_predict = [] for i in range(0,n/80): dn...
{ "content_hash": "8bef379618cd09a99feb30a59c2ce2fa", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 93, "avg_line_length": 24.620689655172413, "alnum_prop": 0.6078431372549019, "repo_name": "andersoncardoso/coding_challenges", "id": "991d18c836225571669b96e3a062816fdaf26d89...
import hashlib import mimetools import os import shutil import subprocess import sys import tempfile import urllib2 sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from rbtools import __version__, __version_info__, is_release PY_VERSIONS = ["2.4", "2.5", "2.6", "2.7"] LATEST_PY_VERSION = PY_...
{ "content_hash": "380be7fa79f4ed86e184a0076fd94cc9", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 80, "avg_line_length": 26.033175355450236, "alnum_prop": 0.5545239395594392, "repo_name": "blair/pkg-rbtools", "id": "cad99d4db083e50d2ba66202ef65faa9335bb5fe", "size": "5...
"""Compile a subset of LaTeX to HTML.""" from __future__ import unicode_literals import os import io import nikola.plugin_categories import nikola.utils import re import json from . import parser, htmlify LOGGER = nikola.utils.get_logger('compile_latex', nikola.utils.STDERR_HANDLER) class LaTeXContext(object): ...
{ "content_hash": "1692fae8ff58bbddc86f6b00d9cc6a1b", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 178, "avg_line_length": 47.103857566765576, "alnum_prop": 0.6021796648607787, "repo_name": "getnikola/plugins", "id": "baf9e3140dc912ad70478902bb7ca47146e4cd13", "size": "...
import unittest from nosedep import depends class DisplayNodeList(unittest.TestCase): @depends(after='test_02') def test_01(self): pass @depends(after='test_03') def test_02(self): pass @depends(after='test_04') def test_03(self): pass def test_04(self): ...
{ "content_hash": "6b8ec68fea58b841dd865247868ef1eb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 41, "avg_line_length": 17.105263157894736, "alnum_prop": 0.6030769230769231, "repo_name": "Zitrax/nose-dep", "id": "e4a25cd0514f94c090e9e27d5be06fb2a338b541", "size": "325"...
import ConfigParser import os from crontab import CronTab import MySQLdb import yum import sys import subprocess import shutil #This first section is about interpteting the configuration file This seciont includes details on how # to confugre the variables that are in the first section and convert them to be used by th...
{ "content_hash": "de3d8c8ad5f4a244dfc7b645da0c338e", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 143, "avg_line_length": 38.436708860759495, "alnum_prop": 0.7095340029639388, "repo_name": "manhof/test_isp_curl", "id": "3b469ab982ee566756fd996230ebd3e7fd16e5c8", "size"...
import asyncio import json import logging import os from async_generator import asynccontextmanager from typing import Text, Union, Optional, AsyncGenerator from rasa.shared.exceptions import RasaException, ConnectionException import rasa.shared.utils.common from rasa.core.constants import DEFAULT_LOCK_LIFETIME from ...
{ "content_hash": "68953699f0cb618e6ad7c937a0f50ca7", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 88, "avg_line_length": 34.438066465256796, "alnum_prop": 0.6241775594350382, "repo_name": "RasaHQ/rasa_nlu", "id": "ac78da3df30f95b31fdb4a80114efd1c68bd6067", "size": "113...
from setuptools import setup, find_packages with open('requirements.txt') as f_in: lines = (l.strip() for l in f_in.readlines()) install_requires = [l for l in lines if l and not l.startswith('--')] with open('README.md') as f_in: long_description = f_in.read() setup( name='fangorn', version='0.0...
{ "content_hash": "bf7f7e698bf83b0f6975a7ab205d43f2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 25.806451612903224, "alnum_prop": 0.605, "repo_name": "lwbrooke/slackbot", "id": "afcfde367eacc94a5affd6297cdb52fa676cba68", "size": "800", "binary...
""" Human Resource Management """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) s3db.hrm_vars() # ============================================================================= def index(): """ Module H...
{ "content_hash": "b0d047d0a33f185fbd7eb1ed737143ad", "timestamp": "", "source": "github", "line_count": 878, "max_line_length": 138, "avg_line_length": 37.50227790432802, "alnum_prop": 0.48306860631093024, "repo_name": "smeissner/eden", "id": "b0fd452987582d0b38d1807f2114656a9549bcd6", "size": "329...
from __future__ import unicode_literals from django.db import migrations from django.db import connection from bluebottle.clients.utils import LocalTenant def update_time_spent(apps, schema_editor): TaskMember = apps.get_model('tasks', "TaskMember") with LocalTenant(connection.tenant): for tm in ...
{ "content_hash": "5c7ae1b69be121b86624d53ad7fe6490", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 27.52, "alnum_prop": 0.6540697674418605, "repo_name": "onepercentclub/bluebottle", "id": "b9555fd6044e0fedc3f7ee47b6704b5e4dcbe0ab", "size": "760", ...
__author__ = 'alandinneen' from MySQLdb import connect, Error from collections import OrderedDict class DBConn(object): """ A class to handle all MySQL connection reads/writes. """ def __init__(self, host=None, db=None, user=None, password=None): self._host = host self._db = db ...
{ "content_hash": "1fe015a3f41b63a1bc111b5740c80af6", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 115, "avg_line_length": 30.954545454545453, "alnum_prop": 0.5380323054331865, "repo_name": "rad08d/mysqlconn", "id": "216c07714d35590bc3517a1bba6dd85ddf42d1a7", "size": "3...
''' Share commands ''' import json import qumulo.lib.opts import qumulo.lib.util import qumulo.rest.nfs as nfs import qumulo.rest.users as users from qumulo.rest.nfs import NFSRestriction def convert_nfs_user_mapping(name): convert = { 'none': 'NFS_MAP_NONE', 'root': 'NFS_MAP_ROO...
{ "content_hash": "66ff1b77ef9b56c5bbe113639756f4fe", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 79, "avg_line_length": 39.99145299145299, "alnum_prop": 0.5960675357982474, "repo_name": "Qumulo/qumulo_splunk_app", "id": "6d27080036661982f8dc7746e3d44bb9b719746e", "siz...
""" You are given a string of lowercase letters. Your task is to figure out the index of the character on whose removal will make the string a palindrome. There will always be a valid solution. In case string is already palindrome, then -1 is also a valid answer along with possible indices. Input Format The first lin...
{ "content_hash": "5037d5db075cecb6f36521f232ffe904", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 120, "avg_line_length": 24.88888888888889, "alnum_prop": 0.546875, "repo_name": "algorhythms/HackerRankAlgorithms", "id": "ad7bb2c9cdfdf553a20e280b5c4d1050472999b7", "size"...
from oslo_log import log from manila.common import constants from manila.share import driver from manila.tests import fake_service_instance LOG = log.getLogger(__name__) class FakeShareDriver(driver.ShareDriver): """Fake share driver. This fake driver can be also used as a test driver within a real run...
{ "content_hash": "83dc7559042ddd66ddfff063e3e03d34", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 77, "avg_line_length": 31.45045045045045, "alnum_prop": 0.6390718991692924, "repo_name": "openstack/manila", "id": "b75508e7831e43c6c95467c8d15ef969dbf541bc", "size": "414...
from pytest import fixture from solar.system_log import change from solar.system_log import data from solar.system_log import operations from solar.core.resource import resource from solar.interfaces import orm def test_revert_update(): commit = {'a': '10'} previous = {'a': '9'} res = orm.DBResource(id='t...
{ "content_hash": "92f34d306626d2a4e5d6b9ce9fbe85c3", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 27.612903225806452, "alnum_prop": 0.6845794392523364, "repo_name": "torgartor21/solar", "id": "be36e5a74bdce01593e4d76a07573c2b19f105aa", "size": "14...
from base import TestRailAPIBase class Suite(TestRailAPIBase): """ Use the following API methods to request details about test suites and to create or modify test suites. """ def __repr__(self): return '<TestRailAPI suite>' def get(self, suite_id): """ Returns an exist...
{ "content_hash": "937123f7cd4cb4536dc23ef2b971759e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 81, "avg_line_length": 33.905660377358494, "alnum_prop": 0.5909849749582637, "repo_name": "JASON0916/testrail-library", "id": "04796643f9afcdd5ff4fa48f89887ffa2ee769ba", "s...
import pytest import loginsightwebhookdemo.slack import conftest NUMRESULTS = '1' # A public URL for testing Teams is not available URL = 'https://mock.test' @pytest.mark.parametrize("url,post,data,expected,method", [ # No URL (None, '/endpoint/msteams', conftest.payload, '500 INTE...
{ "content_hash": "cfaf949178ed8f4e65245e1d34cd9348", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 84, "avg_line_length": 27.442307692307693, "alnum_prop": 0.606166783461808, "repo_name": "vmw-loginsight/webhook-shims", "id": "dfaf57b1f3c6316c8a6d421e94712dd86cd1d263", "...
""" WSGI config for canvas project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
{ "content_hash": "e6ceedd6fac25e7021a6ea558e552676", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.375, "alnum_prop": 0.7692307692307693, "repo_name": "eshamay/score", "id": "642343c7b8e871458c3aa6d8eb2c76123a24ea67", "size": "390", "binary": ...
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WH...
{ "content_hash": "7681aa73a44bef51d639e1498d490292", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 80, "avg_line_length": 30.166666666666668, "alnum_prop": 0.739542225730071, "repo_name": "jeremiedecock/snippets", "id": "5f1fe22180d69aedbb822668c96ea7c140c19deb", "size":...
import nghttp2 import logging import asyncio import sys import os, time, io from base64 import b64decode from copy import copy, deepcopy from .config import get_config from datetime import timedelta, datetime from uuid import uuid4 as uuid from wheezy.template.engine import Engine from wheezy.template.ext.core import ...
{ "content_hash": "490583dba292f1f394fe3965dc945ac0", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 209, "avg_line_length": 35.66831683168317, "alnum_prop": 0.5944482997918112, "repo_name": "fwiesel/http2broker", "id": "3c57f63956dd5e4d5ada7cb1007736a547383f43", "size": ...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic #from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.conf import settings from managers import SynonymManager class Synon...
{ "content_hash": "dc44dc1f89ac426173d9ed83515a06ab", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 102, "avg_line_length": 27.841269841269842, "alnum_prop": 0.6482326111744584, "repo_name": "anscii/django-model-synonyms", "id": "f753f30a514b1de7e22132b19b17e70ac71d8e36", ...
import subprocess from rstgen.utils import confirm from django.core.management.base import BaseCommand from django.conf import settings def runcmd(cmd, **kw): # same code as in getlino.py """Run the cmd similar as os.system(), but stop when Ctrl-C.""" # kw.update(stdout=subprocess.PIPE) # kw.update(stder...
{ "content_hash": "16a489f6c06b7ec30cb75e406d1b07d4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 105, "avg_line_length": 38.82222222222222, "alnum_prop": 0.5804235832856325, "repo_name": "lino-framework/lino", "id": "1fdf8bff34060df4cc4393194e114b9056159b55", "size": "...
from flask import render_template, session, redirect, url_for def checkSession(): if 'username' not in session: return redirect(url_for('login'))
{ "content_hash": "fc281c3d61a2b27e7d090a5ebed60e38", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 61, "avg_line_length": 32.6, "alnum_prop": 0.6871165644171779, "repo_name": "darneymartin/ChartIT", "id": "fce8a7ccfc6b9517f0f3979678367a9c397d4577", "size": "163", "binar...
""" @package ion.agents.data.external_dataset_agent @file ion/agents/data/external_dataset_agent.py @author Tim Giguere @author Christopher Mueller @brief Class derived from InstrumentAgent that provides a one-to-one relationship between an ExternalDatasetAgent instance and a given external dataset """ from pyon.publi...
{ "content_hash": "d092bae988ec766d8eee935588e7edc3", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 149, "avg_line_length": 44.08810572687225, "alnum_prop": 0.60431654676259, "repo_name": "ooici/coi-services", "id": "aff76f7978bf42bea55b0e117a1b38f5d5d5d0e0", "size": "10...
from . import db, login_manager from werkzeug.security import generate_password_hash, check_password_hash from flask.ext.login import UserMixin, AnonymousUserMixin from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app, request, url_for from datetime import datetime import ...
{ "content_hash": "79b8380f024ed4058810ad7bf3d8f6cc", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 86, "avg_line_length": 35.98921832884097, "alnum_prop": 0.597663271420012, "repo_name": "caser789/xuejiao-blog", "id": "9b821309909809639c5cab36a1aa92cba356973f", "size": ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('forum', '0005_auto_20160803_2129'), ] operations = [ migrations.AlterModelOptions( name='tag', options={}, ), ]
{ "content_hash": "218ee1105c6020cdec488cdf6cbf180d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 45, "avg_line_length": 18.352941176470587, "alnum_prop": 0.5769230769230769, "repo_name": "rdujardin/icforum", "id": "a47c0298d646c764ed695f849eb6d43f306f450a", "size": "96...
import logging import re from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.utils.translation import gettext_lazy as _lazy from timezone_field import TimeZoneField from kitsune.lib.countries import COUNTRIES from kitsune....
{ "content_hash": "5f089157ce01589a79080fed7b2185e6", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 99, "avg_line_length": 34.312997347480106, "alnum_prop": 0.641465677179963, "repo_name": "mozilla/kitsune", "id": "b0a41bf82c5c390f614d18dd0954b0386c9441d1", "size": "1293...
cheetahVarStartToken = $ directiveStartToken = # #end compiler-settings # -*- coding: utf-8 -*- #
{ "content_hash": "e00d2a8335ae994d1556eddfaecff61e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 24, "avg_line_length": 16.333333333333332, "alnum_prop": 0.6938775510204082, "repo_name": "mabotech/maboss.py", "id": "faae1cc0c770d65929fb8c314a7f4a859f64c4a3", "size": "11...
from pprint import pprint from django.contrib.auth.mixins import PermissionRequiredMixin from fo2.connections import db_cursor_so from base.views import O2BaseGetPostView from cd.forms.add1palete import Add1PaleteForm from cd.queries.palete import custom_add_palete class Add1Palete(O2BaseGetPostView, PermissionRe...
{ "content_hash": "645da101d888f08da213f3e384c5d9d9", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 85, "avg_line_length": 32.8125, "alnum_prop": 0.6780952380952381, "repo_name": "anselmobd/fo2", "id": "e405ad00776acedaec484580c7d796df7563fba2", "size": "1050", "binary"...
from __future__ import division import numpy as np from numpy.lib.stride_tricks import as_strided from functools import wraps, partial ################################ # distribution-form wrappers # ################################ from pylds.lds_messages import \ kalman_filter as _kalman_filter, \ rts_smoo...
{ "content_hash": "975de28e55611653125a2076d918f16e", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 101, "avg_line_length": 37.5045045045045, "alnum_prop": 0.6202257987028585, "repo_name": "mattjj/pylds", "id": "a9d79b3fa59acaf1730cf2e0dcc7e3fb4ab992f5", "size": "4163", ...
from binascii import hexlify from struct import pack, unpack import hashlib import time import sys import traceback import electrum from electrum.bitcoin import EncodeBase58Check, DecodeBase58Check, TYPE_ADDRESS, int_to_hex, var_int from electrum.i18n import _ from electrum.plugins import BasePlugin, hook from electru...
{ "content_hash": "468a463eecef7088e2b63a7436700809", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 242, "avg_line_length": 40.66736842105263, "alnum_prop": 0.5694983693120049, "repo_name": "cryptapus/electrum-myr", "id": "01f5361aabf7b1fd2de31dd42a67af51c4e3431f", "size...
import pathmagic import sys from bottle import route from bottle import request from bottle import response from Utils.Functions import jsonize from bson.json_util import dumps from Utils.Functions import clean_hash from Utils.Functions import check_hashes from Utils.Functions import change_date_to_str from Utils.Funct...
{ "content_hash": "0f3bc88a66a5470763cd06dd923583aa", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 151, "avg_line_length": 39.92705167173252, "alnum_prop": 0.5658495736906212, "repo_name": "codexgigassys/codex-backend", "id": "d06ccec86d2f567f8c54648fc40eaebafca91ef5", ...
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__(self, plotly_name="colorscale", parent_name="choropleth", **kwargs): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_...
{ "content_hash": "5aa6ccc2e9c839fca17084fa54ab5301", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 41.53846153846154, "alnum_prop": 0.6240740740740741, "repo_name": "plotly/python-api", "id": "ad663bfba380e78f96026e6b8119f84bb9fd2d1a", "size": "540...
import synthtool as s from synthtool.languages import java for library in s.get_staging_dirs(): # put any special-case replacements here s.move(library) s.remove_staging_dirs() java.common_templates( excludes=[ ".kokoro/build.sh", ".kokoro/nightly/samples.cfg", ".kokoro/presubmit/...
{ "content_hash": "741b03552842280f7d0e420402d9c321", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 44, "avg_line_length": 23.88888888888889, "alnum_prop": 0.6604651162790698, "repo_name": "googleapis/java-bigqueryconnection", "id": "20a40a132d70a29cd4ece06d8fc59682ecd99f86...
from django.views.generic import View from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.urls import reverse_lazy from django.http import HttpResponseRedirect # Local Django from user.decorators import is_health_professional from chat.models impor...
{ "content_hash": "8e2ec3cb42177e647cac6e0df58fdae6", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 84, "avg_line_length": 33.608695652173914, "alnum_prop": 0.7658473479948253, "repo_name": "fga-gpp-mds/2017.2-Receituario-Medico", "id": "6e95386d615d05b7ff5b2fbc8319c50cbf67...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p from OpenGL.GL import glget EXTENSION_NAME = 'GL_SGIS_point_line_texgen' _p.unpack_constants( """GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 GL_OBJECT_DIST...
{ "content_hash": "665172925aee548240eeff8f7984d2e3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 36.666666666666664, "alnum_prop": 0.7742424242424243, "repo_name": "frederica07/Dragon_Programming_Process", "id": "2b447ed85c97d3ee25f329bb43a5a77594e...
from config import * from rb import AMQP import json from optparse import OptionParser if __name__ == "__main__": opt_parse = OptionParser() # opt_parse.add_option('-r', '--routing-key', dest = 'routing_key', # help = "Routing key for message (ex: myalert.im)") # opt_parse.add_option('-m', '--message', dest = 'm...
{ "content_hash": "d75724a3f5286d819f476ef990618209", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 34.42857142857143, "alnum_prop": 0.6369294605809128, "repo_name": "enixdark/rabbitmq-py", "id": "fce7c501c4d42748d2fa99e9a0e8298a6197124d", "size": "...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('climate_data', '0015_auto_20170404_1819'), ] operations = [ migrations.CreateModel( name='DataType', ...
{ "content_hash": "6e09d384c64ce3bd5e6969c42d8cab02", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 120, "avg_line_length": 34.333333333333336, "alnum_prop": 0.5786407766990291, "repo_name": "qubs/data-centre", "id": "8f6be52637447ebfb7f9bf4f428b4f0d45dab701", "size": "11...
from collections import namedtuple from flask import Flask, g, render_template, render_template_string, abort from flask_sqlalchemy import SQLAlchemy from flask_perm import Perm from flask_script import Manager app = Flask(__name__) manager = Manager(app) db = SQLAlchemy() perm = Perm() app.config['DEBUG'] = True app....
{ "content_hash": "76232afb82040d00847607d1f80f5d0c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 78, "avg_line_length": 25.472972972972972, "alnum_prop": 0.6694960212201592, "repo_name": "soasme/flask-perm", "id": "a66263a6b6520af8e152461a48ddcab37a62c86a", "size": "19...
import itertools import os import sys import pytest from c7n.config import Config from c7n.loader import PolicyLoader from c7n.provider import clouds from c7n.resources import load_resources from c7n.schema import ElementSchema from c7n.utils import yaml_load from .common import BaseTest # NOQA - loads providers fo...
{ "content_hash": "c944a62693ec53e3176dfa8b1fae4b57", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 100, "avg_line_length": 35.89090909090909, "alnum_prop": 0.6066362715298885, "repo_name": "capitalone/cloud-custodian", "id": "28b406939ad8e088b91195ed2a4b6e6c75a9b0eb", "...
from flask import Flask, Blueprint import random from elasticsearch import Elasticsearch from config import es_url, es_port, admin_username, admin_password, db_conn_str from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bcrypt import Bcrypt from flask.ext.login import LoginManager from flask.ext.admin import Ad...
{ "content_hash": "f3956951c50c343ca553b3ead616b636", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 29.529411764705884, "alnum_prop": 0.7768924302788844, "repo_name": "wgmueller1/unicorn", "id": "8f2c3a777960a150e470ed4b7daa0cf7ec5a7ad6", "size": "1...
""" fabulous.utils ~~~~~~~~~~~~~~ Miscellaneous utilities for Fabulous. """ import os import sys import fcntl import struct import termios import textwrap import functools from fabulous import grapefruit def memoize(function): """A very simple memoize decorator to optimize pure-ish functions ...
{ "content_hash": "bdd0fbee9d92822ac8eb1ef95b278d6b", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 75, "avg_line_length": 26.739436619718308, "alnum_prop": 0.5962602054253358, "repo_name": "jart/fabulous", "id": "426775f2285a4366cf75bedb1b859cd0cb0c4935", "size": "4403"...