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 |
|---|---|---|---|---|---|
synergeticsedx/deployment-wipro | common/test/acceptance/tests/lms/test_lms_acid_xblock.py | 15 | 5952 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS.
"""
from unittest import expectedFailure
from common.test.acceptance.tests.helpers import UniqueCourseTest
from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage
from common.test.acceptance.pages.lms.course_info import CourseInfoPage
from common.t... | agpl-3.0 |
jonathonwalz/ansible | lib/ansible/plugins/inventory/virtualbox.py | 16 | 7523 | # This file is part of Ansible,
# (c) 2012-2017, 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 L... | gpl-3.0 |
wdv4758h/ZipPy | lib-python/3/formatter.py | 751 | 14930 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | bsd-3-clause |
isabernardes/Heriga | Herigaenv/lib/python2.7/site-packages/PIL/PcfFontFile.py | 19 | 6136 | #
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library
# $Id$
#
# portable compiled font file parser
#
# history:
# 1997-08-19 fl created
# 2003-09-13 fl fixed loading of unicode fonts
#
# Copyright (c) 1997-2003 by Secret Labs AB.
# Copyright (c) 1997-2003 by Fredrik Lundh.
#
# See the README file for informa... | mit |
joshisa/taiga-back | taiga/projects/wiki/models.py | 21 | 3733 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
codebauss/don | openstack_dashboard/don/ovs/collector.py | 1 | 35342 | #
# This file runs a whole bunch of commands (on the shell), parses their outputs
# and constructs a dictionary of extracted information.
#
import pprint
import re
import argparse
import os
import sys
from common import settings, debug, error, status_update, dump_json, load_json
from common import execute_cmd,connect_... | apache-2.0 |
KAMI911/loec | examples/Sharpen/binaries-windows-python26/ImageFont.py | 3 | 17547 | #
# The Python Imaging Library.
# $Id: ImageFont.py 2813 2006-10-07 10:11:35Z fredrik $
#
# PIL raster font management
#
# History:
# 1996-08-07 fl created (experimental)
# 1997-08-25 fl minor adjustments to handle fonts from pilfont 0.3
# 1999-02-06 fl rewrote most font management stuff in C
# 1999-03-... | gpl-3.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/twisted/logger/test/test_filter.py | 24 | 12010 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._filter}.
"""
from zope.interface.verify import verifyObject, BrokenMethodImplementation
from twisted.trial import unittest
from .._levels import InvalidLogLevelError
from .._levels import LogLevel
from .._ob... | gpl-2.0 |
n0m4dz/odoo | addons/mail/tests/test_invite.py | 199 | 2591 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-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 |
nin042/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py | 113 | 20678 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | bsd-3-clause |
vincent-tr/rpi-js-os | ext/v8-6.3.166/v8/tools/testrunner/server/daemon.py | 123 | 3753 | #!/usr/bin/env python
# This code has been written by Sander Marechal and published at:
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
# where the author has placed it in the public domain (see comment #6 at
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c6... | gpl-3.0 |
maxenglander/terraform | vendor/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | mpl-2.0 |
willthames/ansible | lib/ansible/modules/network/cloudengine/ce_facts.py | 39 | 11082 | #!/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 distribut... | gpl-3.0 |
romain-dartigues/ansible | lib/ansible/modules/cloud/memset/memset_memstore_facts.py | 12 | 4680 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.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... | gpl-3.0 |
buntyke/GPy | GPy/util/classification.py | 15 | 1489 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
def conf_matrix(p,labels,names=['1','0'],threshold=.5,show=True):
"""
Returns error rate and true/false positives in a binary classification problem
- Actual classes are displ... | mit |
ChameleonCloud/horizon | openstack_dashboard/test/unit/api/test_network.py | 3 | 6498 | # Copyright 2013 NEC 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 applicable law or ag... | apache-2.0 |
kevin-hannegan/vps-droplet | website/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | mit |
IRI-Research/django | django/utils/deconstruct.py | 38 | 1087 | def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
path = kwargs.pop('path', None)
def decorator(klass):
def __new__(cls, *args, **kw... | bsd-3-clause |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pygments/lexers/_cocoa_builtins.py | 25 | 39982 | # -*- coding: utf-8 -*-
"""
pygments.lexers._cocoa_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file defines a set of types used across Cocoa frameworks from Apple.
There is a list of @interfaces, @protocols and some other (structs, unions)
File may be also used as standalone generator for aboves... | apache-2.0 |
ChenJunor/hue | desktop/core/ext-py/pysaml2-2.4.0/src/s2repoze/plugins/challenge_decider.py | 32 | 3196 | from paste.request import construct_url
import zope.interface
from repoze.who.interfaces import IRequestClassifier
from paste.httpheaders import REQUEST_METHOD
from paste.httpheaders import CONTENT_TYPE
from paste.httpheaders import USER_AGENT
import re
_DAV_METHODS = (
'OPTIONS',
'PROPFIND',
'PROPPATCH'... | apache-2.0 |
jiahaoliang/group-based-policy | gbpservice/nfp/configurator/lib/generic_config_constants.py | 1 | 1089 | # 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
# d... | apache-2.0 |
epuzanov/ZenPacks.community.HPMon | ZenPacks/community/HPMon/HPCPU.py | 1 | 1291 | ################################################################################
#
# This program is part of the HPMon Zenpack for Zenoss.
# Copyright (C) 2008, 2009, 2010, 2011 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zen... | gpl-2.0 |
grupoprog3/proyecto_final | Entrega Final/flask/Lib/site-packages/openid/yadis/discover.py | 12 | 6054 | # -*- test-case-name: openid.test.test_yadis_discover -*-
__all__ = ['discover', 'DiscoveryResult', 'DiscoveryFailure']
from io import StringIO
from openid import fetchers
from openid.yadis.constants import \
YADIS_HEADER_NAME, YADIS_CONTENT_TYPE, YADIS_ACCEPT_HEADER
from openid.yadis.parsehtml import MetaNotFo... | apache-2.0 |
AIML/scikit-learn | sklearn/datasets/california_housing.py | 198 | 3877 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | bsd-3-clause |
pydsigner/wesnoth | data/tools/unit_tree/html_output.py | 17 | 44265 | #encoding: utf8
import os, gettext, time, copy, sys, re
import traceback
import unit_tree.helpers as helpers
import wesnoth.wmlparser2 as wmlparser2
pics_location = "../../pics"
html_header = '''
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR... | gpl-2.0 |
dataDogma/Computer-Science | Django-MVP-page/venv/Lib/encodings/iso8859_1.py | 266 | 13176 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | gpl-3.0 |
IrvinT/webapp | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11/setuptools/command/install_egg_info.py | 39 | 3724 | from setuptools import Command
from setuptools.archive_util import unpack_archive
from distutils import log, dir_util
import os, shutil, pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | bsd-3-clause |
DreamerKing/LightweightHtmlWidgets | LightweightHtmlWidgets/bin/Debug/Ipy.Lib/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | gpl-3.0 |
skosukhin/spack | lib/spack/docs/tutorial/examples/Autotools/1.package.py | 1 | 2197 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
kjw0106/GCM_app_server | venv/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py | 470 | 2025 | # This is just a kludge so that bdist_rpm doesn't guess wrong about the
# distribution name and version, if the egg_info command is going to alter
# them, another kludge to allow you to build old-style non-egg RPMs, and
# finally, a kludge to track .rpm files for uploading when run on Python <2.5.
from distutils.comma... | mit |
code-iai/semrec | scripts/bstools/Beliefstate Tools/ExperienceProcessor/expproc/ExperienceProcessor.py | 1 | 1611 | #!/usr/bin/python
import sys
from PyQt4 import QtCore, QtGui
from OwlReader import OwlReader
from DesignatorReader import DesignatorReader
from Log import Log
from Visualization_ui import Ui_MainWindow
class ExperienceProcessor(QtGui.QMainWindow):
def __init__(self, parent=None):
self.rdrOwl = OwlRead... | bsd-2-clause |
asurve/arvind-sysml2 | src/main/python/systemml/mlcontext.py | 1 | 26974 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
rcbops/horizon-buildpackage | horizon/dashboards/nova/access_and_security/floating_ips/tests.py | 2 | 8943 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
#
# Licensed under th... | apache-2.0 |
cujam/SMOS | excelmaster/tests/base_operating.py | 1 | 2563 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
import re
import tools
import mysqlDB
import Auxfunction
import sentiment
class Read:
def __init__(self, filename):
self.filename = filename
self.db = mysqlDB.Mysql('root', 'cujam137', 'Data')
self.Rxlsx = tools.ReadXlsx(self.filename)
sel... | gpl-3.0 |
Weasyl/weasyl | weasyl/files.py | 1 | 3462 | import os
import glob
import errno
import codecs
import shutil
from libweasyl.constants import Category
from libweasyl.exceptions import InvalidFileFormat, UnknownFileFormat
from libweasyl.files import file_type_for_category, makedirs_exist_ok
from libweasyl import security
from weasyl.error import WeasylError
import ... | apache-2.0 |
andela-ooladayo/django | tests/gis_tests/gis_migrations/migrations/0001_initial.py | 269 | 2465 | from django.db import connection, migrations, models
from ...models import models as gis_models
ops = [
migrations.CreateModel(
name='Neighborhood',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.C... | bsd-3-clause |
rbenjamin/namebench | nb_third_party/dns/rdtypes/ANY/NXT.py | 248 | 3725 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
herczy/typesafety | typesafety/tests/test_plugin.py | 3 | 2955 | #
# Copyright (c) 2013-2018 Balabit
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distrib... | lgpl-2.1 |
40023154/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-2.0 |
petrutlucian94/nova | nova/tests/unit/api/openstack/compute/contrib/test_quota_classes.py | 26 | 6784 | # Copyright 2012 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 |
sreichholf/python-coherence | coherence/backends/yamj_storage.py | 5 | 13719 | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# a backend to expose a YMAJ library via UPnP
# see http://code.google.com/p/moviejukebox/ for more info on YAMJ (Yet Another Movie Jukebox):
# Copyright 2007, Frank Scholz <coherence@beebits.net>
# Copyright 2009, Jean-Michel S... | mit |
aldebaran/qibuild | python/qisrc/test/test_qisrc_maintainers.py | 1 | 2468 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test QiSrc Maintainers """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future... | bsd-3-clause |
biddisco/VTK | ThirdParty/Twisted/twisted/mail/test/test_mailmail.py | 77 | 2683 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.mail.scripts.mailmail}, the implementation of the
command line program I{mailmail}.
"""
import sys
from StringIO import StringIO
from twisted.trial.unittest import TestCase
from twisted.mail.scripts.mailmail import parseO... | bsd-3-clause |
nashuiliang/zookeeper | src/contrib/zkpython/src/test/zktestbase.py | 98 | 3572 | #!/usr/bin/python
#
# 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
# "Lic... | apache-2.0 |
sdeepanshu02/microblog | flask/Lib/site-packages/sqlalchemy/sql/type_api.py | 12 | 46121 | # sql/types_api.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/test/test_code.py | 29 | 3240 | """This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.func_code)
name: f
argcount: 1
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>')
>>> dump(f(4).f... | mit |
GaloisInc/hacrypto | src/Tools/FigureOfMerit/FigureOfMerit/BlockCiphers/Scenario2/CipherImplementation.py | 1 | 13359 | #
# University of Luxembourg
# Laboratory of Algorithmics, Cryptology and Security (LACS)
#
# FigureOfMerit (FOM)
#
# Copyright (C) 2015 University of Luxembourg
#
# Written in 2015 by Daniel Dinu <dumitru-daniel.dinu@uni.lu>
#
# This file is part of FigureOfMerit.
#
# This program is free software: you can redistribut... | bsd-3-clause |
stewnorriss/LibCloud | libcloud/test/compute/test_ibm_sce.py | 29 | 14632 | # 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 ... | apache-2.0 |
terryyin/linkchecker | third_party/dnspython/tests/message.py | 68 | 5594 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-2.0 |
moling3650/mblog | www/app/frame/__init__.py | 1 | 4236 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-05-05 22:14:44
# @Author : moling (365024424@qq.com)
# @Link : #
# @Version : 0.1
import asyncio
import functools
import inspect
import logging
import os
from aiohttp import web
from .errors import APIError
# 工厂模式,生成GET、POST等请求方法的装饰器
def request(pa... | mit |
elggem/tensorflow_node | src/tensorflow_node/tests/test_inputlayer.py | 2 | 3115 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging as log
import tensorflow as tf
import numpy as np
from tensorflow_node import AutoEncoderNode
from tensorflow_node import SummaryWriter
from tensorflow_node import OpenCVInputLayer
# this tests the cropping of the input layer.
class InputLayerTest(tf.tes... | unlicense |
papedaniel/oioioi | oioioi/oi/controllers.py | 1 | 11036 | from django.shortcuts import redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from oioioi.base.utils.redirect import safe... | gpl-3.0 |
NeCTAR-RC/neutron | neutron/plugins/cisco/common/cisco_exceptions.py | 43 | 8481 | # Copyright 2011 Cisco Systems, 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 requir... | apache-2.0 |
harshita-gupta/Harvard-FRSEM-Catalog-2016-17 | flask/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 485 | 1917 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
if AnsiToWin32 is not None: # Is... | mit |
ikoula/cloudstack | test/integration/smoke/test_reset_vm_on_reboot.py | 3 | 5578 | # 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... | gpl-2.0 |
reinout/django | tests/fixtures/models.py | 57 | 3234 | """
Fixtures.
Fixtures are a way of loading data into the database in bulk. Fixure data
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, or in one of the directories named in the
``FIX... | bsd-3-clause |
MihaZelnik/meepleAPI | meeple/apps/api/views/mechanic.py | 1 | 1447 | from django.conf.urls import url
from apps.api.models import Mechanic
from apps.api.serializers.mechanic import MechanicSerializer, MechanicListSerializer
from apps.api.views.helpers import BaseGameView, BaseExpansionsView, BaseListView, BaseDetailView
class MechanicListView(BaseListView):
"""
Get list of me... | bsd-3-clause |
cxxgtxy/tensorflow | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | 64 | 10410 | # 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 |
wavelets/hebel | hebel/parameter_updaters.py | 3 | 3771 | # Copyright (C) 2013 Hannes Bretschneider
# 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 distribut... | gpl-2.0 |
IndianHillsLawrence/saferoutes2school | simple.py | 1 | 34186 | import psycopg2
import pprint
conn = psycopg2.connect("dbname=indianhills user=mdupont")
import sys
#cur2 = conn.cursor()
#cur3 = conn.cursor()
def return_list(sql) :
cur = conn.cursor()
try :
cur.execute(sql)
except Exception as e:
print sql
print e
raise e
ret = []
... | agpl-3.0 |
HardLight/denyhosts | DenyHosts/constants.py | 2 | 1776 | import sys
#################################################################################
# These files will be created relative to prefs WORK_DIR #
#################################################################################
SECURE_LOG_OFFSET = "offset"
DENIED_TIMESTAMPS = "denied-time... | gpl-2.0 |
Thortoise/Super-Snake | Blender/animation_nodes-master/base_types/template.py | 1 | 3160 | import bpy
from bpy.props import *
from mathutils import Vector
from .. tree_info import getNodeByIdentifier
from .. nodes.system import subprogram_sockets
from .. utils.nodes import newNodeAtCursor, invokeTranslation
class Template:
bl_options = {"INTERNAL"}
nodeOffset = (0, 0)
menuWidth = 400
usedMe... | gpl-3.0 |
grimlor/OrlandoPythonUserGroup | multiprocess_demo.py | 1 | 3541 | __filename__ = 'multithread_demo.py'
__author__ = 'jwestover@sonobi.com'
import multiprocessing
import time
import random
class HelloWorld(object):
def __init__(self):
self.my_number = 1
self.my_number_2 = multiprocessing.Value('i', 1)
#self.lock = threading.Lock()
self.lock = mul... | apache-2.0 |
dorant/home-assistant | tests/components/test_device_sun_light_trigger.py | 16 | 3719 | """
tests.test_component_device_sun_light_trigger
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests device sun light trigger component.
"""
# pylint: disable=too-many-public-methods,protected-access
import os
import unittest
import homeassistant.loader as loader
from homeassistant.const import CONF_PLATFORM, STATE_HOME, STATE_NOT_HOM... | mit |
bourreauEric/or-tools | data/nonogram_regular/nonogram_car.py | 74 | 1201 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/twisted/python/util.py | 2 | 27425 | # -*- test-case-name: twisted.python.test.test_util -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import, print_function
import os, sys, errno, warnings
try:
import pwd, grp
except ImportError:
pwd = grp = None
try:
from os import set... | mit |
Tao4free/QGIS_plugins | SuperLabeling/ui.py | 2 | 5076 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SuperLabeling.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:
... | gpl-3.0 |
tersmitten/ansible | lib/ansible/modules/network/meraki/meraki_admin.py | 4 | 16712 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | gpl-3.0 |
geometalab/G4SE-Compass | compass-api/G4SE/api/views.py | 1 | 4673 | import logging
from collections import OrderedDict
import django_filters
from drf_haystack.filters import HaystackHighlightFilter
from drf_haystack.viewsets import HaystackViewSet
from haystack.query import SearchQuerySet
from rest_framework import filters
from rest_framework import permissions
from rest_framework imp... | mit |
kirca/OpenUpgrade | addons/crm_partner_assign/wizard/__init__.py | 389 | 1038 | # -*- 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 |
digetx/picasso-kernel | Documentation/target/tcm_mod_builder.py | 868 | 40692 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
appleseedhq/gaffer | python/GafferOSLTest/ModuleTest.py | 8 | 2380 | ##########################################################################
#
# Copyright (c) 2014, John Haddon. 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 so... | bsd-3-clause |
YarivCol/mbed-os | tools/targets/lint.py | 12 | 10093 | """A linting utility for targets.json
This linting utility may be called as follows:
python <path-to>/lint.py targets TARGET [TARGET ...]
all targets will be linted
"""
# mbed SDK
# Copyright (c) 2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | apache-2.0 |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/lib2to3/main.py | 30 | 11638 | """
Main program for 2to3.
"""
from __future__ import with_statement, print_function
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
... | mit |
tensorflow/probability | tensorflow_probability/python/experimental/distributions/__init__.py | 1 | 1702 | # Copyright 2020 The TensorFlow Probability 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 applicable law o... | apache-2.0 |
Distrotech/intellij-community | python/lib/Lib/compiler/future.py | 93 | 1839 | """Parser for future statements
"""
from compiler import ast, walk
def is_future(stmt):
"""Return true if statement is a well-formed future statement"""
if not isinstance(stmt, ast.From):
return 0
if stmt.modname == "__future__":
return 1
else:
return 0
class FutureParser:
... | apache-2.0 |
meteorcloudy/tensorflow | tensorflow/examples/adding_an_op/zero_out_3_test.py | 110 | 1805 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ModdedPA/android_external_chromium_org | media/tools/constrained_network_server/traffic_control.py | 186 | 12569 | # 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.
"""Traffic control library for constraining the network configuration on a port.
The traffic controller sets up a constrained network configuration on a... | bsd-3-clause |
ezietsman/msc-thesis | images/august_phot/S7651/trailed_phot_FT.py | 1 | 1842 | # script to calculate trailed FT of the lightcurve
import astronomy as ast
import pylab as pl
import scipy.stats as sci
X = pl.load('S7651_FF_norm.dat')
x = X[:,0]
y = X[:,1]
z = X[:,2]
N = len(x)
fitlength = 100
#x -= int(x[0])
# ephemeris
T0 = 2453964.3307097
P = 0.1545255
#x = (x - T0) / P
ft = []
date = []
pe... | mit |
etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/pip/_vendor/distlib/database.py | 26 | 51059 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | gpl-3.0 |
citrix-openstack-build/ironic | ironic/openstack/common/rpc/dispatcher.py | 1 | 7038 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
#... | apache-2.0 |
bitcraft/tailor | apps/service/session.py | 1 | 7880 | # -*- coding: utf-8 -*-
"""
countdown between images
submits tasks to be processed by mp queue
"""
import asyncio
import logging
import os
import re
import sys
import threading
import traceback
from io import BytesIO
from os.path import join
import pygame
import requests
from PIL import Image
from apps.service.asyn... | gpl-3.0 |
danieljaouen/ansible | test/units/modules/network/f5/test_bigiq_application_http.py | 21 | 5443 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip i... | gpl-3.0 |
abusesa/abusehelper | abusehelper/core/roomgraph.py | 1 | 9190 | from __future__ import absolute_import
import os
import sys
import errno
import struct
import cPickle
import idiokit
import subprocess
import contextlib
import socket as native_socket
from idiokit import socket, select
from . import events, rules, taskfarm, bot
class _ConnectionLost(Exception):
pass
@contextli... | mit |
wfxiang08/django185 | django/contrib/gis/geos/prototypes/io.py | 103 | 9413 | import threading
from ctypes import POINTER, Structure, byref, c_char, c_char_p, c_int, c_size_t
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_sized_string, check_string,
)
from djan... | bsd-3-clause |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/trial/test/test_testcase.py | 59 | 2043 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Direct unit tests for L{twisted.trial.unittest.SynchronousTestCase} and
L{twisted.trial.unittest.TestCase}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import SynchronousTestCase, TestCase
class TestCas... | gpl-3.0 |
defzzd/UserDataBase-Heroku | venv/Lib/site-packages/pip/_vendor/distlib/locators.py | 191 | 46946 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | mit |
fr34k8/paimei | console/modules/_PAIMEIexplorer/PIDAModulesListCtrl.py | 6 | 6655 | #
# PaiMei
# Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com>
#
# $Id: PIDAModulesListCtrl.py 194 2007-04-05 15:31:53Z cameron $
#
# 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; ei... | gpl-2.0 |
sencha/chromium-spacewalk | tools/deep_memory_profiler/lib/pageframe.py | 123 | 4340 | # Copyright 2013 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.
import logging
import os
import re
import struct
LOGGER = logging.getLogger('dmprof')
class PageFrame(object):
"""Represents a pageframe and maybe its ... | bsd-3-clause |
geminateCoder/Character-Archive-Website | Lib/site-packages/cffi/model.py | 43 | 21110 | import types, sys
import weakref
from .lock import allocate_lock
# type qualifiers
Q_CONST = 0x01
Q_RESTRICT = 0x02
Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
if quals & Q_VOLATILE:
replace_with = ' volatile ' +... | cc0-1.0 |
ParuninPavel/lenta4_hack | config/settings/test.py | 1 | 1941 | """
Test settings for lentach project.
- Used to run tests fast on the continuous integration server and locally
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
# Turn debug off so tests run faster
DEBUG = False
TEMPLATES[0]['OPTIONS']['debug'... | mit |
cesargtz/YecoraOdoo | openerp/addons/test_impex/tests/test_load.py | 350 | 44525 | # -*- coding: utf-8 -*-
import json
import pkgutil
import unittest2
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def message(msg, type='error', from_=0, to_=0, record=0, field='value', **kwargs):
return dict(kwargs,
typ... | agpl-3.0 |
jesramirez/odoo | addons/website_crm/controllers/main.py | 10 | 5500 | # -*- coding: utf-8 -*-
import base64
import werkzeug
import werkzeug.urls
from openerp import http, SUPERUSER_ID
from openerp.http import request
from openerp.tools.translate import _
class contactus(http.Controller):
def generate_google_map_url(self, street, city, city_zip, country_name):
url = "http... | agpl-3.0 |
hfeeki/transifex | transifex/languages/migrations/0003_changed_rules_equations.py | 3 | 20958 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.core.management import call_command
from django.db import models
class Migration(DataMigration):
depends_on = (
('resources', '0009_added_translation_wordcount',),
)
def forwards(self, orm):
... | gpl-2.0 |
doot/CouchPotatoServer | libs/rsa/util.py | 115 | 2817 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 |
adblockplus/gyp | test/win/gyptest-link-fixed-base.py | 344 | 1099 | #!/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.
"""
Make sure fixed base setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGy... | bsd-3-clause |
vFense/vFenseAgent-nix | agent/deps/rpm-32/Python-2.7.5/lib/python2.7/distutils/tests/test_build.py | 141 | 1924 | """Tests for distutils.command.build."""
import unittest
import os
import sys
from test.test_support import run_unittest
from distutils.command.build import build
from distutils.tests import support
from sysconfig import get_platform
class BuildTestCase(support.TempdirManager,
support.LoggingSilen... | lgpl-3.0 |
yuvipanda/kubernetes | cluster/juju/charms/trusty/kubernetes-master/unit_tests/test_install.py | 145 | 4106 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
mitsuhiko/zine | zine/feeds.py | 1 | 19421 | """
Syndication feed generation library -- used for generating RSS, etc.
Implementation lifted from Django and modified to remove Djano
dependencies.
For definitions of the different versions of RSS, see:
http://diveintomark.org/archives/2004/02/04/incompatible-rss
"""
import types
import datetime
import urllib
impor... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.