text
stringlengths
4
1.02M
meta
dict
"""Files API. .. deprecated:: 1.8.1 Use Google Cloud Storage Client library instead. Blobstore-specific Files API calls.""" from __future__ import with_statement __all__ = ['create', 'get_blob_key', 'get_file_name'] import hashlib import urllib from google.appengine.api import datastore from google.appengine....
{ "content_hash": "42ef256b7c20209a7ce0dccd1f7f2f46", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 80, "avg_line_length": 29.621794871794872, "alnum_prop": 0.7048257952824064, "repo_name": "dcroc16/skunk_works", "id": "65d5ea1e5af857629540df9e30db11b57fef387c", "size": ...
'''Basic tests about the client''' from common import TestQless class TestClient(TestQless): '''Test the client''' def test_track(self): '''Gives us access to track and untrack jobs''' self.client.queues['foo'].put('Foo', {}, jid='jid') self.client.track('jid') self.assertEqua...
{ "content_hash": "84e618d85b6287899066547b636abecd", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 78, "avg_line_length": 37.45348837209303, "alnum_prop": 0.5811859670909656, "repo_name": "seomoz/qless-py", "id": "f9be6467f899fdf593ee964aaef1df72ae23a9fa", "size": "6442...
from __future__ import unicode_literals import json from django.forms import widgets from django.utils.safestring import mark_safe from django.utils.encoding import force_text from django.utils.html import format_html, format_html_join def flatatt(attrs): """ Pilfered from `django.forms.utils`: Convert a...
{ "content_hash": "eed67496a9461be8e72d7be8a4e6d7f0", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 107, "avg_line_length": 39.785185185185185, "alnum_prop": 0.6397318935021411, "repo_name": "centrologic/django-codenerix", "id": "587de619dac5ede9e7f561c3d27d734504a41b3c", ...
import uuid import redis redis_server = redis.StrictRedis(host='localhost', port=6379, db=0) def create_code(number=200): code_result = [] while True is True: temp = str(uuid.uuid1()).replace('-', '') if temp not in code_result: code_result.append(temp) if len(code_result) ...
{ "content_hash": "b7095932277218f1e2239a62ae176702", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 67, "avg_line_length": 25.153846153846153, "alnum_prop": 0.6095820591233435, "repo_name": "zhangmianhongni/MyPractice", "id": "d8490c6be2a000ae16531d905f434dfe5b6aa51d", "s...
from uuid import uuid4 from changes.config import db from changes.constants import Result, Status from changes.models.filecoverage import FileCoverage from changes.testutils import APITestCase class BuildCoverageTest(APITestCase): def test_error(self): fake_build_id = uuid4() path = '/api/0/buil...
{ "content_hash": "525969e68878a74b12cc7794c7d109c6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 70, "avg_line_length": 30.073529411764707, "alnum_prop": 0.5550122249388753, "repo_name": "dropbox/changes", "id": "3b44c4f444e4bc15ab6a6d158467ab546c89c3dd", "size": "2045...
''' Written by Lijun An and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ''' import os import numpy as np import pandas as pd from copy import deepcopy from utils.misc import create_folder, load_pkl, save_pkl def pick_well_matched_pairs(args, step4_ou...
{ "content_hash": "18c36681dfc52d0f767d77dd93ffe516", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 79, "avg_line_length": 40.486373165618446, "alnum_prop": 0.5759631317315659, "repo_name": "ThomasYeoLab/CBIG", "id": "8bcf4d72205e778ffb998458edd5054f083988b2", "size": "1...
DEPLOYMENT_STAGE = "development" stage_settings = __import__( DEPLOYMENT_STAGE, globals(), locals()) globals().update(stage_settings.__dict__)
{ "content_hash": "8c0c6e2faad3979f85ab2cd89d6aa3ea", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 67, "avg_line_length": 47.666666666666664, "alnum_prop": 0.7202797202797203, "repo_name": "HacktivateOrg/poll", "id": "2111152febdb4ff4219a33963ee6aba1142f9339", "size": "14...
"""Support for collections of mapped entities. The collections package supplies the machinery used to inform the ORM of collection membership changes. An instrumentation via decoration approach is used, allowing arbitrary types (including built-ins) to be used as entity collections without requiring inheritance from ...
{ "content_hash": "37b11888df9300351a004602f6dd4665", "timestamp": "", "source": "github", "line_count": 1539, "max_line_length": 78, "avg_line_length": 33.708252111760885, "alnum_prop": 0.6019816103475528, "repo_name": "ThiefMaster/sqlalchemy", "id": "58a69227c1d831dea728476837fd67fd6e1e1c8e", "siz...
from . import molecule_util from . import rna_seq_util from . import taxonomy_util from . import warning_util from . import mongo_util from . import file_util from . import chem_util
{ "content_hash": "7a05f8f454645d6bdbe57b47a30a8e20", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 27, "avg_line_length": 26.142857142857142, "alnum_prop": 0.7650273224043715, "repo_name": "KarrLab/kinetic_datanator", "id": "00dc351aee1a2082b3963ad721e1cae8eb2af576", "siz...
"""The main model training loop.""" import functools import os import time from typing import Callable, Dict, Iterable, Mapping, Optional, Tuple, Type, Union from absl import logging from clu import checkpoint from clu import metric_writers from clu import metrics from clu import parameter_overview from clu import pe...
{ "content_hash": "ee861c3399dbcfce5dc5ed2712d03088", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 111, "avg_line_length": 39.54807692307692, "alnum_prop": 0.6729880865548261, "repo_name": "google-research/slot-attention-video", "id": "c31e21b789fa8bcdd6343fc474fd6e15ae58...
from django.conf.urls import include, url, patterns from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from haystack.views import search_view_factory from .views import DocumentView, Search, LanguageRedirectView search_view = search_view_factory(Search) urlpatterns = patterns( url(r'...
{ "content_hash": "81f75e74110522017af746b6b712664d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 32.833333333333336, "alnum_prop": 0.7174280879864636, "repo_name": "aaronhelton/django-multilingual-search", "id": "bd357b6867128568bf63c5b47676d9037a7...
import rospy from std_msgs.msg import String def callback(message): rospy.loginfo("%s",message.data) rospy.init_node('PlayMusicRobot') sub = rospy.Subscriber('HandOff',String,callback) rospy.spin()
{ "content_hash": "33c079ebf0a5731efc938ab8f4003037", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 49, "avg_line_length": 22.666666666666668, "alnum_prop": 0.7549019607843137, "repo_name": "shuheikawai/robosys2015", "id": "d8c3e271e00193b13cb0e78fc8e5fe83aadf9454", "size"...
import numpy as np import matplotlib.pyplot as plt import sys # Add the PyRsw tools to the path # At the moment it is given explicitely. # In the future, it could also be added to the # pythonpath environment variable sys.path.append('../src') import Steppers as Step import Fluxes as Flux from PyRsw import Simulation...
{ "content_hash": "ae7f15059e6fb4f1ca75e79f08d6770d", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 98, "avg_line_length": 33.59405940594059, "alnum_prop": 0.5688181550250516, "repo_name": "PyRsw/PyRsw", "id": "5a19fb3eb691ccfdd6b6c8437d8abe102563d70b", "size": "3393", ...
"""rankmylibrary URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
{ "content_hash": "f1ce7c0f71f56189d0219c0aa8504699", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 36.333333333333336, "alnum_prop": 0.7011795543905636, "repo_name": "NestarZ/rank-my-library", "id": "27406a764b61fca82cd4a52498731ecd963d3ffa", "size...
import _plotly_utils.basevalidators class SizeminValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="sizemin", parent_name="scatter.marker", **kwargs): super(SizeminValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "32b273fad4966c907c6820d351443e64", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 86, "avg_line_length": 36.833333333333336, "alnum_prop": 0.6085972850678733, "repo_name": "plotly/plotly.py", "id": "a03781f33a48f6ecc03834ba5b565c1a0d26cc50", "size": "442...
import stripe import datetime from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.views.decorators.csrf import csrf_protect from django.contrib.auth import logout as logout_user from django.contrib.auth import login as login_user from django.db.mod...
{ "content_hash": "ec3b4076f982942c3266696695f413ff", "timestamp": "", "source": "github", "line_count": 608, "max_line_length": 126, "avg_line_length": 37.36842105263158, "alnum_prop": 0.6384683098591549, "repo_name": "slava-sh/NewsBlur", "id": "33fe209030d16b5261230b8d1365dd26cb0e1e84", "size": "2...
from __future__ import division import os import subprocess from tempfile import TemporaryFile, NamedTemporaryFile import wave import sys from .logging_utils import log_conversion try: from StringIO import StringIO except: from io import StringIO, BytesIO from .utils import ( _fd_or_path_or_tempfile, ...
{ "content_hash": "0c52981785d12e4426843d8b2ac9c10b", "timestamp": "", "source": "github", "line_count": 811, "max_line_length": 120, "avg_line_length": 32.07521578298397, "alnum_prop": 0.5496866951139815, "repo_name": "cbelth/pyMusic", "id": "6bcbb4d761b5719f0ff6ef74e3c81f3f08f959ff", "size": "2601...
"""Package for GDM.""" import sys __project__ = 'GDM' __version__ = '0.3dev' CLI = 'gdm' VERSION = __project__ + '-' + __version__ DESCRIPTION = 'A very basic language-agnostic "dependency manager" using Git.' PYTHON_VERSION = 3, 3 if not sys.version_info >= PYTHON_VERSION: # pragma: no cover (manual test) ex...
{ "content_hash": "9b279e5a44df0de42070453598ae24a4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 24.55, "alnum_prop": 0.6578411405295316, "repo_name": "jacebrowning/gdm-demo", "id": "0cd8035230d2edd1c9826831642296ae2139021c", "size": "491", "bi...
import json from django.views.generic import View from django import http from django.shortcuts import get_object_or_404 from django import forms from trix.trix_core import models class HowSolvedForm(forms.ModelForm): class Meta: model = models.HowSolved fields = ['howsolved'] class HowsolvedVi...
{ "content_hash": "342c8105b24bd4fe74f68d4998278ff8", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 93, "avg_line_length": 33, "alnum_prop": 0.6017871017871018, "repo_name": "devilry/trix2", "id": "e290a0a2d8589338d2c922be4d74a9044a7517c9", "size": "2574", "binary": fal...
from app.enums import FileCategory from app.repository import alv_repository from app.exceptions.base import ResourceNotFoundException from app.service import file_service from werkzeug.utils import secure_filename def save_alv(alv): alv_repository.save(alv) def add_minutes(alv, minutes_file): _file = file...
{ "content_hash": "c9943b9262a299c268fbc848a2defb63", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 77, "avg_line_length": 28.905982905982906, "alnum_prop": 0.6759314015375517, "repo_name": "viaict/viaduct", "id": "606f72c382c5debf7ed3420d426314e256cfc3fa", "size": "3382...
from mock import patch from .utils import unittest, ArgyleTest from argyle import nginx class NginxTest(ArgyleTest): "Base for setting up necessary patches." package = 'argyle.nginx' patched_commands = ['sudo', 'files', 'upload_template', 'restart_service', ] class EnableDisableSitesTest(NginxTest): ...
{ "content_hash": "ef0e74fca773e21e95a72d3dca362ff8", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 102, "avg_line_length": 40.2, "alnum_prop": 0.6557213930348259, "repo_name": "mlavin/argyle", "id": "6a365c18bc486f3cf44cde0716d25bd235383662", "size": "4020", "binary":...
from .utils import write_dict_to_json from .utils import write_dict_to_csv
{ "content_hash": "9eb30a832f8552672b64c309b48c03ca", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 37, "avg_line_length": 37.5, "alnum_prop": 0.7866666666666666, "repo_name": "howsunjow/YahooFinance", "id": "f00ffc2c56171d4945ddfad93ac5d0343b00fabb", "size": "75", "bina...
""" Sahana Eden Inventory Model @copyright: 2009-2012 (c) Sahana Software Foundation @license: MIT 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, inc...
{ "content_hash": "625120e39846fab6075f9dc15e4e34cb", "timestamp": "", "source": "github", "line_count": 2088, "max_line_length": 217, "avg_line_length": 47.02873563218391, "alnum_prop": 0.38543321520224855, "repo_name": "flavour/ssf", "id": "933d82aaf1fc51e0e97370cd329621720a5f7c76", "size": "98221...
from .test_category import * from .test_manufacturer import * from .test_product import *
{ "content_hash": "ba3c6194b0c5012674e1d187dc2e7313", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 32, "avg_line_length": 30, "alnum_prop": 0.7666666666666667, "repo_name": "samitnuk/online_shop", "id": "7f2a7ad4ac0e63e30cb00a575634026412be7c99", "size": "90", "binary":...
from django.conf.urls import include, url from . import views app_name = "pages" urlpatterns = [ url(r'^(?P<slug>[^/]+)$', views.page, name="page"), ]
{ "content_hash": "3e7abc6991b0de18d3e50831252beab8", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 19.625, "alnum_prop": 0.6242038216560509, "repo_name": "nnscr/nnscr.de", "id": "c352c982a68c538568f3d362d450f4da62c96a4a", "size": "157", "binary": ...
verify_stack_after_op = False # ###################################### import copy from ethereum import utils from ethereum import opcodes from ethereum.slogging import get_logger from rlp.utils import encode_hex, ascii_chr from ethereum.utils import to_string log_log = get_logger('eth.vm.log') log_vm_exit = get_log...
{ "content_hash": "d01fc67247d0d08e06c6ea5bea95d3d0", "timestamp": "", "source": "github", "line_count": 681, "max_line_length": 100, "avg_line_length": 42.86637298091043, "alnum_prop": 0.49136749794464235, "repo_name": "shahankhatch/pyethereum", "id": "a1b3edad572ea67cd4dcc2f869a3ea1eefcc3977", "si...
from setuptools import setup VERSION = '0.1.1' def read(file_name): with open(file_name, 'r') as f: return f.read() setup( name='django-terminator', description='''One time method executor for Django models''', long_description=read('README.rst'), version=str(VERSION), author='Krzysz...
{ "content_hash": "4f7154a01e9f082be31a911868044573", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 65, "avg_line_length": 29.666666666666668, "alnum_prop": 0.6179775280898876, "repo_name": "KrzysiekJ/django-terminator", "id": "dca07c017cdfaf7907fd4b1df9f90aba90aa1f4c", "...
import logging from datetime import date from dateutil.relativedelta import relativedelta from dateutil.rrule import ( MONTHLY, rrule, ) from decimal import Decimal from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.contrib.contenttypes.fields import GenericForei...
{ "content_hash": "0f0c6228f21fdef52d7a27f156f2f3bd", "timestamp": "", "source": "github", "line_count": 1245, "max_line_length": 87, "avg_line_length": 30.840160642570282, "alnum_prop": 0.5877435149494739, "repo_name": "pkimber/checkout", "id": "916fcf31548848689ef72320f0b8fe0800dfddf7", "size": "3...
"A collection of augmented standard classes" from hawkweed.classes.list_cls import List from hawkweed.classes.dict_cls import Dict from hawkweed.classes.iterable import Iterable from hawkweed.classes.set_cls import Set from hawkweed.classes.repr import Repr from hawkweed.classes.collection import Collection
{ "content_hash": "46e6c9418423f854c3741f4f6c596e1f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 50, "avg_line_length": 44.142857142857146, "alnum_prop": 0.8478964401294499, "repo_name": "hellerve/hawkweed", "id": "af306f277f016fe1151439dd4de0059c3249cd8e", "size": "309...
"""Package contenant la commande 'route liste'.""" from primaires.format.tableau import Tableau, DROITE from primaires.interpreteur.masque.parametre import Parametre class PrmListe(Parametre): """Commande 'route liste'""" def __init__(self): """Constructeur du paramètre.""" Parametre.__init_...
{ "content_hash": "2aebfd3b795c06189314915127e330e0", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 40.15555555555556, "alnum_prop": 0.6104039845047039, "repo_name": "stormi/tsunami", "id": "3d27163ab1f60dbd2a00b9b6d35277491b895612", "size": "3379",...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..')) # append the MIALab root directory to Python path # fixes the ModuleNotFoundError when executing statistics.py in the console after code changes (e.g. git pull) # somehow pip install does not keep track of packages import mial...
{ "content_hash": "1856edcf7f25fe935e0a0c34692b7df6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 119, "avg_line_length": 41.27272727272727, "alnum_prop": 0.6806167400881057, "repo_name": "mrunibe/MIALab", "id": "bef3341c6b047522b06ad5233c0ea8e224756e1c", "size": "908",...
''' Global variables ''' from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy()
{ "content_hash": "2a7292b96794d1a5fc490b242ac35839", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 12.714285714285714, "alnum_prop": 0.6966292134831461, "repo_name": "TheWaWaR/py-marked-diff", "id": "40264ce270caff7cddd36e5e116e56dfd9d2d9b9", "size"...
""" User view """ from ..utils import err from ..models import db, User, Library, Permissions from ..client import client from base_view import BaseView from flask import current_app from flask.ext.discoverer import advertise from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound from h...
{ "content_hash": "afea771db352bc3444e1b6e0a4625788", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 114, "avg_line_length": 31.836158192090394, "alnum_prop": 0.5669920141969832, "repo_name": "jonnybazookatone/biblib-service", "id": "d0f98ea7f0bb8374f96b6a68f9c8ea101073a6e3...
"""Tests for base_inference_runner.""" from __future__ import annotations from typing import Any, List from absl.testing import absltest import jax import numpy as np from paxml import base_inference_runner from praxis import base_hyperparams from praxis import base_layer from praxis import base_model from praxis im...
{ "content_hash": "99914873188e71a9f037016a36c96f9e", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 78, "avg_line_length": 32.848101265822784, "alnum_prop": 0.7148362235067437, "repo_name": "google/paxml", "id": "008b8e53e091a1981d83c37bb25c4cda44723be5", "size": "3186", ...
from cStringIO import StringIO from pyglet.media import avbin av = avbin.av from ctypes import * class URLContext(Structure): _fields_ = [ ("prot", c_void_p), ("flags", c_int), ("is_streamed", c_int), ("max_packet_size", c_int), ("priv_data", c_void_p), ("filename", ...
{ "content_hash": "df3b4e9986775bf562dcce299dde2736", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 79, "avg_line_length": 29.371681415929203, "alnum_prop": 0.6456764085567942, "repo_name": "fos/fos-legacy", "id": "5e40aa7366abe4344b8ce306cd294e843e1ec0d2", "size": "3319...
from tartist.app import gan from tartist.app.gan import GANGraphKeys from tartist.core import get_env, get_logger from tartist.core.utils.naming import get_dump_directory, get_data_directory from tartist.nn import opr as O, optimizer, summary logger = get_logger(__file__) __envs__ = { 'dir': { 'root': get...
{ "content_hash": "10c0dc455bbb71df7e47f6dba8ad89a2", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 115, "avg_line_length": 38.94202898550725, "alnum_prop": 0.5593598809080759, "repo_name": "vacancy/TensorArtist", "id": "99700fac84ab23d9346a3432f90be11cdf4d0d08", "size":...
"""Shared code for attacks and defenses.""" import abc import inspect import os import numpy as np import tensorflow as tf class DefenseModel(abc.ABC): """Base class which defines interface for all defense models. This base class supports two options for defense model: - defense model which only returns...
{ "content_hash": "321fdf5f78fbc3c908da2a062d73bc39", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 111, "avg_line_length": 38.90041493775934, "alnum_prop": 0.6437333333333334, "repo_name": "google-research/selfstudy-adversarial-robustness", "id": "95a3e5205598f1bc3481273a...
from distutils.core import setup PACKAGE = "paypal_reporter" NAME = "paypal_reporter" DESCRIPTION = "A library to generate reports about activity in a PayPal account" AUTHOR = "Itai Shirav" AUTHOR_EMAIL = "[email protected]" URL = "https://github.com/ishirav/paypal-reporter" VERSION = __import__(PACKAGE).__version__ ...
{ "content_hash": "4884602f7e9c8dbc257e5c39274481ee", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 80, "avg_line_length": 29.933333333333334, "alnum_prop": 0.6536748329621381, "repo_name": "ishirav/paypal-reporter", "id": "015f3f53f12a7dd77b89a3a98065f2cb40bb5251", "size...
""" Talon.One API Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage ap...
{ "content_hash": "704faeedca8f8a1b2c9824bdcc4a7e91", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 732, "avg_line_length": 37.28365384615385, "alnum_prop": 0.6314635718891038, "repo_name": "talon-one/talon_one.py", "id": "51a1d3f22f3ab3d4dd32565bfa6a1de788a4baf0", "size...
from datetime import datetime, timedelta, tzinfo import logging import pytest from planet import data_filter, exceptions LOGGER = logging.getLogger(__name__) def test_and_filter(): f1 = {'type': 'testf1'} f2 = {'type': 'testf2'} res = data_filter.and_filter([f1, f2]) expected = {'type': 'AndFilter',...
{ "content_hash": "4ea5db055288b54e60f88934a0169bfb", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 79, "avg_line_length": 28.793427230046948, "alnum_prop": 0.5225827490624491, "repo_name": "planetlabs/planet-client-python", "id": "4e173a2159f3920ea6d055cb0ef768778ba4e9db"...
from __future__ import unicode_literals from django.db import models, migrations import cms.models.fields class Migration(migrations.Migration): operations = [ migrations.CreateModel( name='Example1', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=F...
{ "content_hash": "ae95dc229b40a2192f0c360a494a339e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 149, "avg_line_length": 51.32098765432099, "alnum_prop": 0.5556891989415443, "repo_name": "pbs/django-cms", "id": "d3545e860a5a65fcb6f87c6e4be0db8902505ffe", "size": "4181"...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Course.has_groups' db.add_column('courses_course', 'has_groups', self.gf('django.db.models.fie...
{ "content_hash": "1465782f0a411c901cd4d828b561a36a", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 232, "avg_line_length": 79.79475982532752, "alnum_prop": 0.5486783779346577, "repo_name": "GeographicaGS/moocng", "id": "7b829ef3330a646f724d2e913bacade70059f042", "size":...
import pytest from pants_test.backend.jvm.tasks.jvm_compile.rsc.rsc_compile_integration_base import ( RscCompileIntegrationBase, ensure_compile_rsc_execution_strategy, ) class RscCompileIntegrationYoutline(RscCompileIntegrationBase): @ensure_compile_rsc_execution_strategy(RscCompileIntegrationBase.outlin...
{ "content_hash": "1e084488a0ccb5aca2c29697308e70d1", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 92, "avg_line_length": 39.592592592592595, "alnum_prop": 0.7380729653882133, "repo_name": "wisechengyi/pants", "id": "c06f125752116575ff8269e6f8d251d7303b6f61", "size": "12...
import _plotly_utils.basevalidators class TickformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="tickformat", parent_name="layout.scene.yaxis", **kwargs ): super(TickformatValidator, self).__init__( plotly_name=plotly_name, p...
{ "content_hash": "42615baf73e306a72f413ecdf2fcb924", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 82, "avg_line_length": 34, "alnum_prop": 0.6029411764705882, "repo_name": "plotly/python-api", "id": "129a24f87a8a4d55778e821fef7d492463afb371", "size": "476", "binary": ...
import logging import logging.config import constants logging.config.fileConfig("logging.conf", defaults={"logfilename": constants.logfileName})
{ "content_hash": "5c2bfeb2238d2274d71948fe778dbf99", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 90, "avg_line_length": 24.5, "alnum_prop": 0.8163265306122449, "repo_name": "crash-g/BoardGameBot", "id": "fa1527e90b1a157c06352eb1882f5ae6189f5316", "size": "147", "binar...
from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse from azure.core.p...
{ "content_hash": "8985918072843579407d9a9a4391f271", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 211, "avg_line_length": 41.362116991643454, "alnum_prop": 0.648663209643747, "repo_name": "Azure/azure-sdk-for-python", "id": "94a3f84e941b0c260346f6b2994fc11e4783138f", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('polls', '0003_auto_20180809_1141'), ] operations = [ migrations.AddField( model_name='poll', name='open', field=...
{ "content_hash": "77f8ae944ba7b816b21a8f4b7bdafbe7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 52, "avg_line_length": 20.666666666666668, "alnum_prop": 0.5860215053763441, "repo_name": "WarwickAnimeSoc/aniMango", "id": "fdc861c2e3cab9a82e9edb9b679f6d99a71cf737", "siz...
import sqlite3 import hashlib import os import threading import sqlalchemy.pool as pool global pas global ind2 global sql_thread_pool def menu(): sane = 1 while sane == 1: print "[ - ] Please enter absolute path to cred. database: " in_path = raw_input() if os.path.exists(in_path): sane = 0...
{ "content_hash": "5c59b41c32e3a16d2d795de4eeed778e", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 96, "avg_line_length": 25.6, "alnum_prop": 0.5974702380952381, "repo_name": "0xhughes/credential_db", "id": "73aaa339bfcef2f6303340b4308779265a94531b", "size": "2688", "...
class WordHist(dict): def append(self, d1): for key, value in d1.items(): key = key.lower() self[key] = self[key] + value if key in self else value def get_tf(self, querie_word): word_count = 0.0 for key, value in self.items(): if querie_word in key...
{ "content_hash": "6e733602ba9305027c0360be5ee05ad4", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 89, "avg_line_length": 26.454545454545453, "alnum_prop": 0.5441008018327605, "repo_name": "thomasmauerhofer/search-engine", "id": "610abe4dc3b3c7751a7814024423e915e7be8c77", ...
import pytest from feedrsub.feeds.search_manager import FeedSearchManager from feedrsub.models.feed import STATUS, Feed from feedrsub.models.feedinfo_schema import FeedInfo from tests.factories import FeedFactory @pytest.fixture(scope="function") def feedsearchmanager(): return FeedSearchManager() @pytest.fixt...
{ "content_hash": "115f5b2721cf4bdb58258aa5cd33f5c2", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 88, "avg_line_length": 31.36046511627907, "alnum_prop": 0.7189469781238413, "repo_name": "DBeath/flask-feedrsub", "id": "828bbecddc37f18ef8884827c5651c5d98c01ea1", "size":...
from __future__ import annotations from cctbx import sgtbx from scitbx import matrix from xia2.Experts.LatticeExpert import lattice_to_spacegroup def _multiply_symmetry_matrix(a, b): """compute a * b, for e.g. h_ = a * b * h, e.g. apply b before a.""" return (matrix.sqr(a) * matrix.sqr(b)).elems def r_to...
{ "content_hash": "311c1b635f8aa74cd47c36c668b9cc47", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 86, "avg_line_length": 23.532258064516128, "alnum_prop": 0.6271418779986292, "repo_name": "xia2/xia2", "id": "01d951300eba29610090fbef36fa2bb9bcf22d4c", "size": "1459", "...
import cookielib import copy import httplib import os import json import pickle import Queue import random import re import socket import sys import time import urllib2 import urlparse from threading import Thread from task import * import config GENERATE_RESULTS = config.GENERATE_RESULTS COOKIES_ENABLED = config.COOK...
{ "content_hash": "2da571fcb2baece04f1ca69edccb6a57", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 127, "avg_line_length": 33.505050505050505, "alnum_prop": 0.5304994472917295, "repo_name": "hishopdc/pybench", "id": "1fc583cb357e4bc81dd36e340f5548cc54d61b12", "size": "1...
from unittest import mock import twisted.web.client from twisted.internet import defer from twisted.test.proto_helpers import MemoryReactor from synapse.api.room_versions import RoomVersions from synapse.events import EventBase from synapse.rest import admin from synapse.rest.client import login, room from synapse.se...
{ "content_hash": "d9f22c6a01dd06300c30eefefca7420e", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 100, "avg_line_length": 37.43344709897611, "alnum_prop": 0.5447665937272064, "repo_name": "matrix-org/synapse", "id": "e67f4058260f561269839693d4422225812fa2a2", "size": "...
""" Post Markup Author: Will McGugan (http://www.willmcgugan.com) pyClanSphere-related addons by pyClanSphere Team """ __version__ = "1.1.5dev-pyClanSphere" import re from urllib import quote, unquote, quote_plus, urlencode from urlparse import urlparse, urlunparse pygments_available = True try: from pyg...
{ "content_hash": "fb0b3c21ba746aa5296bc8a5bd3c69da", "timestamp": "", "source": "github", "line_count": 1721, "max_line_length": 168, "avg_line_length": 29.829169087739686, "alnum_prop": 0.5423484494311984, "repo_name": "jokey2k/pyClanSphere", "id": "0bb29cdf1e785d36a94522dab195163bb86ae340", "size...
from app import app from config import PORT app.run(host='0.0.0.0', port=int(PORT), debug=False)
{ "content_hash": "8a4593e148079e501772e941a345ff90", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 52, "avg_line_length": 24.5, "alnum_prop": 0.7244897959183674, "repo_name": "PradheepShrinivasan/picourl", "id": "274d195de04e9606f16bd13b4617625a7f6103ad", "size": "118", ...
import operator from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse_lazy from django.utils.decorators import method_decorator # noqa from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters # noqa from horizon i...
{ "content_hash": "0d6c7895e9c436d02b9da581f4ff2390", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 78, "avg_line_length": 37.94736842105263, "alnum_prop": 0.5968562182154415, "repo_name": "JioCloud/horizon", "id": "ee8f3dd37299d87582866bb3b79236eeb9a38290", "size": "509...
import tempfile from typing import Any, TypeVar from azure.cli.core import AzCommandsLoader from azure.cli.core._config import ENV_VAR_PREFIX from azure.cli.core.cloud import get_active_cloud from azure.cli.core.commands import AzCliCommand from knack import CLI MOCK_CLI_CONFIG_DIR = tempfile.mkdtemp() MOCK_CLI_ENV_V...
{ "content_hash": "d772db2b63b30807844fae09366c02e8", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 101, "avg_line_length": 26.267605633802816, "alnum_prop": 0.6262734584450402, "repo_name": "yugangw-msft/azure-cli", "id": "1d001294767e26bf107f88d7a309e7356941f645", "size...
from typing import TYPE_CHECKING from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transpo...
{ "content_hash": "161a9bec71098cf94507a60acc9f9447", "timestamp": "", "source": "github", "line_count": 3964, "max_line_length": 282, "avg_line_length": 42.627144298688194, "alnum_prop": 0.6330145466166393, "repo_name": "Azure/azure-sdk-for-python", "id": "a95f5652e08c5d47c24b640721833bec70066941", ...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Gauge(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "indicator" _path_str = "indicator.gauge" _valid_props = { "axis", "bar", ...
{ "content_hash": "6e815803d163fce5d60ca5d8cd3419be", "timestamp": "", "source": "github", "line_count": 669, "max_line_length": 82, "avg_line_length": 39.37369207772795, "alnum_prop": 0.5248092327550207, "repo_name": "plotly/python-api", "id": "7d5c7c6fb4aef9151aa8358341f9837f227b488c", "size": "26...
from lxml import html from lxml import etree #When done delete the unused import line from lxml.etree import fromstring #i think i can delete this line from py2neo import neo4j, Graph, Node, Relationship, rel import requests #no need for this anymore import sys import os import json import time #...
{ "content_hash": "9b28547ad0079ba20735b9029a4cf617", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 216, "avg_line_length": 40.19799498746867, "alnum_prop": 0.5698609639004926, "repo_name": "davidmeza1/KA_Interns", "id": "b1778bae29c963d56b00c6c08817843949a6e1b4", "size"...
"""Wide ResNet 40-4 architecture for CIFAR-100.""" import tensorflow as tf from ._wrn import _wrn from ..datasets.cifar100 import cifar100 from .testproblem import TestProblem class cifar100_wrn404(TestProblem): """DeepOBS test problem class for the Wide Residual Network 40-4 architecture\ for CIFAR-100. ...
{ "content_hash": "149c156cf05f65705dae5ffab29440f4", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 85, "avg_line_length": 39.1125, "alnum_prop": 0.6538830297219559, "repo_name": "fsschneider/DeepOBS", "id": "f1d219360083e72691725a167adb737cf6cc6131", "size": "3153", "b...
kDefaultMMFontFileName = "mmfont.pfa" kInstancesDataFileName = "instances" kCompositeDataName = "temp.composite.dat" ################################################### __copyright__ = """ Copyright 2014-2016 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. This software is licensed as OpenSo...
{ "content_hash": "13f2c7a98f5a25308e6723f7301c0757", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 196, "avg_line_length": 33.4156862745098, "alnum_prop": 0.684661424715409, "repo_name": "adobe-type-tools/fontlab-scripts", "id": "3b241aa3ddbeb081891883e568d8abcc51dc87e0",...
from django.conf.urls import url from .views import ( AliTemplateView, AliVideoconferenciasDetailView, AreaDetailView, AulaDetailView, CuerpoDetailView, IndexView, LaboratorioDetailView, LaboratorioInformaticoDetailView, LaboratorioInformaticoListView, NivelDetailView, recur...
{ "content_hash": "5fa5abbff6923889f00f1187052f8d1e", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 78, "avg_line_length": 27.07843137254902, "alnum_prop": 0.5821868211440985, "repo_name": "utn-frm-si/reservas", "id": "0149c118d8e98a1f596642f67ed4c3512f0f8b0e", "size": "...
from __future__ import unicode_literals from collections import deque from djblets.util.compat.django.template.loader import render_to_string from reviewboard.reviews.errors import DepthLimitExceededError #: The maximum depth limit of any action instance. MAX_DEPTH_LIMIT = 2 #: The mapping of all action IDs to th...
{ "content_hash": "42fcbb6150d2680d372523cf9e4364d4", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 79, "avg_line_length": 31.94396551724138, "alnum_prop": 0.614154635002024, "repo_name": "chipx86/reviewboard", "id": "0b7687fa9e461d63bd78fefdf5f21ca23351c793", "size": "1...
from __future__ import unicode_literals import os import re import warnings from contextlib import contextmanager from datetime import timedelta from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.core.files import File from django.utils import ...
{ "content_hash": "8fa4548ac429a1bc381f4c55ed38540b", "timestamp": "", "source": "github", "line_count": 1131, "max_line_length": 85, "avg_line_length": 36.315649867374006, "alnum_prop": 0.5581282107467193, "repo_name": "brennie/reviewboard", "id": "bcb7a00473d82b77e2cade4699da0041398a921e", "size":...
from obspy.core import UTCDateTime as UTC from sito.data import IPOC from sito.noisexcorr import (prepare, get_correlations, plotXcorrs, noisexcorrf, stack) from sito import util import matplotlib.pyplot as plt from sito.stream import read from multiprocessing import Pool import time from s...
{ "content_hash": "cad64db182a1665ea1f681ecc2ec9a58", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 133, "avg_line_length": 44.91869918699187, "alnum_prop": 0.6079638009049774, "repo_name": "trichter/sito", "id": "7567fe4d6f0561a90507bd198cae244886417428", "size": "5555"...
import io import os from unittest import TestCase def get_path(path): return os.path.join( os.path.dirname(os.path.abspath(__file__)), path, ) class SyamlDefaultReadTest(TestCase): def _call_fut(self, *args, **kwds): from .. import syaml create_reader = syaml.SyamlRea...
{ "content_hash": "bff2145d63119024d6f5eed5c8ba72bf", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 51, "avg_line_length": 29.081967213114755, "alnum_prop": 0.5535512965050733, "repo_name": "TakesxiSximada/syaml", "id": "25ebe45f25be7bb07deccb09acf790488985af13", "size": ...
class Counter(object): def __init__(self, init=0, notification_interval=1000): super(Counter, self).__init__() self.cnt = init self.init = init self.notification_interval = notification_interval if self.notification_interval: print("Start counting: %d/%d" % (self....
{ "content_hash": "ece2548c6eb666efffbb2413c185ac2b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 99, "avg_line_length": 36.26315789473684, "alnum_prop": 0.6008708272859217, "repo_name": "weijia/django-excel-to-model", "id": "314fb5dd317a6d1baf2f96829def8ee448abe2af", "...
import subprocess import glob import os import re import time import datetime import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import benchmark_configuration as config def deleteFiles(pattern): for fl in glob.glob(os.getcwd()+os.path.sep+pattern): if os.path.isfile(fl): o...
{ "content_hash": "eff1a3ece72163c40a0d841e1f104a25", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 196, "avg_line_length": 44.61194029850746, "alnum_prop": 0.6744730679156908, "repo_name": "rmp91/jitd", "id": "f5cc51a30b976da7e68dbc81e780201d85fc1c94", "size": "14960", ...
""" Setup the execution environment based on the command line argument """ import logging from os import environ as env import config class Environment(object): # these variables will be set only if not set already # priority: 0 default_variables = {} # these values will be added to existing ones ...
{ "content_hash": "6889b17bd799cacbcfffb5c2f02034fe", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 108, "avg_line_length": 29.341176470588234, "alnum_prop": 0.5926222935044105, "repo_name": "tudinfse/fex", "id": "7ddd9f8debb15c2cc1a7fd64962bb0b387eedbef", "size": "2494",...
from .validateHub import jsonschemaErrorReport, validateHgncSymbol, symbolStatus from .ontology_lookup import *
{ "content_hash": "34e025233bad0f0faa97354246727bd2", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 80, "avg_line_length": 55.5, "alnum_prop": 0.8648648648648649, "repo_name": "IHEC/ihec-ecosystems", "id": "f8db5061da0a174a8c6a18b09918e854fb89e4a9", "size": "111", "binar...
import unittest import logging try: import mock # Python 2 except ImportError: from unittest import mock # Python 3 from nose.tools import raises from ryu.services.protocols.bgp import bgpspeaker LOG = logging.getLogger(__name__) class Test_BGPSpeaker(unittest.TestCase): """ Test case for bgp.bg...
{ "content_hash": "b356f71094e3d8d8d36735a327264c3a", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 76, "avg_line_length": 33.60919540229885, "alnum_prop": 0.551641586867305, "repo_name": "ool2016-seclab/quarantineSystem", "id": "243ef4b340ffc914b727951b2056df8488a387c3", ...
""" simple thread exaple """ import threading def worker(num): """ Thread worker funtion """ print "Worker: %s" % num return for i in xrange(5): t = threading.Thread(target=worker, args=(i,)) t.start()
{ "content_hash": "8128e8b18caf9a2f3e40bba6212762a2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 50, "avg_line_length": 13.055555555555555, "alnum_prop": 0.5829787234042553, "repo_name": "bristy/HackYourself", "id": "28a0ec83c9af3b0ac9671330526cba636c415bbd", "size": "...
from typing import Any import django import mock from django.test import TestCase from django.utils import translation from django.conf import settings from django.http import HttpResponse from django.core import mail from http.cookies import SimpleCookie from zerver.lib.test_classes import ( ZulipTestCase, ) fro...
{ "content_hash": "91ec11a70c8621ec09c5f6129eeb0eec", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 155, "avg_line_length": 37.93103448275862, "alnum_prop": 0.5675757575757576, "repo_name": "dhcrzf/zulip", "id": "d4cc4843c2abfb336569e46428ca3c2bd90e45e3", "size": "6669",...
import operator import os import zlib from collections import MutableSequence, Iterable, Sequence, Sized from itertools import chain from numbers import Real, Integral from functools import reduce from warnings import warn from threading import Lock import numpy as np import bottleneck as bn from scipy import sparse ...
{ "content_hash": "ce34f793edf99d8cfe51475be4a08088", "timestamp": "", "source": "github", "line_count": 1644, "max_line_length": 105, "avg_line_length": 38.681265206812654, "alnum_prop": 0.5088690401308341, "repo_name": "cheral/orange3", "id": "eecbda0cb96a866cacd1c641135ce47e514524ad", "size": "63...
import factory import factory.django from .models import Post from django.utils.timezone import now from django.utils.text import slugify from faker.providers.lorem.la import Provider as LoremProvider class ExtendedLoremProvider(LoremProvider): @classmethod def title(cls, nb_words=6, variable_nb_words=True):...
{ "content_hash": "f3d8ad177b7564bf9e6ae00a737d3af0", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 62, "avg_line_length": 27.03125, "alnum_prop": 0.7294797687861272, "repo_name": "Prometeo/blog", "id": "ac6112b71c0145a89dcfd312cae9e74d7564cf4b", "size": "865", "binary"...
from base64 import b64encode from ipykernel.comm import Comm from IPython import get_ipython import StringIO import urllib _comm=None def is_notebook(): iPython=get_ipython() if iPython is None or not iPython.config: return False return 'IPKernelApp' in iPython.config def connect(): """ establish connection ...
{ "content_hash": "0f130ccaa077162830e576c4f2d645c0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 70, "avg_line_length": 23.163636363636364, "alnum_prop": 0.7213500784929356, "repo_name": "ericjang/tdb", "id": "012f400781b02f5a5879c4550001b176e35b1b71", "size": "1274", ...
import threading import logging import asyncore close_sockets_lock = threading.Lock() def _do_close_sockets(): for value in asyncore.socket_map.values(): logging.info("Close Socket: %s" % str(value)) value.socket.close() logging.info("Clean socket map!") asyncore.socket_map = {} def cl...
{ "content_hash": "a9f36a92a283636d719bd0b7119aad31", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 53, "avg_line_length": 21.40625, "alnum_prop": 0.6423357664233577, "repo_name": "blacktear23/py-servicebus", "id": "705b131a58bc14943b550df9a1af9e11f2b6dd19", "size": "685"...
from __future__ import division import os import sys import time import csv import shutil import threading import errno import tempfile import collections import re from distutils.version import LooseVersion try: import pandas as pd except ImportError: pd = None from wlauto import Instrument, Parameter, Iter...
{ "content_hash": "426c73b87fa796a0a549bdc4cf5f7f43", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 116, "avg_line_length": 51.14567901234568, "alnum_prop": 0.5829873515496765, "repo_name": "bjackman/workload-automation", "id": "ad630bdb87767c76cfed49525eb8c2dc90bee7c3", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import curses import io import json import os import re import sys import app.default_prefs import app.log import app.regex class Prefs: def __init__(self): self.prefsDirectory = "~/.ci_edit/pref...
{ "content_hash": "ba96656c3baf8498db46ccc6bc370296", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 87, "avg_line_length": 40.0210970464135, "alnum_prop": 0.5340010542962572, "repo_name": "google/ci_edit", "id": "39aac1f034f82771a57e068f74051b36cdf13c86", "size": "10061"...
import sys, os # 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.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "5e6c8c450d7b3b251cdd98fce9b5ef96", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 32.157205240174676, "alnum_prop": 0.7038294405214557, "repo_name": "vadosl/questionnaire", "id": "1bd24a4df4b690774f3e37f21eeab874e7b1ddf3", "size":...
from django.test import TestCase from django.contrib.auth.models import User from django.test.client import Client, RequestFactory from django.http import HttpResponse from .forms import QueryForm, QueryModelForm, Field from .operators import AND, OR, BaseOperator from .decorators import validate A = Field(required=F...
{ "content_hash": "e6eb72e8f94123d8237576a6623abf1a", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 84, "avg_line_length": 34.39890710382514, "alnum_prop": 0.51289383108287, "repo_name": "laginha/django-alo-forms", "id": "9504b13dc3c9ac5ff53f089138b59cdae85e214f", "size"...
from model.new_user_data import N_u_d import random def test_modify_contact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contact.Create() app.contact.Fill_in(N_u_d(namef="Rus", namem="Si", namel="An")) old_contacts = db.get_contact_list() contact = random.choice(old_contacts...
{ "content_hash": "e1a423b18dc55f7705cc05e4af7b9a42", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 127, "avg_line_length": 46.96, "alnum_prop": 0.6115843270868825, "repo_name": "SCLT1975/python_training", "id": "caff21b64af51290e588143ec7657baddf1be28c", "size": "1199", ...
import re import configparser import csv import os from os import path from config_util import config_read def fetch_content(arg_file): conf = config_read() contents_path = conf["contents"] files = os.listdir(contents_path) for file in files: if file == arg_file: title = file ...
{ "content_hash": "5bea20c62c8843d7aa1163f91c7197ab", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 73, "avg_line_length": 24.75, "alnum_prop": 0.5808080808080808, "repo_name": "shinshin86/APWP", "id": "2986bf01696ca43390722d7764a3c698807728f0", "size": "816", "binary":...
from m5.params import * from m5.objects import * from BaseTopology import SimpleTopology class Mesh(SimpleTopology): description='Mesh' def __init__(self, controllers): self.nodes = controllers # Makes a generic mesh assuming an equal number of cache and directory cntrls def makeTopology(se...
{ "content_hash": "3383d5a67b4d0e0364cc1fe809631b1c", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 81, "avg_line_length": 39.98876404494382, "alnum_prop": 0.5268333801629671, "repo_name": "wnoc-drexel/gem5-stable", "id": "e715af8557c6aca7dbe6dd0e05fd6ba758fd040c", "size"...
""" Model of discount, needed when client pays for purchase. """ from mgnemu.models.base_model import BaseModel from mgnemu.models.sales_types import DISCOUNT class Discount(BaseModel): def __init__(self, data): BaseModel.__init__(self, DISCOUNT) self.__sum = data['sum'] if 'prc' in lis...
{ "content_hash": "a5dc57968b63682c162b8b93038b4e14", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 56, "avg_line_length": 20.5, "alnum_prop": 0.5164992826398852, "repo_name": "0xporky/mgnemu-python", "id": "96b9309aa2fa1cb144b03976f08a6b76a8609457", "size": "722", "bin...
__author__ = 'wdwind' from os import walk from SingleFile.ClusterCenter import cluster_rank_rank def wrapper(data_path, cluster_path, index_path, output_path): """ A wrapper for the ClusterCenter.cluster_rank_rank. Clustering results post processing. Do double rank - rank by the number of poi...
{ "content_hash": "74537c3f3b6af8bee38ad6f4e0f54520", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 87, "avg_line_length": 37, "alnum_prop": 0.6096096096096096, "repo_name": "wdwind/ImageTrends", "id": "83ea335b94f11049a2fe88c605fcc50470ca175d", "size": "1707", "binary"...
import argparse import cv2 import mmcv from mmdet.apis import inference_detector, init_detector def parse_args(): parser = argparse.ArgumentParser(description='MMDetection video demo') parser.add_argument('video', help='Video file') parser.add_argument('config', help='Config file') parser.add_argume...
{ "content_hash": "e84b868c33b24a866c11c9ed33ade559", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 76, "avg_line_length": 32.1, "alnum_prop": 0.6334371754932503, "repo_name": "open-mmlab/mmdetection", "id": "4ee1fa675163a0fb8b407f1cff67fab23feb65bc", "size": "1974", "b...
import cStringIO import os import sys import traceback import py from rpython.flowspace.model import (FunctionGraph, Constant, Variable) from rpython.rlib import rstackovf from rpython.rlib.objectmodel import (ComputedIntSymbolic, CDefinedIntSymbolic, Symbolic) # intmask is used in an exec'd code block from rpyth...
{ "content_hash": "402abedb6e1545ec11da2a120c9a7e45", "timestamp": "", "source": "github", "line_count": 1349, "max_line_length": 149, "avg_line_length": 36.47442550037064, "alnum_prop": 0.5637956263718397, "repo_name": "jptomo/rpython-lang-scheme", "id": "5f4c12152ed318d8f524146b4f0ce35c6c9a8271", ...
from django.template import Template, Context from unittest import TestCase class TemplateTestCase(TestCase): library = None def render(self, content, **context_data): load_tpl = '' if self.library: load_tpl = '{% load ' + self.library + ' %}' tpl = Template(load_tpl + co...
{ "content_hash": "4099e668a12104d150199a39b2e7b3ff", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 56, "avg_line_length": 25.863636363636363, "alnum_prop": 0.6362038664323374, "repo_name": "redisca/django-redisca", "id": "1ee019254f31748a03d6a30c3cf8d9dc51e76de0", "size"...
"""A PyClassNode subclass that also exposes the instance as a Courier server.""" import datetime from typing import Any, Callable, Generic, Optional, Mapping, TypeVar from absl import logging import courier from launchpad import address as lp_address from launchpad import flags as lp_flags from launchpad.launch impor...
{ "content_hash": "d40f292b183624adfa8a4acb4e4cc667", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 80, "avg_line_length": 36.57241379310345, "alnum_prop": 0.6705638317933246, "repo_name": "deepmind/launchpad", "id": "99652c9bf5e5f44b9bb637d5bcf3b47863de6ddd", "size": "5...
"""Package contenant les contexes de PNJ.""" from . import controler
{ "content_hash": "ec9737d58cf941555a0e5b565c609088", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 44, "avg_line_length": 23.333333333333332, "alnum_prop": 0.7285714285714285, "repo_name": "stormi/tsunami", "id": "665c32b2a244d1a0a86675bc91fe8289ac8e1509", "size": "1635",...
class AuthNeeded(Exception): pass class InconsistenState(Exception): pass
{ "content_hash": "7b0b9f7e90087ed8380f4124787db281", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 34, "avg_line_length": 14, "alnum_prop": 0.7380952380952381, "repo_name": "peralmq/olloapi", "id": "7fa5f84d8237a4665954096f9b5b19448b839c92", "size": "84", "binary": fals...
''' Gets the given sys.argv[1] as a city_name Reads all the CSV file inside 'data/' folder as a DataFrame Calculates total population of each city Plots it to a Histogram Chart for each year under output/ folder @author: pekzeki ''' import commons import pygal import glob import os import sys if len(sys.argv)...
{ "content_hash": "3e1e155a7710eb232114e5fbe96aa5cf", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 93, "avg_line_length": 28.844444444444445, "alnum_prop": 0.5955315870570108, "repo_name": "pekzeki/PopulationAnalysis", "id": "ddf7321b9701c6a05692e8062848bacb542b90e1", "s...
""" Tests barbante.api.consolidate_user_templates. """ import json import nose.tools import barbante.api.consolidate_user_templates as script import barbante.utils.logging as barbante_logging import barbante.tests as tests log = barbante_logging.get_logger(__name__) def test_script(): """ Tests a call to scr...
{ "content_hash": "1f2a01b1092c345c7187fd340f2ae030", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 22.5, "alnum_prop": 0.7025641025641025, "repo_name": "hypermindr/barbante", "id": "056b0d9377f4ecc78633e89eb3421deb5ef20ae9", "size": "585", "binar...
__all___ = [ 'YubicoError', 'StatusCodeError', 'InvalidClientIdError', 'InvalidValidationResponse', 'SignatureVerificationError' ] class YubicoError(Exception): """ Base class for Yubico related exceptions. """ pass class StatusCodeError(YubicoError): def __init__(self, status_code):...
{ "content_hash": "f2e5db128c1dffd84192bf221907e8eb", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 77, "avg_line_length": 28.725490196078432, "alnum_prop": 0.6286689419795222, "repo_name": "Yubico/python-yubico-client-dpkg", "id": "891336c8ba0c4d4c6bda534f3bc9129b0303a224"...
from clamped import BarClamp x = BarClamp() x.call()
{ "content_hash": "7f9540e9dc342a33c6396d848492bb13", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 28, "avg_line_length": 13.5, "alnum_prop": 0.7222222222222222, "repo_name": "jimbaker/clamped", "id": "95af799846aa64c3db69197470ace3d73ad63cd2", "size": "54", "binary": f...
import os import tempfile from .vendor.six.moves import range def printable_decimal_and_hex(num): return "{0:d} (0x{0:x})".format(num) def assert_index_sane(index, upper_bound_exclusive): assert type(index) == int, "Indices should be integers; '%s' is not" % ( index) assert 0 <= index < upper_boun...
{ "content_hash": "3d9be25c23b97393d097776573e9b15e", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 27.844827586206897, "alnum_prop": 0.6247678018575852, "repo_name": "iLambda/lsdj-wave-cruncher", "id": "f8e74494dc3509e7b22e02f7cc572dd8c28a432c", "s...
from flask import redirect, render_template, render_template_string, Blueprint, g from flask import request, url_for from flask_user import current_user, login_required, roles_accepted from flask.ext.babel import Babel from app import app, db from app.core.models import UserProfileForm core_blueprint = Blueprint('core...
{ "content_hash": "bfa33d40cfcf63db6fb893cfe058447f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 81, "avg_line_length": 30.767123287671232, "alnum_prop": 0.6829919857524488, "repo_name": "dleicht/planx", "id": "09b37913f94319c80208582271bb53653c854482", "size": "2347",...
print("Fuel calculator - Simple cost per litre to cost per gallon\n") # Calculates the cost per gallon from the cost per litre try: costperlitre = input("Please input cost per litre (eg 0.99 is £0.99): £") costpergallon = float(costperlitre) * 4.54609 formattedcostpergallon = format((costpergallon),'.2f' ...
{ "content_hash": "a4483226facca4941be50f0ae750bf76", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 118, "avg_line_length": 34.475, "alnum_prop": 0.6961566352429297, "repo_name": "Cryptostrike/Fuelcalc", "id": "e10d2d7198c1a5a4b057edde824a01a87a932689", "size": "1386", ...