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
takeshineshiro/wagtail
wagtail/wagtailcore/whitelist.py
10
5168
""" A generic HTML whitelisting engine, designed to accommodate subclassing to override specific rules. """ import re from bs4 import BeautifulSoup, NavigableString, Tag ALLOWED_URL_SCHEMES = ['http', 'https', 'ftp', 'mailto', 'tel'] PROTOCOL_RE = re.compile("^[a-z0-9][-+.a-z0-9]*:") def check_url(url_string): ...
bsd-3-clause
javiercantero/streamlink
src/streamlink/plugins/olympicchannel.py
1
2405
import re from streamlink.plugin import Plugin from streamlink.plugin.api import http from streamlink.plugin.api import validate from streamlink.stream import HLSStream, HTTPStream class OlympicChannel(Plugin): _url_re = re.compile(r"http(?:s)?://(\w+)\.?olympicchannel.com/../(?P<type>tv|playback)/(livestream-.\...
bsd-2-clause
johnkit/vtk-dev
ThirdParty/ZopeInterface/zope/interface/tests/test_exceptions.py
57
2722
############################################################################## # # Copyright (c) 2010 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
bsd-3-clause
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/django/middleware/gzip.py
225
2140
import re from django.utils.text import compress_sequence, compress_string from django.utils.cache import patch_vary_headers re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accor...
gpl-2.0
EmreAtes/spack
var/spack/repos/builtin/packages/qbank/package.py
5
3277
############################################################################## # 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
kustodian/ansible
lib/ansible/modules/network/f5/bigip_data_group.py
23
48738
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
x111ong/odoo
addons/account/account_bank_statement.py
65
56688
# -*- 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
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/tests/regressiontests/generic_views/views.py
49
4506
from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page from regre...
mit
krasin/omim
3party/Alohalytics/tests/googletest/test/gtest_xml_output_unittest.py
1815
14580
#!/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...
apache-2.0
ZettelGeist/zettelgeist
sphinx-docs/source/conf.py
1
2464
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
apache-2.0
emonty/vhd-util
tools/python/logging/logging-0.4.9.2/test/log_test10.py
42
2847
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
genome-vendor/cython
debian/cython/usr/share/pyshared/Cython/Compiler/UtilityCode.py
98
6918
from TreeFragment import parse_from_strings, StringParseContext import Symtab import Naming import Code class NonManglingModuleScope(Symtab.ModuleScope): def __init__(self, prefix, *args, **kw): self.prefix = prefix self.cython_scope = None Symtab.ModuleScope.__init__(self, *args, **kw) ...
apache-2.0
r24mille/think_stats
chapter_one/first.py
1
1783
''' Created on Apr 15, 2014 @author: r24mille ''' # Initial code reccomended in Excersize 1.3 import survey table = survey.Pregnancies() table.ReadRecords() print 'Number of pregnancies', len(table.records) # Count the number of live births, outcome=1 is a live birth numbirths = 0; for record in table....
gpl-3.0
bhamlin/discord-pip-boy
test-db.py
1
1210
#!env/bin/python3 import json import os from pydblite import Base db = Base('test.pdl') db.create('owner', 'name', 'game', 'char', mode='override') db.create_index('owner') db.create_index('game') c = { 'name': 'Covfefe', 'race': 'dwarf', 'level': [1], 'class': ['wizard#d20srd'], 'class_feature...
gpl-3.0
JioCloud/neutron
neutron/tests/unit/test_context.py
14
6529
# Copyright 2012 VMware, 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 ...
apache-2.0
shssoichiro/servo
tests/wpt/css-tests/tools/py/testing/process/test_forkedfunc.py
162
4839
import pytest import py, sys, os pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')") def test_waitfinish_removes_tempdir(): ff = py.process.ForkedFunc(boxf1) assert ff.tempdir.check() ff.waitfinish() assert not ff.tempdir.check() def test_tempdir_gets_gc_collected(monkeypatch): monkeypat...
mpl-2.0
supergis/QGIS
python/plugins/processing/algs/saga/versioncheck.py
9
2449
import os import subprocess def getAlgParams(f): params = [] booleanparams = [] numparams = [] lines = open(f) line = lines.readline().strip('\n').strip() name = line if '|' in name: tokens = name.split('|') cmdname = tokens[1] else: cmdname = name line = li...
gpl-2.0
carragom/modoboa
modoboa/admin/tests/test_api.py
1
23672
# coding: utf-8 """Admin API related tests.""" import copy import json from django.core.urlresolvers import reverse from rest_framework.authtoken.models import Token from modoboa.admin import models as admin_models from modoboa.core import models as core_models from modoboa.lib.tests import ModoAPITestCase from .....
isc
MaxVanDeursen/tribler
Tribler/Core/Utilities/torrent_utils.py
2
4348
import logging import os import libtorrent logger = logging.getLogger(__name__) def commonprefix(l): # this unlike the os.path.commonprefix version always returns path prefixes as it compares # path component wise. cp = [] ls = [p.split('/') for p in l] ml = min(len(p) for p in ls) for i in...
lgpl-3.0
kaleidos/intranet
backend/autoreports/urls.py
2
1677
# Copyright (c) 2010 by Yaco Sistemas <pmartin@yaco.es> # # This program 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 later version. ...
apache-2.0
elijah513/scikit-learn
examples/cluster/plot_affinity_propagation.py
349
2304
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print(__doc__) from sklearn.cluster impor...
bsd-3-clause
adw0rd/lettuce
tests/integration/lib/Django-1.3/django/core/management/commands/dumpdata.py
249
8960
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import connections, router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from optparse import make_option class Command(Ba...
gpl-3.0
AllisonWang/incubator-airflow
airflow/executors/sequential_executor.py
46
1862
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
stevemayhew/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
lgpl-2.1
newerthcom/savagerebirth
libs/python-2.72/Lib/encodings/iso8859_11.py
593
12591
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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 decode(self,input,errors...
gpl-2.0
lmazuel/ansible
lib/ansible/modules/system/cronvar.py
49
14310
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
durandj/mymcadmin
mymcadmin/cli/commands/restart.py
1
1046
""" Restart commands for Minecraft servers """ import click from ..base import mymcadmin, cli_command, rpc_command, error, success from ... import rpc @mymcadmin.command() @click.argument('server_id') @cli_command @rpc_command def restart(rpc_conn, server_id): """ Restart a Minecraft server """ clic...
mit
hujiajie/chromium-crosswalk
tools/valgrind/valgrind_test.py
7
33370
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs an exe through Valgrind and puts the intermediate files in a directory. """ import datetime import glob import logging import optparse import os...
bsd-3-clause
dancingdan/tensorflow
tensorflow/contrib/gan/python/features/python/virtual_batchnorm_test.py
21
11083
# 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
atsolakid/edx-platform
common/djangoapps/edxmako/makoloader.py
100
3107
import logging from django.conf import settings from django.template.base import TemplateDoesNotExist from django.template.loader import make_origin, get_template_from_string from django.template.loaders.filesystem import Loader as FilesystemLoader from django.template.loaders.app_directories import Loader as AppDirec...
agpl-3.0
tdsimao/tt
django/core/management/commands/syncdb.py
161
8141
from optparse import make_option import sys from django.conf import settings from django.core.management.base import NoArgsCommand from django.core.management.color import no_style from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal from django.db import connections, router, transaction,...
gpl-2.0
Crypt0s/Ramen
fs_libs/ftputil/ftputil/file_transfer.py
2
6260
# Copyright (C) 2013, Stefan Schwarzer <sschwarzer@sschwarzer.net> # See the file LICENSE for licensing terms. """ file_transfer.py - upload, download and generic file copy """ from __future__ import unicode_literals import io import os #TODO Think a bit more about the API before making it public. # # Only `chunks...
gpl-3.0
peterwilletts24/Python-Scripts
plot_scripts/EMBRACE/plot_from_pp_interp_p_levs_temp_geop_sp_hum.py
1
13209
""" Load pp, plot and save """ import os, sys #%matplotlib inline #%pylab inline import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap ...
mit
terranodo/geonode
geonode/__init__.py
2
1311
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
Azure/azure-sdk-for-python
sdk/core/azure-core/tests/async_tests/test_tracing_decorator_async.py
1
6637
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """The tests for decorators_async.py""" try: from unittest import mock except ImportError: import mock import sys import time import pytest from azure.core.pi...
mit
j-carpentier/nova
nova/tests/unit/virt/vmwareapi/test_configdrive.py
17
7371
# Copyright 2013 IBM Corp. # 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 ...
apache-2.0
MarcAndreJean/PCONC
Modules/__init__.py
1
1056
# Importation des modules locaux. import importlib # 01 m01 = importlib.import_module("Modules.01-Vue") # --01.__ m01x01 = importlib.import_module("Modules.01-01-Ordinateur") m01x02 = importlib.import_module("Modules.01-02-Editeur") m01x03 = importlib.import_module("Modules.01-03-StatusBar") m01x04 = importlib.import_m...
mit
ticosax/django
tests/aggregation_regress/tests.py
11
52791
from __future__ import unicode_literals import datetime import pickle from decimal import Decimal from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Q, Avg, Coun...
bsd-3-clause
nvoron23/avos
openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/tabs.py
12
3162
# 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 the...
apache-2.0
JackKelly/babysitter
babysitter/babysitter_tests.py
1
3426
from __future__ import print_function import babysitter import unittest import StringIO import datetime class TestLoadConfig(unittest.TestCase): def setUp(self): # TODO: setup logger if necessary self.manager = babysitter.Manager() def test_file(self): self.manager.append(babysitter.F...
mit
asi1024/competitive-library
cpp/docs/title.py
2
3276
#!/usr/bin/env python import collections import json import os max_src_len = 3 def category(path, name, verifier): def ext(fname): return fname.split('.')[-1] def extract_ext(fname): return '.'.join(fname.split('.')[:-1]) def get_relpath(path, start): return os.path.normpath(...
mit
zsoltdudas/lis-tempest
tempest/lib/services/compute/versions_client.py
5
2531
# Copyright (c) 2015 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 required by appli...
apache-2.0
tealover/nova
nova/api/openstack/compute/plugins/v3/fping.py
26
4894
# Copyright 2011 Grid Dynamics # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
Laimiux/mydeatree
django/contrib/gis/geos/prototypes/predicates.py
623
1777
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
bsd-3-clause
mattcongy/itshop
docker-images/taigav2/taiga-back/taiga/export_import/services/__init__.py
2
1144
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
mit
neumerance/cloudloon2
openstack_dashboard/usage/views.py
6
2072
import logging from horizon import tables from openstack_dashboard.usage import base LOG = logging.getLogger(__name__) class UsageView(tables.DataTableView): usage_class = None show_terminated = True def __init__(self, *args, **kwargs): super(UsageView, self).__init__(*args, **kwargs) ...
apache-2.0
ekoeppen/panstamp-python
pyswap/src/swap/__init__.py
4
1099
######################################################################### # # __init__ # # Copyright (c) 2011 Daniel Berenguer <dberenguer@usapiens.com> # # This file is part of the panStamp project. # # panStamp is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-2.0
eBay/restcommander
play-1.2.4/python/Lib/hotshot/__init__.py
215
2670
"""High-perfomance logging profiler, mostly written in C.""" import _hotshot from _hotshot import ProfilerError from warnings import warnpy3k as _warnpy3k _warnpy3k("The 'hotshot' module is not supported in 3.x, " "use the 'profile' module instead.", stacklevel=2) class Profile: def __init__(self, logf...
apache-2.0
vijeth-aradhya/coala-bears
bears/c_languages/ClangComplexityBear.py
23
4936
from clang.cindex import Index, CursorKind from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from coalib.bearlib import deprecate_settings from bears.c_languages.ClangBear import clang_available, ClangBear class ClangComplexityBea...
agpl-3.0
VishvajitP/django-extensions
django_extensions/management/commands/sqlcreate.py
27
3176
import socket import sys from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django_extensions.management.utils import signalcommand class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('-R'...
mit
zulumarketing/html2pdf
xhtml2pdf/paragraph.py
20
23868
#!/bin/env/python # -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 # # U...
apache-2.0
jessrosenfield/pants
tests/python/pants_test/android/tasks/test_aapt_gen.py
15
5264
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
abali96/Shapely
tests/threading_test.py
10
1032
import threading from binascii import b2a_hex def main(): num_threads = 10 use_threads = True if not use_threads: # Run core code runShapelyBuilding() else: threads = [threading.Thread(target=runShapelyBuilding, name=str(i), args=(i,)) for i...
bsd-3-clause
open-e/JovianDSS-Flocker
joviandss_flocker_driver/jovian_common/rest_proxy.py
1
4403
# __ _ ___ __ __ # \ \ _____ _(_) __ _ _ __ / \/ _\/ _\ # \ \/ _ \ \ / / |/ _` | '_ \ / /\ /\ \ \ \ # /\_/ / (_) \ V /| | (_| | | | |/ /_// _\ \_\ \ # \___/ \___/ \_/ |_|\__,_|_| |_/____/ \__/\__/ # # # Copyright (c) 2016 Open-E, Inc. # All Rights Reserved. # # ...
apache-2.0
helium/helium-commander
helium_commander/commands/label.py
1
6749
import click from helium_commander import ( Client, Label, Sensor, Element, device_sort_option, device_mac_option, metadata_filter_option, ResourceParamType ) from helium_commander.commands import metadata, timeseries from collections import namedtuple pass_client = click.make_pass_dec...
bsd-3-clause
ruguevara/neon
neon/layers/tests/test_fully_connected.py
9
3084
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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 # # ...
apache-2.0
skirsdeda/django
django/db/models/fields/files.py
22
18693
import datetime import os from django import forms from django.db.models.fields import Field from django.core import checks from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils...
bsd-3-clause
abalkin/numpy
numpy/core/tests/test_extint128.py
17
5643
import itertools import contextlib import operator import pytest import numpy as np import numpy.core._multiarray_tests as mt from numpy.testing import assert_raises, assert_equal INT64_MAX = np.iinfo(np.int64).max INT64_MIN = np.iinfo(np.int64).min INT64_MID = 2**32 # int128 is not two's complement, the sign bit ...
bsd-3-clause
ViKomprenas/nsndswap
nsndswap/viko_nsnd.py
1
13689
#!/usr/bin/env python3 # nsndswap/viko_nsnd.py # copyright 2017 ViKomprenas, 2-clause BSD license (LICENSE.md) from nsndswap.util import Track nsnd = { # A Shade of Two "criticalErr0r": ["Taureg"], "Exploreation": ["Explore", "Upward Movement (Dave Owns)"], "Taureg": ["Sburban Jungle", "Beatdown"], ...
bsd-2-clause
bkirui/odoo
addons/base_gengo/res_company.py
321
1890
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Medium/phantomjs-1
src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py
151
1061
#!/usr/bin/env python # Copyright (c) 2009 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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
bsd-3-clause
Jionglun/w17test_2
static/Brython3.1.1-20150328-091302/Lib/tempfile.py
728
22357
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
gpl-3.0
kalxas/QGIS
python/core/additions/qgsfunction.py
30
6622
# -*- coding: utf-8 -*- """ *************************************************************************** qgsfunction.py --------------------- Date : May 2018 Copyright : (C) 2018 by Denis Rouzaud Email : denis@opengis.ch *************************************...
gpl-2.0
UrusTeam/android_ndk_toolchain_cross
lib/python2.7/ctypes/test/test_parameters.py
76
6552
import unittest, sys class SimpleTypesTestCase(unittest.TestCase): def setUp(self): import ctypes try: from _ctypes import set_conversion_mode except ImportError: pass else: self.prev_conv_mode = set_conversion_mode("ascii", "strict") def te...
gpl-2.0
osiell/oerplib
oerplib/service/osv/osv.py
3
10524
# -*- coding: UTF-8 -*- ############################################################################## # # OERPLib # Copyright (C) 2011-2013 Sébastien Alix. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # ...
lgpl-3.0
maciek263/django2
myvenv/Lib/site-packages/django/contrib/gis/db/models/proxy.py
164
2605
""" The GeometryProxy object, allows for lazy-geometries. The proxy uses Python descriptors for instantiating and setting Geometry objects corresponding to geographic model fields. Thanks to Robert Coup for providing this functionality (see #4322). """ from django.utils import six class GeometryProxy(object): d...
mit
xs2maverick/adhocracy3.mercator
src/adhocracy_core/adhocracy_core/events/__init__.py
2
7835
"""Hooks to modify runtime behavior (use 'subscriber.py' in you package). In addition we have the normal substanced events: https://substanced.readthedocs.org/en/latest/api.html#module-substanced.event """ from pyramid.request import Request from pyramid.registry import Registry from zope.interface import implementer...
agpl-3.0
CasparLi/calibre
src/calibre/gui2/convert/xpath_wizard.py
14
3351
#!/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' from PyQt5.Qt import QDialog, QWidget, Qt, QDialogButtonBox, QVBoxLayout from calib...
gpl-3.0
microcom/odoo
addons/account_asset/wizard/wizard_asset_compute.py
47
1228
# -*- coding: utf-8 -*- from openerp import api, fields, models, _ class AssetDepreciationConfirmationWizard(models.TransientModel): _name = "asset.depreciation.confirmation.wizard" _description = "asset.depreciation.confirmation.wizard" date = fields.Date('Account Date', required=True, help="Choose the ...
agpl-3.0
michaelhowden/eden
modules/tests/inv/warehouse_search.py
24
4021
# -*- coding: utf-8 -*- """ Sahana Eden Warehouse Search Module Automated Tests @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa...
mit
Workday/OpenFrame
third_party/WebKit/Tools/Scripts/webkitpy/tool/multicommandtool.py
51
13189
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above...
bsd-3-clause
robinro/ansible
lib/ansible/modules/network/nxos/nxos_vlan.py
33
10853
#!/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 distribut...
gpl-3.0
blaggacao/odoo
addons/account_test/report/account_test_report.py
156
3740
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
rcarrillocruz/ansible
lib/ansible/modules/remote_management/hpilo/hponcfg.py
66
2841
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Dag Wieers <dag@wieers.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, ...
gpl-3.0
PaulChongPeng/YOLO2TensorFlow
src/deployment/model_deploy.py
1
23821
# 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 applicable ...
apache-2.0
idovear/odoo
addons/auth_oauth/controllers/main.py
205
8042
import functools import logging import simplejson import urlparse import werkzeug.utils from werkzeug.exceptions import BadRequest import openerp from openerp import SUPERUSER_ID from openerp import http from openerp.http import request from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_...
agpl-3.0
GeorgeHahn/Printrun
printrun/gui/utils.py
22
1466
# This file is part of the Printrun suite. # # Printrun 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. # # Printrun is distributed in ...
gpl-3.0
citrix-openstack-build/keystone
keystone/tests/_ldap_livetest.py
3
10549
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 # # Unle...
apache-2.0
escapewindow/scriptworker
tests/test_client.py
2
10920
#!/usr/bin/env python # coding=utf-8 """Test scriptworker.client """ import json import logging import os import sys import tempfile from copy import deepcopy from shutil import copyfile from unittest.mock import MagicMock import aiohttp import arrow import pytest import scriptworker.client as client from scriptwork...
mpl-2.0
eyohansa/django
django/conf/locale/it/formats.py
504
2079
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FO...
bsd-3-clause
sassoftware/conary
conary_test/cvctest/buildtest/macrostest.py
2
2983
# # Copyright (c) SAS Institute 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 w...
apache-2.0
dweinstein/mitmproxy
libmproxy/console/searchable.py
29
2808
import urwid from . import signals class Highlight(urwid.AttrMap): def __init__(self, t): urwid.AttrMap.__init__( self, urwid.Text(t.text), "focusfield", ) self.backup = t class Searchable(urwid.ListBox): def __init__(self, state, contents): ...
mit
Lukasa/cryptography
docs/development/custom-vectors/cast5/generate_cast5.py
3
2745
# 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 the...
apache-2.0
uRndUsr/infinitecoin
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
jupierce/openshift-tools
openshift/installer/vendored/openshift-ansible-git-2016-04-18/roles/os_firewall/library/os_firewall_manage_iptables.py
68
10474
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 # pylint: disable=fixme, missing-docstring from subprocess import call, check_output DOCUMENTATION = ''' --- module: os_firewall_manage_iptables short_description: This module manages iptables rules for a given chain author: Jason DeTibe...
apache-2.0
wisechengyi/pants
src/python/pants/python/executable_pex_tool.py
2
1754
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from typing import TYPE_CHECKING, List, Optional from pex.pex import PEX from pex.pex_builder import PEXBuilder from pex.pex_info import PexInfo from pants.python.pex_build_util import P...
apache-2.0
bcharlas/mytrunk
examples/WireMatPM/wirecontacttest.py
8
5316
# -*- coding: utf-8 -*- from yade import plot, qt #### define parameters for the net # wire diameter d = 2.7/1000. # particle radius radius = d*4. # define piecewise linear stress-strain curve [Pa] strainStressValues=[(0.0019230769,2.5e8),(0.0192,3.2195e8),(0.05,3.8292e8),(0.15,5.1219e8),(0.25,5.5854e8),(0.3,5.6585e8)...
gpl-2.0
matthappens/taskqueue
taskqueue/venv_tq/lib/python2.7/site-packages/boto/route53/status.py
186
1841
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # All rights reserved. # # 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 # w...
mit
bulldy80/gyp_unofficial
test/msvs/filters/gyptest-filters-2010.py
101
1517
#!/usr/bin/env python # Copyright (c) 2014 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. """ Verifies that extra filters are pruned correctly for Visual Studio 2010 and later. """ import TestGyp test = TestGyp.TestGyp(formats=...
bsd-3-clause
cngo-github/nupic
tests/integration/nupic/opf/opf_description_template_test/opf_description_template_test.py
12
10082
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
amitdhiman000/dais
daisadmin/urls.py
1
1363
"""MyOffers URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
apache-2.0
joeyjojo/django_offline
src/django/contrib/auth/context_processors.py
44
1304
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, module_name): self.user, self.module_name = user, module_name def __repr__(self): return str(self.user.get_all_permission...
mit
jmerkow/ITK
Wrapping/Generators/Python/Tests/StrelFromImageGrayscaleDilateImageFilter.py
19
1459
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
rzhxeo/youtube-dl
youtube_dl/extractor/tmz.py
30
1229
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TMZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/]+)/?' _TEST = { 'url': 'http://www.tmz.com/videos/0_okj015ty/', 'md5': '791204e3bf790b1426cb2db0706184c0', ...
unlicense
cxxgtxy/tensorflow
tensorflow/contrib/tensor_forest/python/kernel_tests/tree_predictions_op_test.py
78
9018
# 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
mikekestemont/keras
tests/auto/keras/layers/test_core.py
48
5211
import unittest import numpy as np from numpy.testing import assert_allclose import theano from keras.layers import core class TestLayerBase(unittest.TestCase): def test_input_output(self): nb_samples = 10 input_dim = 5 layer = core.Layer() # As long as there is no input, an erro...
mit
peterfpeterson/mantid
Framework/PythonInterface/plugins/algorithms/ExtractMonitors.py
3
4216
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
gpl-3.0
chouseknecht/ansible
lib/ansible/modules/network/avi/avi_snmptrapprofile.py
28
3563
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
gpl-3.0
z1gm4/desarrollo_web_udp
condominioseguro/urls.py
1
1345
"""condominioseguro URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples:x Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')...
gpl-3.0
brianrodri/oppia
core/storage/subtopic/gae_models.py
2
6435
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
apache-2.0