repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
akhan7/servo
tests/wpt/web-platform-tests/mixed-content/generic/expect.py
92
4155
import json, os, urllib, urlparse def redirect(url, response): response.add_required_headers = False response.writer.write_status(301) response.writer.write_header("access-control-allow-origin", "*") response.writer.write_header("location", url) response.writer.end_headers() response.writer.wri...
mpl-2.0
lukino563/normandy_lulz_kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
zanph/zanph
flaskroulette/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_importlib/abc.py
96
2288
import abc import unittest class FinderTests(metaclass=abc.ABCMeta): """Basic tests for a finder to pass.""" @abc.abstractmethod def test_module(self): # Test importing a top-level module. pass @abc.abstractmethod def test_package(self): # Test importing a package. ...
gpl-2.0
its-dirg/saml-metadata-upload
src/metadata_upload/service.py
1
1421
import os import random import string from flask_transfer.transfer import Transfer from flask_transfer.validators import AllowedExts from flask_wtf.file import FileField from flask_wtf.file import FileRequired, FileAllowed from flask_wtf.form import Form from werkzeug.utils import secure_filename from wtforms.fields.s...
apache-2.0
Richard2ndQuadrant/ansible
lib/ansible/utils/module_docs_fragments/rackspace.py
232
4190
# (c) 2014, Matt Martz <matt@sivel.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 Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
hmen89/odoo
addons/website_certification/__openerp__.py
64
1502
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
aferr/TimingCompartments
src/cpu/o3/FuncUnitConfig.py
49
4259
# Copyright (c) 2010 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
oceanobservatories/mi-instrument
mi/dataset/parser/vel3d_cd_dcl.py
5
28186
""" @package mi.dataset.parser @file /mi/dataset/parser/vel3d_cd_dcl.py @author Emily Hahn @brief Parser for the vel3d instrument series c,d through dcl dataset driver """ __author__ = 'Emily Hahn' __license__ = 'Apache 2.0' import struct import re import binascii import base64 from mi.core.log import get_logger log...
bsd-2-clause
PokemonGoF/PokemonGo-Bot-Desktop
build/pywin/Lib/mhlib.py
22
33434
"""MH interface -- purely object-oriented (well, almost) Executive summary: import mhlib mh = mhlib.MH() # use default mailbox directory and profile mh = mhlib.MH(mailbox) # override mailbox location (default from profile) mh = mhlib.MH(mailbox, profile) # override mailbox and profile mh.error(format, ...)...
mit
ravello/ansible
v2/test/vars/test_variable_manager.py
12
4815
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
zwily/zulip
zerver/management/commands/sync_ldap_user_data.py
124
1461
from __future__ import absolute_import import logging from django.core.management.base import BaseCommand from django.db.utils import IntegrityError from django.conf import settings from zproject.backends import ZulipLDAPUserPopulator from zerver.models import UserProfile ## Setup ## log_format = "%(asctime)s: %(m...
apache-2.0
ssh-odoo/scrapy
scrapy/telnet.py
141
2946
""" Scrapy Telnet Console extension See documentation in docs/topics/telnetconsole.rst """ import pprint import logging from twisted.internet import protocol try: from twisted.conch import manhole, telnet from twisted.conch.insults import insults TWISTED_CONCH_AVAILABLE = True except ImportError: TWI...
bsd-3-clause
guorendong/iridium-browser-ubuntu
third_party/trace-viewer/third_party/closure_linter/closure_linter/not_strict_test.py
142
2332
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
bsd-3-clause
rghe/ansible
test/units/parsing/utils/test_addresses.py
135
3742
# -*- coding: utf-8 -*- import unittest from ansible.parsing.utils.addresses import parse_address class TestParseAddress(unittest.TestCase): tests = { # IPv4 addresses '192.0.2.3': ['192.0.2.3', None], '192.0.2.3:23': ['192.0.2.3', 23], # IPv6 addresses '::': ['::', Non...
gpl-3.0
naokimiyasaka/sublime-text
Backup/20140325101416/ConvertToUTF8/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
ibinti/intellij-community
python/lib/Lib/distutils/cygwinccompiler.py
77
17287
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
apache-2.0
miptliot/edx-platform
common/djangoapps/student/management/tests/test_change_enrollment.py
44
4210
""" Test the change_enrollment command line script.""" import ddt from mock import patch from django.core.management import call_command from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from student.tests.factories import UserF...
agpl-3.0
sowe9385/qiime
tests/test_compare_taxa_summaries.py
15
55832
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2012, The QIIME project" __credits__ = ["Jai Ram Rideout", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" """Test suite...
gpl-2.0
Pinecast/pinecast
sites/data.py
2
3909
import json from django.conf import settings from django.http import Http404 from . import models from accounts.models import UserSettings from accounts.payment_plans import FEATURE_MIN_COMMENT_BOX, FEATURE_MIN_SITE_FAVICON, minimum from podcasts.models import Podcast, PodcastEpisode from pinecast.helpers import get_...
apache-2.0
hejuna/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/Python_RSAKey.py
239
7707
"""Pure-Python RSA implementation.""" from cryptomath import * import xmltools from ASN1Parser import ASN1Parser from RSAKey import * class Python_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if (n and not e) or (e and not n): raise AssertionError() ...
apache-2.0
carltongibson/django-staticsite
staticsite/management/commands/buildstaticsite.py
1
3354
# -*- coding: utf-8 -*- import os import codecs from itertools import chain from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.template import Template from django.template.loader import get_template from django.test import RequestFactory from staticsite.vie...
bsd-2-clause
rainrambler/seccheck
tools/daca2-report.py
4
4586
import os import sys import subprocess def readdate(data): datepos = -1 if data[:5] == 'DATE ': datepos = 0 else: datepos = data.find('\nDATE ') if datepos >= 0: datepos = datepos + 1 if datepos < 0: return None datestr = '' datepos = datepos + 5 ...
gpl-3.0
ZENGXH/scikit-learn
sklearn/neighbors/tests/test_kde.py
208
5556
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
tempbottle/Impala
thirdparty/thrift-0.9.0/lib/py/src/server/TProcessPoolServer.py
94
3966
# # 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
xdajog/samsung_sources_i927
external/webkit/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
15
2560
# Copyright (C) 2010 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 ...
gpl-2.0
shawnferry/ansible
setup.py
20
1181
#!/usr/bin/env python import os import sys from glob import glob sys.path.insert(0, os.path.abspath('lib')) from ansible import __version__, __author__ try: from setuptools import setup, find_packages except ImportError: print("Ansible now needs setuptools in order to build. Install it using" " yo...
gpl-3.0
oriel-hub/api
django/idsapi/openapi/permissions.py
1
1176
from rest_framework.throttling import UserRateThrottle from rest_framework.exceptions import PermissionDenied from django.conf import settings from django.contrib.sites.models import Site class PerUserThrottlingRatePerGroup(UserRateThrottle): def allow_request(self, request, view): """ Implement ...
gpl-2.0
os-cloud/os-ansible-deployment
scripts/pw-token-gen.py
25
7433
#!/usr/bin/env python # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
awduda/awduda.github.io
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
mit
nanata1115/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
cjayb/mne-python
mne/gui/_marker_gui.py
14
15408
"""Mayavi/traits GUI for averaging two sets of KIT marker points.""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os import sys import numpy as np from mayavi.tools.mlab_scene_model import MlabSceneModel from pyface.api import confirm, error, FileDialog, OK, YES from ...
bsd-3-clause
takeflight/django
django/contrib/sessions/backends/cached_db.py
44
2855
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
bsd-3-clause
herocodemaster/opencvr
3rdparty/jsoncpp/scons-tools/srcdist.py
16
5427
# Copyright 2007 Baptiste Lepilleur # Distributed under MIT license, or public domain if desired and # recognized in your jurisdiction. # See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE import os import os.path from fnmatch import fnmatch import targz ##def DoxyfileParse(file_contents): ...
mit
Hwesta/advent-of-code
aoc2016/day5.py
1
4067
#!/usr/bin/env python """ --- Day 5: How About a Nice Game of Chess? --- You are faced with a security door designed by Easter Bunny engineers that seem to have acquired most of their security knowledge by watching hacking movies. The eight-character password for the door is generated one character at a time by findi...
mit
irwinlove/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
jiangjinjinyxt/vnpy
docker/dockerTrader/dataRecorder/drEngine.py
7
9582
# encoding: UTF-8 ''' 本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。 使用DR_setting.json来配置需要收集的合约,以及主力合约代码。 ''' import json import os import copy from collections import OrderedDict from datetime import datetime, timedelta from Queue import Queue from threading import Thread from eventEngine import * from vtGateway import V...
mit
dims/neutron
neutron/tests/unit/scheduler/test_l3_agent_scheduler.py
1
76578
# Copyright (c) 2013 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/LICENSE-2.0 # # Unless ...
apache-2.0
euripedesrocha/gizflo
gizflo/toolchain/_toolflow.py
2
3668
# Copyright (c) 2014 Christopher Felton # # 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. # # This program is dis...
lgpl-3.0
pmeier82/django-spikeval
djspikeval/forms/datafile.py
1
2926
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.apps import apps from .util import form_with_captcha __all__ = ["DatafileForm"] __author__ = "pmeier82" Asset = apps.get_registered_model("base", "asset") Datafile = apps.get_registered_model("djspikeval", "datafile"...
bsd-3-clause
hubsaysnuaa/odoo
addons/l10n_pa/__openerp__.py
260
1737
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_pyexpat.py
51
21917
# XXX TypeErrors on calling handlers, or on bad return values from a # handler, are obscure and unhelpful. import StringIO, sys import unittest import pyexpat from xml.parsers import expat from test.test_support import sortdict, run_unittest class SetAttributeTest(unittest.TestCase): def setUp(self): s...
apache-2.0
tlangerak/Multi-Agent-Systems
tlslite/constants.py
279
7476
"""Constants used in various places.""" class CertificateType: x509 = 0 openpgp = 1 cryptoID = 2 class HandshakeType: hello_request = 0 client_hello = 1 server_hello = 2 certificate = 11 server_key_exchange = 12 certificate_request = 13 server_hello_done = 14 certificate_ve...
lgpl-2.1
blerer/cassandra-dtest
range_ghost_test.py
8
1301
import time import logging from tools.assertions import assert_length_equal from dtest import Tester, create_ks, create_cf logger = logging.getLogger(__name__) class TestRangeGhosts(Tester): def test_ghosts(self): """ Check range ghost are correctly removed by the system """ cluster = self.clus...
apache-2.0
nolanliou/tensorflow
tensorflow/examples/get_started/regression/imports85.py
24
6638
# 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
abourget/formalchemy-abourget
formalchemy/tests/test_multiple_keys.py
1
3071
# -*- coding: utf-8 -*- from formalchemy.tests import * def test_renderer_names(): """ Check that the input name take care of multiple primary keys:: >>> fs = FieldSet(primary1) >>> print fs.field.render() <input id="PrimaryKeys-1_22-field" maxlength="10" name="PrimaryKeys-1_22-field" ...
mit
StephenWeber/ansible
lib/ansible/plugins/callback/jabber.py
67
3402
# Ansible CallBack module for Jabber (XMPP) # Copyright (C) 2016 maxn nikolaev.makc@gmail.com # # This module 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 opti...
gpl-3.0
CloudWareChile/OpenChile
openerp/tests/test_orm.py
14
6509
import os import unittest2 import openerp UID = 1 DB = openerp.tools.config['db_name'] CREATE = lambda values: (0, False, values) UPDATE = lambda id, values: (1, id, values) DELETE = lambda id: (2, id, False) FORGET = lambda id: (3, id, False) LINK_TO = lambda id: (4, id, False) DELETE_ALL = lambda: (5, False, False...
agpl-3.0
smartstudy/project_cron
main.py
1
2804
import json import os from AppKit import NSApplication, NSStatusBar, NSMenu, NSMenuItem, NSVariableStatusItemLength, NSImage from PyObjCTools import AppHelper from project_cron.models import Schedule from threading import Timer from project_cron.utils import logutil class App(NSApplication): def finishLaunching(...
mit
RockySteveJobs/python-for-android
python-modules/twisted/twisted/test/test_usage.py
61
12656
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import usage class WellBehaved(usage.Options): optParameters = [['long', 'w', 'default', 'and a docstring'], ['another', 'n', 'no docstring'], ...
apache-2.0
weaver-viii/subuser
logic/subuserCommands/repository.py
2
3795
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. import pathConfig #external imports import sys import optparse #internal imports from subuserlib.classes.user import User import subuserlib.resolve import subuserlib.repository import subuserlib.c...
lgpl-3.0
F5Networks/f5-ansible
devtools/stubs/tests_unit_module.py
2
2420
# -*- coding: utf-8 -*- # # Copyright: (c) 2020, 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
raymondnijssen/QGIS
python/plugins/processing/algs/grass7/ext/v_what_rast.py
10
1589
# -*- coding: utf-8 -*- """ *************************************************************************** v_what_rast.py --------------------- Date : December 2017 Copyright : (C) 2017 by Médéric Ribreux Email : medspx at medspx dot fr ***********************...
gpl-2.0
chrismdp/pushy
waveapi/model.py
4
10872
#!/usr/bin/python2.4 # # Copyright (C) 2009 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 l...
mit
bsmr-misc-forks/letsencrypt
certbot/tests/display/ops_test.py
1
12393
# coding=utf-8 """Test certbot.display.ops.""" import os import sys import tempfile import unittest import mock import zope.component from acme import jose from acme import messages from certbot import account from certbot import errors from certbot import interfaces from certbot.display import util as display_util...
apache-2.0
noblocknet/shadowsocks
shadowsocks/udprelay.py
9
10827
#!/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
uploadcare/stripe-python
stripe/test/resources/test_api_resource.py
3
2704
import stripe from stripe.test.helper import ( StripeApiTestCase, MyResource, MySingleton ) class APIResourceTests(StripeApiTestCase): def test_retrieve_and_refresh(self): self.mock_response({ 'id': 'foo2', 'bobble': 'scrobble', }) res = MyResource.retrieve('f...
mit
freddycucho/fmResume
ionicons-2.0.1/builder/scripts/eotlitetool.py
374
17505
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozil...
gpl-3.0
AlexBoogaard/Sick-Beard-Torrent-Edition
sickbeard/notifiers/plex.py
8
9037
# 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 t...
gpl-3.0
oswalpalash/remoteusermgmt
RUM/lib/python2.7/site-packages/setuptools/command/easy_install.py
16
86430
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ from...
mit
nttks/edx-platform
biz/djangoapps/ga_achievement/tests/test_views.py
1
201745
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from collections import OrderedDict from datetime import datetime from ddt import ddt import json from mock import patch impor...
agpl-3.0
piffey/ansible
lib/ansible/plugins/lookup/fileglob.py
54
1880
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: fileglob author: Mich...
gpl-3.0
naresh21/synergetics-edx-platform
lms/djangoapps/instructor_task/api_helper.py
8
14823
""" Helper lib for instructor_tasks API. Includes methods to check args for rescoring task, encoding student input, and task submission logic, including handling the Celery backend. """ import hashlib import json import logging from django.utils.translation import ugettext as _ from util.db import outer_atomic from ...
agpl-3.0
wasade/networkx
networkx/generators/ego.py
19
2281
""" Ego graph. """ # Copyright (C) 2010 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. __author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>', 'Aric Hagberg <hagberg@lan...
bsd-3-clause
ESOedX/edx-platform
common/test/acceptance/tests/lms/test_teams.py
1
84355
""" Acceptance tests for the teams feature. """ from __future__ import absolute_import import json import random import time from uuid import uuid4 import ddt from dateutil.parser import parse from selenium.common.exceptions import TimeoutException from six.moves import map, range from common.test.acceptance.fixture...
agpl-3.0
julen/translate
translate/storage/utx.py
24
9761
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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...
gpl-2.0
randynobx/ansible
test/units/modules/network/f5/test_bigip_ssl_certificate.py
48
8322
# -*- coding: utf-8 -*- # # Copyright 2017 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 # (at your option) a...
gpl-3.0
yangming85/lettuce
tests/integration/lib/Django-1.2.5/django/db/backends/sqlite3/base.py
51
10000
""" SQLite3 backend for django. Python 2.4 requires pysqlite2 (http://pysqlite.org/). Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the standard library. """ import re import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection...
gpl-3.0
samv/pyopenssl
examples/mk_simple_certs.py
10
1466
""" Create certificates and private keys for the 'simple' example. """ from OpenSSL import crypto from certgen import * # yes yes, I know, I'm lazy cakey = createKeyPair(TYPE_RSA, 2048) careq = createCertRequest(cakey, CN='Certificate Authority') cacert = createCertificate(careq, (careq, cakey), 0, (0, 60*60*24*365*...
apache-2.0
catapult-project/catapult-csm
third_party/Paste/paste/gzipper.py
50
3611
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licens...
bsd-3-clause
tuxfux-hlp-notes/python-batches
archieves/batch-61/modules/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py
374
3274
# urllib3/exceptions.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php ## Base Exceptions class HTTPError(Exception): "Base exception used by this module." ...
gpl-3.0
purushothamc/myibitsolutions
arrays/fill_range_in_spiral.py
1
1051
def generateMatrix(A): n = A rows, cols = n, n top, bottom = 0, n - 1 left, right = 0, n - 1 direction = 0 result = [[0 for j in xrange(n)] for i in xrange(n)] count = 1 while top <= bottom and left <= right: if direction is 0: for i in xrange(left, right + 1): ...
gpl-3.0
hackerkid/zulip
zerver/management/commands/send_webhook_fixture_message.py
6
3688
import os from typing import Dict, Optional, Union import orjson from django.conf import settings from django.core.management.base import CommandParser from django.test import Client from zerver.lib.management import CommandError, ZulipBaseCommand from zerver.lib.webhooks.common import standardize_headers from zerver...
apache-2.0
golismero/golismero
tools/sqlmap/extra/sqlharvest/sqlharvest.py
8
4332
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import cookielib import re import socket import sys import urllib import urllib2 import ConfigParser from operator import itemgetter TIMEOUT = 10 CONFIG_FILE = 'sqlharvest.c...
gpl-2.0
atsao72/sympy
sympy/sets/tests/test_sets.py
9
32368
from sympy import (Symbol, Set, Union, Interval, oo, S, sympify, nan, GreaterThan, LessThan, Max, Min, And, Or, Eq, Ge, Le, Gt, Lt, Float, FiniteSet, Intersection, imageset, I, true, false, ProductSet, E, sqrt, Complement, EmptySet, sin, cos, Lambda, ImageSet, pi, Eq, Pow, Contains, Sum, RootOf, Symmetr...
bsd-3-clause
HengeSense/objets-d-art
forum/templatetags/bbcode.py
2
5348
import re from django import template from django.template.defaultfilters import stringfilter register = template.Library() @register.filter(name='stripbb') @stringfilter def stripbb(value): bbdata = [ (r'\[badger\](.+?)\[/badger]', r'Check to see where else you can find me on <a target="_blank" href="...
gpl-3.0
Pafcholini/Nadia-kernel-KK-N910F-EUR-KK-N910FXXU1ANK4-Update1
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
schuhumi/i9100-proper-linux-kernel
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
zcbenz/cefode-chromium
native_client_sdk/src/build_tools/tests/update_nacl_manifest_test.py
1
25472
#!/usr/bin/env python # 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. import copy import datetime import hashlib import os import posixpath import subprocess import sys import tempfile import unittest ...
bsd-3-clause
prologic/kdb
kdb/plugins/rss.py
1
7377
from itertools import chain from time import mktime, time from pickle import dumps, loads from traceback import format_exc from circuits.protocols.irc import PRIVMSG from circuits import handler, task, Event, Timer, Component from feedparser import parse as parse_feed from funcy import first, second from html2text...
mit
runt18/mojo
build/android/gyp/create_test_runner_script.py
14
2963
#!/usr/bin/env python # # Copyright 2015 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. """Creates a script to run an android test using build/android/test_runner.py. """ import argparse import os import sys from util i...
bsd-3-clause
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/requests/packages/urllib3/contrib/socks.py
360
5668
# -*- coding: utf-8 -*- """ SOCKS support for urllib3 ~~~~~~~~~~~~~~~~~~~~~~~~~ This contrib module contains provisional support for SOCKS proxies from within urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and SOCKS5. To enable its functionality, either install PySocks or install this module w...
mit
briancurtin/python-openstacksdk
openstack/tests/functional/network/v2/test_auto_allocated_topology.py
1
2426
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
sekikn/incubator-airflow
airflow/serialization/helpers.py
11
1526
# 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
gustavofonseca/packtools
packtools/domain.py
1
20489
# coding:utf-8 """The domain-specific adapters. An adapter is an object that provides domain-specific apis for another object, called adaptee. Examples are: XMLValidator and XMLPacker objects, which provide SciELO PS validation behaviour and packaging functionality, respectively. """ from __future__ import unicode_li...
bsd-2-clause
doctorOb/thoughtsbydrob
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_scilab_builtins.py
364
31261
# -*- coding: utf-8 -*- """ pygments.lexers._scilab_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the ScilabLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # These lists are generated automatically. # Run the follo...
mit
numpy/datetime
numpy/testing/decorators.py
82
8486
""" Decorators for labeling and modifying behavior of test objects. Decorators that merely return a modified version of the original function object are straightforward. Decorators that return a new function object need to use :: nose.tools.make_decorator(original_function)(decorator) in returning the decorator, i...
bsd-3-clause
mattvick/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/submittoews.py
121
3431
# Copyright (C) 2010 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 ...
bsd-3-clause
datamade/yournextmp-popit
candidates/tests/test_revert.py
1
8163
import json from mock import patch from string import Template from django.db.models import F from django_webtest import WebTest from popolo.models import Identifier from candidates.models import MembershipExtra, PersonExtra from .auth import TestUserMixin from . import factories example_timestamp = '2014-09-29T10...
agpl-3.0
thedrow/cython
Demos/benchmarks/bpnn3.py
23
5372
#!/usr/bin/python # Back-Propagation Neural Networks # # Written in Python. See http://www.python.org/ # # Neil Schemenauer <nascheme@enme.ucalgary.ca> import math import random as random # Local imports import util random.seed(0) # calculate a random number where: a <= rand < b def rand(a, b, random=random.ran...
apache-2.0
sarvex/depot-tools
third_party/boto/manage/propget.py
115
2498
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
rubyu/anki
aqt/studydeck.py
2
4951
# Copyright: Damien Elmes <anki@ichi2.net> # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from aqt.qt import * import aqt from aqt.utils import showInfo, openHelp, getOnlyText, shortcut, restoreGeom, saveGeom from anki.hooks import addHook, remHook class StudyDe...
agpl-3.0
jancsarc/KIM-Online
src/profiles/forms.py
67
1169
from __future__ import unicode_literals from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions from django.contrib.auth import get_user_model from . impo...
mit
cloudera/hue
desktop/core/ext-py/docutils-0.14/test/test_writers/test_html4css1_parts.py
2
11359
#! /usr/bin/env python # $Id: test_html4css1_parts.py 8023 2017-02-05 10:29:18Z milde $ # Author: reggie dugard <reggie@users.sourceforge.net> # Copyright: This module has been placed in the public domain. """ Test for fragment code in HTML writer. Note: the 'body' and 'whole' entries have been removed from the part...
apache-2.0
sensarliar/paparazzi
sw/lib/python/pprz_math/setup.py
42
1711
#!/usr/bin/env python """ setup.py file for pprz math wrappers """ from distutils.core import setup, Extension from os import path, getenv # if PAPARAZZI_SRC not set, then assume the tree containing this # file is a reasonable substitute pprz_src = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.a...
gpl-2.0
myang321/django
tests/admin_docs/tests.py
116
19180
import datetime import sys import unittest from django.conf import settings from django.contrib.admindocs import utils from django.contrib.admindocs.views import get_return_data_type from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse fr...
bsd-3-clause
kidmaple/CoolWall
user/python/Tools/idle/BrowserControl.py
4
3871
"""Remote-control interfaces to some browsers.""" import os import string import sys DEFAULT_CONFIG_FILE = "~/.browser.ini" PROCESS_CREATION_DELAY = 4 DEFAULT_BROWSER = "netscape" _browsers = {} def get(name=None): if name is None: name = get_default_browser() else: name = string.lower(na...
gpl-2.0
zh3036/graphql_flask_pony_crunchBase
flask_pony_graphne/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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...
mit
elvishknight1/Terranova
venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
artistic-2.0
p4datasystems/CarnotKE
jyhton/lib-python/2.7/plat-mac/Carbon/Folders.py
81
9308
# Generated from 'Folders.h' def FOUR_CHAR_CODE(x): return x true = True false = False kOnSystemDisk = -32768L kOnAppropriateDisk = -32767 kSystemDomain = -32766 kLocalDomain = -32765 kNetworkDomain = -32764 kUserDomain = -32763 kClassicDomain = -32762 kCreateFolder = true kDontCreateFolder = false kSystemFolderType =...
apache-2.0