repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
andybondar/CloudFerry | tests/cloudferrylib/utils/test_file_utils.py | 1 | 1874 | # Copyright 2015 Mirantis 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 agreed to in writing,... | apache-2.0 |
lorimccurry/python_koans | python3/koans/about_true_and_false.py | 13 | 1506 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTrueAndFalse(Koan):
def truth_value(self, condition):
if condition:
return 'true stuff'
else:
return 'false stuff'
def test_true_is_treated_as_true(self):
self.assertEqual('true ... | mit |
lcrees/tabola | tabola/core.py | 1 | 6504 | '''tabola'''
from tabola.formats import FORMATS as formats
class InvalidDatasetType(Exception):
'''Only Datasets can be added to a DataBook.'''
class InvalidDimensions(Exception):
'''Invalid size.'''
class UnsupportedFormat(NotImplementedError):
'''Format is not supported'''
class Dataset(object... | mit |
ayesandarmoe/microblog_flask_tutorial | flask/lib/python2.7/site-packages/flask_wtf/recaptcha/validators.py | 91 | 2398 | try:
import urllib2 as http
except ImportError:
# Python 3
from urllib import request as http
from flask import request, current_app
from wtforms import ValidationError
from werkzeug import url_encode
from .._compat import to_bytes, to_unicode
import json
RECAPTCHA_VERIFY_SERVER = 'https://www.google.com/... | gpl-2.0 |
qenter/vlc-android | toolchains/arm/lib/python2.7/test/pickletester.py | 36 | 41622 | import unittest
import pickle
import cPickle
import StringIO
import cStringIO
import pickletools
import copy_reg
from test.test_support import TestFailed, verbose, have_unicode, TESTFN
try:
from test.test_support import _2G, _1M, precisionbigmemtest
except ImportError:
# this import might fail when run on olde... | gpl-2.0 |
Snuzzo/vigor_aosp_kernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
eeshangarg/oh-mainline | vendor/packages/scrapy/scrapy/utils/conf.py | 40 | 2132 | import sys
import os
from ConfigParser import SafeConfigParser
from operator import itemgetter
def build_component_list(base, custom):
"""Compose a component list based on a custom and base dict of components
(typically middlewares or extensions), unless custom is already a list, in
which case it's returne... | agpl-3.0 |
alikins/ansible | lib/ansible/modules/network/aci/aci_interface_policy_fc.py | 5 | 3812 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
IsCoolEntertainment/debpkg_python-boto | tests/db/test_lists.py | 136 | 3474 | # Copyright (c) 2010 Chris Moyer http://coredumped.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
# without limitation the rights to use, copy, modify, ... | mit |
jmehnle/ansible | lib/ansible/modules/network/netvisor/pn_trunk.py | 59 | 13979 | #!/usr/bin/python
""" PN CLI trunk-create/trunk-delete/trunk-modify """
#
# 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 y... | gpl-3.0 |
ganjafuzz/PureKernel-v2-CAF | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
KyleAMoore/KanjiNani | Android/.buildozer/android/platform/build/build/python-installs/KanjiNani/kivy/animation.py | 9 | 24508 | '''
Animation
=========
:class:`Animation` and :class:`AnimationTransition` are used to animate
:class:`~kivy.uix.widget.Widget` properties. You must specify at least a
property name and target value. To use an Animation, follow these steps:
* Setup an Animation object
* Use the Animation object on a Widget
... | gpl-3.0 |
Cadasta/cadasta-platform | cadasta/questionnaires/migrations/0017_populate_additional_fields.py | 1 | 3046 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-23 09:04
from __future__ import unicode_literals
from django.db import migrations
from pyxform.xls2json import parse_file_to_json
from botocore.exceptions import ClientError
def populate_additional_fields(apps, schema_editor):
Project = apps.get_mod... | agpl-3.0 |
EricSekyere/airmozilla | airmozilla/base/helpers.py | 6 | 1916 | import jinja2
from jingo import register
from django.contrib.sites.models import RequestSite
from django.utils.http import urlquote
from funfactory.helpers import static
@register.function
@jinja2.contextfunction
def abs_static(context, path):
"""Make sure we always return a FULL absolute URL that starts
wi... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/readwrite/nx_yaml.py | 6 | 2576 | """
****
YAML
****
Read and write NetworkX graphs in YAML format.
"YAML is a data serialization format designed for human readability
and interaction with scripting languages."
See http://www.yaml.org for documentation.
Format
------
http://pyyaml.org/wiki/PyYAML
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"... | gpl-3.0 |
annarev/tensorflow | tensorflow/python/autograph/impl/conversion_test.py | 14 | 4103 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
pquentin/django | tests/template_tests/filter_tests/test_date.py | 207 | 2534 | from datetime import datetime, time
from django.template.defaultfilters import date
from django.test import SimpleTestCase
from django.utils import timezone
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class DateTests(TimezoneTestCase):
@setup({'date01': '{{ d|date:"m" }}'})
def t... | bsd-3-clause |
gaboflowers/mallador_v3 | unidecode/x062.py | 252 | 4620 | data = (
'Lian ', # 0x00
'Nan ', # 0x01
'Mi ', # 0x02
'Tang ', # 0x03
'Jue ', # 0x04
'Gang ', # 0x05
'Gang ', # 0x06
'Gang ', # 0x07
'Ge ', # 0x08
'Yue ', # 0x09
'Wu ', # 0x0a
'Jian ', # 0x0b
'Xu ', # 0x0c
'Shu ', # 0x0d
'Rong ', # 0x0e
'Xi ', # 0x0f
'Cheng ', # 0x10
'... | gpl-3.0 |
robk5uj/invenio | modules/bibrank/lib/bibrank_regression_tests.py | 8 | 7969 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## ... | gpl-2.0 |
victorzhao/miniblink49 | third_party/ply/lex.py | 482 | 40739 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | gpl-3.0 |
waterponey/scikit-learn | benchmarks/bench_plot_parallel_pairwise.py | 127 | 1270 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import matplotlib.pyplot as plt
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def plot(func):
random_state = check_rand... | bsd-3-clause |
beblount/Steer-Clear-Backend-Web | env/Lib/encodings/cp1258.py | 593 | 13620 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.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... | mit |
VanirAOSP/kernel_oppo_n1 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
karan1276/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/dl.py | 107 | 4915 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"dl-in-p": "<p><dl><dt>text<dd>text</dl></p>",
"header-in-dt": "<dl><dt><header>text</header><dd>text</dl>",
"footer-in-dt": "<dl><dt><foot... | mpl-2.0 |
danielsunzhongyuan/my_leetcode_in_python | binary_tree_preorder_traversal_144.py | 1 | 1028 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def preorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
... | apache-2.0 |
poljeff/odoo | addons/account/wizard/account_vat.py | 378 | 2896 | # -*- 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 |
GauravButola/nereid-project | tag.py | 3 | 4787 | # -*- coding: utf-8 -*-
"""
tag
:copyright: (c) 2012-2014 by Openlabs Technologies & Consulting (P) Limited
:license: GPLv3, see LICENSE for more details.
"""
from nereid import (
request, login_required, url_for, redirect,
flash, jsonify, route
)
from trytond.model import ModelView, ModelSQL, fiel... | gpl-3.0 |
dsgouda/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Paging/fixtures/acceptancetestspaging/operations/paging_operations.py | 14 | 33608 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Elettronik/SickRage | lib/pgi/foreign/__init__.py | 19 | 1931 | # Copyright 2013 Christoph Reiter
#
# 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.
"""Foreign structs make it... | gpl-3.0 |
MihaiMoldovanu/ansible | lib/ansible/modules/cloud/google/gcp_url_map.py | 99 | 17159 | #!/usr/bin/python
# Copyright 2017 Google 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
stonekyx/binary | vendor/scons-local-2.3.4/SCons/CacheDir.py | 9 | 8083 | #
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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... | gpl-3.0 |
bsipocz/pyspeckit | pyspeckit/cubes/mapplot.py | 2 | 16597 | """
MapPlot
-------
Make plots of the cube and interactively connect them to spectrum plotting.
This is really an interactive component of the package; nothing in here is
meant for publication-quality plots, but more for user interactive analysis.
That said, the plotter makes use of `APLpy <https://github.com/aplpy/a... | mit |
2014c2g2/teamwork | exts/w2/static/Brython2.0.0-20140209-164925/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | gpl-2.0 |
jeremyh/agdc | src/waitForProjectUserQueueSlot.py | 4 | 4718 | #!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | bsd-3-clause |
vishnugonela/boto | tests/unit/ec2/test_blockdevicemapping.py | 111 | 6739 | from tests.compat import unittest
from boto.ec2.connection import EC2Connection
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
from tests.compat import OrderedDict
from tests.unit import AWSMockServiceTestCase
class BlockDeviceTypeTests(unittest.TestCase):
def setUp(self):
s... | mit |
wscullin/spack | var/spack/repos/builtin/packages/tmhmm/package.py | 3 | 2341 | ##############################################################################
# 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 |
smpanaro/sublime-rdio | sublime_rdio.py | 1 | 17869 | import sublime, sublime_plugin
from queue import Queue, Empty
import threading
import json
import time
from datetime import datetime
import random
from urllib.error import HTTPError
import sys
from Rdio.rdio import Rdio
ARTIST_TYPE = "artist"
ALBUM_TYPE = "album"
TRACK_TYPE = "track"
RDIO_ARTIST_TYPE = 'r'
RDIO_ALB... | mit |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_node.py | 16 | 16390 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | bsd-3-clause |
sbstp/streamlink | tests/test_plugin_tvplayer.py | 3 | 1093 | import unittest
from streamlink.plugins.tvplayer import TVPlayer
class TestPluginTVPlayer(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(TVPlayer.can_handle_url("http://tvplayer.com/watch/"))
self.assertTrue(TVPlayer.can_handle_url("http://www.tvplayer.c... | bsd-2-clause |
mbrukman/libcloud | docs/examples/compute/openstack/hpcloud.py | 61 | 1075 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
HPCLOUD_AUTH_URL_USWEST = \
'https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens'
HPCLOUD_AUTH_URL_USEAST = \
'https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens'
OpenStack = get_driver(Pro... | apache-2.0 |
Vishwanath17/words-battle | third_party/tools/upload.py | 4 | 86298 | #!/usr/bin/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 or ag... | bsd-3-clause |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/turtledemo/forest.py | 65 | 2988 | #!/usr/bin/env python3
""" turtlegraphics-example-suite:
tdemo_forest.py
Displays a 'forest' of 3 'breadth-first-trees'
similar to the one from example tree.
For further remarks see xtx_tree.py
This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See:
http://homepag... | apache-2.0 |
Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/xlsxwriter/chart_doughnut.py | 1 | 2721 | ###############################################################################
#
# ChartDoughnut - A class for writing the Excel XLSX Doughnut charts.
#
# Copyright 2013-2019, John McNamara, jmcnamara@cpan.org
#
from warnings import warn
from . import chart_pie
class ChartDoughnut(chart_pie.ChartPie):
"""
A... | gpl-3.0 |
ggiscan/Interactor | core/commons.py | 4 | 1384 | '''
Created on 4 Apr 2014
@author: geo
'''
from collections import namedtuple
import logging
error_type = namedtuple('error', ['code', 'message'])
(ERR_INVALID_PRODUCT,
WARN_ALREADY_REGISTERED,
WARN_EXISTING_CATEGORY,
ERR_USERNOTREGISTERED,
ERR_RETRY_LATER) = range(400,405)
ERROR_MESSAGES = {ERR_INVAL... | gpl-2.0 |
benhc123/cjdns | node_build/dependencies/libuv/build/gyp/test/mac/gyptest-postbuild-fail.py | 165 | 2190 | #!/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.
"""
Verifies that a failing postbuild step lets the build fail.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# set |match... | gpl-3.0 |
TheTincho/nemu | src/nemu/__init__.py | 1 | 2303 | # vim:ts=4:sw=4:et:ai:sts=4
# -*- coding: utf-8 -*-
# Copyright 2010, 2011 INRIA
# Copyright 2011 Martín Ferrari <martin.ferrari@gmail.com>
#
# This file is part of Nemu.
#
# Nemu is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2, as published by t... | gpl-2.0 |
deKupini/erp | addons/mass_mailing/models/mail_mail.py | 7 | 5375 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
holyglenn/bosen | app/dml/script/run_local.py | 13 | 2246 | #!/usr/bin/env python
"""
This script starts a process locally, using <client-id> <hostfile> as inputs.
"""
import os
from os.path import dirname
from os.path import join
import time
import sys
if len(sys.argv) != 3:
print "usage: %s <client-id> <hostfile>" % sys.argv[0]
sys.exit(1)
# Please set the FULL app di... | bsd-3-clause |
cathyyul/sumo-0.18 | docs/tutorial/output_parsing/runner.py | 4 | 1280 | #!/usr/bin/env python
"""
@file runner.py
@author Michael Behrisch
@date 2012-12-09
@version $Id: runner.py 13146 2012-12-10 12:01:07Z behrisch $
This script is a test runner for the output_parsing tutorial.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2008-2012 DLR (http:... | gpl-3.0 |
JonZeolla/metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/profiler_master.py | 9 | 4117 | """
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 this ... | apache-2.0 |
boundarydevices/android_external_chromium_org | build/android/pylib/forwarder.py | 8 | 13644 | # 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.
# pylint: disable=W0212
import fcntl
import logging
import os
import psutil
from pylib import cmd_helper
from pylib import constants
from pylib import ... | bsd-3-clause |
andrewcmyers/tensorflow | tensorflow/python/training/session_run_hook.py | 23 | 10423 | # 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 |
kallewoof/bitcoin | test/functional/rpc_whitelist.py | 40 | 5082 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
A test for RPC users with restricted permissions
"""
from test_framework.test_framework import Bitcoin... | mit |
MostafaGazar/tensorflow | tensorflow/python/framework/test_util.py | 23 | 21081 | # 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 |
joshowen/django-allauth | allauth/socialaccount/providers/facebook/locale.py | 20 | 2395 | # Default locale mapping for the Facebook JS SDK
# The list of supported locales is at
# https://www.facebook.com/translations/FacebookLocales.xml
import os
from django.utils.translation import get_language, to_locale
def _build_locale_table(filename_or_file):
"""
Parses the FacebookLocales.xml file and buil... | mit |
harmy/kbengine | kbe/src/lib/python/Lib/xml/etree/ElementTree.py | 46 | 57023 | #
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... | lgpl-3.0 |
vipmike007/virt-test | virttest/version.py | 18 | 3404 | #!/usr/bin/python
"""
Based on work from Douglas Creager <dcreager@dcreager.net>
Gets the current version number. If possible, this is the
output of "git describe", modified to conform to the versioning
scheme that setuptools uses. If "git describe" returns an error
(most likely because we're in an unpacked copy of ... | gpl-2.0 |
xpansa/server-tools | base_suspend_security/base_suspend_security.py | 29 | 1308 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
newswangerd/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/utils/utils.py | 47 | 5828 | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# utils
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.six import iteritems
from ansible_collections.ansible.... | gpl-3.0 |
liam-middlebrook/yaml-cpp | test/gmock-1.7.0/gtest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/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... | mit |
leomoon-studios/blender-light-studio | light_profiles.py | 1 | 16362 | import bpy
from bpy.props import BoolProperty, StringProperty, PointerProperty, FloatProperty, EnumProperty
import os, sys, subprocess
from . common import *
from . light_data import *
from itertools import chain
from . operators.modal import close_control_panel
from . import light_list
_ = os.sep
class ListItem(bpy.... | gpl-3.0 |
stanford-ssi/balloons-VALBAL | utils/parser.py | 1 | 11921 | #!/usr/bin/env python
# Stanford Student Space Initiative
# Balloons | VALBAL | May 2017
# Davy Ragland | dragland@stanford.edu
# File: parser.py
# --------------------------
# Server side script to parse incoming messages
# from RockBLOCK
#******************************* SETUP *************************************... | gpl-3.0 |
osvalr/odoo | addons/sale_analytic_plans/sale_analytic_plans.py | 381 | 1765 | # -*- 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 |
shhui/nova | nova/api/openstack/compute/plugins/v3/keypairs.py | 10 | 6309 | # 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 |
maithreyee/python-koans | python3/koans/about_packages.py | 66 | 1910 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is very different to AboutModules in Ruby Koans
# Our AboutMultipleInheritance class is a little more comparable
#
from runner.koan import *
#
# Package hierarchy of Python Koans project:
#
# contemplate_koans.py
# koans/
# __init__.py
# about_asserts.py... | mit |
hainm/mdtraj | mdtraj/geometry/internal.py | 15 | 20595 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Kyle A. Beauchamp
#
# MDTraj i... | lgpl-2.1 |
SofiaReis/django-cms | docs/conf.py | 13 | 7806 | # -*- coding: utf-8 -*-
#
# django cms documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 15 10:47:03 2009.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | bsd-3-clause |
yaqiyang/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/models/usage.py | 4 | 1728 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
lammps/lammps | doc/utils/converters/lammpsdoc/rst_anchor_check.py | 5 | 2188 | #!/usr/bin/env python3
# LAMMPS Documentation Utilities
#
# Scan for duplicate anchor labels in documentation files
#
# Copyright (C) 2017 Richard Berger
#
# 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 Fo... | gpl-2.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/mapi/mapiutil.py | 17 | 5090 | # General utilities for MAPI and MAPI objects.
from types import TupleType, ListType, IntType, StringType
from pywintypes import UnicodeType, TimeType
import pythoncom
import mapi, mapitags
# Pre 2.2.1 compat.
try: True, False
except NameError: True = 1==1; False = 1==0
prTable = {}
def GetPropTagName(pt):
if not pr... | apache-2.0 |
ouya/ouya_1_1-kernel | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
geodynamics/burnman | setup.py | 2 | 1353 | from __future__ import absolute_import
import re
versionstuff = dict(
re.findall("(.+) = '(.+)'\n", open('burnman/version.py').read()))
metadata = dict(name='burnman',
version=versionstuff['version'],
description='a thermoelastic and thermodynamic toolkit for Earth and planetary sc... | gpl-2.0 |
gcblue/gcblue | scripts/PointDefense.py | 1 | 2779 | from UnitCommands import *
from GroupCommands import *
import math
import random
def GetPointDefenseLaunchers(UI):
# build list of all launcher info
launcher_list = []
nLaunchers = UI.GetLauncherCount()
for n in range(0, nLaunchers):
launcher_info = UI.GetLauncherInfo(n)
if ((laun... | bsd-3-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/template/backends/django.py | 119 | 4406 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import sys
from importlib import import_module
from pkgutil import walk_packages
from django.apps import apps
from django.conf import settings
from django.template import TemplateDoesNotExist
from dja... | bsd-3-clause |
darktears/chromium-crosswalk | third_party/WebKit/LayoutTests/http/tests/websocket/reserved-bits_wsh.py | 45 | 1709 | import re
from mod_pywebsocket import common
from mod_pywebsocket import stream
from mod_pywebsocket.extensions import DeflateFrameExtensionProcessor
bit = 0
def _get_deflate_frame_extension_processor(request):
for extension_processor in request.ws_extension_processors:
if isinstance(extension_processor,... | bsd-3-clause |
NewHorizonsAU/ibuild | docs/source/conf.py | 1 | 8697 | # -*- coding: utf-8 -*-
# This file is based upon the file generated by sphinx-quickstart. However,
# where sphinx-quickstart hardcodes values in this file that you input, this
# file has been changed to pull from your module's metadata module.
#
# This file is execfile()d with the current directory set to its contain... | mit |
FlipperPA/wagtail | wagtail/images/tests/test_models.py | 2 | 20435 | import unittest
from django.contrib.auth.models import Group, Permission
from django.core.cache import caches
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.utils import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import... | bsd-3-clause |
reyoung/Paddle | python/paddle/fluid/tests/unittests/test_reduce_op.py | 1 | 9990 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
Mazecreator/tensorflow | tensorflow/python/debug/examples/debug_errors.py | 150 | 2655 | # 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 |
Mazecreator/tensorflow | tensorflow/python/kernel_tests/gradient_correctness_test.py | 118 | 1669 | # 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 |
verpoorten/immobilier | main/tests/views/test_view_utils.py | 1 | 1476 | ##############################################################################
#
# Immobilier it's an application
# designed to manage the core business of property management, buildings,
# rental agreement and so on.
#
# Copyright (C) 2016-2017 Verpoorten Leïla
#
# This program is free software: you can... | agpl-3.0 |
agrimaldi/RandomIO | RandomIO/__init__.py | 5 | 1221 | #
# The MIT License (MIT)
#
# Copyright (c) 2014 William T. James for Storj Labs
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... | mit |
gaddman/ansible | test/units/modules/network/f5/test_bigip_sys_global.py | 21 | 4145 | # -*- 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
if sys.version_info < (2, ... | gpl-3.0 |
peterjc/bioconda-recipes | recipes/biopet-vcfstats/1.0/biopet-vcfstats.py | 44 | 3367 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-vcfstats JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pep... | mit |
freakynit/kaggle-ndsb | configurations/bagging_07_convroll4_doublescale_fs5.py | 6 | 7063 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
validation_split_path = "splits/bagging_split_7.pkl"
patch_sizes = [(95, 95), (47, 47)]
augmentation_params = {
'zoom_rang... | mit |
tobiasjakobi/mpv | bootstrap.py | 7 | 1482 | #!/usr/bin/env python
# This script simply downloads waf to the current directory
from __future__ import print_function
import os, sys, stat, hashlib, subprocess
WAFRELEASE = "waf-1.9.8"
WAFURLS = ["https://waf.io/" + WAFRELEASE,
"http://www.freehackers.org/~tnagy/release/" + WAFRELEASE]
SHA256HASH ... | gpl-2.0 |
Pathel/deuterium | src/server/amp.py | 2 | 20482 | """
Contains the protocols, commands, and client factory needed for the Server
and Portal to communicate with each other, letting Portal work as a proxy.
Both sides use this same protocol.
The separation works like this:
Portal - (AMP client) handles protocols. It contains a list of connected
sessions in a d... | bsd-3-clause |
Endika/edx-platform | openedx/core/lib/api/tests/test_permissions.py | 6 | 4368 | """ Tests for API permissions classes. """
import ddt
from django.test import TestCase, RequestFactory
from student.roles import CourseStaffRole, CourseInstructorRole
from openedx.core.lib.api.permissions import IsStaffOrOwner, IsCourseInstructor
from student.tests.factories import UserFactory
from opaque_keys.edx.ke... | agpl-3.0 |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/UserDict.py | 358 | 5811 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... | gpl-2.0 |
buntyke/Flask | microblog/flask/lib/python2.7/site-packages/openid/consumer/html_parse.py | 167 | 7161 | """
This module implements a VERY limited parser that finds <link> tags in
the head of HTML or XHTML documents and parses out their attributes
according to the OpenID spec. It is a liberal parser, but it requires
these things from the data in order to work:
- There must be an open <html> tag
- There must be an open... | mit |
PeterDaveHello/eden | modules/s3db/event.py | 4 | 116628 | # -*- coding: utf-8 -*-
""" Sahana Eden Event Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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... | mit |
maxwell-demon/grpc | src/python/grpcio/grpc/framework/core/_protocol.py | 18 | 7044 | # Copyright 2015, 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 f... | bsd-3-clause |
racker/cloud-init-debian-pkg | cloudinit/config/cc_yum_add_repo.py | 6 | 3944 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This... | gpl-3.0 |
FreeAgent/djangoappengine-starter | django/utils/daemonize.py | 452 | 1907 | import os
import sys
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=022):
"Robustly turn into a UNIX daemon, running in our_home_dir."
# First fork
try:
if os.fork() > 0:
sys.exit(0... | bsd-3-clause |
jdramani/servo | tests/wpt/harness/wptrunner/browsers/base.py | 195 | 4635 | # 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 os
import platform
import socket
from abc import ABCMeta, abstractmethod
from ..wptcommandline import require_ar... | mpl-2.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/threading.py | 61 | 48900 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
from itertools import islice as _islic... | lgpl-3.0 |
hephaex/kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
sdgathman/cjdns | node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-buffer-security-check.py | 344 | 1612 | #!/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 buffer security check setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Tes... | gpl-3.0 |
Gogolook-Inc/GogoMonkeyRun | demo_runner.py | 1 | 2068 | # this is a test python for old version monkeyrunner
# no need to use this file
import sys,traceback
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
def startSteps():
print ("start monkey runner.")
# ui_debug.mr
# add START_FROM_DESKTOP at the 'first' line of code
# to start app fr... | apache-2.0 |
suyashphadtare/propshikhari-frappe | frappe/email/doctype/email_alert/test_email_alert.py | 37 | 3222 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe, frappe.utils, frappe.utils.scheduler
import unittest
test_records = frappe.get_test_records('Email Alert')
class TestEmailAlert(unittest.TestCase):
def setUp(self):
frappe.... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.