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
dwadler/QGIS
python/plugins/processing/algs/gdal/ClipRasterByExtent.py
5
6353
# -*- coding: utf-8 -*- """ *************************************************************************** ClipRasterByExtent.py --------------------- Date : September 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander bruy at gmail dot com ********...
gpl-2.0
mbiebl/rsyslog-doc
source/_ext/edit_on_github.py
16
1177
""" Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the sidebar. Loosely based on https://github.com/astropy/astropy/pull/347 """ import os import warnings __licence__ = 'BSD (3 clause)' def get_github_url(app, view, path): return 'https://github.com/{project}/{view}/{branch}/source/{path}...
apache-2.0
BellScurry/gem5-fault-injection
src/cpu/simple/TimingSimpleCPU.py
69
1886
# Copyright (c) 2007 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 list ...
bsd-3-clause
devGregA/code
build/lib.linux-x86_64-2.7/scrapy/contrib/spiders/sitemap.py
30
2670
import re from scrapy.spider import Spider from scrapy.http import Request, XmlResponse from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots from scrapy.utils.gz import gunzip, is_gzipped from scrapy import log class SitemapSpider(Spider): sitemap_urls = () sitemap_rules = [('', 'parse')] s...
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/boto/ec2/elb/attributes.py
153
5103
# 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, merge, publish, dis- # tribute, sublicense, and/or sell co...
agpl-3.0
kpkhxlgy0/SublimeText3
Packages/SublimeCodeIntel/libs/SilverCity/ScintillaConstants.py
10
39525
# The file was automatically generated by write_scintilla.py # from Scintilla.iface # # Do not manually edit! # LexerModule ids (used in find_lexer_module_by_id) SCLEX_CONTAINER = 0 SCLEX_NULL = 1 SCLEX_PYTHON = 2 SCLEX_CPP = 3 SCLEX_HTML = 4 SCLEX_XML = 5 SCLEX_PERL = 6 SCLEX_SQL = 7 SCLEX_VB = 8 SCLEX_PROPERTIES = ...
mit
codenote/chromium-test
chrome/test/webdriver/test/util.py
49
3101
# 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. """Generic utilities for all python scripts.""" import atexit import os import signal import stat import subprocess import sys import tempfile import ur...
bsd-3-clause
codeAshu/cgt
cgt/api.py
3
19725
import operator import numpy as np import sys if sys.argv[0] != "gen_py.py": from api_autogen import * import cgt from . import core, utils # Every non-underscored function in this file should have a docstring, and it should enforce that the input data is valid # ==================================================...
mit
MarllonSoares/PYTHON-ESTUDO
tipos-de-variaveis/02-atribuicao-multipla/atribuicao-multipla.py
1
1038
# -*- coding: utf-8 -*- """ Created on Sat Mar 18 01:47:28 2017 @author: Marllon Soares @site: www.marllonsoares.com.br @assunto: Atribuição múltipla @linguagem: Python3 @doc: O Python permite que você atribua um único valor a várias variáveis ​​simultaneamente. Por exemplo - a = b = c = 1 Aqui, um ob...
mit
s0enke/boto
tests/integration/ec2/autoscale/test_cert_verification.py
126
1575
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # 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 withou...
mit
RadioFreeAsia/RDacity
lib-src/lv2/serd/waflib/Tools/ldc2.py
330
1029
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_ldc2(conf): conf.find_program(['ldc2'],var='D') out=conf.cmd_and_log([conf.env.D,'-...
gpl-2.0
Kazade/NeHe-Website
google_appengine/lib/django-1.5/tests/regressiontests/utils/functional.py
93
1084
from django.utils import unittest from django.utils.functional import lazy, lazy_property class FunctionalTestCase(unittest.TestCase): def test_lazy(self): t = lazy(lambda: tuple(range(3)), list, tuple) for a, b in zip(t(), range(3)): self.assertEqual(a, b) def test_lazy_base_clas...
bsd-3-clause
40223125/40223125-2
static/Brython3.1.1-20150328-091302/Lib/_thread.py
740
4879
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
gpl-3.0
glenn-edgar/local_scda
flask_web/werkzeug-master/werkzeug/contrib/cache.py
72
23068
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
mit
bmravec/DownMan
downman/downloaders/hosters/rapidshare.py
1
7541
# # rapidshare.py # # Copyright 2010 Brett Mravec <brett.mravec@gmail.com> # # 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 # ...
gpl-2.0
rockyzhang/zhangyanhit-python-for-android-mips
sl4atools/fullscreenwrapper2/fullscreenwrapper2.py
44
25662
''' @copyright: Hariharan Srinath, 2012 @license: This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/ ''' import abc #import android import cPickle import json import sys import time import os import hashlib class BaseDict(dict): ''' impl...
apache-2.0
grlee77/scipy
scipy/io/matlab/tests/test_mio_utils.py
15
1593
""" Testing """ import numpy as np from numpy.testing import assert_array_equal, assert_ from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings def test_squeeze_element(): a = np.zeros((1,3)) assert_array_equal(np.squeeze(a), squeeze_element(a)) # 0-D output from squeeze gives scalar ...
bsd-3-clause
thinkopensolutions/tkobr-addons
unported/tko_project_task_type/project_task.py
2
2555
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
taedla01/MissionPlanner
Lib/site-packages/scipy/signal/tests/test_fir_filter_design.py
55
13131
import numpy as np from numpy.testing import TestCase, run_module_suite, assert_raises, \ assert_array_almost_equal, assert_ from scipy.signal import firwin, firwin2, kaiserord, freqz, remez class TestFirwin(TestCase): def check_response(self, h, expected_response, tol=.05): N = len(h) ...
gpl-3.0
DeercoderResearch/theano_exercises
02_advanced/02_debugging/ex_02_detect_negative_soln.py
13
2042
import numpy as np from theano import function from theano import tensor as T import theano from theano.compile import Mode class NegativeVariableError(Exception): pass def get_neg_detection_mode(): """ Returns a theano Mode that detects if any negative value occurs in the evaluation of a theano fun...
bsd-3-clause
nagyistoce/koalacloud
boto/sdb/item.py
19
6974
# Copyright (c) 2006,2007 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...
apache-2.0
imjonsnooow/vivisect
vivisect/qt/views.py
4
11441
import vqt.tree as vq_tree import vivisect.base as viv_base import envi.qt.memory as e_q_memory import visgraph.pathcore as vg_path import envi.qt.memcanvas as e_q_memcanvas import vivisect.qt.ctxmenu as v_q_ctxmenu from PyQt4 import QtGui,QtCore from vqt.main import * from vqt.common import * from vivisect.const im...
apache-2.0
dreamsxin/kbengine
kbe/res/scripts/common/Lib/test/test_structmembers.py
87
4889
import unittest from test import support # Skip this test if the _testcapi module isn't available. support.import_module('_testcapi') from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULON...
lgpl-3.0
jarmoni/ansible-modules-core
packaging/language/gem.py
76
8146
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Johan Wiren <johan.wiren.se@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 th...
gpl-3.0
openthread/openthread
tools/harness-automation/cases/med_6_2_1.py
9
1871
#!/usr/bin/env python # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
cneill/designate
designate/openstack/common/report/views/text/process.py
7
1236
# Copyright 2014 Red Hat, 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 agre...
apache-2.0
hujiajie/pa-chromium
tools/telemetry/third_party/png/png.py
161
157814
#!/usr/bin/env python # $URL$ # $Rev$ # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org> # # Original concept by Johann...
bsd-3-clause
celibertojr/Kbsim
lib/pgu/gui/deprecated.py
26
2375
import pygame from .const import * from . import table from . import group from . import button, basic from . import pguglobals def action_open(value): print('gui.action_open',"Scheduled to be deprecated.") value.setdefault('x',None) value.setdefault('y',None) value['container'].open(value['window'],v...
gpl-3.0
peterwilletts24/Monsoon-Python-Scripts
rain/rain_mean_by_day.py
1
3074
""" Load multiple pp diagnostic files, aggregate by year, day etc, calcualte mean, sum etc and save """ import os, sys import datetime import iris import iris.unit as unit from iris.coord_categorisation import add_categorised_coord import pdb diag = 'avg.5216' cube_name_explicit='stratiform_rainfall_rate' cube_name...
mit
bartoszj/Mallet
mallet/UIKit/UIDeviceRGBColor.py
1
4351
#! /usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Bartosz Janda # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including w...
mit
red-hood/calendarserver
twistedcaldav/test/test_caldavxml.py
1
6897
## # Copyright (c) 2011-2015 Apple 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 l...
apache-2.0
pawciobiel/fgpst-gae
tests/utils/test_memc.py
1
1311
import base64 import datetime import json import sys import unittest from webtest import TestApp from google.appengine.api import memcache from google.appengine.ext import testbed from fgpst.utils import memc class TestMemc(unittest.TestCase): def setUp(self): # First, create an instance of the Testbed...
gpl-3.0
hobbyjobs/photivo
scons-local-2.2.0/SCons/Action.py
14
47618
"""SCons.Action This encapsulates information about executing any sort of action that can build one or more target Nodes (typically files) from one or more source Nodes (also typically files) given a specific Environment. The base class here is ActionBase. The base class supplies just a few OO utility methods and so...
gpl-3.0
kamcpp/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py
5
20218
# 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
nvoron23/socialite
jython/Lib/email/parser.py
392
3300
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw, Thomas Wouters, Anthony Baxter # Contact: email-sig@python.org """A parser of RFC 2822 and MIME email messages.""" __all__ = ['Parser', 'HeaderParser'] import warnings from cStringIO import StringIO from email.feedparser import FeedParser ...
apache-2.0
charactory/namcap
Namcap/capsnamespkg.py
2
1271
# # namcap rules - capsnamespkg # Copyright (C) 2003-2007 Jason Chu <jason@archlinux.org> # # 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 yo...
gpl-2.0
openstack/automaton
automaton/runners.py
1
7425
# Copyright (C) 2015 Yahoo! 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...
apache-2.0
dancingdan/tensorflow
tensorflow/contrib/distributions/python/ops/inverse_gamma.py
13
11091
# 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
DSPay/DSValue
share/qt/extract_strings_qt.py
145
1900
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format pro...
mit
qitaos/robotframework-mabot
lib/robot/utils/charwidth.py
4
7424
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
apache-2.0
trondhindenes/ansible
test/units/modules/monitoring/test_icinga2_feature.py
68
3806
# -*- coding: utf-8 -*- # Copyright (c) 2018, Ansible Project # 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 ansible.modules.monitoring import icinga2_feature from units.modules.utils import AnsibleExitJs...
gpl-3.0
ololobster/cvidone
cvidone/model/password_change_request.py
1
1582
# Released under the MIT license. See the LICENSE file for more information. # https://github.com/ololobster/cvidone from .user import User class PasswordChangeRequest(object): def __init__(self): self._token = None self._user_id = None @staticmethod def getExisting(db, token): ...
mit
bdelbosc/bundleman
setup.py
1
3472
#! /usr/bin/env python # (C) Copyright 2006 Nuxeo SAS <http://nuxeo.com> # Author: bdelbosc@nuxeo.com # # 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 ...
gpl-2.0
ycool/apollo
modules/tools/open_space_visualization/hybrid_a_star_visualizer.py
2
6573
#!/usr/bin/env python ############################################################################### # Copyright 2018 The Apollo 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 ...
apache-2.0
MQQiang/kbengine
kbe/src/lib/python/Lib/test/test_stat.py
84
6997
import unittest import os from test.support import TESTFN, import_fresh_module c_stat = import_fresh_module('stat', fresh=['_stat']) py_stat = import_fresh_module('stat', blocked=['_stat']) class TestFilemode: statmod = None file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK', ...
lgpl-3.0
JackPrice/ansible-modules-extras
notification/mail.py
5
9642
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
markr622/moose
gui/gui/FlowLayout.py
42
2707
try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load either PyQt or PySide") class FlowLayout(QtG...
lgpl-2.1
shipci/sympy
sympy/physics/optics/__init__.py
58
1218
__all__ = [] # The following pattern is used below for importing sub-modules: # # 1. "from foo import *". This imports all the names from foo.__all__ into # this module. But, this does not put those names into the __all__ of # this module. This enables "from sympy.physics.optics import TWave" to # work. # 2....
bsd-3-clause
gst/amqpy
amqpy/tests/test_serialization.py
1
9249
from datetime import datetime from decimal import Decimal from random import randint import pytest from ..message import GenericContent from ..serialization import AMQPReader, AMQPWriter, FrameSyntaxError def assert_equal_binary(b, s): assert b == s.encode('latin_1') class TestSerialization: def test_empt...
mit
l0kix2/python-debparse
tests/debcontrol/test_debcontrol_paragraphs.py
1
1572
# coding: utf-8 from debparse.deb_control import paragraphs from . import examples def test_get_raw_paragraphs_correct_count_with_linebreaks(): data = examples.CONTROL_FILE_DATA raw_paragraph = paragraphs.get_raw_paragraphs(data) assert len(raw_paragraph) == 3 def test_get_raw_paragraphs_correct_count...
bsd-3-clause
OpenDaisy/daisy-api
daisy/api/backends/os.py
1
27832
# Copyright 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 # # Un...
apache-2.0
evanscottgray/ryu
ryu/tests/integrated/test_add_flow_v12_matches.py
34
40869
# Copyright (C) 2012 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
sangh/LaserShow
pyglet-hg/contrib/scene2d/scene2d/camera.py
29
1270
#!/usr/bin/env python ''' Camera for projecting 2d flat scenes ==================================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.event import * class Camera(object): def project(self): '''Set up the GL projection matrix. Leave us in GL_...
bsd-3-clause
tobegit3hub/keystone_docker
keystone/common/validation/validators.py
24
2735
# 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 Li...
apache-2.0
octobot-dev/pulpo-forms-django
views.py
2
30920
from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.dispatch import receiver from django.http import HttpResponse, HttpResponseBadRequest from django.http.response import HttpResponseRedirect from django.views.generic import TemplateView from django.shortcut...
apache-2.0
XiaodunServerGroup/ddyedx
lms/djangoapps/courseware/tests/test_module_render.py
12
30189
""" Test for lms courseware app, module render unit """ from ddt import ddt, data from functools import partial from mock import MagicMock, patch, Mock import json from django.http import Http404, HttpResponse from django.core.urlresolvers import reverse from django.conf import settings from django.test import TestCas...
agpl-3.0
mhotwagner/abackend
abackend-env/lib/python3.5/site-packages/django/contrib/staticfiles/views.py
581
1329
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath from django.conf import settings from django.contrib.staticfiles import finders from django.http import Http404 from django.utils.six.moves.url...
mit
momingsong/ns-3
src/core/examples/sample-simulator.py
43
2339
# -*- Mode:Python; -*- # /* # * Copyright (c) 2010 INRIA # * # * 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; # * # * This program is distributed in the hope that it will b...
gpl-2.0
shupelneker/gae_new_structure
boilerplate/external/requests/packages/chardet/jpcntx.py
949
19104
######################## 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...
lgpl-3.0
Peddle/hue
desktop/core/ext-py/python-daemon/test/test_runner.py
39
23973
# -*- coding: utf-8 -*- # # test/test_runner.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2009 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # la...
apache-2.0
amyvmiwei/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/commands/bundle.py
392
1787
import textwrap from pip.locations import build_prefix, src_prefix from pip.util import display_path, backup_dir from pip.log import logger from pip.exceptions import InstallationError from pip.commands.install import InstallCommand class BundleCommand(InstallCommand): """Create pybundles (archives containing mul...
lgpl-3.0
utamaro/youtube-dl
youtube_dl/extractor/metacafe.py
87
10165
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse, compat_urllib_parse_unquote, compat_urllib_request, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, ) class MetacafeIE(Info...
unlicense
gregerts/debian-qpid-cpp
bindings/qpid/examples/python/statistics.py
4
3983
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
Cactuslegs/audacity-of-nope
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/extras/autowaf.py
65
22357
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import glob import os import subprocess import sys from waflib import Configure,Context,Logs,Node,Options,Task,Utils from waflib.TaskGen import feature,before,after global g_i...
gpl-2.0
codecollision/DropboxToFlickr
django/contrib/formtools/utils.py
245
2158
try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.forms import BooleanField from django.utils.crypto import salted_hmac from django.utils.hashcompat import md5_constructor def security_hash(request, form, *args): """ Calculates a security has...
bsd-3-clause
qjw/grit-i18n
grit/test_suite_all.py
32
7518
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit test suite that collects all test cases for GRIT.''' import os import sys if __name__ == '__main__': sys.path.append(os....
bsd-2-clause
jstriebel/webcam-effects
pipes/dank_pipe.py
1
1040
from pipes.pipe import Pipe import numpy as np import cv2 class DankPipe(Pipe): def pipe(self, data): data = cv2.blur(data, (8, 8)) result = np.ndarray(data.shape) # define colors blue = [255, 0, 0] green = [0, 255, 0] red = [0, 0, 255] ...
mit
agrista/odoo-saas
addons/website_blog/wizard/__init__.py
373
1077
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
TheTimmy/spack
var/spack/repos/builtin/packages/msgpack-c/package.py
3
1585
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
immesys/RiSyn
dist/tools/mcuboot/imgtool/version.py
50
1149
""" Semi Semantic Versioning Implements a subset of semantic versioning that is supportable by the image header. """ import argparse from collections import namedtuple import re SemiSemVersion = namedtuple('SemiSemVersion', ['major', 'minor', 'revision', 'build']) version_re = re.compile(r"""^([1-9]\d*|0)(\.([1-9]\...
lgpl-2.1
cnewcome/sos
sos/archive.py
1
15414
# Copyright (C) 2012 Red Hat, Inc., # Jesse Jaggars <jjaggars@redhat.com> # Bryn M. Reeves <bmr@redhat.com> # # 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,...
gpl-2.0
Sylrob434/CouchPotatoServer
couchpotato/core/plugins/userscript/main.py
44
3074
import os from couchpotato import index from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.variable import isDict from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env f...
gpl-3.0
dyyi/moneybook
venv/Lib/site-packages/django/contrib/auth/base_user.py
41
4434
""" This module allows importing AbstractBaseUser even when django.contrib.auth is not in INSTALLED_APPS. """ from __future__ import unicode_literals from django.contrib.auth import password_validation from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password, ) from django.db imp...
apache-2.0
blairg23/Apocalypse-Defense
src/apocalypsedefense/workspace/ApocalypseDefenseJython/src/items.py
1
1677
''' Author: Blair Gemmer Purpose: Creates items in the game, specifically weapons ''' #from pylab import * #TODO: REMOVE ALL PRINT STATEMENTS FOR ANDROID IMPLEMENTATION #TODO: Remove useless comments. class Weapon(): def __init__(self, wType='Default Weapon Type', name='Default Weapon', damage=...
mit
locusf/linux
tools/perf/scripts/python/sctop.py
1996
2102
# 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
sandeepkoduri/GAE-html-to-pdf
libs/reportlab/graphics/widgets/eventcal.py
6
13234
#see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/eventcal.py # Event Calendar widget # author: Andy Robinson __version__='3.3.0' __doc__="""This file is a """ from reportlab.lib import colors from reportlab.lib.validators im...
mit
markslwong/tensorflow
tensorflow/contrib/imperative/examples/mnist.py
69
4576
# 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
tb0hdan/voiceplay
voiceplay/datasources/playlists/libraries/textfile.py
1
1180
#-*- coding: utf-8 -*- """ Plaintext playlist module """ class TextFileLibrary(object): """ (not) Very basic and silly TXT parser """ def __init__(self): self.checks = [lambda x: x.startswith('#'), lambda x: x.startswith('//'), lambda x: x.startswith('/*')] def line...
unlicense
antonioUnina/neutron
neutron/db/migration/alembic_migrations/versions/327ee5fde2c7_set_innodb_engine.py
15
1236
# Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
Kilmannan/HippieStation13
bot/C_maths.py
67
2451
### EXPERIMENTAL PROTOTYPE ### # e = 2.7182818284590452353602874713526624977572 # pi = math.pi from __future__ import division #PYTHON Y U NO TELL ME THIS BEFORE import math import random import re e = "2.7182818284590452353602874713526624977572" pi = str(math.pi) global pre pre = len("maths ") def maths(influx,prefix=...
agpl-3.0
moijes12/oh-mainline
vendor/packages/twisted/twisted/spread/jelly.py
18
36237
# -*- test-case-name: twisted.test.test_jelly -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ S-expression-based persistence of python objects. It does something very much like L{Pickle<pickle>}; however, pickle's main goal seems to be efficiency (both in space and time); jelly's main ...
agpl-3.0
maxamillion/anaconda
pyanaconda/ui/tui/spokes/software.py
3
9880
# Software selection text spoke # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distrib...
gpl-2.0
mjirayu/sit_academy
common/djangoapps/request_cache/middleware.py
98
1225
import threading class _RequestCache(threading.local): """ A thread-local for storing the per-request cache. """ def __init__(self): super(_RequestCache, self).__init__() self.data = {} self.request = None REQUEST_CACHE = _RequestCache() class RequestCache(object): @cla...
agpl-3.0
hendrix/hendrix
test/test_resources.py
2
2267
import unittest from twisted.web.resource import getChildForRequest, NoResource from twisted.web.test.requesthelper import DummyRequest try: from unittest import mock except ImportError: import mock from hendrix.facilities.resources import HendrixResource, NamedResource, WSGIResource class TestHendrixResou...
mit
martindemello/vroom
vroom/shell.py
3
10594
"""Vroom fake shell bridge.""" import json import os import os.path import pickle import pipes import re import tempfile import vroom import vroom.controls import vroom.test from vroom.result import Result # Pylint is not smart enough to notice that all the exceptions here inherit from # vroom.test.Failure, which is...
apache-2.0
chutsu/robotics
prototype/tests/vision/test_geometry.py
1
2838
import unittest import numpy as np import matplotlib.pylab as plt from mpl_toolkits.mplot3d import Axes3D # NOQA from prototype.utils.utils import roty from prototype.utils.utils import deg2rad from prototype.vision.common import focal_length from prototype.vision.common import camera_intrinsics from prototype.visio...
gpl-3.0
geodynamics/gale
config/scons/scons-local-1.2.0/SCons/Variables/__init__.py
12
10733
"""engine.SCons.Variables This file defines the Variables class that is used to add user-friendly customizable variables to an SCons build. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of th...
gpl-2.0
eladhoffer/convNet.pytorch
models/googlenet.py
1
4998
from collections import OrderedDict import torch import torch.nn as nn __all__ = ['googlenet'] class Inception_v1_GoogLeNet(nn.Module): input_side = 227 rescale = 255.0 rgb_mean = [122.7717, 115.9465, 102.9801] rgb_std = [1, 1, 1] def __init__(self, num_classes=1000): super(Inception_v1_G...
mit
bhdn/jurt
jurtlib/su.py
1
14276
# # Copyright (c) 2011 Bogdano Arendartchuk <bogdano@mandriva.com.br> # # Written by Bogdano Arendartchuk <bogdano@mandriva.com.br> # # This file is part of Jurt Build Bot. # # Jurt Build Bot is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by...
gpl-2.0
xxd3vin/spp-sdk
opt/Python27/Lib/encodings/zlib_codec.py
533
3015
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib modu...
mit
hakuya/higu
scripts/insertfile.py
1
3161
#!/usr/bin/python import sys import os import logging log = logging.getLogger( __name__ ) logging.basicConfig() import hdbfs import higu.config MAX_TEXT_LEN = 2**18 def create_album( name, text, tags ): album = h.create_album() if( name is not None ): album.add_name( name ) if( text is not N...
bsd-2-clause
Ayub-Khan/edx-platform
common/test/acceptance/tests/lms/test_lms_entrance_exams.py
55
4073
# -*- coding: utf-8 -*- """ Bok choy acceptance tests for Entrance exams in the LMS """ from textwrap import dedent from ..helpers import UniqueCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import CoursewarePage from ...pages.lms.problem import ProblemPage from ...fixtures....
agpl-3.0
bpagon13/vent
docs/source/conf.py
1
5203
# -*- coding: utf-8 -*- # # Vent documentation build configuration file, created by # sphinx-quickstart on Mon Jul 17 12:58:13 2017. # # 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 ...
apache-2.0
Evervolv/android_external_chromium
testing/gtest/test/gtest_xml_outfiles_test.py
718
5312
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
earnaway/db-tools
pgschemagraph.py
1
11306
import sys import psycopg2 from xml.sax.saxutils import escape from optparse import OptionParser def connect(**params): connstr = "dbname='%(dbname)s' user='%(user)s' host='%(host)s' password='%(password)s'" % params conn = psycopg2.connect(connstr) return conn class Table(object): def __init__(self, ...
gpl-2.0
Workday/OpenFrame
mandoline/tools/android/run_mandoline.py
15
3209
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import atexit import logging import os import shutil import sys import tempfile sys.path.append(os.path.join(os.path.d...
bsd-3-clause
dknez/libmesh
doc/statistics/libmesh_sflogos.py
7
6095
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # SF.net pages and SFLogo Impressions. # On the site, located under "Sourceforge Traffic". Number of logos # (last column) seems to be the...
lgpl-2.1
xxshutong/openerp-7.0
openerp/addons/l10n_be_coda/wizard/__init__.py
439
1098
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
credativUK/account-financial-tools
account_move_locking/account.py
27
2000
# -*- coding: utf-8 -*- ############################################################################## # # Author Vincent Renaville. # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # p...
agpl-3.0
bigdatauniversity/edx-platform
lms/djangoapps/course_blocks/transformers/tests/test_helpers.py
23
12832
""" Test helpers for testing course block transformers. """ from course_modes.models import CourseMode from student.tests.factories import CourseEnrollmentFactory, UserFactory from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modul...
agpl-3.0