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 |
|---|---|---|---|---|---|
tsabi/Odoo-tsabi-fixes | addons/account/wizard/account_report_common.py | 342 | 10353 | # -*- 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 |
Yen-Chung-En/2015cdb_g1_0623 | static/Brython3.1.1-20150328-091302/Lib/xml/etree/__init__.py | 1200 | 1604 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | gpl-3.0 |
RonnyPfannschmidt/django-classy-settings | cbs/base/django18.py | 5 | 2262 |
import os
from . import CoreSettings
class Base18Settings(CoreSettings):
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.c... | bsd-2-clause |
ViralLeadership/numpy | numpy/lib/tests/test_utils.py | 149 | 1466 | from __future__ import division, absolute_import, print_function
import sys
from numpy.core import arange
from numpy.testing import (
run_module_suite, assert_, assert_equal, dec
)
from numpy.lib import deprecate
import numpy.lib.utils as utils
if sys.version_info[0] >= 3:
from io import StringIO
else:
... | bsd-3-clause |
crdoconnor/olympia | apps/addons/urls.py | 15 | 2696 | from django.conf.urls import include, patterns, url
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import redirect
from reviews.urls import review_patterns
from stats.urls import stats_patterns
from . import views
ADDON_ID = r"""(?P<addon_id>[^/<>"']+)"""
# These will all start with /add... | bsd-3-clause |
Teagan42/home-assistant | homeassistant/components/geniushub/water_heater.py | 5 | 2198 | """Support for Genius Hub water_heater devices."""
from typing import List
from homeassistant.components.water_heater import (
SUPPORT_OPERATION_MODE,
SUPPORT_TARGET_TEMPERATURE,
WaterHeaterDevice,
)
from homeassistant.const import STATE_OFF
from homeassistant.helpers.typing import ConfigType, HomeAssistan... | apache-2.0 |
auready/django | tests/logging_tests/tests.py | 2 | 17920 | import logging
from contextlib import contextmanager
from io import StringIO
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.core import mail
from django.core.files.temp import NamedTemporaryFile
from django.core.management import color
from django.db import connection... | bsd-3-clause |
SickRage/subliminal | subliminal/converters/thesubdb.py | 45 | 1123 | # -*- coding: utf-8 -*-
from babelfish import LanguageReverseConverter
from ..exceptions import ConfigurationError
class TheSubDBConverter(LanguageReverseConverter):
def __init__(self):
self.from_thesubdb = {'en': ('eng',), 'es': ('spa',), 'fr': ('fra',), 'it': ('ita',), 'nl': ('nld',),
... | mit |
goliveirab/odoo | openerp/report/render/rml2html/rml2html.py | 438 | 15438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
sestrella/ansible | lib/ansible/plugins/doc_fragments/intersight.py | 44 | 1382 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
petebachant/pyqtgraph | pyqtgraph/frozenSupport.py | 52 | 1830 | ## Definitions helpful in frozen environments (eg py2exe)
import os, sys, zipfile
def listdir(path):
"""Replacement for os.listdir that works in frozen environments."""
if not hasattr(sys, 'frozen'):
return os.listdir(path)
(zipPath, archivePath) = splitZip(path)
if archivePath is None:
... | mit |
slightlymadphoenix/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/template/utils.py | 199 | 3733 | import os
from collections import Counter, OrderedDict
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.functional import cached_property
from django.utils.module... | mit |
pvreman/cobbler | cobbler/action_acl.py | 15 | 3542 | """
Configures acls for various users/groups so they can access the cobbler command
line as non-root. Now that CLI is largely remoted (XMLRPC) this is largely just
useful for not having to log in (access to shared-secret) file but also grants
access to hand-edit various config files and other useful things.
Copyright... | gpl-2.0 |
leifdenby/numpy | numpy/core/tests/test_api.py | 92 | 18851 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.compat import sixu
from numpy.testing import (
run_module_suite, assert_, assert_equal, assert_array_equal,
assert_raises
)
# Switch between new behaviour when NPY_RELAXED_STRIDES_CHECKING is set.
NPY_... | bsd-3-clause |
nickyjaspers/textracematrix | code_parser.py | 1 | 2181 |
class CodeParser:
def __init__(self, req_pattern='// REQ:', test_pattern='@Test', method_pattern='public void '):
self.req_test_mapping = dict()
self.req_pattern = req_pattern
self.test_pattern = test_pattern
self.method_pattern = method_pattern
def get_requirements_and_test_ca... | mit |
procamora/Parseador-mailer | primero.py | 1 | 3235 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.ianlewis.org/en/parsing-email-attachments-python
from email.Header import decode_header
import email
from base64 import b64decode
import sys
from email.Parser import Parser as EmailParser
from email.utils import parseaddr
# cStringIO
from io import StringIO
... | gpl-3.0 |
v-zhongz/azure-linux-extensions | VMAccess/test/test_iptable_rules.py | 8 | 1529 | #!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 |
ariegg/webiopi-drivers | chips/digital/tle7238sl/__init__.py | 1 | 5233 | # Copyright 2012-2016 Eric Ptak - trouch.com
# Copyright 2016 Andreas Riegg - t-h-i-n-x.net
#
# 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/... | apache-2.0 |
jay-christnach/mscons-parser | segmentgenerator.py | 1 | 1341 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 26 11:41:37 2016
@author: ChristnachJeanClaude
"""
import sys
# import logging
# from autologging import traced, TRACE
# @traced
class SegmentGenerator:
def __init__(self, filename):
try:
fh = open(filename)
except IOE... | gpl-3.0 |
wogsland/QSTK | QSTK/qstklearn/hmm.py | 7 | 11366 | """
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
This package includes code for representing and learning HMM's.
Most of the code in this package was derived from the... | bsd-3-clause |
Rodolfoarv/Mars-Explorer-AI-with-Python- | env/lib/python2.7/site-packages/pip/_vendor/distlib/index.py | 571 | 20976 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... | mit |
aneeshusa/servo | tests/wpt/harness/setup.py | 196 | 2713 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import sys
import textwrap
from setuptools import setup, find_packages
here = os.path.split(__fi... | mpl-2.0 |
RyanMallon/linux-ep93xx | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
vasyarv/edx-platform | common/djangoapps/track/tests/test_util.py | 239 | 1203 | from datetime import datetime
import json
from pytz import UTC
from django.test import TestCase
from track.utils import DateTimeJSONEncoder
class TestDateTimeJSONEncoder(TestCase):
def test_datetime_encoding(self):
a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000)
a_tz_datetime = dat... | agpl-3.0 |
emersonsoftware/ansiblefork | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 6 | 60319 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
eLBati/odoo | addons/base_import_module/controllers/main.py | 354 | 1518 | # -*- coding: utf-8 -*-
import functools
import openerp
from openerp.http import Controller, route, request, Response
def webservice(f):
@functools.wraps(f)
def wrap(*args, **kw):
try:
return f(*args, **kw)
except Exception, e:
return Response(response=str(e), status=500... | agpl-3.0 |
lizardsystem/lizard5-apps | lizard_wms/migrations/0018_add_display_name.py | 2 | 5061 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'WMSSource.display_name'
db.add_column('lizard_wms_wmssource', 'display_name',
... | lgpl-3.0 |
gspeedtech/Audacity-2 | lib-src/lv2/sord/waflib/Tools/dmd.py | 316 | 1511 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import sys
from waflib.Tools import ar,d
from waflib.Configure import conf
@conf
def find_dmd(conf):
conf.find_program(['dmd','dmd2','ldc'],var='D')
out=conf.cmd_and_log([co... | gpl-2.0 |
soldag/home-assistant | script/hassfest/requirements.py | 10 | 6968 | """Validate requirements."""
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from typing import Dict, Set
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.const import REQUIRED_PYTHON_VER
import homeassistant.util.package as pkg_ut... | apache-2.0 |
paulollivier/i3pystatus | i3pystatus/pulseaudio/__init__.py | 8 | 7117 | import os
import shutil
from i3pystatus.core.color import ColorRangeModule
from i3pystatus.core.util import make_vertical_bar, make_bar
from .pulse import *
from i3pystatus import Module
import subprocess
class PulseAudio(Module, ColorRangeModule):
"""
Shows volume of default PulseAudio sink (output).
-... | mit |
cstan11/Sick-Beard | lib/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | gpl-3.0 |
XtremeTeam/Lucy-bot | brain/plugins/weather.py | 1 | 2406 | #===islucyplugin===
# -*- coding: utf-8 -*-
# Lucy's Plugin
# weather_plugin.py
# Initial Copyright © 2002-2005 Mike Mintz <mikemintz@gmail.com>
# Modifications Copyright © 2007 Als <Als@exploru.net>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-2.0 |
jean/sentry | src/sentry/south_migrations/0195_auto__chg_field_organization_owner.py | 4 | 56581 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Organization.owner'
db.alter_column(
'sentr... | bsd-3-clause |
jkburges/phantomjs | src/qt/qtbase/src/3rdparty/freetype/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 ... | bsd-3-clause |
nicococo/LatentSVDD | latentsvdd.py | 1 | 3231 | from cvxopt import matrix,spmatrix,sparse,uniform,normal,setseed
from cvxopt.blas import dot,dotu
from cvxopt.solvers import qp
from cvxopt.lapack import syev
import numpy as np
import math as math
from kernel import Kernel
from svdd import SVDD
import pylab as pl
import matplotlib.pyplot as plt
class LatentSVDD:
... | mit |
aonotas/chainer | tests/chainer_tests/links_tests/activation_tests/test_maxout.py | 2 | 4767 | import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
def _as_mat(x):
if x.ndim ... | mit |
okumura/gyp | pylib/gyp/win_tool.py | 24 | 11672 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | bsd-3-clause |
manojhirway/ExistingImagesOnNFS | cinder/tests/unit/scheduler/test_volume_number_weigher.py | 17 | 3932 | # Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
carsongee/edx-platform | lms/djangoapps/courseware/tests/test_grades.py | 33 | 5102 | """
Test grade calculation.
"""
from django.http import Http404
from django.test.utils import override_settings
from mock import patch
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactor... | agpl-3.0 |
harrisonfeng/gunicorn | gunicorn/app/django_wsgi.py | 87 | 4363 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
""" module used to build the django wsgi application """
from __future__ import print_function
import os
import re
import sys
import time
try:
from StringIO import StringIO
except:
fr... | mit |
softlayer/softlayer-python | SoftLayer/CLI/loadbal/ns_detail.py | 2 | 1807 | """Get Netscaler details."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Get Netscaler details."""
mgr = SoftLayer.LoadBal... | mit |
AOSP-S4-KK/platform_external_chromium_org | chrome/test/functional/media/audio_latency_perf.py | 70 | 1454 | #!/usr/bin/env python
# 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.
"""Audio latency performance test.
Benchmark measuring how fast we can continuously repeat a short sound clip. In
the ideal scena... | bsd-3-clause |
40223209/test | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | agpl-3.0 |
WrinklyNinja/yaml-cpp | test/gtest-1.10.0/googletest/scripts/upload.py | 97 | 51084 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | mit |
bartekjagiello/inteygrate_flaskapp | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_add_success.py | 61 | 1785 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessAddParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<add type="success" participant="{{jid}}"></add>
... | gpl-3.0 |
dreamsxin/kbengine | kbe/src/lib/python/Doc/includes/email-dir.py | 43 | 3984 | #!/usr/bin/env python3
"""Send the contents of a directory as a MIME message."""
import os
import sys
import smtplib
# For guessing MIME type based on file name extension
import mimetypes
from argparse import ArgumentParser
from email import encoders
from email.message import Message
from email.mime.audio import MI... | lgpl-3.0 |
sdelaughter/SmartHome | v0.2/resources/gateway.py | 1 | 13584 | # Samuel DeLaughter
# 4/10/15
from SimpleXMLRPCServer import SimpleXMLRPCServer
from threading import Thread
import logging
import socket
import time
import iot
class gateway(iot.device):
#The class defining gateway devices
def __init__(self):
iot.device.__init__(self)
self.id = 0
self.ip = socket.gethostbyn... | gpl-2.0 |
alhashash/odoo | addons/l10n_eu_service/__openerp__.py | 254 | 3277 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | agpl-3.0 |
mrspeaker/react-native | JSCLegacyProfiler/trace_data.py | 375 | 8013 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import unittest
"""
# _-----=> irqs-off
# / _----=> need-resched
# | / _---... | bsd-3-clause |
GladeRom/android_external_chromium_org | build/android/lighttpd_server.py | 96 | 9421 | #!/usr/bin/env python
#
# 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.
"""Provides a convenient wrapper for spawning a test lighttpd instance.
Usage:
lighttpd_server PATH_TO_DOC_ROOT
"""
import co... | bsd-3-clause |
coursemdetw/2014cdb | wsgi/static/Brython2.1.3-20140704-213726/Lib/reprlib.py | 923 | 5110 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... | gpl-2.0 |
neumerance/cloudloon2 | .venv/lib/python2.7/site-packages/novaclient/extension.py | 8 | 1395 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
MartinDelzant/scikit-learn | sklearn/ensemble/gradient_boosting.py | 50 | 67625 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
pdellaert/ansible | lib/ansible/modules/cloud/cloudstack/cs_template.py | 11 | 24032 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported... | gpl-3.0 |
cchurch/ansible | lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_info.py | 2 | 10646 | #!/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 |
throwable-one/lettuce | tests/integration/lib/Django-1.3/django/contrib/webdesign/lorem_ipsum.py | 439 | 4872 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | gpl-3.0 |
denisekgosnell/denisekgosnell.github.io | meetups/utk_march_2017/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
mdietrichc2c/OCB | addons/hw_scanner/controllers/main.py | 77 | 7438 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... | agpl-3.0 |
srickardti/openthread | tools/harness-automation/cases_R140/commissioner_8_1_2.py | 18 | 1889 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
preete-dixit-ck/incubator-airflow | tests/plugins_manager.py | 32 | 2938 | # -*- coding: utf-8 -*-
#
# 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 |
jody-frankowski/ansible-modules-core | web_infrastructure/htpasswd.py | 69 | 7061 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, 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 |
pyinvoke/invoke | invoke/vendor/yaml2/parser.py | 409 | 25542 |
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
# implicit_document ::= block_node DOCUMENT-END*
# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
# block_node_or_inden... | bsd-2-clause |
hobarrera/django | tests/utils_tests/test_regex_helper.py | 448 | 1784 | from __future__ import unicode_literals
import unittest
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def te... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_isinstance.py | 59 | 10173 | # Tests some corner cases with isinstance() and issubclass(). While these
# tests use new style classes and properties, they actually do whitebox
# testing of error conditions uncovered when using extension types.
import unittest
from test import support
import sys
class TestIsInstanceExceptions(unittest.TestCase... | mit |
gecos-team/gecosws-config-assistant | gecosws_config_assistant/view/LocalUserListDialog.py | 1 | 7253 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... | gpl-2.0 |
smartforceplus/SmartForceplus | addons/membership/wizard/membership_invoice.py | 380 | 3229 | # -*- 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 |
jmwenda/geonode | geonode/security/middleware.py | 34 | 1412 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from re import compile
from guardian.shortcuts import get_anonymous_user
class LoginRequiredMiddleware(object):
"""
Requires a user to be logged in to access any page that is not white-l... | gpl-3.0 |
wwchun123/sumatrapdf | scripts/runtests.py | 16 | 2940 | """
Builds test executable(s), runs them and checks for failures.
The conventions are:
- premake4.lua defines all_tests.sln which contains one or more
test projects
- we build Release version of all projects
- they end up as obj-rel/test_*.exe executables
- we run all those test executables
- a test e... | gpl-3.0 |
papados/ordersys | Lib/site-packages/django/db/backends/postgresql_psycopg2/base.py | 30 | 6838 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db.backends import *
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from django.db.backends.postgresql_psycopg2.client import DatabaseClient
from django.db.b... | unlicense |
rjsproxy/wagtail | wagtail/tests/utils.py | 30 | 1697 | from contextlib import contextmanager
import warnings
import sys
from django.contrib.auth import get_user_model
from django.utils import six
class WagtailTestUtils(object):
def login(self):
# Create a user
user = get_user_model().objects.create_superuser(username='test', email='test@email.com', p... | bsd-3-clause |
holzingerm/xbmc | addons/service.xbmc.versioncheck/lib/jsoninterface.py | 82 | 1980 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 versio... | gpl-2.0 |
KickAssCoin/P2Pool-KIK | nattraverso/pynupnp/upnpxml.py | 288 | 3026 | """
This module parse an UPnP device's XML definition in an Object.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
from xml.dom import minidom
import logging
# Allowed UPnP services to use when ... | gpl-3.0 |
Juniper/neutron | neutron/services/metering/drivers/noop/noop_driver.py | 28 | 1308 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Sylvain Afchain <sylvain.afchain@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.apach... | apache-2.0 |
ProjexSoftware/projexui | projexui/widgets/xloggersplashscreen.py | 2 | 2523 | #!/usr/bin/python
""" Creates a splash screen that is linked to the python logging system. """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'L... | lgpl-3.0 |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/sqlalchemy/dialects/sybase/base.py | 19 | 28696 | # sybase/base.py
# Copyright (C) 2010-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is par... | mit |
gram526/VTK | IO/EnSight/Testing/Python/EnSightBlow5ASCII.py | 20 | 1510 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... | bsd-3-clause |
zenotech/StarCluster | starcluster/commands/sshmaster.py | 19 | 2584 | # Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster 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 ... | gpl-3.0 |
jeremiedecock/snippets | python/cairo/fill_and_stroke.py | 1 | 4068 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | mit |
canvasnetworks/canvas | website/apps/activity/redis_models.py | 1 | 8371 | from datetime import date
import itertools
from django.conf import settings
from django.db.models import *
from apps.activity.base_activity import BaseActivity
from apps.canvas_auth.models import User
from canvas import util
from canvas.redis_models import RedisLastBumpedBuffer
from drawquest.apps.drawquest_auth.deta... | bsd-3-clause |
AsgerPetersen/QGIS | python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py | 1 | 13623 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrtopostgislist.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... | gpl-2.0 |
seancallaway/drollerbot | drollerbot/magicball.py | 1 | 1354 | """
magicball.py
~~~~~~~~
Exposes the `MagicBall` object.
:copyright: (c) 2017 by Sean Callaway.
:license: MIT, see LICENSE for more details.
"""
import random
class MagicBall(object):
"""Defines a magic 8 ball."""
def __init__(self):
"""Setup the 8ball with responses."""
... | mit |
llhe/tensorflow | tensorflow/examples/tutorials/layers/cnn_mnist.py | 44 | 5470 | # 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 appl... | apache-2.0 |
Prash88/my-wedding | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
CLVsol/odoo_addons | clv_insured_card/clv_insured_card.py | 1 | 2537 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
jgoclawski/django | tests/queryset_pickle/models.py | 281 | 1904 | import datetime
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
def standalone_number():
return 1
class Numbers(object):
@staticmethod
def get_static_number():
return 2
class PreviousDjangoVersionQuer... | bsd-3-clause |
j0nathan33/CouchPotatoServer | libs/git/ref.py | 110 | 2981 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
KokareIITP/django | tests/staticfiles_tests/test_storage.py | 147 | 18183 | from __future__ import unicode_literals
import os
import sys
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collectstatic
from django.contrib.staticfiles.management.commands.collectstatic import \
... | bsd-3-clause |
tgroh/incubator-beam | sdks/python/apache_beam/coders/slow_coders_test.py | 8 | 1678 | #
# 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 us... | apache-2.0 |
gae-init/gae-init-debug | main/libx/gae_mini_profiler/profiler.py | 3 | 26200 | from __future__ import with_statement
import datetime
import time
import logging
import os
import re
import urlparse
import base64
try:
import threading
except ImportError:
import dummy_threading as threading
# use json in Python 2.7, fallback to simplejson for Python 2.5
try:
import json
except ImportEr... | mit |
lebinh/HdrHistogram_py | hdrh/codec.py | 1 | 15425 | '''
A pure python version of the hdr_histogram code
Ported from
https://github.com/HdrHistogram/HdrHistogram (Java)
https://github.com/HdrHistogram/HdrHistogram_c (C)
Coding / Decoding of histograms using the
HdrHistogram V1 compressed transportable format
Written by Alec Hothan
Licensed under the Apache License, V... | apache-2.0 |
kiwicopple/MyMDb | venv/build/sphinx/sphinx/websupport/storage/sqlalchemystorage.py | 12 | 6128 | # -*- coding: utf-8 -*-
"""
sphinx.websupport.storage.sqlalchemystorage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An SQLAlchemy storage backend.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from datetime import datetime
import sql... | mit |
gregcorbett/SciBot | test/test_command_log.py | 1 | 1974 | """This file contains the TestCommandLog class."""
import unittest
import mock
import pygame
from src.CommandLog import CommandLog
from src.CustomEvent import CustomEvent
from src.Point import Point
class TestCommandLog(unittest.TestCase):
"""This test class unit tests the CommandLog class."""
def setUp(sel... | gpl-2.0 |
lanbing510/GTDWeb | django/conf/__init__.py | 44 | 7061 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time # Needed for Windows... | gpl-2.0 |
JupiterLikeThePlanet/Quoter | vendor/bundle/ruby/2.3.0/gems/ffi-1.9.23/ext/ffi_c/libffi/generate-darwin-source-and-headers.py | 44 | 6626 | #!/usr/bin/env python
import subprocess
import os
import errno
import collections
import glob
import argparse
class Platform(object):
pass
class simulator_platform(Platform):
directory = 'darwin_ios'
sdk = 'iphonesimulator'
arch = 'i386'
triple = 'i386-apple-darwin11'
version_min = '-miphoneos... | mit |
nyleng/scipy2015-3d_printing | alaska_no_sides.py | 2 | 1488 | import numpy as np
from osgeo import gdal
import mayavi.mlab as mlab
import utils
import shapeways_io
gdal.UseExceptions()
def main():
z, x, y = read('data/alaska/clipped_elev.tif')
rgb, _, _ = read('data/alaska/clipped_map.tif')
rgb = np.swapaxes(rgb.T, 0, 1)
fig = mlab.figure()
surf = mlab.m... | mit |
adamchainz/ansible | test/units/modules/network/nxos/test_nxos_hsrp.py | 20 | 2390 | # (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
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
shinpeimuraoka/ryu | ryu/topology/switches.py | 6 | 34197 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
luzfcb/pip | pip/_vendor/requests/packages/urllib3/response.py | 478 | 16459 | try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... | mit |
thiagopnts/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/test_hosts.py | 3 | 1536 | import unittest
import sys
from os.path import join, dirname
from cStringIO import StringIO
sys.path.insert(0, join(dirname(__file__), "..", ".."))
from wptrunner import hosts
class HostsTest(unittest.TestCase):
def do_test(self, input, expected):
host_file = hosts.HostsFile.from_file(StringIO(input))
... | mpl-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/local/lib/python2.7/encodings/undefined.py | 860 | 1299 | """ Python 'undefined' Codec
This codec will always raise a ValueError exception when being
used. It is intended for use by the site.py file to switch off
automatic string to Unicode coercion.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
impo... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.