repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tiagochiavericosta/edx-platform | refs/heads/master | common/djangoapps/django_locale/tests.py | 81 | # pylint: disable=invalid-name, line-too-long, super-method-not-called
"""
Tests taken from Django upstream:
https://github.com/django/django/blob/e6b34193c5c7d117ededdab04bb16caf8864f07c/tests/regressiontests/i18n/tests.py
"""
from django.conf import settings
from django.test import TestCase, RequestFactory
from djang... |
sonuyos/couchpotato | refs/heads/master | libs/apscheduler/jobstores/base.py | 145 | """
Abstract base class that provides the interface needed by all job stores.
Job store methods are also documented here.
"""
class JobStore(object):
def add_job(self, job):
"""Adds the given job from this store."""
raise NotImplementedError
def update_job(self, job):
"""Persists the ... |
friedrich420/S4-AEL-GPE-LOLLIPOP | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
maelnor/cinder | refs/heads/master | cinder/tests/backup/fake_rados.py | 2 | # Copyright 2013 Canonical Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
muff1nman/duplicity | refs/heads/master | duplicity/statistics.py | 2 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
tiagochiavericosta/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/__init__.py | 160 | """Third party authentication. """
from microsite_configuration import microsite
def is_enabled():
"""Check whether third party authentication has been enabled. """
# We do this import internally to avoid initializing settings prematurely
from django.conf import settings
return microsite.get_value(... |
OptimusGitEtna/RestSymf | refs/heads/master | Python-3.4.2/Lib/ctypes/_endian.py | 99 | import sys
from ctypes import *
_array_type = type(Array)
def _other_endian(typ):
"""Return the type with the 'other' byte order. Simple types like
c_int and so on already have __ctype_be__ and __ctype_le__
attributes which contain the types, for more complicated types
arrays and structures are suppo... |
EaseCloud/wechatpy | refs/heads/master | wechatpy/enterprise/__init__.py | 12 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.enterprise.parser import parse_message # NOQA
from wechatpy.enterprise.replies import create_reply # NOQA
from wechatpy.enterprise.crypto import WeChatCrypto # NOQA
from wechatpy.enterprise.client import WeChatClient # N... |
jpippy/pyo | refs/heads/master | embedded/openframeworks/PyoTemplate/scripts/stereoDelay.py | 12 | # Get the input sound and apply a stereo delay + reverb on it.
st_input = Input([0,1])
st_delay = Delay(st_input, delay=[.4, .5], feedback=0.7)
st_rev = WGVerb(st_delay, feedback=0.8, cutoff=4000, bal=0.25).out()
|
Sing-Li/go-buildpack | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/test/seq_tests.py | 103 | """
Tests common to tuple, list and UserList.UserList
"""
import unittest
import sys
# Various iterables
# This is used for checking the constructor (here and in test_deque.py)
def iterfunc(seqn):
'Regular generator'
for i in seqn:
yield i
class Sequence:
'Sequence using __getitem__'
def __in... |
s40523116/2016fallcp_hw | refs/heads/gh-pages | plugin/liquid_tags/test_generation.py | 306 | # -*- coding: utf-8 -*-
from __future__ import print_function
import filecmp
import os
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import pytest
from pelican import Pelican
from pelican.settings import read_settings
from .notebook import IPYTHON_VERSION
PLUGIN_DIR = os.path.dirname(__file... |
sinkuri256/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/utils.py | 61 | # -*- test-case-name: twisted.test.test_iutils -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility methods.
"""
import sys, warnings
from twisted.internet import protocol, defer
from twisted.python import failure, util as tputil
try:
import cStringIO as StringIO
exc... |
rob356/SickRage | refs/heads/master | lib/send2trash/plat_other.py | 68 | # Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
# This is a reimplementation of plat_ot... |
oskar456/youtube-dl | refs/heads/master | youtube_dl/extractor/tudou.py | 50 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TudouPlaylistIE(InfoExtractor):
IE_NAME = 'tudou:playlist'
_VALID_URL = r'https?://(?:www\.)?tudou\.com/listplay/(?P<id>[\w-]{11})\.html'
_TESTS = [{
'url': 'http://www.tudou.com/listplay/zzdE77v6Mmo.... |
ryosuzuki/crowdsource-platform | refs/heads/develop2 | crowdsourcing/migrations/oauth2_provider/0001_initial.py | 23 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oauth2_provider.validators
import oauth2_provider.generators
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.A... |
chiviak/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/automation/moviemeter.py | 38 | from couchpotato.core.helpers.rss import RSS
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.automation.base import Automation
log = CPLog(__name__)
autoload = 'Moviemeter'
class Moviemeter(Automation, RSS):
interval = 1800
rss_url = 'http://www.moviemeter.nl/rss/cinem... |
asm-products/movie-database-service | refs/heads/master | ani/lib/python2.7/site-packages/django/db/models/options.py | 104 | from __future__ import unicode_literals
import re
from bisect import bisect
import warnings
from django.conf import settings
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
from django.db.mode... |
kaixinjxq/crosswalk-test-suite | refs/heads/master | apptools/apptools-android-tests/apptools/CI/manifest_basic.py | 12 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
doismellburning/edx-platform | refs/heads/master | lms/djangoapps/certificates/urls.py | 56 | """
URLs for the certificates app.
"""
from django.conf.urls import patterns, url
from django.conf import settings
from certificates import views
urlpatterns = patterns(
'',
# Certificates HTML view
url(
r'^user/(?P<user_id>[^/]*)/course/{course_id}'.format(course_id=settings.COURSE_ID_PATTERN),... |
NicolasHerin/game_book_share | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
GLolol/variety | refs/heads/master | tests/TestImageFetcher.py | 1 | #!/usr/bin/python2
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (c) 2012, Peter Levi <peterlevi@peterlevi.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as publishe... |
alxgu/ansible | refs/heads/devel | lib/ansible/modules/system/aix_lvg.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Kairo Araujo <kairo@kairo.eti.br>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_vers... |
ammaradil/fibonacci | refs/heads/master | Lib/site-packages/psycopg2/tests/test_types_basic.py | 7 | #!/usr/bin/env python
#
# types_basic.py - tests for basic types conversions
#
# Copyright (C) 2004-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundatio... |
vijayendrabvs/ssl-neutron | refs/heads/master | neutron/tests/unit/vmware/nsxlib/test_l2gateway.py | 3 | # Copyright (c) 2014 VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
eldho5505/OOP | refs/heads/master | dice.py | 2 | from random import randint
import time
# rolls n dice, reports results
def roll(n):
tally = [0, 0, 0, 0, 0, 0]
for i in range(n):
r = randint(0, 5)
tally[r] += 1
return tally
def main():
n = 0
while n <= 0:
n = int(input("How many dice would you like to roll? "))
... |
Centre-Alt-Rendiment-Esportiu/att | refs/heads/master | old_project/Python/win_libs/numpy/fft/fftpack.py | 35 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... |
sloot14/flexifod | refs/heads/master | simplejson/tests/test_float.py | 136 | import math
from unittest import TestCase
import simplejson as json
class TestFloat(TestCase):
def test_floats(self):
for num in [1617161771.7650001, math.pi, math.pi**100,
math.pi**-100, 3.1]:
self.assertEquals(float(json.dumps(num)), num)
self.assertEquals(jso... |
gauthierm/bedrock | refs/heads/master | tests/functional/contribute/test_stories.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.contribute.stories import ContributeStoriesPage
@pytest.mark.sanity
@pytest.mark.nondestruct... |
ArthySundaram/chromeos-3.8 | refs/heads/chromeos-3.8 | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
tarunkapadia93/gk_a6k | refs/heads/gk-r2 | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
prman-pixar/RenderManForBlender | refs/heads/master | rman_bl_nodes/rman_bl_nodes_props.py | 2 | import bpy
from bpy.props import PointerProperty, StringProperty, BoolProperty, \
EnumProperty, IntProperty, FloatProperty, FloatVectorProperty, \
CollectionProperty, BoolVectorProperty
from .. import rman_bl_nodes
from .. import rfb_icons
from ..rfb_utils.shadergraph_utils import is_renderman_nodetree
from ..r... |
icio/github3.py | refs/heads/develop | tests/integration/test_repos_deployment.py | 11 | """Deployment integration tests."""
import github3
from .helper import IntegrationHelper
def find(func, iterable):
"""Helper function to find the first item in an interable."""
return next(iter(filter(func, iterable)))
class TestDeployment(IntegrationHelper):
"""Integration tests for the Deployment cl... |
robscetury/gibson | refs/heads/master | lib/gibson/physics/__init__.py | 1 | try:
import pyximport
pyximport.install()
from gibson.physics.spring import *
print "Got the cython spring!"
except:
print "Cython not installed"
from gibson.physics.pyspring import *
|
rotemtam/pi-mac-monitor | refs/heads/master | install_on_pi/push_data.py | 1 | import subprocess, StringIO, csv
from simplejson import dumps
from firebase import Firebase
from time import sleep, time
firebase = Firebase('https://<your_app>.firebaseio.com/stations')
def fetch_data():
# get the newest capture.csv file, then use awk to get only Station data
cmd = r"cat /tmp/`ls -Ar... |
lilleswing/deepchem | refs/heads/master | examples/sweetlead/sweet.py | 5 | """
Script that loads random forest models trained on the sider and tox21 datasets,
predicts on sweetlead, creates covariance matrix
@Author Aneesh Pappu
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import sys
import numpy as np
import pan... |
Technorip/Myntra | refs/heads/master | Django Backend/myntra/env/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py | 20 | """
Accessors for related objects.
When a field defines a relation between two models, each model class provides
an attribute to access related instances of the other model class (unless the
reverse accessor has been disabled with related_name='+').
Accessors are implemented as descriptors in order to customize acces... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/avro-1.7.6/build/lib/avro/txipc.py | 73 | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
Evervolv/android_external_chromium_org | refs/heads/kitkat | base/allocator/prep_libc.py | 30 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script takes libcmt.lib for VS2005/08/10 and removes the allocation
# related functions from it.
#
# Usage: prep_libc.py <... |
karroje/RAIDER_eval | refs/heads/master | redhawk.py | 1 | ############################################################################
# phRAIDER is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
bmanojlovic/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_vmkernel.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
remik/django-page-cms | refs/heads/master | pages/tests/test_selenium.py | 1 | # -*- coding: utf-8 -*-
"""Django page CMS selemium test module"""
from pages.models import Page
from pages.tests.testcase import TestCase
from pages import settings
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.contrib import auth
from selenium import webdriver
fr... |
ToToL/libprelude | refs/heads/master | bindings/tests/load.py | 4 | #!/usr/bin/python
import sys
sys.path.append('.')
sys.path.append('./.libs')
try:
import PreludeEasy
except Exception,e:
print "Import failed: ",e
print "Try 'cd ./.libs && ln -s libprelude_python.so _PreludeEasy.so'"
sys.exit(1)
idmef = PreludeEasy.IDMEF()
idmef.ReadFromFile("foo.bin")
idmef.PrintToStdout()
|
mdanielwork/intellij-community | refs/heads/master | python/testData/postfix/while/topLevel.py | 39 | True.while<caret> |
2013Commons/HUE-SHARK | refs/heads/master | apps/hbase/src/hbase/conf.py | 2 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
utkbansal/kuma | refs/heads/master | kuma/users/migrations/0003_auto_20150722_1242.py | 8 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
import kuma.core.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
('users', '0002_auto_20150722_1240'),
]
op... |
henrytao-me/openerp.positionq | refs/heads/master | openerp/workflow/instance.py | 61 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Srisai85/scipy | refs/heads/master | scipy/fftpack/fftpack_version.py | 122 | from __future__ import division, print_function, absolute_import
major = 0
minor = 4
micro = 3
fftpack_version = '%(major)d.%(minor)d.%(micro)d' % (locals())
|
SimVascular/VTK | refs/heads/master | ThirdParty/Twisted/twisted/test/test_socks.py | 41 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocol.socks}, an implementation of the SOCKSv4 and
SOCKSv4a protocols.
"""
import struct, socket
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, address, re... |
yashodhank/erpnext | refs/heads/develop | erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProductionPlanSalesOrder(Document):
pass |
stefanopanella/xapi-storage-plugins | refs/heads/master | libs/poolhelper.py | 1 | from xapi.storage import log
import XenAPI
def get_online_host_refs(dbg, session):
# This function is borrowed from xapi-project/sm.git/util.py
online_hosts = []
hosts = session.xenapi.host.get_all_records()
for host_ref, host_rec in hosts.iteritems():
metrics_ref = host_rec["metrics"]
... |
abaheti/rabbitvcs | refs/heads/master | rabbitvcs/ui/remotes.py | 3 | #
# This is an extension to the Nautilus file manager to allow better
# integration with the Subversion source control system.
#
# Copyright (C) 2006-2008 by Jason Field <jason@jasonfield.com>
# Copyright (C) 2007-2008 by Bruce van der Kooij <brucevdkooij@gmail.com>
# Copyright (C) 2008-2010 by Adam Plumb <adamplumb@... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/fixes/fix_apply.py | 315 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... |
jm-begon/scikit-learn | refs/heads/master | sklearn/tree/tree.py | 113 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... |
PetePriority/home-assistant | refs/heads/dev | tests/components/upnp/__init__.py | 42 | """Tests for the IGD component."""
|
krvajalmiguelangel/krvajalmiguelangel.github.io | refs/heads/master | node_modules/node-gyp/gyp/gyptest.py | 1752 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... |
dgovil/AdvancedPythonForMaya | refs/heads/master | Scene/characterRoot.py | 1 | # Again, the node we're defining isn't available under the new api, so we must use the old one
import os
from maya import OpenMaya as om
from maya import OpenMayaMPx as ompx
# A custom transform must inherit from the MPxTransform node
class CharacterRoot(ompx.MPxTransform):
kNodeName = 'characterRoot'
kNodeID... |
geBros-master/GBSdk | refs/heads/master | Assets/GB/Editor/post_process.py | 2 | #!/usr/bin/env python
# Open Source mod_pbxproj.py
# https://github.com/kronenthaler/mod-pbxproj
# mode_pbxproj.py mod_pbxproj3.py
# This module can read, modify, and write a .pbxproj file from an Xcode project.
# The file is usually called project.pbxproj and can be found inside the .xcodeproj bundle.
# Last writte... |
slivingston/flymovieformat | refs/heads/master | motmot/FlyMovieFormat/playfmf.py | 1 | #!/usr/bin/env python
import sys, time, os, gc, datetime, warnings
from optparse import OptionParser
import pkg_resources # from setuptools
matplotlibrc = pkg_resources.resource_filename(__name__,"matplotlibrc") # trigger extraction
matplotlibrc_dir = os.path.split(matplotlibrc)[0]
os.environ['MATPLOTLIBRC'] = matplot... |
Medigate/cutiuta-server | refs/heads/master | cutiuta-server/env/lib/python3.4/site-packages/wheel/__main__.py | 565 | """
Wheel command line tool (enable python -m wheel syntax)
"""
import sys
def main(): # needed for console script
if __package__ == '':
# To be able to run 'python wheel-0.9.whl/wheel':
import os.path
path = os.path.dirname(os.path.dirname(__file__))
sys.path[0:0] = [path]
imp... |
akiss77/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 44 | import base64
import cgi
import Cookie
import StringIO
import tempfile
from six.moves.urllib.parse import parse_qsl, urlsplit
from . import stash
from .utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configurat... |
JavaRabbit/CS496_capstone | refs/heads/master | appengine/standard/localtesting/task_queue_test.py | 9 | # Copyright 2015 Google Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
risicle/django | refs/heads/master | tests/auth_tests/test_basic.py | 328 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.core.exceptions import ImproperlyConfigured
from django.dispatch import... |
Reagankm/KnockKnock | refs/heads/master | venv/lib/python3.4/site-packages/nltk/test/unit/test_seekable_unicode_stream_reader.py | 27 | # -*- coding: utf-8 -*-
"""
The following test performs a random series of reads, seeks, and
tells, and checks that the results are consistent.
"""
from __future__ import absolute_import, unicode_literals
import random
import functools
from io import BytesIO
from nltk.corpus.reader import SeekableUnicodeStreamReader
d... |
DarthMaulware/EquationGroupLeaks | refs/heads/master | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/status/cmd/devicequery/type_Params.py | 1 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Params.py
from types import *
import array
PARAMS_DEVICE_TYPE_USER_SPECIFIC = 0
PARAMS_DEVICE_TYPE_U1394 = 1
PARAMS_DEVICE_TYPE_ADAPTER = 2
PARA... |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | refs/heads/master | data/24 toyota/parseJSON.py | 26 |
def getSocialData(post):
# Get Thread Object
threadObject = post["thread"]
domain_rank = threadObject["domain_rank"] #domain_rank
#print 'domain_rank:' + str(domain_rank)
socialObject = threadObject["social"] #social data object
facebookData = socialObject["facebook"] #facebook data
#print 'facebook data... |
sdgdsffdsfff/jumpserver | refs/heads/master | apps/assets/api/admin_user.py | 1 | # ~*~ coding: utf-8 ~*~
# Copyright (C) 2014-2018 Beijing DuiZhan Technology Co.,Ltd. All Rights Reserved.
#
# Licensed under the GNU General Public License v2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.gnu.org/licens... |
apple/llvm-project | refs/heads/llvm.org/main | lldb/test/API/tools/lldb-server/TestGdbRemoteAttach.py | 5 | import gdbremote_testcase
import lldbgdbserverutils
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteAttach(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
def test_attach_with_vAttach(self... |
yaroslavprogrammer/django | refs/heads/master | django/core/urlresolvers.py | 30 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import re
from threading impo... |
WholeGrainGoats/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_sanitizer.py | 430 | from __future__ import absolute_import, division, unicode_literals
try:
import json
except ImportError:
import simplejson as json
from html5lib import html5parser, sanitizer, constants, treebuilders
def toxmlFactory():
tree = treebuilders.getTreeBuilder("etree")
def toxml(element):
# encode... |
Ziqi-Li/bknqgis | refs/heads/master | pandas/scripts/pypistats.py | 7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Calculates the total number of downloads that a particular PyPI package has
received across all versions tracked by PyPI
"""
from datetime import datetime
import locale
import sys
import xmlrpclib
import pandas as pd
locale.setlocale(locale.LC_ALL, '')
class PyPIDo... |
aselle/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/autoregressive_test.py | 21 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
openhatch/oh-mainline | refs/heads/master | mysite/profile/migrations/0030_remove_dead_columns_from_profile_person.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... |
lily-seabreeze/sappho | refs/heads/master | demo/config.py | 3 | """Configuration constants for Sappho demo."""
import pkg_resources
# Constants/game config
# The path to the file that's being used to represent the player
ANIMATED_SPRITE_PATH = pkg_resources.resource_filename("test_scene", "test.gif")
# The path to the file being used as the tilesheet
TILESHEET_PATH = pkg_resourc... |
renzoolivares/android_kernel_htc_monarudo | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
Ballz0fSteel/Umeko | refs/heads/master | lib/youtube_dl/extractor/aenetworks.py | 23 | from __future__ import unicode_literals
import re
from .theplatform import ThePlatformIE
from ..utils import (
smuggle_url,
update_url_query,
unescapeHTML,
extract_attributes,
get_element_by_attribute,
)
from ..compat import (
compat_urlparse,
)
class AENetworksBaseIE(ThePlatformIE):
_TH... |
kiran/bart-sign | refs/heads/master | venv/lib/python2.7/site-packages/numpy/lib/type_check.py | 72 | """Automatically adapted for numpy Sep 19, 2005 by convertcode.py
"""
from __future__ import division, absolute_import, print_function
__all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex',
'isreal', 'nan_to_num', 'real', 'real_if_close',
'typename', 'asfarray', 'mintypecode', 'asscalar',
... |
pieterdp/helptux | refs/heads/master | db_repository/manage.py | 263 | #!/usr/bin/env python
from migrate.versioning.shell import main
if __name__ == '__main__':
main()
|
alfredtofu/thrift | refs/heads/master | lib/py/src/server/TServer.py | 50 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
andymckay/zamboni | refs/heads/master | mkt/prices/admin.py | 21 | from django.contrib import admin
from mkt.prices.models import Price, PriceCurrency
admin.site.register(Price)
admin.site.register(PriceCurrency)
|
tmerrick1/spack | refs/heads/develop | var/spack/repos/builtin/packages/json-glib/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
orbitfp7/nova | refs/heads/master | nova/spice/__init__.py | 72 | #!/usr/bin/env python
# Copyright (c) 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
alquerci/cyg-apt | refs/heads/master | src/cygapt/test/case/exception.py | 2 | # -*- coding: utf-8 -*-
######################## BEGIN LICENSE BLOCK ########################
# This file is part of the cygapt package.
#
# Copyright (C) 2002-2009 Jan Nieuwenhuizen <janneke@gnu.org>
# 2002-2009 Chris Cormie <cjcormie@gmail.com>
# 2012 James Nylen <jnylen... |
fusion809/fusion809.github.io-old | refs/heads/master | vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/simplejson/simplejson/tests/test_float.py | 136 | import math
from unittest import TestCase
import simplejson as json
class TestFloat(TestCase):
def test_floats(self):
for num in [1617161771.7650001, math.pi, math.pi**100,
math.pi**-100, 3.1]:
self.assertEquals(float(json.dumps(num)), num)
self.assertEquals(jso... |
jmanday/Master | refs/heads/master | TFM/library/opencv-3.2.0/samples/python/houghcircles.py | 5 | #!/usr/bin/python
'''
This example illustrates how to use cv2.HoughCircles() function.
Usage:
houghcircles.py [<image_name>]
image argument defaults to ../data/board.jpg
'''
# Python 2/3 compatibility
from __future__ import print_function
import cv2
import numpy as np
import sys
if __name__ == '__main__':
... |
tallstreet/jaikuenginepatch | refs/heads/master | api/tests.py | 1 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
ctk3b/mbuild | refs/heads/master | docs/conf.py | 3 | # -*- coding: utf-8 -*-
#
# mbuild documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 1 08:59:12 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
incaser/odoo-odoo | refs/heads/8.0 | addons/payment_transfer/models/__init__.py | 437 | # -*- coding: utf-8 -*-
import payment_acquirer
|
malishevg/edugraph | refs/heads/master | common/lib/xmodule/xmodule/tabs.py | 10 | """
Implement CourseTab
"""
# pylint: disable=incomplete-protocol
# Note: pylint complains that we do not implement __delitem__ and __len__, although we implement __setitem__
# and __getitem__. However, the former two do not apply to the CourseTab class so we do not implement them.
# The reason we implement the latter... |
Jumpers/MysoftAutoTest | refs/heads/master | Step1-PythonBasic/Practices/yuxq/1-5/ex1.py | 1 | print "Hello World!"
print "Hello Again"
print "I Like typing this."
print "This is fun."
print "Yay! Printing."
print "I'd much rather you 'not'."
print 'I "said" do not touch this.' |
NeCTAR-RC/nova | refs/heads/nectar/mitaka | nova/api/openstack/compute/hosts.py | 10 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
tkf/emacs-ipython-notebook | refs/heads/master | tools/testein.py | 1 | #!/usr/bin/env python
"""
Run EIN test suite
"""
import sys
import os
import glob
from subprocess import Popen, PIPE, STDOUT
import itertools
EIN_ROOT = os.path.normpath(
os.path.join(os.path.dirname(__file__), os.path.pardir))
def has_library(emacs, library):
"""
Return True when `emacs` has build-in ... |
peterm-itr/edx-platform | refs/heads/master | common/djangoapps/util/bad_request_rate_limiter.py | 200 | """
A utility class which wraps the RateLimitMixin 3rd party class to do bad request counting
which can be used for rate limiting
"""
from ratelimitbackend.backends import RateLimitMixin
class BadRequestRateLimiter(RateLimitMixin):
"""
Use the 3rd party RateLimitMixin to help do rate limiting on the Password ... |
timeyyy/apptools | refs/heads/master | peasoup/util.py | 1 | """
peasoup.util: misc utility functions for peasoup
"""
import sys
import os
# Since Peaoup will have
# every invocation, we want as little overhead as possible when importing
# the main module. We therefore use a simple lazy-loading scheme for many
# of our imports, built from the functions below.
def laz... |
METASPACE2020/sm-engine | refs/heads/master | sm/engine/mol_db.py | 2 | from collections import OrderedDict
import pandas as pd
import logging
import requests
from sm.engine.db import DB
from sm.engine.util import SMConfig
logger = logging.getLogger('engine')
SF_INS = 'INSERT INTO sum_formula (db_id, sf) values (%s, %s)'
SF_COUNT = 'SELECT count(*) FROM sum_formula WHERE db_id = %s'
SF_... |
megraf/asuswrt-merlin | refs/heads/master | release/src/router/nfs-utils/tools/nfs-iostat/nfs-iostat.py | 16 | #!/usr/bin/env python
# -*- python-mode -*-
"""Emulate iostat for NFS mount points using /proc/self/mountstats
"""
__copyright__ = """
Copyright (C) 2005, Chuck Lever <cel@netapp.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as... |
jgeskens/django | refs/heads/master | tests/admin_scripts/custom_templates/project_template/additional_dir/extra.py | 701 | # this file uses the {{ extra }} variable
|
HyperloopTeam/FullOpenMDAO | refs/heads/master | lib/python2.7/site-packages/matplotlib/projections/geo.py | 11 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.axes import Axes
from matplotlib import cbook
from matplotlib.patches import C... |
android-ia/platform_external_chromium_org | refs/heads/master | tools/telemetry/telemetry/web_perf/metrics/mainthread_jank_stats_unittest.py | 55 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.timeline import model as model_module
from telemetry.timeline import async_slice
from telemetry.web_perf import timeline_inte... |
fpy171/django | refs/heads/master | django/contrib/redirects/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class RedirectsConfig(AppConfig):
name = 'django.contrib.redirects'
verbose_name = _("Redirects")
|
RENCI/xDCIShare | refs/heads/xdci-develop | hs_tracking/__init__.py | 4 | default_app_config = 'hs_tracking.apps.HSTrackingAppConfig'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.