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
jawed123/django-stripe-payments
payments/views.py
5
5236
import json from django.conf import settings from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from django.template import RequestContext from django.template.loader import render_to_string from django.utils.encoding import smart_str...
mit
LevinJ/Pedestrian-detection-and-tracking
src/doppia/tools/stixels_evaluation/ground_top_and_bottom_pb2.py
1
3178
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: ground_top_and_bottom.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_po...
apache-2.0
rockneurotiko/django
django/db/backends/base/features.py
159
9718
from django.db.models.aggregates import StdDev from django.db.utils import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures(object): gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False empty_fetchmany_value = [] update_...
bsd-3-clause
funkotron/django-lean
src/django_lean/lean_retention/tests/test_reports.py
4
6900
from datetime import date, datetime, time, timedelta from django.contrib.auth.models import User from django.test import TestCase import mox from django_lean.lean_retention.models import DailyActivity from django_lean.lean_retention.reports import (sort_retention_periods, ...
bsd-3-clause
bofarrell/RECAPP-WebRTC
testrtc.py
6
2660
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. """ This module handles log file upload and download, delete log files from the blobstore (only allowed via a cron job) at a set interval and also creates a 10Mb downloadable file useful for bandwidth benchmarking. """ import cgi import logg...
bsd-3-clause
darjus-amzn/ryu
ryu/lib/packet/ospf.py
9
34589
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # 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
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_importhooks.py
127
8361
import sys import imp import os import unittest from test import test_support test_src = """\ def get_name(): return __name__ def get_file(): return __file__ """ absimp = "import sub\n" relimp = "from . import sub\n" deeprelimp = "from .... import sub\n" futimp = "from __future__ import absolute_import\n" r...
gpl-2.0
ev3dev/u-boot
test/py/u_boot_utils.py
2
10653
# SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # Utility code shared across multiple tests. import hashlib import inspect import os import os.path import pytest import sys import time import re def md5sum_data(data): """Calculate the MD5 hash of some data. ...
gpl-2.0
fnouama/intellij-community
python/lib/Lib/urlparse.py
99
12042
"""Parse (absolute and relative) URLs. See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. """ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", "urlsplit", "urlunsplit"] # A classification of schemes ('' means apply by default) uses_relative = ['ftp', 'htt...
apache-2.0
nathanial/lettuce
tests/integration/lib/Django-1.3/django/db/backends/postgresql/creation.py
247
3753
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll ...
gpl-3.0
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/template/loaders/cached.py
120
7116
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ import hashlib import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.template.backends.django import copy_exception from django.uti...
mit
brammeleman/shotwellfs
shotwellfs.py
1
11846
#!/usr/bin/env python #------------------------------------------------------------------------------- # # shotwellfs.py # # # See usage for details. # # LIMITATIONS: Unicode tags are not supported? # #------------------------------------------------------------------------------- import datetime import errno import o...
gpl-3.0
HwisooSo/gemV-update
util/stats/db.py
90
14018
# Copyright (c) 2003-2004 The Regents of The University of Michigan # 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 ...
bsd-3-clause
4eek/edx-platform
cms/djangoapps/contentstore/management/commands/create_course.py
163
2188
""" Django management command to create a course in a specific modulestore """ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from xmodule.modulestore import ModuleStoreEnum from contentstore.views.course import create_new_course_in_store from contentstore....
agpl-3.0
bols-blue/ansible
v1/ansible/module_utils/openstack.py
198
4502
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
nilgoyyou/dipy
dipy/core/gradients.py
4
13505
from __future__ import division, print_function, absolute_import from dipy.utils.six import string_types import numpy as np try: from scipy.linalg import polar except ImportError: # Some elderly scipy doesn't have polar from dipy.fixes.scipy import polar from scipy.linalg import inv from dipy.io import gra...
bsd-3-clause
briancline/softlayer-python
SoftLayer/tests/CLI/modules/ticket_tests.py
3
1288
""" SoftLayer.tests.CLI.modules.ticket_tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ from SoftLayer import testing import json class TicketTests(testing.TestCase): def test_list(self): result = self.run_command(['ticket', 'list']) e...
mit
Lehkeda/android_kernel_samsung_mint2g
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
jtrobec/pants
tests/python/pants_test/java/distribution/test_distribution_integration.py
9
2317
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from unittest import...
apache-2.0
sodafree/backend
build/ipython/build/lib.linux-i686-2.7/IPython/parallel/error.py
3
8806
# encoding: utf-8 """Classes and functions for kernel related errors and exceptions. Authors: * Brian Granger * Min RK """ from __future__ import print_function import sys import traceback __docformat__ = "restructuredtext en" # Tell nose to skip this module __test__ = {} #---------------------------------------...
bsd-3-clause
gsobczyk/hamster
waflib/extras/netcache_client.py
55
9095
#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011-2015 (ita) """ A client for the network cache (playground/netcache/). Launch the server with: ./netcache_server, then use it for the builds by adding the following: def build(bld): bld.load('netcache_client') The parameters should be present in the envi...
gpl-3.0
krichter722/binutils-gdb
gdb/testsuite/gdb.python/py-bad-printers.py
29
2584
# Copyright (C) 2008-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
Orav/kbengine
kbe/res/scripts/common/Lib/test/test_pty.py
2
11588
from test.support import verbose, run_unittest, import_module, reap_children #Skip these tests if either fcntl or termios is not available fcntl = import_module('fcntl') import_module('termios') import errno import pty import os import sys import select import signal import socket import unittest TEST...
lgpl-3.0
tvenkat/askbot-devel
askbot/__init__.py
2
2728
""" :synopsis: the Django Q&A forum application Functions in the askbot module perform various basic actions on behalf of the forum application """ import os import smtplib import sys import logging VERSION = (0, 7, 43) #keys are module names used by python imports, #values - the package qualifier to use for pip REQ...
gpl-3.0
salamer/django
tests/model_fields/test_durationfield.py
296
2724
import datetime import json from django import forms from django.core import exceptions, serializers from django.db import models from django.test import SimpleTestCase, TestCase from .models import DurationModel, NullDurationModel class TestSaveLoad(TestCase): def test_simple_roundtrip(self): duration...
bsd-3-clause
wujf/rethinkdb
scripts/VirtuaBuild/vm_build.py
46
10209
# Copyright 2010-2012 RethinkDB, all rights reserved. import os import socket import time import socket # pythonic discriminated union I guess, this is kind of retarded. # actually 0 need for a base class it's really more like a comment # that happens to be runable code class RunError(Exception): def __init__(se...
agpl-3.0
cherrishes/weilai
xingxing/protobuf/python/lib/Python2.7/google/protobuf/pyext/message_factory_cpp2_test.py
73
2459
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
apache-2.0
kenshay/ImageScript
Script_Runner/PYTHON/Lib/site-packages/paramiko/primes.py
7
5121
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2.1 of the License, or (a...
gpl-3.0
ptitjano/bokeh
tests/integration/interaction/test_hover.py
5
1326
from __future__ import absolute_import from bokeh.io import save from bokeh.models import HoverTool from bokeh.plotting import figure from selenium.webdriver.common.action_chains import ActionChains from tests.integration.utils import has_no_console_errors import pytest pytestmark = pytest.mark.integration HEIGHT = ...
bsd-3-clause
eckucukoglu/arm-linux-gnueabihf
arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_grammar.py
72
32702
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. from test.test_support import run_unittest, check_syntax_error, \ check_py3k_warnings import unittest import sys # testing import * from sys import * class TokenTests(unittest.TestCase): de...
gpl-2.0
krux/adspygoogle
examples/adspygoogle/dfp/v201204/get_team.py
2
1511
#!/usr/bin/python # # Copyright 2012 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 b...
apache-2.0
nnethercote/servo
components/script/dom/bindings/codegen/ply/ply/lex.py
344
40739
# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2009, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
mpl-2.0
samsu/neutron
plugins/vmware/dbexts/qos_db.py
10
13491
# Copyright 2013 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 a...
apache-2.0
sgerhart/ansible
lib/ansible/modules/network/cnos/cnos_conditional_command.py
17
5851
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
mit
wanahmadzainie/linux-mainline
tools/perf/python/tracepoint.py
270
1465
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- import perf class tracepoint(perf.evsel): def __init__(self, sys, name): config = perf.tracepoint(sys, name) perf.evsel.__init__(self, type = perf.TYPE_TRACEPOINT, config = config,...
gpl-2.0
nikgr95/scrapy
scrapy/spiders/feed.py
151
5441
""" This module implements the XMLFeedSpider which is the recommended spider to use for scraping from an XML feed. See documentation in docs/topics/spiders.rst """ from scrapy.spiders import Spider from scrapy.utils.iterators import xmliter, csviter from scrapy.utils.spider import iterate_spider_output from scrapy.sel...
bsd-3-clause
USCDataScience/polar.usc.edu
html/team22mime/tika-similarity/k-means.py
3
9494
#!/usr/bin/env python2.7 # # 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
wuwenbin2/onos_bgp_evpn
tools/test/topos/opticalUtils.py
13
31304
#!/usr/bin/python ''' Notes: This file contains classes and methods useful for integrating LincOE with Mininet, such as startOE, stopOE, LINCLink, and OpticalSwitch - $ONOS_ROOT ust be set - Need to run with sudo -E to preserve ONOS_ROOT env var - We assume LINC-Config-Generator is named LINC-Config-Generator - We a...
apache-2.0
wtsi-hgi/CoGS-Webapp
cogs/common/types.py
1
1053
""" Copyright (c) 2017 Genome Research Ltd. Authors: * Simon Beal <sb48@sanger.ac.uk> * Christopher Harrison <ch12@sanger.ac.uk> 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 Free Software Foundation, either version...
agpl-3.0
TwinDrills/Ludo
Engine/Source/ThirdParty/GoogleTest/googlemock/scripts/generator/cpp/gmock_class_test.py
395
11356
#!/usr/bin/env python # # Copyright 2009 Neal Norwitz All Rights Reserved. # Portions Copyright 2009 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 # # ...
gpl-3.0
sensysnetworks/uClinux
user/python/Tools/idle/FormatParagraph.py
20
5735
# Extension to format a paragraph # Does basic, standard text formatting, and also understands Python # comment blocks. Thus, for editing Python source code, this # extension is really only suitable for reformatting these comment # blocks or triple-quoted strings. # Known problems with comment reformatting: # * If t...
gpl-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/test/outstanding_bugs.py
87
2231
# # This file is for everybody to add tests for bugs that aren't # fixed yet. Please add a test case and appropriate bug description. # # When you fix one of the bugs, please move the test to the correct # test_ module. # import unittest from test import support # # One test case for outstanding bugs at the moment: #...
mit
odejesush/tensorflow
tensorflow/python/kernel_tests/resource_variable_ops_test.py
7
7259
# 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
jnewland/home-assistant
homeassistant/components/image_processing/__init__.py
5
6174
"""Provides functionality to interact with image processing services.""" import asyncio from datetime import timedelta import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_NAME, CONF_ENTITY_ID, CONF_NAME) from homeassistant.core import callback from homeassistant.exceptio...
apache-2.0
turbokongen/home-assistant
tests/components/yeelight/test_config_flow.py
5
10221
"""Test the Yeelight config flow.""" from unittest.mock import MagicMock, patch from homeassistant import config_entries from homeassistant.components.yeelight import ( CONF_MODE_MUSIC, CONF_MODEL, CONF_NIGHTLIGHT_SWITCH, CONF_NIGHTLIGHT_SWITCH_TYPE, CONF_SAVE_ON_CHANGE, CONF_TRANSITION, DE...
apache-2.0
sexcoin-project/sexcoin
contrib/devtools/optimize-pngs.py
111
3391
#!/usr/bin/env python # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi...
mit
uranusjr/django
tests/signing/tests.py
99
5150
import datetime from django.core import signing from django.test import SimpleTestCase from django.test.utils import freeze_time class TestSigner(SimpleTestCase): def test_signature(self): "signature() method should generate a signature" signer = signing.Signer('predictable-secret') sign...
bsd-3-clause
thrisp/flails
flask_flails/flap.py
1
4664
class Flap(object): """Common registration methods for applications & blueprints""" def __init__(self, flail): self.flail = flail def configure_context_processors(self, app, context_processors): """Sets app wide context processors.""" app.context_processor(lambda: context_processors...
mit
44px/redash
tests/test_permissions.py
14
1643
from collections import namedtuple from unittest import TestCase from redash.permissions import has_access MockUser = namedtuple('MockUser', ['permissions', 'group_ids']) view_only = True class TestHasAccess(TestCase): def test_allows_admin_regardless_of_groups(self): user = MockUser(['admin'], []) ...
bsd-2-clause
MycChiu/tensorflow
tensorflow/python/debug/cli/readline_ui_test.py
81
5646
# 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
mccheung/kbengine
kbe/src/lib/python/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
RoyalTS/econ-project-templates
.mywaflib/waflib/Tools/qt4.py
5
20342
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Tool Description ================ This tool helps with finding Qt4 tools and libraries, and also provides syntactic sugar for using Qt4 tools. The following snippet illustrates the tool usage:: def options(opt): opt.load('compiler_cxx qt...
bsd-3-clause
nirmeshk/oh-mainline
vendor/packages/sphinx/tests/test_markup.py
22
5129
# -*- coding: utf-8 -*- """ test_markup ~~~~~~~~~~~ Test various Sphinx-specific markup extensions. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from docutils import frontend, utils, nodes from docutils.parsers import rst ...
agpl-3.0
keltia/ansible-modules-extras
system/gluster_volume.py
8
13280
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Taneli Leppä <taneli@crasman.fi> # # This file is part of Ansible (sort of) # # 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 o...
gpl-3.0
simonwydooghe/ansible
test/units/modules/network/fortios/test_fortios_system_automation_stitch.py
21
8575
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
mwrlabs/veripy
veripy/models/ip_address_collection.py
1
2465
from veripy.models.ip_address import IPAddress class IPAddressCollection(object): INTERFACELOCAL = 1 LINKLOCAL = 2 SUBNETLOCAL = 3 ADMINLOCAL = 4 SITELOCAL = 5 ORGANISATIONLOCAL = 8 GLOBAL = 15 def __init__(self, ips): self.__v4_ips = [] self.__v4_mapped_ips = []...
gpl-3.0
alsotoes/vsphere-examples
python/.venv/lib/python2.6/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py
2994
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
dwillmer/rust
src/etc/sugarise-doc-comments.py
69
2482
#!/usr/bin/env python # # Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice...
apache-2.0
pib/chartfood
chartfood/__init__.py
1
2038
from pyramid.renderers import render def includeme(config): config.add_renderer(name='chart', factory='chartfood.InlineChartRenderer') config.add_renderer(name='chart_response', factory='chartfood.ChartResponseRenderer') class ChartRenderer(object): def c...
apache-2.0
prashantpawar/supybot-rothbot
plugins/Nickometer/__init__.py
15
3182
### # Copyright (c) 2004, William Robinson. # Derived from work (c) 1998, Adam Spiers <adam.spiers@new.ox.ac.uk> # 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 c...
bsd-3-clause
denny820909/builder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/util/migration.py
4
3192
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
mit
eric-haibin-lin/mxnet
tests/python/unittest/test_image.py
2
20524
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
borkit/scriptdump
AWS/lambda_python/delete-elb-alb.py
1
2100
# coding: utf-8 #ELB delete import boto3 # nodelete,trueを変数化 ND = 'nodelete' TR = 'true' def lambda_handler(event, context): #if __name__ == '__main__': #EC2の場合 client = boto3.client('elb') #loadbalancersの情報を変数化 resp = client.describe_load_balancers() all_list1 = [] del_list1 = [] #loadbala...
mit
tyndare/osmose-backend
analysers/analyser_osmosis_duplicated_geotag.py
1
6493
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Didier Marchand <****@free.fr> 2013 ## ## This program is free software: you can redi...
gpl-3.0
zhujunsan/shadowsocks
shadowsocks/manager.py
925
9692
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
apache-2.0
deandunbar/html2bwml
venv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py
279
3541
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
mit
HousekeepLtd/django
tests/auth_tests/test_tokens.py
297
2551
import unittest from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.test import TestCase from django.utils.six import PY3 class TokenGeneratorTest(TestCase): def test_make...
bsd-3-clause
wrdsb/canvas-lms
vendor/bundle/ruby/1.9.1/gems/pygments.rb-0.5.2/vendor/pygments-main/scripts/vim2pygments.py
127
26283
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Vim Colorscheme Converter ~~~~~~~~~~~~~~~~~~~~~~~~~ This script converts vim colorscheme files to valid pygments style classes meant for putting into modules. :copyright 2006 by Armin Ronacher. :license: BSD, see LICENSE for details. """ impor...
agpl-3.0
alexgleith/Quantum-GIS
python/plugins/sextante/modeler/Providers.py
5
1131
# -*- coding: utf-8 -*- """ *************************************************************************** Providers.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
gpl-2.0
Laurawly/tvm-1
tests/python/unittest/test_auto_scheduler_common.py
1
9013
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
zopyx/pyfilesystem
fs/contrib/tahoelafs/util.py
22
4731
''' Created on 25.9.2010 @author: marekp ''' import sys import platform import stat as statinfo import fs.errors as errors from fs.path import pathsplit try: # For non-CPython or older CPython versions. # Simplejson also comes with C speedup module which # is not in standard CPython >=2.6 ...
bsd-3-clause
mzdaniel/oh-mainline
mysite/customs/migrations/0021_copy_tracker_model_data_across.py
17
13212
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Migrate BugzillaTracker to BugzillaTrackerModel for bt in orm['customs.Bu...
agpl-3.0
CompPhysics/ThesisProjects
doc/MSc/msc_students/former/AudunHansen/Audun/Pythonscripts/diag_draw.py
1
16682
from numpy import * from matplotlib.pyplot import * def nconnect(n1,n2,S,order="l0", p_h = None): N = 60 Phx = (n1.x+n2.x)/2.0 Phy = (n1.y+n2.y)/2.0 lP = sqrt((n2.x-n1.x)**2 + (n2.y-n1.y)**2) dPx = (n2.x-n1.x)/lP dPy = (n2.y-n1.y)/lP Cx = Phx - S*dPy Cy = Phy + S*dPx ...
cc0-1.0
dongjoon-hyun/tensorflow
tensorflow/python/keras/layers/__init__.py
3
8594
# 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
listingmirror/boto
tests/integration/gs/util.py
25
3243
# Copyright (c) 2012, Google, Inc. # 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 # without limitation the rights to use, copy, modify...
mit
xfournet/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_idioms.py
327
4889
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
apache-2.0
Woodybrando/EdenMatrixTrading
eden.py
1
45315
#!/usr/bin/env python ''' Copyright (c) 2017 by Jayson Rahmlow <jayson.rahmlow@gmail.com> and Vanessa Rahmlow <vannyrahmlow@gmail.com> This file is part of EdenMatrixTrading. EdenMatrixTrading is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Li...
gpl-3.0
souravbadami/oppia
core/tests/performance_tests/test_config.py
6
4276
# Copyright 2016 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 required by applicable ...
apache-2.0
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/pyqtgraph/exporters/SVGExporter.py
6
18836
from .Exporter import Exporter from ..python2_3 import asUnicode from ..parametertree import Parameter from ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE from .. import debug from .. import functions as fn import re import xml.dom.minidom as xml import numpy as np __all__ = ['SVGExporter'] class SVGExporter(Exporter)...
gpl-3.0
zubair-arbi/edx-platform
pavelib/paver_tests/utils.py
111
1498
"""Unit tests for the Paver server tasks.""" import os from paver import tasks from unittest import TestCase class PaverTestCase(TestCase): """ Base class for Paver test cases. """ def setUp(self): super(PaverTestCase, self).setUp() # Show full length diffs upon test failure ...
agpl-3.0
miconof/CouchPotatoServer
libs/ndg/httpsclient/https.py
75
4834
"""ndg_httpsclient HTTPS module containing PyOpenSSL implementation of httplib.HTTPSConnection PyOpenSSL utility to make a httplib-like interface suitable for use with urllib2 """ __author__ = "P J Kershaw (STFC)" __date__ = "09/12/11" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ =...
gpl-3.0
bluebore/galaxy
platform/src/trace/dao.py
5
7701
# -*- coding:utf-8 -*- # Copyright (c) 2015, Galaxy 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 datetime from ftrace import sdk from galaxy import log_pb2 from galaxy import master_pb2 from galaxy import galaxy_pb2 from galaxy...
bsd-3-clause
felixjimenez/django
django/core/files/storage.py
47
10495
import os import errno from datetime import datetime from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import locks, File from django.core.files.move import file_move_safe from django.utils.crypto import get_random_string from django.utils.encoding impor...
bsd-3-clause
littlstar/chromium.src
tools/usb_gadget/mouse_gadget.py
101
5065
# 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. """Implementation of a USB HID mouse. Two classes are provided by this module. The MouseFeature class implements the core functionality of a HID mouse and c...
bsd-3-clause
sdgdsffdsfff/jumpserver
apps/ops/views/adhoc.py
1
3665
# ~*~ coding: utf-8 ~*~ from django.utils.translation import ugettext as _ from django.conf import settings from django.views.generic import ListView, DetailView, TemplateView from common.mixins import DatetimeSearchMixin from common.permissions import PermissionsMixin, IsOrgAdmin from orgs.utils import current_org f...
gpl-2.0
gnuhub/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_throw.py
327
1586
"""Fixer for generator.throw(E, V, T). g.throw(E) -> g.throw(E) g.throw(E, V) -> g.throw(E(V)) g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) g.throw("foo"[, V[, T]]) will warn about string exceptions.""" # Author: Collin Winter # Local imports from .. import pytree from ..pgen2 import token from .. im...
apache-2.0
kawasaki2013/getting-started-python
6-pubsub/tests/test_end_to_end.py
3
2501
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Taranys/Sick-Beard
sickbeard/clients/__init__.py
38
2409
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
anurag-ks/eden
modules/s3/sync_adapter/eden.py
4
26523
# -*- coding: utf-8 -*- """ S3 Synchronization: Peer Repository Adapter @copyright: 2011-15 (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 "Software"), to deal in th...
mit
studio666/gnuradio
gr-uhd/apps/hf_radio/output.py
58
1387
# Copyright 2011 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) # any later version. # # G...
gpl-3.0
alfonsokim/nupic
src/nupic/data/stats.py
10
6351
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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 progra...
agpl-3.0
1yvT0s/scrapy
tests/__init__.py
95
1154
""" tests: this package contains all Scrapy unittests see http://doc.scrapy.org/en/latest/contributing.html#running-tests """ import os # ignore system-wide proxies for tests # which would send requests to a totally unsuspecting server # (e.g. because urllib does not fully understand the proxy spec) os.environ['http...
bsd-3-clause
shacker/django
tests/template_backends/test_django.py
77
6100
from template_tests.test_response import test_processor_name from django.template import Context, EngineHandler, RequestContext from django.template.backends.django import DjangoTemplates from django.template.library import InvalidTemplateLibrary from django.test import RequestFactory, override_settings from .test_du...
bsd-3-clause
bohlian/frappe
frappe/utils/fixtures.py
5
2435
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function import frappe, os from frappe.core.page.data_import_tool.data_import_tool import import_doc, export_json def sync_fixtures(app=None): """Import, overwrite fixtu...
mit
samba-team/samba
python/samba/tests/ldap_referrals.py
1
3204
# Test that ldap referral entiries are created and formatted correctly # # Copyright (C) Andrew Bartlett 2019 # # Based on Unit tests for the notification control # Copyright (C) Stefan Metzmacher 2016 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-3.0
xNovax/SickRage
lib/github/tests/Framework.py
25
11595
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
Lemma1/MAC-POSTS
doc_builder/sphinx-contrib/imagesvg/tests/docs/conf.py
1
8041
# -*- coding: utf-8 -*- # # test documentation build configuration file, # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are comment...
mit
Nazg-Gul/bfarm
lib/master/HTTPHandlers/FileHandler.py
1
8611
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ***** BEGIN GPL LICENSE BLOCK ***** # # 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...
gpl-2.0
orbitfp7/nova
nova/api/openstack/compute/plugins/v3/fixed_ips.py
13
3798
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
guerrerocarlos/odoo
addons/website/models/res_config.py
240
2660
from openerp.osv import fields, osv class website_config_settings(osv.osv_memory): _name = 'website.config.settings' _inherit = 'res.config.settings' _columns = { 'website_id': fields.many2one('website', string="website", required=True), 'website_name': fields.related('website_id', 'name'...
agpl-3.0