repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
trivoldus28/pulsarch-verilog | refs/heads/master | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/cgitb.py | 3 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | build/android/pylib/perf/test_options.py | 28 | # Copyright 2013 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.
"""Defines the PerfOptions named tuple."""
import collections
PerfOptions = collections.namedtuple('PerfOptions', [
'steps',
'flaky_steps',
'ou... |
suiyuan2009/tensorflow | refs/heads/master | tensorflow/python/training/ftrl_test.py | 68 | # 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... |
Soya93/Extract-Refactoring | refs/heads/master | python/lib/Lib/modjy/modjy_response.py | 109 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... |
petrutlucian94/nova | refs/heads/master | nova/tests/unit/scheduler/filters/test_core_filters.py | 38 | # 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... |
duyet-website/api.duyet.net | refs/heads/master | lib/boto/mturk/price.py | 170 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
eayunstack/rally | refs/heads/product | tests/unit/plugins/openstack/context/quotas/test_manila_quotas.py | 17 | # Copyright 2015 Mirantis 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... |
kaerdsar/addons-yelizariev | refs/heads/8.0 | project_default_visibility_followers/__init__.py | 2355 | # -*- coding: utf-8 -*-
import models
|
chaluemwut/fbserver | refs/heads/master | venv/lib/python2.7/site-packages/scipy/signal/setup.py | 10 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('signal', parent_package, top_path)
config.add_data_dir('tests')
config.add_data_dir(... |
mer-tools/git-repo | refs/heads/stable | subcmds/branches.py | 5 | # -*- coding:utf-8 -*-
#
# Copyright (C) 2009 The Android Open Source Project
#
# 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 re... |
forseti-security/forseti-security | refs/heads/master | google/cloud/forseti/common/util/replay.py | 1 | # Copyright 2017 The Forseti Security 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 ap... |
sergiocorato/server-tools | refs/heads/8.0 | log_forwarded_for_ip/models/__init__.py | 17 | # -*- coding: utf-8 -*-
# © 2015 Aserti Global Solutions
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import log_forwarded_for_ip_installed
|
KeyWeeUsr/plyer | refs/heads/master | plyer/platforms/android/audio.py | 6 | from jnius import autoclass
from plyer.facades.audio import Audio
# Recorder Classes
MediaRecorder = autoclass('android.media.MediaRecorder')
AudioSource = autoclass('android.media.MediaRecorder$AudioSource')
OutputFormat = autoclass('android.media.MediaRecorder$OutputFormat')
AudioEncoder = autoclass('android.media.... |
lmregus/Portfolio | refs/heads/master | python/design_patterns/env/lib/python3.7/site-packages/IPython/core/tests/test_inputsplitter.py | 2 | # -*- coding: utf-8 -*-
"""Tests for the inputsplitter module."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import unittest
import sys
import nose.tools as nt
from IPython.core import inputsplitter as isp
from IPython.core.inputtransformer import InputTran... |
saydulk/newfies-dialer | refs/heads/develop | newfies/dnc/migrations/0001_initial.py | 5 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
samueldotj/TeeRISC-Simulator | refs/heads/master | util/checkpoint-tester.py | 63 | #! /usr/bin/env python
# Copyright (c) 2010 Advanced Micro Devices, 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,... |
juandiegoag/Jugador-heur-stico-de-Tetris | refs/heads/master | Cuadricula.py | 1 | __author__ = 'rick9'
# -*- coding: utf-8 -*-
import pygame
import sys
from Movimientos import *
from Tablero import *
from Piezas import *
from Puntaje import *
from Jugadas import evaluarJugadas
from Evolucion import *
from random import randint
import time
import threading
# Definición de const... |
jinnykoo/wuyisj | refs/heads/master | sites/sandbox/apps/gateway/forms.py | 60 | from django import forms
from django.contrib.auth.models import User
from oscar.apps.customer.utils import normalise_email
class GatewayForm(forms.Form):
email = forms.EmailField()
def clean_email(self):
email = normalise_email(self.cleaned_data['email'])
if User.objects.filter(email__iexact... |
cloudflare/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/hello/gyptest-disable-regyp.py | 501 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies that Makefiles don't get rebuilt when a source gyp file changes and
the disable_regeneration generator flag is set.
"""
import... |
nickeubank/python-igraph | refs/heads/master | igraph/test/games.py | 2 | import unittest
from igraph import *
class GameTests(unittest.TestCase):
def testGRG(self):
g = Graph.GRG(50, 0.2)
self.assertTrue(isinstance(g, Graph))
g = Graph.GRG(50, 0.2, True)
self.assertTrue(isinstance(g, Graph))
self.assertTrue("x" in g.vertex_attributes())
s... |
NexusIS/libcloud | refs/heads/trunk | docs/examples/dns/zonomi/instantiate_driver.py | 37 | from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.ZONOMI)
driver = cls('apikey')
|
Telestream/telestream-cloud-python-sdk | refs/heads/master | telestream_cloud_qc_sdk/telestream_cloud_qc/models/must_or_must_not.py | 1 | # coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... |
pipermerriam/django | refs/heads/master | tests/unmanaged_models/tests.py | 296 | from __future__ import unicode_literals
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created w... |
vivekanand1101/anitya | refs/heads/master | runserver.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" The flask application """
## These two lines are needed to run on EL6
__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
import pkg_resources
from anitya.app import APP
if __name__ == '__main__':
APP.debug = True
APP.run()
|
CamelBackNotation/CarnotKE | refs/heads/master | jyhton/out/production/jyhton/test376.py | 13 | """
[ 631035 ] Negative repeat cause java exception.
"""
import support
assert "0"*-1 == ""
|
vriera/micropython | refs/heads/master | tests/basics/bool1.py | 77 | # tests for bool objects
# basic logic
print(not False)
print(not True)
print(False and True)
print(False or True)
# unary operators
print(+True)
print(-True)
# unsupported unary op
try:
len(False)
except TypeError:
print('TypeError')
|
pradyunsg/pip | refs/heads/update-to-libera | src/pip/_internal/operations/build/wheel.py | 6 | import logging
import os
from typing import Optional
from pip._vendor.pep517.wrappers import Pep517HookCaller
from pip._internal.utils.subprocess import runner_with_spinner_message
logger = logging.getLogger(__name__)
def build_wheel_pep517(
name, # type: str
backend, # type: Pep517HookCaller
metadat... |
rghe/ansible | refs/heads/devel | lib/ansible/module_utils/k8s/inventory.py | 7 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... |
gmcquillan/hyde | refs/heads/master | hyde.py | 39 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import optparse
import os
import sys
import hydeengine
PROG_ROOT = os.path.dirname(os.path.realpath( __file__ ))
def main():
parser = optparse.OptionParser(usage="%prog [-f] [-q]", version="%prog 0.5.3")
parser.add_option("-s", "--sitepath",
... |
nerith/servo | refs/heads/master | tests/wpt/harness/wptrunner/hosts.py | 196 | # 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/.
from __future__ import unicode_literals
class HostsLine(object):
def __init__(self, ip_address, canonical_hostname... |
qisanstudio/qsapp-express | refs/heads/master | src/express/views/__init__.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import index
from . import account
from . import bill
from . import knowledge
__all__ = ['index', 'account', 'bill', 'knowledge']
|
ghmajx/asuswrt-merlin | refs/heads/374.43_2-update | release/src/router/samba-3.6.13/lib/subunit/runtests.py | 35 | #!/usr/bin/env python
# -*- Mode: python -*-
#
# Copyright (C) 2004 Canonical.com
# Author: Robert Collins <robert.collins@canonical.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 Foundat... |
darribas/pysal | refs/heads/master | pysal/core/util/shapefile.py | 13 | """
A Pure Python ShapeFile Reader and Writer
This module is selfcontained and does not require pysal.
This module returns and expects dictionary based data strucutres.
This module should be wrapped into your native data strcutures.
Contact:
Charles Schmidt
GeoDa Center
Arizona State University
Tempe, AZ
http://geodac... |
mdmdmdmdmd/plugin.video.youtube | refs/heads/master | resources/lib/youtube/helper/yt_specials.py | 8 | __author__ = 'bromix'
from resources.lib import kodion
from resources.lib.kodion.items import DirectoryItem, UriItem
from resources.lib.youtube.helper import v3, tv, extract_urls, UrlResolver, UrlToItemConverter
from . import utils
def _process_related_videos(provider, context, re_match):
result = []
provid... |
ToonBoxEntertainment/rez | refs/heads/master | src/rezgui/util.py | 7 | from rezgui.qt import QtGui
from rez.utils.formatting import readable_time_duration
import os.path
import time
def create_pane(widgets, horizontal, parent_widget=None, compact=False,
compact_spacing=2):
"""Create a widget containing an aligned set of widgets.
Args:
widgets (list of `Q... |
google-research/google-research | refs/heads/master | bigg/bigg/model/tree_clib/tree_lib.py | 1 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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... |
patrickwind/My_Blog | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/py27compat.py | 958 | """
Compatibility Support for Python 2.7 and earlier
"""
import sys
def get_all_headers(message, key):
"""
Given an HTTPMessage, return all headers matching a given key.
"""
return message.get_all(key)
if sys.version_info < (3,):
def get_all_headers(message, key):
return message.getheaders(key)
|
fldc/CouchPotatoServer | refs/heads/custom | libs/unrar2/rar_exceptions.py | 153 | # Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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... |
fhaoquan/kbengine | refs/heads/master | kbe/src/lib/python/Doc/includes/mp_workers.py | 52 | import time
import random
from multiprocessing import Process, Queue, current_process, freeze_support
#
# Function run by worker processes
#
def worker(input, output):
for func, args in iter(input.get, 'STOP'):
result = calculate(func, args)
output.put(result)
#
# Function used to calculate resu... |
bobsilverberg/Marketplace.Python | refs/heads/master | marketplace/connection.py | 2 | """ Provide connection with Marketplace API
"""
import json
import logging
import time
import urllib
import oauth2 as oauth
import requests
log = logging.getLogger('marketplace.%s' % __name__)
class NotExpectedStatusCode(requests.exceptions.HTTPError):
""" Raise if status code returned from API is not the expe... |
miipl-naveen/optibizz | refs/heads/master | addons/point_of_sale/point_of_sale.py | 9 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
jaxlaw/hadoop-common | refs/heads/yahoo-hadoop-0.20 | src/contrib/hod/hodlib/Common/xmlrpc.py | 182 | #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 use thi... |
f4nt/gmecol | refs/heads/master | gmecol/migrations/0005_auto_20140926_2339.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('gmecol', '0004_auto_20140926_0130'),
]
operations = [
migrations.AlterModelOptions(
name='usergame',
... |
skycucumber/restful | refs/heads/master | python/venv/lib/python2.7/site-packages/werkzeug/_compat.py | 148 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... |
pauloricardomg/cassandra | refs/heads/trunk | pylib/cqlshlib/copyutil.py | 4 | # cython: profile=True
# 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
# "... |
aavanian/bokeh | refs/heads/master | sphinx/source/docs/user_guide/examples/styling_func_tick_formatter.py | 16 | from bokeh.models import FuncTickFormatter
from bokeh.plotting import figure, show, output_file
output_file("formatter.html")
p = figure(plot_width=500, plot_height=500)
p.circle([0, 2, 4, 6, 8, 10], [6, 2, 4, 10, 8, 0], size=30)
p.yaxis.formatter = FuncTickFormatter(code="""
return Math.floor(tick) + " + " + (t... |
Goldmund-Wyldebeast-Wunderliebe/django-diazo | refs/heads/master | django_diazo/apps.py | 1 | import imp
from django.apps import AppConfig
from django.conf import settings
from django_diazo.settings import MODULE_NAME
class DjangoDiazoConfig(AppConfig):
name = 'django_diazo'
label = 'django_diazo'
verbose_name = "Django Diazo"
def ready(self):
"""
Implement this method to run... |
Vixionar/django | refs/heads/master | tests/template_tests/syntax_tests/test_cycle.py | 199 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from ..utils import setup
class CycleTagTests(SimpleTestCase):
libraries = {'future': 'django.templatetags.future'}
@setup({'cycle01': '{% cy... |
duhzecca/cinder | refs/heads/master | cinder/tests/unit/test_backup.py | 3 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... |
OTWillems/GEO1005 | refs/heads/master | TwisterSolutions/utility_functions.py | 1 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
SpatialDecision
A QGIS plugin
This is a SDSS template for the GEO1005 course
-------------------
begin : 2015-11-02
git... |
dsbrown/FreeCAD | refs/heads/master | src/Mod/TemplatePyMod/Commands.py | 18 | # FreeCAD TemplatePyMod module
# (c) 2007 Juergen Riegel LGPL
#
# import FreeCAD modules
import FreeCAD, FreeCADGui,inspect
# helper -------------------------------------------------------------------
def addCommand(name,cmdObject):
(list,num) = inspect.getsourcelines(cmdObject.Activated)
pos = 0
... |
rkmaddox/mne-python | refs/heads/master | mne/label.py | 4 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from collections import defaultdict
from colorsys import hsv_to_rgb, rgb_to_hsv
import copy as cp
import os
import os.path ... |
PetePriority/home-assistant | refs/heads/dev | homeassistant/components/maxcube/binary_sensor.py | 1 | """
Support for MAX! Window Shutter via MAX! Cube.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/maxcube/
"""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.maxcube import DATA_KEY
_LOGG... |
DonBeo/statsmodels | refs/heads/master | statsmodels/datasets/anes96/data.py | 25 | """American National Election Survey 1996"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
http://www.electionstudies.org/
The American National Election Studies.
"""
DESCRSHORT = """This data is a subset of the American National Election Stud... |
llevar/germline-regenotyper | refs/heads/master | examples/scripts/prepare_freebayes_genotyping_config.py | 3 | #!/usr/bin/env python
import sys
import os
import uuid
from time import sleep
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine
from sqlalchemy import or_, and_
import json
import logging
import argparse
import tracker.model.analysis
import tracker.m... |
yoshinorim/mysql-5.6 | refs/heads/fb-mysql-5.6.35 | xtrabackup/test/python/testtools/tests/test_fixturesupport.py | 42 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
import unittest
from testtools import (
TestCase,
content,
content_type,
)
from testtools.helpers import try_import
from testtools.tests.helpers import (
ExtendedTestResult,
)
fixtures = try_import('fixtures')
LoggingFixture ... |
dpodder/coreclr | refs/heads/master | src/scripts/genEventPipe.py | 3 | from __future__ import print_function
from genXplatEventing import *
from genXplatLttng import *
import os
import xml.dom.minidom as DOM
stdprolog = """// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in th... |
chiamingyen/pygroup | refs/heads/master | wsgi/static/Brython2.2.0rc0-20140913-093500/Lib/unittest/result.py | 727 | """Test result object"""
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
... |
stxnext-kindergarten/presence-analizer-rkierzkowski | refs/heads/master | src/presence_analyzer/helpers.py | 59 | # -*- coding: utf-8 -*-
"""
Helper functions used in templates.
"""
|
jobiols/odoo-argentina | refs/heads/9.0 | l10n_ar_account/report/__init__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
# TODO arreglar e incorporar
from . import invoice... |
chyla/pat-lms | refs/heads/master | web/slas-web/util/exception/__init__.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from command_exception import *
|
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/source_control/gitlab_user.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... |
mtarek/BeRTOS | refs/heads/master | wizard/const.py | 8 | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of BeRTOS.
#
# Bertos 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.
#
#... |
motion2015/a3 | refs/heads/a3 | lms/djangoapps/mobile_api/social_facebook/test_utils.py | 104 | """
Test utils for Facebook functionality
"""
import httpretty
import json
from rest_framework.test import APITestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from social.apps.django_app.default.models import UserSocialAuth
from student.models import CourseEnrollment
from st... |
openstack/cliff | refs/heads/master | cliff/tests/test_formatters_csv.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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... |
dmitriyse/pythonnet | refs/heads/master | src/tests/test_module.py | 2 | # -*- coding: utf-8 -*-
"""Test CLR modules and the CLR import hook."""
import clr
import time
import types
import warnings
from fnmatch import fnmatch
import pytest
from ._compat import ClassType, PY2, PY3, range
from .utils import is_clr_class, is_clr_module, is_clr_root_module
# testImplicitAssemblyLoad() pass... |
WarrenWeckesser/scikits-image | refs/heads/master | skimage/future/setup.py | 48 |
def configuration(parent_package='skimage', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('future', parent_package, top_path)
config.add_subpackage('graph')
return config
if __name__ == "__main__":
from numpy.distutils.core import setup
config = co... |
rolandovillca/python_basic_concepts | refs/heads/master | oo/create_object.py | 4 | # Create an Employee class
class Employee:
"""Common base class for all employees"""
emp_count = 0
# Create constructor of class.
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.emp_count += 1
# Define a method
def display_count(self):
... |
jniediek/mne-python | refs/heads/master | mne/datasets/spm_face/__init__.py | 8 | """SPM face dataset
"""
from .spm_data import data_path, has_spm_data, get_version, requires_spm_data
|
Witia1/olympia | refs/heads/master | lib/misc/urlconf_decorator.py | 53 | """
Apply a decorator to a whole urlconf instead of a single view function.
Usage::
>>> from urlconf_decorator import decorate
>>>
>>> def dec(f):
... def wrapper(*args, **kw):
... print 'inside the decorator'
... return f(*args, **kw)
... return wrapper
>>>
... |
OCA/stock-logistics-warehouse | refs/heads/12.0 | stock_orderpoint_mrp_link/tests/__init__.py | 2 | from . import test_stock_orderpoint_mrp_link
|
f-prettyland/angr | refs/heads/master | angr/procedures/stubs/Nop.py | 8 | import angr
######################################
# Doing nothing
######################################
class Nop(angr.SimProcedure):
def run(self):
pass
|
beezee/GAE-Django-site | refs/heads/master | django/contrib/gis/models.py | 624 | from django.db import connection
if (hasattr(connection.ops, 'spatial_version') and
not connection.ops.mysql):
# Getting the `SpatialRefSys` and `GeometryColumns`
# models for the default spatial backend. These
# aliases are provided for backwards-compatibility.
SpatialRefSys = connection.ops.spat... |
nwjs/chromium.src | refs/heads/nw45-log | tools/cr/cr/targets/content_shell.py | 68 | # Copyright 2013 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.
"""Module for the content_shell targets."""
import cr
class ContentShellTarget(cr.NamedTarget):
NAME = 'content_shell'
CONFIG = cr.Config.From(
... |
seize-the-dave/XlsxWriter | refs/heads/master | xlsxwriter/test/workbook/test_write_book_views.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...workbook import Workbook
class TestWriteBookViews(unittest.TestCase):
"""
T... |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | Panda3D-1.10.0/python/Lib/test/subprocessdata/sigchild_ignore.py | 243 | import signal, subprocess, sys, time
# On Linux this causes os.waitpid to fail with OSError as the OS has already
# reaped our child process. The wait() passing the OSError on to the caller
# and causing us to exit with an error is what we are testing against.
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
subprocess.P... |
olafdietsche/scrapy | refs/heads/master | scrapy/http/response/text.py | 98 | """
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import six
from six.moves.urllib.parse import urljoin
from w3lib.encoding import html_to_unicode, resolve_encoding, \... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/parts/odoo/addons/account/tests/test_account_move_closed_period.py | 136 | from datetime import date
from openerp.tests.common import TransactionCase
from openerp.osv.orm import except_orm
class TestPeriodState(TransactionCase):
"""
Forbid creation of Journal Entries for a closed period.
"""
def setUp(self):
super(TestPeriodState, self).setUp()
cr, uid = sel... |
2014c2g4/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py | 742 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... |
briancurtin/libcloud | refs/heads/trunk | docs/examples/compute/cloudsigma/create_server_with_vlan.py | 63 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls('username', 'password', region='zrh', api_version='2.0')
name = 'test node with vlan'
size = driver.list_sizes()[0]
image = driver.list_images()[0]
# 1. Create a VLAN. VLAN... |
programadorjc/django | refs/heads/master | tests/utils_tests/test_dateparse.py | 293 | from __future__ import unicode_literals
import unittest
from datetime import date, datetime, time, timedelta
from django.utils.dateparse import (
parse_date, parse_datetime, parse_duration, parse_time,
)
from django.utils.timezone import get_fixed_timezone
class DateParseTests(unittest.TestCase):
def test_... |
TUD-OS/seoul | refs/heads/master | model/intel82576vf/reg_mmio.py | 6 | # -*- Mode: Python -*-
name = "MMIO"
rset = [
# Normal R/W register
{ 'name' : 'rVTCTRL', 'offset' : 0x0, 'initial' : 0,
'callback' : 'VTCTRL_cb' },
# Normal R/O register
{ 'name' : 'rSTATUS', 'offset' : 0x8, 'initial' : int('10000011',2), # 1GB/s, UP, FD
'read-only' : True },
# Free... |
vongochung/buiquocviet | refs/heads/master | django/utils/tree.py | 103 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
import copy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
Node instances.
"""
# S... |
kakunbsc/enigma2 | refs/heads/master | lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py | 2 | # -*- coding: iso-8859-1 -*-
# (c) 2006 Stephan Reichholf
# This Software is Free, use it where you want, when you want for whatever you want and modify it if you want but don't remove my copyright!
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.MessageBox import MessageBox
f... |
mrquim/mrquimrepo | refs/heads/master | repo/plugin.video.salts/scrapers/rlsbb_scraper.py | 5 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... |
uw-it-aca/spotseeker_server | refs/heads/master | spotseeker_server/views/buildings.py | 1 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
""" Changes
=================================================================
sbutler1@illinois.edu: adapt to the new RESTDispatch framework;
remove needless use of regex.
"""
from spotseeker_server.views.rest_disp... |
marcydoty/geraldo | refs/heads/master | site/newsite/django_1_0/tests/regressiontests/requests/models.py | 281 | # Need a models module for the test runner.
|
yoer/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/multiple_database/models.py | 109 | from __future__ import absolute_import
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class R... |
FHannes/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/messages/tests/middleware.py | 556 | from django import http
from django.contrib.messages.middleware import MessageMiddleware
from django.utils import unittest
class MiddlewareTest(unittest.TestCase):
def setUp(self):
self.middleware = MessageMiddleware()
def test_response_without_messages(self):
"""
Makes sure that the... |
hwangsyin/cbrc-devteam-blog | refs/heads/master | lib/tornado/wsgi.py | 18 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
stenskjaer/scrapy | refs/heads/master | scrapy/linkextractors/__init__.py | 18 | """
scrapy.linkextractors
This package contains a collection of Link Extractors.
For more info see docs/topics/link-extractors.rst
"""
import re
from six.moves.urllib.parse import urlparse
from parsel.csstranslator import HTMLTranslator
from scrapy.utils.misc import arg_to_iter
from scrapy.utils.url import (
ca... |
pdonadeo/django-oscar | refs/heads/master | src/oscar/apps/dashboard/vouchers/app.py | 49 | from django.conf.urls import url
from oscar.core.application import Application
from oscar.core.loading import get_class
class VoucherDashboardApplication(Application):
name = None
default_permissions = ['is_staff', ]
list_view = get_class('dashboard.vouchers.views', 'VoucherListView')
create_view =... |
Eksmo/calibre | refs/heads/master | src/calibre/ebooks/mobi/langcodes.py | 10 | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
from struct import pack
from calibre.utils.localization import lang_as_iso639_1
lang_codes = {
}
main_language = {
0 : "NEUTRAL",
54 : "AFRIKAANS",
... |
tiagocardosos/stoq | refs/heads/master | plugins/optical/medicssearch.py | 2 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2014 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program 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 Fo... |
ChicGeek2/app-inventor-for-android | refs/heads/master | app_inv_game_server/tests/test_custom_modules/__init__.py | 24 | # 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 or agreed to in writing, sof... |
coolkang/hsbsite | refs/heads/master | settings.py | 1 | from __future__ import absolute_import, unicode_literals
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for con... |
nkysg/Asenal | refs/heads/master | script/python/python-ad-0.9/lib/ad/core/exception.py | 4 | #
# This file is part of Python-AD. Python-AD is free software that is made
# available under the MIT license. Consult the file "LICENSE" that is
# distributed together with this file for the exact licensing terms.
#
# Python-AD is copyright (c) 2007 by the Python-AD authors. See the file
# "AUTHORS" for a complete ove... |
borgr/ucca | refs/heads/master | scripts/pickle_to_standard.py | 1 | #!/usr/bin/python3
import argparse
import os
import sys
from ucca.ioutil import file2passage, passage2file
desc = """Parses pickle files in UCCA standard format, and writes them in XML format.
"""
def main():
argparser = argparse.ArgumentParser(description=desc)
argparser.add_argument('filenames', nargs='+'... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/cloud/univention/udm_group.py | 37 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright: (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
# 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... |
GeorgeTG/plex-series-organizer | refs/heads/master | series_orginizer.py | 1 | #!/usr/bin/env python3
LICENSE = """
PlexSeriesOrganizer - A tool to organize your plex series, without moving files.
Copyright (C) 2015 George T. Gougoudis <george_gougoudis@hotmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.