text
stringlengths
4
1.02M
meta
dict
"""Operators that integrates with Google Cloud Build service.""" import json import re import warnings from copy import deepcopy from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Tuple, Union from urllib.parse import unquote, urlparse import yaml from google.api_core.retry import Retry from google.clou...
{ "content_hash": "4af1e254bff1dbd7d7f115ca85098dcf", "timestamp": "", "source": "github", "line_count": 1011, "max_line_length": 109, "avg_line_length": 43.018793273986155, "alnum_prop": 0.6573162880529753, "repo_name": "mistercrunch/airflow", "id": "9ca36c7231c437a1f2a8e0b82ba74ca3695deb43", "size...
from __future__ import absolute_import, unicode_literals from django.conf.urls import url import project_management.api urlpatterns = [ url(r'^$', project_management.api.ProjectListAPIView.as_view()), url(r'^all$', project_management.api.ProjectListAllAPIView.as_view()), url(r'^detail/(?P<slug>[\w-]+)$'...
{ "content_hash": "012f82d8f392c9637292f84c18733818", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 95, "avg_line_length": 44.13333333333333, "alnum_prop": 0.6933534743202417, "repo_name": "wbg-optronix-lab/emergence-lab", "id": "50313dac975fc393f627cc22a442773797947706", ...
from .code import ConvolutionalCode from .naive_ml import NaiveMLDecoder from .stack import StackDecoder from .node import Node
{ "content_hash": "f8229b7b6d728a0beb024d3015ff466a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 36, "avg_line_length": 32, "alnum_prop": 0.8359375, "repo_name": "eliasrg/SURF2017", "id": "eb04a1db26aed07dc4c01f7436dca5ddb36acfbb", "size": "205", "binary": false, "c...
import urllib.request import re import string # Get the input data from the problem webpage url = 'http://www.pythonchallenge.com/pc/def/map.html' with urllib.request.urlopen(url) as response: html = response.read().decode('utf-8') data = re.search('g.*spj\.', html) data = data.group(0) print('Input data:\n', data,...
{ "content_hash": "2b603f1497b210a724af7b4b4abb2855", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 113, "avg_line_length": 32.6551724137931, "alnum_prop": 0.7159450897571278, "repo_name": "medwig/pythonchallenge-solutions", "id": "2e5bdeb647cfc025727c4fad63e8bc7bd3c5d430",...
import _plotly_utils.basevalidators class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="sizesrc", parent_name="choroplethmapbox.hoverlabel.font", **kwargs ): super(SizesrcValidator, self).__init__( plotly_name=...
{ "content_hash": "ab8dc8f85bb64ea19d20e2a13c0d2a93", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 29.470588235294116, "alnum_prop": 0.5748502994011976, "repo_name": "plotly/python-api", "id": "666d77b1d47cce3caa4b3d531b5abc2da1d522dd", "size": "50...
from contextlib import nullcontext from copy import deepcopy import os import os.path as op from shutil import copyfile import re import numpy as np from numpy.fft import fft from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_allclose, assert_equal, assert_array...
{ "content_hash": "be0ddd468eaf877982e0ce4ecfde97a5", "timestamp": "", "source": "github", "line_count": 1870, "max_line_length": 79, "avg_line_length": 40.87967914438503, "alnum_prop": 0.5975407155471254, "repo_name": "rkmaddox/mne-python", "id": "23a2c3b7f608d4b5813000a77df813ad0c9acb33", "size": ...
from google.cloud import aiplatform_v1beta1 def sample_delete_custom_job(): # Create a client client = aiplatform_v1beta1.JobServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.DeleteCustomJobRequest( name="name_value", ) # Make the request operation = c...
{ "content_hash": "efe5772cc3b6a88df426068574713c15", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 24.52173913043478, "alnum_prop": 0.7127659574468085, "repo_name": "googleapis/python-aiplatform", "id": "ec6f56faf55d2f0b7899c68c7e91be455b52dd18", "...
from django.conf import settings as django_settings from django.test.signals import setting_changed DEFAULTS = { # wait one second between retries to obtain lock on metric timeslice 'TIMESLICE_LOCK_RETRY_DELAY_MS': 1000, # base url for newrelic plugin api 'NEWRELIC_BASE_URL': 'https://platform-api.new...
{ "content_hash": "5d59a1b9a6f941c5ea83bde5d8541f8c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 87, "avg_line_length": 29.132075471698112, "alnum_prop": 0.6366580310880829, "repo_name": "ambitioninc/django-newrelic-plugin-agent", "id": "84395254d3f53127ea27a22737092f2a8...
import os from os.path import abspath, dirname import tornado.web import tornado.httpserver import tornado.ioloop from tornado.log import app_log from tornado.options import define, options from mongoengine import connect from tt.handle import MainHandler, MongoBackboneHandler, LoginHandler, RegisterHandler, Lo...
{ "content_hash": "08dc40355f7cf2f0c1988bb2ddb50483", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 101, "avg_line_length": 32.228070175438596, "alnum_prop": 0.6260206859009254, "repo_name": "yunlzheng/tomatodo", "id": "31d974a4346ace40a3ea581968d1172705439585", "size": "...
import winsound for i in range(100, 2000, 100): winsound.Beep(i, 75) print "Hopefully you heard some sounds increasing in frequency!"
{ "content_hash": "b43c26e8c3405e4e94bf0b75d186fb6a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 64, "avg_line_length": 27.8, "alnum_prop": 0.7410071942446043, "repo_name": "MalloyPower/parsing-python", "id": "7b4fa15c0a68acfdef6db29db70bd9b40e6bed4c", "size": "203", ...
import os, os.path, popen2, re, string, sys def textfile(file): return { "svn:eol-style" : "native" } def script(file): return { "svn:eol-style" : "native", "svn:executable" : "*" } def executable(file): return { "svn:executable" : "*", "s...
{ "content_hash": "464a7f4280686545e148401445b13741", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 96, "avg_line_length": 24.90810810810811, "alnum_prop": 0.5184461805555556, "repo_name": "jimmygkr/openviewer", "id": "3fb1e466ba39164a0f88c559bb3ecb5f985f8f9c", "size": "...
from django.shortcuts import render, get_object_or_404 from decisions.news.models import Entry def entry(request, year, object_id, slug): e = get_object_or_404(Entry, pub_date__year=year, pk=object_id, slug=slug) return render(request, "news/entry.html", {"entry": e})
{ "content_hash": "c906f0f7d6e82fabb5ad080d7ff066b9", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 31.22222222222222, "alnum_prop": 0.7153024911032029, "repo_name": "okffi/decisions", "id": "9bd3bc7cb305918d21693044b7172027cdacea85", "size": "281", ...
"""Labels requests according to the type of content they represent.""" import collections import logging import operator import os import urlparse import loading_trace import request_track class ContentClassificationLens(object): """Associates requests and frames with the type of content they represent.""" def ...
{ "content_hash": "a3c21d062bf76696ca388ac98e158a3b", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 79, "avg_line_length": 37.20744680851064, "alnum_prop": 0.6607576840600429, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "89f40e2fd2fab174a574c7722b541c91f0bc3366"...
from ledge.core import Ledge from ledge import backends from ledge import serializers
{ "content_hash": "c66980f0a3a17ce961f3420d36808e3c", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 29, "avg_line_length": 28.666666666666668, "alnum_prop": 0.8488372093023255, "repo_name": "j4mie/ledge", "id": "40da89f53fe8a3c8990c0c6e07a8e153d08f5fde", "size": "86", "b...
#!/usr/bin/python2 # -*- Mode: Python; py-indent-offset: 8 -*- # (C) Copyright Zack Rusin 2005 # All Rights Reserved. # # 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, ...
{ "content_hash": "97ec9ad0f4cd0fd2c3a1772a47b1cb7c", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 89, "avg_line_length": 27.911627906976744, "alnum_prop": 0.5880686552241293, "repo_name": "execunix/vinos", "id": "0214932b63a16140cc96e2ecdf14a617c2b008a0", "size": "6001...
"""Command-line interface to inspect and execute a graph in a SavedModel. If TensorFlow is installed on your system through pip, the 'saved_model_cli' binary can be invoked directly from command line. At a high level, SavedModel CLI allows users to both inspect and execute computations on a MetaGraphDef in a SavedMod...
{ "content_hash": "36993e02063fb72071c1a9791b054dca", "timestamp": "", "source": "github", "line_count": 640, "max_line_length": 81, "avg_line_length": 38.634375, "alnum_prop": 0.6742295559330259, "repo_name": "whn09/tensorflow", "id": "17ef8ef9c23a6febc6fd265bc7b1ab8cb6b7fce9", "size": "25415", "...
"""Scratchpad/chain of thought, demonstrated on gsm8k. Scratchpad: https://arxiv.org/abs/2112.00114 Chain of thought: https://arxiv.org/abs/2201.11903 Self consistency (https://arxiv.org/abs/2203.11171) is done by marginalizing out the `thought` in the `infer` operator. """ import dataclasses import re from typing ...
{ "content_hash": "fabbacbc4b46be271cace43428fe2c74", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 229, "avg_line_length": 44.93055555555556, "alnum_prop": 0.6935085007727976, "repo_name": "google-research/cascades", "id": "9a056ef282807488891504fb3d1076823e2ac48c", "si...
""" This module implements more advanced transformations. """ from __future__ import annotations import logging import math import warnings from fractions import Fraction from itertools import groupby, product from math import gcd from string import ascii_lowercase import numpy as np from monty.dev import requires f...
{ "content_hash": "bfa5f93069ceb61068235a654e7a46f2", "timestamp": "", "source": "github", "line_count": 2227, "max_line_length": 120, "avg_line_length": 39.47283340817243, "alnum_prop": 0.5972402338861966, "repo_name": "davidwaroquiers/pymatgen", "id": "b17e93a1ad75f8395c8c152b46d5618ddf4a9b19", "s...
"""Perform MCMC follow-up fitting.""" import os from os.path import join,exists,basename,splitext import shutil from collections import OrderedDict as odict from multiprocessing import Pool import matplotlib matplotlib.use('Agg') #try: os.environ['DISPLAY'] #except KeyError: matplotlib.use('Agg') import ...
{ "content_hash": "afc5e7c0e656f8a78f4f8d1f14a85d7d", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 150, "avg_line_length": 35.00829875518672, "alnum_prop": 0.6158587175536329, "repo_name": "DarkEnergySurvey/ugali", "id": "59e7e949a191620260f33817c892bbf516fcc825", "size...
class StaticMethodExample: def __init__(self): pass @staticmethod def foo(): pass
{ "content_hash": "dd69c9bf2e83c9b7304a704ff0efe95e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 26, "avg_line_length": 14, "alnum_prop": 0.5446428571428571, "repo_name": "bruckhaus/challenges", "id": "705f2bbe7c18d42676da6b74e4a420b6ddfabc79", "size": "112", "binary"...
from mzc.group import Group class CompareTeams(object): """Class that uses the rest of objects in MZ Compare to compare teams""" def __init__(self, usernames): self.usernames = usernames self.g = Group(self.usernames) self.g.get_details() self.g.convert_currency() for ...
{ "content_hash": "61c41c3d2512ebf8ef8042824be1e1f1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 36.02857142857143, "alnum_prop": 0.5313243457573354, "repo_name": "jreyes33/mzcompare", "id": "70301aaec1baeb87535263fa821101f1c12ceebe", "size": "12...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('plugininstances', '0009_auto_20190715_1706'), ] operations = [ migrations.AlterField( model_name='pathparameter', name='value', field=models.CharField(ma...
{ "content_hash": "e2dd60c3f1399efea74917644c7af6c7", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 55, "avg_line_length": 22, "alnum_prop": 0.5880681818181818, "repo_name": "FNNDSC/ChRIS_ultron_backEnd", "id": "63ecda0f7000681ea8c888e4dd7ef959d0c7e89b", "size": "401", ...
from sys import exc_info, argv import pandas as pd import urllib import xml.etree.ElementTree import textwrap from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.decomposition import PCA,TruncatedSVD from sklearn.manifold import TSNE from sklearn.preprocessing import Normalizer, n...
{ "content_hash": "8ed0503777bbaa05c5baded2ac60103b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 469, "avg_line_length": 44.175438596491226, "alnum_prop": 0.7188244638602065, "repo_name": "slremy/cloudroboticsreferences", "id": "c5dfd2997bfefb788d9d02b8696e21cd9969e944",...
from a10sdk.common.A10BaseClass import A10BaseClass class Uri(A10BaseClass): """This class does not support CRUD Operations please use parent. :param match_type: {"enum": ["contains", "ends-with", "equals", "starts-with"], "type": "string", "description": "'contains': Match URI if request URI contains s...
{ "content_hash": "caac5803c54b22ecdadf15d51232535f", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 650, "avg_line_length": 50.544, "alnum_prop": 0.6215574548907882, "repo_name": "a10networks/a10sdk-python", "id": "8fc788204c9bb25bdc966acae7069cbd702edcca", "size": "6318...
import pdb import os import numpy as np from tempfile import mkdtemp def get_digi_train_period(abr_header): digi_trains = np.where(abr_header['ext_epoch_waveform_pulses']\ ['nDigitalTrainValue'][0]==4)[0] if not np.size(digi_trains)==0: return (abr_header['ext_multi-chan_inf']['lEpochP...
{ "content_hash": "a23d4618411ad01cfda56183628235b5", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 99, "avg_line_length": 39.467372134038804, "alnum_prop": 0.5721690946465279, "repo_name": "matthewperkins/abf_reader", "id": "7eae64c9a8aff58631198838548d569f14f52cf1", "s...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' from django.core.management.base import BaseCommand from optparse import make_option from taskengine.atlas.taskdef import TaskDefinition from taskengine.atlas.datamgmt import AMIWrapper from deftcore.log import Logger logger = Logger().get() cla...
{ "content_hash": "b37ac282905b87bbb5a1ade9c488acb2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 69, "avg_line_length": 41.30357142857143, "alnum_prop": 0.5512321660181583, "repo_name": "retmas-dv/panda-deft", "id": "c97140cb27a8b890f24cd53868149f7e79cb9140", "size": "...
from typing import Tuple from amino.state.maybe import MaybeState from amino import Maybe, Just, Left, Right, Either, Id, List from amino.state.either import EitherState from amino.state.eval import EvalState from amino.state.id import IdState from amino.test.spec_spec import Spec class State3Spec(Spec): def ty...
{ "content_hash": "fa9b52ac7708f706da423de09fa1fed6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 119, "avg_line_length": 37.85294117647059, "alnum_prop": 0.5936285936285937, "repo_name": "tek/amino", "id": "614109c3e829932d5081151968e29440c3e53bd8", "size": "2574", "...
class Evaluator: def __init__(self, lexer): self.__lexer = lexer def evaluate(self, line): return int(next(self.__lexer.tokenize(line)).raw_value) class REPL: def __init__(self, read, print, evaluate): self.__read = read self.__eval = evaluate self.__print = print ...
{ "content_hash": "ea658f34696ac50cc6fda8ab724a39ed", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 63, "avg_line_length": 28.166666666666668, "alnum_prop": 0.522189349112426, "repo_name": "PolyglotSymposium/mm-i", "id": "f700f33dffc00e1f53d3e1c3b1d4f0189b0c7b82", "size":...
from google.cloud import edgecontainer_v1 async def sample_create_vpn_connection(): # Create a client client = edgecontainer_v1.EdgeContainerAsyncClient() # Initialize request argument(s) vpn_connection = edgecontainer_v1.VpnConnection() vpn_connection.name = "name_value" request = edgeconta...
{ "content_hash": "2c3d8ee832308c5f67afc2eae41845ab", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 28.071428571428573, "alnum_prop": 0.7175572519083969, "repo_name": "googleapis/python-edgecontainer", "id": "842695613379f460f4a67e0ba48121ad2bd57292",...
import shutil from unittest import TestCase from pathlib import Path from src.dokuwiki_to_hugo import DokuWikiToHugo class TestDokuWikiToHugo(TestCase): def tearDown(self): shutil.rmtree('output') pass def test_doku_to_hugo_converts_home_to_index_markdown_files(self): DokuWikiToHugo...
{ "content_hash": "371c549d3fe5ffb0518e62f335b62792", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 91, "avg_line_length": 32.08, "alnum_prop": 0.6783042394014963, "repo_name": "wgroeneveld/dokuwiki-to-hugo", "id": "8a13c8e032764754754b032fe0f0a562b668bdac", "size": "802"...
import functools from fabric.api import run, env def dir_exists(dir): # return run('[ -d %s ] && echo 1 || echo 0' % dir) == '1' pass def with_defaults(func): """A decorator that sets all defaults for a task.""" @functools.wraps(func) def decorated(*args, **kwargs): env.setdefault('use_s...
{ "content_hash": "96e231a8b0f4acfe292d1c1d632ad461", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 117, "avg_line_length": 47.91111111111111, "alnum_prop": 0.48794063079777367, "repo_name": "peroshi/fabistrano", "id": "5f05fd53ab764acc4a7d4c2dfcb277fe15059d4f", "size": "...
from __future__ import unicode_literals from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import importlib from django.utils.translation import get_language_info import pytz from appconf import AppConf def load_path_attr(path): i = path.rfind(".") mo...
{ "content_hash": "02cb92c8e1f75baa094c77c98c023d3f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 95, "avg_line_length": 33.3125, "alnum_prop": 0.6960600375234521, "repo_name": "Amechi101/concepteur-market-app", "id": "be18bf2b0f026f9cb5caee62e03588a7929d6bcb", "size": ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/space/story_loot/shared_loot_all_freighter_2.iff" result.attribute_template_id = -1 result.stfName("space/story_loot_n","loot_all_freighter_2") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### ...
{ "content_hash": "c52e463c5415abc87d77f04f1f10a687", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 25.76923076923077, "alnum_prop": 0.7014925373134329, "repo_name": "anhstudios/swganh", "id": "96b1b17afda2008fe8bb8af6e76e5b6023078306", "size": "480...
import _plotly_utils.basevalidators class LocationmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="locationmode", parent_name="scattergeo", **kwargs): super(LocationmodeValidator, self).__init__( plotly_name=plotly_name, parent_name=p...
{ "content_hash": "2af461b5acf384e42d8ca592474221ae", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 87, "avg_line_length": 39, "alnum_prop": 0.5934065934065934, "repo_name": "plotly/plotly.py", "id": "fce0b83675a5e33cee92d711cb9b859000fa1751", "size": "546", "binary": f...
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest skltest.test_class_dataset_and_model("iris" , "SVC_sigmoid_10")
{ "content_hash": "778ad79fc9ba7ae73c2a5624a51910f0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 35.5, "alnum_prop": 0.7816901408450704, "repo_name": "antoinecarme/sklearn_explain", "id": "bf916c55bb809050d42914f23089b67b380f50bf", "size": "142", ...
try: from setuptools import setup except ImportError : raise ImportError("setuptools module required, please go to https://pypi.python.org/pypi/setuptools and follow the instructions for installing setuptools") setup( version='0.1', url='', description='', name='datesplitter', packages=['da...
{ "content_hash": "bba54f93b3da231929cc0bf3f9b58ece", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 159, "avg_line_length": 40.03448275862069, "alnum_prop": 0.6253229974160207, "repo_name": "jernsthausen/datesplitter", "id": "00f21d2b1e83c40f954cdd5c4a1ed7d884da4245", "si...
from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") @app.ge...
{ "content_hash": "5f4b02334c9240e6676b2047ed517979", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 31.0625, "alnum_prop": 0.7686116700201208, "repo_name": "tiangolo/fastapi", "id": "245e7110b195d257b8a93b063124465627f1f765", "size": "497", "binar...
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" __revision__ = "$Id: bdist_wininst.py 86223 2010-11-05 23:51:56Z eric.araujo $" import sys, os from distutils.core import Command from distutils.util import get_platform from distutils.dir_...
{ "content_hash": "d4ab2b7f00a4243c170e7c41f6bc2871", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 91, "avg_line_length": 42.92219020172911, "alnum_prop": 0.5519672351282395, "repo_name": "MalloyPower/parsing-python", "id": "cfa65e4a1b91288e3c97c36083d732c31131bd6a", "s...
r"""Module doctest -- a framework for running examples in docstrings. In simplest use, end each module M to be tested with: def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test() Then running the module as a script will cause the examples in the docstrings to get executed and v...
{ "content_hash": "11376b5206fc520dfdeb1d01d6893ce5", "timestamp": "", "source": "github", "line_count": 2742, "max_line_length": 82, "avg_line_length": 37.42013129102845, "alnum_prop": 0.5659415628715669, "repo_name": "makinacorpus/django", "id": "50d772cfadc5590d90cefba4c426eb6cd9d9f909", "size": ...
""" Django settings for webapp project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
{ "content_hash": "7c8ee3443900fddf53419ee7bf039478", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 71, "avg_line_length": 24.547619047619047, "alnum_prop": 0.7235693501454898, "repo_name": "tejesh95/TransApp", "id": "c633dd10fc6563758930b73c38909f6ef7b4bb7c", "size": "20...
import os, sys, traceback def _genAll(verbose=1): from reportlab.lib.testutils import setOutDir setOutDir(__name__) from reportlab.lib.testutils import testsFolder topDir=os.path.dirname(testsFolder) L = [os.path.join(topDir,f) for f in ( #'docs/reference/genreference.py', 'd...
{ "content_hash": "00f3d2ee6207e7d460a80c04180cef5b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 97, "avg_line_length": 32.86666666666667, "alnum_prop": 0.5409060175794456, "repo_name": "Distrotech/reportlab", "id": "18b74ea1ff4568f8a65c3bd96630182fc8b071fd", "size": "...
"""TensorFlow Debugger: Tools for debugging gradients.""" import re import uuid from tensorflow.python.debug.lib import debug_data from tensorflow.python.debug.lib import debug_graphs from tensorflow.python.framework import ops from tensorflow.python.ops import gen_array_ops from tensorflow.python.ops import variable...
{ "content_hash": "29da8c01b88d32a132390c81c2b1801a", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 89, "avg_line_length": 36.876574307304786, "alnum_prop": 0.6801912568306011, "repo_name": "tensorflow/tensorflow-pywrap_tf_optimizer", "id": "8d202c9e1a0e9bcbb08b994d5b1fd5d...
"""Forms.""" from django import forms from imager_images.models import Image, Album class PhotoForm(forms.ModelForm): """This makes a form. Yay.""" class Meta: model = Image exclude = ['owner', 'date_modified', 'date_published', 'date_uploaded'] class AlbumForm(forms.ModelForm): """Th...
{ "content_hash": "04c80f4b60796c4205ddbe5f9f89a425", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 22.047619047619047, "alnum_prop": 0.6241900647948164, "repo_name": "ellezv/django_imager", "id": "8ea3f14a80a5569baa270d61a5d7418ee93708fa", "size": ...
import RPi.GPIO as GPIO import time import sys import json if len(sys.argv) < 3: print "Too few parameters!" sys.exit() GPIO.setmode(GPIO.BOARD) mPort = int(sys.argv[1]) if mPort <= 0 or mPort > 40: print "id must be 1-40!" sys.exit() mMode = sys.argv[2] if mMode == "in": GPIO.setup(mPort,GPIO.I...
{ "content_hash": "8133abf18ee5704c5d2694076fe4710a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 67, "avg_line_length": 25.55, "alnum_prop": 0.5949119373776908, "repo_name": "thatblstudio/belong", "id": "387ef6e38de2c2c46c019b6c89c053c9c895da43", "size": "1046", "bin...
from django.apps import AppConfig from django.db.models.signals import post_save, post_delete from django.conf import settings class AccountsReceivableConfig(AppConfig): name = 'cbe.accounts_receivable' def ready(self): import drf_nest.signals from cbe.accounts_receivable.models import Custome...
{ "content_hash": "8f4896014064d412f7a0e2760e1932b7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 147, "avg_line_length": 49.45, "alnum_prop": 0.6329625884732053, "repo_name": "cdaf/cbe", "id": "5cd24283c8efa12310aa95a3af3c5b076521c8a5", "size": "989", "binary": false...
"""Test listing meters. """ import base64 import datetime import logging import testscenarios from ceilometer.publisher import utils from ceilometer import sample from ceilometer.tests.api.v2 import FunctionalTest from ceilometer.tests import db as tests_db load_tests = testscenarios.load_tests_apply_scenarios LOG ...
{ "content_hash": "70352668dd92693f318a64ada1f3df48", "timestamp": "", "source": "github", "line_count": 487, "max_line_length": 78, "avg_line_length": 43.125256673511295, "alnum_prop": 0.38982001714122466, "repo_name": "lexxito/monitoring", "id": "067cc39ef5065a9427430bb976e4ff741c4b36cd", "size": ...
"""Tests for cement.ext.ext_jinja2.""" import os import sys import random from shutil import copyfile, rmtree from cement.core import exc, foundation, handler, backend, controller from cement.utils import test class Jinja2ExtTestCase(test.CementExtTestCase): def setUp(self): super(Jinja2ExtTestCase, se...
{ "content_hash": "68fc37ef768f94b834a3a233d88dfc17", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 78, "avg_line_length": 35.76086956521739, "alnum_prop": 0.59209726443769, "repo_name": "akhilman/cement", "id": "7696e4fa825b7e0bc3945ad2219e0995d57ac620", "size": "3316", ...
"""An ox_herd plugin for posting messages to github. This module provides a single class: PostToGitHub to post messages to github. It is useful as a tool for the pylint plugin and perhaps others. Provided that you include this plugin in the OX_PLUGINS variable in ox_herd.settings or in your OX_PLUGINS environment var...
{ "content_hash": "0b18f65f0926d568708c4916228479b9", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 36.27407407407407, "alnum_prop": 0.5570757606697978, "repo_name": "aocks/ox_herd", "id": "0835a53c94a3cc18aa31c0946655ec9783661f73", "size": "4897",...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_tatooine_hermit.iff" result.attribute_template_id = 9 result.stfName("theme_park_name","hermit") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "d1becae3a5c0d5a7b3287e6aaae23f18", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 69, "avg_line_length": 23.153846153846153, "alnum_prop": 0.6976744186046512, "repo_name": "anhstudios/swganh", "id": "ae37e74cf9edc943bc77e880dd5ddda46a193b6e", "size": "44...
""" future.backports package """ from __future__ import absolute_import import sys __future_module__ = True from future.standard_library import import_top_level_modules if sys.version_info[0] >= 3: import_top_level_modules() from .misc import (ceil, OrderedDict, Counter,...
{ "content_hash": "64ef87207a5318c611119f9a093bf9da", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 20.384615384615383, "alnum_prop": 0.49433962264150944, "repo_name": "PythonCharmers/python-future", "id": "c71e065354c4a8522b5c3e6d2ab91942bd9b9e11", ...
import flask.helpers import flask.sessions import itsdangerous cookie_name = 'session' cookie_value = '' secret_key = 'drones' secret_key = 'drone' def open_session_original(self, app, request): s = self.get_signing_serializer(app) if s is None: return None val = request.cookies.get(app.session_...
{ "content_hash": "7ab475ed27b8fa51c716ccfa515eaa0e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 30.607142857142858, "alnum_prop": 0.6374951380785686, "repo_name": "benhunter/py-stuff", "id": "015fa3149f9d674540a646664502053972fd119b", "size": "2...
import maya.cmds as cmds def multObjImport(): files_to_import = cmds.fileDialog2(fileFilter = '*.obj', dialogStyle = 2, caption = 'import multiple object files', fileMode = 4) for file_to_import in files_to_import: names_list = file_to_import.split('/') object_name = names_list[-1].replace('.o...
{ "content_hash": "71e041b2e517a4a2b1b64038e066f4c2", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 162, "avg_line_length": 55.5, "alnum_prop": 0.6411411411411412, "repo_name": "aaronfang/personal_scripts", "id": "545d302adea13b2bb6bd2c2a0408614f4eaae47c", "size": "666", ...
"""Main Window. """ import sys from PyQt5 import QtWidgets from PyQt5 import QtCore from mainwindow import Ui_MainWindow import addpi_tela import addtipocred_tela import addcomite_tela import addoi_tela import editlimitescomite_tela import editlimitesoi_tela import buscaoi1_tela import buscapi_tela import buscacomite...
{ "content_hash": "57e253781e80736759a137d5b10c0d03", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 85, "avg_line_length": 37.916666666666664, "alnum_prop": 0.6384615384615384, "repo_name": "zsinx6/elainethegoddess", "id": "9e4b6b7ded0f4f9d7d4cd17c73634af302382904", "size...
""" Vis: Plot a map using the Orthographic map projection and filled contours """ from fatiando import gridder, utils from fatiando.vis import mpl # Generate some data to plot area = (-40, 0, 10, -50) shape = (100, 100) lon, lat = gridder.regular(area, shape) data = utils.gaussian2d(lon, lat, 10, 20, -20, -20, angle=-...
{ "content_hash": "a34394c8e853ee0f863fa3639848fb42", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 27.904761904761905, "alnum_prop": 0.7201365187713311, "repo_name": "mtb-za/fatiando", "id": "813d7a5f82e1056445853ec59bb569386468d62c", "size": "586"...
''' Models for various kinds of arrow heads that can be added to Arrow annotations. ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import logging # isort:skip log = logging.getLogger(__name...
{ "content_hash": "4a2430b9592cca51e51b60e9ae40369e", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 78, "avg_line_length": 27.462184873949578, "alnum_prop": 0.42441860465116277, "repo_name": "ericmjl/bokeh", "id": "270741a790a2ed04703ef61332c60a8575c6387b", "size": "3599...
""" Backwards-compatibility plugin for the Qt reactor. This provides a Qt reactor plugin named C{qt} which emits a deprecation warning and a pointer to the separately distributed Qt reactor plugins. """ import warnings from twisted.application.reactors import Reactor, NoSuchReactor wikiURL = 'http://tw...
{ "content_hash": "59603ebcfe0b0bbf43fd5841bb3cfcc3", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 32.16279069767442, "alnum_prop": 0.6377440347071583, "repo_name": "timkrentz/SunTracker", "id": "0e15bcd3d7e1a85578eb6655b817ef27a9e4608f", "size": "...
XXXXXXXXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXX X XXXXX XXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXX...
{ "content_hash": "89d487b0f902d857befbb3b79a0af3b7", "timestamp": "", "source": "github", "line_count": 932, "max_line_length": 167, "avg_line_length": 25.488197424892704, "alnum_prop": 0.7363923384550621, "repo_name": "dnaextrim/django_adminlte_x", "id": "3c466a96fdb0a1f53617c265682d58dab43d9a30", ...
""" Created on Tue Nov 29 14:36:12 2016 @author: Dominik """ import socket import sys import time_manager as tm class TCPManager(): def __init__(self, tcp_ip, tcp_port, buffer_size): self.TCP_IP = tcp_ip self.TCP_PORT = tcp_port self.BUFFER_SIZE = buffer_size self.create_...
{ "content_hash": "936fcb4899fae5a2d09d36165159660e", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 81, "avg_line_length": 31.541284403669724, "alnum_prop": 0.4909831297265852, "repo_name": "zapfdk/broadcast-clock", "id": "3b366864e8ecb22a174f9ff79d7bc08697422efd", "size...
""" manage logging configuration USAGE: ### perform once as the application begins to initialize logging system-wide from putil.logging import config config.add_configuration("some/path/logging.yml") # could be normal file config.add_configuration("or/resource/logging.local.yml") # or ...
{ "content_hash": "97e84fd79f4c2ad84717d1b292f210ab", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 149, "avg_line_length": 42.40860215053763, "alnum_prop": 0.6102941176470589, "repo_name": "scionrep/scioncc", "id": "a202baf3722686de25a46b057a0317dfc71b9e8c", "size": "78...
""" Utility vote handler. :author: Thomas Calmant :license: Apache Software License 2.0 :version: 3.0.0 .. Copyright 2014 isandlaTech 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 ...
{ "content_hash": "11637b1cc63e17a7acac73a23634d52f", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 80, "avg_line_length": 28.29259259259259, "alnum_prop": 0.5355413012174368, "repo_name": "ahmadshahwan/cohorte-runtime", "id": "8b73396963e05f359edb2f4a62f744b7c52226d9", ...
import abc import collections import contextlib import dataclasses import logging import os import pathlib import re import tempfile from types import MappingProxyType from typing import ( Any, Callable, Counter, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, ...
{ "content_hash": "4fbded495fb2b15adef574202fb5a0bc", "timestamp": "", "source": "github", "line_count": 1056, "max_line_length": 88, "avg_line_length": 35.18465909090909, "alnum_prop": 0.6126497106715112, "repo_name": "josiah-wolf-oberholtzer/supriya", "id": "c2d28a22f216b20318f1944f635f19dbf25b2d04"...
""" Astropy coordinate class for the Sagittarius coordinate system """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party import numpy as np from astropy.coordinates import frame_transform_graph from astropy.coordinates.angles import rotation_matrix import as...
{ "content_hash": "947b5f62efa6a94447e9b2e340df3498", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 88, "avg_line_length": 34.76190476190476, "alnum_prop": 0.6745205479452054, "repo_name": "abonaca/gary", "id": "f0b0b24aa2842a341cf87a39bb6097b7e05640c8", "size": "3667", ...
""" dj-stripe PaymentIntent Model Tests. """ from copy import deepcopy from unittest.mock import patch import pytest import stripe from django.test import TestCase from djstripe.enums import PaymentIntentStatus from djstripe.models import Account, Customer, PaymentIntent from tests import ( FAKE_ACCOUNT, FAKE...
{ "content_hash": "c7aedb91d849a5334a612e07705bede0", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 120, "avg_line_length": 37.172413793103445, "alnum_prop": 0.6239950525664811, "repo_name": "pydanny/dj-stripe", "id": "6e15519470641889bc369459cc88f8eb06338aef", "size": "...
import math import sys from numpy import ( float32, putmask, shape, zeros, ) # This is the average of all species in the alignment outside of exons # > mean(r) # A T C G # 0.2863776 0.2878264 0.2129560 0.2128400 # > sd(r) # A T ...
{ "content_hash": "c3fd27cde17f2051e1b409ac531c7298", "timestamp": "", "source": "github", "line_count": 912, "max_line_length": 123, "avg_line_length": 33.9484649122807, "alnum_prop": 0.49995155195245633, "repo_name": "bxlab/bx-python", "id": "4edef1af1d31ba82f871a0274fcfe5b3964d7ba3", "size": "309...
from imp import load_source from pathlib import Path from os.path import expanduser from pprint import pformat from subprocess import Popen, PIPE import os import sys from psutil import Process, TimeoutExpired import colorama import six from . import logs, conf, types, shells def setup_user_dir(): """Returns user...
{ "content_hash": "f524a852f72f4e815cca783f299ae4b1", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 78, "avg_line_length": 32.34228187919463, "alnum_prop": 0.6219132600124507, "repo_name": "suxinde2009/thefuck", "id": "8d1a3dacac63fcf0f81530c1ce162ac81782380f", "size": "...
""" Modifies the segment identifier column of a PDB file (default is an empty segment). Usage: python pdb_seg.py -<segment id> <pdb file> Example: python pdb_seg.py -C 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to...
{ "content_hash": "56b48a7ba510bb781598c08516542cb3", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 83, "avg_line_length": 27.373417721518987, "alnum_prop": 0.5569942196531792, "repo_name": "haddocking/pdb-tools", "id": "4a4e8e2fc61327488128206a74a33b639f8c96d3", "size":...
import logging import os import re import shutil import subprocess from os.path import splitext from . import image, utils from .settings import Status, get_thumb from .utils import is_valid_html5_video class SubprocessException(Exception): pass def check_subprocess(cmd, source, outname): """Run the comman...
{ "content_hash": "0ac6669374762fc800f064174a650891", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 80, "avg_line_length": 34.28654970760234, "alnum_prop": 0.6118028313150264, "repo_name": "kontza/sigal", "id": "4a2a9d14cbec0eeb02e37cf985d001510fba452f", "size": "7014", ...
from rest_framework import serializers from happy_api.models import Category, Note, Text, Reminder, Checklist, Image, Group from datetime import datetime from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): ctime = serializers.DateTimeField(source='date_joined') class...
{ "content_hash": "3019349cf46312ef9f3420d01facf33f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 135, "avg_line_length": 33.2112676056338, "alnum_prop": 0.6683630195080577, "repo_name": "nazco/todo-of-happiness-api", "id": "f4e24f5b0b7b2cc4c4b28572217c96bdada34a48", "s...
""" Management class for Storage-related functions (attach, detach, etc). """ from oslo_log import log as logging from oslo_vmware import exceptions as oslo_vmw_exceptions from oslo_vmware import vim_util as vutil from nova.compute import power_state import nova.conf from nova import exception from nova.i18n import _...
{ "content_hash": "6ff5a3d2dea95c332664db122c9885d0", "timestamp": "", "source": "github", "line_count": 658, "max_line_length": 79, "avg_line_length": 46.39665653495441, "alnum_prop": 0.5566182973566117, "repo_name": "mahak/nova", "id": "e1d60cc75135bdff289b5397163171795e8dfddf", "size": "31201", ...
import importlib import os import hypothesis from hypothesis import strategies as st import numpy as np import pytest from pandas.compat import PY3 import pandas.util._test_decorators as td import pandas as pd hypothesis.settings.register_profile( "ci", # Hypothesis timing checks are tuned for scalars by de...
{ "content_hash": "851bcac45b1d24601c6d40d630e6c3c3", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 78, "avg_line_length": 25.134191176470587, "alnum_prop": 0.6266364367732027, "repo_name": "harisbal/pandas", "id": "03e09175bdb09af4cf8fbc7f5a3dc18fbb4d3604", "size": "136...
import os from AppKit import * import vanilla from defconAppKit.controls.placardScrollView import DefconAppKitPlacardNSScrollView, PlacardPopUpButton # ------- # Sorting # ------- def fontFileNameSort(fonts): sortable = [] noPathCounter = 0 for font in fonts: if font.path is not None: ...
{ "content_hash": "3c3e08e205e9393c8b87c3fdf374fa5f", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 149, "avg_line_length": 34.72489959839358, "alnum_prop": 0.5916844966171283, "repo_name": "Ye-Yong-Chi/defconAppKit", "id": "86d19dcdf1f8266b349a190ee4572adf62e78dc7", "si...
import datetime from tempest.api.compute import base from tempest import test from tempest.test import attr import time class TenantUsagesV3Test(base.BaseV3ComputeAdminTest): _interface = 'json' @classmethod def setUpClass(cls): super(TenantUsagesV3Test, cls).setUpClass() cls.adm_client...
{ "content_hash": "1e8307afd5944ce6aed8c5eb4c773c70", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 72, "avg_line_length": 33.91428571428571, "alnum_prop": 0.6141533277169334, "repo_name": "ntymtsiv/tempest", "id": "e16332fa47cd55760ce7c64b72c6c1844a8f1e3e", "size": "3005...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import taggit.managers # AWX import awx.main.fields from awx.main.models import CredentialType from awx.main.utils.common import set_current_apps def setup_tower_managed...
{ "content_hash": "7327fba02c92100bfa18cb21ce26ef4d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 296, "avg_line_length": 56, "alnum_prop": 0.6610449735449735, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "32190b2bf21c634fa9678cb9a3c82b157e13d24b", ...
class Account(object): def __init__(self, holder, number, balance,credit_line=1500): self.Holder = holder self.Number = number self.Balance = balance self.CreditLine = credit_line def deposit(self, amount): self.Balance = amount def withdraw(self, amount): ...
{ "content_hash": "11bc380be7ec966ce7a3268dc4c25120", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 66, "avg_line_length": 28.448275862068964, "alnum_prop": 0.5587878787878788, "repo_name": "jimkiiru/james-kiiru-bc17-week1", "id": "7acf443dc785a717b6b30adaebf86bd24c58b0c8",...
from __future__ import print_function from setuptools import setup from pyxl320.version import __version__ as VERSION from build_utils import BuildCommand from build_utils import PublishCommand from build_utils import BinaryDistribution PACKAGE_NAME = 'pyxl320' BuildCommand.pkg = PACKAGE_NAME PublishCommand.pkg = PAC...
{ "content_hash": "5a55f5a4fd87b663e398b773ff808944", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 115, "avg_line_length": 30.745098039215687, "alnum_prop": 0.7098214285714286, "repo_name": "walchko/pyxl320", "id": "1e957e53ce4f167fdc1c88b998c5c20bbcb55b50", "size": "175...
from pywb.warcserver.index.indexsource import MementoIndexSource from pywb.warcserver.index.indexsource import RemoteIndexSource from pywb.warcserver.index.indexsource import WBMementoIndexSource from webrecorder.load.wamloader import WAMLoader # ======================================================================...
{ "content_hash": "60c57d11e385c3aef46170d3ececbc3f", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 96, "avg_line_length": 35.66153846153846, "alnum_prop": 0.5867126833477135, "repo_name": "webrecorder/webrecorder", "id": "7b7c2cdfe44d9337e37ce6066f8ae3ca3ef68578", "size"...
from mparts.manager import Task from mparts.host import HostInfo from support import ResultsProvider, SetCPUs, FileSystem, SystemMonitor, waitForLog import os, signal, re __all__ = [] __all__.append("EximDaemon") class EximDaemon(Task): __info__ = ["host", "eximPath", "eximBuild", "mailDir", "spoolDir", "port"] ...
{ "content_hash": "4cd3ff0a8c1e58221a9badcb58857635", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 83, "avg_line_length": 34.58196721311475, "alnum_prop": 0.5517895235837876, "repo_name": "KMU-embedded/mosbench-ext", "id": "459b9067500c43d2794344104a7358540783d9e6", "si...
"""The IPython Controller Hub with 0MQ This is the master object that handles connections from engines and clients, and monitors traffic through the various queues. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development ...
{ "content_hash": "5e935a0d8293ead2cc3b3b9d6a47d6a5", "timestamp": "", "source": "github", "line_count": 1449, "max_line_length": 118, "avg_line_length": 37.893029675638374, "alnum_prop": 0.537308539894731, "repo_name": "Lightmatter/django-inlineformfield", "id": "ee89133f8db7bc2a8c2e3aa9d92ad0e17cc65...
from optparse import OptionGroup import os import sys import tarfile try: from gppylib import gplog, pgconf from gppylib.commands import gp from gppylib.commands.base import Command, ExecutionError from gppylib.db import dbconn from gppylib.gparray import GpArray from gppylib.gpversion import G...
{ "content_hash": "eb4e2dfceddce31b057240b20d43efd6", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 189, "avg_line_length": 47.698113207547166, "alnum_prop": 0.6105221518987342, "repo_name": "jmcatamney/gpdb", "id": "427982290b4449774900d848971fff3dd67bd0ea", "size": "12...
"""tplink conftest.""" import pytest from . import _patch_discovery from tests.common import mock_device_registry, mock_registry @pytest.fixture def mock_discovery(): """Mock python-kasa discovery.""" with _patch_discovery() as mock_discover: mock_discover.return_value = {} yield mock_disco...
{ "content_hash": "435ee084642d5d041b492b5142813001", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 60, "avg_line_length": 23.46875, "alnum_prop": 0.6950732356857523, "repo_name": "jawilson/home-assistant", "id": "20ce09b9ec8533fff6b8bf3342ccdd146802289c", "size": "751", ...
import datetime from django.http import HttpResponseRedirect from django.urls import reverse from django.views.decorators.cache import cache_control from django.views.generic import FormView, TemplateView, DetailView from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.templ...
{ "content_hash": "67314d1d801e4939a55cb6351aec52df", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 79, "avg_line_length": 31.412322274881518, "alnum_prop": 0.5416415208207604, "repo_name": "DemocracyClub/electionleaflets", "id": "c4760e0abd0266f7fca6bdc2c3f4e574c041bd3b",...
class ConfTrakException(Exception): pass class ConfTrakNotFoundException(ConfTrakException, RuntimeError): pass
{ "content_hash": "2c50a3500e655f2893a9b8c15c6e1699", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 65, "avg_line_length": 20.333333333333332, "alnum_prop": 0.8032786885245902, "repo_name": "hhslepicka/conftrak", "id": "f8954b12be4f40fdc2ef4a23afa39507874a83ea", "size": "1...
from .resource import Resource class BackupResourceVaultConfigResource(Resource): """Backup resource vault config details. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id represents the complete path to the resource. :vartype id: str ...
{ "content_hash": "766b900811c41e96600f19ea86d004f1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 106, "avg_line_length": 36.608695652173914, "alnum_prop": 0.6300475059382423, "repo_name": "SUSE/azure-sdk-for-python", "id": "71e6eaaaa35eb95074ff0bbe417591bd1441f207", "s...
import sys import os sys.path.insert(0, os.path.abspath('..')) from utility.sklearnbasemodel import BaseModel import numpy as np from sklearn.ensemble import BaggingRegressor class BaggingModel(BaseModel): def __init__(self): BaseModel.__init__(self) return def setClf(self): # min_samp...
{ "content_hash": "14eb64065170a5ee420b8622f163febf", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 107, "avg_line_length": 28.642857142857142, "alnum_prop": 0.628428927680798, "repo_name": "LevinJ/Supply-demand-forecasting", "id": "d028c891e7b9c5748f06cb64d0b5a7f80f33b072"...
""" login-oauth.py ~~~~~~~~~~~~~~ This module is an example of how to harness the Readability API w/ OAuth. This module expects the following environment variables to be set: - READABILITY_CONSUMER_KEY - READABILITY_CONSUMER_SECRET """ import sys import webbrowser from ext import readability, get_consumer_keys ...
{ "content_hash": "fadec791ebb0e15cfe8e35ca7d4c2c94", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 100, "avg_line_length": 19.632911392405063, "alnum_prop": 0.6673114119922631, "repo_name": "alexwaters/python-readability-api", "id": "e99d0913698cdfeb96c4da053459911f85a4553...
import seq2seq from seq2seq.models import SimpleSeq2Seq model = SimpleSeq2Seq(input_dim=5, hidden_dim=10, output_length=8, output_dim=8) model.compile(loss='mse', optimizer='rmsprop')
{ "content_hash": "a7c2eef5205fe8ff2e940a685e4f124b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 80, "avg_line_length": 36.8, "alnum_prop": 0.7880434782608695, "repo_name": "zlpmichelle/crackingtensorflow", "id": "26556d890c51b4fdbf6bf944fbd582ff89ae4a3d", "size": "184"...
import urllib.request from io import BytesIO import pandas as pd import ujson from elasticsearch import Elasticsearch csv = urllib.request.urlopen("https://docs.google.com/spreadsheet/pub?key=1h1udf_H073YaVlZs0fkYUf9dC6KbEZAhF1veeLExyXo&gid=937170620&output=csv").read() bio = BytesIO(csv) csv_pd = pd.DataFrame...
{ "content_hash": "13f61e92e5d2210e6fd8f9f94b9d944d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 152, "avg_line_length": 34.90909090909091, "alnum_prop": 0.7408854166666666, "repo_name": "bhillmann/dusty_coffin", "id": "e3f8fcfaa798b44a89b56422805b75cf3c565256", "size"...
import SimpleHTTPServer import SocketServer import traceback import os import sys import pymysql.cursors import subprocess to_shm = os.path.abspath(os.path.dirname(os.path.abspath(__file__ + os.sep + '..'))) sys.path.append(to_shm) import mysqldb db = mysqldb.MysqlConn() # read system arguments if len(sys.argv) != 2...
{ "content_hash": "1d20d4ec4d05e47c9b5338e8e5394a46", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 84, "avg_line_length": 22.323529411764707, "alnum_prop": 0.6310935441370223, "repo_name": "ke00n/alabno", "id": "ef7090877540980ee51ef7fd9e147342d32cda54", "size": "782", ...
"""Provides device triggers for binary sensors.""" import voluptuous as vol from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.const import ( CONF_TURNED_OFF, CONF_TURNED_ON, ) from homeassistant.components.homeassistant.triggers im...
{ "content_hash": "612e9065f7fb1c9d11a206559709076b", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 88, "avg_line_length": 30.53639846743295, "alnum_prop": 0.6558343789209535, "repo_name": "lukas-hetzenecker/home-assistant", "id": "f3eb1851247c4f818be35e4ce823909bddce3fa6"...
"""Tests for the noisy 2D Branin loss function.""" import os import sys import unittest import tensorflow as tf import numpy as np sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from deepobs.tensorflow import testproblems class Two_d_BraninTest(unittest.TestCase): ...
{ "content_hash": "abd568cb592dbe25c9ed1c381c6c6cbe", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 96, "avg_line_length": 35.142857142857146, "alnum_prop": 0.5604674796747967, "repo_name": "fsschneider/DeepOBS", "id": "14cb8d11219524ac60a4824834022fa4b90f1b99", "size": "...
from pyflink.table import DataTypes from pyflink.table.udf import ScalarFunction, udf from pyflink.testing import source_sink_utils from pyflink.testing.test_case_utils import PyFlinkStreamTableTestCase, \ PyFlinkBlinkStreamTableTestCase, PyFlinkBlinkBatchTableTestCase class UserDefinedFunctionTests(object): ...
{ "content_hash": "42231afc050f605ed56121fff6e35d34", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 99, "avg_line_length": 43.06284153005465, "alnum_prop": 0.5286466594759216, "repo_name": "mbode/flink", "id": "d529681f2e919aa5774b3ecb4efe0cdcd6d52209", "size": "16719", ...
from sklearn.naive_bayes import MultinomialNB # from sklearn.naive_bayes import BernoulliNB from sklearn.feature_extraction.text import TfidfVectorizer # from sklearn.ensemble import RandomForestClassifier import pickle from util import plot_roc # spacy_tok class NLPModel(object): def __init__(self): "...
{ "content_hash": "a9517b27451b5c52cdec76e0e7e21184", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6090909090909091, "repo_name": "zzsza/TIL", "id": "c771232cb69d6dd127b1fff14dbaa24953c8821f", "size": "2213", "...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cost_tracking', '0025_increase_price_decimal_places'), ] operations = [ migrations.RemoveField( model_name='priceestimate', name='li...
{ "content_hash": "8272dbb2c5107517ba01d5aad34104ed", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 64, "avg_line_length": 21.714285714285715, "alnum_prop": 0.5789473684210527, "repo_name": "opennode/nodeconductor", "id": "466bad4eb1b02bb98dfaa89bef74e40783ef479f", "size"...
import unittest loader = unittest.TestLoader() tests = loader.discover('.') testRunner = unittest.runner.TextTestRunner() testRunner.run(tests)
{ "content_hash": "0d810ad8d3e107e5d5e378dfd62752d0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 28.8, "alnum_prop": 0.7847222222222222, "repo_name": "mscelnik/besett", "id": "89ccbc4f7c8a997cf6e87c8216f10a4cb78e83cc", "size": "144", "binary": f...
import csv import json import logging import urllib2 import datetime import json import webapp2 import model import server.seed class Pollution: def __init__(self, id, parameter, tecnic, period, ce01, ce02, ce03, station, timestamp, value): self.id = id self.parameter = parameter self.tecnic = tecnic ...
{ "content_hash": "947ebd00b2ee6f866bf69e9f9e08f804", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 149, "avg_line_length": 33.71604938271605, "alnum_prop": 0.5327718784328085, "repo_name": "emarinizquierdo/breathe-better", "id": "9e3cf0d18603cd3c6093aa4937ec224cc6eab0de", ...
"""Implementation of k-means clustering on top of `Estimator` API. This module is deprecated. Please use @{tf.contrib.factorization.KMeansClustering} instead of @{tf.contrib.learn.KMeansClustering}. It has a similar interface, but uses the @{tf.estimator.Estimator} API instead of @{tf.contrib.learn.Estimator}. """ fr...
{ "content_hash": "40da53676d389774fdf3369eb52c9b9f", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 39.00763358778626, "alnum_prop": 0.7011741682974559, "repo_name": "alistairlow/tensorflow", "id": "992b804f59ecd88fedc2fba10d3079f93c4fe83d", "size"...
from django.utils.translation import ugettext_lazy as _ import horizon class SystemPanels(horizon.PanelGroup): slug = "admin" name = _("System") panels = ('overview', 'metering', 'hypervisors', 'aggregates', 'instances', 'volumes', 'flavors', 'images', 'networks', 'routers', '...
{ "content_hash": "4fe82082464e10301aea51ca17a42416", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 25.142857142857142, "alnum_prop": 0.6335227272727273, "repo_name": "aaronorosen/horizon-congress", "id": "5eb41ef7cfeb3bfb302750b2f63d7a7cc216f791", ...
from pyscf import gto from pyscf import scf ''' Density fitting method by decorating the scf object with scf.density_fit function. There is no flag to control the program to do density fitting for 2-electron integration. The way to call density fitting is to decorate the existed scf object with scf.density_fit funct...
{ "content_hash": "082ee916cae05940380711484acc6204", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 82, "avg_line_length": 29.53448275862069, "alnum_prop": 0.699357851722125, "repo_name": "sunqm/pyscf", "id": "e80263884ebd4aa2b03b96dfa6c514202d5acb59", "size": "1784", "...
import saga import os import sys import re import random import time import pwd def submit_remote_job(mod, username, params): read_pipe, write_pipe = os.pipe() pid = os.fork() if pid: os.close(write_pipe) r = os.fdopen(read_pipe) os.waitpid(pid,0) output = r.read() j...
{ "content_hash": "59be7560275584307502d2200d5a5ce4", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 74, "avg_line_length": 27.39325842696629, "alnum_prop": 0.5490155865463495, "repo_name": "ResearchComputing/myhat", "id": "ed4b0e27bdc81750b64802ea98125f8dd42d06bf", "size...
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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....
{ "content_hash": "85f6f53c0fe29661131fcef2a6b9695d", "timestamp": "", "source": "github", "line_count": 675, "max_line_length": 95, "avg_line_length": 33.07111111111111, "alnum_prop": 0.5365318281592976, "repo_name": "Multiscale-Genomics/mg-rest-dm", "id": "894c69cd7090330ca2b0901d622320c57b61a41e", ...