repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
robk5uj/invenio
modules/bibauthorid/lib/bibauthorid_searchinterface.py
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 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...
Venturi/cms
env/lib/python2.7/site-packages/cms/utils/conf.py
# -*- coding: utf-8 -*- from functools import update_wrapper import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ from django.utils.six.moves.urllib.parse import urljoin from cms import constants __all__ = ['get_cm...
andrewleech/SickRage
sickbeard/notifiers/libnotify.py
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # # 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 Free Software Foundation, either version 3 of the L...
ligo-cbc/pycbc
test/test_infmodel.py
# Copyright (C) 2021 Alex Nitz # # 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 the ...
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/curve_simplify.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
subdownloader/subdownloader
subdownloader/client/gui/views/language.py
# -*- coding: utf-8 -*- # Copyright (c) 2019 SubDownloader Developers - See COPYING - GPLv3 from abc import abstractmethod import logging from subdownloader.languages.language import Language, legal_languages, UnknownLanguage from subdownloader.client.internationalization import i18n_get_supported_locales from subdow...
josepht/snapcraft
integration_tests/test_local_plugin.py
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
BondAnthony/ansible
test/units/config/test_manager.py
# -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import os.path import pytest fro...
basraven/Thesis
Implementation/Code/test9/classes/propertyconnecter.py
class propertyconnecter(): import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) def formatResults(self, results): arrayedresults = [] for result in results: resultdict = {} for value in resul...
villasv/plugandpie
examples/accel_included.py
"""Prints the accelerometer values every second.""" import time import datetime import logging from plugandpie.drivers import MMA8452Q G_RANGE = 2 INTERVAL = 0.5 # seconds if __name__ == '__main__': accelerometer = MMA8452Q() logging.basicConfig(level=logging.INFO) while True: ms = accelerometer....
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
# Copyright (C) 2011 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 f...
rdamas/e2openplugin-OpenWebif
plugin/controllers/models/audiotrack.py
# -*- coding: utf-8 -*- from Tools.ISO639 import LanguageCodes def getAudioTracks(session): service = session.nav.getCurrentService() audio = service and service.audioTracks() ret = {"tracklist": [], "result": False} if audio is not None and service is not None: current = audio.getCurrentTrack() for i in lis...
Rusk85/pyload
module/plugins/crypter/Dereferer.py
# -*- coding: utf-8 -*- """ 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...
klahnakoski/SpotManager
vendor/jx_base/expressions/mod_op.py
# encoding: utf-8 # # # 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/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # """ # NOTE: THE self.lang[operator] PATTERN ...
Orpheon/Surveillance
mapconverter/gg2mapparser.py
from PIL import Image, ImageDraw import json import os import sys import math import shutil class Map: ENTITY_SIZE = 42 def __init__(self, name): if os.path.exists(name): self.loadmap(name) else: print("Error: Could not find", name) def loadmap(self, name): ...
sysadminmatmoz/odoo-clearcorp
hr_payroll_pay_generator/hr_payroll_pay_generator.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
suutari-ai/shoop
shuup_tests/admin/test_permissions.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from shuup.admin.menu import get_menu_entry_categor...
ecino/compassion-modules
hr_planning/models/hr_planning_day.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: David Coninckx <david@coninckx.com> # # The licence is in the file __manifest__.p...
iulian787/spack
var/spack/repos/builtin/packages/skilion-onedrive/package.py
# Copyright 2013-2020 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 SkilionOnedrive(MakefilePackage): """A complete tool to interact with OneDrive on Linux, ...
wscullin/spack
var/spack/repos/builtin/packages/elfutils/package.py
############################################################################## # Copyright (c) 2013-2017, 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...
iulian787/spack
var/spack/repos/builtin/packages/r-jsonlite/package.py
# Copyright 2013-2020 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 RJsonlite(RPackage): """A fast JSON parser and generator optimized for statistical data an...
JPWKU/unix-agent
src/dcm/agent/tests/unit/test_utils.py
# # Copyright (C) 2014 Dell, 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 wri...
frreiss/tensorflow-fred
tensorflow/lite/testing/op_tests/rfft2d.py
# Copyright 2019 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...
CuchulainX/featherweight.light
fit_cone.py
# Copyright 2011 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...
openstack/python-neutronclient
neutronclient/neutron/v2_0/tag.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 # distributed under t...
mycFelix/heron
heron/instance/src/python/basics/__init__.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"); you may not u...
keithhendry/treadmill
treadmill/rest/api/identity_group.py
""" Treadmill Identity Group REST api. """ import flask import flask_restplus as restplus from flask_restplus import fields # Disable E0611: No 'name' in module from treadmill import webutils # pylint: disable=E0611 # Old style classes, no init method. # # pylint: disable=W0232 def init(api, cors, impl): """C...
TakayukiSakai/tensorflow
tensorflow/python/framework/tensor_util_test.py
# 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...
sajuptpm/neutron-ipam
neutron/tests/unit/vmware/test_agent_scheduler.py
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
richm/designate
designate/sink/__init__.py
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved. # # Author: Kiall Mac Innes <kiall@hp.com> # # 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....
seanli9jan/tensorflow
tensorflow/python/kernel_tests/scatter_ops_test.py
# 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...
mlperf/training_results_v0.7
NVIDIA/benchmarks/maskrcnn/implementations/pytorch/maskrcnn_benchmark/modeling/roi_heads/box_head/inference.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch import torch.nn.functional as F from torch import nn from maskrcnn_benchmark.structures.bounding_box import BoxList from maskrcnn_benchmark.structures.boxlist_ops import boxlist_nms from maskrcnn_benchmark.structures.boxlist_ops impor...
Floobits/floobits-neovim
rplugin/python/floobits/common/utils.py
import os import errno import json import re import hashlib import time import webbrowser from functools import wraps try: from urllib.parse import urlparse assert urlparse except ImportError: from urlparse import urlparse try: from .. import editor from . import shared as G from .exc_fmt imp...
vdemeester/docker-py
docker/api/secret.py
import base64 from .. import errors from .. import utils class SecretApiMixin: @utils.minimum_version('1.25') def create_secret(self, name, data, labels=None, driver=None): """ Create a secret Args: name (string): Name of the secret data (bytes...
earies/ncclient
test/unit/transport/test_ssh.py
# -*- coding: utf-8 -*- import unittest try: from unittest.mock import MagicMock, patch # Python 3.4 and later except ImportError: from mock import MagicMock, patch from ncclient.transport.ssh import SSHSession from ncclient.transport import AuthenticationError, SessionCloseError, NetconfBase import paramiko f...
tonybaloney/st2contrib
packs/vdx/tests/test_action_services_vrrp.py
"""Generated test for checking pynos based actions """ import xml.etree.ElementTree as ET from st2tests.base import BaseActionTestCase from services_vrrp import services_vrrp __all__ = [ 'TestServicesVrrp' ] class MockCallback(object): # pylint:disable=too-few-public-methods """Class to hold mock callback a...
cloudera/ibis
ibis/udf/validate.py
"""Validation for UDFs. Warning: This is an experimental module and API here can change without notice. DO NOT USE DIRECTLY. """ from inspect import Parameter, Signature, signature from typing import Any, Callable, List import ibis.common.exceptions as com from ibis.expr.datatypes import DataType def _parameter_c...
w1ll1am23/home-assistant
homeassistant/components/adguard/switch.py
"""Support for AdGuard Home switches.""" from __future__ import annotations from datetime import timedelta import logging from typing import Callable from adguardhome import AdGuardHome, AdGuardHomeConnectionError, AdGuardHomeError from homeassistant.components.switch import SwitchEntity from homeassistant.config_en...
go-lab/appcomposer
appcomposer/graasp_i18n.py
import json import xml.etree.ElementTree as ET from collections import OrderedDict from flask import Blueprint, render_template, make_response, current_app from appcomposer.translator.utils import get_cached_session, indent from appcomposer.utils import report_error graasp_i18n_blueprint = Blueprint('graasp_i18n', __...
benhamner/GEFlightQuest
PythonModule/geflight/postgres_ingest/create_schema.py
from csvjazz import csv_to_postgres import os def main(): data_path = os.path.join(os.environ["DataPath"], "GEFlight", "Release 1", "InitialTrainingSet_rev1", "2012_11_12") schema = [] for ...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/lfads/synth_data/synthetic_data_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...
mvaled/sentry
tests/sentry/lang/javascript/test_cache.py
from __future__ import absolute_import from sentry.lang.javascript.cache import SourceCache from unittest import TestCase class BasicCacheTest(TestCase): def test_basic_features(self): cache = SourceCache() url = "http://example.com/foo.js" assert url not in cache assert cache.g...
andrewsmedina/django
django/contrib/gis/tests/geoapp/test_feeds.py
from __future__ import absolute_import from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import TestCase from .models import City class GeoFeedTest(TestCase): urls = 'django.contrib.gis.tests.geoapp.urls' def setUp(self): Si...
remram44/tej
tests/test_bash.py
from rpaths import Path import subprocess import unittest class TestTimeDelta(unittest.TestCase): def call_function(self, delta): p = subprocess.Popen( ['/bin/sh', '-s', '%d' % delta], cwd=(Path(__file__).parent.parent / 'tej/remotes/default/commands').path, ...
ypwalter/evennia
evennia/utils/utils.py
""" General helper functions that don't fit neatly under any given category. They provide some useful string and conversion methods that might be of use when designing your own game. """ import os import sys import imp import types import math import re import textwrap import random import traceback from importlib i...
mshahbaz/exabgp
lib/exabgp/memory/profiler.py
"""Profile the memory usage of a Python program""" __version__ = '0.24' _CMD_USAGE = "python -m memory_profiler script_file.py" import time, sys, os, pdb import warnings import linecache import inspect # TODO: provide alternative when multprocessing is not available try: from multiprocessing import Process, Pi...
mozilla/popcorn_maker
popcorn_gallery/popcorn/migrations/0005_auto__del_category.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'Category' db.delete_table('popcorn_category') # Removing M2M table for field cate...
wmvanvliet/mne-python
mne/beamformer/_compute_beamformer.py
"""Functions shared between different beamformer types.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Roman Goj <roman.goj@gmail.com> # Britta Westner <britta.wstnr@gmail.com> # # License: BSD-3-Clause from copy import deepcopy import numpy as np from ..cov import Covariance, ma...
catapult-project/catapult
telemetry/telemetry/internal/results/page_test_results_unittest.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. from __future__ import absolute_import import json import shutil import sys import tempfile import unittest import mock from telemetry.core import exceptio...
mindriot101/bokeh
bokeh/models/tests/utils/property_utils.py
from itertools import chain from bokeh.core.enums import NamedColor as Color, LineJoin, LineCap # enums FILL = ["fill_color", "fill_alpha"] LINE = ["line_color", "line_width", "line_alpha", "line_join", "line_cap", "line_dash", "line_dash_offset"] TEXT = ["text_font", "text_font_size", "text_font_style", "text_color"...
pllim/astropy
astropy/table/column.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import warnings import weakref from copy import deepcopy import numpy as np from numpy import ma from astropy.units import Unit, Quantity from astropy.utils.console import color_print from astropy.utils.metadata import MetaData from as...
endlessm/chromium-browser
third_party/depot_tools/recipes/recipe_modules/presubmit/test_api.py
# Copyright 2019 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. from recipe_engine import recipe_test_api from PB.recipe_modules.depot_tools.presubmit import properties class PresubmitTestApi(recipe_test_api.RecipeTestA...
nikkitan/bitcoin
test/functional/feature_config_args.py
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various command line arguments and configuration file parameters.""" import os from test_framewo...
xhqu1981/pymatgen
pymatgen/io/lammps/tests/test_lammps_input.py
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals, \ absolute_import import os import unittest from pymatgen.io.lammps.input import DictLammpsInput __author__ = 'Kiran Mathew' __email__ =...
bohlian/frappe
frappe/permissions.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from six.moves import range from six import string_types import frappe, copy, json from frappe import _, msgprint from frappe.utils import cint import frappe.share...
vladsaveliev/bcbio-nextgen
bcbio/pipeline/variation.py
"""Next-gen variant detection and evaluation with GATK and SnpEff. """ import collections import os import toolz as tz from bcbio import utils from bcbio.cwl import cwlutils from bcbio.log import logger from bcbio.pipeline import datadict as dd from bcbio.variation.genotype import variant_filtration, get_variantcaller...
machinelearningnanodegree/stanford-cs231
solutions/pranay/assignment1/cs231n/classifiers/k_nearest_neighbor.py
import numpy as np class KNearestNeighbor(object): """ a kNN classifier with L2 distance """ def __init__(self): pass def train(self, X, y): """ Train the classifier. For k-nearest neighbors this is just memorizing the training data. Inputs: - X: A numpy array of shape (num_train, D) ...
imranwar/AsposeStoragePHP
SDKs/Aspose.Storage_Cloud_SDK_For_Python/asposestoragecloud/models/FilesResponse.py
#!/usr/bin/env python class FilesResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. ...
krintoxi/NoobSec-Toolkit
NoobSecToolkit /tools/inject/sqlmap.py
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import bdb import inspect import logging import os import re import shutil import sys import time import traceback import warnings warnings.filterwarnings(action="ignore", me...
t-woerner/firewalld
src/firewall/core/icmp.py
# -*- coding: utf-8 -*- # # Copyright (C) 2017 Red Hat, Inc. # # Authors: # Thomas Woerner <twoerner@redhat.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 2 of the License...
mrquim/repository.mrquim
script.module.trakt/lib/trakt/interfaces/movies/__init__.py
from __future__ import absolute_import, division, print_function from trakt.interfaces.base import Interface from trakt.mapper.summary import SummaryMapper import requests class MoviesInterface(Interface): path = 'movies' def get(self, id, extended=None, **kwargs): response = self.http.get(str(id),...
pratyushanand/trace-cmd
tracecmd.py
# # Copyright (C) International Business Machines Corp., 2009 # # 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. # # Thi...
SerialShadow/SickRage
lib/subliminal/providers/addic7ed.py
# -*- coding: utf-8 -*- import logging import re from babelfish import Language, language_converters from requests import Session from . import ParserBeautifulSoup, Provider, get_version from .. import __version__ from ..cache import SHOW_EXPIRATION_TIME, region from ..exceptions import AuthenticationError, Configura...
skerit/shotfactory
ppmoffset.py
#!/usr/bin/env python # browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org> # # Browsershots 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 Found...
popuguy/mit-cs-6-034
lab1/utils.py
from UserDict import DictMixin import re class ClobberedDictKey(Exception): "A flag that a variable has been assigned two incompatible values." pass class NoClobberDict(DictMixin): """ A dictionary-like object that prevents its values from being overwritten by different values. If that happens, it...
nkgilley/home-assistant
tests/components/simplisafe/test_config_flow.py
"""Define tests for the SimpliSafe config flow.""" import json from simplipy.errors import SimplipyError from homeassistant import data_entry_flow from homeassistant.components.simplisafe import DOMAIN from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER from homeassistant.const import CONF_CODE, CONF_...
Onager/plaso
utils/plot_storage.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Script to plot storage IO timing usage from profiling data. This script requires the matplotlib and numpy Python modules. """ import argparse import glob import os import sys import numpy from matplotlib import pyplot def Main(): """The main program function. ...
supermari0/ironic
ironic/tests/drivers/test_seamicro.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...
wubr2000/googleads-python-lib
examples/adxbuyer/v201506/error_handling/handle_partial_failures.py
#!/usr/bin/python # # Copyright 2013 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 b...
LukeMurphey/splunk-network-tools
tests/selenium/webdriver/support/event_firing_webdriver.py
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
TomBaxter/osf.io
website/util/__init__.py
# -*- coding: utf-8 -*- from contextlib import contextmanager import collections import logging import re import urlparse from blinker import ANY import furl from django.utils.http import urlencode, urlquote from flask import request, url_for from website import settings as website_settings from api.base import set...
guschmue/tensorflow
tensorflow/python/keras/_impl/keras/applications/vgg19.py
# 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...
BYVoid/OpenCC
deps/pybind11-2.5.0/tests/test_numpy_array.py
import pytest from pybind11_tests import numpy_array as m pytestmark = pytest.requires_numpy with pytest.suppress(ImportError): import numpy as np def test_dtypes(): # See issue #1328. # - Platform-dependent sizes. for size_check in m.get_platform_dtype_size_checks(): print(size_check) ...
mtmarsh2/vislab
vislab/datasets/__init__.py
import ava import flickr import wikipaintings import pinterest import pascal import behance DATASETS = { 'ava': { 'fn': ava.get_ava_df }, 'ava_style': { 'fn': ava.get_style_df }, 'flickr': { 'fn': flickr.get_df }, 'wikipaintings': { 'fn': wikipaintings.get_st...
freakboy3742/django
django/db/backends/sqlite3/base.py
""" SQLite backend for the sqlite3 module in the standard library. """ import datetime import decimal import functools import hashlib import math import operator import random import re import statistics import warnings from itertools import chain from sqlite3 import dbapi2 as Database import pytz from django.core.ex...
mitsuhiko/babel
tests/test_date_intervals.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from babel import dates from babel.dates import get_timezone from babel.util import UTC TEST_DT = datetime.datetime(2016, 1, 8, 11, 46, 15) TEST_TIME = TEST_DT.time() TEST_DATE = TEST_DT.date() def test_format_interval_same_instant_1()...
benschmaus/catapult
systrace/systrace/tracing_agents/atrace_agent_unittest.py
#!/usr/bin/env python # Copyright (c) 2015 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 contextlib import logging import os import unittest from systrace import decorators from systrace import run_systrace from...
pygeek/django
django/views/static.py
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import stat import posixpath import re try: from urllib.parse import unquote except ImportError: ...
ijzer/cwbot-ndy
kol/request/Crimbo2011TradeInCandyRequest.py
import kol.Error as Error from GenericRequest import GenericRequest from kol.manager import PatternManager class Crimbo2011TradeInCandyRequest(GenericRequest): def __init__(self, session, itemId, quantity): super(Crimbo2011TradeInCandyRequest, self).__init__(session) self.url = session.serverURL + ...
ksmit799/Toontown-Source
toontown/coghq/StageLayout.py
from direct.directnotify import DirectNotifyGlobal from direct.showbase.PythonUtil import invertDictLossless from toontown.coghq import StageRoomSpecs from toontown.toonbase import ToontownGlobals from direct.showbase.PythonUtil import normalDistrib, lerp import random def printAllCashbotInfo(): print 'roomId: roo...
mortcanty/earthengine
src/ee/deprecation.py
#!/usr/bin/env python """Decorators to mark function deprecated.""" import functools import warnings def Deprecated(message): """Returns a decorator with a given warning message.""" def Decorator(func): """Emits a deprecation warning when the decorated function is called. Also adds the deprecation me...
zaqwes8811/micro-apps
matlab_ext/external/deModel-0.2/deModel/__init__.py
########################################################################## # This file is part of the deModel library, a Python package for using # Python to model fixed point arithmetic algorithms. # # Copyright (C) 2007 Dillon Engineering, Inc. # http://www.dilloneng.com # # The deModel library is free software;...
michaelld/gnuradio
gr-digital/python/digital/qa_crc32_bb.py
#!/usr/bin/env python # Copyright 2012-2014 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)...
MenZil/kuma
kuma/core/anonymous.py
""" Django middleware for identifying unauthenticated users using a cookie. This is used in kitsune to keep track of their actions such as voting and submitting questions. The middleware adds an `anonymous` attribute to the request object. It is initialized to the value of the anonymous id cookie, if set. The anonymo...
jordanemedlock/psychtruths
temboo/core/Library/Amazon/EC2/DescribeSecurityGroups.py
# -*- coding: utf-8 -*- ############################################################################### # # DescribeSecurityGroups # Returns security group information associated with your AWS Account. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 ...
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
ssh_utils.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # Copyright 2014 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use th...
wileeam/airflow
airflow/providers/microsoft/azure/operators/file_to_wasb.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"); you may not...
mtagle/airflow
airflow/contrib/utils/mlengine_operator_utils.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"); you may not...
tensorflow/tensorflow
tensorflow/python/saved_model/registration/registration_saving_test.py
# Copyright 2021 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...
tboyce021/home-assistant
tests/components/griddy/test_config_flow.py
"""Test the Griddy Power config flow.""" import asyncio from homeassistant import config_entries, setup from homeassistant.components.griddy.const import DOMAIN from tests.async_mock import MagicMock, patch async def test_form(hass): """Test we get the form.""" await setup.async_setup_component(hass, "persi...
cakebread/yolk
yolk/plugins/base.py
# pylint: disable-msg=W0201,W0511 #XXX Attribute 'conf' defined outside __init__ """ Base plugin class This is not needed yet, see working plugins in examples directory. """ import textwrap class Plugin(object): """Base class for yolk plugins. It's not necessary to subclass this class to create a plugin;...
aruneral01/auto-sklearn
autosklearn/cli/HPOlib_interface.py
import time import re from HPOlib.benchmarks.benchmark_util import parse_cli from autosklearn.cli import base_interface if __name__ == "__main__": starttime = time.time() args, params = parse_cli() dataset = args['dataset'] mode = args['mode'] seed = args.get('seed') fold = int(args['fold']...
ingenioustechie/zamboni
mkt/langpacks/tests/test_views.py
# -*- coding: utf-8 -*- import hashlib import json import uuid from django.conf import settings from django.core.urlresolvers import reverse from django.forms import ValidationError from django.test.utils import override_settings from dateutil.tz import tzutc from mock import patch from nose.tools import eq_, ok_ fr...
wfxiang08/django178
tests/invalid_models_tests/test_models.py
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.core.checks import Error from django.db import models from django.test.utils import override_settings from .base import IsolatedModelsTestCase class IndexTogetherTests(IsolatedModelsTestCase): def test_non_iterable(self): cla...
Zolertia/openthread
tools/spinel-cli/spinel/util.py
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # not...
janelia-idf/stern_odor_rig
tracking/python/diskwalk.py
#!/usr/bin/python from __future__ import print_function import os import argparse class DiskWalk(object): def __init__(self,path): self.path = os.path.expanduser(path) def enumerate_paths(self): """Returns the path to all the files in a directory as a list""" path_collection ...
nacc/autotest
utils/reverify_repair_failed.py
#!/usr/bin/python """ Send all Repair Failed hosts that the user running this script has access to back into Verifying. (Only hosts ACL accessable to the user) Suggested use: Run this as an occasional cron job to re-check if Repair Failed hosts have overcome whatever issue caused the failure and are useful again. ""...
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/typed_list/type.py
from theano import gof class TypedListType(gof.Type): """ Parameters ---------- ttype Type of theano variable this list will contains, can be another list. depth Optionnal parameters, any value above 0 will create a nested list of this depth. (0-based) """ def __...
jmartinm/invenio
modules/websession/lib/webaccount.py
## This file is part of Invenio. ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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 ...
unho/virtaal
virtaal/support/openmailto.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of Virtaal. # # 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 ...