repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
sjlehtin/django
tests/foreign_object/test_empty_join.py
61
1476
from django.test import TestCase from .models import SlugPage class RestrictedConditionsTests(TestCase): def setUp(self): slugs = [ 'a', 'a/a', 'a/b', 'a/b/a', 'x', 'x/y/z', ] SlugPage.objects.bulk_create([SlugPage(sl...
bsd-3-clause
lombritz/odoo
addons/report_webkit/header.py
342
4626
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
agpl-3.0
OpenAcademy-OpenStack/nova-scheduler
nova/version.py
15
2486
# 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 l...
apache-2.0
was4444/chromium.src
chrome/browser/resources/chromeos/chromevox/tools/jscompilerwrapper.py
42
2419
#!/usr/bin/env python # Copyright 2014 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. '''Uses the closure compiler to check syntax and semantics of a js module with dependencies.''' import os import re import subprocess...
bsd-3-clause
davidwilson-85/easymap
scripts_snp/af-comparison.py
1
3689
import argparse parser = argparse.ArgumentParser() parser.add_argument('-f2_mut', action="store", dest = 'input_mut') parser.add_argument('-f2_wt', action="store", dest = 'input_wt') parser.add_argument('-out', action="store", dest = 'output') parser.add_argument('-f_input', action="store", dest = 'f_input') parser.ad...
gpl-3.0
rexshihaoren/scikit-learn
doc/sphinxext/gen_rst.py
142
40026
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from __future__ import division, print_function from time import time import ast import os import re import shutil import traceback i...
bsd-3-clause
drglove/SickRage
lib/requests/packages/urllib3/__init__.py
51
1861
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = 'dev' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encod...
gpl-3.0
rajanandakumar/DIRAC
AccountingSystem/Client/Types/BaseAccountingType.py
11
5726
# $HeadURL$ __RCSID__ = "$Id$" import types from DIRAC import S_OK, S_ERROR from DIRAC.Core.Utilities import Time from DIRAC.Core.DISET.RPCClient import RPCClient from DIRAC.AccountingSystem.Client.DataStoreClient import gDataStoreClient class BaseAccountingType: __validDataValues = ( types.IntType, types.LongType...
gpl-3.0
andrewsmedina/horizon
horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py
1
4720
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nebula, 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 # # ...
apache-2.0
ptisserand/portage
pym/portage/tests/locks/test_lock_nonblock.py
16
1629
# Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import tempfile import traceback import portage from portage import os from portage import shutil from portage.tests import TestCase class LockNonblockTestCase(TestCase): def _testLockNonblock(self): tempdir = t...
gpl-2.0
getavalon/core
avalon/nuke/command.py
2
3576
import logging import contextlib import nuke from .. import api, io log = logging.getLogger(__name__) def reset_frame_range(): """ Set frame range to current asset Also it will set a Viewer range with displayed handles """ fps = float(api.Session.get("AVALON_FPS", 25)) nuke.root(...
mit
charanpald/wallhack
wallhack/viroscopy/ContactGrowthStatistics.py
1
49412
import logging import sys import gc import numpy import os.path import matplotlib.pyplot as plt from datetime import date from sandbox.util.PathDefaults import PathDefaults from sandbox.util.DateUtils import DateUtils from sandbox.util.Latex import Latex from sandbox.util.Util import Util from apgl.graph import * fro...
gpl-3.0
pigeonflight/strider-plone
docker/appengine/lib/django-1.2/django/contrib/gis/geos/prototypes/__init__.py
79
1355
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \ cs_clone, cs_getordinate, cs_setordinate, c...
mit
blooparksystems/odoo
addons/mrp_repair/wizard/make_invoice.py
45
2203
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class make_invoice(osv.osv_memory): _name = 'mrp.repair.make_invoice' _description = 'Make Invoice' _columns = { 'group': fields.boolean('Group by partner invo...
gpl-3.0
pywinauto/pywinauto
pywinauto/controls/hwndwrapper.py
1
67694
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
bsd-3-clause
drayanaindra/shoop
shoop_tests/simple_cms/test_date_logic.py
7
1781
# This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import datetime from django.utils.timezone import now import pytest from shoop.simple_cms.models im...
agpl-3.0
econchick/heroku-buildpack-python
vendor/pip-1.2.1/setup.py
10
2142
import sys import os from setuptools import setup # If you change this version, change it also in docs/conf.py version = "1.1" doc_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "docs") index_filename = os.path.join(doc_dir, "index.txt") news_filename = os.path.join(doc_dir, "news.txt") long_descripti...
mit
sigmavirus24/pip
pip/baseparser.py
2
7460
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip.configuration import Configuration from pip.utils import get_terminal_size class PrettyHelpFormatter(optparse.Indent...
mit
fyffyt/scikit-learn
sklearn/preprocessing/tests/test_data.py
71
38516
import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils.testing import assert_almost_equal, clean_warning_registry from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal...
bsd-3-clause
txm/potato
django/utils/simplejson/__init__.py
324
14306
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
bsd-3-clause
arthru/OpenUpgrade
addons/website_event/controllers/main.py
22
11582
# -*- 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
sunlibin/incubator-eagle
eagle-external/eagle-ambari/lib/EAGLE/package/scripts/eagle_userprofile_scheduler.py
21
3209
#!/usr/bin/python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Licen...
apache-2.0
OCA/stock-logistics-barcode
stock_barcodes/tests/test_stock_barcodes_picking.py
1
9539
# Copyright 2108-2019 Sergio Teruel <sergio.teruel@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.addons.stock_barcodes.tests.test_stock_barcodes import\ TestStockBarcodes class TestStockBarcodesPicking(TestStockBarcodes): def setUp(self): super().setUp() ...
agpl-3.0
grue/django-allauth
allauth/socialaccount/providers/weibo/views.py
80
1132
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import WeiboProvider class WeiboOAuth2Adapter(OAuth2Adapter...
mit
musicmetric/mmpy
src/releasegroup.py
1
2354
from entity import * class Releasegroup(Entity): """ wraps the ReleaseGroup entity type as described at http://developer.musicmetric.com all timeseries are attributes of the form self.<type>_<source>, which sets a dict if there's data """ summary_attrs = ("name", "id", "description", "artist") ...
isc
xwolf12/django
tests/m2m_and_m2o/tests.py
383
2711
from django.db.models import Q from django.test import TestCase from .models import Issue, UnicodeReferenceModel, User class RelatedObjectTests(TestCase): def test_related_objects_have_name_attribute(self): for field_name in ('test_issue_client', 'test_issue_cc'): obj = User._meta.get_field(...
bsd-3-clause
popazerty/test-1
lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py
51
8243
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.HelpMenu import HelpableScreen from Components.ActionMap import HelpableActionMap, ActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Prog...
gpl-2.0
chartjes/liesitoldmykids
defensio/__init__.py
1
4092
import sys def is_python3(): return sys.version_info[0] == 3 if is_python3(): import urllib.parse import http.client else: import urllib import httplib import simplejson as json API_VERSION = '2.0' API_HOST = 'api.defensio.com' LIB_VERSION = '0.9.1' ROOT_NODE = 'defensio-result' FORMAT = 'json' ...
mit
ecordell/pymacaroons
tests/functional_tests/serialization_tests.py
1
4067
from nose.tools import * from pymacaroons import Macaroon, Verifier, MACAROON_V1, MACAROON_V2 from pymacaroons.serializers import JsonSerializer class TestSerializationCompatibility(object): def setup(self): pass def test_from_go_macaroon_json_v2(self): # The following macaroon have been gen...
mit
OptiPop/external_chromium_org
tools/site_compare/scrapers/chrome/chromebase.py
189
5358
#!/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. """Does scraping for all currently-known versions of Chrome""" import pywintypes import types from drivers import keyboard from d...
bsd-3-clause
MostlyOpen/odoo_addons_jcafb
myo_address_cst/__openerp__.py
1
1808
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by #...
agpl-3.0
nuobit/odoo-addons
connector_ambugest/models/res_partner/binding.py
1
1728
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import models, fields from odoo.addons.component.core import Component from odoo.addons.queue_job.job import job class ResPartner(models.Model):...
agpl-3.0
jasonbot/django
django/utils/jslex.py
251
7779
"""JsLex: a lexer for Javascript""" # Originally from https://bitbucket.org/ned/jslex from __future__ import unicode_literals import re class Tok(object): """ A specification for a token class. """ num = 0 def __init__(self, name, regex, next=None): self.id = Tok.num Tok.num += 1...
bsd-3-clause
hyiltiz/youtube-dl
youtube_dl/extractor/tvp.py
132
4801
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class TvpIE(InfoExtractor): IE_NAME = 'tvp.pl' _VALID_URL = r'https?://(?:vod|www)\.tvp\.pl/.*/(?P<id>\d+)$' _TESTS = [{ 'url': 'http://vod.tvp.pl/filmy-fabularne/filmy-za-darmo/ogniem-i-...
unlicense
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/pony/orm/tests/test_db_session.py
1
12359
from __future__ import absolute_import, print_function, division import unittest from datetime import date from decimal import Decimal from itertools import count from pony.orm.core import * from pony.orm.tests.testutils import * class TestDBSession(unittest.TestCase): def setUp(self): self.d...
mit
michalkurka/h2o-3
h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7709_gam_error_messages.py
2
2064
from __future__ import division from __future__ import print_function from past.utils import old_div import sys sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator # In this test, we want to make sure the correct error message is retu...
apache-2.0
slongwang/selenium
py/test/selenium/webdriver/support/event_firing_webdriver_tests.py
65
8213
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
xavierwu/scikit-learn
sklearn/metrics/base.py
231
4378
""" Common code for all metrics """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Arnaud Joly <a.joly@ulg.ac.be> # Jochen Wersdorfer <jochen@wersdoerfer.de> # Lars Buitinck ...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/nose/ext/dtcompat.py
96
88063
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! # # Modified for inclusion in nose to provide support for DocFileTest in #...
mit
UNR-AERIAL/scikit-learn
examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
saketkc/statsmodels
examples/incomplete/dates.py
29
1251
""" Using dates with timeseries models """ import statsmodels.api as sm import pandas as pd # Getting started # --------------- data = sm.datasets.sunspots.load() # Right now an annual date series must be datetimes at the end of the year. dates = sm.tsa.datetools.dates_from_range('1700', length=len(data.endog)) # ...
bsd-3-clause
joelbitar/rfinder
requests/compat.py
87
2567
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import charade as chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1....
lgpl-3.0
40223226/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/pydoc.py
637
102017
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydoc <name>" to show documentation ...
gpl-3.0
indrajitr/ansible
lib/ansible/parsing/utils/addresses.py
241
8167
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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) any ...
gpl-3.0
YoungKwonJo/mlxtend
tests/tests_evaluate/test_learning_curves.py
1
2212
from mlxtend.evaluate import plot_learning_curves from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.tree import DecisionTreeClassifier import numpy as np def test_training_size(): iris = datasets.load_iris() X = iris.data y = iris.target X_train, X_test,...
bsd-3-clause
ojake/django
tests/admin_views/admin.py
98
30354
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import tempfile from wsgiref.util import FileWrapper from django import forms from django.conf.urls import url from django.contrib import admin from django.contrib.admin import BooleanFieldListFilter from django.contrib.admin.views.main import ...
bsd-3-clause
manashmndl/kivy
kivy/input/providers/__init__.py
52
1879
# pylint: disable=W0611 ''' Providers ========= ''' import os from kivy.utils import platform as core_platform from kivy.logger import Logger import kivy.input.providers.tuio import kivy.input.providers.mouse platform = core_platform if platform == 'win' or 'KIVY_DOC' in os.environ: try: import kivy.i...
mit
alvarolopez/nova
nova/db/sqlalchemy/migrate_repo/versions/275_add_keypair_type.py
79
1459
# Copyright (c) 2015 Cloudbase Solutions SRL # 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 # # Unles...
apache-2.0
bigdataelephants/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
chirilo/kuma
vendor/packages/babel/messages/frontend.py
63
52212
# -*- coding: utf-8 -*- """ babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ Frontends for the message extraction functionality. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ try: from ConfigParser import RawConfigParser except ImportError: from c...
mpl-2.0
tomkralidis/QGIS
python/plugins/db_manager/table_viewer.py
67
3659
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
kytvi2p/Sigil
3rdparty/python/Lib/encodings/cp862.py
272
33370
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.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_map) def decode(self,input,errors='strict'): ...
gpl-3.0
stargaser/astropy
astropy/stats/info_theory.py
3
14921
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains simple functions for model selection. """ import numpy as np __all__ = ['bayesian_info_criterion', 'bayesian_info_criterion_lsq', 'akaike_info_criterion', 'akaike_info_criterion_lsq'] __doctest_requires__ = {'bayesia...
bsd-3-clause
richardnpaul/FWL-Website
lib/python2.7/site-packages/django/contrib/staticfiles/utils.py
322
1973
import os import fnmatch from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patter...
gpl-3.0
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/ctypes/test/test_unaligned_structures.py
282
1215
import sys, unittest from ctypes import * structures = [] byteswapped_structures = [] if sys.byteorder == "little": SwappedStructure = BigEndianStructure else: SwappedStructure = LittleEndianStructure for typ in [c_short, c_int, c_long, c_longlong, c_float, c_double, c_ushort, c_uint...
gpl-2.0
Aakash1312/appleseed
src/appleseed.python/__init__.py
3
1430
# # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2012-2013 Esteban Tovagliari, Jupiter Jazz Limited # Copyright (c) 2014-2017 Esteban Tovagliari, The appleseedhq Organization # # P...
mit
vitaly-krugl/nupic
tests/integration/nupic/opf/opf_checkpoint_test/experiments/backwards_compatibility/base.py
20
15012
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
magicrub/MissionPlanner
Lib/encodings/cp865.py
93
35572
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.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_map) def decode(self,input,errors=...
gpl-3.0
eric-stanley/youtube-dl
youtube_dl/extractor/r7.py
130
3674
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( js_to_json, unescapeHTML, int_or_none, ) class R7IE(InfoExtractor): _VALID_URL = r'''(?x)https?:// (?: (?:[a-zA-Z]+)\.r7\.com(?:/[^/]+)+/...
unlicense
ravi-sharma/python-api-library
src/kayako/objects/ticket/ticket_enums.py
4
6936
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2011, Evan Leis # # Distributed under the terms of the Lesser GNU General Public License (LGPL) #----------------------------------------------------------------------------- ''' Created on Jun 8, 2011...
bsd-2-clause
mehanig/scrapi
tests/test_helpers.py
5
7171
import vcr import mock import pytest from scrapi import requests from scrapi.base import helpers @pytest.fixture(autouse=True) def mock_maybe_load_response(monkeypatch): mock_mlr = mock.Mock() mock_mlr.return_value = None mock_save = lambda x: x monkeypatch.setattr(requests, '_maybe_load_response', m...
apache-2.0
tdtrask/ansible
lib/ansible/modules/monitoring/icinga2_host.py
19
10096
#!/usr/bin/python # -*- coding: utf-8 -*- # This module is proudly sponsored by CGI (www.cgi.com) and # KPN (www.kpn.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_METADA...
gpl-3.0
sachinpro/sachinpro.github.io
tensorflow/python/framework/importer_test.py
6
28589
# Copyright 2015 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...
apache-2.0
temasek/android_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/tool/commands/queries.py
49
9746
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # Copyright (c) 2012 Intel Corporation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: #...
bsd-3-clause
DooMLoRD/android_kernel_sony_msm8974ab
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
jasonwzhy/django
tests/admin_scripts/tests.py
37
91484
# -*- coding: utf-8 -*- """ A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ from __future__ import unicode_literals import codecs import os import re import shutil import ...
bsd-3-clause
cchurch/ansible
lib/ansible/modules/windows/win_copy.py
71
6764
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # Copyright: (c) 2017, 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', ...
gpl-3.0
andrewyoung1991/abjad
abjad/tools/pitchtools/PitchArrayRow.py
2
16038
# -*- encoding: utf-8 -*- import copy from abjad.tools import durationtools from abjad.tools import indicatortools from abjad.tools.abctools import AbjadObject class PitchArrayRow(AbjadObject): r'''A pitch array row. :: >>> array = pitchtools.PitchArray([[1, 2, 1], [2, 1, 1]]) >>> array[0].c...
gpl-3.0
ita1024/samba
third_party/dnspython/dns/edns.py
47
4318
# Copyright (C) 2009, 2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND...
gpl-3.0
Ted1993/Flasky
venv/lib/python2.7/site-packages/mako/lexer.py
39
16121
# mako/lexer.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides the Lexer class for parsing template strings into parse trees.""" import re import code...
mit
vrv/tensorflow
tensorflow/python/kernel_tests/scatter_nd_ops_test.py
48
19446
# 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
pinobatch/thwaite-nes
tools/dte.py
1
12624
#!/usr/bin/env python3 from __future__ import with_statement, division, print_function, unicode_literals from collections import defaultdict import sys, heapq dte_problem_definition = """ Byte pair encoding, dual tile encoding, or digram coding is a static dictionary compression method first disclosed to the public by...
gpl-3.0
wjt/markgown
markgown/editor.py
1
3156
#!/usr/bin/python # vim: set fileencoding=utf-8 : # # © 2012 Will Thompson <will@willthompson.co.uk> # # 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 y...
gpl-3.0
OpenNetworkingFoundation/Snowmass-ONFOpenTransport
RI/flask_server/tapi_server/models/tapi_notification_service_affecting.py
4
1187
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server import util class TapiNotificationServiceAffecting(Model): """NOTE: This class is auto generated...
apache-2.0
hiro2016/ergodox_gui_configurator
Xlib/keysymdef/latin2.py
14
1075
XK_Aogonek = 0x1a1 XK_breve = 0x1a2 XK_Lstroke = 0x1a3 XK_Lcaron = 0x1a5 XK_Sacute = 0x1a6 XK_Scaron = 0x1a9 XK_Scedilla = 0x1aa XK_Tcaron = 0x1ab XK_Zacute = 0x1ac XK_Zcaron = 0x1ae XK_Zabovedot = 0x1af XK_aogonek = 0x1b1 XK_ogonek = 0x1b2 XK_lstroke = 0x1b3 XK_lcaron = 0x1b5 XK_sacute = 0x1b6 XK_caron = 0x1b7 XK_scar...
gpl-2.0
hujiajie/chromium-crosswalk
tools/ipc_fuzzer/scripts/remove_close_messages.py
40
2548
#!/usr/bin/env python # Copyright 2014 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. """Removes ViewHostMsg_Close and alike from testcases. These messages are an annoyance for corpus distillation. They cause the browser ...
bsd-3-clause
followcat/predator
jobs/definition/batchconvert_cloudshare_jingying.py
1
1798
import Queue import functools import utils.builtin import jobs.definition.cloudshare_jingying from jobs.definition.batchconvert import * class Batchconvert(BatchconvertCloudshare, jobs.definition.cloudshare_jingying.Jingying): CVDB_PATH = 'convert/jingying' ORIGIN_CVDB_PATH = 'output/jing...
lgpl-3.0
florian-dacosta/OpenUpgrade
addons/payment_paypal/controllers/main.py
66
3201
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import urllib2 import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controller): _noti...
agpl-3.0
wangjun/odoo
addons/hr_payroll/__init__.py
433
1137
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
RyanChinSang/ECNG3020-ORSS4SCVI
BETA/TestCode/Tensorflow/Test/object_detection/core/region_similarity_calculator.py
23
3687
# 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...
gpl-3.0
davebshow/gremlinclient
tests/test_tornado.py
1
16608
import uuid import unittest from datetime import timedelta import tornado from tornado import gen from tornado.concurrent import Future from tornado.websocket import WebSocketClientConnection from tornado.testing import gen_test, AsyncTestCase from gremlinclient.connection import Stream from gremlinclient.tornado_cli...
mit
idigbio-api-hackathon/idigbio-lifemapper
dataretrieval/apiquery.py
1
19565
""" @summary: Module containing functions for API Queries @status: beta @license: gpl2 @copyright: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA ...
gpl-3.0
doug-fish/horizon
openstack_dashboard/management/commands/migrate_settings.py
60
8249
# 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
richpolis/siveinpy
env/lib/python2.7/site-packages/django/contrib/auth/tests/test_basic.py
105
9914
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import locale from django.contrib.auth import get_user_model from django.contrib.auth.management.commands import createsuperuser from django.contrib.auth.models import User, AnonymousUser from django.contrib.auth.tests.custom_user import CustomUser fro...
mit
sorenh/cc
vendor/Twisted-10.0.0/twisted/web/vhost.py
53
4382
# -*- test-case-name: twisted.web. # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ I am a virtual hosts implementation. """ # Twisted Imports from twisted.python import roots from twisted.web import resource class VirtualHostCollection(roots.Homogenous): """Wrapper for virt...
apache-2.0
40223144/w16b_test
static/Brython3.1.1-20150328-091302/Lib/long_int1/__init__.py
503
3858
from browser import html, document, window import javascript #memorize/cache? def _get_value(other): if isinstance(other, LongInt): return other.value return other class BigInt: def __init__(self): pass def __abs__(self): return LongInt(self.value.abs()) def __add__(self, other): ...
agpl-3.0
seppi91/CouchPotatoServer
couchpotato/core/plugins/manage.py
17
12274
import os import time import traceback from couchpotato import get_db from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, addEvent, fireEventAsync from couchpotato.core.helpers.encoding import sp from couchpotato.core.helpers.variable import splitString, getTitle, tryInt, getIdentifier...
gpl-3.0
ravindrapanda/tensorflow
tensorflow/python/kernel_tests/record_input_test.py
30
5958
# 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
Macemann/Georgetown-Capstone
app/db/etl/Entities.py
1
1938
import nltk from nltk.corpus import stopwords class EntityExtractor (object): ''' Class used to extract Named Entities from a string ''' def __init__ (self, tweet): self.tweet = tweet self.text = tweet['text'] self.lang = tweet['lang'] self.bool = tweet['text'] and tweet['lang'].find('en') > -1 self.tok...
mit
tushar7795/MicroBlog
flask/lib/python2.7/site-packages/whoosh/automata/glob.py
53
3333
# Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
eliastor/rt-thread
bsp/jz47xx/rtconfig.py
6
1704
import os # toolchains options ARCH = 'mips' CPU = 'jz47xx' CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' elif CROSS_TOOL == 'keil': print '====...
gpl-2.0
NejcZupec/ggrc-core
src/ggrc_basic_permissions/roles/Creator.py
1
6820
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "System" description = """ This role grants a user basic object creation and editing permission. """ owner_base = [ "Categorization", "Category", "ControlCategory", "ControlAsser...
apache-2.0
arokem/nipy
nipy/modalities/fmri/fmri.py
3
4969
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import warnings import numpy as np from ...core.api import ImageList class FmriImageList(ImageList): """ Class to implement image list interface for FMRI time series Allows metadata such as vol...
bsd-3-clause
haojunyu/numpy
numpy/core/tests/test_deprecations.py
7
15338
""" Tests related to deprecation warnings. Also a convenient place to document how deprecations should eventually be turned into errors. """ from __future__ import division, absolute_import, print_function import sys import operator import warnings import numpy as np from numpy.testing import (run_module_suite, asse...
bsd-3-clause
kitanata/resume
env/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
168
26964
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
mit
wilselby/diy_driverless_car_ROS
rover_cv/camera_cal/src/camera_cal/camera_cal.py
1
6503
#!/usr/bin/env python # -*- coding: utf-8 -*- #https://github.com/paramaggarwal/CarND-Advanced-Lane-Lines/blob/master/Notebook.ipynb from __future__ import print_function from __future__ import division import sys import traceback import rospy import numpy as np import cv2 import pickle import glob import time import m...
bsd-2-clause
emilk/sproxel
distro/common/lib/encodings/mac_cyrillic.py
93
14017
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.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 de...
bsd-3-clause
pombredanne/teamwork
wsgi/static/reeborg/src/libraries/brython/Lib/unittest/result.py
15
6282
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
gpl-2.0
kapouer/mapnik
scons/scons-local-2.3.0/SCons/Tool/msginit.py
11
4732
""" msginit tool Tool specific initialization of msginit tool. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files ...
lgpl-2.1
DeskboxBrazil/Cura
cura/CuraActions.py
7
1090
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty, QUrl from PyQt5.QtGui import QDesktopServices from UM.Event import CallFunctionEvent from UM.Application import Application import webbrowser class CuraActions(QObject): def __init__(self, parent = None): super().__init__(parent) ...
agpl-3.0