repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
windskyer/nova
nova/tests/unit/scheduler/filters/test_num_instances_filters.py
59
2920
# 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...
gpl-2.0
sbalde/edxplatform
common/djangoapps/heartbeat/views.py
199
1440
from xmodule.modulestore.django import modulestore from dogapi import dog_stats_api from util.json_request import JsonResponse from django.db import connection from django.db.utils import DatabaseError from xmodule.exceptions import HeartbeatFailure @dog_stats_api.timed('edxapp.heartbeat') def heartbeat(request): ...
agpl-3.0
miracle2k/stgit
stgit/commands/delete.py
1
3073
__copyright__ = """ Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be...
gpl-2.0
frantastic9911/omaha
third_party/gmock/scripts/gmock_doctor.py
64
17418
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0
allenai/deep_qa
deep_qa/models/reading_comprehension/gated_attention_reader.py
3
14808
from typing import Dict from overrides import overrides from keras.layers import Input, Dropout, Concatenate from ...data.instances.reading_comprehension.mc_question_passage_instance import McQuestionPassageInstance from ...common.checks import ConfigurationError from ...layers.backend import BatchDot from ...layers....
apache-2.0
FedoraScientific/salome-smesh
src/Tools/blocFissure/CasTests/fissure_Coude_4.py
1
3081
# -*- coding: utf-8 -*- from fissure_Coude import fissure_Coude class fissure_Coude_4(fissure_Coude): """ probleme de fissure du Coude : ASCOU09A adaptation maillage """ # --------------------------------------------------------------------------- def setParamGeometrieSaine(self): """ Paramètres g...
lgpl-2.1
jaeilepp/mne-python
mne/connectivity/effective.py
3
6612
# Authors: Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) from ..externals.six.moves import zip import copy import numpy as np from ..utils import logger, verbose from .spectral import spectral_connectivity @verbose def phase_slope_index(data, indices=None, sfreq=2 * np.pi, ...
bsd-3-clause
ClimbsRocks/scikit-learn
sklearn/manifold/spectral_embedding_.py
39
20835
"""Spectral Embedding""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from scipy import sparse from scipy.linalg import eigh from scipy.sparse.linalg import lobpcg from ..base import BaseEstimator from ..exter...
bsd-3-clause
ampax/edx-platform-backup
cms/djangoapps/course_creators/models.py
183
4070
""" Table for storing information about whether or not Studio users have course creation privileges. """ from django.db import models from django.db.models.signals import post_init, post_save from django.dispatch import receiver, Signal from django.contrib.auth.models import User from django.utils import timezone from...
agpl-3.0
CPB9/mcc
thirdparty/gtest/scripts/fuse_gtest_files.py
2577
8813
#!/usr/bin/env python # # Copyright 2009, 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...
mpl-2.0
alimony/django
tests/template_tests/syntax_tests/test_url.py
71
11755
from django.template import RequestContext, TemplateSyntaxError from django.test import RequestFactory, SimpleTestCase, override_settings from django.urls import NoReverseMatch, resolve from ..utils import setup @override_settings(ROOT_URLCONF='template_tests.urls') class UrlTagTests(SimpleTestCase): # Successe...
bsd-3-clause
davidwilson-85/easymap
graphic_output/Pillow-4.2.1/Tests/test_file_wmf.py
1
1215
from helper import unittest, PillowTestCase, hopper from PIL import Image class TestFileWmf(PillowTestCase): def test_load_raw(self): # Test basic EMF open and rendering im = Image.open('Tests/images/drawing.emf') if hasattr(Image.core, "drawwmf"): # Currently, support for WM...
gpl-3.0
abrt/faf
src/pyfaf/storage/migrations/versions/a2b6d12819f9_drop_yum_type.py
1
2158
# Copyright (C) 2019 ABRT Team # Copyright (C) 2019 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0
rcurtin/shogun
tests/integration/python_static/test_one.py
21
2421
#!/usr/bin/env python """ Test one data file """ from numpy import * import sys import kernel import distance import classifier import clustering import distribution import regression import preprocessor from sg import sg SUPPORTED=['kernel', 'distance', 'classifier', 'clustering', 'distribution', 'regression', 'pr...
gpl-3.0
imperodesign/paas-tools
deis/prd/controller/api/south_migrations/0016_drop_allauth.py
2
12814
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): "Drop django-allauth tables." tables_to_drop = [ 'account_ema...
mit
switchboardOp/ansible
lib/ansible/module_utils/crypto.py
4
1667
# -*- coding: utf-8 -*- # # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
lucius-feng/tg2
tests/test_middlewares.py
2
3091
from webtest import TestApp from tg.support.middlewares import StatusCodeRedirect from tg.support.middlewares import DBSessionRemoverMiddleware from tg.support.middlewares import MingSessionRemoverMiddleware def FakeApp(environ, start_response): if environ['PATH_INFO'].startswith('/error'): start_response...
mit
Gillu13/scipy
scipy/io/harwell_boeing/hb.py
83
18473
""" Implementation of Harwell-Boeing read/write. At the moment not the full Harwell-Boeing format is supported. Supported features are: - assembled, non-symmetric, real matrices - integer for pointer/indices - exponential format for float values, and int format """ from __future__ import division, print_...
bsd-3-clause
youprofit/kivy
examples/widgets/lists/list_reset_data.py
48
2400
# -*- coding: utf-8 -*- from kivy.uix.listview import ListView from kivy.uix.floatlayout import FloatLayout from kivy.clock import Clock from kivy.adapters.listadapter import ListAdapter from kivy.adapters.models import SelectableDataItem from kivy.uix.listview import ListItemButton from random import choice from str...
mit
pombredanne/progress
progress/bar.py
510
2685
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
isc
t0in4/django
tests/user_commands/tests.py
205
7165
import os from django.apps import apps from django.core import management from django.core.management import BaseCommand, CommandError, find_commands from django.core.management.utils import find_command, popen_wrapper from django.db import connection from django.test import SimpleTestCase, ignore_warnings, override_s...
bsd-3-clause
Konstantin-Posudevskiy/pythonnet
src/tests/test_subclass.py
2
7634
# -*- coding: utf-8 -*- # FIXME: This test module randomly passes/fails even if all tests are skipped. # Something fishy is going on with the Test fixtures. Behavior seen on CI on # both Linux and Windows # TODO: Remove delay of class creations. Adding SetUp/TearDown may help """Test sub-classing managed types""" imp...
mit
cloud-fan/spark
python/pyspark/pandas/data_type_ops/base.py
1
12265
# # 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 us...
apache-2.0
HoracioAlvarado/fwd
venv/Lib/site-packages/pip/operations/freeze.py
24
3925
from __future__ import absolute_import import logging import re import pip from pip.compat import stdlib_pkgs from pip.req import InstallRequirement from pip.utils import get_installed_distributions from pip._vendor import pkg_resources logger = logging.getLogger(__name__) # packages to exclude from freeze output ...
mit
valtech-mooc/edx-platform
lms/djangoapps/dashboard/tests/test_sysadmin.py
13
23822
""" Provide tests for sysadmin dashboard feature in sysadmin.py """ import glob import os import re import shutil import unittest from util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT from django.conf import settings from django.contrib.auth.hashers import check_password from django.contrib.auth.model...
agpl-3.0
bygit/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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 la...
apache-2.0
SmartInfrastructures/neutron
neutron/tests/unit/extensions/test_quotasv2.py
7
19779
# Copyright 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 req...
apache-2.0
mitsuhiko/sqlalchemy
lib/sqlalchemy/sql/elements.py
2
80420
# sql/elements.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core SQL expression elements, including :class:`.ClauseElement`, :class:`.ColumnEle...
mit
paulmadore/Eric-IDE
6-6.0.9/eric/Helpviewer/Bookmarks/BookmarksImporters/BookmarksImporter.py
2
2150
# -*- coding: utf-8 -*- # Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a base class for the bookmarks importers. """ from __future__ import unicode_literals from PyQt5.QtCore import QObject class BookmarksImporter(QObject): """ Class implementing the base...
gpl-3.0
MechCoder/sympy
sympy/utilities/exceptions.py
93
5777
""" General SymPy exceptions and warnings. """ from __future__ import print_function, division import warnings from sympy.utilities.misc import filldedent class SymPyDeprecationWarning(DeprecationWarning): r"""A warning for deprecated features of SymPy. This class is expected to be used with the warnings....
bsd-3-clause
Isendir/brython
www/src/Lib/test/time_hashlib.py
167
2887
# It's intended that this script be run by hand. It runs speed tests on # hashlib functions; it does not test for correctness. import sys, time import hashlib def creatorFunc(): raise RuntimeError("eek, creatorFunc not overridden") def test_scaled_msg(scale, name): iterations = 106201/scale * 20 longSt...
bsd-3-clause
grap/OpenUpgrade
addons/base_action_rule/migrations/8.0.1.0/post-migration.py
14
1449
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 HBEE (http://www.hbee.eu) # @author: Paulius Sladkevičius <paulius@hbee.eu> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
rnirmal/savanna
savanna/tests/unit/db/models/test_clusters.py
1
1607
# Copyright (c) 2013 Mirantis 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 writ...
apache-2.0
taedori81/gentlecoffee
saleor/order/forms.py
10
1249
from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from .models import Payment class PaymentMethodsForm(forms.Form): method = forms.ChoiceField(choices=settings.CHECKOUT_PAYMENT_CHOICES, widget=forms.RadioSelect, initi...
bsd-3-clause
sigma-random/wireshark
tools/dftestlib/tvb.py
40
2451
# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu> # # 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. # # Th...
gpl-2.0
MTK6580/walkie-talkie
ALPS.L1.MP6.V2_HEXING6580_WE_L/alps/build/tools/releasetools/img_from_target_files.py
1
4926
#!/usr/bin/env python # # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
gpl-3.0
weimingtom/python-for-android
tools/googlecode_upload.py
304
8912
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
apache-2.0
JKarathiya/Lean
Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py
1
5416
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
apache-2.0
Vimos/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
manasapte/pants
src/python/pants/backend/jvm/tasks/properties.py
16
3411
# coding=utf-8 # Copyright 2015 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 re from colle...
apache-2.0
Johnzero/erp
openerp/addons/clivia_analysis/report/analysis_report.py
1
2399
# -*- encoding: utf-8 -*- import tools from osv import fields, osv class common_report(osv.osv): _name = "clivia_analysis.production_report" _description = "报表视图" _auto = False _rec_name = 'date' _columns = { 'year': fields.char('年份', size=4, readonly=True), 'month': fie...
agpl-3.0
eahneahn/free
lib/python2.7/site-packages/selenium/webdriver/common/alert.py
43
2320
#Copyright 2007-2009 WebDriver committers #Copyright 2007-2009 Google Inc. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required b...
agpl-3.0
saun4app/python_lib_sphinx
tests/test_utils.py
1
1148
""" python_lib_sphinx tests. """ import unittest from python_lib_sphinx.utils import Constants, orbital_speed, circumference, orbital_period class TestUtils(unittest.TestCase): """ Test python_lib_sphinx's utils. """ def setUp(self): pass def test_orbital_speed(self): """ ...
mit
neilhan/tensorflow
tensorflow/python/kernel_tests/sparse_to_dense_op_py_test.py
21
6743
# 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...
apache-2.0
ApplauseAQI/androguard
elsim/elsim/similarity/similarity.py
35
14893
# This file is part of Elsim # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Elsim is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
apache-2.0
xleng/YCM_WIN_X86
third_party/ycmd/third_party/jedi/test/static_analysis/attribute_error.py
11
2087
class Cls(): class_attr = '' def __init__(self, input): self.instance_attr = 3 self.input = input def f(self): #! 12 attribute-error return self.not_existing def undefined_object(self, obj): """ Uses an arbitrary object and performs an operation on it, s...
gpl-3.0
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/docutils/parsers/rst/directives/misc.py
106
22888
# $Id: misc.py 7487 2012-07-22 21:20:28Z milde $ # Authors: David Goodger <goodger@python.org>; Dethe Elza # Copyright: This module has been placed in the public domain. """Miscellaneous directives.""" __docformat__ = 'reStructuredText' import sys import os.path import re import time from docutils import io, nodes, ...
gpl-2.0
gylian/sickrage
lib/hachoir_parser/audio/aiff.py
90
4043
""" Audio Interchange File Format (AIFF) parser. Author: Victor Stinner Creation: 27 december 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt16, UInt32, Float80, TimestampMac32, RawBytes, NullBytes, String, Enum, PascalString32) from lib.hachoir_core.endia...
gpl-3.0
michhar/flask-webapp-aml
env/Lib/site-packages/pip/_vendor/requests/utils.py
177
21845
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import platform import re import sys import socket import struct import wa...
mit
cyberintruder/wfuzz
framework/plugins/api.py
11
5938
from framework.plugins.pluginobjects import PluginResult from framework.plugins.pluginobjects import PluginRequest from framework.core.myexception import FuzzException from framework.core.facade import Facade import os import urlparse import urllib2 import json # Util methods when processing fuzz results def url_fi...
gpl-2.0
brijeshkesariya/odoo
addons/website_blog/__init__.py
373
1036
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
CN-UPB/OpenBarista
components/decaf-masta/decaf_masta/components/database/datacenter.py
1
1976
## # Copyright 2016 DECaF Project Group, University of Paderborn # This file is part of the decaf orchestration framework # All Rights Reserved. # # 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 htt...
mpl-2.0
backtou/longlab
gr-digital/python/gmsk.py
16
11078
# # GMSK modulation and demodulation. # # # Copyright 2005,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either v...
gpl-3.0
tjanez/ansible
test/integration/gce_credentials.py
84
1852
import collections import os import sys import yaml try: from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver _ = Provider.GCE except ImportError: print("failed=True " + \ "msg='libcloud with GCE support (0.13.3+) required for this module'") sys.exit...
gpl-3.0
google/fuzzbench
fuzzbench/test_e2e/test_e2e_run.py
1
3103
# Copyright 2020 Google 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 to in writing, ...
apache-2.0
mogotest/selenium
setup.py
4
2438
#!/usr/bin/env python # Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
apache-2.0
airodactyl/qutebrowser
tests/helpers/stubs.py
1
16414
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
rrrene/django
django/contrib/postgres/operations.py
374
1377
from django.contrib.postgres.signals import register_hstore_handler from django.db.migrations.operations.base import Operation class CreateExtension(Operation): reversible = True def __init__(self, name): self.name = name def state_forwards(self, app_label, state): pass def database...
bsd-3-clause
googleapis/python-essential-contacts
google/cloud/essential_contacts_v1/services/essential_contacts_service/client.py
1
36542
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
apache-2.0
t1m0thy/django-extensions
tests/test_uuid_field.py
24
2355
import re import uuid import six from django.test import TestCase from django_extensions.db.fields import PostgreSQLUUIDField from .testapp.models import ( UUIDTestAgregateModel, UUIDTestManyToManyModel, UUIDTestModel_field, UUIDTestModel_pk, ) class UUIDFieldTest(TestCase): def test_UUID_field_create(...
mit
jcchin/MagnePlane
src/hyperloop/Python/ticket_cost.py
4
8796
from __future__ import print_function import numpy as np from openmdao.api import IndepVarComp, Component, Group, Problem, ExecComp import matplotlib.pylab as plt class TicketCost(Component): ''' Notes ------- This Component takes into account various cost figures from the system model and combines them to estima...
apache-2.0
rahulkurup/zookeeper
src/contrib/monitoring/test.py
114
8195
#! /usr/bin/env python # 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 # "...
apache-2.0
ax003d/openerp
openerp/addons/event_moodle/__init__.py
54
1067
# -*- 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...
agpl-3.0
atheed/servo
tests/wpt/web-platform-tests/old-tests/webdriver/windows/window_manipulation.py
142
1556
# -*- mode: python; fill-column: 100; comment-column: 100; -*- import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions class WindowingTest(base_test.WebDriverBaseTest): def test_maximize(self): #sel...
mpl-2.0
heaven001/android_kernel_sony_msm8974
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
SoftwareHeritage/swh-web-ui
swh/web/admin/adminurls.py
1
1231
# Copyright (C) 2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU Affero General Public License version 3, or any later version # See top-level LICENSE file for more information from swh.web.common.urlsindex import UrlsIndex class AdminUrls(U...
agpl-3.0
jonyroda97/redbot-amigosprovaveis
lib/pip/_vendor/urllib3/packages/backports/makefile.py
339
1461
# -*- coding: utf-8 -*- """ backports.makefile ~~~~~~~~~~~~~~~~~~ Backports the Python 3 ``socket.makefile`` method for use with anything that wants to create a "fake" socket object. """ import io from socket import SocketIO def backport_makefile(self, mode="r", buffering=None, encoding=None, ...
gpl-3.0
lmcro/webserver
admin/CTK/CTK/List.py
5
3058
# -*- coding: utf-8 -*- # # CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2014 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the...
gpl-2.0
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/wi/views/user/user.py
1
7236
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
Maseratigsg/kohencoin
test/functional/mempool_spendcoinbase.py
35
2286
#!/usr/bin/env python3 # Copyright (c) 2014-2016 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 spending coinbase transactions. The coinbase transaction in block N can appear in block N+100... ...
mit
devs1991/test_edx_docmode
common/djangoapps/embargo/views.py
148
2463
"""Views served by the embargo app. """ from django.http import Http404 from django.views.generic.base import View from django.conf import settings from edxmako.shortcuts import render_to_response from embargo import messages class CourseAccessMessageView(View): """Show a message explaining that the user was b...
agpl-3.0
nkmk/python-snippets
notebook/numpy_sin_cos_tan.py
1
2677
import numpy as np print(np.__version__) # 1.19.0 print(np.pi) # 3.141592653589793 print(np.radians(180)) # 3.141592653589793 print(type(np.radians(180))) # <class 'numpy.float64'> a = np.array([0, 90, 180]) print(type(a)) # <class 'numpy.ndarray'> print(np.radians(a)) # [0. 1.57079633 3.14159265] print(...
mit
egraba/vbox_openbsd
VirtualBox-5.0.0/src/libs/xpcom18a4/python/gen_python_deps.py
11
3486
#!/usr/bin/python """ Copyright (C) 2009-2013 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 Free...
mit
wagnerand/olympia
src/olympia/addons/tests/test_tasks.py
2
21631
import mock import os import pytest import tempfile from datetime import datetime from django.conf import settings from django.core import mail from django.test.utils import override_settings from freezegun import freeze_time from olympia import amo from olympia.activity.models import ActivityLog from olympia.addons...
bsd-3-clause
Fl0rianFischer/sme_odoo
addons/event/models/event_config_settings.py
44
1952
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class event_config_settings(osv.TransientModel): _name='event.config.settings' _inherit='res.config.settings' _columns = { 'module_event_sale': fields.selection([ (0, "All events are free"), (1, 'Allow selling tick...
gpl-3.0
mahim97/zulip
zerver/webhooks/github_webhook/tests.py
5
21928
from typing import Dict, Optional, Text import ujson from mock import MagicMock, patch from zerver.lib.test_classes import WebhookTestCase from zerver.lib.webhooks.git import COMMITS_LIMIT from zerver.models import Message class GithubWebhookTest(WebhookTestCase): STREAM_NAME = 'github' URL_TEMPLATE = "/api/...
apache-2.0
melmorabity/streamlink
src/streamlink/plugins/clubbingtv.py
4
2653
import logging import re from streamlink.plugin import Plugin, PluginArgument, PluginArguments from streamlink.stream import HLSStream log = logging.getLogger(__name__) class ClubbingTV(Plugin): _login_url = "https://www.clubbingtv.com/user/login" _url_re = re.compile(r"https://(www\.)?clubbingtv\.com/") ...
bsd-2-clause
michaelhowden/eden
modules/templates/default/layouts.py
19
9240
# -*- coding: utf-8 -*- from gluon import * from gluon.storage import Storage from s3 import * #from s3theme import NAV, SECTION # Below is an example which you can base your own template's layout.py on # - there are also other examples in the other templates folders # - you will need to restart web2py after making c...
mit
beni55/edx-platform
common/djangoapps/third_party_auth/settings.py
19
6670
"""Settings for the third-party auth module. Defers configuration of settings so we can inspect the provider registry and create settings placeholders for only those values actually needed by a given deployment. Required by Django; consequently, this file must not invoke the Django armature. The flow for settings reg...
agpl-3.0
jdmcbr/geopandas
benchmarks/sindex.py
2
3488
from shapely.geometry import Point from geopandas import read_file, datasets, GeoSeries # Derive list of valid query predicates based on underlying index backend; # we have to create a non-empty instance of the index to get these index = GeoSeries([Point(0, 0)]).sindex predicates = sorted(p for p in index.valid_quer...
bsd-3-clause
TheTypoMaster/my-vim-set-mac
.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/jedi/jedi/evaluate/analysis.py
33
10812
""" Module for statical analysis. """ from jedi import debug from jedi.parser import tree from jedi.evaluate.compiled import CompiledObject CODES = { 'attribute-error': (1, AttributeError, 'Potential AttributeError.'), 'name-error': (2, NameError, 'Potential NameError.'), 'import-error': (3, ImportError, ...
gpl-2.0
SebDieBln/QGIS
python/ext-libs/jinja2/ext.py
34
25077
# -*- coding: utf-8 -*- """ jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2 import nod...
gpl-2.0
Kiiv/CouchPotatoServer
libs/git/files.py
122
1831
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
GehenHe/Recognize-Face-on-Android
tensorflow/python/summary/writer/writer_cache.py
49
1780
# 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...
apache-2.0
abhisg/scikit-learn
sklearn/linear_model/bayes.py
220
15248
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
pigeonflight/strider-plone
docker/appengine/lib/django-1.3/tests/regressiontests/conditional_processing/models.py
47
6873
# -*- coding:utf-8 -*- from datetime import datetime from django.test import TestCase from django.utils import unittest from django.utils.http import parse_etags, quote_etag, parse_http_date FULL_RESPONSE = 'Test conditional get response' LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47) LAST_MODIFIED_STR = 'Sun, 21...
mit
atztogo/spglib
python/test/test_collinear_spin.py
1
1335
import unittest import numpy as np from spglib import get_symmetry class TestGetSymmetry(unittest.TestCase): def setUp(self): lattice = [[4, 0, 0], [0, 4, 0], [0, 0, 4]] positions = [[0, 0, 0], [0.5, 0.5, 0.5]] numbers = [1, 1] magmoms = [0, 0] self._cell = (lattice, posit...
bsd-3-clause
aalien/subtitle2spu
parsesrt.py
1
1661
# Copyright (C) 2008 Antti Laine <antti.a.laine@tut.fi> # # This file is part of subtitle2spu. # # subtitle2spu 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 # ...
mit
soscpd/bee
root/tests/zguide/examples/Python/mdcliapi.py
1
3030
"""Majordomo Protocol Client API, Python version. Implements the MDP/Worker spec at http:#rfc.zeromq.org/spec:7. Author: Min RK <benjaminrk@gmail.com> Based on Java example by Arkadiusz Orzechowski """ import logging import zmq import MDP from zhelpers import dump class MajorDomoClient(object): """Majordomo P...
mit
Cerberus98/quark
quark/tests/functional/mysql/test_ipam.py
3
6645
import contextlib import datetime import mock import netaddr from neutron.common import exceptions from neutron.common import rpc from oslo_config import cfg from oslo_utils import timeutils from quark.db import api as db_api import quark.ipam from quark.tests.functional.mysql.base import MySqlBaseFunctionalTest cl...
apache-2.0
epssy/hue
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_openidyadis.py
87
4828
import unittest from openid.consumer.discover import \ OpenIDServiceEndpoint, OPENID_1_1_TYPE, OPENID_1_0_TYPE from openid.yadis.services import applyFilter XRDS_BOILERPLATE = '''\ <?xml version="1.0" encoding="UTF-8"?> <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)" xmlns:...
apache-2.0
Kast0rTr0y/ansible
lib/ansible/modules/system/debconf.py
25
5870
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to configure .deb packages. (c) 2014, Brian Coca <briancoca+ansible@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 Softwa...
gpl-3.0
CuonDeveloper/cuon
cuon_client/cuon/bin/cuon/Databases/SingleCuon.py
3
2083
# -*- coding: utf-8 -*- ##Copyright (C) [2005] [Jürgen Hamel, D-32584 Löhne] ##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 versio...
gpl-3.0
ENjOyAbLE1991/scrapy
scrapy/commands/shell.py
107
2194
""" Scrapy Shell See documentation in docs/topics/shell.rst """ from threading import Thread from scrapy.commands import ScrapyCommand from scrapy.shell import Shell from scrapy.http import Request from scrapy.utils.spider import spidercls_for_request, DefaultSpider class Command(ScrapyCommand): requires_proj...
bsd-3-clause
kamcpp/tensorflow
tensorflow/python/debug/debug_data.py
6
33994
# 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...
apache-2.0
scholer/cadnano2.5
cadnano/strand/modscmd.py
2
1922
from cadnano.proxies.cnproxy import UndoCommand from cadnano.cntypes import ( DocT, StrandT ) class AddModsCommand(UndoCommand): def __init__(self, document: DocT, strand: StrandT, idx: int, mod_id: str): super(AddModsCommand, self).__init__() self._strand = strand self._id_num = st...
mit
deandunbar/bitwave
hackathon_version/venv/lib/python2.7/site-packages/django/utils/dateformat.py
115
10703
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import re import time import calendar import d...
mit
preghenella/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/ComparisonData.py
41
4738
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
sanghinitin/golismero
thirdparty_libs/django/core/files/base.py
147
4653
from __future__ import unicode_literals import os from io import BytesIO, StringIO, UnsupportedOperation from django.utils.encoding import smart_text from django.core.files.utils import FileProxyMixin from django.utils import six from django.utils.encoding import force_bytes, python_2_unicode_compatible @python_2_un...
gpl-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters_py3.py
9
1239
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit