repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
rs2/pandas
pandas/plotting/_matplotlib/core.py
1
52089
from typing import TYPE_CHECKING, List, Optional, Tuple import warnings from matplotlib.artist import Artist import numpy as np from pandas._typing import Label from pandas.errors import AbstractMethodError from pandas.util._decorators import cache_readonly from pandas.core.dtypes.common import ( is_float, i...
bsd-3-clause
seocam/django
tests/one_to_one/models.py
125
3132
""" One-to-one relationships To define a one-to-one relationship, use ``OneToOneField()``. In this example, a ``Place`` optionally can be a ``Restaurant``. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compat...
bsd-3-clause
gaddman/ansible
packaging/release/versionhelper/version_helper.py
124
6838
from __future__ import absolute_import, division, print_function __metaclass__ = type import argparse import os import re import sys from packaging.version import Version, VERSION_PATTERN class AnsibleVersionMunger(object): tag_offsets = dict( dev=0, a=100, b=200, rc=1000 ) ...
gpl-3.0
fabricehong/lhistoireserepete
tests/test_forms.py
1
2470
# -*- coding: utf-8 -*- """Test forms.""" from webapp.public.forms import LoginForm from webapp.user.forms import RegisterForm class TestRegisterForm: """Register form.""" def test_validate_user_already_registered(self, user): """Enter username that is already registered.""" form = RegisterF...
bsd-3-clause
decvalts/iris
lib/iris/tests/unit/quickplot/test_scatter.py
17
1655
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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, or # (at your option) any l...
gpl-3.0
40223141/w16b_test
static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py
617
2786
# local storage in browser import sys from javascript import JSObject class __UnProvided(): pass class LocalStorage(): storage_type = "local_storage" def __init__(self): if not sys.has_local_storage: raise EnvironmentError("LocalStorage not available") self.store = JSObject(__...
gpl-3.0
tungvx/deploy
.google_appengine/google/appengine/_internal/antlr3/tree.py
28
69529
""" @package antlr3.tree @brief ANTLR3 runtime package, tree module This module contains all support classes for AST construction and tree parsers. """ # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or...
apache-2.0
jstammers/EDMSuite
EDMScripts/field_sniffer.py
2
2470
# This is a pretty brittle way to get the assembly reference sys.path.append("C:\\Program Files\\National Instruments\\MeasurementStudioVS2005\\DotNET\\Assemblies\\Current") clr.AddReference("NationalInstruments.DAQmx.dll") from NationalInstruments.DAQmx import * from DAQ.Environment import * from math import * ...
mit
javachengwc/hue
desktop/core/ext-py/Django-1.6.10/tests/str/models.py
54
1302
# -*- coding: utf-8 -*- """ 2. Adding __str__() or __unicode__() to models Although it's not a strict requirement, each model should have a ``_str__()`` or ``__unicode__()`` method to return a "human-readable" representation of the object. Do this not only for your own sanity when dealing with the interactive prompt, ...
apache-2.0
ryfeus/lambda-packs
pytorch/source/caffe2/python/queue_util.py
2
4604
## @package queue_util # Module caffe2.python.queue_util from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, dataio from caffe2.python.task import TaskGroup import logging logger = loggin...
mit
mudithkr/zamboni
mkt/constants/features.py
7
22302
import base64 import itertools import math from collections import OrderedDict from django.conf import settings from tower import ugettext_lazy as _lazy # WARNING: When adding a new app feature here also include a migration. # # WARNING: Order matters here. Don't re-order these or alphabetize them. If you # add new...
bsd-3-clause
danibram/mitro
browser-ext/third_party/firefox-addon-sdk/python-lib/mozrunner/wpk.py
37
2765
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from ctypes import sizeof, windll, addressof, c_wchar, create_unicode_buffer from ctypes.wintypes import DWORD, HANDLE ...
gpl-3.0
jburger424/MediaQueueHCI
m-q-env/lib/python3.4/site-packages/wtforms/ext/sqlalchemy/fields.py
177
6848
""" Useful form fields for use with SQLAlchemy ORM. """ from __future__ import unicode_literals import operator from wtforms import widgets from wtforms.compat import text_type, string_types from wtforms.fields import SelectFieldBase from wtforms.validators import ValidationError try: from sqlalchemy.orm.util im...
mit
swdream/neutron
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/extension_drivers/test_qos_driver.py
13
4443
# 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...
apache-2.0
jobiols/odoo-addons
hr_expense_imp/__manifest__.py
1
1422
############################################################################## # # Copyright (C) 2019 jeo Software (http://www.jeosoft.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
jammerful/buildbot
master/buildbot/test/integration/test_custom_buildstep.py
6
11714
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
xNUTs/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp874.py
93
13158
""" Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def dec...
apache-2.0
yangleo/cloud-github
openstack_dashboard/dashboards/identity/roles/views.py
63
3427
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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
CasparLi/calibre
src/calibre/devices/iriver/driver.py
14
1420
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import re from calibre.devices.usbms.driver import USBMS class IRIVER_STORY(USBMS)...
gpl-3.0
apigee/edx-platform
common/lib/xmodule/xmodule/modulestore/mixed.py
7
6114
""" MixedModuleStore allows for aggregation between multiple modulestores. In this way, courses can be served up both - say - XMLModuleStore or MongoModuleStore IMPORTANT: This modulestore only supports READONLY applications, e.g. LMS """ from . import ModuleStoreWriteBase from xmodule.modulestore.django import crea...
agpl-3.0
minhtuancn/odoo
addons/l10n_tr/__init__.py
429
1050
# -*- 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...
agpl-3.0
engla/kupfer
waflib/Tools/c_osx.py
10
5517
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy 2008-2010 """ MacOSX related tools """ import os, shutil, sys, platform from waflib import TaskGen, Task, Build, Options, Utils, Errors from waflib.TaskGen import taskgen_method, feature, after_method, before_method app_info = ''' <?xml version="1.0" encoding="UT...
gpl-3.0
davidyezsetz/kuma
vendor/packages/sqlalchemy/examples/beaker_caching/helloworld.py
7
2629
"""helloworld.py Illustrate how to load some data, and cache the results. """ from environment import Session from model import Person from caching_query import FromCache # load Person objects. cache the result under the namespace "all_people". print "loading people...." people = Session.query(Person).options(From...
mpl-2.0
leifurhauks/grpc
tools/distrib/check_vsprojects.py
42
3186
#!/usr/bin/env python2.7 # Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this li...
bsd-3-clause
johndpope/tensorflow
tensorflow/python/training/adadelta.py
84
4531
# 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
jeremyfix/pylearn2
pylearn2/models/model.py
44
24339
"""Generic "model" class.""" __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from collections import defaultdict from theano.compat.six.moves imp...
bsd-3-clause
VielSoft/odoo
addons/project_timesheet/__init__.py
441
1084
# -*- 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
hkhamm/django_rest_tutorial_2
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/euctwprober.py
2994
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
cuihantao/cvxopt
examples/doc/chap8/mcsdp.py
4
3212
# The SDP example of section 8.7 (Exploiting structure). from cvxopt import blas, lapack, solvers, matrix, normal def mcsdp(w): """ Returns solution x, z to (primal) minimize sum(x) subject to w + diag(x) >= 0 (dual) maximize -tr(w*z) subject t...
gpl-3.0
IndonesiaX/edx-platform
openedx/core/djangoapps/profile_images/tests/helpers.py
117
1742
""" Helper methods for use in profile image tests. """ from contextlib import contextmanager import os from tempfile import NamedTemporaryFile from django.core.files.uploadedfile import UploadedFile from PIL import Image @contextmanager def make_image_file(dimensions=(320, 240), extension=".jpeg", force_size=None): ...
agpl-3.0
nickpack/reportlab
src/reportlab/pdfbase/_fontdata_enc_zapfdingbats.py
5
2242
ZapfDingbatsEncoding = ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a11...
bsd-3-clause
deathbaba/Alohalytics
tests/googletest/test/gtest_list_tests_unittest.py
1898
6515
#!/usr/bin/env python # # Copyright 2006, 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...
mit
rysson/filmkodi
plugin.video.mrknow/lib/utils/crypto/keyedHash/pbkdf2.py
2
1565
# -*- coding: iso-8859-1 -*- """ crypto.keyedHash.pbkdf2 Password Based Key Derivation Function 2 References: RFC2898, B. Kaliski, September 2000, PKCS #5 This function is used for IEEE 802.11/WPA passphrase to key hashing Copyright © (c) 2002 by Paul A. Lambert Read LICENSE.txt for license information. """ fr...
apache-2.0
tsabi/Odoo-tsabi-fixes
addons/account/report/report_vat.py
93
10433
# -*- 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
turbokongen/home-assistant
script/hassfest/codeowners.py
6
2431
"""Generate CODEOWNERS.""" from typing import Dict from .model import Config, Integration BASE = """ # This file is generated by script/hassfest/codeowners.py # People marked here will be automatically requested for a review # when the code that they own is touched. # https://github.com/blog/2392-introducing-code-own...
apache-2.0
robbiet480/home-assistant
tests/components/vesync/test_config_flow.py
7
2341
"""Test for vesync config flow.""" from homeassistant import data_entry_flow from homeassistant.components.vesync import DOMAIN, config_flow from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from tests.async_mock import patch from tests.common import MockConfigEntry async def test_abort_already_setup(hass...
apache-2.0
jerryyjr/sogen_2015
scripts/refine-ranges.py
4
5405
""" Refine existing ranges into more precise ones based on parameter sets Copyright (C) 2013 Ahmet Ay, Jack Holland, Adriana Sperlea, Sebastian Sangervasi 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 Foundati...
gpl-3.0
RianFuro/vint
vint/linting/policy/prohibit_implicit_scope_variable.py
1
1340
from vint.ast.node_type import NodeType from vint.linting.level import Level from vint.linting.policy.abstract_policy import AbstractPolicy from vint.linting.policy_registry import register_policy from vint.ast.plugin.scope_plugin import ExplicityOfScopeVisibility @register_policy class ProhibitImplicitScopeVariable(...
mit
gdgellatly/OCB1
addons/account_budget/report/crossovered_budget_report.py
22
8641
# -*- 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
JackGavin13/octoprint-test-not-finished
src/octoprint/cli/server.py
2
8195
# coding=utf-8 from __future__ import absolute_import, division, print_function __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" import click import logging import sys from ...
agpl-3.0
miipl-naveen/optibizz
addons/l10n_cl/__openerp__.py
260
1679
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
NetDBNCKU/GAE-Conference-Web-App
django/contrib/databrowse/plugins/calendars.py
86
5742
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import force_unicode from dja...
bsd-3-clause
dongguangming/youtube-dl
youtube_dl/extractor/lynda.py
45
8691
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, clean_html, int_or_none, ) class LyndaBaseIE(InfoExtractor): _LOGIN_URL =...
unlicense
jonashaag/ansible
lib/ansible/inventory/vars_plugins/noop.py
317
1632
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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 Foundat...
gpl-3.0
shaufi10/odoo
addons/sale/report/invoice_report.py
336
1680
# -*- 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
christianurich/VIBe2UrbanSim
3rdparty/opus/src/psrc_parcel/person_x_job/income_and_am_total_transit_time_walk_from_home_to_work.py
2
3483
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable class income_and_am_total_transit_time_walk_from_home_to_work(Variable): """ income * am_total_transit_time_walk_from_home_to_work""" ...
gpl-2.0
silly-wacky-3-town-toon/SOURCE-COD
toontown/coghq/SellbotMegaFactoryOilRoom_Battle00_Cogs.py
6
1037
from SpecImports import * import random from toontown.toonbase import ToontownGlobals CogParent = 10000 BattleCellId = 0 BattleCells = {BattleCellId: {'parentEntId': CogParent, 'pos': Point3(0, 0, 0)}} CogData = [{'parentEntId': CogParent, 'boss': 1, 'level': 12, 'battleCell': BattleCellId, 'pos...
apache-2.0
matsu777/sheepdog
lttng/request.py
6
5017
#! /usr/bin/env python3.4 # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # # 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. # # You should have received a copy of the...
gpl-2.0
rcbops/python-django-buildpackage
django/conf/locale/pt/formats.py
232
1532
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \de F \de Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \de F \de Y à...
bsd-3-clause
nan86150/ImageFusion
lib/python2.7/site-packages/numpy/core/tests/test_multiarray.py
23
175667
from __future__ import division, absolute_import, print_function import tempfile import sys import os import shutil import warnings import operator import io if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins from decimal import Decimal import numpy as np from nose import SkipT...
mit
thnee/ansible
lib/ansible/modules/cloud/vmware/vmware_host_service_manager.py
18
8837
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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...
gpl-3.0
littlstar/chromium.src
tools/cr/cr/commands/shell.py
103
1724
# Copyright 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. """A module for the shell command.""" import os import tempfile import cr class ShellCommand(cr.Command): """The implementation of the shell command. ...
bsd-3-clause
collmot/ardupilot
libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F427xx.py
11
21206
#!/usr/bin/env python ''' these tables are generated from the STM32 datasheets for the STM32F42x ''' # additional build information for ChibiOS build = { "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk", "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F4xx/platform.mk" ...
gpl-3.0
landism/pants
contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_variable_names.py
16
5217
# 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) from pants_test.cont...
apache-2.0
RO-ny9/python-for-android
python3-alpha/extra_modules/gdata/calendar/client.py
48
25016
#!/usr/bin/python # # Copyright (C) 2011 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 by applicable law ...
apache-2.0
Dhivyap/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_info.py
20
16298
#!/usr/bin/python # # Copyright (c) 2018 # Gustavo Muniz do Carmo <gustavo@esign.com.br> # Zim Kalinowski <zikalino@microsoft.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 ANSIB...
gpl-3.0
fllodrab/Practica1
venv/lib/python2.7/site-packages/werkzeug/testsuite/serving.py
98
3373
# -*- coding: utf-8 -*- """ werkzeug.testsuite.serving ~~~~~~~~~~~~~~~~~~~~~~~~~~ Added serving tests. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys import time try: import httplib except ImportError: from http import client as httplib ...
gpl-3.0
cevaris/commons
src/python/twitter/common/java/bin/java_inspect.py
16
1131
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
bowen0701/algorithms_data_structures
lc0167_two_sum_ii_Input_array_is_sorted.py
1
1396
"""Leetcode 167. Two Sum II - Input array is sorted Easy URL: https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two ...
bsd-2-clause
romixch/TicTacToeDeepBot
Learn.py
1
2537
import tensorflow as tf import pickle import model_helper import config import TicTacToe as ttt import numpy # Build model b = ttt.TicTacToe(config.board_size, config.board_size, config.runlength) x, y, pred, x_wins, o_wins, draw = model_helper.build_model(b.board_field_size, config.hidden_layers, config.hidden_layer...
gpl-3.0
manashmndl/kivy
kivy/uix/rst.py
24
32167
''' reStructuredText renderer ========================= .. versionadded:: 1.1.0 `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. .. warning:: This widget is highly experimental. The whole styling and im...
mit
drakuna/odoo
openerp/service/db.py
6
13522
# -*- coding: utf-8 -*- import json import logging import os import shutil import tempfile import threading import traceback import zipfile from functools import wraps from contextlib import closing import psycopg2 import openerp from openerp import SUPERUSER_ID from openerp.exceptions import UserError import opene...
gpl-3.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/mimetools.py
334
7168
"""Various tools used by MIME-reading or MIME-writing programs.""" import os import sys import tempfile from warnings import filterwarnings, catch_warnings with catch_warnings(): if sys.py3kwarning: filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning) import rfc822 from warnings ...
mit
nugget/home-assistant
tests/components/auth/test_login_flow.py
13
3388
"""Tests for the login flow.""" from unittest.mock import patch from . import async_setup_auth from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI async def test_fetch_auth_providers(hass, aiohttp_client): """Test fetching auth providers.""" client = await async_setup_auth(hass, aiohttp_client) resp...
apache-2.0
chokribr/invenioold
modules/miscutil/lib/dataciteutils_tester.py
16
5110
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
gpl-2.0
Pluto-tv/chromium-crosswalk
chrome/test/mini_installer/variable_expander.py
31
7100
# Copyright 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 base64 import hashlib import os import string import win32api import win32com.client from win32com.shell import shell, shellcon import win32security ...
bsd-3-clause
orgito/ansible
lib/ansible/vars/fact_cache.py
28
3285
# Copyright: (c) 2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2018, Ansible Project # 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 from ansible import constants a...
gpl-3.0
twilio/twilio-python
tests/integration/trusthub/v1/customer_profiles/test_customer_profiles_evaluations.py
1
36371
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class CustomerProfilesEvaluatio...
mit
ltiao/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
272
5245
""" 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_...
bsd-3-clause
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/build/android/buildbot/bb_annotations.py
172
1057
# Copyright 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. """Helper functions to print buildbot messages.""" def PrintLink(label, url): """Adds a link with name |label| linking to |url| to current buildbot step. ...
apache-2.0
wschwa/Mr-Orange-Sick-Beard
sickbeard/search.py
1
19836
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
kura/blackhole
docs/source/conf.py
1
11459
# -*- coding: utf-8 -*- # (The MIT License) # # Copyright (c) 2013-2021 Kura # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # ...
mit
ted-gould/nova
nova/tests/unit/test_safeutils.py
55
4340
# Copyright 2011 Justin Santa Barbara # # 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 l...
apache-2.0
ykim362/mxnet
example/module/lstm_bucketing.py
26
4053
# 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
pwoodworth/intellij-community
python/helpers/profiler/thrift/server/TServer.py
56
8504
# # 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
sudosurootdev/external_chromium_org
third_party/protobuf/python/google/protobuf/internal/test_util.py
210
27885
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
breavo/GitPython
git/test/performance/lib.py
5
2427
"""Contains library functions""" import logging import os import tempfile from git import ( Repo ) from git.db import ( GitCmdObjectDB, GitDB ) from git.test.lib import ( TestBase ) from git.util import rmtree import os.path as osp #{ Invariants k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" #} EN...
bsd-3-clause
ealegol/kolla-newton
docker/swift/swift-base/build-swift-ring.py
7
3181
#!/usr/bin/env python # Copyright 2015 Paul Bourke # # 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
Qwlouse/Findeco
microblogging/tests/test_post.py
1
4832
#!/usr/bin/python # coding=utf-8 # region License # Findeco is dually licensed under GPLv3 or later and MPLv2. # ################################################################################ # Copyright (c) 2012 Klaus Greff <klaus.greff@gmx.net> # This file is part of Findeco. # # Findeco is free software; you can r...
gpl-3.0
0xffea/keystone
keystone/contrib/admin_crud/core.py
6
7746
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
apache-2.0
liavkoren/djangoDev
tests/indexes/tests.py
6
1551
from unittest import skipUnless from django.core.management.color import no_style from django.db import connections, DEFAULT_DB_ALIAS from django.test import TestCase from .models import Article, IndexTogetherSingleList class IndexesTests(TestCase): def test_index_together(self): connection = connection...
bsd-3-clause
semio/zipline
tests/utils/test_events.py
20
12209
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
saquiba2/numpytry
numpy/testing/tests/test_utils.py
18
27128
from __future__ import division, absolute_import, print_function import warnings import sys import numpy as np from numpy.testing import ( assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, build_err_msg, raises, assert_raises, assert_warns, assert_no_warnings, assert_allclo...
bsd-3-clause
sfam/home-assistant
homeassistant/components/demo.py
4
4115
""" homeassistant.components.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up a demo environment that mimics interaction with devices. """ import time import homeassistant.core as ha import homeassistant.bootstrap as bootstrap import homeassistant.loader as loader from homeassistant.const import ( CONF_PLATFORM, ATTR_E...
mit
suncycheng/intellij-community
python/lib/Lib/xml/sax/handler.py
109
14076
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id: handler.py,v ...
apache-2.0
mancoast/CPythonPyc_test
fail/321_test_import.py
47
24643
import builtins import imp from importlib.test.import_ import test_relative_imports from importlib.test.import_ import util as importlib_util import marshal import os import py_compile import random import stat import sys import unittest import textwrap from test.support import ( EnvironmentVarGuard, TESTFN, check...
gpl-3.0
ewindisch/nova
nova/tests/integrated/v3/test_flavor_rxtx.py
20
1718
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
matthiasdiener/spack
var/spack/repos/builtin/packages/r-sourcetools/package.py
5
1737
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
multikatt/CouchPotatoServer
libs/subliminal/exceptions.py
170
1050
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
snnn/tensorflow
tensorflow/python/ops/check_ops.py
2
46872
# 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
CRImier/yowsup
yowsup/layers/auth/protocolentities/success.py
69
1659
from yowsup.structs import ProtocolEntity, ProtocolTreeNode class SuccessProtocolEntity(ProtocolEntity): def __init__(self, status, kind, creation, expiration, props, t, nonce = None): super(SuccessProtocolEntity, self).__init__("success") self.status = status self.kind = kind self.c...
gpl-3.0
paypal/keystone
keystone/common/ldap/core.py
1
21476
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
apache-2.0
jazkarta/edx-platform
common/lib/xmodule/xmodule/course_module.py
7
62308
""" Django module container for classes and operations related to the "Course Module" content type """ import logging from cStringIO import StringIO from math import exp from lxml import etree from path import path # NOTE (THK): Only used for detecting presence of syllabus import requests from datetime import datetime...
agpl-3.0
CiscoSystems/vespa
neutron/common/test_lib.py
7
2317
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
apache-2.0
eonpatapon/contrail-controller
src/container/mesos-cni/setup.py
3
1568
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import setuptools, re import os class RunTestsCommand(setuptools.Command): description = "Test command to run testr in virtualenv" user_options = [ ('coverage', 'c', "Generate code coverage report"), ] boolean_op...
apache-2.0
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/synthesizer/gui/file_menu/summary_page.py
2
8064
# PopGen 1.1 is A Synthetic Population Generator for Advanced # Microsimulation Models of Travel Demand # Copyright (C) 2009, Arizona State University # See PopGen/License from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtSql import * from misc.widgets import * import os, shutil class...
gpl-2.0
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/response_py3.py
1
2175
# 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
sebastic/QGIS
python/plugins/processing/algs/grass/GrassAlgorithmProvider.py
3
4690
# -*- coding: utf-8 -*- """ *************************************************************************** GrassAlgorithmProvider.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************...
gpl-2.0
dcherian/pyroms
examples/Bering/ini_bering_2000.py
2
1033
import pyroms import pyroms_toolbox src_varname = ['zeta','uice','vice','aice','hice','tisrf','snow_thick', \ 'sfwat','ageice','ti','sig11','sig12','sig22','t0mk', \ 's0mk','temp','salt','u','v'] # Change src_filename to your directory for the file's containing variable data src_filename...
bsd-3-clause
chouseknecht/ansible
lib/ansible/modules/network/fortios/fortios_router_auth_path.py
13
10412
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0