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
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for the 'grit build' tool. ''' import codecs import os import sys import tempfile if __name__ == '__main__': sys.p...
sgraham/nope
tools/grit/grit/tool/build_unittest.py
Python
bsd-3-clause
11,256
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generic presubmit checks that can be reused by other presubmit checks.""" import os as _os _HERE = _os.path.dirname(_os.path.abspath(__file__)) ###...
Phonebooth/depot_tools
presubmit_canned_checks.py
Python
bsd-3-clause
40,994
import os.path as op from nose.tools import assert_true, assert_raises import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal import warnings import mne from mne import compute_covariance from mne.datasets import testing from mne.beamformer import lcmv, lcmv_epochs, lcmv_raw, tf_lc...
dimkal/mne-python
mne/beamformer/tests/test_lcmv.py
Python
bsd-3-clause
15,822
# Run with nosetests tests/test_slave_cli.py import debile.slave.cli as slave def test_parse_args(): args = slave.parse_args(['--auth', 'simple', '--config', \ '/etc/debile/slave.yaml', '-s', '-d']) assert args.auth_method == 'simple' assert args.config == '/etc/debile/slave.yaml' assert ...
lucaskanashiro/debile
tests/test_slave_cli.py
Python
mit
370
import subprocess, os if os.path.basename(os.getcwd()) != 'scripts': print("Run this from the scripts directory") exit() #make a "sandox" for the large number of files being generated try: os.mkdir('simfiles') except OSError: pass os.chdir('simfiles') subprocess.call(['pynml-channelanalysis', '-temp...
gsarma/ChannelWorm
scripts/iv_curve_from_model.py
Python
mit
606
from __future__ import print_function import tensorflow as tf import numpy as np import time, sys from Eval_Data import Data from Eval_Config import Config import Eval_Calculate_Performance as perf import Eval_utils as utils class Network: def __init__(self, cfg): self.cfg = cfg def loss(self, y_p...
yashchandak/GNN
Sample_Run/level2/Eval_MLP.py
Python
mit
9,173
from __future__ import absolute_import import torch import torch.nn.functional as F from torch import nn, autograd class OIM(autograd.Function): def __init__(self, lut, momentum=0.5): super(OIM, self).__init__() self.lut = lut self.momentum = momentum def forward(self, inputs, target...
dapengchen123/code_v1
reid/loss/oim.py
Python
mit
1,727
/// <reference path="./testBlocks/enums.ts" /> enum EnumOfFlags { W = 1, X = 1 << 1, Z = 1 << 3 } let userDefinedTest7 = EnumOfFlags.W
switch-education/pxt
tests/pydecompile-test/baselines/enum_user_defined_bit_mask_bad_sequence.py
Python
mit
148
# coding: utf-8 """ Compile publication data for astronomy journals over the last 10 years. """ from __future__ import division, print_function __author__ = "Andy Casey <acasey@mso.anu.edu.au>" # Standard library import json # Module specific import ads if __name__ == "__main__": # Let's select the years and...
jonnybazookatone/ads
examples/journal-publications-over-time/journals.py
Python
mit
3,651
#!/usr/bin/env python class DrawingObjectResponse(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 attribut...
sohail-aspose/Aspose_Words_Cloud
SDKs/Aspose.Words_Cloud_SDK_for_Python/asposewordscloud/models/DrawingObjectResponse.py
Python
mit
822
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithm.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
dwadler/QGIS
python/plugins/processing/algs/saga/SagaAlgorithm.py
Python
gpl-2.0
20,651
#!/usr/bin/env python # -*- coding: utf-8 -*- """ *************************************************************************** SagaHelpGenerator.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com...
kiith-sa/QGIS
python/plugins/processing/saga/SagaHelpGenerator.py
Python
gpl-2.0
7,582
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007 Zsolt Foldvari # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2013 Vassilii Khachaturov # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
SNoiraud/gramps
gramps/plugins/docgen/cairodoc.py
Python
gpl-2.0
12,315
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2005 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
SNoiraud/gramps
gramps/gui/merge/mergesource.py
Python
gpl-2.0
7,569
import datetime import pytz from bugwarrior.services.github import GithubService from .base import ServiceTest class TestGithubIssue(ServiceTest): maxDiff = None SERVICE_CONFIG = { 'github.login': 'arbitrary_login', 'github.password': 'arbitrary_password', 'github.username': 'arbitr...
ryansb/bugwarrior
tests/test_github.py
Python
gpl-3.0
2,426
"""Loading unittests.""" import os import re import sys import traceback import types from functools import cmp_to_key as _CmpToKey from fnmatch import fnmatch from . import case, suite __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '....
ruibarreira/linuxtrail
usr/lib/python2.7/unittest/loader.py
Python
gpl-3.0
13,465
# Copyright 2014-2020 Arx Libertatis Team (see the AUTHORS file) # # This file is part of Arx Libertatis. # # Arx Libertatis 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 ...
Thoronador/ArxLibertatis
plugins/blender/arx_addon/dataFts.py
Python
gpl-3.0
10,486
# Returns a valid response when a request has appropriate credentials. def main(request, response): cookie = request.cookies.first(b"cookieName", None) expected_value = request.GET.first(b"value", None) source_origin = request.headers.get(b"origin", None) response_headers = [(b"Content-Type", b"text/ja...
asajeffrey/servo
tests/wpt/web-platform-tests/worklets/resources/credentials.py
Python
mpl-2.0
591
# -*- 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...
sysadminmatmoz/odoo-clearcorp
TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_import.py
Python
agpl-3.0
1,660
# 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 os import symlink from spack import * class BlastLegacy(Package): """Legacy NCBI BLAST distribution -- no long...
LLNL/spack
var/spack/repos/builtin/packages/blast-legacy/package.py
Python
lgpl-2.1
1,292
import FemGui import FreeCAD import os import time import sys class inp_writer: def __init__(self, analysis_obj, mesh_obj, mat_obj, fixed_obj, force_obj, pressure_obj, dir_name=None): self.dir_name = dir_name self.mesh_object = mesh_obj self.material_objects = mat_obj self.fixed_ob...
cypsun/FreeCAD
src/Mod/Fem/ccxInpWriter.py
Python
lgpl-2.1
18,324
import os path = os.path import unittest from unittest import TestCase import random from random import randrange random.seed(2) import time import myhdl from myhdl import * from myhdl.conversion import verify N = 8 M = 2 ** N DEPTH = 5 @block def xor(z, a, b, c): @instance def logic(): while 1: ...
josyb/myhdl
myhdl/test/conversion/general/test_randscrambler.py
Python
lgpl-2.1
2,592
from . import test_attachment fast_suite = [test_attachment, ]
meta-it/misc-addons
attachment_large_object/tests/__init__.py
Python
lgpl-3.0
78
"""wsgiref -- a WSGI (PEP 3333) Reference Library Current Contents: * util -- Miscellaneous useful functions and wrappers * headers -- Manage response headers * handlers -- base classes for server/gateway implementations * simple_server -- a simple BaseHTTPServer that supports WSGI * validate -- valid...
Orav/kbengine
kbe/src/lib/python/Lib/wsgiref/__init__.py
Python
lgpl-3.0
610
# coding=utf-8 # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
SauloAislan/ironic
ironic/objects/node.py
Python
apache-2.0
29,894
"""Config flow for Plex.""" import copy import logging from aiohttp import web_response import plexapi.exceptions from plexapi.gdm import GDM from plexauth import PlexAuth import requests.exceptions import voluptuous as vol from homeassistant import config_entries from homeassistant.components import http from homeas...
kennedyshead/home-assistant
homeassistant/components/plex/config_flow.py
Python
apache-2.0
16,121
# # 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...
ChugR/qpid-dispatch
python/qpid_dispatch_internal/router/link.py
Python
apache-2.0
3,006
# -*- coding: utf-8 -*- """The plist event formatter.""" from plaso.formatters import interface from plaso.formatters import manager class PlistFormatter(interface.ConditionalEventFormatter): """Formatter for a plist key event.""" DATA_TYPE = u'plist:key' FORMAT_STRING_SEPARATOR = u'' FORMAT_STRING_PIECES...
ostree/plaso
plaso/formatters/plist.py
Python
apache-2.0
497
''' Created on Jun 8, 2010 Contains views for permissions tests @author: jnaous ''' from django.shortcuts import get_object_or_404 from models import PermissionTestClass from ..decorators import require_objs_permissions_for_view from ..utils import get_user_from_req, get_queryset from django.http import HttpResponse,...
dana-i2cat/felix
optin_manager/src/python/openflow/common/permissions/tests/views.py
Python
apache-2.0
3,108
# Copyright 2013-2014 MongoDB, 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 writin...
americanstone/mongo-connector
tests/test_config.py
Python
apache-2.0
23,616
# -*- coding: utf-8 -*- import requests from modularodm import Q from modularodm.exceptions import ModularOdmException from framework.auth import Auth from website import util from website import settings from website.project import new_node from website.models import Node, MailRecord def record_message(message, n...
monikagrabowska/osf.io
website/conferences/utils.py
Python
apache-2.0
2,561
from __future__ import unicode_literals import pykka from mopidy import backend from .library import GMusicLibraryProvider from .playback import GMusicPlaybackProvider from .playlists import GMusicPlaylistsProvider from .session import GMusicSession class GMusicBackend(pykka.ThreadingActor, backend.Backend): d...
jaibot/mopidy-gmusic
mopidy_gmusic/actor.py
Python
apache-2.0
1,034
# Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
rahulunair/nova
nova/virt/disk/mount/api.py
Python
apache-2.0
10,966
# -*- coding: utf-8 -*- import os import re from cms.models import CMSPlugin from django.core.files.storage import get_storage_class from django.template.defaultfilters import force_escape from django.utils.functional import LazyObject OBJ_ADMIN_RE_PATTERN = r'<img [^>]*\bid="plugin_obj_(\d+)"[^>]*/?>' OBJ_ADMIN_RE =...
Glasgow2015/team-10
env/lib/python2.7/site-packages/djangocms_text_ckeditor/utils.py
Python
apache-2.0
3,506
# 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...
HaebinShin/tensorflow
tensorflow/contrib/metrics/python/metrics/classification.py
Python
apache-2.0
2,307
# Copyright 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 requ...
affo/nova
nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping.py
Python
apache-2.0
13,756
#!/usr/bin/env python # encoding: utf-8 """ dbset.py Created by Razor <bg1tpt AT gmail.com> on 2008-03-31 Copyright (c) 2008 xBayDNS Team. All rights reserved. """ import bsddb, pickle, os class Set(): def __init__(self): self._dbname = os.tmpnam() try: self._dbobj = bsddb.btopen(se...
changtailiang/xbaydns
xbaydns/tools/dbset.py
Python
bsd-2-clause
760
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
jmargeta/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
Python
bsd-3-clause
2,208
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
lianliuwei/gyp
pylib/gyp/generator/xcode.py
Python
bsd-3-clause
53,816
from __future__ import division, print_function import numpy as np from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn import ensemble from sklearn.datasets import make_multilabel_classification from sklearn.random_projection import sparse_random_matrix fro...
ankurankan/scikit-learn
sklearn/metrics/tests/test_ranking.py
Python
bsd-3-clause
37,643
#!/usr/bin/env python import os, sys, re, string # the list only for debugging. The real list, used in the real OpenCV build, is specified in CMakeLists.txt opencv_hdr_list = [ "../../core/include/opencv2/core/core.hpp", "../../flann/include/opencv2/flann/miniflann.hpp", "../../ml/include/opencv2/ml/ml.hpp", "../../i...
grace-/opencv-3.0.0-cvpr
opencv/modules/python/src2/hdr_parser.py
Python
bsd-3-clause
33,980
# Wrapper for loading templates from eggs via pkg_resources.resource_string. from __future__ import unicode_literals import warnings from django.apps import apps from django.template.base import Origin, TemplateDoesNotExist from django.utils import six from django.utils.deprecation import RemovedInDjango21Warning fr...
hackerbot/DjangoDev
django/template/loaders/eggs.py
Python
bsd-3-clause
2,307
import copy import sys from functools import update_wrapper from future_builtins import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_F...
lzw120/django
django/db/models/base.py
Python
bsd-3-clause
39,705
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-02-02 12:18 from __future__ import unicode_literals from django.contrib.auth.models import Permission from django.db import migrations def delete_old_comment_permission(apps, schema_editor): """ Deletes the old 'can_see_and_manage_comments' permiss...
CatoTH/OpenSlides
server/openslides/motions/migrations/0005_auto_20180202_1318.py
Python
mit
2,199
"""Tests for hermite_e module. """ from __future__ import division import numpy as np import numpy.polynomial.hermite_e as herme from numpy.polynomial.polynomial import polyval from numpy.testing import * He0 = np.array([ 1 ]) He1 = np.array([ 0 , 1 ]) He2 = np.array([ -1 ,0 , 1 ]) He3 = np.array([ 0 , -3 ,0 , 1 ]) ...
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/polynomial/tests/test_hermite_e.py
Python
mit
16,441
#!/usr/bin/env python """Execute the tests for the razers2 program. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usage:...
bkahlert/seqan-research
raw/workshop12/workshop2012-data-20120906/trunk/core/apps/razers2/tests/run_tests.py
Python
mit
12,683
import os import tempfile import unittest import win32com.test.util expected_output = "The jscript test worked.\nThe Python test worked" class XSLT(win32com.test.util.TestCase): def testAll(self): output_name = tempfile.mktemp("-pycom-test") cmd = "cscript //nologo testxslt.js doesnt_matter.xml te...
sserrot/champion_relationships
venv/Lib/site-packages/win32com/test/testxslt.py
Python
mit
890
# minors.py - functions for computing minors of graphs # # Copyright 2015 Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com>. # Copyright 2010 Drew Conway <drew.conway@nyu.edu> # Copyright 2010 Aric Hagberg <hagberg@lanl.gov> # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICEN...
sserrot/champion_relationships
venv/Lib/site-packages/networkx/algorithms/minors.py
Python
mit
17,564
# -*- coding: utf-8 -*- # # Cherokee-admin's Common Static wizard # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2001-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 ...
lmcro/webserver
admin/wizards/flcache.py
Python
gpl-2.0
7,353
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distribut...
cynapse/cynin
src/ubify.viewlets/ubify/viewlets/browser/sitetitle.py
Python
gpl-3.0
2,433
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
lewischeng-ms/pox
pox/core.py
Python
gpl-3.0
11,128
#!/usr/bin/env python3 """ # Copyright (C) 2016 # 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. You should have received # a copy of the GNU General Public License along with this p...
numixproject/circle-core
tests/ordered_db.py
Python
gpl-3.0
1,931
#!/usr/bin/env python # sphinxy: commandline continuous integration sphinx documentation # # Copyright (C) 2015 Charlie Taylor <ctatsourceforge@gmail.com> # # 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...
sonofeft/ODSCharts
docs/sphinxy.py
Python
gpl-3.0
4,251
import pytest from tests.support.asserts import assert_error, assert_success def perform_actions(session, actions): return session.transport.send( "POST", "/session/{session_id}/actions".format(session_id=session.session_id), {"actions": actions}) @pytest.mark.parametrize("action_type",...
paulrouget/servo
tests/wpt/web-platform-tests/webdriver/tests/perform_actions/validity.py
Python
mpl-2.0
2,188
import os import dbus.service # Ignore PyImportSortBear from coalib.misc.Exceptions import get_exitcode from coalib.output.Interactions import fail_acquire_settings from coalib.output.printers.ListLogPrinter import ListLogPrinter from coalib.parsing.Globbing import fnmatch from coalib.processes.Processing import exe...
AdeshAtole/coala
coalib/output/dbus/DbusDocument.py
Python
agpl-3.0
6,675
# -*- 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...
highco-groupe/odoo
addons/share/wizard/share_wizard.py
Python
agpl-3.0
50,906
"""Defines the URL routes for the Team API.""" from django.conf import settings from django.conf.urls import patterns, url from .views import ( MembershipDetailView, MembershipListView, TeamsDetailView, TeamsListView, TopicDetailView, TopicListView ) TEAM_ID_PATTERN = r'(?P<team_id>[a-z\d_-]+...
miptliot/edx-platform
lms/djangoapps/teams/api_urls.py
Python
agpl-3.0
1,464
import json import copy from util.json_request import JsonResponse from django.http import HttpResponseBadRequest from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django_future.csrf import ensure_csrf_cookie from edxmako.shortcuts import rende...
LICEF/edx-platform
cms/djangoapps/contentstore/views/checklist.py
Python
agpl-3.0
6,004
# 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 Mii(MakefilePackage): """Mii is an inverted indexing system for environment modules. ...
LLNL/spack
var/spack/repos/builtin/packages/mii/package.py
Python
lgpl-2.1
900
from __future__ import unicode_literals import os.path import optparse import shlex import sys from .downloader.external import list_external_downloaders from .compat import ( compat_expanduser, compat_get_terminal_size, compat_getenv, compat_kwargs, ) from .utils import ( preferredencoding, w...
lulufei/youtube-dl
youtube_dl/options.py
Python
unlicense
36,996
############################################################################### # # ChartPie - A class for writing the Excel XLSX Pie charts. # # Copyright 2013-2016, John McNamara, jmcnamara@cpan.org # from warnings import warn from . import chart class ChartPie(chart.Chart): """ A class for writing the Exc...
exiahuang/SalesforceXyTools
xlsxwriter/chart_pie.py
Python
apache-2.0
6,168
""" Various tests for class members access. """ # pylint: disable=R0903,print-statement,no-absolute-import, metaclass-assignment,import-error,no-init,missing-docstring, wrong-import-order,wrong-import-position from missing import Missing class MyClass(object): """class docstring""" def __init__(self): ...
axbaretto/beam
sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/functional/class_members_py27.py
Python
apache-2.0
1,691
# Copyright (c) 2012 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...
sebrandon1/neutron
neutron/extensions/providernet.py
Python
apache-2.0
3,608
# Copyright 2015-2017 Capital One Services, LLC # # 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 ...
FireballDWF/cloud-custodian
c7n/output.py
Python
apache-2.0
13,380
import markupsafe from os.path import basename from website import settings def serialize_addon_config(config, user): lookup = config.template_lookup user_addon = user.get_addon(config.short_name) ret = { 'addon_short_name': config.short_name, 'addon_full_name': config.full_name, ...
erinspace/osf.io
addons/base/utils.py
Python
apache-2.0
2,446
# -*- coding: utf-8 -*- ############################################################################### # # GetExerciseFollowUp # Retrieves user data about all excercises which have the specified excercise as a prerequisite. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apach...
jordanemedlock/psychtruths
temboo/core/Library/KhanAcademy/Users/GetExerciseFollowUp.py
Python
apache-2.0
4,590
#!/usr/bin/python #========================================================================== # # Copyright Insight Software Consortium # # 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...
daviddoria/itkHoughTransform
Utilities/Maintenance/UpdateCopyrightStatementsInITK.py
Python
apache-2.0
6,444
# 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...
Kongsea/tensorflow
tensorflow/contrib/crf/python/ops/crf.py
Python
apache-2.0
20,451
from __future__ import print_function, division, absolute_import from llvmlite.llvmpy.core import Module, Type, Builder, InlineAsm from llvmlite import binding as ll from numba.cuda.cudadrv import nvvm from numba.cuda.testing import unittest, CUDATestCase from numba.cuda.testing import skip_on_cudasim @skip_on_cudasi...
GaZ3ll3/numba
numba/cuda/tests/cudadrv/test_inline_ptx.py
Python
bsd-2-clause
1,302
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
vasily-v-ryabov/pywinauto
pywinauto/tests/miscvalues.py
Python
bsd-3-clause
4,700
#!/usr/bin/env python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script to shard build bot steps and save results to disk. Our buildbot infrastructure requires each slave to run steps...
matsumoto-r/synciga
src/build/android/bb_run_sharded_steps.py
Python
bsd-3-clause
7,158
""" A helper function to retrieve the data from Mayavi structures on arbitrary points. """ import numpy as np from tvtk.api import tvtk from . import tools import tvtk.common as tvtk_common def probe_data(mayavi_object, x, y, z, type='scalars', location='points'): """ Retrieve the data from a described by Mayavi...
dmsurti/mayavi
mayavi/tools/probe_data.py
Python
bsd-3-clause
2,853
def main(request, response): _URL = request.url _CSSURL = _URL[:_URL.index('/csp')+1] +"csp/support/w3c/CanvasTest.ttf" response.headers.set("Content-Security-Policy", "default-src http://www.tizen.com 'unsafe-inline'") response.headers.set("X-Content-Security-Policy", "default-src http://www.tizen.com ...
YongseopKim/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_default-src_cross-origin_font_blocked-manual.py
Python
bsd-3-clause
2,607
# Copyright 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 imp def FindModule(name): """Gets the path of the named module. This is useful for cases where we want to use subprocess.call on a module we h...
modulexcite/catapult
catapult_build/module_finder.py
Python
bsd-3-clause
551
from unittest import mock import pytest from mitmproxy.test import tflow from mitmproxy.net.http import http1 from mitmproxy.net.tcp import TCPClient from mitmproxy.test.tutils import treq from ... import tservers class TestHTTPFlow: def test_repr(self): f = tflow.tflow(resp=True, err=True) asse...
ujjwal96/mitmproxy
test/mitmproxy/proxy/protocol/test_http1.py
Python
mit
3,325
from __future__ import with_statement import sys from setuptools import setup, find_packages __version__ = None with open('twilio/version.py') as f: exec(f.read()) # To install the twilio-python library, open a Terminal shell, then run this # file by typing: # # python setup.py install # # You need to have the se...
YeelerG/twilio-python
setup.py
Python
mit
2,325
########################################################### # # Copyright (c) 2012, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
CeltonMcGrath/TACTIC
src/tactic/ui/widget/ckeditor_wdg.py
Python
epl-1.0
4,594
from __future__ import print_function import sys import re import string #TODO: # * fail if an unexpected state occurs _verbose = False _echo_file = False class Game: regex = re.compile(r'(.+)\s+\(c\)\s+([0-9]+)\s+(.+)') def __init__(self, systems, romnames): self.systems = systems self....
zach-morris/plugin.program.iarl
resources/lib/historydat_parser.py
Python
gpl-2.0
6,720
# -*- coding: utf-8 -*- """ sphinx.roles ~~~~~~~~~~~~ Handlers for additional ReST roles. :copyright: 2007-2008 by Georg Brandl. :license: BSD. """ import re from docutils import nodes, utils from docutils.parsers.rst import roles from sphinx import addnodes ws_re = re.compile(r'\s+') caption_...
creasyw/IMTAphy
documentation/doctools/tags/0.4.3/sphinx/roles.py
Python
gpl-2.0
8,698
import pytest from amoco.system.pe import PE def test_parser_PE(samples): for f in samples: if f[-4:]=='.exe': p = PE(f)
chubbymaggie/amoco
tests/test_system_pe.py
Python
gpl-2.0
148
"""Shell is an interactive text control in which a user types in commands to be sent to the interpreter. This particular shell is based on wxPython's wxStyledTextCtrl. Sponsored by Orbtech - Your source for Python programming expertise.""" __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>" __cvsid__ = "$Id: she...
ezequielpereira/Time-Line
libs64/wx/py/shell.py
Python
gpl-3.0
57,165
# # Copyright (C) 2010, 2011, 2014 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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 3 of the License, or # (at your option) any...
spirali/kaira
gui/process.py
Python
gpl-3.0
7,102
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2011 NaN Projectes de Programari Lliure, S.L. All Rights Reserved. # http://www.NaN-tic.com # Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # ...
jmesteve/saas3
openerp/addons_extra/l10n_es_account_invoice_sequence/__openerp__.py
Python
agpl-3.0
2,298
# 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 PySentrySdk(PythonPackage): """The new Python SDK for Sentry.io""" homepage = "https:...
LLNL/spack
var/spack/repos/builtin/packages/py-sentry-sdk/package.py
Python
lgpl-2.1
1,517
# 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...
HaebinShin/tensorflow
tensorflow/python/ops/nn_batchnorm_test.py
Python
apache-2.0
24,393
from pyxb.bundles.opengis.raw.tml import *
CantemoInternal/pyxb
pyxb/bundles/opengis/tml.py
Python
apache-2.0
43
from __future__ import absolute_import from collections import defaultdict from django.db import transaction from django.utils.translation import ugettext as _ from zerver.lib.exceptions import JsonableError from zerver.models import UserProfile, Realm, UserGroupMembership, UserGroup from typing import Dict, Iterable,...
jackrzhang/zulip
zerver/lib/user_groups.py
Python
apache-2.0
3,997
"""Contains the SfxPlayer class, a thin utility class for playing sounds at a particular location.""" __all__ = ['SfxPlayer'] import math from panda3d.core import * class SfxPlayer: """ Play sound effects, potentially localized. """ UseInverseSquare = 0 def __init__(self): # volume atte...
chandler14362/panda3d
direct/src/showbase/SfxPlayer.py
Python
bsd-3-clause
3,536
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os try: import resource # pylint: disable=F0401 except ImportError: resource = None # Not available on all platforms from telemetry.core.pl...
pozdnyakov/chromium-crosswalk
tools/telemetry/telemetry/core/platform/mac_platform_backend.py
Python
bsd-3-clause
1,792
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trigger.contrib.docommand ~~~~~~~~~~~~~~~~~~~~~~~~~ This package provides facilities for running commands on devices using the CLI. """ __author__ = 'Jathan McCollum, Mike Biancianello' __maintainer__ = 'Jathan McCollum' __email__ = 'jathan@gmail.com' __copyright__ =...
chepazzo/trigger
trigger/contrib/docommand/__init__.py
Python
bsd-3-clause
12,051
__all__ = ['unsigned_volume','signed_volume'] from scipy import sqrt,inner,shape,asarray from scipy.misc import factorial from scipy.linalg import det def unsigned_volume(pts): """Unsigned volume of a simplex Computes the unsigned volume of an M-simplex embedded in N-dimensional space. The poin...
ryanbressler/pydec
pydec/math/volume.py
Python
bsd-3-clause
2,450
from __future__ import unicode_literals import datetime import unittest from decimal import Decimal from django import forms, test from django.core import checks, validators from django.core.exceptions import ValidationError from django.db import IntegrityError, connection, models, transaction from django.db.models.f...
abhattad4/Digi-Menu
tests/model_fields/tests.py
Python
bsd-3-clause
35,232
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import warnings import numpy as np from itertools import product from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix from scipy.sparse import coo_matrix from sklearn import datasets from sklearn.base import clo...
waterponey/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
Python
bsd-3-clause
40,529
# -*- coding:utf-8 -*- import logging import unittest import unittest.mock as mock import operator import time import os from ..trader.coordinator import Coordinator, POSITION_HANDLE_TICK from ..common.base import TEST_PATH,TICK,BaseObject,LONG,SHORT,ZERO_TICK,TEST_STATE_PATH from ..common.contract_type import M,P,Con...
lovelylain/pyctp
example/pyctp2/test/test_coordinator.py
Python
mit
49,136
try: import json except ImportError: import simplejson as json from flask import jsonify, render_template, request import urllib import urllib2 from jinja2.filters import FILTERS from Maraschino import app from maraschino.tools import * from maraschino import logger def sab_http(): if get_setting_value(...
awagnon/maraschino
modules/sabnzbd.py
Python
mit
5,990
# -*- coding: utf-8 -*- import os import subprocess from ..internal.Addon import Addon from ..internal.misc import Expose, encode class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" __version__ = "0.73" __status__ = "testing" __config__ = [("activated", "bool", "Activat...
Arno-Nymous/pyload
module/plugins/hooks/ExternalScripts.py
Python
gpl-3.0
9,817
# -*- 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...
addition-it-solutions/project-all
addons/account_budget/__openerp__.py
Python
agpl-3.0
3,013
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
odoousers2014/odoo
addons/hr_holidays/tests/test_holidays_flow.py
Python
agpl-3.0
10,541
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import _ from odoo.addons.survey.tests import common from odoo.tests.common import users class TestSurveyInternals(common.TestSurveyCommon): @users('survey_manager') def test_answer_validation_mandat...
ddico/odoo
addons/survey/tests/test_survey.py
Python
agpl-3.0
3,979
# 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 .commands import COMMANDS from .excludes import set_exclude_patters, get_exclude_patterns from ...
lawzou/shoop
shoop_setup_utils/__init__.py
Python
agpl-3.0
780