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 |
|---|---|---|---|---|---|
erdincay/youtube-dl | youtube_dl/extractor/tnaflix.py | 109 | 10280 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
fix_xml_ampersands,
float_or_none,
int_or_none,
parse_duration,
str_to_int,
xpath_text,
)
class TNAFlixNetworkBaseIE(InfoExtractor):
# May be overridd... | unlicense |
thomaskeck/root | tutorials/tmva/keras/MulticlassKeras.py | 5 | 2342 | #!/usr/bin/env python
from ROOT import TMVA, TFile, TTree, TCut, gROOT
from os.path import isfile
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.regularizers import l2
from keras import initializations
from keras.optimizers import SGD
# Setup TMVA
TMVA.Tools.Instance()... | lgpl-2.1 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/idlelib/undo.py | 7 | 11046 | import string
from idlelib.delegator import Delegator
# tkintter import not needed because module does not create widgets,
# although many methods operate on text widget arguments.
#$ event <<redo>>
#$ win <Control-y>
#$ unix <Alt-z>
#$ event <<undo>>
#$ win <Control-z>
#$ unix <Control-z>
#$ event <<dump-undo-sta... | gpl-3.0 |
calebmadrigal/algorithms-in-python | heap.py | 1 | 3668 | """heap.py - implementation of a heap priority queue. """
__author__ = "Caleb Madrigal"
__date__ = "2015-02-17"
import math
from enum import Enum
from autoresizelist import AutoResizeList
class HeapType(Enum):
maxheap = 1
minheap = 2
class Heap:
def __init__(self, initial_data=None, heap_type=HeapType... | mit |
RafaelOrtiz/EbookReader | samples/myRead/epubview/navmap.py | 2 | 3449 | from lxml import etree
import gtk
import logging
logging.basicConfig(level=logging.DEBUG)
_log = logging.getLogger('navmap')
class NavPoint(object):
def __init__(self, label, contentsrc, children=[]):
self._label = label
self._contentsrc = contentsrc
self._children = children
def get... | gpl-2.0 |
garbled1/ansible | lib/ansible/utils/module_docs_fragments/eos.py | 87 | 5493 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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) any late... | gpl-3.0 |
mrquim/mrquimrepo | repo/script.module.exodus/lib/resources/lib/indexers/movies.py | 5 | 48031 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
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 progra... | gpl-2.0 |
eugenesan/postman | postman/FlickrWorker.py | 1 | 2057 | from BaseWorker import *
class FlickrWorker(BaseWorker):
key = '391fb6763fe0b5011cf52638067e0fed'
secret = '369f46a112452186'
def __init__(self, parent = None):
super(FlickrWorker, self).__init__(parent)
def run(self):
self.progressSignal.emit(self.stampConfi... | gpl-3.0 |
4tikhonov/eurogis | maps/bin/get_regions.py | 4 | 1346 | #!/usr/bin/python
import urllib2
import simplejson
import json
import sys
from shapely.geometry import shape, Polygon, MultiPolygon
#from shapely.geometry.multipolygon import shape
# Example of polygon
co1 = {"type": "Polygon", "coordinates": [
[(-102.05, 41.0),
(-102.05, 37.0),
(-109.05, 37.0),
(-... | gpl-3.0 |
emmericp/dpdk | app/test/autotest_runner.py | 1 | 14419 | # SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
# The main logic behind running autotests in parallel
from __future__ import print_function
import StringIO
import csv
from multiprocessing import Pool, Queue
import pexpect
import re
import subprocess
import sys
import time
import glo... | gpl-2.0 |
kenju254/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_remove.py | 61 | 1128 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity
class RemoveParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}">
<remove>
<partici... | gpl-3.0 |
Hybrid-Rom/external_skia | tools/gen_bench_expectations_from_codereview.py | 67 | 5806 | #!/usr/bin/python
# Copyright (c) 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.
"""Generate new bench expectations from results of trybots on a code review."""
import collections
import compare_codereview
import... | bsd-3-clause |
akashsinghal/Speech-Memorization-App | speech/Swift/Speech-gRPC-Streaming/env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## 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... | apache-2.0 |
adblockplus/gyp | test/mac/gyptest-strip-default.py | 232 | 2448 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the default STRIP_STYLEs match between different generators.
"""
import TestGyp
import re
import subprocess
import sys
i... | bsd-3-clause |
corruptnova/namebench | nb_third_party/dns/rdtypes/IN/A.py | 248 | 2055 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
ioannistsanaktsidis/invenio | modules/websubmit/lib/functions/DEMOVID_Validation.py | 28 | 4492 | ## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Inv... | gpl-2.0 |
piensa/geonode | geonode/groups/translation.py | 18 | 1291 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
edxnercel/edx-platform | .pycharm_helpers/pydev/pydev_ipython/inputhook.py | 52 | 18411 | # coding: utf-8
"""
Inputhook management for GUI event loop integration.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribu... | agpl-3.0 |
hickford/youtube-dl | youtube_dl/__init__.py | 32 | 16801 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__license__ = 'Public Domain'
import codecs
import io
import os
import random
import sys
from .options import (
parseOpts,
)
from .compat import (
compat_expanduser,
compat_getpass,
compat_print,
compat_shlex_... | unlicense |
AlanZatarain/cortex-vfx | test/IECore/TypeIdTest.py | 12 | 2531 | ##########################################################################
#
# Copyright (c) 2008, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/python/saved_model/utils_test.py | 62 | 5133 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
geerlingguy/ansible-modules-extras | cloud/amazon/dynamodb_table.py | 35 | 8108 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
unkyulee/elastic-cms | src/web/modules/post/services/config.py | 1 | 2826 | import web.util.tools as tools
import os
from web import app
import lib.es as es
def get(p):
# get host and index from the global config
h = tools.get_conf(p['host'], p['navigation']['id'], 'host', 'http://localhost:9200')
n = tools.get_conf(p['host'], p['navigation']['id'], 'index', '')
return {
... | mit |
GutenkunstLab/SloppyCell | test/test_FixedPoints.py | 1 | 3610 | import unittest
import scipy
from SloppyCell.ReactionNetworks import *
lorenz = Network('lorenz')
lorenz.add_compartment('basic')
lorenz.add_species('x', 'basic', 0.5)
lorenz.add_species('y', 'basic', 0.5)
lorenz.add_species('z', 'basic', 0.5)
lorenz.add_parameter('sigma', 1.0)
lorenz.add_parameter('r', 2.0)
lorenz.... | bsd-3-clause |
bitemyapp/Suns | src/pika/exceptions.py | 6 | 4260 | """Pika specific exceptions"""
class AMQPError(Exception):
def __repr__(self):
return 'An unspecified AMQP error has occurred'
class AMQPConnectionError(AMQPError):
def __repr__(self):
if len(self.args) == 1:
if (self.args[0] == 1):
return ('No connection could be... | bsd-3-clause |
diagramsoftware/odoo | addons/sale/res_partner.py | 236 | 1722 | # -*- 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 |
sijis/err | tests/backend_tests/text_test.py | 3 | 1047 | import sys
from tempfile import mkdtemp
import pytest
import logging
import os
from errbot.backends.text import TextBackend
from errbot.bootstrap import bot_config_defaults
@pytest.fixture
def text_backend():
tempdir = mkdtemp()
# reset the config every time
sys.modules.pop('errbot.config-template', No... | gpl-3.0 |
lijoantony/django-oscar | src/oscar/apps/dashboard/catalogue/tables.py | 27 | 2631 | from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _, ungettext_lazy
from django_tables2 import Column, LinkColumn, TemplateColumn, A
from oscar.core.loading import get_class, get_model
DashboardTable = get_class('dashboard.tables', 'DashboardTable')
Product = get_mod... | bsd-3-clause |
Meriipu/quodlibet | tests/plugin/test_console.py | 4 | 1050 | # Copyright 2017 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from gi.repository import Gtk
from... | gpl-2.0 |
CloudBotIRC/CloudBotLegacy | plugins/brainfuck.py | 6 | 2477 | """brainfuck interpreter adapted from (public domain) code at
http://brainfuck.sourceforge.net/brain.py"""
import re
import random
from util import hook
BUFFER_SIZE = 5000
MAX_STEPS = 1000000
@hook.command('brainfuck')
@hook.command
def bf(inp):
"""bf <prog> -- Executes <prog> as Brainfuck code."""
progr... | gpl-3.0 |
tcarmelveilleux/IcarusAltimeter | Analysis/altitude_analysis.py | 1 | 1202 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 19:34:31 2015
@author: Tennessee
"""
import numpy as np
import matplotlib.pyplot as plt
def altitude(atm_hpa, sea_level_hpa):
return 44330 * (1.0 - np.power(atm_hpa / sea_level_hpa, 0.1903))
def plot_alt():
default_msl = 101300.0
pressure = np.l... | mit |
endlessm/chromium-browser | third_party/catapult/third_party/typ/typ/tests/stats_test.py | 84 | 2292 | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
clef/python-social-auth | social/tests/backends/test_azuread.py | 58 | 3180 | """
Copyright (c) 2015 Microsoft Open Technologies, Inc.
All rights reserved.
MIT License
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 ri... | bsd-3-clause |
SmartPeople/zulip | zerver/webhooks/zapier/view.py | 14 | 1068 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from typing import Any, Callable, Dict
from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, ... | apache-2.0 |
tokenly/counterparty-lib | counterpartylib/test/conftest.py | 2 | 5555 | #! /usr/bin/python3
"""
Test suite configuration
"""
import os
import sys
current_dir = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
base_dir = os.path.normpath(os.path.join(current_dir, '../../'))
sys.path.insert(0, base_dir)
import json, binascii, apsw
from datetime i... | mit |
aESeguridad/GERE | venv/lib/python2.7/site-packages/flask_weasyprint/__init__.py | 1 | 7726 | # coding: utf8
"""
flask_weasyprint
~~~~~~~~~~~~~~~~
Flask-WeasyPrint: Make PDF in your Flask app with WeasyPrint.
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
import weasyprint
from flask import request, current_app
from werkzeug.test import Client, Clie... | gpl-3.0 |
pombredanne/numba | numba/cuda/tests/cudapy/test_gufunc.py | 2 | 10779 | from __future__ import print_function, absolute_import
from numba import void, float32, float64
import numpy as np
import numpy.core.umath_tests as ut
from numba import guvectorize
from numba import cuda
from timeit import default_timer as time
from numba import unittest_support as unittest
from numba.cuda.testing impo... | bsd-2-clause |
Samuel789/MediPi | MedManagementWeb/env/lib/python3.5/site-packages/django/contrib/gis/gdal/datasource.py | 46 | 4682 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | apache-2.0 |
jannishuebl/electron | script/bump-version.py | 135 | 3506 | #!/usr/bin/env python
import os
import re
import sys
from lib.util import execute, get_atom_shell_version, parse_version, scoped_cwd
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
if len(sys.argv) != 2 or sys.argv[1] == '-h':
print 'Usage: bump-version.py [<version> | ... | mit |
olivierayache/xuggle-xuggler | captive/libx264/csrc/tools/digress/cli.py | 145 | 4413 | """
Digress's CLI interface.
"""
import inspect
import sys
from optparse import OptionParser
import textwrap
from types import MethodType
from digress import __version__ as version
def dispatchable(func):
"""
Mark a method as dispatchable.
"""
func.digress_dispatchable = True
return func
class... | lgpl-3.0 |
MiyamotoAkira/kivy | examples/canvas/repeat_texture.py | 40 | 1597 | '''
Repeat Texture on Resize
========================
This examples repeats the letter 'K' (mtexture1.png) 64 times in a window.
You should see 8 rows and 8 columns of white K letters, along a label
showing the current size. As you resize the window, it stays an 8x8.
This example includes a label with a colored backgr... | mit |
marty331/jakesclock | flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/pyodbc.py | 59 | 2665 | # mysql/pyodbc.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... | gpl-2.0 |
awifi-dev/android_kernel_lge_awifi | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
ThomasHabets/python-pyhsm | examples/yhsm-monitor-exit.py | 1 | 1480 | #!/usr/bin/env python
#
# Copyright (c) 2011, Yubico AB
# All rights reserved.
#
# Utility to send a MONITOR_EXIT command to a YubiHSM.
#
# MONITOR_EXIT only works if the YubiHSM is in debug mode. It would
# be a security problem to allow remote reconfiguration of a production
# YubiHSM.
#
# If your YubiHSM is not in d... | bsd-2-clause |
o3project/ryu-oe | ryu/controller/event.py | 43 | 1110 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... | apache-2.0 |
omor1/linux-430 | scripts/gdb/linux/modules.py | 774 | 2718 | #
# gdb helper commands and functions for Linux kernel debugging
#
# module tools
#
# Copyright (c) Siemens AG, 2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import cpus, utils
module_type = utils.CachedType("str... | gpl-2.0 |
darvin/qtdjango | src/qtdjango/settings.py | 1 | 5503 | # -*- coding: utf-8 -*-
from qtdjango.helpers import test_connection
__author__ = 'darvin'
from qtdjango.connection import *
__author__ = 'darvin'
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class BooleanEdit(QCheckBox):
def text(self):
return QVariant(self.checkState()).toString()
def ... | gpl-2.0 |
person142/scipy | scipy/interpolate/tests/test_gil.py | 9 | 1882 | import itertools
import threading
import time
import numpy as np
from numpy.testing import assert_equal
import pytest
import scipy.interpolate
class TestGIL(object):
"""Check if the GIL is properly released by scipy.interpolate functions."""
def setup_method(self):
self.messages = []
def log(se... | bsd-3-clause |
Awesomeomics/webserver | env/lib/python2.7/site-packages/jinja2/debug.py | 620 | 10980 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | mit |
kiyoto/statsmodels | statsmodels/api.py | 2 | 1484 | from . import iolib
from . import datasets
from . import tools
from .tools.tools import add_constant, categorical
from . import regression
from .regression.linear_model import OLS, GLS, WLS, GLSAR
from .regression.quantile_regression import QuantReg
from .regression.mixed_linear_model import MixedLM
from .genmod import... | bsd-3-clause |
rodriguezdevera/sakai | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/fckconnector.py | 131 | 2686 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | apache-2.0 |
bonitadecker77/python-for-android | python-modules/twisted/twisted/trial/test/test_output.py | 61 | 5167 | # Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the output generated by trial.
"""
import os, StringIO
from twisted.scripts import trial
from twisted.trial import runner
from twisted.trial.test import packages
def runTrial(*args):
from twisted.trial import reporter
... | apache-2.0 |
barbarahui/nuxeo-calisphere | s3stash/nxstash_mediajson.py | 1 | 4444 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import os
from s3stash.nxstashref import NuxeoStashRef
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
from deepharvest.mediajson import MediaJson
from dplaingestion.mappers.ucldc_nuxeo_mapper import UCLDCNuxeoM... | bsd-3-clause |
jhseu/tensorflow | tensorflow/python/keras/callbacks_v1.py | 9 | 19005 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
huonw/servo | tests/wpt/update/updatecommandline.py | 210 | 1736 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def create_parser():
from wptrunner import wptcommandline
parser = wptcommandline.create_parser_update()
pa... | mpl-2.0 |
40023256/2015cdag1man | static/Brython3.1.1-20150328-091302/Lib/genericpath.py | 727 | 3093 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... | gpl-3.0 |
vikitripathi/MB-MessApp-API | messApp/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 330 | 3364 | # 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."
... | apache-2.0 |
thierry1985/project-1022 | translate/pddl/pddl_types.py | 3 | 2620 | # Renamed from types.py to avoid clash with stdlib module.
# In the future, use explicitly relative imports or absolute
# imports as a better solution.
import conditions
import graph
import itertools
class Type(object):
def __init__(self, name, basetype_name=None):
self.name = name
self.basetype_name = ba... | mit |
rd37/horizon | openstack_dashboard/dashboards/project/instances/urls.py | 7 | 1957 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
isht3/zulip | zerver/views/user_settings.py | 7 | 12505 | from __future__ import absolute_import
from typing import Optional, Any
from typing import Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth import authenticate, update_session_auth_hash
from django.http import HttpRequest, HttpResponse
from zerver.decor... | apache-2.0 |
chrisglass/kubernetes | hack/lookup_pull.py | 194 | 1290 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 |
knehez/edx-platform | lms/djangoapps/teams/migrations/0001_initial.py | 84 | 7593 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseTeam'
db.create_table('teams_courseteam', (
... | agpl-3.0 |
pastephens/pysal | pysal/spreg/ols_regimes.py | 15 | 25402 | """
Ordinary Least Squares regression with regimes.
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, Pedro V. Amaral pedro.amaral@asu.edu, Daniel Arribas-Bel darribas@asu.edu"
import regimes as REGI
import user_output as USER
import multiprocessing as mp
from ols import BaseOLS
from utils import set_warn, spbroadca... | bsd-3-clause |
lalitkumarj/NEXT-psych | gui/base/app_manager/PoolBasedTripletMDS/PoolBasedTripletMDS.py | 1 | 9004 | import csv, json, os, requests, sys
from wtforms import Form, FieldList, FloatField, FormField, TextField, IntegerField, SelectField, validators, RadioField
from jinja2 import Environment, FileSystemLoader
import copy
from base.models import Experiment
from flask import render_template
from base.settings import Confi... | apache-2.0 |
bpramod/azure-linux-extensions | CustomScript/test/test_file_download.py | 8 | 1456 | #!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft 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
#
#... | apache-2.0 |
oberlin/django | django/conf/locale/ml/formats.py | 1007 | 1815 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... | bsd-3-clause |
anjel-ershova/python_training | fixture/fixture_group.py | 1 | 4896 | from model.model_group import Group
import random
class GroupHelper:
def __init__(self, app):
self.app = app
def select_group_by_index(self, index):
wd = self.app.wd
wd.find_elements_by_name("selected[]")[index].click()
def select_group_by_id(self, id):
wd = self.app.wd
... | apache-2.0 |
raphaelfruneaux/thumbor | thumbor/detectors/local_detector.py | 14 | 2401 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import join, dirname, abspath, isabs
try:
import c... | mit |
subdigital/nsdateformatter.com | node_modules/node-gyp/gyp/pylib/gyp/common.py | 64 | 20173 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
tongwang01/tensorflow | tensorflow/models/rnn/ptb/reader.py | 24 | 3992 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
40223112/w16test | static/Brython3.1.3-20150514-095342/Lib/os.py | 635 | 35582 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | agpl-3.0 |
aerickson/OctoPrint | src/octoprint/server/api/timelapse.py | 9 | 2551 | # coding=utf-8
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import os
from flask import request, jsonify, url_for
from werkzeug.utils import secure_filename
import octoprint.timelapse
import octoprint.util as util
from octoprint.s... | agpl-3.0 |
cyberark-bizdev/ansible | lib/ansible/modules/cloud/openstack/os_keystone_endpoint.py | 20 | 6464 | #!/usr/bin/python
# Copyright: (c) 2017, VEXXHOST, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pr... | gpl-3.0 |
stefanodoni/HTperf | main-live-ack.py | 2 | 3411 | #!/usr/bin/env python3
from argparse import ArgumentParser
from functools import partial
from asyncio import get_event_loop, Future, Queue
from toolrack.script import Script
from toolrack.async import ProcessParserProtocol
class CommandOutputParser:
'''Parse process output and push parsed samples to a queue.'''... | gpl-2.0 |
bb111189/Arky2 | boilerplate/external/pycountry/__init__.py | 1 | 3459 | # vim:fileencoding=utf-8
# Copyright (c) 2008-2011 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""pycountry"""
import os.path
import pycountry.db
LOCALES_DIR = os.path.join(os.path.dirname(__file__), 'locales')
DATABASE_DIR = os.path.join(os.path.dirname(__file__), 'databases')
class Countries(pycountry.db... | lgpl-3.0 |
malept/youtube-dl | youtube_dl/extractor/mangomolo.py | 43 | 1834 | # coding: utf-8
from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
int_or_none,
)
class MangomoloBaseIE(InfoExtractor):
def _get_real_id(self, page_id):
return page_id
def _real_extract(s... | unlicense |
abilian/abilian-core | src/abilian/core/models/tests/test_blob.py | 1 | 3462 | """"""
import uuid
from io import StringIO
from flask import Flask
from abilian.core.models.blob import Blob
from abilian.core.sqlalchemy import SQLAlchemy
from abilian.services import repository_service as repository
from abilian.services import session_repository_service as session_repository
#
# Unit tests
#
def... | lgpl-2.1 |
Phonemetra/TurboCoin | test/functional/rpc_getblockstats.py | 1 | 6826 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 TurboCoin
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.test_framework import TurbocoinTestFramework
from test_framework.util... | mit |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/GL/NV/shader_buffer_store.py | 2 | 1943 | '''OpenGL extension NV.shader_buffer_store
This module customises the behaviour of the
OpenGL.raw.GL.NV.shader_buffer_store to provide a more
Python-friendly API
Overview (from the spec)
This extension builds upon the mechanisms added by the
NV_shader_buffer_load extension to allow shaders to perform random-acc... | mit |
ddzialak/boto | tests/integration/s3/test_bucket.py | 88 | 12516 | # -*- coding: utf-8 -*-
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# witho... | mit |
savioabuga/django-geonames-field | docs/conf.py | 1 | 8231 | # -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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.
#
# ... | bsd-3-clause |
chachan/nodeshot | nodeshot/core/base/mixins.py | 5 | 1879 | """
reusable restframework mixins for API views
"""
import reversion
from rest_framework.response import Response
class ACLMixin(object):
""" implements ACL in views """
def get_queryset(self):
"""
Returns only objects which are accessible to the current user.
If user is not authenti... | gpl-3.0 |
sharifmamun/ansible | v1/ansible/runner/lookup_plugins/pipe.py | 162 | 1951 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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) any lat... | gpl-3.0 |
tuanavu/python-cookbook-3rd | src/6/reading_nested_and_variable_sized_binary_structures/example2.py | 5 | 1825 | # Example 2: Introduction of a metaclass
import struct
class StructField:
def __init__(self, format, offset):
self.format = format
self.offset = offset
def __get__(self, instance, cls):
if instance is None:
return self
else:
r = struct.unpack_from(self.... | mit |
stvstnfrd/edx-platform | openedx/core/lib/hash_utils.py | 9 | 1136 | """
Utilities related to hashing
This duplicates functionality in django-oauth-provider,
specifically long_token and short token functions which was used to create
random tokens
"""
import hashlib
from django.utils.encoding import force_bytes
from django.utils.crypto import get_random_string
from django.conf import se... | agpl-3.0 |
rzhxeo/youtube-dl | youtube_dl/extractor/motorsport.py | 129 | 1797 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
class MotorsportIE(InfoExtractor):
IE_DESC = 'motorsport.com'
_VALID_URL = r'http://www\.motorsport\.com/[^/?#]+/video/(?:[^/?#]+/)(?P<id>[^/]+)/?(?:$|[?#])'
_TEST = {
... | unlicense |
movermeyer/cabot | cabot/cabotapp/migrations/0015_auto__add_field_alertacknowledgement_cancelled_time__add_field_alertac.py | 5 | 16689 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AlertAcknowledgement.cancelled_time'
db.add_column(u'cabo... | mit |
jeremiahmarks/sl4a | python/src/Lib/bsddb/test/test_dbshelve.py | 33 | 11290 | """
TestCases for checking dbShelve objects.
"""
import os, string
import random
import unittest
from test_all import db, dbshelve, test_support, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
# We want the objects to be ... | apache-2.0 |
huxh10/iSDX | pctrl-sgdx/mds_lib.py | 4 | 3123 | def decompose_verbrokenheimerschnitzel(row_2_cols):
""" Input is a dictionary with matrix row IDs as keys and a list of each
row's contents (column indices of nonzero row entries) as a value.
BROKEN. DONUT USE.
"""
item_2_group = {}
item_buddies = {}
for group in row_2_cols.values():
for item in group:
# ... | apache-2.0 |
MiltosD/CEF-ELRC | lib/python2.7/site-packages/django/utils/crypto.py | 245 | 1443 | """
Django's standard crypto functions and utilities.
"""
import hmac
from django.conf import settings
from django.utils.hashcompat import sha_constructor, sha_hmac
def salted_hmac(key_salt, value, secret=None):
"""
Returns the HMAC-SHA1 of 'value', using a key generated from key_salt and a
secret (which... | bsd-3-clause |
guettli/django | tests/utils_tests/test_timezone.py | 13 | 8369 | import datetime
import pickle
import pytz
from django.test import SimpleTestCase, mock, override_settings
from django.utils import timezone
CET = pytz.timezone("Europe/Paris")
EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi
ICT = timezone.get_fixed_timezone(420) # Asia/Bangkok
class TimezoneTests... | bsd-3-clause |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_lbvserver_binding.py | 3 | 6480 | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
zploskey/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/extensions.py | 489 | 31780 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
Nick-OpusVL/odoo | addons/association/__openerp__.py | 260 | 1700 | # -*- 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 |
gangadhar-kadam/sapphire_app | hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py | 2 | 2974 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, cint
from webnotes import msgprint, _
def execute(filters=None):
if not filters: filters = {}
conditions, filter... | agpl-3.0 |
nattayamairittha/MeanStack | MyProject/node_modules/node-sass-middleware/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
starcraftman/pakit | pakit/main.py | 2 | 14538 | """
The main entry point for pakit.
Acts as an intermediary between program arguments and pakit Tasks.
"""
from __future__ import absolute_import, print_function
import argparse
from argparse import RawDescriptionHelpFormatter as RawDescriptionHelp
import logging
import logging.handlers
import os
import sys
import pa... | bsd-3-clause |
x111ong/odoo | addons/mail/mail_group.py | 247 | 12877 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
annarev/tensorflow | tensorflow/python/ops/parallel_for/array_test.py | 9 | 16317 | # Copyright 2018 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 |
vmindru/ansible | lib/ansible/modules/network/aci/mso_schema_template_anp_epg_subnet.py | 4 | 7529 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.