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 |
|---|---|---|---|---|---|
boundlessgeo/QGIS | python/plugins/processing/algs/grass7/ext/i_cca.py | 12 | 1776 | # -*- coding: utf-8 -*-
"""
***************************************************************************
i_cca.py
--------
Date : March 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*********************************************... | gpl-2.0 |
openstack/heat | heat/api/openstack/v1/build_info.py | 1 | 1730 | #
# 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
# ... | apache-2.0 |
zeha/pdns | regression-tests.recursor-dnssec/test_RecDnstap.py | 4 | 11041 | import os
import socket
import struct
import sys
import threading
import dns
import dnstap_pb2
from nose import SkipTest
from recursortests import RecursorTest
FSTRM_CONTROL_ACCEPT = 0x01
FSTRM_CONTROL_START = 0x02
FSTRM_CONTROL_STOP = 0x03
FSTRM_CONTROL_READY = 0x04
FSTRM_CONTROL_FINISH = 0x05
# Python2/3 compatibil... | gpl-2.0 |
gerryhd/diabot-assistant | lib/python2.7/site-packages/pip/commands/download.py | 340 | 7810 | from __future__ import absolute_import
import logging
import os
from pip.exceptions import CommandError
from pip.index import FormatControl
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip import cmdoptions
from pip.utils import ensure_dir, normalize_path
from pip.utils.build... | gpl-3.0 |
austinwagner/sublime-sourcepawn | watchdog/utils/decorators.py | 4 | 4060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Most of this code was obtained from the Python documentation online.
"""Decorator utility functions.
decorators:
- synchronized
- propertyx
- accepts
- returns
- singleton
- attrs
- deprecated
"""
import functools
import warnings
import threading
import sys
def synch... | mit |
brownsr/Cinnamon | files/usr/share/cinnamon/cinnamon-looking-glass/pageutils.py | 23 | 2997 | from gi.repository import Gio, Gtk, GObject, Gdk, Pango, GLib
class ResultTextDialog(Gtk.Dialog):
def __init__(self, title, text):
Gtk.Dialog.__init__(self, title, None, 0,
(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE))
self.set_default_size(350, 70)
label = Gtk.Label(text)
... | gpl-2.0 |
beezee/GAE-Django-base-app | django/contrib/messages/tests/cookie.py | 154 | 5768 | from django.contrib.messages import constants
from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.storage.cookie import CookieStorage, \
MessageEncoder, MessageDecoder
from django.contrib.messages.storage.base import Message
from django.utils ... | bsd-3-clause |
woshilapin/cjdns | node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-safeseh.py | 96 | 1684 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure safeseh setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp()... | gpl-3.0 |
chauhanhardik/populo | cms/djangoapps/contentstore/management/commands/export_convert_format.py | 29 | 2462 | """
Script for converting a tar.gz file representing an exported course
to the archive format used by a different version of export.
Sample invocation: ./manage.py export_convert_format mycourse.tar.gz ~/newformat/
"""
import os
from path import Path as path
from django.core.management.base import BaseCommand, Command... | agpl-3.0 |
endorphinl/horizon | openstack_dashboard/dashboards/admin/metadata_defs/constants.py | 54 | 1389 | # (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 |
skumar07/Air-Share-Real | boilerplate/external/wtforms/ext/csrf/form.py | 119 | 1788 | from __future__ import unicode_literals
from wtforms.form import Form
from wtforms.validators import ValidationError
from .fields import CSRFTokenField
class SecureForm(Form):
"""
Form that enables CSRF processing via subclassing hooks.
"""
csrf_token = CSRFTokenField()
def __init__(self, formd... | lgpl-3.0 |
rnavarro/vitess | py/vtdb/vtrouting.py | 12 | 9750 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
etzhou/edx-platform | lms/djangoapps/mobile_api/tests.py | 133 | 1958 | # -*- coding: utf-8 -*-
"""
Tests for mobile API utilities.
"""
import ddt
from django.test import TestCase
from mobile_api.models import MobileApiConfig
from .utils import mobile_course_access, mobile_view
@ddt.ddt
class TestMobileAPIDecorators(TestCase):
"""
Basic tests for mobile api decorators to ensure... | agpl-3.0 |
jsdosa/TizenRT | external/gmock/scripts/generator/cpp/gmock_class.py | 268 | 8241 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
runekaagaard/django-contrib-locking | tests/syndication_tests/urls.py | 42 | 1028 | from django.conf.urls import url
from . import feeds
urlpatterns = [
url(r'^syndication/rss2/$', feeds.TestRss2Feed()),
url(r'^syndication/rss2/guid_ispermalink_true/$',
feeds.TestRss2FeedWithGuidIsPermaLinkTrue()),
url(r'^syndication/rss2/guid_ispermalink_false/$',
feeds.TestRss2FeedWith... | bsd-3-clause |
PaulKennedyDIT/GamesEnginesAssignment1 | Dependancies/SDL_ttf/external/freetype-2.4.12/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | mit |
wxzuan/wxzuan | vendor/bower/bootstrap-datepicker/docs/conf.py | 276 | 8002 | # -*- coding: utf-8 -*-
#
# bootstrap-datepicker documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 2 14:45:57 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 ... | bsd-3-clause |
torhve/FrameworkBenchmarks | frameworks/PHP/php-micromvc/setup.py | 2 | 1749 | import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("php-micromvc/Config/Config.php", "localhost", ""+ args.database_host +"")
setup_util.replace_text("php-micromvc/deploy/nginx.conf", "root .*\/FrameworkBenchmarks/php-micromvc", "root " + args.troot)... | bsd-3-clause |
pkainz/pylearn2 | pylearn2/costs/dbm.py | 34 | 68703 | """
This module contains cost functions to use with deep Boltzmann machines
(pylearn2.models.dbm).
"""
__authors__ = ["Ian Goodfellow", "Vincent Dumoulin"]
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import collecti... | bsd-3-clause |
koparasy/faultinjection-gem5 | tests/quick/00.hello/test.py | 2 | 1701 | # Copyright (c) 2006 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 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/lib2to3/fixes/fix_renames.py | 203 | 2221 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | mit |
fluxw42/youtube-dl | youtube_dl/extractor/promptfile.py | 52 | 2425 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
urlencode_postdata,
)
class PromptFileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)'
_TEST = {
... | unlicense |
piffey/ansible | lib/ansible/plugins/lookup/shelvefile.py | 38 | 2833 | # (c) 2015, Alejandro Guirao <lekumberri@gmail.com>
# (c) 2012-17 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: shelvefile
author: A... | gpl-3.0 |
rohitwaghchaure/erpnext-receipher | erpnext/controllers/recurring_document.py | 25 | 6938 | from __future__ import unicode_literals
import frappe
import frappe.utils
import frappe.defaults
from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \
get_first_day, get_last_day, comma_and
from frappe.model.naming import make_autoname
from frappe import _, msgprint, throw
from erpnext.a... | agpl-3.0 |
automl/RoBO | robo/fmin/bayesian_optimization.py | 1 | 6056 | import logging
import george
import numpy as np
from pybnn.dngo import DNGO
from robo.priors.default_priors import DefaultPrior
from robo.models.wrapper_bohamiann import WrapperBohamiann
from robo.models.gaussian_process import GaussianProcess
from robo.models.gaussian_process_mcmc import GaussianProcessMCMC
from rob... | bsd-3-clause |
Awesomeomics/webserver | env/lib/python2.7/site-packages/pip/commands/__init__.py | 476 | 2236 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... | mit |
apurvbhartia/gnuradio-routing | gr-audio/examples/python/dial_tone.py | 17 | 2006 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at you... | gpl-3.0 |
VagrantApe/flaskMicroblog | venv/lib/python2.7/site-packages/whoosh/lang/snowball/dutch.py | 96 | 6194 | from .bases import _StandardStemmer
from whoosh.compat import u
class DutchStemmer(_StandardStemmer):
"""
The Dutch Snowball stemmer.
:cvar __vowels: The Dutch vowels.
:type __vowels: unicode
:cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
:type __step1_suffixes: t... | bsd-3-clause |
nicopresto/webSkapes | modules/savage/graph/canvas.py | 2 | 19448 | from base import BaseGraph
from reg import RegressionLine
from ..graphics import Canvas
from ..graphics.shapes import Circle, Line, Rectangle, Sector, Path, Square
from ..graphics.group import Group, Grouping
from ..graphics.utils import ViewBox
from ..graphics.color import white
from ..utils.struct import Vector as ... | mit |
destijl/grr | grr/checks/unix_login_test.py | 2 | 4546 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for service state checks."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import checks_test_lib
from grr.parsers import linux_file_parser
class LoginPolicyConfigurationTests(checks_test_lib.HostCheckTest):
results = None
@cla... | apache-2.0 |
hosseinmh/Django_learning | djmod/.venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## 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 |
hehongliang/tensorflow | tensorflow/contrib/saved_model/__init__.py | 24 | 1431 | # 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 |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/django/utils/functional.py | 31 | 13713 | import copy
import operator
from functools import total_ordering, wraps
from django.utils import six
# You can't trivially replace this with `functools.partial` because this binds
# to classes and returns bound instances, whereas functools.partial (on
# CPython) is a type and its instances don't bind.
def curry(_cur... | apache-2.0 |
fhe-odoo/odoo | openerp/addons/base/tests/test_ir_filters.py | 285 | 11000 | # -*- coding: utf-8 -*-
import functools
from openerp import exceptions
from openerp.tests import common
def noid(d):
""" Removes values that are not relevant for the test comparisons """
d.pop('id', None)
d.pop('action_id', None)
return d
class FiltersCase(common.TransactionCase):
def build(self... | agpl-3.0 |
ibelem/crosswalk-test-suite | apptools/apptools-ios-tests/apptools/comm.py | 15 | 3052 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
Zord13appdesa/python-for-android | python-modules/twisted/twisted/python/reflect.py | 59 | 26091 | # -*- test-case-name: twisted.test.test_reflect -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Standardized versions of various cool and/or strange things that you can do
with Python's reflection capabilities.
"""
import sys
import os
import types
import pickle
import traceb... | apache-2.0 |
archf/ansible | lib/ansible/modules/network/aci/aci_aep.py | 22 | 3532 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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': ['preview'],
... | gpl-3.0 |
florentchandelier/gensim | gensim/models/lda_worker.py | 53 | 4079 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s
Worker ("slave") process used in computing distributed LDA. Run this script \
on every node in your cluster.... | gpl-3.0 |
szns99/samsung_android_kernel_3.0 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
farmer-martin/ardupilot | Tools/autotest/param_metadata/xmlemit.py | 28 | 2600 | #!/usr/bin/env python
from xml.sax.saxutils import escape, quoteattr
from emit import Emit
from param import known_param_fields
# Emit APM documentation in an machine readable XML format
class XmlEmit(Emit):
def __init__(self):
Emit.__init__(self)
wiki_fname = 'apm.pdef.xml'
self.f = ope... | gpl-3.0 |
sontek/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/generator/gypd.py | 912 | 3325 | # Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | agpl-3.0 |
bmbouter/python-bugzilla | bugzilla/__init__.py | 1 | 4164 | # python-bugzilla - a Python interface to bugzilla using xmlrpclib.
#
# Copyright (C) 2007, 2008 Red Hat Inc.
# Author: Will Woods <wwoods@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 Found... | gpl-2.0 |
jdavidrcamacho/Tests_GP | 06 - Results/untitled1.py | 1 | 4417 | # -*- coding: utf-8 -*-
import emcee
import corner
import numpy as np
import scipy.optimize as op
import matplotlib.pyplot as pl
from matplotlib.ticker import MaxNLocator
# Reproducible results!
np.random.seed(123)
# Choose the "true" parameters.
m_true = -0.9594
b_true = 4.294
f_true = 0.534
# Generate some synthet... | mit |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Lib/test/test_property.py | 51 | 6923 | # Test case for property
# more tests are in test_descr
import sys
import unittest
from test.support import run_unittest
class PropertyBase(Exception):
pass
class PropertyGet(PropertyBase):
pass
class PropertySet(PropertyBase):
pass
class PropertyDel(PropertyBase):
pass
class BaseClass(object):
... | apache-2.0 |
facetothefate/contrail-controller | src/config/api-server/tests/fake_api_server.py | 18 | 2866 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import gevent
import socket
import logging
import argparse
#import cgitb
#cgitb.enable(format='text')
from flexmock import flexmock, Mock
import sys
sys.path.append("../common/tests")
from test_utils import *
import test_common
logger = logging.get... | apache-2.0 |
xiaolonginfo/decode-Django | Django-1.5.1/tests/regressiontests/i18n/tests.py | 41 | 59714 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import os
import pickle
from threading import local
from django.conf import settings
from django.template import Template, Context
from django.template.base import TemplateSyntaxError
from django.test imp... | gpl-2.0 |
sveetch/boussole | tests/001_parser/002_comments.py | 1 | 3708 | # -*- coding: utf-8 -*-
import pytest
@pytest.mark.parametrize('parser_name,source,expected', [
# removing singleline comment case 1
(
"scss",
"""// foo""",
"",
),
(
"sass",
"""// foo""",
"",
),
# removing singleline comment case 2
(
... | mit |
mborgbrant/hallifornia-font | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 1446 | 65937 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | mit |
scotwk/cloud-custodian | tools/c7n_index/c7n_index/metrics.py | 6 | 19730 | # Copyright 2017 Capital One Services, LLC
#
# 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... | apache-2.0 |
GiulioRossetti/ndlib | ndlib/models/epidemics/ICPModel.py | 1 | 4663 | from ndlib.models.DiffusionModel import DiffusionModel
import numpy as np
import future.utils
__author__ = 'Giulio Rossetti'
__license__ = "BSD-2-Clause"
__email__ = "giulio.rossetti@gmail.com"
class ICPModel(DiffusionModel):
"""
Edge Parameters to be specified via ModelConfig
:param threshold: ... | bsd-2-clause |
asm-products/movie-database-service | ani/lib/python2.7/site-packages/pip/baseparser.py | 329 | 8162 | """Base option parser setup"""
import sys
import optparse
import os
import textwrap
from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types
from pip.locations import default_config_file
from pip.util import get_terminal_size, get_prog
from pip._vendor import pkg_resources
clas... | agpl-3.0 |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/debugger/debugger.py | 17 | 29684 | # debugger.py
# A debugger for Pythonwin. Built from pdb.
# Mark Hammond (MHammond@skippinet.com.au) - Dec 94.
# usage:
# >>> import pywin.debugger
# >>> pywin.debugger.GetDebugger().run("command")
import pdb
import bdb
import sys
import string
import os
import types
import win32ui
import win32api
import win32con... | apache-2.0 |
adeepkit01/networks | src/propagation/bindings/modulegen__gcc_ILP32.py | 68 | 191885 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
softak/webfaction_demo | vendor-local/lib/python/amqplib/client_0_8/basic_message.py | 22 | 3876 | """
Messages for AMQP
"""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your opti... | bsd-3-clause |
cuongnv23/ansible | lib/ansible/modules/cloud/ovirt/ovirt_vms.py | 6 | 59107 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
gwAdvNet2015/adv-net-samples | sdn/pox/pox/lib/recoco/events.py | 42 | 2077 | # Copyright 2011 James McCauley
#
# 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 writi... | mit |
Boussadia/weboob | modules/lcl/backend.py | 2 | 3300 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon, Pierre Mazière
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 |
draugiskisprendimai/odoo | addons/point_of_sale/controllers/main.py | 243 | 1576 | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
import time
import random
import werkzeug.utils
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import module_boot, login_redirect
_logger = logging.getLogger(__name__)
class PosContr... | agpl-3.0 |
BrandonY/python-docs-samples | compute/metadata/main_test.py | 9 | 1692 | # Copyright 2016, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
sjfloat/youtube-dl | youtube_dl/extractor/bloomberg.py | 99 | 1566 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BloombergIE(InfoExtractor):
_VALID_URL = r'https?://www\.bloomberg\.com/news/videos/[^/]+/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.bloomberg.com/news/videos/b/aaeae121-5949-481e-a1ce-4562db6f5df2',
... | unlicense |
OpenUpgrade-dev/OpenUpgrade | openerp/tools/sql.py | 455 | 1173 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
robacklin/sigrok | decoders/usb_signalling/__init__.py | 1 | 2016 | ##
## This file is part of the sigrok project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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-3.0 |
xuxiao19910803/edx | common/djangoapps/util/tests/test_request.py | 113 | 2390 | """Tests for util.request module."""
import unittest
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.test.client import RequestFactory
from util.request import course_id_from_url, safe_get_host
class ResponseTestCase(unittest.TestCase):
""" Tests for response... | agpl-3.0 |
ojengwa/oh-mainline | vendor/packages/Django/tests/modeltests/fixtures/models.py | 51 | 3314 | """
37. Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
`... | agpl-3.0 |
Achint08/open-event-orga-server | app/views/sitemap.py | 8 | 2663 | from math import ceil
from flask import url_for, render_template, make_response, request, \
Blueprint, abort
from app.settings import get_settings
from app.helpers.data_getter import DataGetter
from app.models.event import Event
from app.models.setting import Environment
sitemaps = Blueprint('sitemaps', __name__... | gpl-3.0 |
apache/incubator-airflow | airflow/sensors/time_delta.py | 5 | 1791 | #
# 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... | apache-2.0 |
JioCloud/neutron | neutron/tests/api/test_metering_extensions.py | 47 | 6880 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/selenium/webdriver/remote/command.py | 38 | 5179 | # Copyright 2010 WebDriver committers
# Copyright 2010 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 ap... | mit |
matrixise/odoo | addons/crm/__openerp__.py | 41 | 4555 | # -*- 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 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/v8/tools/ignition/linux_perf_report_test.py | 25 | 5371 | # Copyright 2016 the V8 project 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 linux_perf_report as ipr
import StringIO
import unittest
PERF_SCRIPT_OUTPUT = """
# This line is a comment
# This should be ignored too
#
# cde... | gpl-3.0 |
unixjazz/drupal-pece | src/docs/source/conf.py | 1 | 11009 | # -*- coding: utf-8 -*-
#
# PECE documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 26 15:51:14 2016.
#
# 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 ... | gpl-3.0 |
jkshaver/virtualenv-1.8.2 | env/lib/python2.7/site-packages/django/contrib/localflavor/py/py_department.py | 90 | 1129 | # -*- coding: utf-8 -*-
# http://www.statoids.com/upy.html
DEPARTMENT_CHOICES = (
('AG', u'Alto Paraguay'),
('AA', u'Alto Paraná'),
('AM', u'Amambay'),
('AS', u'Asunción'),
('BQ', u'Boquerón'),
('CG', u'Caaguazú'),
('CZ', u'Caazapá'),
('CY', u'Canindeyú'),
('CE', u'Central'),
(... | mit |
OCA/stock-logistics-workflow | product_cost_price_avco_sync/tests/test_product_cost_price_avco_sync.py | 1 | 8187 | # Copyright 2019 Tecnativa - Carlos Dauden
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from time import sleep
from odoo.tests.common import SavepointCase
class TestProductCostPriceAvcoSync(SavepointCase):
@classmethod
def setUpClass(cls):
... | agpl-3.0 |
laurimyllari/xbmc | lib/gtest/test/gtest_test_utils.py | 1100 | 10812 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-2.0 |
strk/mapnik | utils/upgrade_map_xml/upgrade_map_xml.py | 8 | 9687 | #!/usr/bin/env python
import os
import re
import sys
import optparse
import tempfile
__version__ = '0.1.0'
HAS_LXML = False
try:
import lxml.etree as etree
HAS_LXML = True
except ImportError:
try:
import elementtree.ElementTree as etree
except ImportError:
import xml.etree.ElementTre... | lgpl-2.1 |
michael-donat/ansible | lib/ansible/plugins/callback/osx_say.py | 144 | 2882 |
# (C) 2012, 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) any la... | gpl-3.0 |
heromod/migrid | mig/shared/functionality/liveio.py | 1 | 17096 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# liveio - communication with running jobs
# Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | gpl-2.0 |
bytekve/libforensics | unittests/tests/utils/time.py | 13 | 2368 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 ver... | gpl-3.0 |
ncdesouza/bookworm | env/lib/python2.7/site-packages/whoosh/__init__.py | 35 | 2059 | # Copyright 2008 Matt Chaput. 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 notice,
# this list of conditions and the... | gpl-3.0 |
mcanes/OctoPrint | src/octoprint/server/views.py | 7 | 19260 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import os
from collections ... | agpl-3.0 |
krinart/django-rest-framework | tests/test_permissions.py | 68 | 18850 | from __future__ import unicode_literals
import base64
from django.contrib.auth.models import Group, Permission, User
from django.core.urlresolvers import ResolverMatch
from django.db import models
from django.test import TestCase
from django.utils import unittest
from rest_framework import (
HTTP_HEADER_ENCODING... | bsd-2-clause |
atmark-techno/atmark-dist | user/python/Lib/test/test_b2.py | 6 | 10123 | # Python test set -- part 4b, built-in functions n-z
from test_support import *
print 'oct'
if oct(100) != '0144': raise TestFailed, 'oct(100)'
if oct(100L) != '0144L': raise TestFailed, 'oct(100L)'
if oct(-100) not in ('037777777634', '01777777777777777777634'):
raise TestFailed, 'oct(-100)'
if oct(-100L) != '-0144... | gpl-2.0 |
adamkh/micropython | tests/basics/op_error.py | 65 | 1183 | # test errors from bad operations (unary, binary, etc)
def test_exc(code, exc):
try:
exec(code)
print("no exception")
except exc:
print("right exception")
except:
print("wrong exception")
# unsupported unary operators
test_exc("~None", TypeError)
test_exc("~''", TypeError)
... | mit |
b0ri5/fssw-googlecode | scons/scons-local-2.0.1/SCons/Tool/bcc32.py | 61 | 2988 | """SCons.Tool.bcc32
XXX
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 rest... | lgpl-3.0 |
defance/edx-platform | lms/djangoapps/courseware/model_data.py | 29 | 35833 | """
Classes to provide the LMS runtime data storage to XBlocks.
:class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which
stores a subset of xblocks scopes as Django ORM objects. It wraps
:class:`~FieldDataCache` to provide an XBlock-friendly interface.
:class:`FieldDataCache`: A object which pro... | agpl-3.0 |
jolevq/odoopub | addons/website_forum/__openerp__.py | 62 | 1843 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/pycparser/c_generator.py | 20 | 13951 | #------------------------------------------------------------------------------
# pycparser: c_generator.py
#
# C code generator from pycparser AST nodes.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# License: BSD
#------------------------------------------------------------------------------
from . import c_ast
... | gpl-3.0 |
djkonro/client-python | kubernetes/client/apis/autoscaling_v1_api.py | 2 | 79148 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
im... | apache-2.0 |
FairCoinTeam/electrum-fair | lib/paymentrequest_pb2.py | 55 | 12540 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='paymentrequest.p... | mit |
wangjun/odoo | addons/account/installer.py | 381 | 8404 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
janocat/odoo | addons/hr_evaluation/__openerp__.py | 267 | 3155 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
jlegendary/nupic | examples/opf/experiments/anomaly/spatial/10field_many_skewed/description.py | 16 | 15747 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
Neil741/ryu-master | ryu/app/rest_quantum.py | 22 | 4625 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne 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
#
# h... | apache-2.0 |
hrabcak/jsbsim | tests/TestSuspend.py | 1 | 3001 | # TestSuspend.py
#
# A regression test that checks that suspending JSBSim is not modifying the
# results compared to the same script that was run without being suspended.
#
# Copyright (c) 2016 Bertrand Coconnier
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of th... | lgpl-2.1 |
the-sashko/peow-cms | app/media/__init__.py | 1 | 1544 | import os,shutil,json
from PIL import Image
def generateMedia(pathFrom,pathTo):
params=json.loads(open('config/media.json', 'r').read())
os.makedirs('tmp/build/media/'+pathTo,0o777,1)
for item in os.listdir('content/articles/'+pathFrom+'/media'):
try:
im = Image.open('content/articles/'+pathFrom+'/media/'+item... | mit |
filipenf/ansible | lib/ansible/module_utils/asa.py | 10 | 6402 | #
# (c) 2016 Peter Sprygada, <psprygada@ansible.com>
# (c) 2016 Patrick Ogenstad, <@ogenstad>
#
# 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 |
nightjean/Deep-Learning | tensorflow/contrib/batching/python/ops/batch_ops.py | 38 | 5427 | # 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 |
gauravbose/digital-menu | digimenu2/build/lib.linux-x86_64-2.7/django/contrib/gis/gdal/driver.py | 526 | 3260 | from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
from django.utils import six
from django.utils.encoding import force_bytes, force_text
class Driver(GDALBas... | bsd-3-clause |
algerbrex/Schemey | src/_builtins.py | 1 | 5651 | """
builtins.py
----------------------------------------
An implementation of builtin procedures
and variables in Scheme.
"""
import operator as op
from functools import reduce
from .expressions import *
from .utils import get_number_of_params
class ProcedureError(Exception):
pass
class Procedure:
"""
... | unlicense |
habanero-rice/hclib | test/performance-regression/full-apps/qmcpack/nexus/library/qaobject.py | 2 | 3373 |
from generic import obj
from developer import DevBase
from project_base import Pobj
from plotter import Plotter
class QAobj_base(Pobj):
None
#end class QAobj_base
class QAobject(QAobj_base):
_global = obj()
_global.dynamic_methods_objects=[]
plotter = Plotter()
opt_methods = set(['opt','line... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.