repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
levibostian/myBlanky | refs/heads/master | googleAppEngine/google/appengine/ext/deferred/__init__.py | 15 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
antoinecarme/pyaf | refs/heads/master | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_BestCycle_MLP.py | 1 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['PolyTrend'] , ['BestCycle'] , ['MLP'] ); |
amir-qayyum-khan/lore | refs/heads/master | rest/tests/test_members.py | 2 | """
Unit tests for REST api
"""
from __future__ import unicode_literals
from operator import itemgetter
from django.contrib.auth.models import User
from rest_framework.status import (
HTTP_400_BAD_REQUEST,
HTTP_403_FORBIDDEN,
HTTP_404_NOT_FOUND,
)
from roles.api import (
assign_user_to_repo_group,
... |
carlTLR/gyp | refs/heads/master | test/make_global_settings/full-toolchain/my_nm.py | 203 | #!/usr/bin/env python
# Copyright (c) 2014 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.
import sys
print sys.argv
with open('RAN_MY_NM', 'w') as f:
f.write('RAN_MY_NM')
|
MattCCS/PyVault | refs/heads/master | site-packages/pycparser/_build_tables.py | 79 | #-----------------------------------------------------------------
# pycparser: _build_tables.py
#
# A dummy for generating the lexing/parsing tables and and
# compiling them into .pyc for faster execution in optimized mode.
# Also generates AST code from the configuration file.
# Should be called from the pycparser di... |
codeforamerica/skillcamp | refs/heads/master | ENV/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/oursql.py | 79 | # mysql/oursql.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+oursql
:name: OurSQL
:dbapi: oursql
:connectstring... |
aselle/tensorflow | refs/heads/master | tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_op.py | 29 | # Copyright 2015 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 applicab... |
netsamir/dotfiles | refs/heads/master | files/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/waitress/waitress/tests/fixtureapps/writecb.py | 40 | def app(environ, start_response): # pragma: no cover
path_info = environ['PATH_INFO']
if path_info == '/no_content_length':
headers = []
else:
headers = [('Content-Length', '9')]
write = start_response('200 OK', headers)
if path_info == '/long_body':
write(b'abcdefghij')
... |
mcus/SickRage | refs/heads/master | tests/test_searches.py | 3 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: echel0n <sickrage.tv@gmail.com>
# URL: http://www.github.com/sickragetv/sickrage/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... |
jthelin/rainbowstream | refs/heads/master | rainbowstream/c_image.py | 7 | # -*- coding: utf-8 -*-
from PIL import Image
from os.path import join, dirname, getmtime, exists, expanduser
from .config import *
from .py3patch import *
import ctypes
import sys
import os
def call_c():
"""
Call the C program for converting RGB to Ansi colors
"""
library = expanduser('~/.image.so')... |
darshanthaker/nupic | refs/heads/master | tests/integration/nupic/opf/opf_experiments_test.py | 22 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
denny820909/builder | refs/heads/master | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/package/__init__.py | 28 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
agiovann/Constrained_NMF | refs/heads/master | caiman/source_extraction/cnmf/params.py | 1 | import logging
import numpy as np
import os
import pkg_resources
from pprint import pformat
import scipy
from scipy.ndimage.morphology import generate_binary_structure, iterate_structure
import caiman.utils.utils
from ...paths import caiman_datadir
from .utilities import dict_compare, get_file_size
class CNMFParams(... |
joolswills/plugin.video.youtube | refs/heads/master | resources/lib/youtube/youtube_exceptions.py | 27 | from resources.lib import kodion
__author__ = 'bromix'
class LoginException(kodion.KodionException):
pass
class YouTubeException(kodion.KodionException):
pass
|
wfxiang08/django197 | refs/heads/master | django/db/migrations/operations/models.py | 48 | from __future__ import unicode_literals
from django.db import models
from django.db.migrations.operations.base import Operation
from django.db.migrations.state import ModelState
from django.db.models.options import normalize_together
from django.utils import six
from django.utils.functional import cached_property
cl... |
mavit/ansible | refs/heads/devel | lib/ansible/modules/network/system/net_ping.py | 55 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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_version': '1.1',
... |
LinusU/ansible | refs/heads/devel | lib/ansible/plugins/strategy/free.py | 47 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 License, or
# (at your option) an... |
dexterx17/nodoSocket | refs/heads/master | clients/Python-2.7.6/Lib/test/crashers/borrowed_ref_1.py | 168 | """
_PyType_Lookup() returns a borrowed reference.
This attacks the call in dictobject.c.
"""
class A(object):
pass
class B(object):
def __del__(self):
print 'hi'
del D.__missing__
class D(dict):
class __missing__:
def __init__(self, *args):
pass
d = D()
a = A()
a.cy... |
caveman-dick/ansible | refs/heads/devel | lib/ansible/modules/crypto/openssl_privatekey.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# 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_version': '... |
2014cdbg4/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/sre_constants.py | 692 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
seeminglee/pyglet64 | refs/heads/master | tests/window/WINDOW_STYLE_TOOL.py | 30 | #!/usr/bin/env python
'''Test that window style can be tool.
Expected behaviour:
One tool-styled window will be opened.
Close the window to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import unittest
from pygl... |
GGoussar/scikit-image | refs/heads/master | skimage/morphology/tests/test_ccomp.py | 11 | import numpy as np
from numpy.testing import assert_array_equal, run_module_suite
from skimage.measure import label
import skimage.measure._ccomp as ccomp
from skimage._shared._warnings import expected_warnings
# Background value
BG = 0
class TestConnectedComponents:
def setup(self):
self.x = np.array([... |
souravsingh/sympy | refs/heads/master | sympy/holonomic/tests/test_recurrence.py | 33 | from sympy.holonomic.recurrence import RecurrenceOperators, RecurrenceOperator
from sympy import symbols, ZZ, QQ
def test_RecurrenceOperator():
n = symbols('n', integer=True)
R, Sn = RecurrenceOperators(QQ.old_poly_ring(n), 'Sn')
assert Sn*n == (n + 1)*Sn
assert Sn*n**2 == (n**2+1+2*n)*Sn
assert S... |
pdellaert/ansible | refs/heads/devel | lib/ansible/plugins/connection/qubes.py | 47 | # Based on the buildah connection plugin
# Copyright (c) 2017 Ansible Project
# 2018 Kushal Das
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
#
# Written by: Kushal Das (https://github.com/kushaldas)
from __future__ import (absolute_import, division, print... |
joeythesaint/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/python/test/test_versions.py | 7 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
from cStringIO import StringIO
from twisted.python.versions import getVersionString, IncomparableVersions
from twisted.python.versions import Version, _inf
from twisted.python.filepath import FilePath
from twisted.trial import unittes... |
gangadharkadam/smrtfrappe | refs/heads/develop | frappe/core/doctype/page_role/__init__.py | 2292 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
misdoro/python-ase | refs/heads/master | ase/gui/ag.py | 2 | from __future__ import print_function
# Copyright 2008, 2009
# CAMd (see accompanying license files for details).
from __future__ import print_function
import sys
from optparse import OptionParser
import ase.gui.i18n
from gettext import gettext as _
# Grrr, older versions (pre-python2.7) of optparse have a bug
# whic... |
totallybradical/temp_servo2 | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/constants.py | 141 | from . import utils
content_types = utils.invert_dict({"text/html": ["htm", "html"],
"application/json": ["json"],
"application/xhtml+xml": ["xht", "xhtm", "xhtml"],
"application/xml": ["xml"],
... |
ArneBab/pypyjs | refs/heads/master | website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/lib-scriptpackages/Terminal/Terminal_Suite.py | 82 | """Suite Terminal Suite: Terms and Events for controlling the Terminal application
Level 1, version 1
Generated from /Applications/Utilities/Terminal.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'trmx'
class Terminal_Suite_Events:
def GetURL(self, _object, _a... |
huiren/ece511 | refs/heads/master | src/arch/arm/kvm/ArmKvmCPU.py | 38 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/mini/multiclusters/paths/multi_path51.py | 1 | import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster1'],
[TestAction.change_vm_ha, 'vm1'],
[TestAction.create_vm_... |
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/nmbs/sensor.py | 3 | """Get ride details and liveboard details for NMBS (Belgian railway)."""
import logging
from pyrail import iRail
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_NA... |
mhrivnak/pulp | refs/heads/master | server/pulp/server/exceptions.py | 2 | from datetime import timedelta
from gettext import gettext as _
from pprint import pformat
import httplib
from pulp.common import error_codes, auth_utils
class PulpException(Exception):
"""
Base exception class for Pulp.
Provides base class __str__ and data_dict implementations
"""
http_status_c... |
prakritish/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_facts.py | 70 | #!/usr/bin/python
# 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 License, or
# (at your option) any later version.
#
# Ansible is distributed... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/local_modules/frontend_base/tests/test_res_industry.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... |
wonder-sk/QGIS | refs/heads/master | scripts/qgis_fixes/fix_absolute_import.py | 77 | from libfuturize.fixes.fix_absolute_import import FixAbsoluteImport as FixAbsoluteImportOrig
class FixAbsoluteImport(FixAbsoluteImportOrig):
def probably_a_local_import(self, imp_name):
if imp_name.startswith(u"PyQt"):
return False
if imp_name == "AlgorithmsTestBase":
retu... |
baylee/django | refs/heads/master | django/contrib/postgres/aggregates/general.py | 419 | from django.db.models.aggregates import Aggregate
__all__ = [
'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'StringAgg',
]
class ArrayAgg(Aggregate):
function = 'ARRAY_AGG'
def convert_value(self, value, expression, connection, context):
if not value:
return []
return v... |
RealImpactAnalytics/airflow | refs/heads/master | airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py | 9 | # -*- coding: utf-8 -*-
#
# 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
#... |
Blue-Lightning-Rom/external_chromium | refs/heads/jb-mr1 | testing/gtest/scripts/fuse_gtest_files.py | 2577 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
nikolay-fedotov/networking-cisco | refs/heads/master | networking_cisco/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_topology_agent.py | 20 | # Copyright (c) 2014 Cisco Systems
# 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 require... |
bastianeicher/0repo | refs/heads/master | repo/registry.py | 3 | # Copyright (C) 2013, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from __future__ import print_function
import json
from zeroinstall import SafeException
from zeroinstall.support import basedir
def lookup(uri, missing_ok = False):
"""Search repositories.json for the repository w... |
emfcamp/micropython | refs/heads/tilda-master | tests/basics/fun3.py | 119 | # function with large number of arguments
def fun(a, b, c, d, e, f, g):
return a + b + c * d + e * f * g
print(fun(1, 2, 3, 4, 5, 6, 7))
|
JohnVinyard/zounds | refs/heads/master | zounds/timeseries/test_constantrate.py | 1 | import unittest2
from .constantrate import ConstantRateTimeSeries
from zounds.core import ArrayWithUnits, IdentityDimension
from zounds.timeseries import TimeDimension, Seconds, Milliseconds, TimeSlice
import numpy as np
class ConstantRateTimeSeriesTests(unittest2.TestCase):
def test_raises_when_not_array_with_u... |
wwj718/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_view_authentication.py | 89 | import datetime
import pytz
from django.core.urlresolvers import reverse
from mock import patch
from nose.plugins.attrib import attr
from courseware.access import has_access
from courseware.tests.helpers import CourseAccessTestMixin, LoginEnrollmentTestCase
from courseware.tests.factories import (
BetaTesterFacto... |
ewiseblatt/spinnaker | refs/heads/master | dev/buildtool/__main__.py | 3 | # Copyright 2017 Google Inc. 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 applicable law or a... |
ncareol/lrose-soloPy | refs/heads/master | lrose_solopy/radial_demo.py | 1 | # *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2014
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
# ** See LICENSE.TXT for license detai... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.4/django/conf/locale/te/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =... |
nikhiljan93/sony_yuga_kernel | refs/heads/rebase | 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... |
kerneltask/micropython | refs/heads/master | tests/basics/builtin_hasattr.py | 23 | class A:
var = 132
def __init__(self):
self.var2 = 34
def meth(self, i):
return 42 + i
a = A()
print(hasattr(a, "var"))
print(hasattr(a, "var2"))
print(hasattr(a, "meth"))
print(hasattr(a, "_none_such"))
print(hasattr(list, "foo"))
class C:
def __getattr__(self, attr):
if ... |
ribag/ganeti-experiments | refs/heads/topic-cli-quote | lib/rapi/client_utils.py | 11 | #
#
# Copyright (C) 2010 Google Inc.
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... |
atosatto/ansible | refs/heads/devel | lib/ansible/module_utils/urls.py | 11 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
francisar/rds_manager | refs/heads/master | aliyun/api/rest/Mkvstore20150301DeactivateInstanceRequest.py | 1 | '''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Mkvstore20150301DeactivateInstanceRequest(RestApi):
def __init__(self,domain='m-kvstore.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.InstanceId = None
def getapiname(self):
return 'm-kvstore.aliyuncs.com.Dea... |
hockeybuggy/sudoku_solver | refs/heads/master | python/tests/test_puzzle.py | 1 | import os
from unittest import TestCase
from ..sudoku_solver.puzzle import Puzzle
from ..sudoku_solver.puzzle import GroupFactory
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
class PuzzleTestCase(TestCase):
def setUp(self):
return Puzzle([str(x) for x in range(64)])
def test_puzzle(self):... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/mixedreality/azure-mixedreality-authentication/tests/_constants.py | 1 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# Fake ac... |
doismellburning/edx-platform | refs/heads/master | common/djangoapps/student/management/commands/set_superuser.py | 95 | """Management command to grant or revoke superuser access for one or more users"""
from optparse import make_option
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
"""Management command to grant or revoke superuser access f... |
iniju/ankidroid-triage | refs/heads/master | mapreduce/lib/pipeline/util.py | 43 | #!/usr/bin/env python
#
# Copyright 2010 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 o... |
EmanueleCannizzaro/scons | refs/heads/master | test/TEX/PDFTEXCOM.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
nattee/cafe-grader-web | refs/heads/master | lib/assets/Lib/reprlib.py | 19 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
... |
RevelSystems/django | refs/heads/master | docs/_ext/literals_to_xrefs.py | 42 | """
Runs through a reST file looking for old-style literals, and helps replace them
with new-style references.
"""
import re
import shelve
import sys
refre = re.compile(r'``([^`\s]+?)``')
ROLES = (
'attr',
'class',
"djadmin",
'data',
'exc',
'file',
'func',
'lookup',
'meth',
'm... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.2/Lib/ctypes/test/test_repr.py | 170 | from ctypes import *
import unittest
subclasses = []
for base in [c_byte, c_short, c_int, c_long, c_longlong,
c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong,
c_float, c_double, c_longdouble, c_bool]:
class X(base):
pass
subclasses.append(X)
class X(c_char):
pass
# This test check... |
RDXT/django-guardian | refs/heads/devel | guardian/utils.py | 2 | """
django-guardian helper functions.
Functions defined within this module should be considered as django-guardian's
internal functionality. They are **not** guaranteed to be stable - which means
they actual input parameters/output type may change in future releases.
"""
from __future__ import unicode_literals
import ... |
an7oine/WinVHS | refs/heads/master | Cygwin/lib/python2.7/multifile.py | 313 | """A readline()-style interface to the parts of a multipart message.
The MultiFile class makes each part of a multipart message "feel" like
an ordinary file, as long as you use fp.readline(). Allows recursive
use, for nested multipart messages. Probably best used together
with module mimetools.
Suggested use:
real... |
majidaldo/ansible | refs/heads/devel | v2/ansible/playbook/role/definition.py | 24 | # (c) 2014 Michael DeHaan, <michael@ansible.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 License, or
# (at your option) any later ve... |
papados/ordersys | refs/heads/master | Lib/site-packages/django/contrib/sessions/backends/db.py | 101 | import logging
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils import timezone
from django.utils.encoding import force_text
class SessionStore(SessionBase):
... |
snowcloud/engine-groups | refs/heads/master | engine_groups/views.py | 1 | from django.conf import settings
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from mongoengine.bas... |
liulion/mayavi | refs/heads/master | docs/source/mayavi/auto/protein.py | 4 | """
Visualize a protein graph structure downloaded from the protein database in
standard pdb format.
We parse the pdb file, but extract only a very small amount of
information: the type of atoms, their positions, and the links between them.
Most of the complexity of this example comes from the code turning the
PDB in... |
dawnpower/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/258_placeholder.py | 200 | # 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, software
# d... |
tectronics/photivo | refs/heads/master | scons-local-2.2.0/SCons/Options/PackageOption.py | 14 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# 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
... |
lixiangning888/whole_project | refs/heads/master | modules/signatures_orginal_20151110/martians_ie.py | 1 | # Copyright (C) 2015 Will Metcalf (william.metcalf@gmail.com)
#
# This program 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.
#
# This... |
nafex/pyload | refs/heads/stable | module/plugins/hoster/BillionuploadsCom.py | 15 | # -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class BillionuploadsCom(DeadHoster):
__name__ = "BillionuploadsCom"
__type__ = "hoster"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?billionuploads\.com/\w{12}... |
duqiao/django | refs/heads/master | tests/flatpages_tests/test_models.py | 342 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.flatpages.models import FlatPage
from django.test import SimpleTestCase
from django.test.utils import override_script_prefix
class FlatpageModelTests(SimpleTestCase):
def test_get_absolute_url_urlencodes(self):
pf = Fla... |
ddico/odoo | refs/heads/master | addons/sms/wizard/sms_cancel.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, fields, models
class SMSCancel(models.TransientModel):
_name = 'sms.cancel'
_description = 'Dismiss notification for resend by model'
model = fields.Char(string='Model', required=T... |
ros/ros | refs/heads/noetic-devel | core/roslib/src/roslib/resources.py | 1 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... |
xiaozhuchacha/OpenBottle | refs/heads/master | action_earley_srv/scripts/nltk/test/childes_fixt.py | 28 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
def setup_module(module):
from nose import SkipTest
import nltk.data
try:
nltk.data.find('corpora/childes/data-xml/Eng-USA-MOR/')
except LookupError as e:
print(e)
raise SkipTest("The CHILDES corpus is not found. "
... |
aarora79/sitapt | refs/heads/master | sitapt/visualize/wc.py | 1 | import pandas as pd
df = pd.read_csv('applications.csv')
df = df[df.columns[1:]]
mean = df.mean()
mean.sort_values(inplace=True, ascending=False)
mean[:100].to_csv('appl_mean.csv')
df2 = pd.read_csv('appl_mean.csv', names=['application', 'percentage'])
df2.to_csv('appl_top100.csv', index=False)
df = pd.read_csv('p... |
rlskoeser/loris | refs/heads/development | misc/openjpeg_transform.py | 3 |
# Here's why we can't use PIL's API for OpenJPEG
# See http://pillow.readthedocs.org/en/latest/handbook/image-file-formats.html#jpeg-2000
import timeit
import subprocess
from PIL import Image
from PIL.ImageFile import Parser
import subprocess
import sys
def mk_tile_with_PIL():
jp2_with_tiles_fp = '../tests/img/01/02... |
monash-merc/cvl-fabric-launcher | refs/heads/master | pyinstaller-2.1/PyInstaller/depend/utils.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
TeamExodus/external_chromium_org | refs/heads/EXODUS-5.1 | build/android/pylib/instrumentation/test_runner.py | 25 | # 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.
"""Class for running instrumentation tests on a single device."""
import logging
import os
import re
import sys
import time
from pylib import constants... |
argentumproject/electrum-arg | refs/heads/master | gui/kivy/uix/dialogs/wallets.py | 1 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum_arg_gui.kivy.i18n import _
from electrum_arg.util import base_units
import os
from label_dialog import LabelDialog
Builder.load_string('''
#:import os os
<WalletDialog@Popu... |
jcftang/ansible | refs/heads/devel | lib/ansible/errors/__init__.py | 40 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 License, or
# (at your option) an... |
WQuanfeng/wagtail | refs/heads/master | wagtail/tests/testapp/migrations/0006_image_file_size.py | 23 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tests', '0005_streampage'),
]
operations = [
migrations.AddField(
model_name='customimagewithadminformfields',
... |
40223247/2015test2-1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/tokenize.py | 728 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... |
drawquest/drawquest-web | refs/heads/master | website/compressor/filters/css_default.py | 3 | import os
import re
import posixpath
from compressor.cache import get_hexdigest, get_hashed_mtime
from compressor.conf import settings
from compressor.filters import FilterBase, FilterError
from compressor.utils import staticfiles
URL_PATTERN = re.compile(r'url\(([^\)]+)\)')
class CssAbsoluteFilter(FilterBase):
... |
kustodian/ansible | refs/heads/devel | test/integration/targets/module_utils/other_mu_dir/facts.py | 294 | data = 'should not be visible facts.py'
|
thaumos/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_devtestlabvirtualnetwork.py | 15 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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_version': '1.1',
... |
atsao72/sympy | refs/heads/master | sympy/polys/tests/test_orthopolys.py | 124 | """Tests for efficient functions for generating orthogonal polynomials. """
from sympy import Poly, S, Rational as Q
from sympy.utilities.pytest import raises
from sympy.polys.orthopolys import (
jacobi_poly,
gegenbauer_poly,
chebyshevt_poly,
chebyshevu_poly,
hermite_poly,
legendre_poly,
l... |
gromez/Sick-Beard | refs/heads/development | lib/imdb/Movie.py | 126 | """
Movie module (imdb package).
This module provides the Movie class, used to store information about
a given movie.
Copyright 2004-2010 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the F... |
48thct2jtnf/P | refs/heads/master | qa/rpc-tests/receivedby.py | 164 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework import BitcoinTestFramework
from bitcoinrpc.auth... |
ESS-LLP/frappe | refs/heads/develop | frappe/utils/file_lock.py | 22 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
'''
File based locking utility
'''
import os
from time import time
from frappe.utils import get_site_path, touch_file
class LockTimeoutError(Exception):
pass
def create_lo... |
jkorell/PTVS | refs/heads/master | Python/Tests/TestData/DragDropCopyCutPaste/!Source/DraggedToOtherProject.py | 18 | #DraggedToOtherProject.py |
cleverhans-lab/cleverhans | refs/heads/master | cleverhans_v3.1.0/cleverhans/model_zoo/soft_nearest_neighbor_loss/SNNL_regularized_train.py | 1 | """
This model shows how to train a model with Soft Nearest Neighbor Loss
regularization. The paper which presents this method can be found at
https://arxiv.org/abs/1902.01889
"""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_func... |
leotrs/graph_homotopy | refs/heads/master | generate_graphs.py | 1 | """
generate_graphs.py
------------------
Generate small synthetic graphs whose complete CLD will be computed.
"""
import cycles
import numpy as np
import networkx as nx
from numpy import arange
def is_valid(graph):
"""Return whether the graph is valid to run experiments on."""
rank = cycles.fundamental_gr... |
UIKit0/shaka-player | refs/heads/master | third_party/gjslint/closure_linter-2.3.13/closure_linter/common/erroraccumulator.py | 264 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... |
caguado/boinc-v2 | refs/heads/master | test/test_exit.py | 24 | #!/usr/bin/env python
## $Id$
# Make sure server hears that client exited with nonzero status.
from test_uc import *
class WorkExit(WorkUC):
def __init__(self):
WorkUC.__init__(self)
self.wu_template = "uc_exit_wu"
class ResultExit(ResultUCError):
def __init__(self):
ResultUCError._... |
bkpathak/HackerRank-Problems | refs/heads/master | collections/binary_trees/identical_tree.py | 2 | class Node(object):
def __init__(self,x):
self.val = x
self.left = None
self.right = None
def is_identical(root1, root2):
if root1 == None and root2 == None:
return True
if root1 != None and root2 != None:
return (root1.val == root2.val and
is_identical(root1... |
ankit-collective/ggrc-core | refs/heads/master | src/ggrc/login/common.py | 4 | """Handle the interface to GGRC models for all login methods.
"""
from ggrc import db
from ggrc.models.person import Person
def find_user_by_id(id):
"""Find Person object by some ``id``.
Note that ``id`` need not be Person().id, but should match the value
returned by ``Person().get_id()``.
"""
return Person... |
martinwicke/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/fifo_queue_test.py | 7 | # Copyright 2015 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... |
charbeljc/account-financial-tools | refs/heads/8.0 | account_fiscal_position_vat_check/__openerp__.py | 6 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Fiscal Position VAT Check module for Odoo
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free softw... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/quest/corellia/corellia_38_meatlump_armor.py | 85615 | import sys
def setup(core, object):
return |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/ship/attachment/engine/shared_decimator_engine_s01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/engine/shared_decimator_engine_s01.iff"
result.attr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.