text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.db import migrations, models, connection from django.utils.translation import activate, _trans from tenant_extras.middleware import tenant_translation from parler.models import TranslatableModelMixin def remove_...
{ "content_hash": "a470945d9141ff2fa667b40e349a76be", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 101, "avg_line_length": 34.388888888888886, "alnum_prop": 0.6591276252019386, "repo_name": "onepercentclub/bluebottle", "id": "3bf3fa6da98891e9a57886ea84af2ef2e2540fc5", "s...
from rope.base import (change, taskhandle, evaluate, exceptions, pyobjects, pynames, ast) from rope.refactor import restructure, sourceutils, similarfinder class UseFunction(object): """Try to use a function wherever possible""" def __init__(self, project, resource, offset): se...
{ "content_hash": "086ca12b7b080a52c5f8168c3749e5ad", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 36.29479768786127, "alnum_prop": 0.5832138875617137, "repo_name": "sreejithr/emacs.d", "id": "1a147ab234f982eaecf2e3ce3e8002bfede04eb2", "size": "62...
from vatsystem.model import * from vatsystem.util import const from vatsystem.widgets.components import * __all__ = [ "ohead_search_form", "nhead_search_form", "po_search_form", "charge_search_form", "variance_search_form" ] class OheadSearchForm(RPAC...
{ "content_hash": "d128ad42bbadea782a9e43b6785e88b2", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 120, "avg_line_length": 50.741176470588236, "alnum_prop": 0.6415488059355438, "repo_name": "LamCiuLoeng/vat", "id": "4560cd1cd577c322b6f058c07456cacc3649eec4", "size": "433...
from django.db import models from django.conf import settings from django.core.urlresolvers import reverse class Phenotype(models.Model): """ Phenotype model, if possible links to AraPheno """ name = models.CharField(max_length=255) # name of phenotype study_name = models.CharField(max_length=255, ...
{ "content_hash": "89d5cb04a4cf158716ed9a5112ebf3aa", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 136, "avg_line_length": 52.19047619047619, "alnum_prop": 0.7057481751824818, "repo_name": "1001genomes/AraGWAS", "id": "79801bccb574d7e446f7f130e9aa5b5ff1851c3e", "size": "...
from unittest.mock import Mock, patch from django.test import TestCase from data_refinery_common import utils class UtilsTestCase(TestCase): @patch('data_refinery_common.utils.requests.get') def test_get_instance_id_cloud(self, mock_get): """Test that a request is made and the global value is stored"...
{ "content_hash": "e213ddb7790bf04703449dcc8c8a45a2", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 105, "avg_line_length": 46.09, "alnum_prop": 0.666088088522456, "repo_name": "data-refinery/data_refinery", "id": "8a01966a4c1c0b9ed1bc6f007c635d99cead85bc", "size": "4609...
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="layout.ternary.aaxis.title.font", **kwargs, ): super(SizeValidator, self).__init__( plotly_name=plotly...
{ "content_hash": "50ceb71a0df82ae27e97f3c1f907f0ce", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 28.764705882352942, "alnum_prop": 0.5603271983640081, "repo_name": "plotly/plotly.py", "id": "4f95af68bcb26ea5f9718515a26c70938c08a979", "size": "489...
""" copy the text of button from a window to b window in DND Tested environment: Mac OS X 10.6.8 http://doc.qt.nokia.com/latest/dnd.html """ import sys try: from PySide import QtCore from PySide import QtGui except ImportError: from PyQt4 import QtCore from PyQt4 import QtGui class DragWidget(Q...
{ "content_hash": "301bd4bac0cd23a17c66e72a21040706", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 95, "avg_line_length": 25.78813559322034, "alnum_prop": 0.5836345711468945, "repo_name": "alexlib/Qt-Python-Binding-Examples", "id": "a90bd217ec06b90f5a8a12649c9a6338577b505...
from __future__ import print_function import glob import os.path import shutil import subprocess import sys import time AWKS = [ './goawk', './orig', # GoAWK without perf improvements 'original-awk', 'gawk', 'mawk', ] NORM_INDEX = AWKS.index('original-awk') TESTS_TO_MEAN = None # By default, calc...
{ "content_hash": "8716424d2e10cf9a63f8d65507bba2ec", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 94, "avg_line_length": 31.710743801652892, "alnum_prop": 0.5856137607505864, "repo_name": "benhoyt/goawk", "id": "7fbd919df5278975c28092ca2d2e511a3c556241", "size": "3906"...
from django.conf import settings from django.db import transaction from django.db.models import Q from celery import task from venue.models import Venue from venue.services import VenueService @task def update_venues(): venues = Venue.objects.select_for_update().filter( street='', ).exclude( ...
{ "content_hash": "be826e275468db7d981e114aae092284", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 54, "avg_line_length": 23.25, "alnum_prop": 0.6221198156682027, "repo_name": "FedorSelitsky/eventrack", "id": "2725c66f3c913e8d1db23a8647d7bc8d51beea11", "size": "651", "...
"""Tests for feature_column.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import copy import numpy as np from tensorflow.core.example import example_pb2 from tensorflow.core.example import feature_pb2 from tensorflow.core.protobuf...
{ "content_hash": "be8eb632375da443dd9c2acf692dc85a", "timestamp": "", "source": "github", "line_count": 7939, "max_line_length": 123, "avg_line_length": 39.89318553974052, "alnum_prop": 0.5963462072797999, "repo_name": "hehongliang/tensorflow", "id": "115763f656e93eed5a2e82f7b1ac848c9f81ad83", "siz...
"""Optionnal shortcuts module for DAL. This module exports all the public classes for the project. It imports dal module classes and extension module classes by checking the INSTALLED_APPS setting: - if dal_select2 is present, import classes from dal_select2_*, - with dal_queryset_sequence, import views and fields fr...
{ "content_hash": "5e71885197307e72746fff9aa805b43c", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 75, "avg_line_length": 29.902173913043477, "alnum_prop": 0.7230098146128681, "repo_name": "yourlabs/django-autocomplete-light", "id": "7f201b893103258868917e08cf2fa4fd7594f51...
import agate import agateremote class TestArchive(agate.AgateTestCase): def setUp(self): self.archive = agateremote.Archive('https://github.com/vincentarelbundock/Rdatasets/raw/master/csv/') def test_get_table(self): table = self.archive.get_table('sandwich/PublicSchools.csv') self....
{ "content_hash": "2b2bbbc9bb35709b881055a56f4784c6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 109, "avg_line_length": 33.53333333333333, "alnum_prop": 0.7017892644135189, "repo_name": "wireservice/agate-remote", "id": "47cdad4dfea5c7ad487271e304305c54a3f04f47", "siz...
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='sanneal', version='0.1.dev1', packages=find_packages(), entry_points = { 'console_scripts': [ 'sanneal-demo = sanneal.sanneal_demo:main', ], }, install...
{ "content_hash": "48a591b95440ec6f41430314a20012b7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 23.903225806451612, "alnum_prop": 0.5964912280701754, "repo_name": "yshklarov/sanneal", "id": "d07e08325dab8cc75ce7ea99fcdc797c070ef06d", "size": "74...
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject class StartupModel(IdentifiedObject): """Unit start up characteristics depending on how long the unit has been off lineUnit start up characteristics depending on how long the unit has been off line """ def __init__(self, startupCost=0.0, st...
{ "content_hash": "0218659ca7ffcb795094700baeafb923", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 332, "avg_line_length": 51.10071942446043, "alnum_prop": 0.7132197662959313, "repo_name": "rwl/PyCIM", "id": "41dbf7440449e18ad8b5e7da216aaa1cbbacb549", "size": "8203", ...
"""Helper script for running endtoend tests.""" import unittest import logging # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.endtoend_tests import base from grr.lib import access_control from grr.lib import aff4 from ...
{ "content_hash": "b984b529dcac1a37e46e6db57cb2911e", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 32.70434782608696, "alnum_prop": 0.6216431800053177, "repo_name": "defaultnamehere/grr", "id": "12ee6279bb5c351631bb0b977fd297c4259c64cb", "size": "...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Lighting(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "cone" _path_str = "cone.lighting" _valid_props = { "ambient", "diffuse", ...
{ "content_hash": "a79c28176f1d7c7017173c2be2a5e5bc", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 82, "avg_line_length": 29.315112540192928, "alnum_prop": 0.5517165734342437, "repo_name": "plotly/python-api", "id": "2d6093bf247fc2e8d68ff6791dfb6cfdd3874ddb", "size": "9...
import discord import pam from pam.utils import checks from discord.ext import commands class StallmanModule: def __init__(self, bot): pam.log("GNU/Stallman initialized", tag="PAM COG") self._bot = bot @property def module_name(self): return "GNU/Stallman" def _embed(self, ct...
{ "content_hash": "157d934a90b402fb27af8725c5876f89", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 199, "avg_line_length": 55.70238095238095, "alnum_prop": 0.6326138063688822, "repo_name": "Emzi0767/Discord-PAM-Bot", "id": "4365eef3efff6e2bc96599bbddf922e2003142db", "siz...
import logging import uuid from spacel.provision.cloudformation import BaseCloudFormationFactory logger = logging.getLogger('spacel') class SpaceElevatorAppFactory(BaseCloudFormationFactory): def __init__(self, clients, change_sets, uploader, app_template): super(SpaceElevatorAppFactory, self).__init__...
{ "content_hash": "4522b5942a9b54d11511882589451a1a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 37.125, "alnum_prop": 0.5733525733525734, "repo_name": "pebble/spacel-provision", "id": "7fea79a4d52ad2486d74b00b56db8023c6d2abf6", "size": "2079", ...
import argparse import os import pathlib import sys import subprocess def banner_execute() -> pathlib.Path: script_path = pathlib.Path(os.path.realpath(__file__)) sep = "-" * 79 print("{}\nExecuting: {}\n{}".format(sep, script_path.name, sep)) return script_path def file_exists(path_str: pathlib, ch...
{ "content_hash": "1e58b48fa9646a46d599be79ce877509", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 30.93243243243243, "alnum_prop": 0.6190476190476191, "repo_name": "neitsa/PrepareLanding", "id": "81c3fbf9a1a07bbeae3b204829fd6cd1f86d8db0", "size": ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Mail-Merge for Scribus. This file provides the backend. # # For further information (manual, description, etc.) please visit: # https://github.com/berteh/ScribusGenerator/ # # v2.9.1 (2021-01-22): update port to Python3 for Scribut 1.5.6+, various DOC update # ...
{ "content_hash": "4dffa62959b7a31f468299d31acb471e", "timestamp": "", "source": "github", "line_count": 721, "max_line_length": 559, "avg_line_length": 48.697642163661584, "alnum_prop": 0.5599384808179773, "repo_name": "berteh/ScribusGenerator", "id": "b6bcb6eb18bca2489bb289a9610ce1606004a383", "si...
__author__ = 'Daniel' import sys from PySide.QtCore import * from PySide.QtGui import * import GUI.ui_menu import GUI.ui_startwidget import GUI.ui_gamedialog import GUI.ui_historywidget class MenuWidget(QWidget, GUI.ui_menu.Ui_Menu): def __init__(self): super(MenuWidget, self).__init__() self.setu...
{ "content_hash": "53508e5a1b16b4f1dd4114a231f62554", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 93, "avg_line_length": 32.35576923076923, "alnum_prop": 0.6350668647845468, "repo_name": "daniellowtw/MentalMaths", "id": "0265ff4a0431f63a6dcd4e33be60b0d99fd61e73", "size...
"""This example gets a forecast for a prospective line item. The prospective line item targets the entire network. The targeting can be modified to determine forecasts for other criteria such as custom criteria targeting (in addition to targeting the whole network). See create_line_items.py for an example of how to cr...
{ "content_hash": "44ed8356927325060afc537512d512a6", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 80, "avg_line_length": 34.11063829787234, "alnum_prop": 0.5415419161676647, "repo_name": "Aloomaio/googleads-python-lib", "id": "96980310ea1a9613aaa10efad5fa9e800809ecd1", ...
""" Volume driver for NetApp Data ONTAP (7-mode) FibreChannel storage systems. """ from oslo_log import log as logging from cinder.volume import driver from cinder.volume.drivers.netapp.dataontap import block_7mode from cinder.zonemanager import utils as fczm_utils LOG = logging.getLogger(__name__) class NetApp7m...
{ "content_hash": "75a0139ab297d57a367a9f269f0a12e2", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 76, "avg_line_length": 35.09473684210526, "alnum_prop": 0.6475704859028194, "repo_name": "dims/cinder", "id": "9efe27c6922571bdce8147b1701b5f6ecc16f4bd", "size": "3970", ...
"""Create auth tokens for existing users""" from __future__ import unicode_literals from django.db import models, migrations def no_op(apps, schema_editor): pass def create_auth_tokens(apps, schema_editor): User = apps.get_model('email_user', 'EmailUser') Token = apps.get_model('authtoken', 'Token') ...
{ "content_hash": "328ddb20a7f246eb92f739dcb072df4e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 52, "avg_line_length": 22.06451612903226, "alnum_prop": 0.6242690058479532, "repo_name": "theirc/ServiceInfo", "id": "2d7e70305202c8239fa31499bc0a03147396f3f5", "size": "70...
from io import BytesIO from unittest import TestCase, SkipTest from os.path import join from gzip import GzipFile from scrapy.spiders import Spider from scrapy.http import Response, Request, HtmlResponse from scrapy.downloadermiddlewares.httpcompression import HttpCompressionMiddleware, \ ACCEPTED_ENCODINGS from s...
{ "content_hash": "cb4ea916d0078eb5e3e169e6e389178b", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 131, "avg_line_length": 41.8804780876494, "alnum_prop": 0.653824200913242, "repo_name": "eLRuLL/scrapy", "id": "64488841a299e37e1967973b62069b6acaa70acd", "size": "10512",...
def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return words def sort_words(words): """Sorts the words.""" return sorted(words) def print_first_word(words): """Prints the first word after popping it off.""" word = words.pop(0) print word...
{ "content_hash": "bb684940b3c6356a7012f196b6fe3f31", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 64, "avg_line_length": 27.333333333333332, "alnum_prop": 0.6646341463414634, "repo_name": "darthbinamira/learn_python", "id": "2534942dad78526a7d684012562fb2063edbc4a4", "s...
from __future__ import absolute_import, unicode_literals from django.core.handlers.wsgi import WSGIRequest from django.utils.html import escape from django.utils.safestring import mark_safe from django.test.client import FakePayload from itertools import chain import inspect import six import warnings def python_2_un...
{ "content_hash": "0903336c75438c4f519e949756ff768f", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 94, "avg_line_length": 33.28260869565217, "alnum_prop": 0.5127367733507512, "repo_name": "clan-wot/rewards", "id": "2c2d9be9cb620082bb49421e56cbd1c273506340", "size": "183...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import datetime import six import tensorflow as tf import tflearn import numpy as np import multiprocessing as mp from multiprocessing.managers import BaseManager from helpers import * import utils i...
{ "content_hash": "c6df673a739230120a18a2afd5f07d00", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 191, "avg_line_length": 48.51780821917808, "alnum_prop": 0.5538426788638545, "repo_name": "lisa-1010/smart-tutor", "id": "442b74ef37f39c34952def42c68c4cec3dde76c3", "size"...
import os import sys sys.path.insert(0, os.path.abspath('../')) sys.path.insert(0, os.path.abspath('../src/')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module ...
{ "content_hash": "c5b266295ef6cf501bbac2532ec850d2", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 90, "avg_line_length": 28.981308411214954, "alnum_prop": 0.6919273352681931, "repo_name": "piraaa/VideoDigitalWatermarking", "id": "4dec7a3648e4f5394473e9f3a6aba1d18fe3ece3"...
import sys n = int(input().strip()) sockColors = [int(color) for color in input().strip().split(' ')] d = dict() for color in sockColors: if color not in d: d[color] = 0 d[color] += 1 count = 0 for key, colorCount in d.items(): count += colorCount // 2 print(count)
{ "content_hash": "6d4c6e5a47a73dbc6848c8a2a190dced", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 17.125, "alnum_prop": 0.635036496350365, "repo_name": "shobhitmishra/CodingProblems", "id": "89aed15274465d52bce949ccec78ac7f572ed52d", "size": "274"...
import cv2 import io import base64 import numpy as np import pandas as pd from subprocess import Popen, PIPE class VideoAnalysis(object): """ TODO: - Define common interfaces on similar functions - Define what format video will come in as - Probably want a preprocessed dataframe with image, time,...
{ "content_hash": "f2aa31f52346aac5b96f32719d09378d", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 93, "avg_line_length": 26.938144329896907, "alnum_prop": 0.572139303482587, "repo_name": "pdxcycling/carv.io", "id": "dfbe7b37bded89f37eb6d09373ef479e33938af4", "size": "26...
from qrl.core.Transaction_subtypes import TX_SUBTYPE_STAKE, TX_SUBTYPE_TX, TX_SUBTYPE_COINBASE from collections import OrderedDict, namedtuple from pyqrllib.pyqrllib import getHashChainSeed, bin2hstr from qrl.core import config, logger from qrl.core.ChainBuffer import ChainBuffer from qrl.core.Transaction import Transa...
{ "content_hash": "7a96efb4d1da70d75c94569a6f6e50c7", "timestamp": "", "source": "github", "line_count": 693, "max_line_length": 155, "avg_line_length": 38.38239538239538, "alnum_prop": 0.5723899394714087, "repo_name": "elliottdehn/QRL", "id": "f19b38d6b57296a08d1562db7f88507a1e711615", "size": "267...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: iosxr_command version_added: "2.1" author: "Ricardo Carrillo ...
{ "content_hash": "130338dc2bfd18769782ce7d492feb01", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 88, "avg_line_length": 32.03414634146341, "alnum_prop": 0.6520481193848028, "repo_name": "SergeyCherepanov/ansible", "id": "e3d971a76a5e71046523966f4c011a12a11466e5", "siz...
#The MIT License (MIT) #Copyright (c) 2014 Microsoft Corporation #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, mod...
{ "content_hash": "47f45ecc0f72fd2b2600d484c009f051", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 117, "avg_line_length": 39.016129032258064, "alnum_prop": 0.6903679206283588, "repo_name": "Azure/azure-documentdb-python", "id": "584eecd05482e25d32e079a6483174cd40b9084f", ...
"""gcloud datastore emulator start command.""" from googlecloudsdk.api_lib.emulators import datastore_util from googlecloudsdk.api_lib.emulators import util from googlecloudsdk.calliope import arg_parsers from googlecloudsdk.calliope import base class Start(base.Command): """Start a local datastore emulator. Th...
{ "content_hash": "6f4e13b83f4fe04f8c38e16922788600", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 29.903846153846153, "alnum_prop": 0.6655948553054662, "repo_name": "flgiordano/netcash", "id": "568a13d8e0ff7bff616f6afe80f232fb3e6f8f95", "size": "2...
"""Various chroot-related exception classes""" from __future__ import unicode_literals import os class ChrootError(Exception): """Exception that is raised when there is an error when trying to set up a chroot.""" def __init__(self, message, errno=None): self.message = message self.args = (m...
{ "content_hash": "a5a71cfa8e87a31c53be94bb05b50a9f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 104, "avg_line_length": 27.275862068965516, "alnum_prop": 0.638432364096081, "repo_name": "radhermit/pychroot", "id": "548f2b31461712d04b3601f249b35aa50233d388", "size": "7...
import os import sys import urlparse import requests try: from requests.packages import urllib3 urllib3.disable_warnings() except ImportError: pass AUTH_USERNAME = 'getsentry-bot' AUTH_TOKEN = os.environ['GITHUB_AUTH_TOKEN'] AUTH = (AUTH_USERNAME, AUTH_TOKEN) TAG = os.environ.get('TRAVIS_TAG') or \ o...
{ "content_hash": "775da096f938fab6c4d474c1bf44f079", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 27.12962962962963, "alnum_prop": 0.6013651877133106, "repo_name": "getsentry/symsynd", "id": "b1ebf29cf283a82ca85d0505e43fe537d8929ad8", "size": "29...
from plugin.srv_graph.pretty_printer import ARCADIAXMLPrinter from plugin.srv_graph.graph_element import ComponentFactory from plugin.srv_graph.graph_element import ComponentFactoryFacade from plugin.srv_graph.graph_builder import GraphBuilder from plugin.api.responses import ARCADIACompResponse from mock import Magi...
{ "content_hash": "c4eb8089aa985d1583914eb6a7193a73", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 91, "avg_line_length": 34.395604395604394, "alnum_prop": 0.7207667731629392, "repo_name": "SINTEF-9012/cloudify-arcadia-plugin", "id": "de01129cc752d5fd235efaeffe78342e9b5548...
""" Created on Mon Sep 4 20:25:49 2017 @author: Kirby Urner """ """ primes.py -- Oregon Curriculum Network (OCN) Feb 1, 2001 changed global var primes to _primes, added relative primes test Dec 17, 2000 appended probable prime generating methods, plus invmod Dec 16, 2000 revised to use pow(), removed method...
{ "content_hash": "dcc6c3a59ed5596439718e22abc53d68", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 79, "avg_line_length": 28.34005037783375, "alnum_prop": 0.5720380410630166, "repo_name": "4dsolutions/Python5", "id": "9ff676d169a0b0e7a4ccfdea15d72818323725ff", "size": "...
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding import python_2_unicode_compatible from rapidsms.models import Contact, Connection @python_2_unicode_compatible class Message(models.Model): INCOMING = "I" OUTGO...
{ "content_hash": "329f75fe1ae80ac2de3f4452e20800dc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 78, "avg_line_length": 38.847457627118644, "alnum_prop": 0.6391797556719022, "repo_name": "catalpainternational/rapidsms", "id": "1a35b0c5d04c8693bb0287ad2ca52b554f547915", ...
update_template = '''#!/usr/bin/env bash # The MIT License (MIT) # # Copyright (c) 2016 Philippe Proulx <eepp.ca> # # 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, inclu...
{ "content_hash": "e9ff8a9eea92f7736317f11d30e21f07", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 79, "avg_line_length": 33.18, "alnum_prop": 0.7426160337552743, "repo_name": "eepp/vlttng", "id": "ae41f501f292cf7434852a6a13090718a9156ca5", "size": "2790", "binary": fa...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ARB_geometry_shader4' def _f( function ): return _p.createFunction( function,_p.GL,'GL_ARB_geometry_shader4',False) _p.unpack_const...
{ "content_hash": "18c5b4e20fa20cb38718762f8d9d1f42", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 45.62, "alnum_prop": 0.7834283209118807, "repo_name": "frederica07/Dragon_Programming_Process", "id": "28968012f36d90283e79cffc4361acecfe07c24f", "si...
import logging import os import subprocess import sys import thread from . import server from options import parser from pkg_resources import resource_filename from utils import container, target, project gdb_command_file = '.gdb_commands' gdb_commands = '''\ target remote %s:3333 file %s load ''' def addOptions(pa...
{ "content_hash": "2571fcaa599b1a5ce481e3251a6f6354", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 153, "avg_line_length": 33.06849315068493, "alnum_prop": 0.6628003314001657, "repo_name": "kyleparrott/kubos-sdk", "id": "fd25c93c0be3d3e7484f0a8abe1420a068140e08", "size":...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse f...
{ "content_hash": "e92408e56c6fbf8567d388c5268cc03d", "timestamp": "", "source": "github", "line_count": 814, "max_line_length": 375, "avg_line_length": 45.09213759213759, "alnum_prop": 0.6363165781228716, "repo_name": "Azure/azure-sdk-for-python", "id": "7f7e1f04ab7a24202c7e173c4e76250042c4b5fc", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('visit', '0086_auto_20150829_2157'), ] operations = [ migrations.RemoveField( model_name='issueprek', name='visit_num', ...
{ "content_hash": "04138541d1e4727223650a8e81fbc86a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 45, "avg_line_length": 21.142857142857142, "alnum_prop": 0.5630630630630631, "repo_name": "koebbe/homeworks", "id": "0ee07f07ff5824f2b26edeaacdfc0d7d812fbbbd", "size": "468...
import os.path import StringIO import lxml.etree as ET import dhtmlparser from marcxml_parser import MARCXMLRecord # Variables =================================================================== XML_TEMPLATE = """<root> <collection xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/...
{ "content_hash": "3595aa26c7d10f014b7e66c985ec7cfc", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 80, "avg_line_length": 25.596273291925467, "alnum_prop": 0.5877214268381461, "repo_name": "edeposit/marcxml2mods", "id": "bebf009e969c163bed502cf25638cb3f003b17d7", "size"...
from __future__ import absolute_import from django import forms from django.utils.translation import ugettext_lazy as _ from allauth.account.forms import BaseSignupForm from allauth.account.utils import (user_username, user_email, user_field) from .models import SocialAccount from ...
{ "content_hash": "6ce9098cc7d917138d9f13401298cd2c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 76, "avg_line_length": 38.263888888888886, "alnum_prop": 0.585480943738657, "repo_name": "jwhitlock/django-allauth", "id": "c79387cf1cdb4800b3fefc7f17a12296a4d543a6", "size...
import time import pytest from flexmock import flexmock from pyp2rpm.package_data import * class TestPackageData(object): @pytest.mark.parametrize(('s', 'expected'), [ ('Spam.', 'Spam'), ('Spam', 'Spam'), ]) def test_summary_with_dot(self, s, expected): pd = PackageData('...
{ "content_hash": "15d228433c76c235cb1b4426185a5564", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 63, "avg_line_length": 30.263157894736842, "alnum_prop": 0.5669565217391305, "repo_name": "joequant/pyp2rpm", "id": "683d88562f10b98cb7cbf31dc392a5aded90f1ba", "size": "115...
from datetime import date class Prescription(object): def __init__(self, dispense_date=None, days_supply=30): self.dispense_date = dispense_date or date.today() self.days_supply = days_supply
{ "content_hash": "ffa02e3cfbd12271d6b14b4c07d4969c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 59, "avg_line_length": 31.142857142857142, "alnum_prop": 0.6743119266055045, "repo_name": "emilybache/KataMedicineClash", "id": "a528a94422446e1897210380cd5e1dbec8106ba3", "...
from __future__ import absolute_import, print_function, unicode_literals import copy import itertools import os import sys import attr import plette.models.base import plette.pipfiles import tomlkit from vistir.compat import FileNotFoundError, Path from ..environment import MYPY_RUNNING from ..exceptions import Requ...
{ "content_hash": "1f5f99be796e29d91764d89ad25f8090", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 112, "avg_line_length": 37.15706806282723, "alnum_prop": 0.5935606594335635, "repo_name": "kennethreitz/pipenv", "id": "9c0aea4ea35ea59a85067152e2ec11f8cc6f116b", "size": ...
from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from django.shortcuts import render_to_response, redirect, HttpResponse, Http404 from django.template import RequestContext from django.contrib.auth import authenticate, logout, login from django.contrib.auth.decorators import l...
{ "content_hash": "96406fa4c44e4dd6386d20302826c9ec", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 117, "avg_line_length": 38.29007633587786, "alnum_prop": 0.6275917065390749, "repo_name": "aazhbd/medical_info01", "id": "a4e4c89dec9653a8e8bd95fb9f76d2aa099fa560", "size"...
import unittest from pyloc.db import Results from pyloc.util import loc class Tests(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_python(self): t1_expected = {'comment': 2, 'code': 2, 'total': 5, 'docstring': 2, 'empty': 1} t2_expected = {'co...
{ "content_hash": "5283a009bd7b6ff1a512b4e07520aab2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 87, "avg_line_length": 26.875, "alnum_prop": 0.5106976744186047, "repo_name": "abingham/pyloc", "id": "a59fd03f298f2c856a351192d121d8a93a08c15d", "size": "1075", "binary"...
import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') setup(...
{ "content_hash": "64b591c8a1d78684ef7f7587c07d4758", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 66, "avg_line_length": 25.897959183673468, "alnum_prop": 0.5902285263987391, "repo_name": "trenton42/mmtr", "id": "424fb6993e2a5ee66d7e180b01b5be55038f8c91", "size": "1316"...
''' Created on 11.03.15 @author = mharder ''' from termcolor import colored import syslog def get_log_color_and_background(level): log_color = 'green' log_background = None if level == syslog.LOG_CRIT: log_color = 'white' log_background = 'on_red' elif level == syslog.LOG_ERR: ...
{ "content_hash": "bf32e757076efb071328959b6fcc5ad8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 28.977777777777778, "alnum_prop": 0.6234662576687117, "repo_name": "blue-yonder/bonfire", "id": "f345592d19a3e4c7a45e1c8f7455df07f41d4ccc", "size": "...
__program__ = 'PseudoBusy' __version__ = '1.0.0' __description__ = 'Terminal vomit' __author__ = 'Brandon Dreager' __author_email__ ='pseudobusy@subol.es' __copyright__ = 'Copyright (c) 2016 Brandon Dreager' __license__ = 'MIT' __website__ = 'https://github.com/Regaerd/PseudoBusy' import os from printer import Printer...
{ "content_hash": "d3e429d71b98fbd955496f69de7b65f3", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 130, "avg_line_length": 41.39370078740158, "alnum_prop": 0.5683850104622408, "repo_name": "Regaerd/PseudoBusy", "id": "714a8fa7c4a36fd2723b4e25e503e0c5a6a50acb", "size": "...
from __future__ import unicode_literals import json, logging, os, pprint from django.conf import settings from django.contrib.auth import authenticate from django.http import HttpResponse from iip_processing_app.models import Status log = logging.getLogger(__name__) class UserGrabber(object): """ Grabs user ob...
{ "content_hash": "98525db4a0c94c418f1fd0afbf9359ec", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 138, "avg_line_length": 42.38423645320197, "alnum_prop": 0.5890283589028359, "repo_name": "birkin/iip_processing_project", "id": "7d9b19bee217d5e1dc3d941caf9517ed60bed56d", ...
""" Pelix basic HTTP service test module. :author: Thomas Calmant """ from pelix.framework import FrameworkFactory from tests.http.gen_cert import make_certs from tests.http.test_basic import install_bundle, install_ipopo import logging import os import shutil import tempfile try: import unittest2 as unittest e...
{ "content_hash": "e85cc83885fe460ac9fb26608fb094e3", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 80, "avg_line_length": 27.153846153846153, "alnum_prop": 0.5709159584513692, "repo_name": "ahmadshahwan/ipopo", "id": "fa981f39681d841ff11c7640e5c9ef2e18dfd64c", "size": "...
import platform if platform.python_version() < '2.7': unittest = __import__('unittest2') else: import unittest import mse from mse.base import Column, Index, IndexColumn from mse.cli import Cli, CliSQLParseException from docopt import docopt, DocoptExit class TestCli(unittest.TestCase): def test_fail_no...
{ "content_hash": "b3add02919326d644776b6630f4e2071", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 117, "avg_line_length": 35, "alnum_prop": 0.6416988416988417, "repo_name": "frail/mysql-size-estimator", "id": "bad866c86239057073caa23977e15a93936edae8", "size": "1295", ...
"""Provides mock objects for powl.action.""" class MockAction(object): """ Provides a mock object for powl.action.Action. """ def __init__(self): self._do_called = False self._do_string = "" self._do_date = "" def do_called_with(self, string, date): return (self._d...
{ "content_hash": "309b605c3ac6d42f175f6a83d34792da", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 50, "avg_line_length": 25.17391304347826, "alnum_prop": 0.5457685664939551, "repo_name": "adammansfield/Powl", "id": "bbf2dd475e10108e822e858ae668b8cd676cc441", "size": "57...
""" Zip splitter. Status: can read most important headers Authors: Christophe Gisquet and Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, Bit, Bits, Enum, TimeDateMSDOS32, SubFile, UInt8, UInt16, UInt32, UInt64, String, PascalString16, Ra...
{ "content_hash": "9c5086b59802c1aaf4585c883e7955bf", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 116, "avg_line_length": 41.006928406466514, "alnum_prop": 0.6037395809867088, "repo_name": "Yukinoshita47/Yuki-Chan-The-Auto-Pentest", "id": "8271ac93cece32562c15a62111e9d9b...
from django.contrib import admin from django.utils.translation import ugettext as _ from django.utils.timezone import now from . import forms, models @admin.register(models.Post) class PostAdmin(admin.ModelAdmin): list_display = ( '__str__', 'status', 'approved', 'created_at', ...
{ "content_hash": "1ca3d5607d997dc3078459c4dac9c926", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 72, "avg_line_length": 23.069767441860463, "alnum_prop": 0.5403225806451613, "repo_name": "dvl/pyclub", "id": "b6736b9c711e4ff6856f381520289946f2930ef5", "size": "1017", ...
''' Created on 4 juin 2013 @author: Aristote Diasonama ''' import logging from shop.handlers.base_handler import BaseHandler class VerificationHandler(BaseHandler): def get(self): signup_token = self.request.str_GET["signup_token"] verification_type = self.request.str_GET['type'] user_id...
{ "content_hash": "df6f2595cd5cfa3ae58c86ea3d7292e8", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 84, "avg_line_length": 31.24590163934426, "alnum_prop": 0.5351521511017838, "repo_name": "EventBuck/EventBuck", "id": "b51a0cd6dfe626e9e631d9042852011cce9eb83c", "size": "1...
import logging logger = logging.getLogger('dmrg_helpers') logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.INFO) logger.addHandler(ch)
{ "content_hash": "20a1f53d5a2f140f351e90ab6554125b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 27.5, "alnum_prop": 0.8, "repo_name": "iglpdc/dmrg_helpers", "id": "4aafc7a049822b2e7197e3605eb9a9fc54da3869", "size": "165", "binary": false, "co...
import os import google_api import google_api.lib_google import google_api.lib_google2 import google_api.lib_google3 import dropbox_api import dropbox_api.lib_dropbox import local_api import local_api.lib_local import config import simple_httpserver import meta_puller import traceback import time from con...
{ "content_hash": "d0f2aecc29d01a0c07e92cc1c072950f", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 140, "avg_line_length": 35.73347107438016, "alnum_prop": 0.6366001734605378, "repo_name": "baolinw/cloud", "id": "2390f442ed02c13ba23adb8baef3824deda2609d", "size": "17444...
import RPi.GPIO as GPIO import time #GPIO Mode (BOARD / BCM) GPIO.setmode(GPIO.BCM) #set GPIO Pins GPIO_TRIGGER = 17 GPIO_ECHO = 13 #set GPIO direction (IN / OUT) GPIO.setup(GPIO_TRIGGER, GPIO.OUT) GPIO.setup(GPIO_ECHO, GPIO.IN) def main (): try: while True: dist = distance() ...
{ "content_hash": "223bce59af9e6c90349a8dc37450398c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 56, "avg_line_length": 22.654545454545456, "alnum_prop": 0.6123595505617978, "repo_name": "JohnOmernik/pimeup", "id": "2f8b7421ded099b4768c160d12e093d2da0fc33b", "size": "1...
import fallout_login as login import fallout_boot as boot import fallout_locked as locked import fallout_hack as hack import fallout_selection as select import sys hard = False if len(sys.argv) == 2 and sys.argv[1].lower() == 'hard': hard = True if boot.beginBoot(hard): pwd = hack.beginLogin() if pwd != N...
{ "content_hash": "823050b4baaaae3460fd892798d3f91f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 56, "avg_line_length": 23.85, "alnum_prop": 0.6729559748427673, "repo_name": "J77D/fallout-terminal", "id": "584607c0f2139e84fad6d899eeb5dd95b88b6ce4", "size": "500", "bi...
""" Automatically scrape paintings by specified artists from wikiart. Jesse Mu """ import requests from bs4 import BeautifulSoup import os from collections import defaultdict from fake_useragent import UserAgent # Hehe # Global constants ARTIST_URL = 'http://wikiart.org/en/{artist}/mode/all-paintings/{page}' IMG_UR...
{ "content_hash": "7fe1a054d0df89ef6eb63392293fe732", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 83, "avg_line_length": 32.63970588235294, "alnum_prop": 0.6273935571074566, "repo_name": "jayelm/neural-art", "id": "471cbd8dd4a148e545fab8c74f2791fa14343f10", "size": "44...
from recipe_engine import post_process PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ 'git', 'recipe_engine/assertions', 'recipe_engine/properties', ] def RunSteps(api): numbers = api.git.number( commitrefs=api.properties.get('commitrefs'), test_values=api.properties.get('test_values'), ...
{ "content_hash": "d3c4f9cf10f2e57c7327f36b7981c47b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 63, "avg_line_length": 25.517241379310345, "alnum_prop": 0.6297297297297297, "repo_name": "CoherentLabs/depot_tools", "id": "409ba78100e8284e6244ff894cc0abf4202f9447", "siz...
__author__ = 'VinnieJohns' import re def test_phones_on_home_page(app): contact_from_home_page = app.contact.get_contacts_list()[0] contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0) assert contact_from_home_page.all_phones_from_homepage == merge_phones_like_on_home_page(contact_from_...
{ "content_hash": "f4506b3711c8c7166ff7d8e64c652b50", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 129, "avg_line_length": 44.75, "alnum_prop": 0.6624102154828412, "repo_name": "VinnieJohns/barancev_python_training", "id": "979dc063f1a0ff58880432a00d95a2d0e3634191", "siz...
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("AdaBoostRegressor" , "california_housing" , "mysql")
{ "content_hash": "47a502171bdae8ca12f27413fecf54f4", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 35.5, "alnum_prop": 0.7816901408450704, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "1ed0dbb6d9d7df41dcb867a1994bef1d60b55841", "size": "142...
import json from django.http import ( HttpResponseNotAllowed, HttpResponseBadRequest, HttpResponse, QueryDict ) from issues.models import Issue def get_issues(request, **kwargs): if request.method != 'GET': return HttpResponseNotAllowed() issues = [issue.serialize() for issue in Issue.objects...
{ "content_hash": "d1bbd84bcae67e458f0bd9207e049f3c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 65, "avg_line_length": 24.57894736842105, "alnum_prop": 0.6541755888650964, "repo_name": "zadarians/qa_dashboard", "id": "c5a06aef515b333b7c6e0e1a9bf22794830ae168", "size":...
""" API endpoints for Registration """ class Registration_API_Endpoints: "Class for registration endpoints" def registration_url(self,suffix=''): """Append API end point to base URL""" return self.base_url+'/register/'+suffix def register_car(self,url_params,json,headers): "register car " url = self.regi...
{ "content_hash": "8679df86ee9674d24bf19e3d216299cb", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 23.925, "alnum_prop": 0.6980146290491118, "repo_name": "qxf2/qxf2-page-object-model", "id": "b9a7d033cce387a99123603c1d9164e610ee80ee", "size": "958"...
from sklearn.base import TransformerMixin, BaseEstimator class FitFixer(BaseEstimator, TransformerMixin): def __init__(self, cls): self.cl = cls def fit(self, X, y=None): self.cl.fit(X) return self def transform(self, X): return self.cl.transform(X)
{ "content_hash": "6161677b1bb64178b26c2b3d27332e34", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 24.75, "alnum_prop": 0.6397306397306397, "repo_name": "ryadzenine/featkit", "id": "ed7e627307ae2b77f7a598f20a5b19e61c5d618d", "size": "314", "binar...
""" Data input with Pandas for Data Bootcamp course. Course materials * http://databootcamp.nyuecon.com/ * https://github.com/NYUDataBootcamp/Materials Written by Dave Backus, August 2015 Created with Python 3.4 Edited by Chase Coleman and Spencer Lyon, October 2016 Created with Python 3.5 """ #%% """ Read csv file...
{ "content_hash": "4bc1b9fed45b09f95a585612d0b7ccc3", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 79, "avg_line_length": 29.174698795180724, "alnum_prop": 0.6279165806318397, "repo_name": "NYUDataBootcamp/Materials", "id": "32aa7aee4f24dfe5d002ba43a7d1d9a03e4b4ba3", "s...
from django.utils.translation import gettext_lazy as _ from rest_framework import exceptions, status class TokenError(Exception): pass class TokenBackendError(Exception): pass class DetailDictMixin: def __init__(self, detail=None, code=None): """ Builds a detail dictionary for the erro...
{ "content_hash": "3f0b944ed3fd660fa7445eb27e26f905", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 80, "avg_line_length": 25.487179487179485, "alnum_prop": 0.6599597585513078, "repo_name": "davesque/django-rest-framework-simplejwt", "id": "530d3a8e052bef78e20ba962cd2b1604c...
import os import tempfile from django import VERSION as DJANGO_VERSION from testapp.helpers import get_middleware # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = ")0-t%mc5y1^fn8e7i**^^v166@5iu(&-2%9#kxud0&4ap#k!_k" DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_AP...
{ "content_hash": "5306f001df527cd6170001e82db2b6f0", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 80, "avg_line_length": 29.150943396226417, "alnum_prop": 0.6058252427184466, "repo_name": "korfuri/django-prometheus", "id": "fde7729fb02794c894d81a446d60052e36bd59eb", "s...
from __future__ import absolute_import, print_function, unicode_literals import os import sys if __name__ == "__main__": sys.path.append(os.path.dirname(__file__)) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_proj.settings") from django.core.management import execute_from_command_line execu...
{ "content_hash": "cd15192d3d7974b9400b021f6ab4a30d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 29.25, "alnum_prop": 0.7150997150997151, "repo_name": "luzfcb/django_documentos", "id": "f9ea198351cda129972a59b7d7351744e2e75c6e", "size": "397", ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "supervise_backend.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # is...
{ "content_hash": "39eb2502dab6474bf5503a66e3680f83", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 81, "avg_line_length": 37.76190476190476, "alnum_prop": 0.6242118537200504, "repo_name": "kaqfa/supervise_backend", "id": "e254aa05450c6b3b23382aaa9c4f43923451b3e7", "size"...
import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) version = None exec(open('aiodockerpy/version.py').read()) with open('./requirements.txt') as reqs_txt: requirements = list(iter(reqs_txt)) with open('./requirements-test.txt') as test...
{ "content_hash": "d6171567e8d3b32293f46c0bade47c98", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 61, "avg_line_length": 31.025, "alnum_prop": 0.6526994359387591, "repo_name": "tenforce/docker-py-aiohttp", "id": "0df5ef92a5efe58cbd5f4c599d329d0a053e7d30", "size": "1265"...
from azure.identity import DefaultAzureCredential from azure.mgmt.testbase import TestBase """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-testbase # USAGE python email_events_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret o...
{ "content_hash": "a5b8c981aa7ef630766eca72964f3406", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 137, "avg_line_length": 32, "alnum_prop": 0.7196691176470589, "repo_name": "Azure/azure-sdk-for-python", "id": "82863b982841ffd4bc770ec02eb903b3e3b8cac8", "size": "1556", ...
from eventlet import timeout import mock from oslo_config import cfg import requests from mistral.actions import std_actions from mistral.db.v2 import api as db_api from mistral.db.v2.sqlalchemy import models from mistral.engine import policies from mistral import exceptions as exc from mistral.lang import parser as s...
{ "content_hash": "42c92060716b26271fc60c54703e6b60", "timestamp": "", "source": "github", "line_count": 1730, "max_line_length": 78, "avg_line_length": 26.069364161849713, "alnum_prop": 0.5584922394678492, "repo_name": "StackStorm/mistral", "id": "c1135251207c5655e4f0da80e21320dc8460aabe", "size": ...
from app.models.foo import Foo from app.models.account import Account __all__ = ['Foo', 'Account']
{ "content_hash": "6b9e4e4832c47dbfa4679625aad92184", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 25, "alnum_prop": 0.71, "repo_name": "alexcc4/flask_restful_backend", "id": "09fdafce168a99742d1da38589939a87e0205a34", "size": "148", "binary": fal...
""" @name: Modules/Core/Mqtt/_test/test_mqtt.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2017-2019 by D. Brian Kimmel @license: MIT License @note: Created on Apr 26, 2017 @summary: Test Passed all 11 tests - DBK - 2019-08-15 """ __updated__ = '2020-01-05' # Impor...
{ "content_hash": "f7d749c10aa89b4c3dec8fc5ec4c8c13", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 100, "avg_line_length": 34.07114624505929, "alnum_prop": 0.5964037122969837, "repo_name": "DBrianKimmel/PyHouse", "id": "15df49c4f22710be4cdcc545cb4cb81c0fa53e37", "size":...
import numpy as np from scipy.sparse import coo_matrix, csr_matrix, csc_matrix from scipy.sparse.linalg import spsolve from compmech.logger import * def remove_null_cols(*args, **kwargs): """Remove null rows and cols of a symmetric, square sparse matrix. Parameters ---------- args : list of sparse m...
{ "content_hash": "8757d1b23564963cd7d8578c489c2766", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 78, "avg_line_length": 28.12785388127854, "alnum_prop": 0.5988636363636364, "repo_name": "saullocastro/compmech", "id": "d06cbcd1e400fa751af066ce12191d51c5f0d08b", "size":...
import requests import pprint import sys import sys from getpass import getpass try: from urllib.parse import urlparse from urllib.parse import urljoin except ImportError: from urlparse import urlparse from urlparse import urljoin python_major_version = sys.version_info[0] python_minor_...
{ "content_hash": "f9b2d2f05ed828adae91075ae0ad62bd", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 777, "avg_line_length": 84.51190476190476, "alnum_prop": 0.6195238766023383, "repo_name": "barracudanetworks/waf-automation", "id": "e7c1ad800ee36cadd9cad34c3f87e1540c049740"...
"""Nova base exception handling. Includes decorator for re-raising Nova-type exceptions. SHOULD include dedicated exception logging. """ import functools import sys from oslo.config import cfg import webob.exc from nova.openstack.common import excutils from nova.openstack.common.gettextutils import _ from nova.op...
{ "content_hash": "8461b5a35a84bb1a6a9a900361537e12", "timestamp": "", "source": "github", "line_count": 1553, "max_line_length": 79, "avg_line_length": 28.249839021249194, "alnum_prop": 0.6717496353026987, "repo_name": "afrolov1/nova", "id": "a0c5cae87968e5b76c0daf2d4f888291b42ca2f4", "size": "4460...
from __future__ import unicode_literals """ These URL routings are used by the example `commodity`, `smartcard` and `i18n_smartcard` as found in the django-SHOP's tutorials. This is the simplest way of routing and a good default to start with. """ from django.conf.urls import url from shop.views.catalog import AddToC...
{ "content_hash": "fb1908eaafdcc0bb242ed1d9d6d52fdf", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 97, "avg_line_length": 34.52173913043478, "alnum_prop": 0.7229219143576826, "repo_name": "nimbis/django-shop", "id": "bb94c5eefa43f8037f49032298ae7e53118a8cbd", "size": "81...
"""Interfaces for Pylint objects""" from collections import namedtuple Confidence = namedtuple("Confidence", ["name", "description"]) # Warning Certainties HIGH = Confidence("HIGH", "No false positive possible.") INFERENCE = Confidence("INFERENCE", "Warning based on inference result.") INFERENCE_FAILURE = Confidence( ...
{ "content_hash": "07ae3e6d4146ccce47a4980f4ed34578", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 87, "avg_line_length": 28.67058823529412, "alnum_prop": 0.6840377513336069, "repo_name": "ruchee/vimrc", "id": "e61a049281e0f6a42d4f3a1c5aec457894677615", "size": "3320", ...
import scikits.statsmodels.api as sm import matplotlib.pyplot as plt import numpy as np from scikits.statsmodels.sandbox.survival2 import KaplanMeier #Getting the strike data as an array dta = sm.datasets.strikes.load() print 'basic data' print '\n' dta = dta.values()[-1] print dta[range(5),:] print '\n' #Create the ...
{ "content_hash": "94398a2eaaa02bbc3c434306ab35ae11", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 79, "avg_line_length": 22.206611570247933, "alnum_prop": 0.7082247860066989, "repo_name": "wesm/statsmodels", "id": "0f8d2b42a129704dc75f048e6f3c064c521d7950", "size": "27...
from ..broker import Broker class BasicServicesBroker(Broker): controller = "basic_services" def authenticate(self, **kwargs): """Authenticates the user with NetMRI. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:``...
{ "content_hash": "fc31ce263ee986091fe640b588d426a5", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 380, "avg_line_length": 32.79365079365079, "alnum_prop": 0.5181779068516725, "repo_name": "infobloxopen/infoblox-netmri", "id": "74962599ec42048394abdadb766f1b1c091d4d1b", ...
from oslo_config import cfg from oslo_log import log as logging from oslo_policy import policy from webob import exc as exceptions from murano.common.i18n import _ LOG = logging.getLogger(__name__) CONF = cfg.CONF _ENFORCER = None def reset(): global _ENFORCER if _ENFORCER: _ENFORCER.clear() _...
{ "content_hash": "ff75ffe300e22f16862f13eef82659cc", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 78, "avg_line_length": 28.375, "alnum_prop": 0.6145374449339207, "repo_name": "sajuptpm/murano", "id": "c36225fd253bab307ed0a3db731ba981fcb51178", "size": "2943", "binary...
import json class Filter(dict): def __init__(self, function=None, *args): if function == 'property': self[function] = args[0] else: self[function] = list(args) def __str__(self): return json.dumps(self) And = lambda *args: Filter('and', *args) Or = lambda *args...
{ "content_hash": "0e460e3cab7faf06b9609b69016b6d59", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 56, "avg_line_length": 32.68, "alnum_prop": 0.616891064871481, "repo_name": "tamber/tamber-python", "id": "f5e23231239c4afe8d15c29ddb031fa10789bba0", "size": "817", "bina...
from django.conf import settings from django.utils.module_loading import import_string _handler_class = None def get_handler_class(): """ Get the configured `ievv_i18n_url` handler class. E.g. import the handler class from the class path configured in the ``IEVV_I18N_URL_HANDLER`` setting. Returns...
{ "content_hash": "e25819b90e32972462eebc1279b14a47", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 115, "avg_line_length": 32.62068965517241, "alnum_prop": 0.678646934460888, "repo_name": "appressoas/ievv_opensource", "id": "8865ff3260a8b721a5e67f78ebc7a2ec571a560e", "si...
from google.appengine.api import users import json from raceways.handler import BaseHandler, api_handler, authorized from raceways.client import StravaClient from google.appengine.ext import ndb from raceways import model class StreamsHandler(BaseHandler): @authorized @api_handler @ndb.toplevel def g...
{ "content_hash": "533f74580e605cfdbe4b41e488a89995", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 91, "avg_line_length": 33.638297872340424, "alnum_prop": 0.592662871600253, "repo_name": "alecf/strava-raceways", "id": "1929bcb459f7d06d90a619c1943af23b14162510", "size": ...
""" this calls test_executable_caller as it should be called for the test to work. """ import subprocess if __name__ == '__main__': process = subprocess.Popen( ['python', 'test_executable_caller.py','test_executable_callee.py'], shell = False, universal_newlines = True ) exit_stat...
{ "content_hash": "9730dde5c6b00e5fdc23ba263ca718bf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 26.153846153846153, "alnum_prop": 0.6264705882352941, "repo_name": "cirosantilli/python-utils", "id": "9b978469b0ee8ea75c4e009f4d5522ccfc187a4d", "si...
import imutils def sliding_window(image, stepSize, windowSize): # slide a window across the image for y in xrange(0, image.shape[0], stepSize): for x in xrange(0, image.shape[1], stepSize): # yield the current window yield (x, y, image[y:y + windowSize[1], x:x + windowSize[0]]) def sliding_window_variable_s...
{ "content_hash": "178bb964fb34eb816221ca13d170a301", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 85, "avg_line_length": 42.95, "alnum_prop": 0.6414435389988359, "repo_name": "AKAMobi/goods-counter", "id": "0d5f66500516a7cf8ca25a727e34980cc94a44bf", "size": "860", "bi...
import os from django.conf import settings from django.core.files.storage import FileSystemStorage from django.utils.deconstruct import deconstructible __doc__ = """ I needed to efficiently create a mirror of a directory tree (so that "origin pull" CDNs can automatically pull files). The trick was that some files cou...
{ "content_hash": "9cb09d0c18f714b4108fed01ece94b31", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 81, "avg_line_length": 41.215384615384615, "alnum_prop": 0.706233669279582, "repo_name": "ZuluPro/django-storages", "id": "6432190f877c6ee50d3c89765ec67353329c46ae", "size"...
from azure.identity import DefaultAzureCredential from azure.mgmt.oep import OpenEnergyPlatformManagementServiceAPIs """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-oep # USAGE python energy_services_list_partitions_maximum_set_gen.py Before run the sample, please set the values ...
{ "content_hash": "e197c0881d5d59b97b4e9d45a6c98501", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 171, "avg_line_length": 36.21212121212121, "alnum_prop": 0.7497907949790795, "repo_name": "Azure/azure-sdk-for-python", "id": "0c52073fdf9c58133e5b6f3a956d529f877277c9", "s...
"""Source code analyzer for chalice app. The main point of this module is to analyze your source code and track which AWS API calls you make. We can then use this information to create IAM policies automatically for you. How it Works ============ This is basically a simplified abstract interpreter. The type inferen...
{ "content_hash": "74142f13b22a39e203cbf4e9748ecaf8", "timestamp": "", "source": "github", "line_count": 699, "max_line_length": 79, "avg_line_length": 37.798283261802574, "alnum_prop": 0.5950948109458385, "repo_name": "awslabs/chalice", "id": "9b2f75e37667e3104da7e9e2ab554c93ad40bfd5", "size": "264...
from pyvdp.merchantsearch import VisaMerchantSearchDispatcher def send(data): """Submits a Merchant Search request. :param MerchantSearch data: **Required**. Instance of :func:`~pyvdp.merchantsearch.MerchantSearchData`. :return: A response from VDP. **Usage:** .. code-block:: python ...
{ "content_hash": "6a4b92508b815d908fb137edaf3a7263", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 107, "avg_line_length": 33.32142857142857, "alnum_prop": 0.5096463022508039, "repo_name": "ppokrovsky/pyvdp", "id": "55694d502d3427220ebd4ab10af50e8629b46a32", "size": "186...