code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# pylint: disable=missing-docstring from datetime import datetime, timedelta import factory import pytz from factory.django import DjangoModelFactory from factory.fuzzy import FuzzyText from oauth2_provider.models import AccessToken, Application, RefreshToken from openedx.core.djangoapps.oauth_dispatch.models impor...
eduNEXT/edx-platform
openedx/core/djangoapps/oauth_dispatch/tests/factories.py
Python
agpl-3.0
1,383
#import DBusInterface
buguelos/odoo
yowsup/Interfaces/DBus/__init__.py
Python
agpl-3.0
22
############################################################################## # 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...
krafczyk/spack
var/spack/repos/builtin/packages/sleef/package.py
Python
lgpl-2.1
1,534
# -*- coding: utf-8 -*- import httplib as http import mock from nose.tools import * # noqa from boto.exception import S3ResponseError from framework.auth import Auth from tests.base import get_default_metaschema from tests.factories import ProjectFactory, AuthUserFactory from website.addons.base import testing from...
monikagrabowska/osf.io
website/addons/s3/tests/test_view.py
Python
apache-2.0
12,215
# Copyright (c) 2018 PaddlePaddle 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 app...
tensor-tang/Paddle
python/paddle/fluid/tests/unittests/test_program_code.py
Python
apache-2.0
2,769
import re from django import template from django import forms register = template.Library() def _process_field_attributes(field, attr, process): # split attribute name and value from 'attr:value' string params = attr.split(':', 1) attribute = params[0] value = params[1] if len(params) == 2 else ''...
Prakhash/security-tools
external/django-DefectDojo-1.2.1/dojo/templatetags/event_tags.py
Python
apache-2.0
2,640
# # 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 # ...
gonzolino/heat
heat/tests/clients/test_designate_client.py
Python
apache-2.0
11,629
from __future__ import absolute_import, division, print_function from lxml import etree import os def open_xml_file(filename, mode): """Opens an XML file for use. :param filename: XML file to create file from :param mode: file mode for open :return: """ base = os.path.dirname(__file__) + '/x...
chelseawinfree/symantecssl
tests/unit/utils.py
Python
apache-2.0
623
class EmptyResult(object): ''' Null Object pattern to prevent Null reference errors when there is no result ''' def __init__(self): self.status = 0 self.body = '' self.msg = '' self.reason = '' def __nonzero__(self): return False class HapiError(ValueEr...
jonathan-s/happy
happy/error.py
Python
apache-2.0
2,606
# Copyright 2015 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 ...
GDGLima/contentbox
help/views.py
Python
apache-2.0
1,559
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
landism/pants
src/python/pants/backend/jvm/tasks/nailgun_task.py
Python
apache-2.0
4,969
# 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...
kamcpp/tensorflow
tensorflow/python/training/supervisor_test.py
Python
apache-2.0
33,571
# 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
cloudbase/nova-virtualbox
nova/api/openstack/compute/plugins/v3/flavors_extraspecs.py
Python
apache-2.0
6,450
# 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 applicab...
tombstone/models
research/deep_contextual_bandits/bandits/algorithms/variational_neural_bandit_model.py
Python
apache-2.0
12,618
# Copyright 2020 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...
davidzchen/tensorflow
tensorflow/lite/tools/reverse_xxd_dump_from_cc.py
Python
apache-2.0
2,210
from tests import BaseTestCase import mock import time from redash.models import User from redash.authentication.account import invite_token from tests.handlers import get_request, post_request class TestInvite(BaseTestCase): def test_expired_invite_token(self): with mock.patch('time.time') as patched_ti...
pubnative/redash
tests/handlers/test_authentication.py
Python
bsd-2-clause
2,213
""" ============== Blob Detection ============== Blobs are bright on dark or dark on bright regions in an image. In this example, blobs are detected using 3 algorithms. The image used in this case is the Hubble eXtreme Deep Field. Each bright dot in the image is a star or a galaxy. Laplacian of Gaussian (LoG) -------...
paalge/scikit-image
doc/examples/features_detection/plot_blob.py
Python
bsd-3-clause
2,997
# Copyright (c) 2010 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
axinging/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py
Python
bsd-3-clause
3,181
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
Ban3/Limnoria
plugins/BadWords/__init__.py
Python
bsd-3-clause
2,470
project_slug = '{{ cookiecutter.project_slug }}' if hasattr(project_slug, 'isidentifier'): assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
kappataumu/cookiecutter-django
hooks/pre_gen_project.py
Python
bsd-3-clause
184
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
ProgVal/Limnoria-test
plugins/Plugin/__init__.py
Python
bsd-3-clause
2,763
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, _testing as tm, ) def test_split(any_string_dtype): values = Series(["a_b_c", "c_d_e", np.nan, "f_g_h"], dtype=any_string_dtype) result = values....
dsm054/pandas
pandas/tests/strings/test_split_partition.py
Python
bsd-3-clause
21,379
# # ImageViewCairo.py -- classes for the display of Ginga canvases # in Cairo surfaces # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. import sy...
rupak0577/ginga
ginga/cairow/ImageViewCairo.py
Python
bsd-3-clause
6,874
# -*- coding: utf-8 -*- """ logbook._fallback ~~~~~~~~~~~~~~~~~ Fallback implementations in case speedups is not around. :copyright: (c) 2010 by Armin Ronacher, Georg Brandl. :license: BSD, see LICENSE for more details. """ from itertools import count from logbook.helpers import get_iterator_next_...
agustinhenze/logbook.debian
logbook/_fallback.py
Python
bsd-3-clause
6,767
# 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...
eunchong/build
third_party/buildbot_8_4p1/buildbot/locks.py
Python
bsd-3-clause
10,720
# Copyright 2016, 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...
tengyifei/grpc
src/python/grpcio_tests/tests/stress/client.py
Python
bsd-3-clause
4,801
from __future__ import print_function import unittest import numpy as np import pydrake import os.path class TestRBTCoM(unittest.TestCase): def testCoM0(self): r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))...
billhoffman/drake
drake/bindings/python/pydrake/test/testRBTCoM.py
Python
bsd-3-clause
1,228
import unittest from mock import Mock from biicode.common.model.content import Content from biicode.common.model.content import ContentDeserializer from biicode.common.model.content import content_diff from biicode.common.exception import BiiSerializationException from biicode.common.model.id import ID class ContentT...
zhangf911/common
test/model/content_test.py
Python
mit
1,322
from kolibri.auth.api import KolibriAuthPermissions, KolibriAuthPermissionsFilter from kolibri.content.api import OptionalPageNumberPagination from rest_framework import filters, viewsets from .models import ContentRatingLog, ContentSessionLog, ContentSummaryLog, UserSessionLog from .serializers import ContentRatingLo...
ralphiee22/kolibri
kolibri/logger/api.py
Python
mit
2,079
# -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the ...
ricardogsilva/pycsw
pycsw/oaipmh.py
Python
mit
15,091
""" Menu utilities. """ from fnmatch import fnmatch from django.utils.importlib import import_module from django.core.urlresolvers import reverse from wpadmin.utils import ( get_wpadmin_settings, get_admin_site, get_admin_site_name) def get_menu_cls(menu, admin_site_name='admin'): """ menu - menu name (...
nwaxiomatic/django-wpadmin
wpadmin/menu/utils.py
Python
mit
4,176
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
akashlevy/Lyff
lyff_lambda/boto/s3/key.py
Python
mit
83,034
import os import shutil import biicode.common.test from biicode.common.utils import file_utils as common_file_utils def load(filepath): """Return binary load of given test resource.""" abspath = file_path(filepath) with open(abspath, "rb") as f: return f.read() def read(filepath): """Return ...
zhangf911/common
test/testfileutils.py
Python
mit
4,715
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/sql/__init__.py
Python
mit
1,376
import os.path from pipeline.conf import settings from pipeline.compilers import SubProcessCompiler class LessCompiler(SubProcessCompiler): output_extension = 'css' def match_file(self, filename): return filename.endswith('.less') def compile_file(self, content, path): command = '%s %s ...
pdr/django-pipeline
pipeline/compilers/less.py
Python
mit
560
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ pipe2py.modules.pipeurlinput ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://pipes.yahoo.com/pipes/docs?doc=user_inputs#URL """ from pipe2py.lib import utils def pipe_urlinput(context=None, _INPUT=None, conf=None, **kwargs): """An input that prompts the use...
klyap/pipe2py
pipe2py/modules/pipeurlinput.py
Python
gpl-2.0
822
#!/usr/bin/env python """buildpkg.py -- Build OS X packages for Apple's Installer.app. This is an experimental command-line tool for building packages to be installed with the Mac OS X Installer.app application. It is much inspired by Apple's GUI tool called PackageMaker.app, that seems to be part of the OS X develo...
xbmc/atv2
xbmc/lib/libPython/Python/Mac/scripts/buildpkg.py
Python
gpl-2.0
15,904
from rsf.proj import * from math import * import fdmod,pcsutil,wefd def data(par): # ------------------------------------------------------------ Fetch('vp_marmousi-ii.segy',"marm2") Fetch('vs_marmousi-ii.segy',"marm2") Fetch('density_marmousi-ii.segy',"marm2") # ---------------------------------...
zxtstarry/src
book/cwp/geo2008IsotropicAngleDomainElasticRTM/marm2allA/marm2.py
Python
gpl-2.0
4,919
#!/usr/bin/env python # # Copyright (c) 2020 by VMware, Inc. ("VMware") # Used Copyright (c) 2018 by Network Device Education Foundation, # Inc. ("NetDEF") in this file. # # Permission to use, copy, modify, and/or distribute this software # for any purpose with or without fee is hereby granted, provided # that the abo...
freerangerouting/frr
tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py
Python
gpl-2.0
229,521
# $HeadURL: $ ''' :mod: Utils Module that collects utility functions. ''' import fnmatch from DIRAC import gConfig, S_OK from DIRAC.Core.Utilities import List from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations __...
Sbalbp/DIRAC
ResourceStatusSystem/Utilities/Utils.py
Python
gpl-3.0
3,106
""" URLResolver Addon for Kodi Copyright (C) 2016 t0mm0, 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 late...
fapeci/Filma
script.module.urlresolver/lib/default.py
Python
gpl-3.0
2,499
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (c) 2009 Raymond Hettinger # # 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 r...
andpp/cherrymusic
backport/collections/_backported.py
Python
gpl-3.0
4,139
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
sputnick-dev/weboob
weboob/capabilities/geolocip.py
Python
agpl-3.0
1,791
# 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 __future__ import unicode_literals from copy import deepcopy from django import forms from dj...
lawzou/shoop
shoop/admin/modules/methods/views/edit.py
Python
agpl-3.0
4,422
from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='BlockSt...
edx/edx-platform
openedx/core/djangoapps/content/block_structure/migrations/0001_config.py
Python
agpl-3.0
1,174
# # 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...
nathanielvarona/airflow
airflow/migrations/versions/64a7d6477aae_fix_description_field_in_connection_to_.py
Python
apache-2.0
2,586
# Copyright 2017 AT&T Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
vedujoshi/tempest
tempest/tests/lib/services/identity/v3/test_endpoint_groups_client.py
Python
apache-2.0
5,681
# Copyright 2013 VMware, 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 a...
eayunstack/neutron
neutron/conf/extensions/allowedaddresspairs.py
Python
apache-2.0
1,020
## @package get_python_cmake_flags # Module scripts.get_python_cmake_flags ############################################################################## # Use this script to find your preferred python installation. ############################################################################## # # You can use the follo...
Yangqing/caffe2
scripts/get_python_cmake_flags.py
Python
apache-2.0
1,130
# # 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...
Acehaidrey/incubator-airflow
airflow/providers/google/cloud/example_dags/example_automl_nl_text_sentiment.py
Python
apache-2.0
3,589
# -*- coding: utf-8 -*- ############################################################################### # # InitializeOAuth # Generates an authorization URL that an application can use to complete the first step in the OAuth process. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under ...
jordanemedlock/psychtruths
temboo/core/Library/Bitly/OAuth/InitializeOAuth.py
Python
apache-2.0
5,111
"""Tests for tensorflow.ops.gradients.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings import tensorflow.python.platform import numpy as np from tensorflow.python.framework import ops from tensorflow.python.framework import test_util fr...
arunhotra/tensorflow
tensorflow/python/ops/gradients_test.py
Python
apache-2.0
12,673
"""Test for the smhi weather entity.""" import asyncio from datetime import datetime import logging from unittest.mock import AsyncMock, Mock, patch from smhi.smhi_lib import APIURL_TEMPLATE, SmhiForecastException from homeassistant.components.smhi import weather as weather_smhi from homeassistant.components.smhi.con...
partofthething/home-assistant
tests/components/smhi/test_weather.py
Python
apache-2.0
9,580
# Copyright 2009-2015 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
jhajek/euca2ools
euca2ools/commands/iam/createsigningcertificate.py
Python
bsd-2-clause
2,698
# Copyright 2013-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
vasiliykochergin/euca2ools
euca2ools/commands/ec2/deletenetworkaclentry.py
Python
bsd-2-clause
1,948
from __future__ import unicode_literals import json from django.test import TestCase, override_settings from django.utils.http import urlquote from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django.core.files.uploadedfile import SimpleUploadedFile from django.templa...
bjesus/wagtail
wagtail/wagtailimages/tests/test_admin_views.py
Python
bsd-3-clause
25,034
from __future__ import absolute_import input_name = '../examples/multi_physics/thermo_elasticity_ess.py' output_name = 'test_thermo_elasticity_ess.vtk' from tests_basic import TestInput class Test(TestInput): pass
vlukes/sfepy
tests/test_input_thermo_elasticity_ess.py
Python
bsd-3-clause
219
def get_attributes_display_map(variant, attributes): display = {} for attribute in attributes: value = variant.get_attribute(attribute.pk) if value: choices = {a.pk: a for a in attribute.values.all()} attr = choices.get(value) if attr: display[...
laosunhust/saleor
saleor/product/utils.py
Python
bsd-3-clause
424
#!/usr/bin/env python # -*- coding: utf-8 -*- # https://github.com/swistakm/django-rest-framework/blob/master/rest_framework/runtests/runtests.py import os import sys # fix sys path so we don't need to setup PYTHONPATH sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) os.environ['DJANGO_SETTINGS_MODUL...
philipforget/django-oauth-plus
oauth_provider/runtests/runtests.py
Python
bsd-3-clause
1,167
import taxcalc
mcdeaton13/Tax-Calculator
conda.recipe/run_test.py
Python
mit
15
import cherrypy from cherrypy.test import helper class ETagTest(helper.CPWebCase): def setup_server(): class Root: def resource(self): return "Oh wah ta goo Siam." resource.exposed = True def fail(self, code): code = int(cod...
evilhero/mylar
lib/cherrypy/test/test_etags.py
Python
gpl-3.0
3,071
# -*- coding: utf-8 -*- # # Test links: # http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): __name__ = "SpeedyshareCom" __type__ = "hoster" __version__ = "0.06" _...
fayf/pyload
module/plugins/hoster/SpeedyshareCom.py
Python
gpl-3.0
1,259
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Online Members Directory', 'category': 'Website', 'summary': 'Publish your members directory', 'version': '1.0', 'description': """ Publish your members/association directory publicly. ...
t3dev/odoo
addons/website_membership/__manifest__.py
Python
gpl-3.0
711
# -*- 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...
ksrajkumar/openerp-6.1
openerp/addons/base_action_rule/base_action_rule.py
Python
agpl-3.0
24,051
# Generated by Django 1.11.21 on 2019-07-01 12:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('instructor_task', '0002_gradereportsetting'), ] operations = [ migrations.AlterField( model_name='instructortask', ...
eduNEXT/edx-platform
lms/djangoapps/instructor_task/migrations/0003_alter_task_input_field.py
Python
agpl-3.0
396
# 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 DhpmmF(MakefilePackage): """DHPMM_P:High-precision Matrix Multiplication with Faithful Rou...
LLNL/spack
var/spack/repos/builtin/packages/dhpmm-f/package.py
Python
lgpl-2.1
2,254
# 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 Minigan(Package): """miniGAN is a generative adversarial network code developed as part of...
LLNL/spack
var/spack/repos/builtin/packages/minigan/package.py
Python
lgpl-2.1
1,105
import unittest import sys from PySide.QtCore import QObject, SIGNAL, QUrl from PySide.QtWebKit import * from PySide.QtNetwork import QNetworkRequest from helper import adjust_filename, UsesQApplication class TestWebFrame(UsesQApplication): def load_finished(self, ok): self.assert_(ok) page = s...
enthought/pyside
tests/QtWebKit/webframe_test.py
Python
lgpl-2.1
899
# Copyright (c) 2008-2016 VMware, 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 applicabl...
wknet123/harbor
tools/migration/migration_harbor/versions/0_4_0.py
Python
apache-2.0
2,016
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals, division import random import string import timeit import os import zipfile import datrie def words100k(): zip_name = os.path.join( os.path.abspath(os.path.dirname(__file__)), 'words100k.txt.zip...
hexforge/pulp_db
experiments/tries/comparison/datrie/bench/speed.py
Python
apache-2.0
9,330
# 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...
tensorflow/tensorflow
tensorflow/python/data/kernel_tests/from_sparse_tensor_slices_test.py
Python
apache-2.0
8,944
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for workflow object exports.""" from os.path import abspath, dirname, join from flask.json import dumps from ggrc.app import app from ggrc_workflows.models import Workflow from integration.ggrc im...
andrei-karalionak/ggrc-core
test/integration/ggrc_workflows/converters/test_workflow_export_csv.py
Python
apache-2.0
11,531
# 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...
xodus7/tensorflow
tensorflow/python/estimator/training_test.py
Python
apache-2.0
85,718
"""Support for ISY994 lights.""" from typing import Callable, Dict from pyisy.constants import ISY_VALUE_UNKNOWN from homeassistant.components.light import ( DOMAIN as LIGHT, SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.restore_state im...
robbiet480/home-assistant
homeassistant/components/isy994/light.py
Python
apache-2.0
4,198
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
citrix-openstack-build/keystone
keystone/openstack/common/loopingcall.py
Python
apache-2.0
4,679
import mock from nose.tools import eq_, ok_, assert_raises from funfactory.urlresolvers import reverse from .base import ManageTestCase class TestErrorTrigger(ManageTestCase): def test_trigger_error(self): url = reverse('manage:error_trigger') response = self.client.get(url) assert self...
zofuthan/airmozilla
airmozilla/manage/tests/views/test_errors.py
Python
bsd-3-clause
1,278
from django.http import HttpResponseNotAllowed, HttpResponseServerError from django.utils import simplejson as json from util import to_json_response from util import to_dojo_data try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. def e...
google-code-export/dojango
dojango/decorators.py
Python
bsd-3-clause
5,423
from __future__ import print_function import inspect import numpy as np import theano from ..layers.advanced_activations import LeakyReLU, PReLU from ..layers.core import Dense, Merge, Dropout, Activation, Reshape, Flatten, RepeatVector, Layer from ..layers.core import ActivityRegularization, TimeDistributedDense, Aut...
Cadene/keras
keras/utils/layer_utils.py
Python
mit
4,856
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
sephalon/python-ivi
ivi/agilent/agilentE3634A.py
Python
mit
1,924
#!/usr/bin/python # # Copyright 2011-2013 Software freedom conservancy # # 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...
smallswan267/octoplus
selenium/webdriver/chrome/webdriver.py
Python
mit
3,175
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging from flexget import plugin from flexget.event import event from flexget.utils.log import log_once try: from flexge...
sean797/Flexget
flexget/plugins/metainfo/rottentomatoes_lookup.py
Python
mit
4,533
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test of the omero import control. Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest from path import path import omero.clients import uuid from omero.cli import CLI, NonZeroR...
dominikl/openmicroscopy
components/tools/OmeroPy/test/unit/clitest/test_import.py
Python
gpl-2.0
8,731
#!/usr/bin/python # # Copyright (C) 2012 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the F...
miguelinux/vbox
src/VBox/Main/webservice/samples/python/clienttest.py
Python
gpl-2.0
4,520
#-*- coding:utf-8 -*- ''' Created on 18/2/2015 @author: PC06 ''' from flaskext.mysql import MySQL from flask import Flask class DBcon(): ''' classdocs ''' def __init__(self): ''' Constructor ''' pass def conexion(self): mysql = MySQL() app =...
Elvirita/reposelvira
elviraae/ec/edu/itsae/conn/DBcon.py
Python
gpl-2.0
604
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
erjohnso/ansible
lib/ansible/playbook/play_context.py
Python
gpl-3.0
27,712
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class ProcurementOrder(models.Model): _inherit = 'procurement.order' task_id = fields.Many2one('project.task', 'Task', copy=False) def _is_procurement_task(self): ...
chienlieu2017/it_management
odoo/addons/sale_timesheet/models/procurement.py
Python
gpl-3.0
3,947
# Generated from TacticNotations.g by ANTLR 4.7.2 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\f") buf.write("f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4...
Zimmi48/coq
doc/tools/coqrst/notations/TacticNotationsLexer.py
Python
lgpl-2.1
3,961
# Copyright 2012 Nebula, 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 agree...
spring-week-topos/horizon-week
openstack_dashboard/test/test_data/utils.py
Python
apache-2.0
4,617
from nose.tools import * # noqa: F403 from tests.base import AdminTestCase from osf_tests.factories import NodeFactory, UserFactory from osf.utils.permissions import ADMIN from admin.nodes.serializers import serialize_simple_user_and_node_permissions, serialize_node class TestNodeSerializers(AdminTestCase): def...
mfraezz/osf.io
admin_tests/nodes/test_serializers.py
Python
apache-2.0
1,496
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("zerver", "0301_fix_unread_messages_in_deactivated_streams"), ] operations = [ # We do Stream lookups case-insensitively with respect to the name, but we were missing # the appropriate (realm...
andersk/zulip
zerver/migrations/0302_case_insensitive_stream_name_index.py
Python
apache-2.0
706
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012 Cloudscaling Group, Inc. # All Rights Reserved. # # Licens...
alex/solum
solum/openstack/common/db/sqlalchemy/models.py
Python
apache-2.0
3,969
""" msgfmt tool """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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...
h4ck3rm1k3/OpenWrt-Firefly-SDK
staging_dir/host/lib/scons-2.3.1/SCons/Tool/msgfmt.py
Python
gpl-2.0
4,460
##### import sys import inspect from pylons import config import logging import zkpylons.lib.helpers as h from pylons import request, response, session, tmpl_context as c from zkpylons.lib.helpers import redirect_to from pylons.util import class_name_from_module_name from zkpylons.model import meta from pylons.control...
neillc/zookeepr
zkpylons/controllers/secret_hash.py
Python
gpl-2.0
4,319
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat import unittest from units.mock.loader import DictDataLoader from mock import MagicMock from ansible.template import Templar from ansible import errors from ansible.playbook import conditional class TestCondit...
mattclay/ansible
test/units/playbook/test_conditional.py
Python
gpl-3.0
9,810
#!/usr/bin/python # -*- 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) # This is a virtual module that is entirely implemented as an action plugin and runs on the controller from __future__ import absolute_import, ...
Dhivyap/ansible
lib/ansible/modules/files/template.py
Python
gpl-3.0
2,564
from __future__ import unicode_literals from django import template from temba.channels.views import get_channel_icon register = template.Library() @register.filter def channel_icon(channel): return get_channel_icon(channel.channel_type)
praekelt/rapidpro
temba/channels/templatetags/channels.py
Python
agpl-3.0
246
#!/usr/bin/env python from Acspy.Nc.CommonNC import CommonNC from Acspy.Nc.Supplier import Supplier import datacapEx from datacapEx import ExecBlockProcessedEvent, DataCapturerId, ExecBlockStartedEvent, ScanStartedEvent import asdmEX s = Supplier('pyTest-NC') name = 'DATACAP1' s.publishEvent(name) ses...
ACS-Community/ACS
LGPL/CommonSoftware/nctest/ws/test/pyStructureEventTest.py
Python
lgpl-2.1
1,355
from mock import * from .gp_unittest import * from gppylib.programs.gppkg import GpPkgProgram import sys class GpPkgProgramTestCase(GpTestCase): def setUp(self): self.mock_cmd = Mock() self.mock_gppkg = Mock() self.mock_uninstall_package = Mock() self.apply_patches([ ...
50wu/gpdb
gpMgmt/bin/gppylib/test/unit/test_unit_gppkg.py
Python
apache-2.0
3,975
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from datetime import date from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(Exc...
liukaijv/XlsxWriter
xlsxwriter/test/comparison/test_chart_date04.py
Python
bsd-2-clause
2,223
""" DIRECT Nine DoF Manipulation Panel """ from direct.showbase.DirectObject import DirectObject from direct.directtools.DirectGlobals import * from direct.tkwidgets.AppShell import AppShell from direct.tkwidgets.Dial import AngleDial from direct.tkwidgets.Floater import Floater from Tkinter import Button, Menubutton,...
hj3938/panda3d
contrib/src/sceneeditor/sePlacer.py
Python
bsd-3-clause
33,063