repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
FreeAgent/djangoappengine-starter
django/contrib/admindocs/views.py
296
15504
from django import template, templatetags from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions import ImproperlyConfigur...
bsd-3-clause
michaelconnor00/gbdxtools
gbdxtools/catalog_search_aoi.py
1
3959
""" GBDX Catalog Search Helper Functions. This set of functions is used for breaking up a large AOI into smaller AOIs to search, because the catalog API can only handle 2 square degrees at a time. """ from builtins import zip from builtins import range from pygeoif import geometry import json def point_in_poly(x,y...
mit
leighpauls/k2cro4
testing/gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
bsd-3-clause
jjscarafia/odoo
addons/base_import/tests/test_cases.py
84
13383
# -*- encoding: utf-8 -*- import unittest2 from openerp.tests.common import TransactionCase from .. import models ID_FIELD = { 'id': 'id', 'name': 'id', 'string': "External ID", 'required': False, 'fields': [], } def make_field(name='value', string='unknown', required=False, fields=[]): retur...
agpl-3.0
shimpe/pyvectortween
vectortween/SequentialAnimation.py
1
2872
from copy import deepcopy import numpy as np from vectortween.Animation import Animation from vectortween.Mapping import Mapping from vectortween.Tween import Tween def normalize(x): return x / sum(x) class SequentialAnimation(Animation): def __init__(self, list_of_animations=None, timeweight=None, repeat...
mit
spaceof7/QGIS
python/plugins/MetaSearch/pavement.py
67
7402
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com) # # This source 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 # So...
gpl-2.0
trabucayre/periphondemand
periphondemand/toolchains/synthesis/vivado/vivado.py
2
26838
#! /usr/bin/python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: ise.py # Purpose: # Author: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com> # Created: 21/07/2015 # ---------------------------------------------------------------------...
lgpl-2.1
omaciel/pylyglot
translations/views.py
1
2607
# -*- encoding: utf-8 -*- # vim: ts=4 sw=4 expandtab ai # # This file is part of Pylyglot. # # Pylyglot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
jim-thisplace/exercises-in-programming-style
33-restful/tf-33.py
17
3653
#!/usr/bin/env python import re, string, sys with open("../stop_words.txt") as f: stops = set(f.read().split(",")+list(string.ascii_lowercase)) # The "database" data = {} # Internal functions of the "server"-side application def error_state(): return "Something wrong", ["get", "default", None] # The "server"...
mit
ivanmarcin/kubernetes
cluster/saltbase/salt/_states/container_bridge.py
96
5593
# Copyright 2014 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
morreene/tradenews
venv/Lib/site-packages/flask/testsuite/reqctx.py
557
5960
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
bsd-3-clause
lyoshenka/PyPagekite
pagekite/ui/basic.py
2
9580
""" This is the "basic" text-mode user interface class. """ ############################################################################# LICENSE = """\ This file is part of pagekite.py. Copyright 2010-2013, the Beanstalks Project ehf. and Bjarni Runar Einarsson This program is free software: you can redistribute it a...
agpl-3.0
jhawkesworth/ansible
lib/ansible/modules/network/dellos10/dellos10_command.py
39
7311
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # Copyright: (c) 2017, Dell 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 ...
gpl-3.0
2ndQuadrant/ansible
lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py
47
4254
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata...
gpl-3.0
anilmuthineni/tensorflow
tensorflow/python/saved_model/main_op.py
5
2262
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Tudorvr/metagoofil
hachoir_parser/program/exe_res.py
95
15292
""" Parser for resource of Microsoft Windows Portable Executable (PE). Documentation: - Wine project VS_FIXEDFILEINFO structure, file include/winver.h Author: Victor Stinner Creation date: 2007-01-19 """ from hachoir_core.field import (FieldSet, ParserError, Enum, Bit, Bits, SeekableFieldSet, UInt16, UInt3...
gpl-2.0
npuichigo/ttsflow
third_party/tensorflow/tensorflow/python/kernel_tests/variables_test.py
18
23601
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
sivatha/video-player-sample
source/core/js/libs/closure-library/closure/bin/build/depswriter.py
17
6206
#!/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
WimpyAnalytics/django-andablog
demo/common/migrations/0002_auto_20150507_1708.py
1
1391
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django import VERSION as DJANGO_VERSION def get_operations(): """ This will break things if you upgrade Django to 1.8 having already applied this migration in 1.7. Since this is for a demo site i...
bsd-2-clause
dfdx2/django
tests/httpwrappers/tests.py
14
30531
import copy import json import os import pickle import unittest import uuid from django.core.exceptions import DisallowedRedirect, SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.db import close_old_connections from django.http...
bsd-3-clause
Yuliang-Zou/Automatic_Group_Photography_Enhancement
lib/roi_pooling_layer/roi_pooling_op_grad.py
1
1375
import tensorflow as tf from tensorflow.python.framework import ops import roi_pooling_op import pdb @tf.RegisterShape("RoiPool") def _roi_pool_shape(op): """Shape function for the RoiPool op. """ dims_data = op.inputs[0].get_shape().as_list() channels = dims_data[3] dims_rois = op.inputs[1].get_shape().as...
mit
msdubov/AST-text-analysis
east/main.py
2
6145
# -*- coding: utf-8 -* import getopt import os import sys from east import applications from east import consts from east import formatting from east.synonyms import synonyms from east import relevance from east import utils def main(): args = sys.argv[1:] opts, args = getopt.getopt(args, "s:a:w:v:l:f:c:r:p...
mit
reasonerjt/harbor
make/photon/prepare/commands/gencerts.py
3
1188
import os import sys import click import pathlib import logging from subprocess import Popen, PIPE, STDOUT, CalledProcessError from utils.cert import openssl_installed from utils.misc import get_realpath gen_tls_script = pathlib.Path(__file__).parent.parent.joinpath('scripts/gencert.sh').absolute() @click.command() ...
apache-2.0
kennedyshead/home-assistant
tests/components/mikrotik/test_init.py
8
3080
"""Test Mikrotik setup process.""" from unittest.mock import AsyncMock, Mock, patch from homeassistant.components import mikrotik from homeassistant.setup import async_setup_component from . import MOCK_DATA from tests.common import MockConfigEntry async def test_setup_with_no_config(hass): """Test that we do ...
apache-2.0
julien-hadleyjack/genrss-py
src/genrss/podcast.py
1
5482
#!/usr/bin/env python # -*- coding: utf-8 -*- from future.standard_library import install_aliases install_aliases() import os import re from operator import attrgetter from urllib.request import urlretrieve from io import open from PIL import Image from jinja2 import Environment, FileSystemLoader, StrictUndefined f...
bsd-2-clause
Spleen64/Sick-Beard
lib/subliminal/services/subswiki.py
35
5235
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
ClearCorp-dev/account-financial-reporting
account_move_line_report_xls/report/move_line_list_xls.py
25
17494
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
t27/ol3
bin/check-whitespace.py
5
1582
import logging import re import sys logging.basicConfig(format='%(asctime)s %(name)s: %(message)s', level=logging.INFO) logger = logging.getLogger('check-whitespace') CR_RE = re.compile(r'\r') LEADING_WHITESPACE_RE = re.compile(r'\s+') TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z') NO_NEWLINE_RE...
bsd-2-clause
JayvicWen/Crawler
kaoyan/crawl_post.py
2
2301
#!/usr/bin/env python # encoding:utf-8 import os import sys import requests import MySQLdb from bs4 import BeautifulSoup from bs4 import SoupStrainer from config import * base_url = 'http://download.kaoyan.com' status = [] def get_soup(url, parse_only=None): content = requests.get(url).content return Beau...
mit
vnc-biz/pyzimbra
pyzimbra/z/admin.py
3
2605
# -*- coding: utf-8 -*- """ ################################################################################ # Copyright (c) 2010, Ilgar Mashayev # # E-mail: pyzimbra@lab.az # Website: http://github.com/ilgarm/pyzimbra ################################################################################ # This file is part...
lgpl-3.0
arummler/eudaq
legacy/producers/palpidess/scripts/slow_control/config_pALPIDE_driver.py
11
3952
#! /usr/bin/env python ## ## standard configuration of the FEC HLVDS for the use ## with the pALPIDE with the Padua Proximity board V1 ## import sys import os import SlowControl # slow control code import biasDAC # special code to setup up the voltage biases m = SlowControl.SlowControl(0) # HLVDS FEC (master) # w...
lgpl-3.0
ljgabc/lfs
usr/lib/python2.7/test/test_zipimport.py
128
16817
import sys import os import marshal import imp import struct import time import unittest from test import test_support from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co # some tests can be ran even without zlib try: import zlib except ImportError: zlib = None from zipfile import Zi...
gpl-2.0
dylanparsons/Sample-Code
python/pickle.py
1
3287
import pickle import math import random def arrow(n): return str(n)+"--> " def isPositive(aNumber): return aNumber > 0 def abs(aNumber): if aNumber >= 0: return aNumber return -aNumber def main2(): """ test two build in high order functions: map and filter functions""" ...
gpl-3.0
MiLk/youtube-dl
youtube_dl/extractor/ign.py
12
4549
from __future__ import unicode_literals import re from .common import InfoExtractor class IGNIE(InfoExtractor): """ Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com. Some videos of it.ign.com are also supported """ _VALID_URL = r'https?://.+?\.ign\.com/(?P<type>video...
unlicense
abenzbiria/clients_odoo
addons/website_hr_recruitment/controllers/main.py
19
5703
# -*- coding: utf-8 -*- import base64 from openerp import SUPERUSER_ID from openerp import http from openerp.tools.translate import _ from openerp.http import request from openerp.addons.website.models.website import slug class website_hr_recruitment(http.Controller): @http.route([ '/jobs', '/job...
agpl-3.0
sargas/scipy
scipy/stats/tests/test_mstats_extras.py
4
4790
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for maskedArray statistics. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, print_function, absolute_import __author__ = "Pierre GF Gerard-Marchant ($Author: backtopop $)" import numpy as np import ...
bsd-3-clause
cohortfsllc/cohort-cocl2-sandbox
buildbot/buildbot_lib.py
2
21805
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 optparse import os.path import shutil import subprocess import stat import sys import time import traceback ARCH_MAP = { ...
bsd-3-clause
supriyantomaftuh/syzygy
third_party/numpy/files/numpy/polynomial/legendre.py
16
33731
""" Objects for dealing with Legendre series. This module provides a number of objects (mostly functions) useful for dealing with Legendre series, including a `Legendre` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in th...
apache-2.0
holmes/intellij-community
python/lib/Lib/readline.py
82
5885
from __future__ import with_statement import os.path import sys from warnings import warn import java.lang.reflect.Array __all__ = ['add_history', 'clear_history', 'get_begidx', 'get_completer', 'get_completer_delims', 'get_current_history_length', 'get_endidx', 'get_history_item', 'get_history_...
apache-2.0
ghchinoy/tensorflow
tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch_test.py
2
80753
# 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
PhilippeTillet/DSHF-ICA
python/examples/infomax_.py
2
14364
# Authors: Lukas Breuer <l.breuer@fz-juelich.de> # Juergen Dammers <j.dammers@fz-juelich.de> # Denis A. Engeman <denis.engemann@gemail.com> # # License: BSD (3-clause) import math import logging import numpy as np logger = logging.getLogger('mne') # one selection here used across mne-python logger...
mit
otype/myip
setup.py
1
8799
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
mit
pyokagan/gyp
buildbot/buildbot_run.py
10
8342
#!/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. """Argument-less script to select what to run on the buildbots.""" import filecmp import os import shutil import subprocess import sys i...
bsd-3-clause
Dioptas/Dioptas
dioptas/model/MaskModel.py
1
11647
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
gpl-3.0
craigcitro/apitools
apitools/base/py/compression_test.py
8
5319
#!/usr/bin/env python # # Copyright 2017 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 o...
apache-2.0
seslattery/django-sample-app
bin/fabfile.py
1
3028
from fabric.api import cd, run, env, local, sudo, require from fabric.operations import _prefix_commands, _prefix_env_vars from lib.fabric_helpers import * import os import string env.hosts = ['djtut2.example.com'] env.code_dir = '/srv/www/djtut2' env.virtualenv = '/srv/www/djtut2/.virtualenv' env.code_repo = 'git@gi...
bsd-3-clause
Ademan/NumPy-GSoC
numpy/core/tests/test_umath.py
3
38130
import sys from numpy.testing import * import numpy.core.umath as ncu import numpy as np class TestDivision(TestCase): def test_division_int(self): # int division should follow Python x = np.array([5, 10, 90, 100, -5, -10, -90, -100, -120]) if 5 / 10 == 0.5: assert_equal(x / 1...
bsd-3-clause
eligoenergy/git-repo
subcmds/overview.py
83
2727
# # Copyright (C) 2012 The Android Open Source Project # # 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
cfei18/incubator-airflow
tests/www/api/experimental/test_endpoints.py
15
11876
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
JakeBrand/CMPUT410-E3
lab4/lib/python2.7/site-packages/jinja2/testsuite/debug.py
415
1935
# -*- coding: utf-8 -*- """ jinja2.testsuite.debug ~~~~~~~~~~~~~~~~~~~~~~ Tests the debug system. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase, filesystem_loader from jinja2 import Environment,...
apache-2.0
halberom/ansible-modules-extras
cloud/cloudstack/cs_loadbalancer_rule.py
31
11531
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # (c) 2015, René Moser <mail@renemoser.net> # # 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 So...
gpl-3.0
sujeet4github/MyLangUtils
LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/sqlalchemy/ext/serializer.py
32
5586
# ext/serializer.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Serializer/Deserializer objects for usage with SQLAlchemy query structures, all...
gpl-3.0
bobintetley/asm3
src/asm3/locales/locale_th.py
1
126059
# th.po val = {" days." : "", "(all)" : "", "(any)" : "", "(anyone)" : "(&#3652;&#3617;&#3656;&#3617;&#3637;)", "(available)" : "", "(blank)" : "", "(both)" : "", "(everyone)" : "", "(master user, not editable)" : "", "(no change)" : "", "(no deduction)" : "", "(none)" : "(&#3652;&#3617;&#3656;&#3617;&#3637;)", "(unkn...
gpl-3.0
ammaradil/fibonacci
Lib/site-packages/pip/_vendor/requests/__init__.py
412
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
mit
wolverineav/neutron
neutron/db/migration/autogen.py
11
3994
# Copyright (c) 2015 Red Hat # # 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...
apache-2.0
Swimlane/sw-python-client
functional_tests/driver_tests/test_user_group_fields.py
1
57102
import pytest from swimlane import exceptions @pytest.fixture(autouse=True, scope='module') def my_fixture(helpers): # setup stuff defaultApp = 'user group fields' pytest.swimlane_instance = helpers.swimlane_instance pytest.app, pytest.appid = helpers.findCreateApp(defaultApp) pytest.testUsers = l...
mit
kamijawa/ogc_server
bayesian/test/test_gaussian_bayesian_network.py
2
2497
from __future__ import division import pytest import os from bayesian.gaussian import MeansVector, CovarianceMatrix from bayesian.gaussian_bayesian_network import * from bayesian.examples.gaussian_bayesian_networks.river import ( f_a, f_b, f_c, f_d) def pytest_funcarg__river_graph(request): g = build_graph(...
mit
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/galaxy/visualization/data_providers/registry.py
1
5462
from galaxy.visualization.data_providers.basic import ColumnDataProvider from galaxy.visualization.data_providers import genome from galaxy.model import NoConverterException from galaxy.visualization.data_providers.phyloviz import PhylovizDataProvider from galaxy.datatypes.tabular import Tabular, Vcf from galaxy.dataty...
gpl-3.0
artur-shaik/qutebrowser
scripts/hostblock_blame.py
8
2305
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-3.0
AIML/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
218
3893
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
darisandi/geonode
geonode/maps/forms.py
18
1263
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 versio...
gpl-3.0
napkindrawing/ansible
lib/ansible/modules/network/f5/bigip_hostname.py
26
5767
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks Inc. # # 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 # ...
gpl-3.0
Toshakins/wagtail
wagtail/wagtailsnippets/views/snippets.py
2
8601
from __future__ import absolute_import, unicode_literals from django.apps import apps from django.core.urlresolvers import reverse from django.http import Http404 from django.shortcuts import get_object_or_404, redirect, render from django.utils.text import capfirst from django.utils.translation import ugettext as _ ...
bsd-3-clause
germanovm/vdsm
vdsm/gluster/storagedev.py
1
13988
# # Copyright 2015 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
pgjones/jinja
tests/test_security.py
23
6015
# -*- coding: utf-8 -*- """ jinja2.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~ Checks the sandbox and other security features. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import pytest from jinja2 import Environment from jinja2.sandbox import Sandboxe...
bsd-3-clause
magfest/ubersystem
alembic/versions/e1d3c11eb9dd_add_adult_panels_and_tables.py
1
1928
"""Add adult panels and tables Revision ID: e1d3c11eb9dd Revises: 1f862611ba04 Create Date: 2018-06-21 23:06:32.678061 """ # revision identifiers, used by Alembic. revision = 'e1d3c11eb9dd' down_revision = '1f862611ba04' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa try: ...
agpl-3.0
jspan/Open-Knesset
laws/forms.py
8
8038
from django import forms from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from datetime import date from tagging.models import Tag from models import (Vote, Bill, KnessetProposal, BillBudgetEstimation, CONVERT_TO_DISCUSSION_HEADERS) from vote_choices import (ORD...
bsd-3-clause
edx/ecommerce
ecommerce/extensions/api/v2/views/refunds.py
1
6962
"""HTTP endpoints for interacting with refunds.""" import logging from django.contrib.auth import get_user_model from django.db import transaction from django.utils.decorators import method_decorator from oscar.core.loading import get_model from rest_framework import generics, status from rest_framework.exceptions i...
agpl-3.0
jcoady9/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/rijndael.py
359
11341
""" A pure python (slow) implementation of rijndael with a decent interface To include - from rijndael import rijndael To do a key setup - r = rijndael(key, block_size = 16) key must be a string of length 16, 24, or 32 blocksize must be 16, 24, or 32. Default is 16 To use - ciphertext = r.encrypt(plaintext) plai...
apache-2.0
TanPhongPhan/ABC4GSD
ABC v3/library/basic_frames/ApplicationList.py
2
6114
#!/usr/bin/env python # -*- coding: utf8 -*- import wx import sys, os sys.path.append(os.getcwd()) import library.constants as CO from library.utils import utils as UT from library.client.ABCAppInterface import ABCAppInterface class ApplicationList(wx.Frame, ABCAppInterface): def __init__(self, parent, id, tit...
mit
aabbox/kbengine
kbe/res/scripts/common/Lib/test/test_code_module.py
79
3009
"Test InteractiveConsole and InteractiveInterpreter from code module" import sys import unittest from contextlib import ExitStack from unittest import mock from test import support code = support.import_module('code') class TestInteractiveConsole(unittest.TestCase): def setUp(self): self.console = code....
lgpl-3.0
dorotan/pythontraining
env/Lib/base64.py
15
20442
#! /usr/bin/env python3 """Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struc...
apache-2.0
larks/mbed
workspace_tools/host_tests/udpecho_server_auto.py
101
2515
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
cgar/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py
465
1781
# 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 of conditions and the f...
mpl-2.0
vitan/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/validate_templates.py
35
3355
import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.core.management.color import color_style from django.template.base import add_to_builtins from django.template.loaders.filesystem import Loader from django_extensions.utils import validatingtemplatet...
apache-2.0
c0defreak/python-for-android
python3-alpha/python3-src/Tools/unicode/mkstringprep.py
47
10046
import re, unicodedata, sys if sys.maxunicode == 65535: raise RuntimeError("need UCS-4 Python") def gen_category(cats): for i in range(0, 0x110000): if unicodedata.category(chr(i)) in cats: yield(i) def gen_bidirectional(cats): for i in range(0, 0x110000): if unicodedata.bidir...
apache-2.0
Daniex/horizon
openstack_dashboard/dashboards/project/data_processing/jobs/tabs.py
38
1172
# 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
wd5/jangr
djangoappengine/tests/not_return_sets.py
36
4303
import datetime from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.test import TestCase from .testmodels import FieldsWithOptionsModel, OrderedModel, \ SelfReferenceModel class NonReturnSetsTest(TestCase): floats = [5.3, 2.6, 9.1, 1.58, 2.4] emails = ['app-engine@...
bsd-3-clause
GREO/GNU-Radio
gnuradio-examples/python/digital_voice/encdec.py
10
2029
#!/usr/bin/env python # # Copyright 2005 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) ...
gpl-3.0
yakky/django
tests/check_framework/test_caches.py
249
1114
from django.core.checks.caches import E001 from django.test import SimpleTestCase from django.test.utils import override_settings class CheckCacheSettingsAppDirsTest(SimpleTestCase): VALID_CACHES_CONFIGURATION = { 'default': { 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', ...
bsd-3-clause
westinedu/newertrends
django/conf/locale/pt_BR/formats.py
231
1530
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \de N \de Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \de N \de Y à\s...
bsd-3-clause
TixLo/kademlia
lib/jsoncpp/devtools/antglob.py
3
7695
#!/usr/bin/env python # encoding: utf-8 # Baptiste Lepilleur, 2009 from __future__ import print_function from dircache import listdir import re import fnmatch import os.path # These fnmatch expressions are used by default to prune the directory tree # while doing the recursive traversal in the glob_impl method of gl...
gpl-3.0
crr0004/taiga-back
taiga/users/services.py
2
3912
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 the F...
agpl-3.0
huihoo/reader
vendor/appdotnet.py
19
9191
import json import requests # To add # - Identity Delegation # - Streams (in dev by app.net) # - Filters (in dev by app.net) class Appdotnet: ''' Once access has been given, you don't have to pass through the client_id, client_secret, redirect_uri, or scope. These are just to get the authentication token....
mit
fga-verival/2017-1Grupo2
backend/game/tests/acceptance/test_13.py
1
1980
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException...
gpl-3.0
giggsey/SickRage
lib/github/Permissions.py
74
3027
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
Sh4kE/ofm_helper
core/tests/unit/views/ofm_views/test_ofm_finances_view.py
2
4895
import json from django.core.urlresolvers import reverse from django.test import TestCase from core.factories.core_factories import MatchdayFactory, FinanceFactory from users.models import OFMUser class OFMFinancesViewTestCase(TestCase): def setUp(self): self.matchday = MatchdayFactory.create() ...
agpl-3.0
whip112/Whip112
vendor/packages/lockfile/symlinklockfile.py
487
2613
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # s...
mpl-2.0
cedk/odoo
addons/website_sale_options/controllers/main.py
236
3610
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website_sale.controllers.main import website_sale class website_sale_options(website_sale): @http.route(['/shop/product/<model("product.template"):product>'...
agpl-3.0
andreimacavei/coala
coalib/tests/bearlib/abstractions/SectionCreatableTest.py
2
2504
import sys sys.path.insert(0, ".") import unittest from coalib.bearlib.abstractions.SectionCreatable import SectionCreatable from coalib.settings.Section import Section, Setting class TestObject(SectionCreatable): def __init__(self, setting_one: int, raw_setting, ...
agpl-3.0
kingsamchen/Eureka
crack-data-structures-and-algorithms/leetcode/populating_next_right_pointers_in_each_node_II_q117.py
1
1821
""" # Definition for a Node. class Node(object): def __init__(self, val=0, left=None, right=None, next=None): self.val = val self.left = left self.right = right self.next = next """ # 核心思路 # 递归处理,因为题目已经说过递归调用栈不算extra space # 对于每一个节点,首先找到这个节点的不为空的,最靠右的孩子节点,作为下一层连接操作的左端 # 然后在这一层往右扫描,找...
mit
Changaco/oh-mainline
vendor/packages/Django/django/contrib/admin/templatetags/admin_modify.py
101
2428
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
agpl-3.0
codeforamerica/skillcamp
ENV/lib/python2.7/site-packages/psycopg2/tests/test_extras_dictcursor.py
62
17404
#!/usr/bin/env python # # extras_dictcursor - test if DictCursor extension class works # # Copyright (C) 2004-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 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...
mit
MaxStrange/ArtieInfant
scripts/plotaudio/plotaudio.py
1
2598
""" This is code that I find I use a LOT while debugging or analyzing. """ import audiosegment import math import matplotlib.pyplot as plt import numpy as np import os import sys ################################################# #### These are the parameters I have been using # #######################################...
mit
glaubitz/fs-uae-debian
arcade/launcher/ui/floppiesgroup.py
2
4358
import fsui from launcher.cd_manager import CDManager from launcher.floppy_manager import FloppyManager from launcher.i18n import gettext from launcher.option import Option from launcher.ui.behaviors.platformbehavior import ( AMIGA_PLATFORMS, CDEnableBehavior, FloppyEnableBehavior, ) from launcher.ui.floppy...
gpl-2.0
kalvdans/scipy
scipy/io/matlab/tests/test_mio.py
14
42133
# -*- coding: latin-1 -*- ''' Nose test generators Need function load / save / roundtrip tests ''' from __future__ import division, print_function, absolute_import import os from os.path import join as pjoin, dirname from glob import glob from io import BytesIO from tempfile import mkdtemp from scipy._lib.six impor...
bsd-3-clause
sschnug/pyeda
pyeda/parsing/pla.py
5
4136
""" PLA This is a partial implementation of the Berkeley PLA format. See extension/espresso/html/espresso.5.html for details. Exceptions: Error Interface Functions: parse """ # Disable 'no-name-in-module', b/c pylint can't look into C extensions # pylint: disable=E0611 import re from pyeda.boolalg.espre...
bsd-2-clause
watonyweng/horizon
openstack_dashboard/dashboards/project/images/images/urls.py
65
1264
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
janeloveless/mechanics-of-exploration
neuromech/util.py
1
11756
#! /usr/bin/env python import os import itertools as it import sys import textwrap #import gtk import numpy as np import sympy as sy import sympy.stats import odespy as ode import matplotlib import matplotlib.pyplot as plt import sympy.physics.mechanics as mech """ Pretty plotting code. """ _all_spines = ["top", "r...
unlicense
ms-iot/python
cpython/Lib/test/test_file.py
83
11367
import sys import os import unittest from array import array from weakref import proxy import io import _pyio as pyio from test.support import TESTFN, run_unittest from collections import UserList class AutoFileTests: # file tests for which a test file is automatically set up def setUp(self): self.f...
bsd-3-clause