repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
zouyapeng/horizon_change
openstack_dashboard/dashboards/identity/groups/constants.py
89
1214
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
mikalstill/nova
nova/tests/functional/api_sample_tests/test_compare_result.py
1
16270
# Copyright 2015 HPE, 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 t...
apache-2.0
omnirom/android_external_chromium-org
chrome/common/extensions/docs/server2/local_file_system.py
79
3480
# 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. import os import sys from docs_server_utils import StringIdentity from file_system import FileSystem, FileNotFoundError, StatInfo from future import Fut...
bsd-3-clause
fernandobt8/thrift
lib/py/src/transport/THttpClient.py
53
4251
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
jakirkham/ilastik
ilastik/applets/blockwiseObjectClassification/blockwiseObjectClassificationSerializer.py
4
1552
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
gpl-3.0
randomic/aniauth-tdd
evexml/forms.py
1
2256
import evelink from django.forms.models import ModelForm from django.core.exceptions import ValidationError from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Field from crispy_forms.bootstrap import FormActions from evexml.models import APIKeyPair class AddAPIForm(ModelForm):...
mit
Gabriel439/pants
src/python/pants/base/build_file_parser.py
2
7080
# 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 logging impor...
apache-2.0
repotvsupertuga/repo
plugin.video.TVsupertuga/resources/lib/sources/animeultima_tv.py
6
5596
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-2.0
tyagow/AdvancingTheBlog
src/accounts/views.py
1
1262
from django.shortcuts import render, redirect from django.contrib.auth import ( authenticate, get_user_model, login, logout, ) from .forms import UserLoginForm, UserRegisterForm def login_view(request): print(request.user.is_authenticated()) next = request.GET.get('next') form = UserLoginForm(request.POST or ...
mit
CriticalD20/Conway-Life
ggame/headlessdeps.py
228
9672
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('PIL'): from PIL import Image class _body(object): def __init__(self): self.events = {} def appendChild(self, obj): self...
mit
GeorgePlukov/FloodWatch
XBee-2.2.3/examples/alarm.py
1
6698
#! /usr/bin/python """ alarm.py By Paul Malmsten, 2010 pmalmsten@gmail.com This module will communicate with a remote XBee device in order to implement a simple alarm clock with bed occupancy detection. """ import serial from xbee import XBee class DataSource(object): """ Represents a source from which ala...
mit
jhawkesworth/ansible
lib/ansible/modules/network/aci/mso_schema_site_anp_epg.py
7
6428
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ve...
gpl-3.0
mvaled/OpenUpgrade
addons/l10n_be_invoice_bba/__openerp__.py
312
2621
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
kbccoin/kbc
contrib/bitrpc/bitrpc.py
17
9207
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9998") e...
mit
AndreaCrotti/ansible
test/units/parsing/test_data_loader.py
64
3283
# (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, or # (at your option) an...
gpl-3.0
thekad/clusto
src/clusto/commands/allocate.py
3
6821
#!/usr/bin/env python # -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*- # vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8 import sys import clusto from clusto import drivers from clusto import script_helper class Allocate(script_helper.Script): ''' Alloc...
bsd-3-clause
lbryio/lbrycrd
test/functional/feature_proxy.py
15
8335
#!/usr/bin/env python3 # Copyright (c) 2015-2018 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 bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy c...
mit
yohanko88/gem5-DC
tests/long/se/70.twolf/test.py
83
2122
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
robotwholearned/dotfilesCustom
Sublime Text 2/Packages/Default/side_bar.py
10
2533
import sublime, sublime_plugin import os import functools import send2trash class NewFileAtCommand(sublime_plugin.WindowCommand): def run(self, dirs): v = self.window.new_file() if len(dirs) == 1: v.settings().set('default_dir', dirs[0]) def is_visible(self, dirs): return ...
mit
mitchcapper/mythbox
resources/lib/twisted/twisted/conch/insults/client.py
133
4251
""" You don't really want to use this module. Try insults.py instead. """ from twisted.internet import protocol class InsultsClient(protocol.Protocol): escapeTimeout = 0.2 def __init__(self): self.width = self.height = None self.xpos = self.ypos = 0 self.commandQueue = [] sel...
gpl-2.0
MWisBest/PyBot
Commands/insult/insult.py
1
1860
########################################################################### ## PyBot ## ## Copyright (C) 2015, Kyle Repinski ## ## Copyright (C) 2015, Andres Preciado (Glitch) ## ## ...
gpl-3.0
googleapis/googleapis-gen
google/appengine/v1/google-cloud-appengine-v1-py/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py
1
79963
# -*- 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
cg31/tensorflow
tensorflow/python/kernel_tests/softmax_op_test.py
6
6964
# 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
drglove/SickRage
lib/sqlalchemy/connectors/mxodbc.py
79
5362
# connectors/mxodbc.py # Copyright (C) 2005-2014 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 """ Provide an SQLALchemy connector for the eGenix mxODBC commercial Python adapt...
gpl-3.0
40223209/test1
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmock.py
737
40047
import copy import sys import unittest from unittest.test.testmock.support import is_instance from unittest import mock from unittest.mock import ( call, DEFAULT, patch, sentinel, MagicMock, Mock, NonCallableMock, NonCallableMagicMock, _CallList, create_autospec ) class Iter(object): def __init__...
agpl-3.0
mattn/ultisnips
test/vim_interface.py
3
6968
# encoding: utf-8 import os import re import shutil import subprocess import tempfile import textwrap import time from test.constant import (ARR_D, ARR_L, ARR_R, ARR_U, BS, ESC, PYTHON3, SEQUENCES) def wait_until_file_exists(file_path, times=None, interval=0.01): while times is None or times: if...
gpl-3.0
tojon/treeherder
tests/settings.py
3
1082
from treeherder.config.settings import * DATABASES["default"]["TEST"] = {"NAME": "test_treeherder"} TREEHERDER_TEST_REPOSITORY_NAME = 'test_treeherder_jobs' # this makes celery calls synchronous, useful for unit testing CELERY_ALWAYS_EAGER = True CELERY_EAGER_PROPAGATES_EXCEPTIONS = True # Reconfigure pulse to oper...
mpl-2.0
jusdng/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py
293
4692
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
SunghanKim/numpy
numpy/f2py/tests/test_return_real.py
145
5403
from __future__ import division, absolute_import, print_function from numpy import array from numpy.compat import long from numpy.testing import run_module_suite, assert_, assert_raises, dec import util class TestReturnReal(util.F2PyTest): def check_function(self, t): if t.__doc__.split()[0] in ['t0', '...
bsd-3-clause
AlienCowEatCake/ImageViewer
src/ThirdParty/Exiv2/exiv2-0.27.3-Source/tests/bugfixes/redmine/test_issue_1137.py
2
1287
# -*- coding: utf-8 -*- import system_tests @system_tests.CopyFiles("$data_path/exiv2-empty.jpg") class MetadataPiping(metaclass=system_tests.CaseMeta): url = "http://dev.exiv2.org/issues/1137" filename = system_tests.path("$data_path/exiv2-empty_copy.jpg") Stonehenge = system_tests.path("$data_path/St...
gpl-3.0
leekchan/django_test
tests/view_tests/tests/test_specials.py
66
1428
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase, override_settings @override_settings(ROOT_URLCONF='view_tests.generic_urls') class URLHandling(TestCase): """ Tests for URL handling in views and responses. """ redirect_target = "/%E4%B8%AD%E6%96%87/tar...
bsd-3-clause
jpshort/odoo
openerp/addons/base/ir/ir_needaction.py
455
2704
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
chiviak/headphones
lib/unidecode/x0b1.py
253
4746
data = ( 'nyaess', # 0x00 'nyaeng', # 0x01 'nyaej', # 0x02 'nyaec', # 0x03 'nyaek', # 0x04 'nyaet', # 0x05 'nyaep', # 0x06 'nyaeh', # 0x07 'neo', # 0x08 'neog', # 0x09 'neogg', # 0x0a 'neogs', # 0x0b 'neon', # 0x0c 'neonj', # 0x0d 'neonh', # 0x0e 'neod', # 0x0f 'neol', ...
gpl-3.0
JeroenZegers/Nabu-MSSS
nabu/postprocessing/scorers/sdr_snr_noise_scorer.py
1
6506
"""@file sdr_snr_noise_scorer.py contains the scorer using SdrSnrNoiseScorer""" # Edited by Pieter Appeltans (added snr score) import scorer import numpy as np import os import scipy.io.wavfile as wav from nabu.postprocessing import data_reader import bss_eval class SdrSnrNoiseScorer(scorer.Scorer): """the SDR score...
mit
miloszz/DIRAC
Core/Utilities/File.py
8
5406
##################################################################################### # $HeadURL$ ##################################################################################### """Collection of DIRAC useful file related modules. .. warning:: By default on Error they return None. """ __RCSID__ = "$Id$" impo...
gpl-3.0
tsvtkv/lgt
games/terms.py
2
4927
from mongoengine import * class Term(EmbeddedDocument): meta = {'allow_inheritance': True} def __init__(self, is_comb=False, *args, **kwargs): super(Term, self).__init__(*args, **kwargs) def bounded_variables(self): return set() def free_variables(self): return set() d...
mit
bluele/skype4py
Skype4Py/lang/ru.py
23
19299
apiAttachAvailable = u'\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0418\u041f\u041f' apiAttachNotAvailable = u'\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d' apiAttachPendingAuthorization = u'\u041e\u0436\u...
bsd-3-clause
dementrock/nbgrader
nbgrader/tests/apps/test_nbgrader_autograde.py
1
18212
import os from ...api import Gradebook from .. import run_python_module from .base import BaseTestApp class TestNbGraderAutograde(BaseTestApp): def test_help(self): """Does the help display without error?""" run_python_module(["nbgrader", "autograde", "--help-all"]) def test_missing_student...
bsd-3-clause
valtech-mooc/edx-platform
common/djangoapps/student/roles.py
15
11247
""" Classes used to model the roles used in the courseware. Each role is responsible for checking membership, adding users, removing users, and listing members """ from abc import ABCMeta, abstractmethod from django.contrib.auth.models import User import logging from student.models import CourseAccessRole from xmodu...
agpl-3.0
bguillot/OpenUpgrade
openerp/service/__init__.py
380
1613
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you c...
agpl-3.0
krischer/python-future
docs/3rd-party-py3k-compat-code/django_utils_encoding.py
13
8418
from __future__ import unicode_literals import codecs import datetime from decimal import Decimal import locale try: from urllib.parse import quote except ImportError: # Python 2 from urllib import quote from django.utils.functional import Promise from django.utils import six class DjangoUnicodeDecodeErr...
mit
somcom3x/android_kernel_motorola_msm8226-common
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
ehirt/odoo
addons/l10n_cl/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
philsch/ansible
lib/ansible/modules/cloud/amazon/cloudfront_facts.py
25
31930
#!/usr/bin/python # 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, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
thorsilver/Modelling-academic-job-security
Academic.py
1
8945
from random import randint class Academic: """ An academic agent. Attributes: - id : unique identifier - research_quality : quality of research (random float in range 0 - 1) - applying: True if agent is currently applying for grants - grant_held : grant held for current year (boolean 1/0)...
mit
khrapovs/diffusions
diffusions/param_cir.py
1
2969
#!/usr/bin/env python # -*- coding: utf-8 -*- """ CIR parameter class ~~~~~~~~~~~~~~~~~~~ """ from __future__ import print_function, division import numpy as np from .param_generic import GenericParam __all__ = ['CIRparam'] class CIRparam(GenericParam): """Parameter storage for CIR model. Attributes ...
mit
daviddao/luminosity
sklearn-server/flask/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py
474
1597
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
bsd-3-clause
jkandasa/integration_tests
cfme/utils/db.py
5
9126
from collections import Mapping from contextlib import contextmanager from itertools import izip from cached_property import cached_property from sqlalchemy import MetaData, create_engine, event, inspect from sqlalchemy.exc import ArgumentError, DisconnectionError, InvalidRequestError from sqlalchemy.ext.declarative i...
gpl-2.0
david-ragazzi/nupic
tests/integration/nupic/algorithms/tp_overlapping_sequences_test.py
8
31904
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
un1versal/kodi
tools/EventClients/lib/python/ps3/sixpair.py
208
2903
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import usb vendor = 0x054c product = 0x0268 timeout = 5000 passed_value = 0x03f5 def find_sixaxes(): res = [] for bus in usb.busses(): for dev in bus.devices: if dev.idVendor == vendor and dev.idProduct == product: res.append(dev) return r...
gpl-2.0
openprivacy/.emacs.d
elpy/rpc-venv/lib/python3.8/site-packages/pip/_vendor/chardet/enums.py
290
1661
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ class InputState(object): """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 class LanguageFilter...
gpl-2.0
JTarball/generator-dockerized-django-polymer
app/templates/docker/app/app/backend/apps/_archive/content/urls.py
8
5213
from django.conf.urls import patterns, url from .views import LanguageListView, LanguageDetailView, PostCommentListView, CategoryListView, CommentCardListView, CardListView, CardCreateView, CardCheckImageView, CardAddClickView, CardAddBrokenView, CardAddCommentView, CardAddLikeView, CardCommentsView, CardAddCommentVie...
gpl-2.0
relacs/relacs
plugins/efield/printtrace.py
3
1988
# example script for printing all visible traces # set plotcommand to "python printtrace.py" in relacs.cfg import numpy as np import matplotlib.pyplot as plt import subprocess def is_float( s ): try: float(s) return True except ValueError: return False def loaddat( filename ): ...
gpl-3.0
urisimchoni/samba
buildtools/wafsamba/samba3.py
8
4115
# a waf tool to add autoconf-like macros to the configure section # and for SAMBA_ macros for building libraries, binaries etc import Options, Build, os from samba_utils import os_path_relpath, TO_LIST, samba_add_onoff_option from samba_autoconf import library_flags Options.Handler.SAMBA3_ADD_OPTION = samba_add_onoff...
gpl-3.0
GreenRecycleBin/servo
components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
208
3824
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface SpecialMethods { getter long long (unsigned long index); setter long long (unsigned long index, long long value); creator long long (unsigned long index, long long value); deleter long long (un...
mpl-2.0
TeamSirius/Utilities
scripts/finder.py
1
2416
"""This is a python script which utilizes the OS X airport utility in order to find the location of a user""" import json import os from PIL import Image, ImageDraw import requests import subprocess import sys SERVER_URL = "http://mapbuilder.herokuapp.com/" SERVER_URL = "http://localhost:5000/" floorPaths = [""...
apache-2.0
HalcyonChimera/osf.io
admin_tests/institutions/test_views.py
19
9039
import json from nose import tools as nt from django.test import RequestFactory from django.contrib.auth.models import Permission from django.core.exceptions import PermissionDenied from tests.base import AdminTestCase from osf_tests.factories import ( AuthUserFactory, InstitutionFactory, ProjectFactory ...
apache-2.0
Soya93/Extract-Refactoring
python/helpers/py2only/docutils/utils.py
5
24559
# $Id: utils.py 6394 2010-08-20 11:26:58Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous utilities for the documentation utilities. """ __docformat__ = 'reStructuredText' import os import os.path import sys import unicodedata impo...
apache-2.0
cleech/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
619
2183
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from __future__ import print_func...
gpl-2.0
luzfcb/pip
pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
theotherjimmy/mbed
tools/build.py
3
12815
#! /usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2013 ARM Limited 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...
apache-2.0
kingvuplus/b-p
lib/python/Components/NimManager.py
1
68155
import os from Tools.HardwareInfo import HardwareInfo from Tools.BoundFunction import boundFunction from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \ ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \ ConfigSubDict, ConfigOnOff, ConfigDateTime, ConfigText from eni...
gpl-2.0
radzhome/AWS-ElasticBeanstalk-CLI
eb/linux/python3/lib/aws/requests/packages/urllib3/packages/ordered_dict.py
9
8919
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
apache-2.0
bigmlcom/Area53
route53/test.py
1
2646
import unittest from area53 import route53 class TestRoute53(unittest.TestCase): @classmethod def setUpClass(self): zone = route53.get_zone('example.com') if zone is not None: zone.delete() self.zone = route53.create_zone('example.com') def test_nameservers(self): ...
mit
akhilari7/pa-dude
lib/python2.7/site-packages/django/forms/models.py
91
55231
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) fro...
mit
cpcloud/dask
dask/array/image.py
6
1997
from __future__ import absolute_import, division, print_function from glob import glob import os try: from skimage.io import imread as sk_imread except ImportError: pass from .core import Array from ..base import tokenize def add_leading_dimension(x): return x[None, ...] def imread(filename, imread=N...
bsd-3-clause
amjadm61/bedrock
vendor-local/packages/chardet/chardet/jpcntx.py
190
19049
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mpl-2.0
cherokee/pyscgi
CTK/HiddenField.py
1
1551
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2011 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation....
bsd-3-clause
mushtaqak/edx-platform
openedx/core/djangoapps/user_api/preferences/tests/test_api.py
39
17881
# -*- coding: utf-8 -*- """ Unit tests for preference APIs. """ import datetime import ddt import unittest from mock import patch from pytz import UTC from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase from django.test.utils import override_settings from dateu...
agpl-3.0
Azure/azure-sdk-for-python
sdk/agrifood/azure-agrifood-farming/azure/agrifood/farming/aio/operations/_oauth_providers_operations.py
1
17124
# 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 may ...
mit
mringel/ThinkStats2
code/regression.py
62
9652
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import math import pandas import random import numpy as np import statsmode...
gpl-3.0
mewtaylor/django
django/contrib/gis/gdal/raster/const.py
238
1537
""" GDAL - Constant definitions """ from ctypes import ( c_byte, c_double, c_float, c_int16, c_int32, c_uint16, c_uint32, ) # See http://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4 GDAL_PIXEL_TYPES = { 0: 'GDT_Unknown', # Unknown or unspecified type 1: 'GDT_Byte', # Eight bit unsigned int...
bsd-3-clause
Work4Labs/lettuce
tests/integration/lib/Django-1.3/django/db/models/fields/files.py
156
16228
import datetime import os import django.utils.copycompat as copy from django.conf import settings from django.db.models.fields import Field from django.core.files.base import File, ContentFile from django.core.files.storage import default_storage from django.core.files.images import ImageFile, get_image_dimensions fr...
gpl-3.0
WamanAvadhani/Rammbock
utest/test_messages.py
2
4523
from unittest import TestCase, main from Rammbock.message import Struct, Field, BinaryContainer, BinaryField from Rammbock.binary_tools import to_bin def uint_field(value='0x00'): return Field('uint', 'name', to_bin(value)) class TestMessages(TestCase): def test_in(self): msg = Struct('foo', 'foo_t...
apache-2.0
ekansa/open-context-py
opencontext_py/apps/ocitems/octypes/manage.py
1
7232
import uuid as GenUUID import datetime from django.conf import settings from django.db import models from opencontext_py.apps.ocitems.manifest.models import Manifest from opencontext_py.apps.ocitems.strings.models import OCstring from opencontext_py.apps.ocitems.strings.manage import StringManagement from opencontext_p...
gpl-3.0
JakeLowey/HackRPI2
django/core/urlresolvers.py
65
20847
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a tuple in this format: (view_function, function_args, function_kwargs) """ import re from threading import local from django.http import Http40...
mit
jerryz1982/neutron
neutron/plugins/cisco/extensions/credential.py
37
2973
# Copyright 2013 Cisco Systems, 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 requir...
apache-2.0
tboyce021/home-assistant
homeassistant/components/google_maps/device_tracker.py
19
4198
"""Support for Google Maps location sharing.""" from datetime import timedelta import logging from locationsharinglib import Service from locationsharinglib.locationsharinglibexceptions import InvalidCookies import voluptuous as vol from homeassistant.components.device_tracker import PLATFORM_SCHEMA, SOURCE_TYPE_GPS ...
apache-2.0
130s/bloom
bloom/commands/git/import_upstream.py
1
15537
# Software License Agreement (BSD License) # # Copyright (c) 2013, Willow Garage, 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...
bsd-3-clause
edx/ecommerce
ecommerce/core/management/commands/populate_sdn_fallback_data_and_metadata.py
1
3601
""" Django management command to download SDN csv for use as fallback if the trade.gov API is down. See docs/decisions/0007-sdn-fallback.rst for more details. """ import logging import tempfile import requests from django.conf import settings from django.core.management.base import BaseCommand from django.db import t...
agpl-3.0
sander76/home-assistant
homeassistant/components/abode/camera.py
17
3026
"""Support for Abode Security System cameras.""" from datetime import timedelta import abodepy.helpers.constants as CONST import abodepy.helpers.timeline as TIMELINE import requests from homeassistant.components.camera import Camera from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassist...
apache-2.0
google/makani
avionics/linux/provision/ui_helper.py
1
10570
# Copyright 2020 Makani Technologies 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...
apache-2.0
UrusTeam/android_ndk_toolchain_cross
lib/python2.7/lib2to3/pgen2/parse.py
569
8053
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser engine for the grammar tables generated by pgen. The grammar table must be loaded first. See Parser/parser.c in the Python distribution for additional info on how this parsing engine works. ...
gpl-2.0
dannyperry571/theapprentice
script.module.youtube.dl/lib/youtube_dl/extractor/microsoftvirtualacademy.py
68
7476
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_xpath, ) from ..utils import ( int_or_none, parse_duration, smuggle_url, unsmuggle_url, xpath_text, ) class MicrosoftVirtualAcademyBaseIE(InfoExtractor): def _extract_base_ur...
gpl-2.0
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Imaging/Core/Testing/Python/voxelModel.py
9
2170
#!/usr/bin/env python import os import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Now create the RenderWindow, Renderer and Interactor # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteracto...
gpl-3.0
gardenm/hypetra.in
reviews/wordof/reviewparser.py
1
3352
__author__ = 'matthewgarden' import datetime import logging import requests from review import Review from bs4 import BeautifulSoup class ReviewParser: """ Class to parse an album review from an RSS feed's DOM. :param title_re: Regular expression object that can be used to get the artist and album from the RSS i...
bsd-3-clause
Bismarrck/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
24
7880
# 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...
apache-2.0
cul-it/Invenio
modules/websubmit/lib/websubmit_dblayer.py
9
33061
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
MRN-Code/pl2mind
analysis/sz_analysis.py
1
1678
""" Module for analysis of schizophrenia experiments. """ import logging from scipy.stats import ttest_1samp from scipy.stats import ttest_ind logger = logging.getLogger("pl2mind") def get_sz_info(dataset, activations): """ Get schizophrenia classification experiment related info from activations. Info ...
gpl-2.0
valentin-krasontovitsch/ansible
lib/ansible/modules/network/f5/bigip_imish_config.py
10
29613
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
mavenlin/tensorflow
tensorflow/contrib/session_bundle/bundle_shim_test.py
147
16424
# 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
aliyun/spark-on-ecs
bin/service/hue.py
2
2050
#!/usr/bin/python #coding=utf-8 import os import sys from core import ecs, utils from core.common import GlobalVar def start_hue(masters, opts): print "==> Starting HUE service..." master = masters[0] ins = ecs.get_instance_info(master) ip = ins['InnerIpAddress']['IpAddress'][0] copy_command = ' \"...
artistic-2.0
guruxu/dd-agent
tests/checks/mock/test_jenkins.py
46
5706
# stdlib from collections import defaultdict import datetime import logging import os import shutil import tempfile import unittest # 3p import xml.etree.ElementTree as ET # project from tests.checks.common import get_check logger = logging.getLogger(__file__) DATETIME_FORMAT = '%Y-%m-%d_%H-%M-%S' LOG_DATA = 'Finis...
bsd-3-clause
yosi-dediashvili/SubiT
src/api/version.py
1
7946
""" Implementation of the Version classes. This package is not responsible for resolving the Version from arbitrary string input and such. It simply the implementation of Versions. Users of this package will implement the methods for extracting the required info for the Version. """ __all__ = ['Version...
gpl-3.0
dreamsxin/kbengine
kbe/src/lib/python/Lib/configparser.py
84
49437
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
lgpl-3.0
jonalmeida/hack-the-north-crazyflie
scan.py
1
1542
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2014 Bitcraze AB # # Cr...
mit
40223133/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/errno.py
624
4096
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
gpl-3.0
blindroot/django
tests/template_tests/test_response.py
24
14490
from __future__ import unicode_literals import pickle import time from datetime import datetime from django.template import engines from django.template.response import ( ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse, ) from django.test import ( RequestFactory, SimpleTestCase, modify_setti...
bsd-3-clause
andela-ifageyinbo/django
tests/model_forms/tests.py
37
112198
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from djang...
bsd-3-clause
frewsxcv/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_server.py
86
1285
import unittest import urllib2 import wptserve from .base import TestUsingServer class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEqual(cm.exception.code, 404) class Te...
mpl-2.0