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 |
|---|---|---|---|---|---|
dhruvagarwal/django | tests/template_tests/filter_tests/test_pluralize.py | 430 | 1200 | from decimal import Decimal
from django.template.defaultfilters import pluralize
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_integers(self):
self.assertEqual(pluralize(1), '')
self.assertEqual(pluralize(0), 's')
self.assertEqual(pluralize(2), 's')... | bsd-3-clause |
mapseed/api | src/sa_api_v2/management/commands/updateDatasetDevCreds.py | 3 | 3486 | from __future__ import print_function
from django.core.management.base import BaseCommand
import os
import re
# for manually testing with `./manage.py shell` commandline:
# from ... import models as sa_models
# from ... import forms
from sa_api_v2 import models as sa_models
import logging
# display our logs to conso... | gpl-3.0 |
hargup/sympy | sympy/polys/domains/tests/test_polynomialring.py | 99 | 3314 | """Tests for the PolynomialRing classes. """
from sympy.polys.domains import QQ, ZZ
from sympy.polys.polyerrors import ExactQuotientFailed, CoercionFailed, NotReversible
from sympy.abc import x, y
from sympy.utilities.pytest import raises
def test_build_order():
R = QQ.old_poly_ring(x, y, order=(("lex", x), ("... | bsd-3-clause |
britcey/ansible | test/runner/lib/target.py | 28 | 16080 | """Test target identification, iteration and inclusion/exclusion."""
from __future__ import absolute_import, print_function
import os
import re
import errno
import itertools
import abc
from lib.util import ApplicationError
MODULE_EXTENSIONS = '.py', '.ps1'
def find_target_completion(target_func, prefix):
"""
... | gpl-3.0 |
frost-nzcr4/djangocms-installer | docs/conf.py | 3 | 8439 | #!/usr/bin/env python
# -*- 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
# au... | bsd-3-clause |
amerlyq/airy | vim/res/ycm_extra_conf.py | 1 | 5213 | # SEE: CACHE/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall', '-Wex... | mit |
rdo-management/ironic | ironic/tests/drivers/test_virtualbox.py | 4 | 18456 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
mjirayu/sit_academy | common/test/acceptance/tests/studio/test_studio_rerun.py | 122 | 4166 | """
Acceptance tests for Studio related to course reruns.
"""
import random
from bok_choy.promise import EmptyPromise
from nose.tools import assert_in
from ...pages.studio.index import DashboardPage
from ...pages.studio.course_rerun import CourseRerunPage
from ...pages.studio.overview import CourseOutlinePage
from ..... | agpl-3.0 |
vnsofthe/odoo-dev | openerp/addons/base/tests/test_res_lang.py | 384 | 2104 | import unittest2
import openerp.tests.common as common
class test_res_lang(common.TransactionCase):
def test_00_intersperse(self):
from openerp.addons.base.res.res_lang import intersperse
assert intersperse("", []) == ("", 0)
assert intersperse("0", []) == ("0", 0)
assert intersp... | agpl-3.0 |
Russell-IO/ansible | lib/ansible/modules/network/slxos/slxos_command.py | 25 | 7951 | #!/usr/bin/python
#
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
niteshch207/universe | scripts/generate-config-reference.py | 3 | 3017 | #!/usr/bin/env python3
"""This script builds a Markdown file containing configuration references for
all packages (and all package versions) contained in the Mesosphere DC/OS
Universe repository. It outputs a single file, 'config-reference.md' in the
current working directory.
Usage: ./generate-config-reference.py ... | apache-2.0 |
kamcpp/tensorflow | tensorflow/contrib/opt/__init__.py | 11 | 1119 | # 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 |
LarsFronius/ansible | lib/ansible/modules/cloud/ovirt/ovirt_external_providers_facts.py | 7 | 5916 | #!/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 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/scipy/optimize/nnls.py | 116 | 1423 | from __future__ import division, print_function, absolute_import
from . import _nnls
from numpy import asarray_chkfinite, zeros, double
__all__ = ['nnls']
def nnls(A, b):
"""
Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper
for a FORTAN non-negative least squares solver.
Parameters... | mit |
nugget/home-assistant | tests/components/frontend/test_storage.py | 10 | 4742 | """The tests for frontend storage."""
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components.frontend import storage
@pytest.fixture(autouse=True)
def setup_frontend(hass):
"""Fixture to setup the frontend."""
hass.loop.run_until_complete(async_setup_component(hass,... | apache-2.0 |
mdanielwork/intellij-community | python/testData/MockSdk2.7/python_stubs/__builtin__.py | 19 | 174731 | # encoding: utf-8
# module __builtin__
# from (built-in)
# by generator 1.145
from __future__ import print_function
"""
Built-in functions, exceptions, and other objects.
Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.
"""
# imports
from exceptions import (ArithmeticError, AssertionError, A... | apache-2.0 |
allenlavoie/tensorflow | tensorflow/contrib/autograph/converters/logical_expressions.py | 5 | 4878 | # 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 |
sangwonl/stage34 | webapp/api/handlers/stage.py | 1 | 6612 | from django.views import View
from django.conf import settings
from datetime import datetime
from api.helpers.mixins import AuthRequiredMixin
from api.helpers.http.jsend import JSENDSuccess, JSENDError
from api.models.resources import Membership, Stage
from libs.utils.model_ext import model_to_dict
from worker.tasks... | mit |
martinbuc/missionplanner | packages/IronPython.StdLib.2.7.4/content/Lib/distutils/command/sdist.py | 42 | 18344 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id$"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive... | gpl-3.0 |
jimkmc/micropython | tests/bytecode/pylib-tests/abc.py | 765 | 8057 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | mit |
globaltoken/globaltoken | test/functional/test_framework/authproxy.py | 1 | 7759 | # Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... | mit |
jtomasek/tuskar-ui-1 | tuskar_ui/infrastructure/resource_management/resource_classes/workflows.py | 1 | 12384 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 |
khushboo9293/postorius | src/postorius/models.py | 2 | 11004 | # -*- coding: utf-8 -*-
# Copyright (C) 1998-2015 by the Free Software Foundation, Inc.
#
# This file is part of Postorius.
#
# Postorius 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... | gpl-3.0 |
chaso137/wot-xvm | src/xpm/xpm/mods/lib/tlslite/utils/pem.py | 116 | 3587 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
from .compat import *
import binascii
#This code is shared with tackpy (somewhat), so I'd rather make minimal
#changes, and preserve the use of a2b_base64 throughout.
def dePem(s, name):
"""Decode a PEM string into a... | gpl-3.0 |
waytai/odoo | openerp/addons/base/res/res_config.py | 243 | 30944 | # -*- 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 |
ppmt/Crust | flask/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 203 | 12894 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | gpl-2.0 |
kuszmaul/PerconaFT | src/tests/ipm.py | 92 | 1263 | #!/usr/local/bin/python2.6
import sys
import os
import pexpect
import getpass
#
# remote_cmd
#
nameaddr='admn@192.168.1.254'
passwd='admn'
def IPM_cmd(cmds):
# password handling
ssh_newkey = 'Are you sure you want to continue connecting'
p=pexpect.spawn('ssh %s' % nameaddr, timeout=60)
i=p.expect([... | agpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python-build/python-libs/gdata/src/gdata/Crypto/Protocol/Chaffing.py | 226 | 9467 | """This file implements the chaffing algorithm.
Winnowing and chaffing is a technique for enhancing privacy without requiring
strong encryption. In short, the technique takes a set of authenticated
message blocks (the wheat) and adds a number of chaff blocks which have
randomly chosen data and MAC fields. This means... | apache-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/py2.5/lib/python2.5/distutils/command/bdist_msi.py | 88 | 30900 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2005, 2006 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""
import sys, os, string
from distutils.core import Command
from distutils.util import get_platfor... | mit |
vladimir-ipatov/ganeti | test/py/ganeti.impexpd_unittest.py | 9 | 8733 | #!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
#
# 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.
#
# This program... | gpl-2.0 |
mayankcu/Django-social | venv/Lib/site-packages/django/contrib/gis/geos/prototypes/predicates.py | 623 | 1777 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis... | bsd-3-clause |
iansf/sky_engine | sky/tools/webkitpy/layout_tests/port/linux.py | 7 | 6967 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
rgommers/statsmodels | statsmodels/duration/tests/survival_r_results.py | 34 | 11980 | import numpy as np
coef_20_1_bre = np.array([-0.9185611])
se_20_1_bre = np.array([0.4706831])
time_20_1_bre = np.array([0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,1.1,1.2,1.3,1.4,1.5])
hazard_20_1_bre = np.array([0,0,0.04139181,0.1755379,0.3121216,0.3121216,0.4263121,0.6196358,0.6196358,0.6196358,0.909556,1.31083,1.31083])
c... | bsd-3-clause |
forman/dectree | examples/intertidal_flat_classif/intertidal_flat_classif.py | 1 | 12362 |
from numba import jit, jitclass, float64
import numpy as np
@jit(nopython=True)
def _B1_LT_085(x):
# B1.LT_085: lt(0.85)
if 0.0 == 0.0:
return 1.0 if x < 0.85 else 0.0
x1 = 0.85 - 0.0
x2 = 0.85 + 0.0
if x <= x1:
return 1.0
if x <= x2:
return 1.0 - (x - x1) / (x2 - x1)
... | mit |
blacklin/kbengine | kbe/src/lib/python/Lib/pickle.py | 67 | 55641 | """Create portable serialized representations of Python objects.
See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes:
Pickler
Unpickler
Functions:
dump(object, file)
dumps(object) -> string
load(file) -> object
lo... | lgpl-3.0 |
Shabbypenguin/Jellybean_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
rajashreer7/autotest-client-tests | linux-tools/libpwquality/libpwquality.py | 4 | 1206 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class libpwquality(test.test):
"""
Autotest module for testing basic functionality
of libpwquality
@author Tejaswini Sambamurthy <tejaswin.linux.vnet.ibm.com>
"""
vers... | gpl-2.0 |
pfouque/deezer-python | deezer/tests/test_resources.py | 1 | 9053 | # -*- coding: utf-8 -*-
import json
import unittest
from types import GeneratorType
import deezer
from mock import patch
from .mocked_methods import fake_urlopen
class TestResources(unittest.TestCase):
def setUp(self):
self.patcher = patch('deezer.client.urlopen', fake_urlopen)
self.patcher.start... | mit |
gsnedders/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/demo/broadcast/broadcast_server.py | 4 | 2351 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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... | bsd-3-clause |
isabellemao/Hello-World | python/Junior2015CCCJ4.py | 1 | 1278 | #Problem J4: Arrival Time
departure_time = input()
split_departure = list(departure_time) #The time of departure, split into a list.
#Split the list
departure_hour = split_departure[0:2]
departure_minute = split_departure[3:5]
#Change the split list to integers.
departure_hour = int("".join(departure_hour))
departur... | apache-2.0 |
JosephCastro/selenium | py/selenium/webdriver/support/wait.py | 81 | 4070 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
FUSED-Wind/fusedwind | src/fusedwind/lib/cubicspline.py | 2 | 2234 |
import numpy as np
from scipy.linalg import solve_banded
from fusedwind.lib.utilities import _checkIfFloat
class NaturalCubicSpline(object):
"""
class implementation of utilities.cubic_with_deriv
"""
def __init__(self, xp, yp):
if np.any(np.diff(xp) < 0):
raise TypeError('xp mus... | apache-2.0 |
googleapis/python-pubsublite | google/cloud/pubsublite_v1/types/__init__.py | 1 | 4702 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | apache-2.0 |
jounex/hue | desktop/core/ext-py/Mako-0.8.1/test/test_tgplugin.py | 36 | 1260 | import unittest
from mako.ext.turbogears import TGPlugin
from test.util import flatten_result, result_lines
from test import TemplateTest, template_base
tl = TGPlugin(options=dict(directories=[template_base]), extension='html')
class TestTGPlugin(TemplateTest):
def test_basic(self):
t = tl.load_template(... | apache-2.0 |
gisce/OCB | openerp/report/render/rml2pdf/__init__.py | 75 | 1135 | # -*- 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 |
robosafe/testbench_vRAL_hydro | bert2_simulator/sim_step_monitors/assertion_monitor_manager.py | 1 | 2830 | #!/usr/bin/env python
"""
Assertion Monitor Manager
Created by David Western, June 2015.
"""
from coverage import coverage
import imp
import rospkg
import rospy
from std_msgs.msg import UInt64
from std_srvs.srv import Empty
import sys
class AMM:
def __init__(self,AM_list_file,trace_label):
# Read list... | gpl-3.0 |
ContinuumIO/chaco | examples/demo/xray_plot.py | 3 | 5751 | """
Implementation of a plot using a custom overlay and tool
"""
from __future__ import with_statement
import numpy
from traits.api import HasTraits, Instance, Enum
from traitsui.api import View, Item
from enable.api import ComponentEditor
from chaco.api import Plot, ArrayPlotData, AbstractOverlay
from enable.api im... | bsd-3-clause |
xuweiliang/Codelibrary | nova/db/sqlalchemy/migrate_repo/versions/302_pgsql_add_instance_system_metadata_index.py | 43 | 1322 | # Copyright 2015 Huawei.
# 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 appli... | apache-2.0 |
0x7E/ubuntu-tweak | ubuntutweak/settings/ccm/Utils.py | 5 | 12852 | # -*- coding: UTF-8 -*-
# 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.
#
# This program is distributed in the hope tha... | gpl-2.0 |
YongseopKim/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_media-src_none_audio_blocked_int.py | 30 | 3064 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "media-src 'none'; scr... | bsd-3-clause |
gccpacman/shadowsocks | shadowsocks/shell.py | 652 | 12736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
reingart/rad2py | assignments/program10A.py | 16 | 3944 | #!/usr/bin/env python
# coding:utf-8
"PSP Program 6A - Linear Regression Prediction Interval"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "GPL 3.0"
from math import sqrt, pi
# reuse previous programs
from program1A import mean
from progr... | gpl-3.0 |
40223245/2015cdb_g6-team1 | static/Brython3.1.1-20150328-091302/Lib/site-packages/highlight.py | 617 | 2518 | import keyword
import _jsre as re
from browser import html
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'_'
digits = '0123456789'
builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
"eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +... | gpl-3.0 |
JeremyRubin/bitcoin | test/functional/test_framework/siphash.py | 91 | 2014 | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Specialized SipHash-2-4 implementations.
This implements SipHash-2-4 for 256-bit integers.
"""
def ro... | mit |
tempesta-tech/linux-4.1-tfw | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
yuanke/hadoop-hbase | contrib/hod/hodlib/Common/setup.py | 182 | 45814 | #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 use thi... | apache-2.0 |
an7oine/WinVHS | Cygwin/lib/python2.7/distutils/command/bdist_msi.py | 164 | 35191 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""
import sys, os
from sysconfig import get_python_version
from distutils.core import Command
from... | gpl-3.0 |
m-sanders/wagtail | wagtail/wagtailimages/migrations/0001_initial.py | 31 | 3250 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import wagtail.wagtailimages.models
import taggit.managers
from django.conf import settings
import wagtail.wagtailadmin.taggable
class Migration(migrations.Migration):
dependencies = [
('taggit', '__... | bsd-3-clause |
Huskerboy/startbootstrap-freelancer | freelancer_env/Lib/re.py | 36 | 15501 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | mit |
zcbenz/cefode-chromium | tools/telemetry/telemetry/core/extension_dict.py | 35 | 1135 | # 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.
from telemetry.core import extension_to_load
class ExtensionDict(object):
"""Dictionary of ExtensionPage instances, with extension_id as key"""
def ... | bsd-3-clause |
pyKun/rally | rally/plugins/openstack/scenarios/ceilometer/samples.py | 3 | 1169 | # 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 agreed to in... | apache-2.0 |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/email/mime/image.py | 573 | 1764 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing image/* type MIME documents."""
__all__ = ['MIMEImage']
import imghdr
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
class MIMEImage(MIMENonMultipart... | gpl-3.0 |
eayunstack/eayunstack-upgrade | ansible/library/keystone_v2_endpoint.py | 1 | 9178 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | apache-2.0 |
haroldl/homeworklog | django/core/management/commands/reset.py | 229 | 2598 | from optparse import make_option
from django.conf import settings
from django.core.management.base import AppCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import sql_reset
from django.db import connections, transaction, DEFAULT_DB_ALIAS
class Command(AppComman... | bsd-3-clause |
fards/Ainol_fire_kernel | 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 |
TinLe/Diamond | src/collectors/snmpraw/snmpraw.py | 56 | 6074 | # coding=utf-8
"""
The SNMPRawCollector is designed for collecting data from SNMP-enables devices,
using a set of specified OIDs
#### Configuration
Below is an example configuration for the SNMPRawCollector. The collector
can collect data any number of devices by adding configuration sections
under the *devices* hea... | mit |
sinhrks/scikit-learn | sklearn/externals/joblib/_memory_helpers.py | 303 | 3605 | try:
# Available in Python 3
from tokenize import open as open_py_source
except ImportError:
# Copied from python3 tokenize
from codecs import lookup, BOM_UTF8
import re
from io import TextIOWrapper, open
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
def _get_normal_name(orig_enc):
... | bsd-3-clause |
lexus42/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_skipping.py | 744 | 5173 | import unittest
from .support import LoggingResult
class Test_TestSkipping(unittest.TestCase):
def test_skipping(self):
class Foo(unittest.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(events)
test = Foo("t... | agpl-3.0 |
gaddman/ansible | lib/ansible/modules/storage/ibm/ibm_sa_domain.py | 9 | 4173 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, IBM CORPORATION
# Author(s): Tzur Eliyahu <tzure@il.ibm.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_... | gpl-3.0 |
shakamunyi/nova | nova/tests/unit/db/test_migrations.py | 1 | 32632 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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/li... | apache-2.0 |
jotes/ansible | v2/test/parsing/test_mod_args.py | 109 | 4913 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/tvigle.py | 48 | 4229 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_age_limit,
)
class TvigleIE(InfoExtractor):
IE_NAME = 'tvigle'
IE_DESC = 'Интернет-телевидение Tvigle.ru'
_VALID_URL... | gpl-3.0 |
ukanga/SickRage | sickbeard/show_queue.py | 3 | 30406 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
#
# 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 version 3 of the Li... | gpl-3.0 |
Kivvix/stage-LPC | compareSrc/searchSDSSdata.py | 1 | 4221 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import os
import glob
from config import *
import data.calexp
import data.src
## @def attributs
# @brief attributs which we select in SDSS DB and src fits file
attributs = 'objid,run,camcol,field,ra,dec,u,g,r,i,z'
## Calexp treatment ##
def coordCalexp( fit... | mit |
pinkavaj/gnuradio | gnuradio-runtime/python/gnuradio/gru/msgq_runner.py | 94 | 2529 | #
# Copyright 2009 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 your option)
# any later version.
#
#... | gpl-3.0 |
yamila-moreno/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 |
xaled/wunderous-analytics | wunderous/drive.py | 1 | 5688 | import os
import sys
import httplib2
from oauth2client.file import Storage
from apiclient import discovery
from oauth2client.client import OAuth2WebServerFlow
from wunderous.config import config
OAUTH_SCOPE = 'https://www.googleapis.com/auth/drive'
SHEETS_OAUTH_SCOPE = 'https://www.googleapis.com/auth/drive https://ww... | mit |
astocko/statsmodels | statsmodels/tsa/varma_process.py | 30 | 19986 | # -*- coding: utf-8 -*-
""" Helper and filter functions for VAR and VARMA, and basic VAR class
Created on Mon Jan 11 11:04:23 2010
Author: josef-pktd
License: BSD
This is a new version, I didn't look at the old version again, but similar
ideas.
not copied/cleaned yet:
* fftn based filtering, creating samples with f... | bsd-3-clause |
timesking/sublime-evernote | lib/pygments/lexers/templates.py | 9 | 56066 | # -*- coding: utf-8 -*-
"""
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.web import \
PhpLexer, H... | mit |
dgladkov/django | django/db/models/signals.py | 399 | 2734 | from django.apps import apps
from django.dispatch import Signal
from django.utils import six
class_prepared = Signal(providing_args=["class"])
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def __in... | bsd-3-clause |
DiptoDas8/Biponi | lib/python2.7/site-packages/django/template/backends/django.py | 44 | 3018 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import warnings
from django.conf import settings
from django.template.context import Context, RequestContext, make_context
from django.template.engine import Engine, _dirs_undefined
from django.utils.... | mit |
ex1usive-m4d/TemplateDocx | controllers/phpdocx/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/encodings/__init__.py | 60 | 5638 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | bsd-3-clause |
0k/OpenUpgrade | addons/purchase_double_validation/__init__.py | 441 | 1090 | # -*- 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 |
LuckDragon82/demo | boilerplate/external/babel/tests/core.py | 61 | 1726 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | lgpl-3.0 |
lnielsen/invenio | invenio/legacy/pdfchecker/arxiv.py | 3 | 16346 | # -*- coding: utf-8 -*-
##
## 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) a... | gpl-2.0 |
Red-M/CloudBot-legacy | util/http.py | 7 | 3042 | # convenience wrapper for urllib2 & friends
import cookielib
import json
import urllib
import urllib2
import urlparse
from urllib import quote, quote_plus as _quote_plus
from lxml import etree, html
from bs4 import BeautifulSoup
# used in plugins that import this
from urllib2 import URLError, HTTPError
ua_cloudbot... | gpl-3.0 |
dennisobrien/bokeh | examples/embed/autoload_static.py | 5 | 2050 | from jinja2 import Template
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
from bokeh.embed import autoload_static
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.sampledata.iris import flowers
from bokeh.util.browser import view
template = Template... | bsd-3-clause |
aaxelb/SHARE | share/harvesters/org_elife.py | 3 | 3365 | import time
import logging
import requests
from django.conf import settings
from furl import furl
from lxml import etree
from share.harvest import BaseHarvester
logger = logging.getLogger(__name__)
class ELifeHarvester(BaseHarvester):
VERSION = 1
BASE_DATA_URL = 'https://raw.githubusercontent.com/elife... | apache-2.0 |
angryrancor/kivy | examples/audio/main.py | 40 | 2207 | '''
Audio example
=============
This example plays sounds of different formats. You should see a grid of
buttons labelled with filenames. Clicking on the buttons will play, or
restart, each sound. Not all sound formats will play on all platforms.
All the sounds are from the http://woolyss.com/chipmusic-samples.php
"T... | mit |
lattwood/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py | 121 | 10730 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_email/test_utils.py | 87 | 5422 | import datetime
from email import utils
import test.support
import time
import unittest
import sys
import os.path
class DateTimeTests(unittest.TestCase):
datestring = 'Sun, 23 Sep 2001 20:10:55'
dateargs = (2001, 9, 23, 20, 10, 55)
offsetstring = ' -0700'
utcoffset = datetime.timedelta(hours=-7)
t... | lgpl-3.0 |
Goamaral/SCC | inputWindow.py | 1 | 31922 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'inputWindow.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s... | mit |
treejames/erpnext | erpnext/buying/doctype/quality_inspection/quality_inspection.py | 61 | 2058 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class QualityInspection(Document):
def get_item_specification_details(self):
self.set('re... | agpl-3.0 |
kirca/odoo | addons/point_of_sale/wizard/pos_session_opening.py | 40 | 5025 |
from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp.addons.point_of_sale.point_of_sale import pos_session
class pos_session_opening(osv.osv_memory):
_name = 'pos.session.opening'
_columns = {
'pos_config_id' : fields.many2one('pos.config', 'Point of Sale', require... | agpl-3.0 |
Product-Foundry/vaultier | vaultier/nodes/business/permissions.py | 3 | 1731 | from rest_framework import permissions
from accounts.models import Member
def _has_membership(user, node):
return Member.objects.filter(node=node.get_root(), user=user).exists()
def _get_membership(user, node):
if not _has_membership(user, node):
return
return Member.objects.to_node(user, node)
... | bsd-3-clause |
ennoborg/gramps | gramps/gen/plug/_pluginreg.py | 2 | 47851 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2011 Tim G L Lyons
#
# 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 v... | gpl-2.0 |
iglootools/genconf | genconf/filegenerator/_filegenerator.py | 2 | 2425 | """
Copyright 2011 Sami Dalouche
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 |
shakalaca/ASUS_ZenFone_ZE500CL | linux/kernel/tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py | 63 | 7419 | """
Management utility to create superusers.
"""
from __future__ import unicode_literals
import getpass
import sys
from optparse import make_option
from django.contrib.auth import get_user_model
from django.contrib.auth.management import get_default_username
from django.core import exceptions
from django.core.managem... | apache-2.0 |
redbear/micropython | tests/extmod/ure1.py | 35 | 1169 | try:
import ure as re
except ImportError:
import re
r = re.compile(".+")
m = r.match("abc")
print(m.group(0))
try:
m.group(1)
except IndexError:
print("IndexError")
r = re.compile("(.+)1")
m = r.match("xyz781")
print(m.group(0))
print(m.group(1))
try:
m.group(2)
except IndexError:
print("Index... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.