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 |
|---|---|---|---|---|---|
ferrants/ansible | v1/tests/TestModuleUtilsDatabase.py | 325 | 5737 | import collections
import mock
import os
import re
from nose.tools import eq_
try:
from nose.tools import assert_raises_regexp
except ImportError:
# Python < 2.7
def assert_raises_regexp(expected, regexp, callable, *a, **kw):
try:
callable(*a, **kw)
except expected as e:
... | gpl-3.0 |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/lp/gui/terminal/__init__.py | 1 | 2285 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: D:\Development\Dsz_1.3.0\DevDisk\Resources\Dsz\PyScripts\Lib\dsz\lp\gui\terminal\__init__.py
# Compiled at: 2012-10-22 17:30:11
import dsz
import dsz... | unlicense |
BackupGGCode/python-for-android | python3-alpha/extra_modules/gdata/spreadsheet/service.py | 47 | 16862 | #!/usr/bin/python
#
# Copyright (C) 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 ... | apache-2.0 |
pdellaert/ansible | lib/ansible/modules/storage/netapp/na_ontap_portset.py | 27 | 10305 | #!/usr/bin/python
# (c) 2018-2019, NetApp, 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 |
ita1024/samba | python/samba/tests/samba_tool/rodc.py | 1 | 4776 | # Unix SMB/CIFS implementation.
# Copyright (C) Catalyst IT Ltd. 2015
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
Hitechverma/zamboni | mkt/versions/tests/test_serializers.py | 12 | 1807 | from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from nose.tools import eq_, ok_
from mkt.site.tests import app_factory, TestCase
from mkt.versions.models import Version
from mkt.versions.serializers import VersionSerializer
class TestVersionSerializer(TestCase):
def se... | bsd-3-clause |
civato/kernel_p900 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
alan-unravel/bokeh | tests/travis/nbexecuter.py | 43 | 3427 | """
Script for running notebooks and output nbconverted html files from the
command line, by @damianavila
To be replaced by IPython.nbconvert execute preprocessor in the future:
https://github.com/ipython/ipython/pull/5639
"""
from __future__ import print_function
import io
import os
import sys
from six import iterit... | bsd-3-clause |
kbase/metrics | source/custom_scripts/populate_user_info_user_id.py | 1 | 2985 | import os
import mysql.connector as mysql
sql_host = os.environ["SQL_HOST"]
query_on = os.environ["QUERY_ON"]
metrics_mysql_password = os.environ["METRICS_MYSQL_PWD"]
'''
This script populates the user_id column in the user_info table.
It is built to backfill the records fro scratch
or to add on if the Unuique key g... | mit |
OptiPop/external_chromium_org | third_party/cython/src/pyximport/pyxbuild.py | 95 | 5795 | """Build a Pyrex file from .pyx source to .so loadable module using
the installed distutils infrastructure. Call:
out_fname = pyx_to_dll("foo.pyx")
"""
import os
import sys
from distutils.dist import Distribution
from distutils.errors import DistutilsArgError, DistutilsError, CCompilerError
from distutils.extension i... | bsd-3-clause |
angdraug/nova | nova/compute/monitors/__init__.py | 5 | 7305 | # Copyright 2013 Intel 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 requir... | apache-2.0 |
powerjg/gem5-ci-test | util/style/file_types.py | 23 | 6891 | # Copyright (c) 2010 The Hewlett-Packard Development Company
# 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... | bsd-3-clause |
akash1808/nova | nova/tests/unit/api/openstack/compute/contrib/test_extended_status.py | 63 | 4923 | # 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 |
DigiThinkIT/stem | test/integ/control/base_controller.py | 1 | 8632 | """
Integration tests for the stem.control.BaseController class.
"""
import re
import threading
import time
import unittest
import stem.control
import test.runner
import stem.socket
import stem.util.system
class StateObserver(object):
"""
Simple container for listening to ControlSocket state changes and
rembe... | lgpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Paste-2.0.1/paste/auth/multi.py | 78 | 3042 | # (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# This code was written with funding by http://prometheusresearch.com
"""
Authentication via Multiple Methods
In some environments, the choice of authe... | apache-2.0 |
rainwoodman/nbodykit | nbodykit/core/datasource/TPMSnapshot.py | 2 | 2852 | from nbodykit.core import DataSource
from nbodykit import files
import numpy
class TPMSnapshotDataSource(DataSource):
"""
DataSource to read snapshot files from Martin White's TPM simulations
"""
plugin_name = "TPMSnapshot"
def __init__(self, path, BoxSize, rsd=None, bunchsize=4*1024*1024):
... | gpl-3.0 |
Nowheresly/odoo | addons/hr_timesheet_sheet/report/hr_timesheet_report.py | 194 | 4092 | # -*- 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 |
boundarydevices/android_external_chromium_org | tools/telemetry/telemetry/web_perf/metrics/timeline_based_metric.py | 77 | 2212 | # Copyright 2014 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.
class TimelineBasedMetricException(Exception):
"""Exception that can be thrown from metrics that implements
TimelineBasedMetric to indicate a problem... | bsd-3-clause |
kevinwilde/WildeBot | src/mybot/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
Asderdd/android_kernel_google_msm8952 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
JulyKikuAkita/PythonPrac | cs15211/AverageOfLevelsInBinaryTree.py | 1 | 4320 | __source__ = 'https://leetcode.com/problems/average-of-levels-in-binary-tree/description/'
# Time: O(N)
# Space: O(M) M refers to the maximum mumber of nodes at any level in the input tree.
#
# Description: Leetcode # 637. Average of Levels in Binary Tree
#
# Given a non-empty binary tree, return the average value of ... | apache-2.0 |
CyanogenMod/android_kernel_samsung_ks01lte | scripts/build-all.py | 329 | 10325 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
albert-chin/yowsup | yowsup/layers/protocol_ib/protocolentities/account_ib.py | 57 | 1996 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .ib import IbProtocolEntity
class AccountIbProtocolEntity(IbProtocolEntity):
'''
<ib from="s.whatsapp.net">
<account status="active | ?" kind="paid" creation="timestamp" expiration="timestamp"></account>
</ib>
'''
STATUS_ACTIV... | gpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/jupyter_console/tests/test_image_handler.py | 6 | 3464 | # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import sys
import unittest
import base64
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from jupyter_console.ptshell import ZMQTerminalInteractiveShell
from ipython_... | mit |
gavinp/chromium | third_party/closure_linter/closure_linter/common/lintrunner.py | 286 | 1258 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
JPJPJPOPOP/zulip | zerver/webhooks/deskdotcom/view.py | 34 | 1234 | # Webhooks for external integrations.
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from zerver.models import get_client, UserProfile
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.decorator import REQ, has_request_va... | apache-2.0 |
rastaman/ansible-modules-core | packaging/os/apt_repository.py | 93 | 17068 | #!/usr/bin/python
# encoding: utf-8
# (c) 2012, Matt Wright <matt@nobien.net>
# (c) 2013, Alexander Saltanov <asd@mokote.com>
# (c) 2014, Rutger Spiertz <rutger@kumina.nl>
#
# 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... | gpl-3.0 |
rcbops/nova-buildpackage | nova/virt/fake.py | 2 | 10453 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | apache-2.0 |
MozzieChou/FlaskDemo | app/__init__.py | 1 | 1242 | # -*- coding: UTF-8 –*-
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.pagedown import PageDown
from config import config
bootstrap ... | apache-2.0 |
Werkov/PyQt4 | pyuic/uic/Compiler/indenter.py | 27 | 2742 | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as fol... | gpl-2.0 |
pwhelan/djshouts | django/contrib/flatpages/tests/csrf.py | 228 | 3780 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase, Client
class FlatpageCSRFTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.client = Client(enforce_csrf_checks=... | bsd-3-clause |
Southpaw-TACTIC/Team | src/python/Lib/bsddb/dbshelve.py | 2 | 11139 | #!/bin/env python
#------------------------------------------------------------------------
# Copyright (c) 1997-2001 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: dbShelve.py
#
# Desc... | epl-1.0 |
jakar/odoo-bank-statement-reconcile | __unported__/account_statement_base_completion/__openerp__.py | 14 | 3392 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | agpl-3.0 |
jumoconnect/openjumo | jumodjango/urls.py | 1 | 8636 | from api.api_v1 import api_urls
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
)
''' RANDOM URLs '''
urlpatterns += patterns('etc.views',
url(r'^about/?$', 'about', name = 'about'),
url(r'^help/?$', 'h... | mit |
openstack/os-brick | os_brick/tests/encryptors/test_nop.py | 1 | 1447 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
sandymanu/manufooty_yu_lp | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # 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 |
paukenba/youtube-dl | youtube_dl/extractor/facebook.py | 74 | 7339 | from __future__ import unicode_literals
import json
import re
import socket
from .common import InfoExtractor
from ..compat import (
compat_http_client,
compat_str,
compat_urllib_error,
compat_urllib_parse_unquote,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,... | unlicense |
geekaia/edx-platform | lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py | 80 | 7637 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'StudentModuleHistory.version'
db.alter_column('courseware_studentmodulehistory', 'version... | agpl-3.0 |
pheanex/ansible | lib/ansible/plugins/cache/base.py | 124 | 1479 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... | gpl-3.0 |
minhlongdo/scipy | scipy/spatial/setup.py | 6 | 2810 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
from numpy.distutils.misc_util import get_info as get_misc_info
... | bsd-3-clause |
profblock/adaptive-litmus | tools/perf/tests/attr.py | 1266 | 9424 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
mindnervestech/mnrp | addons/sale_order_dates/__openerp__.py | 52 | 1819 | # -*- 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 |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/test/test_mutants.py | 65 | 8498 | from test.test_support import verbose, TESTFN
import random
import os
# From SF bug #422121: Insecurities in dict comparison.
# Safety of code doing comparisons has been an historical Python weak spot.
# The problem is that comparison of structures written in C *naturally*
# wants to hold on to things like the size ... | apache-2.0 |
jelly/leetnews | app/__init__.py | 1 | 1283 | #!/usr/bin/python
from datetime import datetime
from flask import Flask, request, jsonify
app = Flask(__name__)
from pymongo import MongoClient
app.mongo_client = MongoClient()
app.db = app.mongo_client['leetnews']
app.posts = app.db['posts']
@app.route('/post/', methods=['GET', 'POST'])
def post():
# List of p... | mit |
Yukarumya/Yukarum-Redfoxes | python/mach/mach/decorators.py | 2 | 12077 | # 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/.
from __future__ import absolute_import, unicode_literals
import argparse
import collections
import inspect
import os
im... | mpl-2.0 |
Vingaard/conpot | conpot/protocols/IEC104/DeviceDataController.py | 2 | 6761 | # Copyright (C) 2017 Patrick Reichenberger (University of Passau) <patrick.reichenberger@t-online.de>
#
# 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... | gpl-2.0 |
benjsto/ronquixote | djangoappengine/main/main.py | 62 | 2351 | # Python 2.5 CGI handler.
import os
import sys
from djangoappengine.main import application
from google.appengine.ext.webapp.util import run_wsgi_app
from djangoappengine.boot import setup_logging, env_ext
from django.conf import settings
path_backup = None
def real_main():
# Reset path and environment variabl... | mit |
mschmidt87/nest-simulator | pynest/examples/tsodyks_facilitating.py | 17 | 4981 | # -*- coding: utf-8 -*-
#
# tsodyks_facilitating.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Li... | gpl-2.0 |
passiweinberger/nupic | src/nupic/support/pymysqlhelpers.py | 19 | 4179 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
GeyerA/android_external_chromium_org | tools/perf/measurements/startup.py | 23 | 2929 | # 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 json
from telemetry.page import page_measurement
class Startup(page_measurement.PageMeasurement):
"""Performs a measurement of Chromium's startup ... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/en/torrentapi.py | 1 | 3246 |
import re,urllib,urlparse,json
from resources.lib.modules import client,debrid,source_utils
from resources.lib.modules import dom_parser2 as dom
class source:
def __init__(self):
self.priority = 1
self.language = ['en']
self.tvsearch = 'https://torrentapi.org/pubapi_v2.php?app_id=Torapi&... | gpl-2.0 |
muadibbm/gini | backend/src/gloader/xml/xslt/LiteralElement.py | 9 | 5059 | ########################################################################
#
# File Name: LiteralElement.py
#
#
"""
Implementation of the XSLT Spec import stylesheet element.
WWW: http://4suite.com/4XSLT e-mail: support@4suite.com
Copyright (c) 1999-2000 Fourthought Inc, USA. All Rights Reserved.
See... | mit |
1st/django | tests/template_tests/syntax_tests/test_if.py | 204 | 25375 | import warnings
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase, ignore_warnings
from django.test.utils import reset_warning_registry
from django.utils.deprecation import RemovedInDjango110Warning
from ..utils import TestObj, setup
class IfTagTests(SimpleTestCase):
@setup... | bsd-3-clause |
hitakaken/ifplus | ifplus/rbac/helpers/utils.py | 1 | 4316 | # -*- coding: utf-8 -*-
from bson import ObjectId
import calendar
import datetime as dt
import flatdict
import six
class UTC(dt.tzinfo):
"""
UTC Time Object
"""
ZERO = dt.timedelta(0)
def utcoffset(self, dt):
return self.ZERO
def tzname(self, dt):
return 'UTC'
def dst(se... | mit |
DeNeutoy/deep_qa | deep_qa/layers/option_attention_sum.py | 4 | 7124 | from keras import backend as K
from overrides import overrides
from .masked_layer import MaskedLayer
from ..common.checks import ConfigurationError
from ..tensors.backend import switch
class OptionAttentionSum(MaskedLayer):
"""
This Layer takes three inputs: a tensor of document indices, a tensor of
docu... | apache-2.0 |
GRArmstrong/invenio-inspire-ops | modules/bibauthorid/lib/bibauthorid_prob_matrix_unit_tests.py | 2 | 1184 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ve... | gpl-2.0 |
TheAlgorithms/Python | dynamic_programming/edit_distance.py | 1 | 2982 | """
Author : Turfa Auliarachman
Date : October 12, 2016
This is a pure Python implementation of Dynamic Programming solution to the edit
distance problem.
The problem is :
Given two strings A and B. Find the minimum number of operations to string B such that
A = B. The permitted operations are removal, insertion... | mit |
aayushidwivedi01/spark-tk | python/sparktk/graph/ops/export_to_orientdb.py | 7 | 6158 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | apache-2.0 |
okjohn/SHARPpy | sharppy/drawing/barbs.py | 2 | 2795 | ''' Barbs Class '''
import sharppy.sharptab as tab
__all__ = ['Barb']
class Barb(object):
def __init__(self, canvas, x, y, dir, spd, **kwargs):
self.gCanvas = canvas # Canvas to draw upon
self.centerx = x # Location to draw
self.c... | bsd-3-clause |
brad-kaiser/spark | python/pyspark/mllib/stat/test.py | 155 | 2301 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
pagea/bridgedb | lib/bridgedb/test/test_configure.py | 1 | 2562 | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see the AUTHORS file for attributions
# :copyright: (c) 2013-2014, Isis Lovecruft
# (c) 2007-2014, The Tor Project, Inc.
# :license: see LICENSE for licensing information
"""Tests for :mod:`bri... | bsd-3-clause |
openstack/training-labs | labs/osbash/tools/log_snapshot_split.py | 1 | 7063 | #!/usr/bin/env python
"""
This script splits out log file portions based on full log files and
"ls -l" snapshots that document their size at various points in time.
"""
# Force Python 2 to use float division even for ints
from __future__ import division
from __future__ import print_function
import argparse
import ... | apache-2.0 |
quinot/ansible | lib/ansible/module_utils/facts/virtual/hpux.py | 199 | 2486 | # 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 distributed in the hope that ... | gpl-3.0 |
kawasaki2013/python-for-android-x86 | python-modules/zope/zope/interface/__init__.py | 50 | 3001 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | apache-2.0 |
UWPCE-PythonCert/IntroPython2016 | students/jbearer/session02/lpthw_ex31-1.py | 3 | 1359 | print ("You enter a dark room with two doors. Do you go through door #1 or door #2?")
door = input("> ")
if door == "1":
print ("There's a giant bear here eating a cheese cake. What do you do?")
print ("1. Take the cake.")
print ("2. Scream at the bear.")
print ("3. Run like you've never run before.... | unlicense |
ZacariasBendeck/youtube-dl | youtube_dl/extractor/xnxx.py | 112 | 1406 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class XNXXIE(InfoExtractor):
_VALID_URL = r'^https?://(?:video|www)\.xnxx\.com/video(?P<id>[0-9]+)/(.*)'
_TEST = {
'url': 'http://video.xnxx.com/video1135332/li... | unlicense |
lukasfenix/namebench | nb_third_party/dns/edns.py | 248 | 4312 | # Copyright (C) 2009 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 "AS IS" AND NOMIN... | apache-2.0 |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/Connected/Connected.py | 1 | 2499 |
import dsz.script
import os.path
import ops
import ops.env
import ops.project
import ops.networking.ifconfig
import ops.survey
import ops.survey.ifconfig
import json
import dsz
dsz.control.echo.Off()
dsz.ui.Echo(('-' * 50))
dsz.ui.Echo('Re-registering global wrappers for current target')
dsz.ui.Echo(('-' * 50))
with o... | unlicense |
DavidRamirez19/Total-Demolition---PYGAME | Total Demolition 1.4/Clases/Estadisticas.py | 5 | 4420 | import pygame
class Estadisticas(pygame.sprite.Sprite):
"""Clase para controlar los muros que hay distribuidos por el mapa"""
"""
Constructor de la clase
"""
def __init__(self,ancho,alto,anchoEstadisticas):
pygame.sprite.Sprite.__init__(self)
self.cuadro = pygame.Rect(... | mit |
40223139/39g7test | static/Brython3.1.3-20150514-095342/Lib/encodings/aliases.py | 726 | 15414 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... | gpl-3.0 |
jaimahajan1997/sympy | sympy/polys/orderings.py | 123 | 8498 | """Definitions of monomial orderings. """
from __future__ import print_function, division
__all__ = ["lex", "grlex", "grevlex", "ilex", "igrlex", "igrevlex"]
from sympy.core import Symbol
from sympy.core.compatibility import iterable
class MonomialOrder(object):
"""Base class for monomial orderings. """
al... | bsd-3-clause |
vinchoi/fishplay | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/dom.py | 920 | 8469 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
class A... | gpl-3.0 |
ausdim/TW-jb-Edition-I9505-jfltexx | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
sean-/ansible | lib/ansible/vars/__init__.py | 3 | 13233 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
Innovahn/odoo.old | addons/mrp/res_config.py | 301 | 3684 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
subramani95/neutron | neutron/tests/unit/services/firewall/agents/varmour/test_varmour_router.py | 7 | 11959 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 vArmour Networks 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.apa... | apache-2.0 |
yosshy/nova | nova/tests/unit/virt/libvirt/volume/test_volume.py | 17 | 9167 | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | apache-2.0 |
Pirata-Repository/Pirata | plugin.video.tvpor/dns/opcode.py | 91 | 2614 | # Copyright (C) 2001-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 |
alexcrichton/gyp | test/library/gyptest-shared-obj-install-path.py | 289 | 1180 | #!/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.
"""
Verifies that .so files that are order only dependencies are specified by
their install location rather than by their alias.
"""
# Pyth... | bsd-3-clause |
eckozero/CLIc | NewCLIc/NewCLIc.py | 1 | 7954 | #!/usr/bin/env python
import Mechanics
"""Reimplementation of CLIc, using (hopefully!) better code
Let's pretend this is V2"""
# Important function below. This allows for easy finding of debugging
# lines rather than using print all of the time.
def debug(*args):
print args
# Set up the chess board. Rows go ... | gpl-2.0 |
melbit-kevinwessel/ansible-modules-core | utilities/logic/set_fact.py | 115 | 2015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
kybi/django-haystack | test_haystack/test_fields.py | 2 | 16668 | import datetime
from decimal import Decimal
from django.template import TemplateDoesNotExist
from django.test import TestCase
from haystack.fields import *
from test_haystack.core.models import MockModel, MockTag
class CharFieldTestCase(TestCase):
def test_init(self):
try:
foo = CharField(mode... | bsd-3-clause |
mastizada/kuma | vendor/packages/translate-toolkit/translate/convert/test_po2tmx.py | 6 | 5187 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.convert import po2tmx
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.storage import tmx
from translate.storage import lisa
class TestPO2TMX:
def po2tmx(self, posource, sourcelanguage='en', targetlanguage=... | mpl-2.0 |
GunoH/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_collect_try_except_info.py | 10 | 8659 | from opcode import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname, hasname, hasjrel, haslocal, \
hascompare, hasfree, cmp_op
import dis
import sys
from collections import namedtuple
try:
xrange
except NameError:
xrange = range
class TryExceptInfo(object):
def __init__(self, try_line, is_finally=False... | apache-2.0 |
varigit/kernel-VAR-SOM-AMxx | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
sdague/home-assistant | tests/components/axis/test_device.py | 5 | 14005 | """Test Axis device."""
from copy import deepcopy
from unittest import mock
import axis as axislib
from axis.api_discovery import URL as API_DISCOVERY_URL
from axis.applications import URL_LIST as APPLICATIONS_URL
from axis.applications.vmd4 import URL as VMD4_URL
from axis.basic_device_info import URL as BASIC_DEVICE... | apache-2.0 |
silky/sms-tools | lectures/05-Sinusoidal-model/plots-code/synthesis-window.py | 22 | 1725 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
from scipy.fftpack import fft, ifft, fftshift
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import ... | agpl-3.0 |
SOKP/external_chromium_org | tools/findit/git_repository_parser.py | 26 | 10960 | # Copyright (c) 2014 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 base64
import xml.dom.minidom as minidom
from xml.parsers.expat import ExpatError
import crash_utils
from repository_parser_interface import Pars... | bsd-3-clause |
aronsky/home-assistant | tests/components/fan/test_mqtt.py | 2 | 6828 | """Test MQTT fans."""
import json
import unittest
from homeassistant.setup import setup_component, async_setup_component
from homeassistant.components import fan
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_UNAVAILABLE
from tests.common impo... | apache-2.0 |
zcourts/py-leveldb | test/try.py | 43 | 2259 | #!/usr/bin/python
# Copyright (c) Arni Mar Jonsson.
# See LICENSE for details.
import leveldb, pointless, random, string, itertools, collections
from twisted.internet import reactor, defer, threads
def compare(a, b):
return cmp(a, b)
c = 'bytewise'
c = ('leveldb.BytewiseComparator', compare)
kw = {
'create_if_m... | bsd-3-clause |
dstrockis/outlook-autocategories | lib/future/backports/email/_policybase.py | 82 | 14647 | """Policy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future.builtins import super
from future... | apache-2.0 |
legoktm/pywikipedia-rewrite | pywikibot/userinterfaces/win32_unicode.py | 11 | 11170 | # Stdout, stderr and argv support:
##############################################
# Support for unicode in windows cmd.exe
# Posted on Stack Overflow [1], available under CC-BY-SA [2]
#
# Question: "Windows cmd encoding change causes Python crash" [3] by Alex [4],
# Answered [5] by David-Sarah Hopwood [6].
#
# [1] htt... | mit |
francoisluus/tensorboard-supervise | tensorboard/plugins/debugger/debugger_plugin_test.py | 2 | 10292 | # 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 |
dfm/george | george/utils.py | 1 | 2454 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["multivariate_gaussian_samples", "nd_sort_samples"]
import numpy as np
from scipy.spatial import cKDTree
def multivariate_gaussian_samples(matrix, N, mean=None):
"""
Generate samples from a multidimensional Gaussian with a g... | mit |
ModdedPA/android_external_chromium_org | remoting/tools/keygen.py | 40 | 1272 | # 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.
import os
import sys
_SCRIPT_PATH = os.path.dirname(sys.argv[0])
if _SCRIPT_PATH == "":
_SCRIPT_PATH = os.getcwd()
_EXE_PATHS_TO_TRY = [
'.',
'..... | bsd-3-clause |
bmoar/ansible-modules-extras | messaging/rabbitmq_vhost.py | 161 | 4201 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | gpl-3.0 |
krazybean/randomaas | lib/python2.6/site-packages/flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | apache-2.0 |
lafayette/JBTT | framework/python/Lib/wsgiref/headers.py | 54 | 5916 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.Message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
from types import ListType, TupleType
# Regular expression that matches `special' characters in para... | mit |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/glanceclient/exc.py | 3 | 4758 | # 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... | mit |
Vatsinator/VatsinatorDatabase | vatsinatordatabase/wsgi.py | 1 | 1455 | """
WSGI config for VatsinatorDatabase project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.