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 |
|---|---|---|---|---|---|
tseaver/google-cloud-python | dataproc/noxfile.py | 27 | 5051 | # -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
tjlaboss/openmc | openmc/model/funcs.py | 2 | 20791 | from collections.abc import Iterable
from functools import partial
from math import sqrt
from numbers import Real
from operator import attrgetter
from warnings import warn
from openmc import (
XPlane, YPlane, Plane, ZCylinder, Cylinder, XCylinder,
YCylinder, Universe, Cell)
from ..checkvalue import (
check... | mit |
mrgambal/vulyk | vulyk/models/tasks.py | 1 | 6601 | # -*- coding: utf-8 -*-
"""Module contains all models directly related to the main entity - tasks."""
from collections import namedtuple
from typing import Any, Dict, List
from bson import ObjectId
from flask_mongoengine import Document
from mongoengine import (
BooleanField,
CASCADE,
DateTimeField,
Di... | bsd-3-clause |
tima/ansible | lib/ansible/modules/cloud/amazon/route53_facts.py | 39 | 12906 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
rawwell/django | django/core/management/commands/testserver.py | 5 | 1662 | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--verbosity', action='store', dest='verbosity', default='1',
type='choice', choices=['0', '1', '2'],
help='Verbosi... | bsd-3-clause |
Yellowen/Owrang | stock/doctype/stock_entry/stock_entry.py | 1 | 35585 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
from webnotes.utils import cstr, cint, flt, comma_or, nowdate
from webnotes.model.doc import Document, addchild
from webnote... | agpl-3.0 |
halberom/ansible | contrib/inventory/brook.py | 48 | 9483 | #!/usr/bin/env python
# Copyright 2016 Doalitic.
#
# 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 ve... | gpl-3.0 |
koalalorenzo/greatdiary | main.py | 1 | 15891 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import gtk
import webkit
import gobject
import xml.dom.minidom
from xml.dom.minidom import Node
import time
import os
import sys
import crypt, random, string
import libcrypt
from sqlite3 import dbapi2 as sqlite
gobject.threads_init()
def dialog_info(info):
"""
... | gpl-3.0 |
Sebastian-ba/DoDoBing | red-scare/src/test_output.py | 1 | 1050 |
from main import *
def test_output_1():
print()
res = output("Testfile", 43, True, 3,2,1, False, False)
res1 = output("Testfile", 43, True, 3,2,1, False, False)
res2 = output("Testfile", 43, True, 3,2,1, False, False)
res3 = output("Testfile", 43, True, 3,2,1, False, False)
res4 = ... | mit |
msmolens/VTK | ThirdParty/AutobahnPython/autobahn/twisted/wamp.py | 16 | 15991 | ###############################################################################
##
## Copyright (C) 2014 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:/... | bsd-3-clause |
Nowheresly/account-financial-tools | account_compute_tax_amount/account_move_line.py | 36 | 2323 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013-2014 Camptocamp (http://www.camptocamp.com)
#
# Author : Vincent Renaville (Camptocamp)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
DiamondLightSource/auto_tomo_calibration-experimental | old_code_scripts/simulate_data/lmfit-py/lmfit/_version.py | 4 | 7599 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just conta... | apache-2.0 |
ckirby/django | tests/template_tests/syntax_tests/test_width_ratio.py | 342 | 6095 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils import six
from ..utils import setup
class WidthRatioTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'widthratio01': '{% widthratio a b 0 %}'})
def test... | bsd-3-clause |
jfpla/PyChart | pychart/error_bar.py | 12 | 5184 | #
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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, or (at your option) any
# later version.
#
# Jockey is distr... | gpl-2.0 |
chozabu/p4a-ctypes | src/buildlib/jinja2.egg/jinja2/debug.py | 212 | 9931 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | lgpl-2.1 |
egh/spydaap | spydaap/parser/vorbis.py | 1 | 3664 | # Copyright (C) 2008 Erik Hetzner
# This file is part of Spydaap. Spydaap 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.
# Spydaap i... | gpl-3.0 |
vitaly4uk/django | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | 1795 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... | bsd-3-clause |
leighpauls/k2cro4 | third_party/python_26/Tools/scripts/untabify.py | 56 | 1185 | #! /usr/bin/env python
"Replace tabs with spaces in argument files. Print names of changed files."
import os
import sys
import getopt
def main():
tabsize = 8
try:
opts, args = getopt.getopt(sys.argv[1:], "t:")
if not args:
raise getopt.error, "At least one file argument required"... | bsd-3-clause |
ThiagoGarciaAlves/libgdx | extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/glnames.py | 360 | 105239 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | apache-2.0 |
Big-B702/python-for-android | python-modules/twisted/twisted/runner/procmon.py | 49 | 10916 | # -*- test-case-name: twisted.runner.test.test_procmon -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for starting, monitoring, and restarting child process.
"""
import warnings
from twisted.python import log
from twisted.internet import error, protocol, reactor as _... | apache-2.0 |
BillClyde/safenetfs | safenet/api/directory.py | 1 | 4211 | import safenet.api
import requests
import json
from StringIO import StringIO
import base64
__author__ = "William Clyde"
__copyright__ = "Copyright 2016, William Clyde"
__license__ = "MIT"
class Directory:
"""Directory management"""
def __init__(self):
"""__init__"""
self.headers = {'content-... | mit |
OwlHex/OwlNet | vendor/psy/psysh/test/tools/gen_unvis_fixtures.py | 536 | 3120 | #! /usr/bin/env python3
import sys
from os.path import abspath, expanduser, dirname, join
from itertools import chain
import json
import argparse
from vis import vis, unvis, VIS_WHITE
__dir__ = dirname(abspath(__file__))
OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json')
# Add custom fixtures her... | agpl-3.0 |
dongritengfei/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py | 115 | 28246 | # Copyright (C) 2012 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 |
stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/states/ssh_known_hosts.py | 1 | 7898 | # -*- coding: utf-8 -*-
'''
Control of SSH known_hosts entries
==================================
Manage the information stored in the known_hosts files.
.. code-block:: yaml
github.com:
ssh_known_hosts:
- present
- user: root
- fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df... | apache-2.0 |
2947721120/sagacious-capsicum | src/tests/ggrc/json/test_common.py | 4 | 3305 |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By:
# Maintained By:
import ggrc.builder
import ggrc.models
from ggrc.builder.json import publish
from ggrc.services.common import Resource
from mock ... | apache-2.0 |
vbannai/neutron | neutron/plugins/nuage/nuage_models.py | 4 | 3812 | # Copyright 2014 Alcatel-Lucent USA 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 r... | apache-2.0 |
Zhongqilong/mykbengineer | kbe/res/scripts/common/Lib/encodings/cp1251.py | 272 | 13361 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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,in... | lgpl-3.0 |
codilime/cloudify-system-tests | cosmo_tester/test_suites/test_security/auth_test_base.py | 1 | 22487 | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | apache-2.0 |
CristianoRC/CristianoRC.Github.io | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | mit |
shuggiefisher/crowdstock | django/forms/extras/widgets.py | 156 | 5157 | """
Extra HTML Widget classes
"""
import time
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
from django.conf import setting... | bsd-3-clause |
LeJay/android_kernel_samsung_jactivelte | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
lilydjwg/xmpptalk | main.py | 1 | 16436 | #!/usr/bin/env python3
# vim:fileencoding=utf-8
#
# (C) Copyright 2012 lilydjwg <lilydjwg@gmail.com>
#
# This file is part of xmpptalk.
#
# xmpptalk 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 versi... | gpl-3.0 |
macarthur-lab/xbrowse | xbrowse_server/base/management/commands/get_lof_variants.py | 1 | 4504 | from collections import defaultdict
import csv
from django.core.management.base import BaseCommand
import elasticsearch
import elasticsearch_dsl
import json
import settings
from seqr.models import Individual
from seqr.views.utils.orm_to_json_utils import _get_json_for_individuals
from xbrowse_server.base.models import... | agpl-3.0 |
nephics/tornado | tornado/auth.py | 16 | 59831 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
shadanan/hevante-points | src/requests/packages/urllib3/util/response.py | 316 | 2343 | from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check `i... | mit |
sosreport/sos | plugins_overview.py | 3 | 4946 | # this script generates for each plugin:
# - its name
# - URL to upstream code
# - list of distros
# - list of profiles
# - list of packages that enable the plugin (no other enabling pieces)
# - list of paths it collects (add_copy_spec)
# - list of paths it forbits to collect (add_forbidden_path)
# - list of commands i... | gpl-2.0 |
coala-analyzer/coala-quickstart | coala_quickstart/generation/FileGlobs.py | 1 | 2475 | import os
from coalib.parsing.Globbing import glob_escape
from coala_quickstart.generation.Utilities import get_gitignore_glob
from coala_utils.Question import ask_question
from coala_quickstart.Strings import GLOB_HELP
from coalib.collecting.Collectors import collect_files
def get_project_files(log_printer,
... | agpl-3.0 |
shishir-a412ed/docker-py | docker/utils/types.py | 43 | 2304 | import six
class LogConfigTypesEnum(object):
_values = (
'json-file',
'syslog',
'journald',
'gelf',
'fluentd',
'none'
)
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, NONE = _values
class DictType(dict):
def __init__(self, init):
for k, v in six.iterit... | apache-2.0 |
VasuAgrawal/tartanHacks2015 | site/flask/lib/python2.7/site-packages/openid/store/sqlstore.py | 154 | 17190 | """
This module contains C{L{OpenIDStore}} implementations that use
various SQL databases to back them.
Example of how to initialize a store database::
python -c 'from openid.store import sqlstore; import pysqlite2.dbapi2; sqlstore.SQLiteStore(pysqlite2.dbapi2.connect("cstore.db")).createTables()'
"""
import re
i... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/dateutil/tzwin.py | 227 | 5737 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import winreg
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"
TZLOC... | agpl-3.0 |
brandondrew/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/mwcc.py | 61 | 6894 | """SCons.Tool.mwcc
Tool-specific initialization for the Metrowerks CodeWarrior compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,... | apache-2.0 |
mkhutornenko/incubator-aurora | src/main/python/apache/thermos/common/options.py | 14 | 1755 | #
# 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 ... | apache-2.0 |
hmit/livestreamer | src/livestreamer/packages/pbs.py | 37 | 14321 | #===============================================================================
# Copyright (C) 2011-2012 by Andrew Moffat
#
# 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 restricti... | bsd-2-clause |
tehasdf/AdventOfCode2016 | p4.py | 1 | 1371 | from collections import Counter
def split(name):
name, _, sector_checksum = name.strip().rpartition('-')
sector, _, checksum = sector_checksum.partition('[')
checksum = checksum[:-1]
return name, int(sector), checksum
def real(name, checksum):
letters = Counter(name.replace('-', ''))
return ... | mit |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtNetwork/QHttpMultiPart.py | 1 | 1266 | # encoding: utf-8
# module PyQt4.QtNetwork
# from /usr/lib/python3/dist-packages/PyQt4/QtNetwork.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QHttpMultiPart(__PyQt4_QtCore.QObject):
"""
QHttpMultiPart(QObject parent=None)
QHttpMultiPa... | gpl-2.0 |
JeroenZegers/Nabu-MSSS | nabu/processing/feature_computers/angspec.py | 1 | 1409 | """@file angspec.py
contains the angular spectrum feature computer"""
import numpy as np
import base
import feature_computer
from sigproc import snip
class Angspec(feature_computer.FeatureComputer):
"""the feature computer class to compute angular spectrum feature"""
def comp_feat(self, sig, rate):
... | mit |
Sushantgakhar/cookiecutter-django | tests/test_cookiecutter_substitution.py | 19 | 1072 | from __future__ import absolute_import
import sh
from .base import DjangoCookieTestCase
class TestCookiecutterSubstitution(DjangoCookieTestCase):
"""Test that all cookiecutter instances are substituted"""
def test_default_configuration(self):
# Build a list containing absolute paths to the generated... | bsd-3-clause |
andmos/ansible | lib/ansible/modules/network/fortios/fortios_antivirus_profile.py | 24 | 55015 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, 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 3 of the Lic... | gpl-3.0 |
freezmeinster/teh-manis | django/contrib/gis/measure.py | 398 | 12282 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | bsd-3-clause |
gkotton/neutron | neutron/tests/unit/nuage/fake_nuageclient.py | 11 | 9357 | # Copyright 2014 Alcatel-Lucent USA 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 l... | apache-2.0 |
HomeRad/TorCleaner | wc/update.py | 1 | 10807 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2009 Bastian Kleineidam
"""
Routines for updating filter and rating configuration.
"""
import os
import md5
from . import log, LOG_GUI, Name, Version, configuration
#XXXfrom filter.Rating import rating_cache_merge, rating_cache_parse
#
# urlutils.py - Simplified urll... | gpl-2.0 |
pablorecio/Cobaya | src/cobaya/config.py | 1 | 2598 | ###############################################################################
# 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 #
... | gpl-3.0 |
Sarah-Alsinan/muypicky | lib/python3.6/site-packages/PIL/SunImagePlugin.py | 7 | 4319 | #
# The Python Imaging Library.
# $Id$
#
# Sun image file handling
#
# History:
# 1995-09-10 fl Created
# 1996-05-28 fl Fixed 32-bit alignment
# 1998-12-29 fl Import ImagePalette module
# 2001-12-18 fl Fixed palette loading (from Jean-Claude Rimbault)
#
# Copyright (c) 1997-2001 by Secret Labs AB
# Copyright (c... | mit |
meabsence/python-for-android | python-modules/twisted/twisted/conch/client/knownhosts.py | 56 | 14196 | # -*- test-case-name: twisted.conch.test.test_knownhosts -*-
# Copyright (c) 2008-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An implementation of the OpenSSH known_hosts database.
@since: 8.2
"""
from binascii import Error as DecodeError, b2a_base64
import hmac
import sys
from zope.interface i... | apache-2.0 |
vmendez/DIRAC | AccountingSystem/Client/DataStoreClient.py | 10 | 4486 | # $HeadURL$
__RCSID__ = "$Id$"
import time, random, copy
from DIRAC import S_OK, S_ERROR, gLogger, gConfig
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.Core.Utilities.ThreadSafe import Synchronizer
from DIRAC.Core.Utilities import DEncode
from... | gpl-3.0 |
femmerling/DirMaker | box/lib/python2.7/site-packages/flask/testsuite/ext.py | 57 | 4720 | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from flask.testsuite import FlaskTestCase... | mit |
gandarez/wakatime | wakatime/packages/pygments_py2/pygments/styles/perldoc.py | 135 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | bsd-3-clause |
larsmans/scipy | tools/osx/install_and_test.py | 104 | 1245 | #!/usr/bin/env python
"""Install the built package and run the tests."""
import os
# FIXME: Should handle relative import better!
#from .build import DIST_DIR
from build import SRC_DIR, DIST_DIR, shellcmd
clrgreen = '\033[0;32m'
clrnull = '\033[0m'
# print '\033[0;32m foobar \033[0m'
def color_print(msg):
"""Add... | bsd-3-clause |
yd0str/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/treewalkers/_base.py | 436 | 7014 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE... | gpl-3.0 |
adrienbrault/home-assistant | homeassistant/components/zwave/light.py | 5 | 13288 | """Support for Z-Wave lights."""
import logging
from threading import Timer
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_TRA... | mit |
garnertb/rogue_geonode | geoshape/firestation/migrations/0018_auto__add_field_firedepartment_region.py | 2 | 11581 | # -*- 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):
# Adding field 'FireDepartment.region'
db.add_column(u'firestation_firede... | gpl-3.0 |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/pip/commands/hash.py | 514 | 1597 | from __future__ import absolute_import
import hashlib
import logging
import sys
from pip.basecommand import Command
from pip.status_codes import ERROR
from pip.utils import read_chunks
from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
class HashCommand(Command):
""... | apache-2.0 |
varunkamra/kuma | vendor/packages/pygments/styles/friendly.py | 135 | 2515 | # -*- coding: utf-8 -*-
"""
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyw... | mpl-2.0 |
endocode/linux | Documentation/target/tcm_mod_builder.py | 497 | 22865 | #!/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 |
CubicERP/odoo | addons/website_forum/models/forum.py | 233 | 38491 | # -*- coding: utf-8 -*-
from datetime import datetime
import uuid
from werkzeug.exceptions import Forbidden
import logging
import openerp
from openerp import api, tools
from openerp import SUPERUSER_ID
from openerp.addons.website.models.website import slug
from openerp.exceptions import Warning
from openerp.osv impo... | agpl-3.0 |
pattisdr/osf.io | osf/management/commands/update_bepress_version.py | 11 | 4820 | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from scripts import utils as script_utils
from osf.models import PreprintProvider, Subject
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__... | apache-2.0 |
drblez/dynamodb-transaction-manager | dynamodb2/constructor.py | 1 | 6099 | from datetime import datetime
import decimal
__author__ = 'drblez'
"""
Field('f1', 'value1').field('f2', 'value2').field('f3', 42).field('f4', ['a', 'b', 'c']).field('f5', [1, 2, 3]).dict
{
'f1': {'S': 'value1'),
'f2': {'S': 'value2'},
'f3': {'N': '42'},
'f4': {'SS': ['a', 'b... | gpl-3.0 |
arcturusannamalai/Ezhil-Lang | ezhil/ezhil_transforms.py | 2 | 7334 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
## (C) 2015 Muthiah Annamalai
## Licensed under GPL Version 3
##
## Interpreter for Ezhil language
from __future__ import print_function
import sys
PYTHON3 = (sys.version[0] == '3')
if PYTHON3:
unicode = str
## Tx
from .transform import Visitor, TransformVisitor
from .... | gpl-3.0 |
heeraj123/oh-mainline | vendor/packages/celery/celery/backends/base.py | 18 | 14790 | # -*- coding: utf-8 -*-
"""celery.backends.base"""
from __future__ import absolute_import
import time
import sys
from datetime import timedelta
from kombu import serialization
from .. import states
from ..datastructures import LRUCache
from ..exceptions import TimeoutError, TaskRevokedError
from ..utils import time... | agpl-3.0 |
tpoy0099/option_calculator | gui_impl/position_editor.py | 1 | 4509 | #coding=utf8
from qt_ui.ui_position_editor import Ui_position_editor_dialog
from gui_impl.qt_mvc_impl import MatrixModel, AutoFormDelegate
from gui_impl.qtableview_utility import getSelectedRows
from utility.data_handler import TableHandler
from PyQt4.QtCore import *
from PyQt4.QtGui import *
########################... | gpl-2.0 |
prutseltje/ansible | lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py | 23 | 16768 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version':... | gpl-3.0 |
ezekial4/atomic_neu | atomic/tests/test_atomic_data.py | 1 | 4985 | import unittest
import numpy as np
import atomic_neu as atomic
class TestAtomicData(unittest.TestCase):
def test_element_data_names_abbreviated_and_long(self):
"""This does not require that the user has downloaded data"""
data1 = atomic.atomic_data._element_data('Li')
data2 = atomic.atomic_... | mit |
nasa-gibs/onearth | src/empty_tile/oe_generate_empty_tile.py | 1 | 11279 | #!/usr/bin/env python3
# Copyright (c) 2002-2017, California Institute of Technology.
# All rights reserved. Based on Government Sponsored Research under contracts NAS7-1407 and/or NAS7-03001.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followi... | apache-2.0 |
LearnEra/LearnEraPlaftform | common/lib/xmodule/xmodule/modulestore/tests/test_publish.py | 1 | 7315 | """
Test the publish code (mostly testing that publishing doesn't result in orphans)
"""
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.test_split_w_old_mongo import SplitWMongoCourseBoostrapper
from xmodule.modulestore.tests.factories import check_mongo_calls
from xmodule.m... | agpl-3.0 |
calvinleenyc/zulip | zerver/tests/webhooks/test_yo.py | 6 | 1122 | # -*- coding: utf-8 -*-
from six import text_type
from typing import Any, Dict
from zerver.lib.test_classes import WebhookTestCase
class YoHookTests(WebhookTestCase):
STREAM_NAME = 'yo'
URL_TEMPLATE = u"/api/v1/external/yo?email={email}&api_key={api_key}&username={username}&user_ip={ip}"
FIXTURE_DIR_NAME =... | apache-2.0 |
eek6/squeakspace | lib/squeakspace/common/util_http.py | 1 | 14648 |
import urlparse
import json
import Cookie
import squeakspace.common.squeak_ex as ex
def json_fun(object):
#return json.dumps(object)
return json.dumps(object, indent=4) + '\n'
def respond(environ, start_response, status, content, response_headers=None):
if response_headers == None:
response_hea... | gpl-3.0 |
mrtommyb/K2fov | K2fov/tests/test_rotate2.py | 2 | 4573 |
import numpy as np
import unittest
from .. import rotate2 as r
#$Id: test_rotate2.py 28 2013-12-02 04:34:57Z fergalm $
#$URL: svn+ssh://fergalm@svn.code.sf.net/p/keplertwowheel/code/py/test/test_rotate2.py $
class TestSingleRotation(unittest.TestCase):
def testXAroundZ(self):
for deg in np.arange(0, 360... | mit |
hajicj/safire | build/lib/test/test_utils.py | 1 | 6748 | """
Testing the utility functions.
"""
import gzip
import logging
import math
import os
import unittest
import gensim
from gensim.models import TfidfModel
import operator
from safire.data import VTextCorpus, FrequencyBasedTransformer
from safire.data.filters.positionaltagfilter import PositionalTagTokenFilter
from s... | gpl-3.0 |
T3kton/subcontractor | subcontractor/credentials.py | 1 | 1841 | import json
import ssl
from urllib import request
VAULT_TIMEOUT = 20
_handler = None
def getCredentials( value ):
if value is None:
return None
return _handler.get( value )
def setup( config ):
global _handler
vault_type = config.get( 'credentials', 'type', fallback=None )
if not vault_type: # ... | apache-2.0 |
deroneriksson/systemml | src/main/python/pre_setup.py | 14 | 2047 | #-------------------------------------------------------------
#
# 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 |
ronas/PythonGNF | Igor/Tabuada.py | 1 | 1262 | '''
numero = int(input("Número para a tabuada: "))
for multiplicador in range(1,11):
print (numero,"x",multiplicador,"=",(numero*multiplicador))
'''
#
# Calculo de Horas trabalhadas.
# Autor: Igor Nunes
# Materia: Programa Python
# Orientador: Ronaldo
# Aula de total de horas trabalhadas
#
#Leitur... | gpl-3.0 |
shakamunyi/nova | nova/api/openstack/compute/schemas/v3/cloudpipe.py | 8 | 1645 | # Copyright 2014 IBM Corporation. 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 ... | apache-2.0 |
appsembler/edx-platform | lms/djangoapps/commerce/tests/__init__.py | 20 | 3149 | # -*- coding: utf-8 -*-
""" Commerce app tests package. """
import httpretty
import mock
from django.conf import settings
from django.test import TestCase
from freezegun import freeze_time
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
from openedx.core.lib.token_utils import JwtBuilder
from ... | agpl-3.0 |
vivek-bala/radical.entk | tests/test_task.py | 2 | 1685 | from radical.entk import Task
from radical.entk import states
from radical.entk.exceptions import *
import pytest
def test_attribute_types():
t = Task()
assert type(t.name) == str
assert type(t.state) == str
assert type(t.pre_exec) == list
assert type(t.executable) == list
assert type(t.argum... | mit |
varuntiwari27/rally | rally/plugins/openstack/scenarios/nova/flavors.py | 3 | 2997 | # Copyright 2015: Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium/testing/gtest/test/gtest_xml_outfiles_test.py | 718 | 5312 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
petrutlucian94/nova_dev | nova/scheduler/rpcapi.py | 3 | 5301 | # Copyright 2013, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
pchauncey/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option.py | 31 | 14953 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
embeddedarm/linux-vanilla-imx6 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 1891 | 3300 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
jhawkesworth/ansible | test/runner/lib/sanity/__init__.py | 22 | 11139 | """Execute Ansible sanity tests."""
from __future__ import absolute_import, print_function
import abc
import glob
import json
import os
import re
import sys
from lib.util import (
ApplicationError,
SubprocessError,
display,
run_command,
import_plugins,
load_plugins,
parse_to_list_of_dict,
... | gpl-3.0 |
svn2github/gyp | pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | bsd-3-clause |
duramato/SickRage | lib/github/HookDescription.py | 73 | 3481 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
Sancus/bedrock | bedrock/releasenotes/views.py | 2 | 9810 | # 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 re
from django.conf import settings
from django.db.models import Q
from django.http import Http404, HttpResponseR... | mpl-2.0 |
gs0510/coala-bears | bears/general/QuotesBear.py | 23 | 3280 | from coalib.bears.LocalBear import LocalBear
from bears.general.AnnotationBear import AnnotationBear
from coalib.results.Diff import Diff
from coalib.results.HiddenResult import HiddenResult
from coalib.results.Result import Result
class QuotesBear(LocalBear):
BEAR_DEPS = {AnnotationBear}
AUTHORS = {'The coa... | agpl-3.0 |
rakeshjsr/rakesh | contrib/svn-fe/svnrdump_sim.py | 328 | 2044 | #!/usr/bin/python
"""
Simulates svnrdump by replaying an existing dump from a file, taking care
of the specified revision range.
To simulate incremental imports the environment variable SVNRMAX can be set
to the highest revision that should be available.
"""
import sys
import os
if sys.hexversion < 0x02040000:
# T... | gpl-2.0 |
jblackburne/scikit-learn | doc/sphinxext/sphinx_gallery/notebook.py | 9 | 3565 | # -*- coding: utf-8 -*-
r"""
============================
Parser for Jupyter notebooks
============================
Class that holds the Ipython notebook information
"""
# Author: Óscar Nájera
# License: 3-clause BSD
from __future__ import division, absolute_import, print_function
import json
import os
import re
imp... | bsd-3-clause |
huanchenz/STX-h-store | third_party/python/boto/contrib/m2helpers.py | 39 | 2295 | # Copyright (c) 2006,2007 Jon Colverson
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, ... | gpl-3.0 |
IndonesiaX/edx-platform | openedx/core/lib/api/tests/test_permissions.py | 19 | 3006 | """ Tests for API permissions classes. """
import ddt
from django.test import TestCase, RequestFactory
from openedx.core.lib.api.permissions import IsStaffOrOwner
from student.tests.factories import UserFactory
class TestObject(object):
""" Fake class for object permission tests. """
user = None
@ddt.ddt
... | agpl-3.0 |
MatthewWilkes/reportlab | tools/pythonpoint/styles/projection.py | 24 | 3214 | """This is an example style sheet. You can create your own, and
have them loaded by the presentation. A style sheet is just a
dictionary, where they keys are style names and the values are
ParagraphStyle objects.
You must provide a function called "getParagraphStyles()" to
return it. In future, we can put things li... | bsd-3-clause |
rob356/SickRage | lib/bs4/builder/__init__.py | 447 | 11151 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.