repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
looker/sentry | src/sentry/south_migrations/0216_auto__add_groupsnooze.py | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GroupSnooze'
db.create_table(
'sentry_groupsno... |
eunchong/build | third_party/buildbot_8_4p1/buildbot/test/unit/test_db_buildrequests.py | # 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... |
dracos/django | django/shortcuts.py | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from dj... |
alex/sqlalchemy | test/base/test_dependency.py | from sqlalchemy.util import topological
from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing.util import conforms_partial_ordering
from sqlalchemy import exc
from sqlalchemy.testing import fixtures
class DependencySortTest(fixtures.TestBase):
def assert_sort(self, tuples, allitems=None):
... |
laonawuli/addrest | web2py/applications/admin/controllers/default.py | # -*- coding: utf-8 -*-
EXPERIMENTAL_STUFF = True
MAXNFILES = 1000
if EXPERIMENTAL_STUFF:
if is_mobile:
response.view = response.view.replace('default/', 'default.mobile/')
response.menu = []
import re
from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon... |
daishichao/elephas | examples/ml_mlp.py | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, Adam, RMSprop
from keras.utils import np_utils
from elephas.ml... |
zxtstarry/src | book/rsf/rsf/gui/gui.py | #!/usr/bin/env python
import os, sys
try:
from Tkinter import *
except:
sys.stderr.write('Please install Tkinter!\n\n')
sys.exit(1)
root = Tk()
root.title('Wavelet Demo')
wtype = StringVar()
wtype.set('b')
type_frame = Frame(root,relief=SUNKEN,borderwidth=2)
type_frame.pack(side=TOP,fill=X)
Label(type_... |
MSusik/invenio | invenio/modules/records/testsuite/functions/get_modification_date.py | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... |
michellemorales/OpenMM | models/lfads/utils.py | # 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... |
dockerera/func | test/unittest/test_groups_api.py | from func.overlord.groups import Groups,get_hosts_spec
from certmaster.config import read_config, CONFIG_FILE
from certmaster.commonconfig import CMConfig
import os
import fnmatch
from func.overlord.group.conf_backend import ConfBackend
from func.overlord.group.sqlite_backend import SqliteBackend
TEST_DB_FILE = "/tm... |
eri-trabiccolo/exaile | xl/__init__.py | # Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
lmcro/webserver | admin/CTK/CTK/Plugin.py | # CTK: Cherokee Toolkit
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.... |
freerangerouting/frr | tests/topotests/bgp_dont_capability_negogiate/test_bgp_dont_capability_negotiate.py | #!/usr/bin/env python
# Copyright (c) 2021 by
# Donatas Abraitis <donatas.abraitis@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# T... |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/completion/definition.py | """
Fallback to callee definition when definition not found.
- https://github.com/davidhalter/jedi/issues/131
- https://github.com/davidhalter/jedi/pull/149
"""
"""Parenthesis closed at next line."""
# Ignore these definitions for a little while, not sure if we really want them.
# python <= 2.5
#? isinstance
isinsta... |
vineodd/PIMSim | GEM5Simulation/gem5/tests/gem5/__init__.py | # Copyright (c) 2017 Mark D. Hill and David A. Wood
# 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 of conditio... |
andrius-preimantas/purchase-workflow | purchase_request_to_requisition/tests/test_purchase_request_to_requisition.py | # -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests import common
from openerp.tools import SUPERUSER_ID
class TestPurchaseRequestToRequisition(common.TransactionCase):
def setUp(self):
super(Te... |
tiexinliu/odoo_addons | smile_log/tools/db_logger.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... |
EmreAtes/spack | var/spack/repos/builtin/packages/viennarna/package.py | ##############################################################################
# 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... |
tst-mswartz/earthenterprise | earth_enterprise/src/server/wsgi/search/plugin/poi_search_app.py | #!/usr/bin/env python2.7
#
# Copyright 2017 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 l... |
bswartz/manila | manila/tests/cmd/test_api.py | # 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 applicable law or a... |
punalpatel/st2 | st2actions/tests/unit/test_rescheduler.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
rhdedgar/openshift-tools | scripts/monitoring/cron-send-create-app.py | #!/usr/bin/env python
""" Create application check for v3 """
# We just want to see any exception that happens
# don't want the script to die under any cicumstances
# script must try to clean itself up
# pylint: disable=broad-except
# main() function has a lot of setup and error handling
# pylint: disable=too-many-st... |
tboyce021/home-assistant | homeassistant/components/fitbit/sensor.py | """Support for the Fitbit API."""
import datetime
import logging
import os
import time
from fitbit import Fitbit
from fitbit.api import FitbitOauth2Client
from oauthlib.oauth2.rfc6749.errors import MismatchingStateError, MissingTokenError
import voluptuous as vol
from homeassistant.components.http import HomeAssistan... |
jbedorf/tensorflow | tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py | # Copyright 2018 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... |
marinkaz/orange3 | Orange/widgets/tests/test_settings_handler.py | from io import BytesIO
import os
import pickle
from tempfile import mkstemp
import unittest
from unittest.mock import patch, Mock
import warnings
from Orange.widgets.settings import SettingsHandler, Setting, SettingProvider
class SettingHandlerTestCase(unittest.TestCase):
@patch('Orange.widgets.settings.SettingPr... |
guorendong/iridium-browser-ubuntu | tools/telemetry/telemetry/util/find_dependencies.py | # 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 fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from teleme... |
anusornc/vitess | test/queryservice_tests/stream_tests.py | import json
import threading
import time
import traceback
import urllib
from vtdb import cursor
from vtdb import dbexceptions
import environment
import framework
class TestStream(framework.TestCase):
def tearDown(self):
self.env.conn.begin()
self.env.execute("delete from vtocc_big")
self.env.conn.commi... |
jennolsen84/PyTables | tables/scripts/pttree.py | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: November 8, 2014
# Author: Alistair Muldal - alimuldal@gmail.com
#
# $Id$
#
########################################################################
"""This utility prints the contents of an H... |
wdv4758h/ZipPy | lib-python/3/pickletools.py | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... |
blankclemens/tools-iuc | data_managers/data_manager_hisat2_index_builder/data_manager/hisat2_index_builder.py | #!/usr/bin/env python
# Based heavily on the Bowtie 2 data manager wrapper script by Dan Blankenberg
from __future__ import print_function
import argparse
import os
import shlex
import subprocess
import sys
from json import dumps, loads
DEFAULT_DATA_TABLE_NAME = "hisat2_indexes"
def get_id_name( params, dbkey, fast... |
engdan77/edoAutoHomeMobile | twisted/trial/test/test_script.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import StringIO
import gc
import re
import sys
import textwrap
import types
from twisted.trial import unittest
from twisted.trial.runner import (
TrialRunner, TestSuite, DestructiveTestSuite, TestLoader)
from twisted.trial._dist.disttrial imp... |
spcui/autotest | client/deps/mysql/mysql.py | #!/usr/bin/python
import os
from autotest.client import utils
version = 3
def setup(tarball, topdir):
srcdir = os.path.join(topdir, 'src')
if not os.path.exists(tarball):
utils.get_file('http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.45.tar.gz', tarball)
utils.extract_tarball_to_dir(tarb... |
oskopek/did | did/plugins/wiki.py | # coding: utf-8
"""
MoinMoin wiki stats about updated pages
Config example::
[wiki]
type = wiki
wiki test = http://moinmo.in/
"""
import xmlrpclib
from did.utils import item
from did.base import Config
from did.stats import Stats, StatsGroup
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
bigmonachus/Delaunay | site_scons/site_tools/scons_qt4/test/ts_qm/noclean/sconstest-noclean.py | #!/usr/bin/env python
#
# Copyright (c) 2001-2010 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 use,... |
jeremiahyan/odoo | addons/mail/models/ir_model.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class IrModel(models.Model):
_inherit = 'ir.model'
_order = 'is_mail_thread DESC, name ASC'
is_mail_thread = fields.Boolean(
... |
gjlawran/ckanext-bcgov | ckanext/bcgov/scripts/load_orgs.py | # Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
import os
import sys
import json
import urllib2
import urllib
from base import (create_org, site_url, api_key)
def create_org_members(id, members):
for member in members :
data_di... |
LLNL/spack | var/spack/repos/builtin/packages/py-pickleshare/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPickleshare(PythonPackage):
"""Tiny 'shelve'-like database with concurrency support"""
... |
tensorflow/tensorflow | tensorflow/python/framework/function_def_to_graph_test.py | # Copyright 2018 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... |
weolar/miniblink49 | third_party/WebKit/Source/bindings/scripts/code_generator_v8.py | # Copyright (C) 2013 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 of conditions and the ... |
andersk/zulip | zerver/webhooks/freshdesk/tests.py | from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
class FreshdeskHookTests(WebhookTestCase):
STREAM_NAME = "freshdesk"
URL_TEMPLATE = "/api/v1/external/freshdesk?stream={stream}"
WEBHOOK_DIR_NAME = "freshdesk"
def test_ticket_creation(self) -> None:
... |
yiheng/BigDL | spark/dl/src/test/resources/tf/models/tensor_array.py | #
# Copyright 2016 The BigDL 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 applicable law or agreed to in ... |
tensorflow/tensorflow | tensorflow/python/debug/lib/common.py | # 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... |
mikea/appengine-mapreduce | python/src/mapreduce/mock_webapp.py | #!/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... |
tboyce021/home-assistant | homeassistant/components/zwave/node_entity.py | """Entity class that represents Z-Wave node."""
# pylint: disable=import-outside-toplevel
from itertools import count
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_ENTITY_ID, ATTR_WAKEUP
from homeassistant.core import callback
from homeassistant.helpers.device_registry import async_get_registry as get_dev_r... |
wagnerand/zamboni | apps/reviews/models.py | from datetime import datetime, timedelta
import logging
from django.conf import settings
from django.core.cache import cache
from django.db import models
import bleach
from celeryutils import task
from tower import ugettext_lazy as _
import amo.models
from amo.helpers import shared_url
from translations.fields impor... |
DonBeo/statsmodels | statsmodels/duration/tests/test_phreg.py | import os
import numpy as np
from statsmodels.duration.hazard_regression import PHReg
from numpy.testing import (assert_allclose,
assert_equal)
import pandas as pd
# TODO: Include some corner cases: data sets with empty strata, strata
# with no events, entry times after censoring times,... |
ehein6/stinger | util/flask/test/test_algorithms.py | import argparse
import cPickle as pickle
import colorama as color
import csv
import json
import os
import requests
import sys
import time
from time import gmtime, strftime
# test_algorithms has two modes of operation:
# 1. Create reference output of algorithms
# 2. Validate current algorithm results against refere... |
staranjeet/fjord | vendor/packages/requests-2.7.0/requests/packages/chardet/euctwprober.py | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
DESHRAJ/fjord | vendor/packages/nose/unit_tests/test_core.py | import os
import sys
import unittest
from cStringIO import StringIO
from optparse import OptionParser
import nose.core
from nose.config import Config
from nose.tools import set_trace
from mock import Bucket, MockOptParser
class NullLoader:
def loadTestsFromNames(self, names):
return unittest.TestSuite()
... |
jmchilton/galaxy-central | modules/docutils/languages/sv.py | # Author: Adam Chodorowski
# Contact: chodorowski@users.sourceforge.net
# Revision: $Revision: 2224 $
# Date: $Date: 2004-06-05 21:40:46 +0200 (Sat, 05 Jun 2004) $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# re... |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/PIL/ImageColor.py | #
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... |
zlorb/mitmproxy | pathod/language/generators.py | import os
import string
import random
import mmap
import sys
DATATYPES = dict(
ascii_letters=string.ascii_letters.encode(),
ascii_lowercase=string.ascii_lowercase.encode(),
ascii_uppercase=string.ascii_uppercase.encode(),
digits=string.digits.encode(),
hexdigits=string.hexdigits.encode(),
octdi... |
Distrotech/yum-utils | plugins/tsflags/tsflags.py | # 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 in the hope that it will be useful,... |
UpYou/relay | my_gnuradio/gr/hier_block2.py | #
# Copyright 2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later versi... |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sympy/polys/domains/sympyrealdomain.py | """Implementation of :class:`SymPyRealDomain` class. """
from sympy.polys.domains.realdomain import RealDomain
from sympy.polys.domains.groundtypes import SymPyRealType
class SymPyRealDomain(RealDomain):
"""Domain for real numbers based on SymPy Float type. """
dtype = SymPyRealType
zero = dtype(0)
... |
shabab12/edx-platform | lms/djangoapps/course_api/blocks/transformers/proctored_exam.py | """
Proctored Exams Transformer
"""
from django.conf import settings
from edx_proctoring.api import get_attempt_status_summary
from edx_proctoring.models import ProctoredExamStudentAttemptStatus
from openedx.core.lib.block_structure.transformer import BlockStructureTransformer, FilteringTransformerMixin
class Proct... |
vrenaville/project-service | project_issue_baseuser/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis, 2013
#
# 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, eith... |
arth-co/shoop | shoop_tests/utils/test_analog.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db import models
from shoop.utils.analog import define_log_model... |
JackDanger/sentry | src/sentry/web/forms/edit_organization_member.py | from __future__ import absolute_import
from sentry.models import (
AuditLogEntry,
AuditLogEntryEvent,
)
from sentry.web.forms.base_organization_member import BaseOrganizationMemberForm
class EditOrganizationMemberForm(BaseOrganizationMemberForm):
def save(self, actor, organization, ip_address=None):
... |
archifix/settings | sublime/Packages/SublimeCodeIntel/libs/codeintel2/lang_less.py | #!/usr/bin/env python
# Copyright (c) 2010 ActiveState Software Inc.
# See LICENSE.txt for license details.
"""Less support for CodeIntel"""
import logging
from codeintel2.common import _xpcom_
from codeintel2.lang_css import CSSLexer, CSSLangIntel, CSSBuffer
from codeintel2.lang_css import isident, WHITESPACE
from ... |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/test/testall.py | import sys, os
import re
import unittest
import traceback
import pywin32_testutil
# A list of demos that depend on user-interface of *any* kind. Tests listed
# here are not suitable for unattended testing.
ui_demos = """GetSaveFileName print_desktop win32cred_demo win32gui_demo
win32gui_dialog win32gui_... |
pgoeser/gnuradio | gnuradio-examples/python/digital/benchmark_qt_rx2.py | #!/usr/bin/env python
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... |
esthermm/odoomrp-wip | mrp_repair_full_editable/models/mrp_repair.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class MrpRepair(... |
huangciyin/youtube-dl | youtube_dl/extractor/noco.py | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
compat_str,
)
class NocoIE(InfoExtractor):
_VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)'
... |
lukecwik/incubator-beam | learning/katas/python/test_helper.py | # 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"); y... |
bp-kelley/rdkit | Data/Pains/test_data/run_tests.py | #
# Copyright (C) 2015 Greg Landrum
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
import unittest, os, csv
from rdkit import Chem, RDConfig
class TestCase(unittest.Test... |
bp-kelley/rdkit | rdkit/ML/UnitTestBuildComposite.py | # $Id$
#
# Copyright (C) 2003-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code ... |
sysbot/pastedown | vendor/pygments/pygments/lexers/asm.py | # -*- coding: utf-8 -*-
"""
pygments.lexers.asm
~~~~~~~~~~~~~~~~~~~
Lexers for assembly languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL... |
newvem/pytz | pytz/zoneinfo/Asia/Rangoon.py | '''tzinfo timezone information for Asia/Rangoon.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Rangoon(DstTzInfo):
'''Asia/Rangoon timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Rangoon'
_utc_... |
Agent007/deepchem | examples/low_data/tox_rf_one_fold.py | """
Train low-data Tox21 models with random forests. Test last fold only.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import tempfile
import numpy as np
import deepchem as dc
from datasets import load_tox21_ecfp
from sklearn.ensemble import RandomFo... |
ccilab/binutils | gdb/testsuite/gdb.python/py-mi-objfile-gdb.py | # Copyright (C) 2015-2016 Free Software Foundation, 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 3 of the License, or
# (at your option) any later version.
#
# This progr... |
ligo-cbc/pycbc | pycbc/tmpltbank/option_utils.py | # Copyright (C) 2013 Ian W. Harry
#
# 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 program is distributed in t... |
crmccreary/openerp_server | openerp/addons/import_google/wizard/import_google_data.py | # -*- 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... |
manevant/django-oscar | src/oscar/apps/promotions/models.py | from django.db import models
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.contrib.c... |
chrxr/wagtail | wagtail/contrib/wagtailapi/utils.py | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.utils.six.moves.urllib.parse import urlparse
from wagtail.wagtailcore.models import Page
class BadRequestError(Exception):
pass
def get_base_url(request=None):
base_url = getattr(settings, 'WAGTAILAPI_BAS... |
zestrada/nova-cs498cc | nova/virt/hyperv/snapshotops.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
# 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.ap... |
BladeSmithJohn/nixysa | nixysa/cpp_utils_unittest.py | #!/usr/bin/python2.4
#
# Copyright 2008 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... |
jjkoletar/panda3d | direct/src/extensions/ConfigVariable-extensions.py |
def __str__(self):
return self.getStringValue()
def __hash__(self):
raise AttributeError, "ConfigVariables are not immutable."
def ls(self):
from pandac.Notify import Notify
self.write(Notify.out())
def __int__(self):
return int(self.getValue())
def __lon... |
devGregA/code | scrapy/tests/test_spidermanager/__init__.py | import sys
import os
import shutil
from zope.interface.verify import verifyObject
from twisted.trial import unittest
# ugly hack to avoid cyclic imports of scrapy.spider when running this test
# alone
from scrapy.interfaces import ISpiderManager
from scrapy.spidermanager import SpiderManager
from scrapy.http import ... |
glogiotatidis/mozillians-new | vendor-local/lib/python/kombu/tests/transport/test_amqplib.py | from __future__ import absolute_import
import sys
from kombu.transport import amqplib
from kombu.connection import BrokerConnection
from kombu.tests.utils import TestCase
from kombu.tests.utils import mask_modules, Mock
class MockConnection(dict):
def __setattr__(self, key, value):
self[key] = value
... |
apavlo/h-store | third_party/python/boto/roboto/awsqueryservice.py | import os
import urlparse
import boto
import boto.connection
import boto.jsonresponse
import boto.exception
import awsqueryrequest
class NoCredentialsError(boto.exception.BotoClientError):
def __init__(self):
s = 'Unable to find credentials'
boto.exception.BotoClientError.__init__(self, s)
class ... |
ashang/calibre | src/calibre/gui2/actions/show_template_tester.py | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.template_dialog import TemplateDialog
from cal... |
zestrada/nova-cs498cc | nova/tests/api/openstack/compute/test_api.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 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.apach... |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/jupyter_core/migrate.py | from __future__ import unicode_literals
"""Migrating IPython < 4.0 to Jupyter
This *copies* configuration and resources to their new locations in Jupyter
Migrations:
- .ipython/
- nbextensions -> JUPYTER_DATA_DIR/nbextensions
- kernels -> JUPYTER_DATA_DIR/kernels
- .ipython/profile_default/
- static/custom -... |
ligo-cbc/pycbc | pycbc/results/dq.py | '''This module contains utilities for following up search triggers'''
# JavaScript for searching the aLOG
redirect_javascript = """<script type="text/javascript">
function redirect(form,way)
{
// Set location to form and submit.
if(form != '')
{
document.forms[form].action=way;
... |
dsajkl/reqiop | lms/djangoapps/courseware/tests/test_course_info.py | """
Test the course_info xblock
"""
import mock
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from .helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.modulestore_config import TEST_DATA_MIXE... |
movicha/dcos | packages/bootstrap/extra/dcos_internal_utils/utils/__init__.py | import fcntl
import logging
import os
log = logging.getLogger(__name__)
def read_file_line(filename):
with open(filename, 'r') as f:
return f.read().strip()
class Directory:
def __init__(self, path):
self.path = path
def __enter__(self):
log.info('Opening {}'.format(self.path))... |
jawilson/home-assistant | tests/components/imap_email_content/test_sensor.py | """The tests for the IMAP email content sensor platform."""
from collections import deque
import datetime
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from homeassistant.components.imap_email_content import sensor as imap_email_content
from homeassistant.helpers.even... |
Brett55/moto | tests/test_ec2/test_server.py | from __future__ import unicode_literals
import re
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_ec2_server_get():
backend = server.create_backend_app("ec2")
test_client = backend.test_client()
res = test_client.get(
'/?Action=RunInstances&... |
FCP-INDI/nipype | nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..histogrammatching import HistogramMatching
def test_HistogramMatching_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(noha... |
dims/heat | heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py | # 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... |
HKUST-SING/tensorflow | tensorflow/python/debug/wrappers/local_cli_wrapper.py | # Copyright 2016 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... |
TheMOOCAgency/edx-platform | openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py | """
Tests for programs celery tasks.
"""
import json
import unittest
from celery.exceptions import MaxRetriesExceededError
import ddt
from django.conf import settings
from django.core.cache import cache
from django.test import override_settings, TestCase
from edx_rest_api_client.client import EdxRestApiClient
from edx... |
EduPepperPD/pepper2013 | common/lib/xmodule/xmodule/static_content.py | # /usr/bin/env python
"""
This module has utility functions for gathering up the static content
that is defined by XModules and XModuleDescriptors (javascript and css)
"""
import logging
import hashlib
import os
import errno
import sys
from collections import defaultdict
from docopt import docopt
from path import path... |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/mpmath/functions/hypergeometric.py | from ..libmp.backend import xrange
from .functions import defun, defun_wrapped
def _check_need_perturb(ctx, terms, prec, discard_known_zeros):
perturb = recompute = False
extraprec = 0
discard = []
for term_index, term in enumerate(terms):
w_s, c_s, alpha_s, beta_s, a_s, b_s, z = term
h... |
danieljwest/mycli | tests/test_naive_completion.py | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import mycli.sqlcompleter as sqlcompleter
return sqlcompleter.SQLCompleter(smart_completion=False)
@pytest.fixture
def complete_e... |
certik/pyjamas | pgen/test_support.py | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError, 'test_support must be imported from the test package'
import sys
class Error(Exception):
"""Base class for regression test exceptions."""
class TestFailed(Error):
"""Test failed."""
clas... |
ankur-gupta91/horizon-net-ip | openstack_dashboard/dashboards/identity/domains/panel.py | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 requir... |
matthewoliver/swift | test/unit/test_locale/test_locale.py | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2013 OpenStack Foundation
#
# 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... |
squilter/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F407xx.py | #!/usr/bin/env python
'''
these tables are generated from the STM32 datasheets for the
STM32F40x
'''
# additional build information for ChibiOS
build = {
"CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk",
"CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F4xx/platform.mk"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.