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
baklanovp/pystella
pystella/rf/light_curve_func.py
1
14550
import csv import os import numpy as np from .rad_func import Fnu2Fwl, Fwl2Fnu from pystella.util.phys_var import phys from pystella.model.stella import Stella from . import extinction from .lc import LightCurve, SetLightCurve from .reddening import ReddeningLaw from .reddening import LawFitz __author__ = 'bakl' # ...
mit
JakeLowey/HackRPI2
django/core/serializers/pyyaml.py
81
2170
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ from StringIO import StringIO import decimal import yaml from django.db import models from django.core.serializers.base import DeserializationError from django.core.serializers.python import Serializer as PythonSeriali...
mit
farhaanbukhsh/networkx
networkx/tests/test_convert_scipy.py
31
9362
from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_equal, raises import networkx as nx from networkx.testing import assert_graphs_equal from networkx.generators.classic import barbell_graph,cycle_graph,path_graph from networkx.testing.utils import assert_graphs_equal class TestConver...
bsd-3-clause
walke469/spartahack-17
ballotbuilder/lib/python3.5/site-packages/flask/globals.py
322
1645
# -*- coding: utf-8 -*- """ flask.globals ~~~~~~~~~~~~~ Defines all the global objects that are proxies to the current active context. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import partial from werkzeug.local import LocalStack, ...
bsd-2-clause
AnimeshSinha1309/WebsiteEdunet
WebsiteEdunet/env/Lib/site-packages/django/contrib/postgres/fields/array.py
31
9172
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, IntegerField, Transform from django.db.models.lookups ...
mit
jonpetersen/transitfeed-1.2.12
test/testfeedvalidator.py
1
21144
#!/usr/bin/python2.5 # Copyright (C) 2007 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 la...
apache-2.0
danakj/chromium
chrome/tools/webforms_aggregator_tests.py
185
1970
#!/usr/bin/env python # Copyright (c) 2011 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 tempfile import unittest import webforms_aggregator class WebformsAggregatorTest(unittest.TestCase): """Unit ...
bsd-3-clause
lwiecek/django
tests/datatypes/tests.py
43
4253
from __future__ import unicode_literals import datetime from django.test import TestCase, skipIfDBFeature from django.utils import six from django.utils.timezone import utc from .models import Donut, RumBaba class DataTypesTestCase(TestCase): def test_boolean_type(self): d = Donut(name='Apple Fritter'...
bsd-3-clause
leonardowolf/bookfree
flask/lib/python3.5/site-packages/click/types.py
196
18864
import os import stat from ._compat import open_stream, text_type, filename_to_ui, \ get_filesystem_encoding, get_streerror, _get_argv_encoding, PY2 from .exceptions import BadParameter from .utils import safecall, LazyFile class ParamType(object): """Helper for converting values through types. The followin...
mit
DaniilLeksin/theblog
env/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py
52
36360
from django.db import connections from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis import memoryview from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField from django.contrib....
gpl-2.0
trenton3983/Fluent_Python
attic/concurrency/charfinder/charfinder.py
6
6544
#!/usr/bin/env python3 """ Unicode character finder utility: find characters based on words in their official names. This can be used from the command line, just pass words as arguments. Here is the ``main`` function which makes it happen:: >>> main('rook') # doctest: +NORMALIZE_WHITESPACE U+2656 ♖ WHITE...
mit
cosmiclattes/TPBviz
torrent/lib/python2.7/site-packages/django/utils/cache.py
105
11097
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
gpl-3.0
nathanaevitas/odoo
openerp/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
sstoma/CellProfiler
tutorial/example5b_objectmeasurements_overlapped.py
3
6157
'''<b>Example 5</b> Object measurements <hr> ''' import numpy as np import scipy.ndimage import cellprofiler.cpmodule as cpm import cellprofiler.measurements as cpmeas import cellprofiler.settings as cps C_EXAMPLE5 = "Example5" FTR_MEAN_DISTANCE = "MeanDistance" M_MEAN_DISTANCE = "_".join((C_EXAMPLE5, FTR_MEAN_DISTA...
gpl-2.0
kemalakyol48/python-for-android
python3-alpha/python3-src/PC/VC6/build_ssl.py
48
8353
# Script for building the _ssl module for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session # for _ssl.pyd itself. # THEORETICALLY, you can: # * Unpack the latest SSL release one level above your main Python source # directory. It is likely you ...
apache-2.0
piotrpawlaczek/suds-jurko
suds/sax/date.py
9
13980
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
maciek263/django2
myvenv/Lib/site-packages/setuptools/command/egg_info.py
100
16824
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys try: from setuptools_s...
mit
krafczyk/spack
var/spack/repos/builtin/packages/wannier90/package.py
2
3874
############################################################################## # 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
digitalyuki/wordpress-site
scripts/launch_stack.py
1
3188
#!/usr/bin/python import subprocess import argparse import os import json from datetime import datetime from pprint import pprint from subprocess import Popen, PIPE now = datetime.now() now_stamp = now.strftime('%Y%m%d-%H%M%S') stack_name = "HAWordpress" template_filename = "wordpress-multi-az-us-east-1-template.json...
mit
ArcherSys/ArcherSys
Lib/site-packages/cms/test_utils/project/extensionapp/models.py
28
1088
# -*- coding: utf-8 -*- import django from django.conf import settings from django.contrib.auth.models import User from django.db import models from cms.extensions import PageExtension, TitleExtension from cms.extensions.extension_pool import extension_pool from distutils.version import LooseVersion class MyPageEx...
mit
helldorado/ansible
lib/ansible/modules/cloud/amazon/ec2_ami_facts.py
27
8693
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: ec2_a...
gpl-3.0
richpolis/siveinpy
env/lib/python2.7/site-packages/django/db/models/base.py
92
45515
from __future__ import unicode_literals import copy import sys from functools import update_wrapper from django.utils.six.moves import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObject...
mit
av8ramit/tensorflow
tensorflow/python/keras/applications/vgg16/__init__.py
75
1127
# 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
okwow123/djangol2
allauth/socialaccount/providers/linkedin_oauth2/provider.py
6
2294
from allauth.socialaccount import app_settings from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class LinkedInOAuth2Account(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('publicProf...
mit
batpad/mezzanine
mezzanine/forms/forms.py
2
18056
from __future__ import unicode_literals from future.builtins import int, range, str from datetime import date, datetime from os.path import join, split from uuid import uuid4 from django import forms from django.forms.extras import SelectDateWidget from django.core.files.storage import FileSystemStorage from django.c...
bsd-2-clause
miguelparaiso/PracticaOdoo
addons/google_calendar/__openerp__.py
299
1671
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 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
muupan/chainer
chainer/functions/activation/softmax.py
5
3085
import numpy from chainer import cuda from chainer import function from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn _algorithm = libcudnn.CUDNN_SOFTMAX_ACCURATE _mode = libcudnn.CUDNN_SOFTMAX_MODE_CHANNEL class Softmax(function.Function): """...
mit
flotre/sickbeard-vfvo
sickbeard/clients/requests/packages/urllib3/contrib/ntlmpool.py
262
4740
# urllib3/contrib/ntlmpool.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
gpl-3.0
missionpinball/mpf
mpf/tests/test_BallDeviceSingle.py
1
1240
from mpf.tests.MpfGameTestCase import MpfGameTestCase class TestBallDeviceSingle(MpfGameTestCase): def get_platform(self): return "smart_virtual" def get_config_file(self): return 'test_single_device.yaml' def get_machine_path(self): return 'tests/machine_files/ball_device/' ...
mit
subfusc/anki
aqt/profiles.py
14
11972
# Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # Profile handling ########################################################################## # - Saves in pickles rather than json to easily store Qt window state. # - Saves in sqlite rather than ...
agpl-3.0
chiviak/headphones
lib/unidecode/x09d.py
252
4632
data = ( 'Fou ', # 0x00 'Yiao ', # 0x01 'Jue ', # 0x02 'Jue ', # 0x03 'Pi ', # 0x04 'Huan ', # 0x05 'Zhen ', # 0x06 'Bao ', # 0x07 'Yan ', # 0x08 'Ya ', # 0x09 'Zheng ', # 0x0a 'Fang ', # 0x0b 'Feng ', # 0x0c 'Wen ', # 0x0d 'Ou ', # 0x0e 'Te ', # 0x0f 'Jia ', # 0x10 'N...
gpl-3.0
mihail911/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pyparsing.py
72
143924
# module pyparsing.py # # Copyright (c) 2003-2008 Paul T. McGuire # # 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 to use, cop...
gpl-3.0
davidmalcolm/pygobject
demos/gtk-demo/demos/appwindow.py
3
13905
#!/usr/bin/env python # -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2010 Red Hat, Inc., John (J5) Palmieri <johnp@redhat.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License a...
lgpl-2.1
Engr-Kaka/video-player-sample
source/core/js/libs/closure-library/closure/bin/build/closurebuilder.py
16
8428
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
apache-2.0
mousepawgames/diamondquest
src/diamondquest/view/map/block.py
1
2672
import pygame from diamondquest.common.constants import TEXTURE_RES from diamondquest.common import Color, Resolution from diamondquest.common import loader from diamondquest.model.map import ( BlockType, TreasureVariant, MantleVariant, Decoration, ) from diamondquest.view.window import Window class ...
gpl-3.0
molpopgen/pylibseq
setup.py
2
6464
from setuptools import setup, Extension from setuptools.command.build_ext import build_ext import sys import setuptools import subprocess import platform import os import glob if sys.version_info < (3, 4): raise RuntimeError("Python >= 3.4 required") __version__ = '0.2.3' # clang/llvm is default for OS X builds....
gpl-3.0
ewandor/home-assistant
homeassistant/components/config/customize.py
13
1259
"""Provide configuration end points for Customize.""" import asyncio from homeassistant.components.config import EditKeyBasedConfigView from homeassistant.components import async_reload_core_config from homeassistant.config import DATA_CUSTOMIZE import homeassistant.helpers.config_validation as cv CONFIG_PATH = 'cus...
apache-2.0
mgit-at/ansible
lib/ansible/modules/identity/ipa/ipa_host.py
74
10421
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
redhat-openstack/horizon
openstack_dashboard/dashboards/project/loadbalancers/forms.py
45
12071
# Copyright 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 agre...
apache-2.0
vijayanandnandam/youtube-dl
youtube_dl/extractor/vbox7.py
62
3413
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class Vbox7IE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?:[^/]+\.)?vbox7\.com/ (?: ...
unlicense
littlednet/mps-prototypes
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/gyptest.py
1752
8019
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
mit
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/third_party/gsutil/gslib/util.py
45
5074
# Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
mit
open-power-ref-design/os-services
osa/dbaas_ui/dbaas_ui/instances/tables.py
2
9569
# Copyright 2017, IBM US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
40223246/0622cdb-Final-TEST2-1
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/compat.py
603
3054
"""Python 2.x/3.x compatibility tools""" import sys __all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_', 'unicode_', 'raw_input_', 'as_bytes', 'as_unicode'] def geterror (): return sys.exc_info()[1] try: long_ = long except NameError: long_ = int try: xrange_ = xrange except Nam...
gpl-3.0
BT-fgarbely/l10n-switzerland
l10n_ch_sepa/wizard/__init__.py
16
1030
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2011 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
Bourneer/scrapy
tests/test_item.py
129
7291
import unittest from scrapy.item import Item, Field import six class ItemTest(unittest.TestCase): def assertSortedEqual(self, first, second, msg=None): return self.assertEqual(sorted(first), sorted(second), msg) def test_simple(self): class TestItem(Item): name = Field() ...
bsd-3-clause
eXcomm/OpenBazaar-Server
dht/crawling.py
7
6904
""" Copyright (c) 2014 Brian Muller Copyright (c) 2015 OpenBazaar """ from collections import Counter from twisted.internet import defer from log import Logger from dht.utils import deferredDict from dht.node import Node, NodeHeap from protos import objects class SpiderCrawl(object): """ Crawl the network...
mit
drpeteb/scipy
scipy/sparse/sputils.py
6
12881
""" Utility functions for sparse matrix module """ from __future__ import division, print_function, absolute_import __all__ = ['upcast','getdtype','isscalarlike','isintlike', 'isshape','issequence','isdense','ismatrix'] import warnings import numpy as np from scipy._lib._version import NumpyVersion # k...
bsd-3-clause
elkingtowa/pyrake
tests/test_downloadermiddleware_useragent.py
1
2224
from unittest import TestCase from pyrake.spider import Spider from pyrake.http import Request from pyrake.contrib.downloadermiddleware.useragent import UserAgentMiddleware from pyrake.utils.test import get_crawler class UserAgentMiddlewareTest(TestCase): def get_spider_and_mw(self, default_useragent): ...
mit
gojira/tensorflow
tensorflow/contrib/distribute/python/shared_variable_creator_test.py
20
2535
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
baris/fullerite
src/diamond/collectors/bind/test/testbind.py
36
7707
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from bind import Bin...
apache-2.0
CompassionCH/l10n-switzerland
l10n_ch_zip/models/better_zip.py
1
2490
# -*- coding: utf-8 -*- # Copyright 2011-2017 Camptocamp SA # Copyright 2014 Olivier Jossen (brain-tec AG) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields class ResBetterZip(models.Model): """ Inherit res.better.zip class in order to add swiss specific fields F...
agpl-3.0
ddki/my_study_project
language/python/frameworks/flask/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py
2715
30098
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
mit
mlaitinen/odoo
addons/portal_stock/__openerp__.py
437
1600
# -*- 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
Adel-Magebinary/odoo
addons/crm_partner_assign/report/crm_lead_report.py
309
5104
# -*- 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
Ghost-script/dyno-chat
kickchat/apps/pulsar/async/eventloop.py
1
3971
import os import asyncio from threading import current_thread from .access import thread_data, LOGGER from .futures import Future, maybe_async, async, Task from .threads import run_in_executor, QueueEventLoop, set_as_loop __all__ = ['EventLoop', 'call_repeatedly', 'loop_thread_id'] class EventLoopPolicy(asyncio.Ab...
gpl-2.0
campbe13/openhatch
vendor/packages/scrapy/scrapy/xlib/pydispatch/robust.py
25
1857
"""Module implementing error-catching version of send (sendRobust)""" from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, getAllReceivers from scrapy.xlib.pydispatch.robustapply import robustApply def sendRobust( signal=Any, sender=Anonymous, *arguments, **named ): """Send signal from se...
agpl-3.0
marqueedev/django
django/db/models/options.py
6
35477
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import AutoFiel...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/operations/_application_type_versions_operations.py
1
28866
# 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
TomRegan/ccProject
lib/gtest-1.7.0/test/gtest_color_test.py
3259
4911
#!/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
helenst/django
tests/initial_sql_regress/tests.py
46
1556
from django.core.management.color import no_style from django.core.management.sql import custom_sql_for_model from django.db import connections, DEFAULT_DB_ALIAS from django.test import TestCase, override_settings from .models import Simple class InitialSQLTests(TestCase): """ The format of the included SQL ...
bsd-3-clause
eonpatapon/nova
nova/image/s3.py
38
17754
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
shssoichiro/servo
tests/wpt/css-tests/tools/html5lib/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
mpl-2.0
baloo/shinken
test/test_service_withhost_exclude.py
1
1735
#!/usr/bin/env python2.6 #Copyright (C) 2009-2010 : # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # #This file is part of Shinken. # #Shinken is free software: you can redistribute it and/or modify #it under the terms of the GNU Affero General Public License as published by #the Fr...
agpl-3.0
randyzingle/tools
kub/services/archive/cdk/python/sample-app/.env/lib/python3.6/site-packages/pip/_vendor/urllib3/connectionpool.py
7
36446
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket from .exceptions import ( ClosedPoolError, ProtocolError, EmptyPoolError, HeaderParsingError, HostChangedError, Locatio...
apache-2.0
tchellomello/home-assistant
tests/components/plex/test_media_players.py
7
3174
"""Tests for Plex media_players.""" from plexapi.exceptions import NotFound from homeassistant.components.plex.const import DOMAIN, SERVERS from .const import DEFAULT_DATA, DEFAULT_OPTIONS from .mock_classes import MockPlexAccount, MockPlexServer from tests.async_mock import patch from tests.common import MockConfig...
apache-2.0
Ms2ger/presto-testo
css/image-fit/reftests/video-poster-jpg-wide/build.py
4
4441
#!/usr/bin/python import sys import os sys.path.insert(0, os.path.abspath("../../include/")) import allpairs_v imgfilename = 'wide.jpg' imgwidth = 240.0 imgheight = 128.0 test_template = """<!doctype html> <!-- This file is generated by build.py. --> <title>video %s; %s</title> <link rel="stylesheet" href="../../supp...
bsd-3-clause
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py
3127
1902
######################## 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...
gpl-2.0
nzinfo/ElasticSphinx
space/jsonfy.py
1
4592
try: from simplejson import JSONEncoder except ImportError: # pragma: no cover from json import JSONEncoder # noqa from datetime import datetime, date from decimal import Decimal # depending on the version WebOb might have 2 types of dicts try: # WebOb <= 1.1.1 from webob.mu...
apache-2.0
dparnell/rethinkdb
test/rql_test/connections/http_support/flask/testsuite/regression.py
563
3198
# -*- coding: utf-8 -*- """ flask.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests regressions. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import gc import sys import flask import threading import unittest from werkzeug.exceptions impor...
agpl-3.0
theguardian/headphones
lib/unidecode/x1d5.py
248
3839
data = ( 'w', # 0x00 'x', # 0x01 'y', # 0x02 'z', # 0x03 'A', # 0x04 'B', # 0x05 '', # 0x06 'D', # 0x07 'E', # 0x08 'F', # 0x09 'G', # 0x0a '', # 0x0b '', # 0x0c 'J', # 0x0d 'K', # 0x0e 'L', # 0x0f 'M', # 0x10 'N', # 0x11 'O', # 0x12 'P', # 0x13 'Q', # 0x14...
gpl-3.0
aequitas/home-assistant
tests/components/http/test_real_ip.py
15
3351
"""Test real IP middleware.""" from aiohttp import web from aiohttp.hdrs import X_FORWARDED_FOR from ipaddress import ip_network from homeassistant.components.http.real_ip import setup_real_ip from homeassistant.components.http.const import KEY_REAL_IP async def mock_handler(request): """Return the real IP as te...
apache-2.0
leekchan/django_test
tests/forms_tests/tests/test_media.py
62
45615
# -*- coding: utf-8 -*- from django.forms import Media, TextInput, CharField, Form, MultiWidget from django.template import Template, Context from django.test import TestCase, override_settings @override_settings( STATIC_URL=None, MEDIA_URL='http://media.example.com/media/', ) class FormsMediaTestCase(TestCas...
bsd-3-clause
IKholopov/HackUPC2017
hackupc/env/lib/python3.5/site-packages/django/utils/archive.py
59
7042
""" Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/ Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors. 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 So...
apache-2.0
marcellodesales/svnedge-console
ext/windows/pkg-toolkit/pkg/vendor-packages/pkg/bundle/TarBundle.py
4
2724
#!/usr/bin/python2.4 # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://w...
agpl-3.0
lepricon49/headphones
lib/unidecode/x02a.py
148
3589
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
gpl-3.0
xiaoyaozi5566/DiamondCache
src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_mask.py
91
4079
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
quoclieu/codebrew17-starving
env/lib/python3.5/site-packages/eventlet/debug.py
14
6326
"""The debug module contains utilities and functions for better debugging Eventlet-powered applications.""" from __future__ import print_function import os import sys import linecache import re import inspect __all__ = ['spew', 'unspew', 'format_hub_listeners', 'format_hub_timers', 'hub_listener_stacks', '...
mit
andoma/movian
ext/libyuv/tools/valgrind-libyuv/libyuv_tests.py
13
5222
#!/usr/bin/env python # Copyright (c) 2012 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
gpl-3.0
Thhhza/XlsxWriter
xlsxwriter/test/comparison/test_header_image06.py
8
1461
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
UNINETT/nav
tests/unittests/api/api_test.py
2
1277
# -*- coding: utf-8 -*- from mock import Mock from nav.web.api.v1.auth import TokenPermission def test_path_in_endpoints(): path = '/api/1/room/' endpoints = {'room': '/api/1/room/'} assert TokenPermission.is_path_in_endpoints(path, endpoints) def test_missing_slashes(): path = '/api/1/room/' ...
gpl-2.0
adityaduggal/erpnext
erpnext/hr/report/employee_leave_balance/employee_leave_balance.py
30
2110
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.hr.doctype.leave_application.leave_application \ import get_leave_allocation_records, get_leave_balance...
gpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_extensions_operations.py
1
15005
# 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
ScottHull/Exoplanet-Pocketknife
old/hefestofilewriter.py
1
8686
import os import shutil import pandas as pd class _AtomicWeights: def __init__(self): self.fe = 55.845 self.mg = 24.305 self.si = 28.086 self.ca = 40.078 self.al = 26.982 self.ti = 47.867 self.na = 22.99 self.o = 15.99 class _OxideCationNumbers: ...
cc0-1.0
luoguizhou/gooderp_addons
asset/tests/test_asset.py
1
10951
# -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase from odoo.exceptions import UserError class TestAsset(TransactionCase): def setUp(self): '''固定资产准备数据''' super(TestAsset, self).setUp() self.asset = self.env.ref('asset.asset_car') def test_unlink(self): '''...
agpl-3.0
gauribhoite/personfinder
env/site-packages/docutils/languages/es.py
148
1962
# -*- coding: utf-8 -*- # $Id: es.py 4572 2006-05-25 20:48:37Z richieadler $ # Author: Marcelo Huerta San Martín <richieadler@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net...
apache-2.0
niranjan-hanumegowda/chef-repo
cookbooks/logstash/files/default/logstash_index_cleaner.py
3
6725
#!/usr/bin/env python # # Deletes all indices with a datestamp older than "days-to-keep" for daily # if you have hourly indices, it will delete all of those older than "hours-to-keep" # # This script presumes an index is named typically, e.g. logstash-YYYY.MM.DD # It will work with any name-YYYY.MM.DD or name-YYYY.MM.D...
apache-2.0
janelia-flyem/neuroglancer
python/tests/annotation_tool_test.py
2
3101
# @license # Copyright 2020 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 or agreed to in...
apache-2.0
andersonresende/django
django/contrib/flatpages/templatetags/flatpages.py
100
3633
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): se...
bsd-3-clause
jfarrell/thrift
test/crossrunner/test.py
17
5241
# # 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
marcosdiez/ansible-modules-extras
cloud/google/gce_tag.py
29
6381
#!/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
mikrosimage/rez
src/rez/utils/yaml.py
1
3278
from rez.utils.data_utils import SourceCode from rez.vendor import yaml from rez.vendor.yaml.dumper import SafeDumper from rez.vendor.yaml.nodes import ScalarNode, MappingNode from rez.vendor.version.version import Version from rez.vendor.version.requirement import Requirement from types import FunctionType, BuiltinFun...
lgpl-3.0
aycanirican/nixops
nixops/resources/azure_availability_set.py
6
5352
# -*- coding: utf-8 -*- # Automatic provisioning of Azure availability sets. import os import azure from nixops.util import attr_property from nixops.azure_common import ResourceDefinition, ResourceState, normalize_location from azure.mgmt.compute import AvailabilitySet class AzureVirtualNetworkDefinition(Resource...
lgpl-3.0
e0ne/python-brickagentclient
brickclient/v1/connector.py
1
1052
# Copyright 2011 OpenStack Foundation # # 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 w...
apache-2.0
Fireblend/chromium-crosswalk
tools/telemetry/telemetry/core/android_app.py
20
1250
# Copyright 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. from telemetry.core import app class AndroidApp(app.App): """A running android app instance that can be controlled in a limited way. Be sure to clean ...
bsd-3-clause
arborh/tensorflow
tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py
5
11770
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
40223104/test_lego
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_loader.py
738
49593
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
gpl-3.0
bjori/grpc
src/python/grpcio_test/grpc_interop/methods.py
8
14975
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
mskrzypkows/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_mux.py
427
91852
#!/usr/bin/env python # # Copyright 2012, 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
cricketclubucd/davisdragons
platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-edgedata/script.py
23
1384
import toplevel_existing import toplevel_nonexisting class MyClass: import toplevel_class_existing import toplevel_class_nonexisting if a == b: import toplevel_conditional_existing import toplevel_conditional_nonexisting try: import toplevel_conditional_import_existing import top...
mit