text
stringlengths
4
1.02M
meta
dict
""" Gage adjustment ^^^^^^^^^^^^^^^ Concept ------- The objective of this module is the adjustment of radar-based rainfall estimates by rain gage observations. However, this module could also be applied to adjust satellite rainfall by rain gage observations, remotely sensed soil moisture patterns by ground truthing mo...
{ "content_hash": "eaec60bdd6649f24ddbad166e83c9828", "timestamp": "", "source": "github", "line_count": 892, "max_line_length": 88, "avg_line_length": 39.539237668161434, "alnum_prop": 0.6403640590887182, "repo_name": "kmuehlbauer/wradlib", "id": "06f3311ef480e83d2efd61cca013184239148fe5", "size": ...
""" FCKeditor - The text editor for internet Copyright (C) 2003-2006 Frederico Caldeira Knabben Licensed under the terms of the GNU Lesser General Public License: http://www.opensource.org/licenses/lgpl-license.php For further information visit: http://www.fckeditor.net/ "Support Open Source software...
{ "content_hash": "0fa971b6e1f0c84d1bcc2b604b3801cf", "timestamp": "", "source": "github", "line_count": 780, "max_line_length": 173, "avg_line_length": 28.82948717948718, "alnum_prop": 0.6552674878818873, "repo_name": "sknlim/classified-2", "id": "67a107c59ad26de8605f4cce7663f0b506193e58", "size": ...
from django import template from django.core.cache import cache from django.http import HttpRequest from django.test import TestCase from django.urls.exceptions import NoReverseMatch from django.utils.safestring import SafeText from wagtail.core.models import Page, Site from wagtail.core.templatetags.wagtailcore_tags ...
{ "content_hash": "084346e9e557cfcc8f08036586f593f3", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 140, "avg_line_length": 40.234042553191486, "alnum_prop": 0.6502732240437158, "repo_name": "nealtodd/wagtail", "id": "20001ca12c1185ed4496994aed449b0a27198986", "size": "1...
from django.conf.urls.defaults import * from django.conf import settings from django.contrib.auth.decorators import login_required from bootstrapit.views import * urlpatterns=patterns('', url(r'^$', DesignView.as_view(), name='bootstrapit-index'), url(r'^(?P<theme>[\d\w-]+)$', DesignEditView.as_view(), n...
{ "content_hash": "e48cf35e22b1a999f7a8739ee20bc073", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 100, "avg_line_length": 41.65384615384615, "alnum_prop": 0.6278855032317636, "repo_name": "h3/bootstrapit", "id": "faefa2cd0bdfcbcba958d5cc30737e38ce3cd541", "size": "1083"...
import re import sys import time import tarfile from six import BytesIO from bs4 import BeautifulSoup from dlkit.abstract_osid.repository import record_templates as abc_repository_records from dlkit.abstract_osid.osid.errors import IllegalState, NotFound from dlkit.primordium.id.primitives import Id from dlkit.primo...
{ "content_hash": "d625fd9389eb6c1d1c6c5ced92ef18cc", "timestamp": "", "source": "github", "line_count": 425, "max_line_length": 109, "avg_line_length": 40.76705882352941, "alnum_prop": 0.5717996075262611, "repo_name": "mitsei/dlkit", "id": "0335ebc4dc7cc7d55a2b1813cbfc0a315c57049a", "size": "17326"...
import random from enum import Enum from bomb_defusal.modules.module import NeedyModule class KnobOrientation(Enum): Right = 0 Up = 1 Left = 2 Down = 3 class LedSet(Enum): UpOne = '001011111101' UpTwo = '101010011011' DownOne = '011001111101' DownTwo = '101010010001' LeftOne = '...
{ "content_hash": "1558073e0e3f875fc896b925a6dff7d5", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 109, "avg_line_length": 25.822580645161292, "alnum_prop": 0.6389756402248594, "repo_name": "leupibr/BombDefusal", "id": "9a7804b2f43c789aadfe6563bf55e62030d60975", "size": ...
""" This file was generated with the customdashboard management command and contains the class for the main dashboard. To activate your index dashboard add the following to your settings.py:: GRAPPELLI_INDEX_DASHBOARD = 'protocolle.dashboard.CustomIndexDashboard' """ from django.utils.translation import ugettext_l...
{ "content_hash": "4407a74339c78045197d52321fed9431", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 76, "avg_line_length": 32.98198198198198, "alnum_prop": 0.4766457252116908, "repo_name": "klebercode/protocolle", "id": "20b8848582512749014094c4c2414f9709026557", "size":...
"""Tests for the process resources CLI arguments helper.""" from __future__ import unicode_literals import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import process_resources from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class ProcessResourcesArgument...
{ "content_hash": "b99087121412fc179a53edcceecb6c98", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 77, "avg_line_length": 34, "alnum_prop": 0.693392425463336, "repo_name": "rgayon/plaso", "id": "1ecaaed84db58334a1c811fd6a6191acf85601cf", "size": "2529", "binary": false...
from south.utils import datetime_utils as 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 'PurchaseOrder.deal' db.add_column(u'app_purchaseorder', 'deal', ...
{ "content_hash": "e4b85e9e8802a790fefefe6f5c4d1433", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 195, "avg_line_length": 82.94090909090909, "alnum_prop": 0.5410204417164466, "repo_name": "vforgione/dodger", "id": "bc34f08711218c22b4d6b2451eef378d7df9e9ad", "size": "18...
""" Read a MAF from standard input and print the fraction of gap columns in each block. usage: %prog < maf > out """ from __future__ import division import sys import bx.align.maf def main(): for m in bx.align.maf.Reader( sys.stdin ): gaps = 0 for col in m.column_iter(): ...
{ "content_hash": "513cc34cc97d5a0497c61f4664d305f4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 20.523809523809526, "alnum_prop": 0.5475638051044084, "repo_name": "bxlab/HiFive_Paper", "id": "2a01cb00fc7dcd11e44d801ade78d91ce4ce13aa", "size": "4...
""" Host a WSGI app in mitmproxy. This example shows how to graft a WSGI app onto mitmproxy. In this instance, we're using the Flask framework (http://flask.pocoo.org/) to expose a single simplest-possible page. """ from flask import Flask from mitmproxy.addons import asgiapp app = Flask("proxapp") @app.route("/") ...
{ "content_hash": "ea4ae50523447db77134001dee451959", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 118, "avg_line_length": 34.607142857142854, "alnum_prop": 0.718266253869969, "repo_name": "mhils/mitmproxy", "id": "4f117f05abe1a129ca8cb74e39093ea677c6fad4", "size": "969"...
""" Support for exposing Concord232 elements as sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.concord232/ """ import datetime import logging import requests import voluptuous as vol from homeassistant.components.binary_sensor im...
{ "content_hash": "a3fe38e7f24fb941736dbe4c49d2c743", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 77, "avg_line_length": 32.06382978723404, "alnum_prop": 0.6357000663570007, "repo_name": "ewandor/home-assistant", "id": "73cf77f2b936017de89b36162239f70632ea14aa", "size"...
"""Test MNRead.getChecksum()""" import io import pytest import responses import d1_common.checksum import d1_common.types import d1_common.types.exceptions import d1_gmn.tests.gmn_mock import d1_gmn.tests.gmn_test_case class TestGetChecksum(d1_gmn.tests.gmn_test_case.GMNTestCase): @responses.activate def ...
{ "content_hash": "602abd07e00e8b7ce0812da30635025a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 91, "avg_line_length": 39.47826086956522, "alnum_prop": 0.6372980910425844, "repo_name": "DataONEorg/d1_python", "id": "c79078b26aef977c30b0ed0d7ecfcae54acfac80", "size": "...
"""SCons.Tool.dmd Tool-specific initialization for the Digital Mars D compiler. (http://digitalmars.com/d) Coded by Andy Friesen (andy@ikagames.com) 15 November 2003 Amended by Russel Winder (russel@russel.org.uk) 2010-02-07 There are a number of problems with this script at this point in time. The one that irritat...
{ "content_hash": "fab687b0b1e06d715dc1ad00716e35a4", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 120, "avg_line_length": 39.68333333333333, "alnum_prop": 0.5758084838303233, "repo_name": "sftd/scons", "id": "67355b1ad52a14d64ba2bd9723e4957d842a2b30", "size": "9524", ...
"""Generates script-specific samples (collections of chars) using cldr exemplar data for languages written in a script.""" import argparse import codecs import collections import locale import os from os import path import re import shutil import xml.etree.cElementTree as ElementTree from nototools import cldr_data f...
{ "content_hash": "9d4b5f2c1af5140f46a4ca30a21ad173", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 94, "avg_line_length": 34.68129770992366, "alnum_prop": 0.6420513949265394, "repo_name": "pathumego/nototools", "id": "53a9fbccd77fd17a7d8df1b5272d6c696b5d8789", "size": "...
from django.shortcuts import render, get_object_or_404, redirect from django.http import Http404, HttpResponse from django.contrib import messages from django.core import serializers # from django.utils import simplejson from workflows.urls import * from workflows.helpers import * import workflows.interaction_views imp...
{ "content_hash": "9bfc592a1e7532d465fc47b1b4538f92", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 28.1, "alnum_prop": 0.7855871886120996, "repo_name": "xflows/textflows", "id": "9e5b7bdb28bae52ac203d354010799a8e8234908", "size": "1151", "binary"...
import discord from discord.ext import commands class Info: """Info is a class within Pixie that is only for accessing data from discords built in things (Although we add Pixie's status command here)""" def __init__(self, bot): self.bot = bot @commands.command(name="userinfo", pass_context=True...
{ "content_hash": "25506129cb4589224f81965a84b3267e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 156, "avg_line_length": 46, "alnum_prop": 0.5047554347826086, "repo_name": "GetRektByMe/Pixie", "id": "805a00b6ce491bb9b2338ba701e383afa1bb2084", "size": "2944", "binary"...
from django.apps import apps from django.core import exceptions from django.utils.translation import gettext_lazy as _ from hashids import Hashids from rest_framework import fields from hashid_field.conf import settings from hashid_field.hashid import Hashid from hashid_field.lookups import _is_int_representation c...
{ "content_hash": "0dce4d3f68b0981ead934fdd64c448b1", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 119, "avg_line_length": 46.42045454545455, "alnum_prop": 0.653610771113831, "repo_name": "nshafer/django-hashid-field", "id": "1c7a5778ff2087024a18109177abe257df71ffab", "s...
from som.primitives.integer_primitives import IntegerPrimitivesBase as _Base IntegerPrimitives = _Base
{ "content_hash": "aa99db5f9b2fa721eb0d995fb49b6cc8", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 76, "avg_line_length": 26.25, "alnum_prop": 0.8380952380952381, "repo_name": "SOM-st/PySOM", "id": "4f285a309e0d458c5a21f888bdfe83521245d91d", "size": "105", "binary": fal...
import gc import pprint import sys import traceback import eventlet import eventlet.backdoor import greenlet from nova.openstack.common import cfg eventlet_backdoor_opts = [ cfg.IntOpt('backdoor_port', default=None, help='port for eventlet backdoor to listen') ] CONF = cfg.CONF CON...
{ "content_hash": "987bf4928bf76ddb414189736861268d", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 74, "avg_line_length": 27.080645161290324, "alnum_prop": 0.6515783204288267, "repo_name": "maoy/zknova", "id": "118385427c65db9509a69f01674091ee34622f10", "size": "2429", ...
"""Tests for pooling layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python import keras from tensorflow.python.eager import context from tensorflow.python.framework import test_util as tf_test_util from tensor...
{ "content_hash": "61e4ed55354e74f0029c14b19c0a84cc", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 75, "avg_line_length": 34.70048309178744, "alnum_prop": 0.5900041765279131, "repo_name": "DavidNorman/tensorflow", "id": "b3bf875737158bc5785d062c709780a07e2a6204", "size"...
import unittest from unittest import mock from google.api_core.gapic_v1.method import DEFAULT from google.cloud.tasks_v2.types import Queue, Task from airflow.providers.google.cloud.operators.tasks import ( CloudTasksQueueCreateOperator, CloudTasksQueueDeleteOperator, CloudTasksQueueGetOperator, Cloud...
{ "content_hash": "6395cf805571b53f0a941c7b7969acc7", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 105, "avg_line_length": 35.31937172774869, "alnum_prop": 0.6077675659650164, "repo_name": "danielvdende/incubator-airflow", "id": "b13be1ca8dfd6d3e0be1641df6883c695729da20",...
from future import standard_library standard_library.install_aliases() from builtins import str from builtins import range from future.utils import iteritems import codecs import csv import json import re import urllib.request, urllib.parse, urllib.error from PDFUtilityFunctions import * PACKAGE_MAP = { 'AR (...
{ "content_hash": "f4ba2f740758a0247adeced2965f72fc", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 128, "avg_line_length": 44.15111111111111, "alnum_prop": 0.5658848399436279, "repo_name": "OSEHRA/VistA", "id": "4e448343e9e30e0e6ea8f2f0675ebe64cbbbb21b", "size": "20633"...
"""Boolean algebra module for SymPy""" from sympy.core.basic import Basic from sympy.core.operations import LatticeOp from sympy.core.function import Application, sympify class Boolean(Basic): """A boolean object is an object for which logic operations make sense.""" __slots__ = [] def __and__(self, othe...
{ "content_hash": "9e277ffe0b24851750336769597b8d79", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 115, "avg_line_length": 27.743772241992882, "alnum_prop": 0.5815802975885069, "repo_name": "mattpap/sympy-polys", "id": "6cfcb115709de7a24b2185feefe0e7d43576cf5a", "size":...
from django.contrib import admin from django.db.models import get_model class ProductRecordAdmin(admin.ModelAdmin): list_display = ('product', 'num_views', 'num_basket_additions', 'num_purchases') class UserProductViewAdmin(admin.ModelAdmin): list_display = ('user', 'product', 'date_created') class UserR...
{ "content_hash": "f9c3eb833c185dca08d89b5b7a69ef78", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 120, "avg_line_length": 48.1875, "alnum_prop": 0.7509727626459144, "repo_name": "aykut/django-oscar", "id": "79b54b40000b052f691e8e06267b4e7a18a90759", "size": "771", "bi...
""" Unit testing of FontConverter class """ import logging import os import shutil import time import unittest from font_converter import FontConverter class TestFontConverter(unittest.TestCase): def setUp(self): super(TestFontConverter, self).setUp() # disable log during tests logging....
{ "content_hash": "2724d0c4d28b3514f4e52171f0140b57", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 105, "avg_line_length": 39.33673469387755, "alnum_prop": 0.6249027237354086, "repo_name": "kalhamaar/xwing-font-converter", "id": "bd06fe596274a99ded2a324920cd10d951a0a7f6", ...
import sys import os import shlex # 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('.')) sys.pa...
{ "content_hash": "2f0e1afe723861aca57c78668d94d808", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 79, "avg_line_length": 32.234657039711195, "alnum_prop": 0.7037742188374958, "repo_name": "nerandell/seamus", "id": "56beb17eb78f1e921be7b8e9f20cb1c35d58a0ab", "size": "93...
from __future__ import absolute_import import gc import os import sys import time import errno import fcntl import signal import socket import logging import marshal import threading import subprocess import multiprocessing import six from six.moves import socketserver, cPickle, SimpleHTTPServer, urllib import resource...
{ "content_hash": "69d2205e3ff564e8d56c3f3f6f4e0ec2", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 120, "avg_line_length": 32.45910780669145, "alnum_prop": 0.5302639867147684, "repo_name": "douban/dpark", "id": "28bbd2316a725990ad75ed1ffe0c5c5b6ed86a04", "size": "17463"...
"""Auto-generated file, do not edit by hand. FJ metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_FJ = PhoneMetadata(id='FJ', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[0-579]\\d(?:\\d(?:\\d{2})?)?', possibl...
{ "content_hash": "2743427a265e7c8bb758f72ced7d1c1d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 175, "avg_line_length": 87.3, "alnum_prop": 0.7056128293241696, "repo_name": "daviddrysdale/python-phonenumbers", "id": "89655ddc890d76c09c263012bb4cdd602b4bfc9f", "size": ...
from . import census class Stats(census.Stats): namespace = "dcuo" def __str__(self): return "EVERQUST 2 STATS API"
{ "content_hash": "8159b71067046215c59d7f3726719cb5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 31, "avg_line_length": 18.428571428571427, "alnum_prop": 0.6434108527131783, "repo_name": "abathur/dbg_census", "id": "668ee95a7721f6eeb3b4d5d7d288918119a2e26c", "size": "12...
"""Tests for tensorflow.python.training.saver.py.""" import glob import math import os import random import time import numpy as np import six from google.protobuf.any_pb2 import Any from tensorflow.core.framework import summary_pb2 from tensorflow.core.protobuf import config_pb2 from tensorflow.core.protobuf impor...
{ "content_hash": "43c5a35855e7767ea018695698ad45ca", "timestamp": "", "source": "github", "line_count": 3200, "max_line_length": 80, "avg_line_length": 42.5784375, "alnum_prop": 0.6442594916734556, "repo_name": "Intel-Corporation/tensorflow", "id": "423fbb07f4609e8fa2d2db1571a9c19c5023eb7b", "size"...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource) from neuralnilm.source import (standardise, discretize, fdiff, power_and_fdiff, ...
{ "content_hash": "8f2df40d35b33dfbc09a90a377a1f5d1", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 133, "avg_line_length": 31.697318007662837, "alnum_prop": 0.6061888069624078, "repo_name": "mmottahedi/neuralnilm_prototype", "id": "54c1598483dcb361e1aaa27add727d63c181a1f5...
from django.http import HttpResponseRedirect from django.views.generic import ListView from ...views import BackendModelViewMixin class ActionFormMixin(BackendModelViewMixin): def pre_dispatch(self, request, *args, **kwargs): self.action_form = self.get_action_form() return super(ActionFormMixin, ...
{ "content_hash": "0e916510ac0a35122f8cba2f14ad2c8f", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 81, "avg_line_length": 36.78504672897196, "alnum_prop": 0.6133130081300813, "repo_name": "team23/django_backend", "id": "0a3c4e0bbff551f869e80a7440004fb6b7bf2fdf", "size":...
""" BRMFlask instance instantiation. Load and configure brmflask flask application. """ from os import environ from importlib import import_module from flask import Flask from brmflask.utils.routing import base_path from brmflask.utils.dotenv import dotenv def create_app( app_name=__name__, config_override=N...
{ "content_hash": "8d7d08b44d2e5a615dbfa134b1bb8be6", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 77, "avg_line_length": 27.173333333333332, "alnum_prop": 0.6570166830225711, "repo_name": "BRMWebDev/BRMFlask", "id": "bb1671808af8a698e98ee86da2ec384b3ee7ee45", "size": "...
from rest_framework import routers from .api import ( AttemptLogViewSet, ContentSessionLogViewSet, ContentSummaryLogViewSet, ExamAttemptLogViewSet, ExamLogViewSet, MasteryLogViewSet, TotalContentProgressViewSet, UserSessionLogViewSet ) from .csv import ContentSessionLogCSVExportViewSet, ContentSummaryLogCSVExp...
{ "content_hash": "72dfd892297c073ee2f7cd50e86b976d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 132, "avg_line_length": 55.47826086956522, "alnum_prop": 0.8432601880877743, "repo_name": "rtibbles/kolibri", "id": "a9b409c03d1e0043ec7c7ffc88420371ca505f23", "size": "127...
from __future__ import absolute_import, unicode_literals from bs4 import BeautifulSoup from django.test import TestCase from wagtail.wagtaildocs.rich_text import DocumentLinkHandler class TestDocumentRichTextLinkHandler(TestCase): fixtures = ['test.json'] def test_get_db_attributes(self): soup = B...
{ "content_hash": "08b106f62395834ae4799b0c5afd8f64", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 97, "avg_line_length": 31.829268292682926, "alnum_prop": 0.5954022988505747, "repo_name": "iansprice/wagtail", "id": "520dc8ba0fffa120d21fb68a962d7990eef01153", "size": "13...
from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class test_add_fgroup(unittest.TestCase): def ...
{ "content_hash": "f9a3d934e25baedf2652e33dae93f112", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 73, "avg_line_length": 39.28, "alnum_prop": 0.6206720977596741, "repo_name": "Manolaru/Python_train", "id": "e04744643e2214e4991999905716675f0b7de3dd", "size": "1988", "b...
import time import logging import sys import threading import argparse from ConfigParser import SafeConfigParser from morfeu.tsuru.app import TsuruApp from morfeu.tsuru.client import TsuruClient from morfeu.settings import TSURU_APP_PROXY, SLEEP_TIME, DOMAIN, SKIP_APPS logging.basicConfig(format='%(asctime)s %(level...
{ "content_hash": "a81b1440acbd5d5df505abe91a6c00cd", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 110, "avg_line_length": 29.6375, "alnum_prop": 0.5854070012652889, "repo_name": "tsuru/morfeu", "id": "826966d8f34285242e93a81a98df9ecee8626170", "size": "2371", "binary"...
""" Storage service catalog utility functions and classes for NetApp systems. """ import copy import threading from oslo_log import log as logging from oslo_utils import timeutils import six from cinder import exception from cinder.i18n import _, _LI, _LW from cinder import utils from cinder.volume.drivers.netapp.da...
{ "content_hash": "01ca93369d4446c015248e89be3af49f", "timestamp": "", "source": "github", "line_count": 621, "max_line_length": 79, "avg_line_length": 40.388083735909824, "alnum_prop": 0.5182010286671186, "repo_name": "JioCloud/cinder", "id": "8c2c781338133b083f147a1a59746e1533485873", "size": "259...
import os import sys sys.path.insert(0, os.path.abspath('..')) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', 'sphinx_autodoc_typehints', ] source_suffix = '.rst' master_doc = 'ind...
{ "content_hash": "72c69a6d9bbe4fa3ec13842a16427b6d", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 74, "avg_line_length": 19.576923076923077, "alnum_prop": 0.6296660117878192, "repo_name": "macrat/PyGenSound", "id": "7e80b3ea25b42385c9971dc10fd040bad31487c3", "size": "10...
"""Python md to HTML converter with YAML Usage: pyconverter.py FILE [--pandoc_args | -h] Arguments: file the file to convert Options: -h, --help Show this screen. --pandoc_args option list of arguments for pandoc """ from docopt import docopt """ pyconverter.py uses Pandoc inte...
{ "content_hash": "94e8039573f275ed9b922b40c9129b94", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 27.661016949152543, "alnum_prop": 0.5735294117647058, "repo_name": "xysmas/pandoc_yaml_keeper", "id": "473e078fe9e417ed68333fa0ca3c6ae03c0efc0e", "si...
"""Helper module to factorize the conditional multiprocessing import logic We use a distinct module to simplify import statements and avoid introducing circular dependencies (for instance for the assert_spawning name). """ import os import sys import warnings # Obtain possible configuration from the environment, ass...
{ "content_hash": "1e62eeacb38590174afc204e9d464ae7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 76, "avg_line_length": 32.795918367346935, "alnum_prop": 0.6664592408214064, "repo_name": "vortex-ape/scikit-learn", "id": "be642b869febe1c94b2ba8a26c25ba537a017c90", "size...
import asyncio from octobot import Bot from octobot.plugins import PluginManager if __name__ == '__main__': loop = asyncio.get_event_loop() loop.set_debug(True) bot = Bot.new(loop, 'localhost', 6667) loop.run_forever() #plugin_manager = PluginManager(['plugins']) #plugin_manager.find_plugins()...
{ "content_hash": "343cbebfcb7582d7a179c39008476c5a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 26.75, "alnum_prop": 0.6728971962616822, "repo_name": "Thezomg/OctoBot", "id": "25ed55a9793d5133b8dc324679566b0002dfc0be", "size": "321", "binary":...
import os import sys #find out the file location within the sources tree this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) ) #find out gccxml location gccxml_09_path = os.path.join( this_module_dir_path, '..', '..', '..', 'gccxml_bin', 'v09', sys.platform, 'bin' ) #add ...
{ "content_hash": "36a2ebf78a66c31d292781614dbe9be7", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 113, "avg_line_length": 37.31666666666667, "alnum_prop": 0.6976328718177758, "repo_name": "avaitla/Haskell-to-C---Bridge", "id": "b0306a2e9e139d51591e82706648576f30c8f542", ...
import time import functools class TimeCost(object): def __init__(self, unit='s', precision=4, logger=None): self.start = None self.end = None self.total = 0 self.unit = unit self.precision = precision self.__unitfactor = {'s': 1, 'ms': 1000, ...
{ "content_hash": "13b513739ee642b7a063d805b21be482", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 30.46511627906977, "alnum_prop": 0.5290076335877862, "repo_name": "rfyiamcool/TimeCost", "id": "e814bd1b8421bf0773a2b834ac7a70a72d5ad159", "size": "1...
from os.path import dirname as _dirname, basename as _basename, isfile as _isfile import glob as _glob exec('\n'.join(map(lambda name: "from ." + name + " import *", [_basename(f)[:-3] for f in _glob.glob(_dirname(__file__) + "/*.py") \ if _isfile(f) and not _basename(f).startsw...
{ "content_hash": "c0cb1ee5fad6e8882b7d17c576b7fc21", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 89, "avg_line_length": 55.5, "alnum_prop": 0.5615615615615616, "repo_name": "TimeSynth/TimeSynth", "id": "2e5d4599b4e546cdac354aa4d073b9fb307f3e15", "size": "333", "binary...
import IECore import Gaffer import GafferUI from Qt import QtGui from Qt import QtWidgets from Qt import QtCore class Button( GafferUI.Widget ) : __palette = None def __init__( self, text="", image=None, hasFrame=True, highlightOnOver=True, **kw ) : GafferUI.Widget.__init__( self, QtWidgets.QPushButton(), **k...
{ "content_hash": "e865398ded00635412a25229fd54c8a2", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 105, "avg_line_length": 32.12582781456954, "alnum_prop": 0.7161410018552876, "repo_name": "GafferHQ/gaffer", "id": "1b59a13f0bd89e4954de7bc86992dfe689397ae5", "size": "671...
import pygame from spritesheet import SpriteSheet from enemy import Enemy from directions import Directions from utils import * class Spider(Enemy): def __init__(self, width, height, x, y): Enemy.__init__(self, width, 20, x, y) self.dir = 'D' self.speed = 1 # initialize sprite lists ss = SpriteSheet(pat...
{ "content_hash": "d11819c7edc136102b5ddbdddb4dd01f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 99, "avg_line_length": 26.123456790123456, "alnum_prop": 0.6483931947069943, "repo_name": "450W16/MODACT", "id": "fbae5471068bd67f5bb416d2b6e11b122dbbb7af", "size": "2116",...
from __future__ import annotations import socket from functools import lru_cache from airflow.configuration import conf # patched version of socket.getfqdn() - see https://github.com/python/cpython/issues/49254 @lru_cache(maxsize=None) def getfqdn(name=""): """Get fully qualified domain name from name. An e...
{ "content_hash": "693725b50fb6fe9c13ce22cbda74690b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 94, "avg_line_length": 27.475, "alnum_prop": 0.6460418562329391, "repo_name": "apache/airflow", "id": "57bd9008b95d88710261c3ede0016ce16779fee2", "size": "1886", "binary"...
import sys import unittest import tempfile, os, shutil from gppylib.commands.base import CommandResult, Command, ExecutionError from gppylib.operations.backup_utils import * from gppylib.operations.restore import * from gppylib.operations.restore import _build_gpdbrestore_cmd_line from gppylib.mainUtils import Exceptio...
{ "content_hash": "f72bef3c3b2bcfb463f31046b4d6f6d5", "timestamp": "", "source": "github", "line_count": 1138, "max_line_length": 255, "avg_line_length": 59.61775043936731, "alnum_prop": 0.6807281302970005, "repo_name": "yuanzhao/gpdb", "id": "2844f0f44e6e700b4a92c0c44477f61d4d4ecfa3", "size": "6794...
from django.core.mail import send_mail import string import random from django.conf import settings def createEmailBody(request,aff): tmp = """Dear """+request.user.get_full_name()+""" Your confirmation code to confirm your affiliation at """ +aff.org+""" is: """+aff.token+""" Use this code to confirm your a...
{ "content_hash": "c02da2e3c3f6c3824ecfb08b1edc55d8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 89, "avg_line_length": 27.151515151515152, "alnum_prop": 0.7310267857142857, "repo_name": "salimm/django-affiliations", "id": "d49519e806e6d84b8090506a76906a8c79f1388f", "s...
import types import weakref from .lock import allocate_lock from .error import CDefError, VerificationError, VerificationMissing # type qualifiers Q_CONST = 0x01 Q_RESTRICT = 0x02 Q_VOLATILE = 0x04 def qualify(quals, replace_with): if quals & Q_CONST: replace_with = ' const ' + replace_with.lstrip() ...
{ "content_hash": "663a13e58883c281fdbb695bc29bd401", "timestamp": "", "source": "github", "line_count": 614, "max_line_length": 79, "avg_line_length": 35.31270358306189, "alnum_prop": 0.5422470251821788, "repo_name": "LukeMurphey/splunk-google-drive", "id": "5f1b0d2b7641385bb8389cf2780ce155bf2bd502",...
from django.apps import AppConfig class MRRBenchmarkConfig(AppConfig): name = 'apps.evaluators.MRR.benchmark' label = 'MRRBenchmark'
{ "content_hash": "e64b664881a4d9f2337645bb28ebbd5c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 23.833333333333332, "alnum_prop": 0.7552447552447552, "repo_name": "DiegoCorrea/ouvidoMusical", "id": "a46ef2314b27e6a3b4d6a66d21dce2230e92d5db", "siz...
import os import re import tempfile try: import subprocess32 as subprocess except Exception: import subprocess from pandaharvester.harvestercore import core_utils from .base_stager import BaseStager from pandaharvester.harvestermover import mover_utils # logger baseLogger = core_utils.setup_logger('gridftp_st...
{ "content_hash": "e821479fbd5c1a101ea886141860a819", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 105, "avg_line_length": 38.17948717948718, "alnum_prop": 0.5854040743228117, "repo_name": "PanDAWMS/panda-harvester", "id": "48f1158fac308c23d01f9dfd6033894c7f935f3c", "si...
"""This example deletes a campaign by setting the status to 'REMOVED'. To get campaigns, run get_campaigns.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication...
{ "content_hash": "945e21e950a727c7a4c2dba068c12e96", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 26.904761904761905, "alnum_prop": 0.6920353982300885, "repo_name": "googleads/googleads-python-lib", "id": "778f9dc6d148f53052743e39824a104ab9c37fa2", ...
from __future__ import absolute_import, division, print_function, unicode_literals from binascii import unhexlify import time from django.conf import settings from django.db import models from django.utils.encoding import force_text from django_otp.models import Device from django_otp.oath import TOTP from django_ot...
{ "content_hash": "2f089b17f967cbc244df331108e71996", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 148, "avg_line_length": 35.6140350877193, "alnum_prop": 0.638423645320197, "repo_name": "altanawealth/django-otp", "id": "7b2baeea2d40f99613b53e44daa8b9c6b9c0e168", "size"...
import unittest import uuid from airflow.providers.amazon.aws.hooks.aws_dynamodb_hook import AwsDynamoDBHook try: from moto import mock_dynamodb2 except ImportError: mock_dynamodb2 = None class TestDynamoDBHook(unittest.TestCase): @unittest.skipIf(mock_dynamodb2 is None, 'mock_dynamodb2 package not pre...
{ "content_hash": "5d16f4658fb0f3dc007556fa3cb817ae", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 101, "avg_line_length": 29.868852459016395, "alnum_prop": 0.5592755214050494, "repo_name": "wileeam/airflow", "id": "f72efe4f9f448f396364ed1b99e237c63630816c", "size": "261...
""" Tests for `api.defined_names`. """ import textwrap from jedi import api from ..helpers import TestCase class TestDefinedNames(TestCase): def assert_definition_names(self, definitions, names): assert [d.name for d in definitions] == names def check_defined_names(self, source, names): def...
{ "content_hash": "a53a6db5938caf1efe174d88f6787300", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 29.853658536585368, "alnum_prop": 0.551062091503268, "repo_name": "jonashaag/jedi", "id": "3eb413566a723819a71b4824193c9b9625f70b7e", "size": "2448",...
from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import patch_logger from . import middleware as mw @override_settings(ROOT_URLCONF='middleware_exceptions.urls') class MiddlewareTests...
{ "content_hash": "31ded3e33b6a8b45b80e766b8ae66d54", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 106, "avg_line_length": 41.097744360902254, "alnum_prop": 0.7136845956824003, "repo_name": "loic/django", "id": "f6a7e24e591ccf7661cdff8ce0117ae79996e57e", "size": "5466",...
""" byceps.blueprints.user.profile.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from operator import attrgetter from flask import abort, g from ....services.orga_team import service as orga_team_service from ....services.t...
{ "content_hash": "04f59e8a5fa5d38ba42ffd8a21174b24", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 31.75, "alnum_prop": 0.6941247728649304, "repo_name": "m-ober/byceps", "id": "7dfe65544f9b8f7980452703a7cc0d5e1fa20ce1", "size": "1651", "binary": ...
import os from absl import app, flags from selenium import webdriver import test_util FLAGS = flags.FLAGS flags.DEFINE_string('user_data_dir', None, 'Need specify user data dir to test') flags.mark_flag_as_required('user_data_dir') def main(argv): policy_url = "chrome://policy" version_url = "chrome://version"...
{ "content_hash": "16713712d57c1c4e792a3829f25146ec", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 28.857142857142858, "alnum_prop": 0.7072135785007072, "repo_name": "endlessm/chromium-browser", "id": "6a89f7cfd603fa75011d65191627c635a812b010", "si...
from util import sieve primes = set(sieve(1000000)) def rotations(i): result = [] s = str(i) for j in xrange(len(s)): result.append(int(s[j:] + s[:j])) return result def circular(prime): r = set(rotations(prime)) return len(r) == len(r & primes) def solve(): retur...
{ "content_hash": "93ad7947845d1a64f412c848b613984a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 51, "avg_line_length": 20.65, "alnum_prop": 0.559322033898305, "repo_name": "elemel/project-euler", "id": "7c3c37c1c3c2a6cf97b3917c5a0d675f1aca6c87", "size": "413", "bina...
from __future__ import unicode_literals import time import json from django.db import models from django.utils.dateformat import format class ActionType(models.Model): """This define type of action for action log record.""" name = models.CharField( max_length=100, blank=False, null=False, unique=Tru...
{ "content_hash": "3fcec8d14bdba99afe98f5d19fe387bd", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 72, "avg_line_length": 33.00909090909091, "alnum_prop": 0.6232442853208483, "repo_name": "bradojevic/django-action-log", "id": "3aa6bb4d60feb723341aea3f26e56846faaf2875", ...
""" Tests for importing .sdf files """ from __future__ import division from __future__ import unicode_literals __author__ = "Joseph Gomes" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import os import unittest import tempfile import shutil import deepchem as dc class TestFeaturizedSampl...
{ "content_hash": "0f8157d561b3214e4967f441068514b8", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 28.32, "alnum_prop": 0.6779661016949152, "repo_name": "Agent007/deepchem", "id": "337d8d790fd7bbfa194f1b9f2b969308f74256a2", "size": "1416", "binar...
""" Prepare images to go out to the LabelMe site. """ import os import urlparse import zipfile import numpy as np from scipy.misc import imread, imsave import pyfacades import pyfacades.models.driving_12x360x480.model import pyfacades.models.driving_12x360x480.segment from pyfacades.rectify import rectify from pyfac...
{ "content_hash": "22c3b5c3f83461a5da506427ce1a9d82", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 107, "avg_line_length": 30.711111111111112, "alnum_prop": 0.5815846599131693, "repo_name": "jfemiani/facade-segmentation", "id": "e746698b0ee2f0b0cdaf9c3b15e5b3258af81efe", ...
from setuptools import setup # see requirements.txt for dependencies setup( name = "servee_blog", version = "0.1.1.dev10", author = "Servee LLC, Bibilion (the base) originally by Eldarion", author_email = "issac@servee.com", description = "The Servee Blog was originally extacted from servee_blog", ...
{ "content_hash": "34444270e6fac2dd829df2a3082d6b8a", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 31.294117647058822, "alnum_prop": 0.581766917293233, "repo_name": "kellycreativetech/servee_blog", "id": "a848f755fb3c13655d9656f17c862e376e5334dd", ...
DWI_ANALYSIS_DIR = "/speechlab/subjects/pool_dwi/" BASE_TRACULA_CFG = "/speechlab/software/pool_dwi/base.cfg" # FS_SUBJECTS_DIR = "/speechlab/subjects/pool" FIX_BVECS_SCRIPT = "/speechlab/software/pool_dwi/fix_bvecs.py" # INIT_FLIRT_MATS must be an array INIT_FLIRT_MATS = ["/speechlab/software/pool_dwi/_defaults/d2a....
{ "content_hash": "3eb056361a213399263bc0f4fa264bc7", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 96, "avg_line_length": 40.59322033898305, "alnum_prop": 0.6613778705636744, "repo_name": "shanqing-cai/dwi_workflow", "id": "0050b8670482397d93880e5c378d07c7abf19cf7", "siz...
def square(n): # Return `n` times `n`. return n * n # TODO: Talk about automated testing # TODO: Show what happens if the function returned `n`. # TODO: Show what happens if the function returned `n + n`. # TODO: SHow what happens if the function returned `n ** n`. if square(0) == 0: print('Thumbs up.') else: prin...
{ "content_hash": "c9542ecb98be0955bad7fc53e5367044", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 60, "avg_line_length": 20.296296296296298, "alnum_prop": 0.6441605839416058, "repo_name": "regnart-tech-club/programming-concepts", "id": "6a02812134c442cd3c53d51ba541d9c644e...
from django import forms from cms.models import Page from cms.utils.urlutils import static_with_version from .wizard_pool import entry_choices, wizard_pool def step2_form_factory(mixin_cls, entry_form_class, attrs=None): """ Combines a form mixin with a form class, sets attrs to the resulting class. Thi...
{ "content_hash": "c818ef839cc4ba6c8a977c848cbce92a", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 115, "avg_line_length": 33.172413793103445, "alnum_prop": 0.6420651420651421, "repo_name": "timgraham/django-cms", "id": "426de8e1c0fd1fbc1e245697a920433e6eb3cbcc", "size":...
from oslo_config import cfg COMMON_OPTIONS = [ cfg.ListOpt( 'gearman', default=['localhost:4730'], help=('List of gearman servers in HOST:PORT format') ), cfg.ListOpt( 'db_uris', default=['influx://localhost:8086/crawler'], help=('List of InfluxDB servers \ ...
{ "content_hash": "6032d7c994585cf2e59aed8da4be76db", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 64, "avg_line_length": 24.625, "alnum_prop": 0.5761421319796954, "repo_name": "dukov/simplecrawler", "id": "b43970993bbfe743a7bc2e2d61ebea272b953185", "size": "940", "bin...
from __future__ import print_function import collections from datetime import datetime import functools import os import sys import pytz import re import matplotlib matplotlib.use('Agg') import pylab pylab.rcParams['figure.figsize'] = (35.0, 12.0) import pandas as pd from bcbio import utils from bcbio.graph.collectl...
{ "content_hash": "f75f543bc8b5288cae30e98741fb1e35", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 146, "avg_line_length": 32.38422391857507, "alnum_prop": 0.6006914433880726, "repo_name": "elkingtonmcb/bcbio-nextgen", "id": "a33cb5a8a19035bf8800e8a770699748436c6fd5", "...
import sys from textwrap import dedent import py import pytest import tox import tox.config from tox.config import * # noqa from tox.venv import VirtualEnv class TestVenvConfig: def test_config_parsing_minimal(self, tmpdir, newconfig): config = newconfig([], """ [testenv:py1] """) ...
{ "content_hash": "3b74ea789e84546b59c6e75c3e5d70d3", "timestamp": "", "source": "github", "line_count": 1731, "max_line_length": 97, "avg_line_length": 35.0421721548238, "alnum_prop": 0.5385274819479706, "repo_name": "samstav/circleci-python-sandbox", "id": "8aa7abd5e82e07d3614ae2bdf4c9a2cd4f1d1af2",...
"""Footnotes for documents using chicago manual style. By default specific languages forgo the symbol based footnotes. https://en.wikipedia.org/wiki/Dagger_(typography) : While daggers are freely used in English-language texts, they are often avoided in other languages because of their similarity to the Christian cro...
{ "content_hash": "6296e2bd80917a574b8c7459ce3b2244", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 89, "avg_line_length": 28.287581699346404, "alnum_prop": 0.607902033271719, "repo_name": "grow/grow", "id": "e84c7cc6ec3cf60110ed2054c530489351a80312", "size": "4379", "...
""" Integer parameter type testcases - INT32 List of tested functions : -------------------------- - [setParameter] function - [getParameter] function Initial Settings : ------------------ INT32 : - size = 32 - range : [-1000, 1000] Test cases : ------------ - INT32 parameter min val...
{ "content_hash": "8bdc761153104e41f32105140266da3e", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 123, "avg_line_length": 41.814070351758794, "alnum_prop": 0.5239754837158995, "repo_name": "zchokri/parameter-framework", "id": "579e4f8d58ee48d2b0963c0ea91c1f3d89417693", ...
""" .. py:currentmodule:: pysemeels.test_raw_spectrum .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Tests for the module :py:mod:`pysemeels.raw_spectrum`. """ ############################################################################### # Copyright 2017 Hendrix Demers # # Licensed under the Apac...
{ "content_hash": "598662e6b52aea3e6aab8ff5277db9c7", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 116, "avg_line_length": 40.23101265822785, "alnum_prop": 0.6449303862188311, "repo_name": "drix00/pysemeels", "id": "0cefca131402615c4fc9207308cc3ef63f7d2756", "size": "12...
import os.path import json def load_last_toc_from_file(filename): last_stories_fetched = list() if os.path.exists(filename): with open(filename, 'r') as f: last_stories_fetched = [tuple(i) for i in json.load(f)] return last_stories_fetched def save_toc_to_file(toc, filename): wit...
{ "content_hash": "011e7c32360c19d65376a3cd8b24bb83", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 68, "avg_line_length": 29.227272727272727, "alnum_prop": 0.6796267496111975, "repo_name": "sevas/csxj-crawler", "id": "1204784c50f67ccb87aef3d0c5aa95d4575b6cc5", "size": "6...
from datetime import timedelta from django.utils import timezone from django.db.models import Q from rest_framework.views import APIView, Response from common.models import County, Constituency, Ward from chul.models import CommunityHealthUnit from ..models import ( OwnerType, Owner, FacilityStatus, ...
{ "content_hash": "5910e54286e5a555628b7e7b30fdd269", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 79, "avg_line_length": 39.11272727272727, "alnum_prop": 0.5740981777612495, "repo_name": "Nyto035/Konza_backend", "id": "3831cbe6ead4aec8e6ad5b0c729365e9a02e6a33", "size":...
import warnings from django.conf import settings from django.contrib.auth.models import Permission, Group from django.contrib.contenttypes.models import ContentType from django.db import connection from django.db import models from django.db.transaction import set_autocommit from south.db import db from south.v2 import...
{ "content_hash": "8e7fa173bf0fc148fc655eebc1c5273a", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 195, "avg_line_length": 82.2191235059761, "alnum_prop": 0.5691718757571352, "repo_name": "qnub/django-cms", "id": "5d1f03023758e15ef5628d22d5a98bb771721e61", "size": "2066...
"""Unit tests for the "get_feed" module.""" import unittest from unittest import mock from google.auth.transport import requests from . import get_feed class GetFeedTest(unittest.TestCase): @mock.patch.object(requests, "AuthorizedSession", autospec=True) @mock.patch.object(requests.requests, "Response", autos...
{ "content_hash": "83118049c6dfeb43217f5320bf5dc2d6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 33.75555555555555, "alnum_prop": 0.6872942725477288, "repo_name": "chronicle/api-samples-python", "id": "b2add94667e32e4a68838f9198c30d6a84caeed6", "...
import urllib2, config, re from bs4 import BeautifulSoup def httpget(): req = urllib2.Request(config.hportal_ips + config.ip + "&mine=1") try: response = urllib2.urlopen(req) data = response.read() print data print data.index(config.ip) print data.index("creator") ...
{ "content_hash": "4531fe97b02a0e43e1fe1d0890051943", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 69, "avg_line_length": 27.2, "alnum_prop": 0.6102941176470589, "repo_name": "miaolujing/python_script", "id": "d72f043c7d40c29dd42e13a1fa2eefd24ac573e3", "size": "475", "...
"""Implementation of Cluster Resolvers for Cloud TPUs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from six.moves.urllib.request import Request from six.moves.urllib.request import urlopen from tensorflow.contrib.cluster_resolver.python.t...
{ "content_hash": "acb675a70306948674304b102d0a8e48", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 96, "avg_line_length": 38.62706270627063, "alnum_prop": 0.6418318523581682, "repo_name": "aselle/tensorflow", "id": "1ab150d74ac00c5f9acf3c9399880708b2f62b1e", "size": "12...
from __future__ import print_function from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly' store = file.Storage('storage.json') creds = store.get() if not creds or creds.invalid: flow = clien...
{ "content_hash": "3126078b7a7d785a6c9e40517b6c0987", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 68, "avg_line_length": 34.705882352941174, "alnum_prop": 0.7203389830508474, "repo_name": "googleworkspace/gsuite-apis-intro", "id": "48d28ea9b2404dfa8e4dad7e8e8a6c55b1da6795...
ordering_of_classes = [ "Point", "Segment", "Ray", "Line", "Triangle", "RegularPolygon", "Polygon", "Circle", "Ellipse", "Curve" ] class GeometryEntity(tuple): """The base class for any geometrical entity.""" def __new__(cls, *args, **kwargs): return tuple.__new...
{ "content_hash": "ad742df2ef23e0d312256dd983369c3e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 106, "avg_line_length": 30.337662337662337, "alnum_prop": 0.5303938356164384, "repo_name": "mattpap/sympy-polys", "id": "ca29dc093faf0a53f70641676e88f5009ff890c3", "size":...
""" It is unfortunately not well documented how stubs and annotations work in Jedi. If somebody needs an introduction, please let me know. """
{ "content_hash": "9cef0a1f3b15596c2f03c75b986283e9", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 79, "avg_line_length": 35.75, "alnum_prop": 0.7692307692307693, "repo_name": "sserrot/champion_relationships", "id": "5c86b7b349988f5dd5e0e6c3e957c59918ff997d", "size": "143...
import psycopg2 import time, os conn = psycopg2.connect(database='postgis_22_DBSpatial', user='postgres', password='salilbatra', host='127.0.0.1', port='5432') #print("opened database very very successfully") file = open('resultPostgis.geojson', 'w') cur = conn.cursor() start = time.time() #print(datetime.time) cur.ex...
{ "content_hash": "b2d3110862b2c42c121f8bdd39b05ba9", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 127, "avg_line_length": 41, "alnum_prop": 0.6292682926829268, "repo_name": "salilbatra/Spatial-joins-on-relational-database-and-key-value-store", "id": "87ead41f692a4235cd9a8...
from oslo_config import cfg from kuryr.lib import config as kuryr_config from kuryr.tests.unit import base class ConfigurationTest(base.TestCase): def test_defaults(self): neutron_group = getattr(cfg.CONF, kuryr_config.neutron_group.name) self.assertEqual('kuryr', neutro...
{ "content_hash": "abf59840486bcb955db3076f55e8fd66", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 74, "avg_line_length": 35.42857142857143, "alnum_prop": 0.6115591397849462, "repo_name": "openstack/kuryr", "id": "9bf4efb374e499f83731a39cf46eda972de38321", "size": "1317"...
import time import datetime import dateutil import stripe import hashlib import redis import uuid import mongoengine as mongo from pprint import pprint from django.db import models from django.db import IntegrityError from django.db.utils import DatabaseError from django.db.models.signals import post_save from django.d...
{ "content_hash": "ebe9abf61f57dcf8bb7a53c5c20f8faa", "timestamp": "", "source": "github", "line_count": 1187, "max_line_length": 163, "avg_line_length": 45.014321819713565, "alnum_prop": 0.5787543045366073, "repo_name": "Suninus/NewsBlur", "id": "5b7c0d6a0f104e1b2f8903413ad0d0ec916f4970", "size": "...
import subprocess import tensorflow as tf import time import sys flags = tf.flags flags.DEFINE_string("port1", "2222", "port of worker1") flags.DEFINE_string("port2", "2223", "port of worker2") flags.DEFINE_string("task", "", "internal use") FLAGS = flags.FLAGS # setup local cluster from flags host = "127.0.0.1:" clu...
{ "content_hash": "b76ff2fc699b47b1d7ef649e9b599eb2", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 82, "avg_line_length": 35.75471698113208, "alnum_prop": 0.6327176781002638, "repo_name": "xiayuan/tensorflow-server", "id": "873cc69d6cbee47f0eaba4250c04f87e077b6276", "siz...
"custom command to build doc.zip file" #============================================================================= # imports #============================================================================= # core import os from distutils import dir_util from distutils.cmd import Command from distutils.errors i...
{ "content_hash": "abd0d506dcd84206a9a005225a711f2b", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 36.689655172413794, "alnum_prop": 0.4692982456140351, "repo_name": "Glottotopia/aagd", "id": "98a12c49eaf23a26636ce287d4b9c7221ccd3d4b", "size": "319...
"""User friendly container for Cloud Spanner Database.""" import copy import functools import re import threading from google.api_core.gapic_v1 import client_info import google.auth.credentials from google.protobuf.struct_pb2 import Struct from google.cloud.exceptions import NotFound import six # pylint: disable=ung...
{ "content_hash": "d55720ba9a51148dca5503d35af2eca8", "timestamp": "", "source": "github", "line_count": 766, "max_line_length": 149, "avg_line_length": 35.907310704960835, "alnum_prop": 0.6230139974550082, "repo_name": "jonparrott/google-cloud-python", "id": "6fb367d3ab87178dd64aaac5ed6b498c33e943e0"...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import logging import numpy as np from .utils import SynHandlerMod, SynHandlerEcho import uuid import pytest logger = logging.getLogger(__name__) def test_context(): with SynHandlerMod('', (...
{ "content_hash": "270b7a5f92d7cb9d241684c6105004f5", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 69, "avg_line_length": 31.953846153846154, "alnum_prop": 0.6605681271064034, "repo_name": "ericdill/databroker", "id": "b8ca49e3715fc5ae07de14e152f69c3d10f2e0da", "size": "...
from spotally.spotally-bot import *
{ "content_hash": "f429e4b36047d59e9818d685d6322e24", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 35, "alnum_prop": 0.8285714285714286, "repo_name": "TheChugnut/spotally", "id": "f1e0311a339274b892fc61fa0cb1a839bb678fe3", "size": "35", "binary": ...
import rospy import tf from static_transform_manager.srv import ( SetTransformation, SetTransformationResponse, StopTransformation, StopTransformationResponse ) class StaticTransformationsManager(object): def __init__(self, freq): self...
{ "content_hash": "7074798a90f3f13fea6ff04570929bd1", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 89, "avg_line_length": 44.306451612903224, "alnum_prop": 0.48380050964688753, "repo_name": "strands-project/strands_apps", "id": "d06b3c2c742af4ae84e47eefa6f76a2c2fe6c404", ...
""" A contextualization script required by CloudMan (http://cloudman.irb.hr/). The script is automatically run at instance startup (via an `upstart` job; see `/etc/init/cloudman.conf`). Requires: PyYAML http://pyyaml.org/wiki/PyYAMLDocumentation (easy_install pyyaml) boto http://code.google.com/p/boto/ (easy_...
{ "content_hash": "48051774c9935bb4a9d99d8ee0130340", "timestamp": "", "source": "github", "line_count": 604, "max_line_length": 112, "avg_line_length": 40.19867549668874, "alnum_prop": 0.6021004942339374, "repo_name": "IntersectAustralia/galaxy-cloudman-playbook", "id": "9881198959a777ffc9184d553997f...
import sys from exceptions import Exception import pcapy from pcapy import open_offline from impacket.ImpactDecoder import EthDecoder, LinuxSLLDecoder class Connection: """This class can be used as a key in a dictionary to select a connection given a pair of peers. Two connections are considered the same if ...
{ "content_hash": "458a57a2dc5de3ee5f08be080ee1b9ca", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 31.991666666666667, "alnum_prop": 0.6017191977077364, "repo_name": "tholum/PiBunny", "id": "05841fbe00ab137dee53997d4d8608b4accca372", "size": "4396...
from __future__ import print_function from collections import deque from datetime import datetime import operator import pytest from numpy import nan, random import numpy as np from pandas.compat import lrange, range from pandas import compat from pandas import (DataFrame, Series, MultiIndex, Timestamp, ...
{ "content_hash": "87b026aef75a4722689aea2d270182b9", "timestamp": "", "source": "github", "line_count": 1249, "max_line_length": 79, "avg_line_length": 36.056845476381106, "alnum_prop": 0.516598201398912, "repo_name": "NixaSoftware/CVis", "id": "986ba543141929a024cd8098cccc5f76819c35d7", "size": "4...
"""Tests for the BSBLan device config flow.""" import aiohttp from homeassistant import data_entry_flow from homeassistant.components.bsblan import config_flow from homeassistant.components.bsblan.const import CONF_DEVICE_IDENT, CONF_PASSKEY from homeassistant.config_entries import SOURCE_USER from homeassistant.const...
{ "content_hash": "8998796f9a9fac73fd36aec24659450c", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 81, "avg_line_length": 32.685534591194966, "alnum_prop": 0.6430633057533193, "repo_name": "nkgilley/home-assistant", "id": "b8efa960fcabd9b3ce441d8673cc69ab8ecb9587", "siz...
import rospy from std_msgs.msg import String import std_msgs.msg from ros_quad_experimental.msg import Barometer import Adafruit_BMP.BMP085 as BMP085 def talker(): pub = rospy.Publisher('barometer', Barometer, queue_size=10) rospy.init_node('barometersensor', anonymous=True) r = rospy.Rate(10) # 10hz ...
{ "content_hash": "4ba327a29b6437e33f38698a91219168", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 98, "avg_line_length": 33.138888888888886, "alnum_prop": 0.6345347862531433, "repo_name": "wonkothesanest/ros_quad_experimental", "id": "80bd7baf69b95630fdbab130dae74d146374c...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Task', fields=[ ('id', models.AutoField(auto_created=True, verbose_name...
{ "content_hash": "fa0d93e9f79f4de0e674b683f0bb29c9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 114, "avg_line_length": 29.838709677419356, "alnum_prop": 0.5459459459459459, "repo_name": "static-code-generators/taskzilla", "id": "5b80f7e9ad7f07f50b672ce7e19f5cb06aa3ecb4...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import pytest @pytest.mark.online class TestHeaders(object): config = """ tasks: test_headers: text: url: http://httpbin.org/co...
{ "content_hash": "48a969e07774a9e9c51fa13a11074256", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 92, "avg_line_length": 31.08695652173913, "alnum_prop": 0.5566433566433566, "repo_name": "dsemi/Flexget", "id": "d14f4646e532e61a87545958d7c0d3e439fbb0a7", "size": "715", ...