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 |
|---|---|---|---|---|---|
kar1m/firefox-ios | scripts/clean-xliff.py | 41 | 2284 | #! /usr/bin/env python
#
# clean-xliff.py <l10n_folder>
#
# Remove targets from a locale, remove target-language attribute
#
from glob import glob
from lxml import etree
import argparse
import os
NS = {'x':'urn:oasis:names:tc:xliff:document:1.2'}
def indent(elem, level=0):
# Prettify XML output
# http://eff... | mpl-2.0 |
fossoult/odoo | addons/stock/tests/test_owner_available.py | 233 | 3002 | # Author: Leonardo Pistone
# 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
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | agpl-3.0 |
comandrei/django-haystack | haystack/signals.py | 27 | 3163 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.db import models
from haystack.exceptions import NotHandled
class BaseSignalProcessor(object):
"""
A convenient way to attach Haystack to Django's signals & cause things to
index.
By de... | bsd-3-clause |
florian-dacosta/OCB | addons/crm_partner_assign/report/crm_lead_report.py | 309 | 5104 | # -*- 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 |
ryansb/boto | boto/dynamodb2/layer1.py | 134 | 152740 | # Copyright (c) 2014 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 without restriction, including
# without limitation the rights ... | mit |
LarryHillyer/PoolHost | PoolHost/env/Lib/site-packages/django/core/serializers/pyyaml.py | 439 | 2843 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import collections
import decimal
import sys
from io import StringIO
import yaml
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDes... | gpl-3.0 |
israeleriston/scientific-week | backend/venv/lib/python3.5/site-packages/setuptools/namespaces.py | 196 | 3199 | import os
from distutils import log
import itertools
from setuptools.extern.six.moves import map
flatten = itertools.chain.from_iterable
class Installer:
nspkg_ext = '-nspkg.pth'
def install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filenam... | mit |
conan-io/conan | conans/client/graph/build_mode.py | 1 | 4085 | import fnmatch
from conans.errors import ConanException
class BuildMode(object):
""" build_mode => ["*"] if user wrote "--build"
=> ["hello*", "bye*"] if user wrote "--build hello --build bye"
=> ["hello/0.1@foo/bar"] if user wrote "--build hello/0.1@foo/bar"
... | mit |
qrkourier/ansible | lib/ansible/modules/cloud/amazon/elb_target_group_facts.py | 8 | 9841 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
HXLStandard/hxl-proxy | tests/test_dao.py | 1 | 3313 | """
Unit tests for hxl-proxy dao module
David Megginson
February 2016
License: Public Domain
"""
import unittest, os
from hxl_proxy import app, dao
from . import base
class AbstractDAOTest(base.AbstractDBTest):
"""Abstract base class for DAO tests."""
def setUp(self):
super().setUp()
def t... | unlicense |
grlee77/scipy | benchmarks/benchmarks/signal_filtering.py | 7 | 3025 | import numpy as np
import timeit
from concurrent.futures import ThreadPoolExecutor, wait
from .common import Benchmark, safe_import
with safe_import():
from scipy.signal import (lfilter, firwin, decimate, butter, sosfilt,
medfilt2d)
class Decimate(Benchmark):
param_names = ['q'... | bsd-3-clause |
jusdng/odoo | addons/account/wizard/account_invoice_state.py | 340 | 2875 | # -*- 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 |
angelapper/edx-platform | lms/djangoapps/student_account/test/test_views.py | 2 | 37721 | # -*- coding: utf-8 -*-
""" Tests for student account views. """
import logging
import re
from unittest import skipUnless
from urllib import urlencode
import ddt
import mock
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.messages... | agpl-3.0 |
Orav/kbengine | kbe/res/scripts/common/Lib/test/test_frame.py | 2 | 4693 | import gc
import sys
import types
import unittest
import weakref
from test import support
class ClearTest(unittest.TestCase):
"""
Tests for frame.clear().
"""
def inner(self, x=5, **kwargs):
1/0
def outer(self, **kwargs):
try:
self.inner(**kwargs)
... | lgpl-3.0 |
Ubuntu-Solutions-Engineering/glance-simplestreams-sync-charm | hooks/charmhelpers/contrib/storage/linux/loopback.py | 8 | 1698 |
import os
import re
from subprocess import (
check_call,
check_output,
)
##################################################
# loopback device helpers.
##################################################
def loopback_devices():
'''
Parse through 'losetup -a' output to determine currently mapped
lo... | agpl-3.0 |
indie1982/osmc-fixes | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0a2.py | 253 | 4503 | data = (
'kax', # 0x00
'ka', # 0x01
'kap', # 0x02
'kuox', # 0x03
'kuo', # 0x04
'kuop', # 0x05
'kot', # 0x06
'kox', # 0x07
'ko', # 0x08
'kop', # 0x09
'ket', # 0x0a
'kex', # 0x0b
'ke', # 0x0c
'kep', # 0x0d
'kut', # 0x0e
'kux', # 0x0f
'ku', # 0x10
'kup', # 0x11
'kurx',... | gpl-2.0 |
laszlocsomor/tensorflow | tensorflow/contrib/tpu/python/tpu/util.py | 48 | 1148 | # 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 |
kargakis/test-infra | gubernator/pb_glance.py | 22 | 2862 | #!/usr/bin/env python
# Copyright 2016 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 applic... | apache-2.0 |
Woile/commitizen | commitizen/commands/commit.py | 1 | 2734 | import contextlib
import os
import tempfile
import questionary
from commitizen import factory, git, out
from commitizen.config import BaseConfig
from commitizen.cz.exceptions import CzException
from commitizen.exceptions import (
CommitError,
CustomError,
DryRunExit,
NoAnswersError,
NoCommitBackup... | mit |
CUCWD/edx-platform | lms/djangoapps/verify_student/tests/test_ssencrypt.py | 19 | 4149 | """
Tests of the encryption and decryption utilities in the ssencrypt module.
"""
import base64
from lms.djangoapps.verify_student.ssencrypt import (
aes_decrypt,
aes_encrypt,
decode_and_decrypt,
encrypt_and_encode,
rsa_decrypt,
rsa_encrypt
)
AES_KEY_BYTES = b'32fe72aaf2abb44de9e161131b5435c8... | agpl-3.0 |
dongsenfo/pymatgen | pymatgen/core/ion.py | 2 | 6398 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Module containing class to create an ion
"""
__author__ = "Sai Jayaraman"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.0"
__maintainer__ = "Sai Jayaraman"
__email__ = "sjayaram... | mit |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/pandas/tests/series/test_indexing.py | 3 | 88164 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import pytest
from datetime import datetime, timedelta
from numpy import nan
import numpy as np
import pandas as pd
import pandas._libs.index as _index
from pandas.core.dtypes.common import is_integer, is_scalar
from pandas import (Index, Series, DataFrame, isnull,
... | mit |
yousafsyed/casperjs | bin/Lib/test/test_threading.py | 72 | 36686 | """
Tests for the threading module.
"""
import test.support
from test.support import verbose, strip_python_stderr, import_module, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
_thread = import_module('_thread')
threading = import_module('threading')
import time
import... | mit |
Bioinformatics-Support-Unit/python-scripts | zic1/zic1_correlation.py | 1 | 2362 | import sys
from scipy.stats.stats import pearsonr
import matplotlib
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.mlab as mlab
def main(f):
fh = open(f, 'r')
zic1_expression = []
other_expression = {}
for line in fh:... | mit |
Evervolv/android_external_chromium_org | ui/resources/PRESUBMIT.py | 121 | 1397 | # 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.
"""Presubmit script for Chromium UI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the pr... | bsd-3-clause |
proudlygeek/proudlygeek-blog | jinja2/testsuite/__init__.py | 114 | 2758 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite
~~~~~~~~~~~~~~~~
All the unittests of Jinja2. These tests can be executed by
either running run-tests.py using multiple Python versions at
the same time.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
i... | mit |
dgreisen/u2db | u1db/vectorclock.py | 2 | 3167 | # Copyright 2011 Canonical Ltd.
#
# This file is part of u1db.
#
# u1db is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# u1db is distributed in the hope that it will be useful,
# but WITHOU... | gpl-3.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_exitfunc.py | 140 | 2497 | """
Convert use of sys.exitfunc to use the atexit module.
"""
# Author: Benjamin Peterson
from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
class FixExitfunc(fixer_base.BaseFix):
keep_line_order = True
BM_compatible = True
PATTERN = """
... | apache-2.0 |
Azulinho/ansible | test/units/modules/network/netscaler/test_netscaler_gslb_service.py | 39 | 27775 |
# Copyright (c) 2017 Citrix Systems
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
heytcass/homeassistant-config | deps/fuzzywuzzy/process.py | 1 | 11161 | #!/usr/bin/env python
# encoding: utf-8
"""
process.py
Copyright (c) 2011 Adam Cohen
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 t... | mit |
ThornCreekChurch/e2mc | main.py | 1 | 5923 | ## Copyright (C) 2017 ThornCreek Church
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program... | gpl-3.0 |
GodBlessPP/w16b_test | static/Brython3.1.1-20150328-091302/Lib/binascii.py | 620 | 24585 | """A pure Python implementation of binascii.
Rather slow and buggy in corner cases.
PyPy provides an RPython version too.
"""
# borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py
class Error(Exception):
pass
class Done(Exception):
pass
class Incomplete(Exception):
pass
... | agpl-3.0 |
Greennut/ostproject | django/contrib/gis/maps/google/gmap.py | 90 | 8964 | from django.conf import settings
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
class GoogleMapException(Exception):
pass
# The default Google Maps URL (for the API javascript)
# T... | bsd-3-clause |
mdanielwork/intellij-community | python/helpers/pydev/third_party/wrapped_for_pydev/ctypes/__init__.py | 106 | 15821 | #@PydevCodeAnalysisIgnore
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
from itertools import chain as _chain
# special developer support to use ctypes from the CVS sandbox,
# without installing it
# XXX Remove this for the python core version
_magicfile = _os.path.join(_os.path.dir... | apache-2.0 |
hrhtspr/IkaLog | ikalog/utils/ikautils.py | 2 | 5158 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... | apache-2.0 |
gurneyalex/odoo | addons/stock_landed_costs/tests/test_stockvaluationlayer.py | 4 | 20303 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" Implementation of "INVENTORY VALUATION TESTS (With valuation layers)" spreadsheet. """
from odoo.tests import Form, tagged
from odoo.addons.stock_account.tests.test_stockvaluationlayer import TestStockValuationCommo... | agpl-3.0 |
wanderine/nipype | nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py | 2 | 2188 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.semtools.diffusion.diffusion import DWIConvert
def test_DWIConvert_inputs():
input_map = dict(args=dict(argstr='%s',
),
conversionMode=dict(argstr='--conversionMode %s',
),
environ=d... | bsd-3-clause |
crossbario/crossbar-examples | work/multisub.py | 3 | 3259 | from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.wamp.types import PublishOptions, SubscribeOptions
from autobahn.twisted.wamp import ApplicationSession
from autobahn.twisted.wamp import ApplicationRunner
from autobahn.twisted.util import sleep
class MyComponent(A... | apache-2.0 |
avatar29A/pyfuzzy | fuzzy/norm/HarmonicMean.py | 1 | 1128 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.... | mit |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_3/django/db/backends/oracle/introspection.py | 210 | 5106 | from django.db.backends import BaseDatabaseIntrospection
import cx_Oracle
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_types_re... | mit |
Midrya/chromium | third_party/boto/core/auth.py | 68 | 3150 | # 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 without... | bsd-3-clause |
applicationdevm/XlsxWriter | xlsxwriter/test/comparison/test_chart_data_labels03.py | 8 | 1743 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters.py | 1 | 3503 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
MatthewWilkes/django-oscar | src/oscar/apps/search/app.py | 33 | 1040 | from django.conf.urls import url
from haystack.views import search_view_factory
from oscar.core.application import Application
from oscar.core.loading import get_class
from oscar.apps.search import facets
class SearchApplication(Application):
name = 'search'
search_view = get_class('search.views', 'FacetedSe... | bsd-3-clause |
sarvex/tensorflow | tensorflow/lite/testing/op_tests/elu.py | 17 | 2060 | # Copyright 2019 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 |
GNOME/conduit | test/soup/env/__init__.py | 2 | 1235 |
import os, sys
from soup.utils.pluginloader import PluginLoader
class EnvironmentWrapper(object):
@classmethod
def enabled(cls, opts):
return True
def prepare_environment(self):
""" Modify the environment that the tests are running in """
pass
def decorate_test(self, test):... | gpl-2.0 |
jctanner/ansible | test/units/modules/test_pip.py | 35 | 1502 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible.modules import pip
pytestmark = pytest.mark.usefixtures('p... | gpl-3.0 |
tsgit/invenio | modules/bibcheck/lib/plugins/rename_subfield_filter.py | 2 | 2388 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2016 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 opt... | gpl-2.0 |
apache/stratos | components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/Thrift.py | 253 | 4543 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_languages_japanese.py | 1 | 1113 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@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 Softwar... | gpl-3.0 |
caraya/ebook-experiments | python-xml-gen/xml-gen.py | 2 | 2180 | #!/usr/bin/env python
import mimetypes
import glob
import os
import os.path
# Initialize the mimetypes database
mimetypes.init()
# Create the package.opf file
package = open('package.opf', 'w')
# The glob below should encompass everything under
# OEBPS. Right now I'm trying to remove empty directories
# and the pac... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/nbconvert/filters/latex.py | 10 | 1868 | """Latex filters.
Module of useful filters for processing Latex within Jinja latex templates.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in th... | gpl-3.0 |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v3.8/gnmt-tpuv3-8/code/gnmt/model/staging/models/rough/mask_rcnn/utils.py | 8 | 2663 | # Copyright 2018 Google. 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 agree... | apache-2.0 |
ak15199/rop | art/cascade.py | 1 | 1744 | from ._baseclass import ArtBaseClass
import numpy as np
from opc.colors import BLACK
from opc.hue import hsvToRgb
from math import fmod, sin, cos, sqrt
class ClearTrain(object):
def __init__(self, length):
self.length = length
self.points = [(0, 0) for i in range(length)]
self.head = 0
... | gpl-3.0 |
pedropenna/.emacs.d | elpa/floobits-20160804.1135/floo/common/api.py | 2 | 7200 | import sys
import base64
import json
import subprocess
import traceback
from functools import wraps
try:
import ssl
except ImportError:
ssl = False
PY2 = sys.version_info < (3, 0)
try:
import __builtin__
str_instances = (str, __builtin__.basestring)
except Exception:
str_instances = (str, )
try... | gpl-3.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/distutils/tests/test_build_clib.py | 95 | 4978 | """Tests for distutils.command.build_clib."""
import unittest
import os
import sys
from test.support import run_unittest
from distutils.command.build_clib import build_clib
from distutils.errors import DistutilsSetupError
from distutils.tests import support
from distutils.spawn import find_executable
class BuildCLib... | lgpl-3.0 |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/decomposition/tests/test_nmf.py | 33 | 6189 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | apache-2.0 |
evilhero/mylar | lib/comictaggerlib/pageloader.py | 1 | 2202 | """A PyQT4 class to load a page image from a ComicArchive in a background thread"""
# Copyright 2012-2014 Anthony Beville
# 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.apa... | gpl-3.0 |
leosartaj/autosign | tests/helper.py | 1 | 1238 | #!/usr/bin/env python2
##
# autosign
# https://github.com/leosartaj/autosign.git
#
# copyright (c) 2014 sartaj singh
# licensed under the mit license.
##
import shutil, os
from autosign import config
"""
Helper functions for performing tests
"""
def newFile(fName):
"""
Touch a new file
"""
with ope... | mit |
nicoboss/Floatmotion | OpenGL/GL/ARB/internalformat_query.py | 9 | 1526 | '''OpenGL extension ARB.internalformat_query
This module customises the behaviour of the
OpenGL.raw.GL.ARB.internalformat_query to provide a more
Python-friendly API
Overview (from the spec)
OpenGL 4.1 has a number of queries to indicate the maximum number of
samples available for different formats. These give ... | agpl-3.0 |
justmearc/zero-phone | app-list.py | 1 | 2441 | #List of all apps and menu to open them
#copyright (c) 2015 Tyler Spadgenske
#GPL License
###############################
#To be packaged with stock TYOS
###############################
import sys, time
import pygame
class Run():
def __init__(self, fona):
#Stuff to follow app protocol
self.exit = ... | mit |
sumedhasingla/VTK | ThirdParty/Twisted/twisted/internet/test/test_gtkreactor.py | 28 | 2861 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests to ensure all attributes of L{twisted.internet.gtkreactor} are
deprecated.
"""
import sys
from twisted.trial.unittest import TestCase
class GtkReactorDeprecation(TestCase):
"""
Tests to ensure all attributes of L{twisted.int... | bsd-3-clause |
mgit-at/ansible | lib/ansible/plugins/lookup/keyring.py | 59 | 1901 | # (c) 2016, Samuel Boucher <boucher.samuel.c@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: keyring
author:
... | gpl-3.0 |
mzdaniel/oh-mainline | vendor/packages/twisted/twisted/web/static.py | 20 | 35712 | # -*- test-case-name: twisted.web.test.test_static -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Static resources for L{twisted.web}.
"""
import os
import warnings
import urllib
import itertools
import cgi
import time
from zope.interface import implements
from twisted.web import se... | agpl-3.0 |
by46/tunicorn | tunicorn/packages/werkzeug/serving.py | 73 | 27736 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | mit |
majora2007/plexpy | lib/apscheduler/schedulers/tornado.py | 33 | 1792 | from __future__ import absolute_import
from datetime import timedelta
from functools import wraps
from apscheduler.schedulers.base import BaseScheduler
from apscheduler.util import maybe_ref
try:
from tornado.ioloop import IOLoop
except ImportError: # pragma: nocover
raise ImportError('TornadoScheduler requi... | gpl-3.0 |
MartialD/hyperspy | hyperspy/events.py | 5 | 18478 | import inspect
import collections
from contextlib import contextmanager
from functools import wraps # Used in exec statement
import re
class Events(object):
"""
Events container.
All available events are attributes of this class.
"""
def __init__(self):
self._events = {}
@contex... | gpl-3.0 |
JCROM-Android/jcrom_external_chromium_org | third_party/closure_linter/closure_linter/common/matcher.py | 284 | 2158 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | bsd-3-clause |
calfonso/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py | 18 | 3741 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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_version': '1.1... | gpl-3.0 |
dlazz/ansible | lib/ansible/module_utils/facts/other/facter.py | 232 | 2985 | # 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 in the hope that ... | gpl-3.0 |
tcpcloud/contrail-controller | src/discovery/tests/test_dsa.py | 2 | 20448 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import gevent
import uuid
import time
sys.path.append("../config/common/tests")
from testtools.matchers import Equals, Contains, Not
from test_utils import *
import test_common
import test_case
from vnc_api.vnc_api import *
from vnc_api.g... | apache-2.0 |
Acehaidrey/incubator-airflow | airflow/contrib/hooks/spark_submit_hook.py | 7 | 1178 | #
# 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 |
lepture/pythondotorg | jobs/forms.py | 8 | 3256 | from django import forms
from django.forms.widgets import CheckboxSelectMultiple
from django.utils.translation import ugettext_lazy as _
from django_comments_xtd.conf import settings as comments_settings
from django_comments_xtd.forms import CommentForm
from django_comments_xtd.models import TmpXtdComment
from .model... | apache-2.0 |
paweljasinski/ironpython3 | Src/StdLib/Lib/lib2to3/fixes/fix_raise.py | 203 | 2926 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:... | apache-2.0 |
freieslabor/laborbot-modules | modules/asl.py | 1 | 3040 | # coding=utf8
"""
asl.py - Willie Freies Labor Activity Streams Lite Module
Licensed under a Mozilla Public License 2.0.
"""
from willie.module import commands, interval
import urllib2, json, os, pickle
from datetime import datetime, timedelta
ASL_QUERY = '-wiki.*&-sensor.traffic-light&-sensor.mate-o-meter&-twitter.re... | mpl-2.0 |
torbjoernk/easybuild-easyblocks | easybuild/easyblocks/n/netcdf4_python.py | 14 | 2883 | ##
# Copyright 2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (http://w... | gpl-2.0 |
ucloud/uai-sdk | uaitrain/api/modify_train_job_memo.py | 1 | 2173 | # Copyright 2017 The UAI-SDK Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
JonathanStein/odoo | addons/portal_project_issue/tests/__init__.py | 260 | 1086 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
yongtang/tensorflow | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/hash_table_v1.py | 10 | 3322 | # Copyright 2019 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 |
arseneyr/essentia | test/src/unittest/highlevel/test_intensity.py | 1 | 2586 | #!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 ... | agpl-3.0 |
meghana1995/sympy | sympy/series/order.py | 4 | 15386 | from __future__ import print_function, division
from sympy.core import S, sympify, Expr, Rational, Symbol, Dummy
from sympy.core import Add, Mul, expand_power_base, expand_log
from sympy.core.cache import cacheit
from sympy.core.compatibility import default_sort_key, is_sequence
from sympy.core.containers import Tuple... | bsd-3-clause |
gurinderhans/pysnap | pysnap/__init__.py | 3 | 12642 | #!/usr/bin/env python
import json
import os.path
from time import time
from pysnap.utils import (encrypt, decrypt, decrypt_story,
make_media_id, request)
MEDIA_IMAGE = 0
MEDIA_VIDEO = 1
MEDIA_VIDEO_NOAUDIO = 2
FRIEND_CONFIRMED = 0
FRIEND_UNCONFIRMED = 1
FRIEND_BLOCKED = 2
PRIVACY_EVERYONE ... | mit |
grap/OCB | addons/account_budget/report/analytic_account_budget_report.py | 53 | 7537 | # -*- 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 |
KaranToor/MA450 | google-cloud-sdk/lib/surface/test/android/devices/__init__.py | 4 | 1372 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/cloud/amazon/ecs_service_facts.py | 50 | 9143 | #!/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 |
tealover/nova | nova/tests/unit/objects/test_agent.py | 53 | 3762 | # 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 a... | apache-2.0 |
googlefonts/TachyFont | run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/ttLib/tables/C_O_L_R_.py | 11 | 5313 | # Copyright 2013 Google, Inc. All Rights Reserved.
#
# Google Author(s): Behdad Esfahbod
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import operator
import struct
class table_C_O_L_R_(Defau... | apache-2.0 |
muchbeli/bitcoin-abe | Abe/upgrade.py | 20 | 43693 | #!/usr/bin/env python
# Copyright(C) 2011,2012,2013,2014 by Abe developers.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any lat... | agpl-3.0 |
tumbl3w33d/ansible | lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py | 13 | 17413 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
adrianholovaty/django | tests/regressiontests/queries/models.py | 4 | 9168 | """
Various complex queries that have been problematic in the past.
"""
import threading
from django.db import models
class DumbCategory(models.Model):
pass
class NamedCategory(DumbCategory):
name = models.CharField(max_length=10)
class Tag(models.Model):
name = models.CharField(max_length=10)
par... | bsd-3-clause |
savoirfairelinux/django | django/contrib/gis/measure.py | 81 | 11948 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... | bsd-3-clause |
VisionistInc/advent-of-code-2016 | joshgordon/01/parse_1.py | 1 | 2606 | from operator import add, sub
import sys
#image stuff
from PIL import Image, ImageDraw
#Read in the directions
with open(sys.argv[1]) as f:
directions = f.read()[:-1]
directions.strip()
directions = directions.split(', ')
compass = 0
# Compass directions:
# 0 : north
# 1 : east
# 2 : south
# 3 : west
# turning R... | mit |
shakamunyi/tensorflow | tensorflow/contrib/batching/__init__.py | 85 | 1029 | # 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 |
auerj/flask-oauthlib | flask_oauthlib/contrib/apps.py | 6 | 7551 | """
flask_oauthlib.contrib.apps
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The bundle of remote app factories for famous third platforms.
Usage::
from flask import Flask
from flask_oauthlib.client import OAuth
from flask_oauthlib.contrib.apps import github
app = Flask(__name__)
... | bsd-3-clause |
walke469/spartahack-17 | ballotbuilder/lib/python3.5/site-packages/requests/packages/urllib3/util/request.py | 780 | 2128 | from __future__ import absolute_import
from base64 import b64encode
from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
"""
Shortcuts for generatin... | bsd-2-clause |
15Dkatz/pants | tests/python/pants_test/backend/graph_info/tasks/test_cloc.py | 16 | 2934 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.g... | apache-2.0 |
clayz/crazy-quiz-web | lib/wtforms/fields/simple.py | 38 | 1834 | import warnings
from .. import widgets
from .core import StringField, BooleanField
__all__ = (
'BooleanField', 'TextAreaField', 'PasswordField', 'FileField',
'HiddenField', 'SubmitField', 'TextField'
)
class TextField(StringField):
"""
Legacy alias for StringField
.. deprecated:: 2.0
"""
... | apache-2.0 |
ajaali/django | tests/gis_tests/geoadmin/tests.py | 304 | 3157 | from __future__ import unicode_literals
from django.contrib.gis import admin
from django.contrib.gis.geos import Point
from django.test import TestCase, override_settings, skipUnlessDBFeature
from .admin import UnmodifiableAdmin
from .models import City, site
@skipUnlessDBFeature("gis_enabled")
@override_settings(R... | bsd-3-clause |
drglove/SickRage | SickBeard.py | 2 | 21428 | #!/usr/bin/env python2
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ve... | gpl-3.0 |
sixones/vitality | dbscripts/dump_attrs.py | 1 | 4004 | import MySQLdb
import dump_table
from optparse import OptionParser
import db_config
#calculate the ship attribute tables.
def dumpAttribute(conn,query,attrNum):
cursor = conn.cursor()
cursor.execute(query)
rowcount = int(cursor.rowcount)
conn.query("BEGIN;");
for i in range (0,rowcount):
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.