repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
TorpedoXL/namebench | libnamebench/nameserver_list.py | 173 | 24485 | # Copyright 2009 Google 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 applicable law or ... | apache-2.0 |
yesbox/ansible | test/units/module_utils/basic/test_known_hosts.py | 74 | 2365 | # -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <mscherer@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | gpl-3.0 |
NYU-DevOps-Fall2017-PromotionsTeam/promotions | features/steps/promotion_steps.py | 1 | 7975 | from os import getenv
import requests
from behave import *
import json
from app import server
from verify import expect
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
WAIT_SECONDS = 30
BASE_URL = getenv('BAS... | apache-2.0 |
wuyuewen/libcloud | libcloud/test/common/test_gandi.py | 66 | 1293 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
erikge/watch_gyp | test/generator-output/gyptest-rules.py | 19 | 1839 | #!/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 --generator-output= behavior when using rules.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGy... | bsd-3-clause |
googleapis/python-compute | google/cloud/compute_v1/services/region_notification_endpoints/transports/__init__.py | 1 | 1104 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
Mappy/PyLR | pylr/parser.py | 1 | 15704 | # -*- coding: utf-8 -*-
''' Location parser
.. moduleauthor:: David Marteau <david.marteau@mappy.com>
'''
from collections import namedtuple
from bitstring import BitStream
from .utils import lazyproperty
from .constants import (LATEST_BINARY_VERSION,
BINARY_VERSION_2,
... | apache-2.0 |
ArchiveLabs/dweb_gateway | python/Multihash.py | 1 | 5374 | """
A set of classes to hold different kinds of hashes etc and convert between them,
Much of this was adapted from https://github.com/tehmaze/python-multihash,
which seems to have evolved from the pip3 multihash, which is seriously broken.
"""
import hashlib
import struct
import sha3
import pyblake2
import base58
imp... | agpl-3.0 |
Fat-Zer/FreeCAD_sf_master | src/Mod/Path/PathScripts/PathArray.py | 4 | 11223 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2015 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... | lgpl-2.1 |
repotvsupertuga/tvsupertuga.repository | script.module.streamlink.base/resources/lib/streamlink/plugins/atresplayer.py | 4 | 2806 | from __future__ import print_function
import logging
import re
from functools import partial
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream, DASHStream
from streamlink.utils import parse_json, update_scheme, search_dict
log = logging.getLogger(... | gpl-2.0 |
killbug2004/peinjector | pe-injector-interceptor/libPePatch.py | 34 | 4600 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Provides de-serialization and in-stream patch applying capabilities for PE Files
"""
__author__ = 'A.A.'
# Unpack binary data
from struct import unpack_from
# Holds an single patch part
class PePatchPart(object):
# Constructor
def __init__(self, mem, ... | unlicense |
CERNDocumentServer/invenio | modules/webjournal/lib/webjournal_unit_tests.py | 3 | 2784 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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
# License, or (at your optio... | gpl-2.0 |
etxc/namebench | nb_third_party/dns/rdtypes/ANY/CNAME.py | 248 | 1092 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
CuriousLearner/standup | src/updates/views.py | 1 | 1310 | from django.shortcuts import render, get_object_or_404
from django.views.generic import DetailView
from authen.models import User
from fraternity.models import Team, Project
from .models import Post, Hashtag
class GetUserPosts(DetailView):
model = Post
template_name = 'posts.html'
context_object_name = '... | gpl-3.0 |
zasdfgbnm/tensorflow | tensorflow/contrib/text/python/ops/skip_gram_ops.py | 76 | 21608 | # 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 |
epfl-idevelop/jahia2wp | src/parser/sitemap_node.py | 1 | 1306 | from anytree import Node, RenderTree
class SitemapNode(Node):
"""
A SitemapNode represents a node of the sitemap. The root node
(the homepage) is available as a property of the Site class,
e.g. site.sitemaps["en"] for the English sitemap. This class
is an extension of Node, from the anytree librar... | mit |
Vimos/scikit-learn | sklearn/preprocessing/_function_transformer.py | 41 | 3475 | from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array
def _identity(X):
"""The identity function.
"""
return X
class FunctionTransformer(BaseEstimator, TransformerMixin):
"""Constructs a transformer from an arbitrary callable.
A FunctionTransformer forwards its X (a... | bsd-3-clause |
lfcnassif/MultiContentViewer | release/modules/ext/libreoffice/program/python-core-3.3.0/lib/email/_policybase.py | 94 | 14327 | """Policy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
"""
import abc
from email import header
from email import charset as _charset
from email.utils import _has_surrogates
__all__ = [
'Policy',
'Compat32',
'compat32',
]
class _Polic... | lgpl-3.0 |
MSFTOSSMgmt/WPSDSCLinux | Providers/Scripts/3.x/Scripts/nxFileInventory.py | 2 | 14839 | #!/usr/bin/env python
# ====================================
# Copyright (c) Microsoft Corporation.
# All rights reserved.
# See license.txt for license information.
# ====================================
from __future__ import print_function
from __future__ import with_statement
from contextlib import contextmanag... | mit |
gtaylor/python-colormath | examples/delta_e_matrix.py | 1 | 1329 | # -*- coding: utf-8 -*-
"""
For a massive matrix of colors and color labels you can download
the follow two files
# http://lyst-classifiers.s3.amazonaws.com/color/lab-colors.pk
# http://lyst-classifiers.s3.amazonaws.com/color/lab-matrix.pk
lab-colors is a cPickled list of color names and lab-matrix is a
cPickled (n,3... | bsd-3-clause |
tima/ansible | lib/ansible/modules/notification/catapult.py | 49 | 4362 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jonathan Mainguy <jon@soh.re>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# basis of code taken from the ansible twillio and nexmo modules
from __future__ import absolute_import, division, print_function
__metacla... | gpl-3.0 |
kingvuplus/ts-gui-3 | lib/python/Components/Harddisk.py | 3 | 28983 | import os
import time
from Tools.CList import CList
from Tools.HardwareInfo import HardwareInfo
from SystemInfo import SystemInfo
from Components.Console import Console
import Task
def readFile(filename):
file = open(filename)
data = file.read().strip()
file.close()
return data
def getProcMounts():
try:
mounts... | gpl-2.0 |
bluesea/zulip | tools/deprecated/finbot/monthdelta.py | 115 | 6015 | """monthdelta
Date calculation with months: MonthDelta class and monthmod() function.
"""
__all__ = ['MonthDelta', 'monthmod']
from datetime import date, timedelta
class MonthDelta:
"""Number of months offset from a date or datetime.
MonthDeltas allow date calculation without regard to the different length... | apache-2.0 |
Niknakflak/-tg-station | tools/midi2piano/pyperclip/windows.py | 110 | 5405 | """
This module implements clipboard handling on Windows using ctypes.
"""
import time
import contextlib
import ctypes
from ctypes import c_size_t, sizeof, c_wchar_p, get_errno, c_wchar
from .exceptions import PyperclipWindowsException
class CheckedCall(object):
def __init__(self, f):
super(CheckedCall, s... | agpl-3.0 |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/cryptography/hazmat/backends/openssl/encode_asn1.py | 3 | 23428 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import calendar
import ipaddress
import six
from cryptography import ut... | apache-2.0 |
mafiya69/sympy | sympy/physics/quantum/matrixutils.py | 87 | 10287 | """Utilities to deal with sympy.Matrix, numpy and scipy.sparse."""
from __future__ import print_function, division
from sympy import Matrix, I, Expr, Integer
from sympy.core.compatibility import range
from sympy.matrices import eye, zeros
from sympy.external import import_module
__all__ = [
'numpy_ndarray',
... | bsd-3-clause |
moondrop-entertainment/django-nonrel-drawp | tests/regressiontests/test_utils/tests.py | 49 | 4833 | import sys
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
from models import Person
if sys.version_info >= (2, 5):
from tests_25 import AssertNumQueriesContextManagerTests
class SkippingTestCase(TestCase):
def test_skip_unless_db_feature(self):
"A test that might be skipped ... | bsd-3-clause |
esakellari/my_root_for_test | interpreter/llvm/src/utils/lldbDataFormatters.py | 20 | 3286 | """
LLDB Formatters for LLVM data types.
Load into LLDB with 'command script import /path/to/lldbDataFormatters.py'
"""
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('type category define -e llvm -l c++')
debugger.HandleCommand('type synthetic add -w llvm '
... | lgpl-2.1 |
NukeAOSP/external_chromium | chrome/common/extensions/docs/build/build.py | 65 | 8905 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""Docbuilder for extension docs."""
import os
import os.path
import shutil
import sys
import time
import urllib
from subprocess impo... | bsd-3-clause |
yarothetimble/todo | todo/settings.py | 1 | 3215 | """
Django settings for todo project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
#... | mit |
walchko/pygecko | retired/old_version/original/bin/mjpeg_server.py | 1 | 4736 | #!/usr/bin/env python
import cv2
from BaseHTTPServer import BaseHTTPRequestHandler
from BaseHTTPServer import HTTPServer
import time
import argparse
from opencvutils import Camera
import socket as Socket
# import errno
# threaded version
# http://stackoverflow.com/questions/12650238/processing-simultaneous-asynchrono... | mit |
fjbatresv/odoo | addons/membership/membership.py | 21 | 27956 | # -*- 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 |
XiaosongWei/crosswalk-test-suite | apptools/apptools-android-tests/apptools/create_basic.py | 3 | 2943 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
williamthegrey/swift | test/unit/common/middleware/test_xprofile.py | 5 | 23334 | # Copyright (c) 2010-2012 OpenStack, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
ttanner/kryptomime | tests/test_smime.py | 1 | 3239 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# S/MIME unit tests
#
# This file is part of kryptomime, a Python module for email kryptography.
# Copyright © 2013,2014 Thomas Tanner <tanner@gmx.net>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public ... | lgpl-3.0 |
Pythonity/icon-font-to-png | icon_font_to_png/icon_font.py | 1 | 6185 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import re
from collections import OrderedDict
import tinycss
from PIL import Image, ImageFont, ImageDraw
from six import unichr
class IconFont(object):
"""Base class that represents web icon font"""
def __init__(self,... | mit |
h3biomed/ansible | lib/ansible/modules/storage/netapp/na_ontap_lun_copy.py | 28 | 5680 | #!/usr/bin/python
# (c) 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 |
aabbox/kbengine | kbe/res/scripts/common/Lib/test/test__osx_support.py | 72 | 11776 | """
Test suite for _osx_support: shared OS X support functions.
"""
import os
import platform
import shutil
import stat
import sys
import unittest
import test.support
import _osx_support
@unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X")
class Test_OSXSupport(unittest.TestCase):
def setUp... | lgpl-3.0 |
tokenly/counterparty-lib | counterpartylib/lib/messages/execute.py | 3 | 7034 | #! /usr/bin/python3
"""Execute arbitrary data as a smart contract."""
import struct
import binascii
import logging
logger = logging.getLogger(__name__)
from counterpartylib.lib import (util, config, exceptions)
from .scriptlib import (utils, blocks, processblock)
FORMAT = '>20sQQQ'
LENGTH = 44
ID = 101
def initial... | mit |
whereismyjetpack/ansible | lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py | 13 | 4318 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
JPFrancoia/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 225 | 6278 | import sys
import re
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.utils.testing import (assert_almost_equal, assert_array_equal,
assert_true)
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as ... | bsd-3-clause |
mlyundin/scikit-learn | examples/decomposition/plot_pca_iris.py | 253 | 1801 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo... | bsd-3-clause |
scith/htpc-manager_ynh | sources/libs/sqlobject/declarative.py | 10 | 7263 | """
Declarative objects.
Declarative objects have a simple protocol: you can use classes in
lieu of instances and they are equivalent, and any keyword arguments
you give to the constructor will override those instance variables.
(So if a class is received, we'll simply instantiate an instance with
no arguments).
You ... | gpl-3.0 |
fredericlepied/ansible | lib/ansible/modules/network/vyos/vyos_user.py | 11 | 10403 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
jillesme/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/examples/add_person.py | 432 | 1656 | #! /usr/bin/python
# See README.txt for information and build instructions.
import addressbook_pb2
import sys
# This function fills in a Person message based on user input.
def PromptForAddress(person):
person.id = int(raw_input("Enter person ID number: "))
person.name = raw_input("Enter name: ")
email = raw_... | bsd-3-clause |
datascopeanalytics/traces | tests/test_docs.py | 1 | 1056 | import traces
from datetime import datetime
def test_quickstart():
time_series = traces.TimeSeries()
time_series[datetime(2042, 2, 1, 6, 0, 0)] = 0 # 6:00:00am
time_series[datetime(2042, 2, 1, 7, 45, 56)] = 1 # 7:45:56am
time_series[datetime(2042, 2, 1, 8, 51, 42)] = 0 # 8:51:42am
time_ser... | mit |
xyloeric/pi | piExp/users/views.py | 55 | 1681 | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Only authenticated ... | bsd-3-clause |
guolivar/totus-niwa | service/thirdparty/featureserver/FeatureServer/DataSource/DBM.py | 1 | 6212 | __author__ = "MetaCarta"
__copyright__ = "Copyright (c) 2006-2008 MetaCarta"
__license__ = "Clear BSD"
__version__ = "$Id: DBM.py 444 2008-03-19 01:35:35Z brentp $"
from FeatureServer.DataSource import DataSource
from FeatureServer.DataSource import Lock
from FeatureServer.Service.Action import Action
import anydbm
... | gpl-3.0 |
GladeRom/android_external_chromium_org | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/top_20.py | 34 | 3245 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class Top20Page(page_module.Page):
def __init__(se... | bsd-3-clause |
jkandasa/integration_tests | scripts/enable_internal_db.py | 8 | 1146 | #!/usr/bin/env python2
"""SSH in to a running appliance and set up an internal DB.
An optional region can be specified (default 0), and the script
will use the first available unpartitioned disk as the data volume
for postgresql.
Running this script against an already configured appliance is
unsupported, hilarity ma... | gpl-2.0 |
ryenus/vbox | src/VBox/HostServices/SharedOpenGL/crserverlib/get_sizes.py | 1 | 17633 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
num_get_values = {
'GL_ACCUM_ALPHA_BITS' : 1,
'GL_ACCUM_BLUE_BITS' : 1,
'GL_ACCUM_CLEAR_VALUE': 4,
'GL_ACCUM_GREEN_BITS' : 1,
'GL_ACCUM_RED_BITS' : 1,
... | gpl-2.0 |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/frame/test_nonunique_indexes.py | 2 | 18038 | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, MultiIndex, Series, date_range
from pandas.tests.frame.common import TestData
import pandas.util.testing as tm
from pandas.util.testing import assert_frame_equal, assert_series_equal
class TestDataFrameNonuniqueIndexes(TestData):
... | apache-2.0 |
ZuluPro/libcloud | libcloud/dns/drivers/onapp.py | 10 | 10684 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
gistic/PublicSpatialImpala | thirdparty/thrift-0.9.0/lib/py/src/TSerialization.py | 184 | 1387 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
gabrielcnr/pytest | testing/test_pluginmanager.py | 4 | 12014 | import pytest
import py
import os
from _pytest.config import get_config, PytestPluginManager
from _pytest.main import EXIT_NOTESTSCOLLECTED
@pytest.fixture
def pytestpm():
return PytestPluginManager()
class TestPytestPluginInteractions:
def test_addhooks_conftestplugin(self, testdir):
testdir.makepyf... | mit |
dzbarsky/servo | components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py | 241 | 1433 | import WebIDL
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodUniqueness1 {
getter deleter boolean (DOMString name);
getter boolean (DOMString name);
};
""")
results = parser.finish()
ex... | mpl-2.0 |
linktlh/Toontown-journey | toontown/coghq/LaserGameRoll.py | 4 | 1977 | import random
from direct.distributed import ClockDelta
from direct.task import Task
from toontown.coghq import LaserGameBase
class LaserGameRoll(LaserGameBase.LaserGameBase):
def __init__(self, funcSuccess, funcFail, funcSendGrid, funcSetGrid):
LaserGameBase.LaserGameBase.__init__(self, funcSuccess, fun... | apache-2.0 |
framon/samba | buildtools/wafadmin/Runner.py | 16 | 5556 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008 (ita)
"Execute the tasks"
import os, sys, random, time, threading, traceback
try: from Queue import Queue
except ImportError: from queue import Queue
import Build, Utils, Logs, Options
from Logs import debug, error
from Constants import *
GAP = 15
run... | gpl-3.0 |
mchasal/compose | compose/project.py | 15 | 12276 | from __future__ import unicode_literals
from __future__ import absolute_import
from functools import reduce
import logging
from docker.errors import APIError
from .config import get_service_name_from_net, ConfigurationError
from .const import DEFAULT_TIMEOUT, LABEL_PROJECT, LABEL_SERVICE, LABEL_ONE_OFF
from .containe... | apache-2.0 |
mahendra-r/edx-platform | lms/djangoapps/certificates/tests/test_queue.py | 43 | 5953 | # -*- coding: utf-8 -*-
"""Tests for the XQueue certificates interface. """
from contextlib import contextmanager
import json
from mock import patch, Mock
from nose.plugins.attrib import attr
from django.test import TestCase
from django.test.utils import override_settings
from opaque_keys.edx.locator import CourseLoc... | agpl-3.0 |
linkedin/indextank-service | storefront/boto/s3/bucketlistresultset.py | 3 | 2380 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.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, modi... | apache-2.0 |
ingenieroariel/geonode | geonode/upload/forms.py | 1 | 8421 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
stanxii/wen9000 | node.js/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/generator/msvs.py | 41 | 109235 | # 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.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.MSVSNew a... | lgpl-2.1 |
vancepym/ogre | Tools/Blender2.6Export/ogre_mesh_exporter/global_properties.py | 16 | 9771 | # ##### BEGIN MIT LICENSE BLOCK #####
# Copyright (C) 2011 by Lih-Hern Pang
# 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 ... | mit |
LittleLama/Sick-Beard-BoxCar2 | cherrypy/lib/static.py | 39 | 14178 | import logging
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg'] = 'image/x-dwg'
mimetypes.types_map['.ico'] = 'image/x-icon'
mimetypes.types_map['.bz2'] = 'application/x-bzip2'
mimetypes.types_map['.gz'] = 'application/x-gzip'
import os
import re
import stat
import time
from urllib import unquote
import ... | gpl-3.0 |
havt/odoo | addons/account/product.py | 374 | 2897 | # -*- 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 |
open-io/oio-swift | tests/unit/controllers/test_container.py | 1 | 5114 | import unittest
from mock import patch
from mock import MagicMock as Mock
from oioswift.common.ring import FakeRing
from oioswift import server as proxy_server
from swift.common.swob import Request
from swift.proxy.controllers.base import headers_to_container_info
from swift.common.request_helpers import get_sys_meta_... | apache-2.0 |
libcrosswind/libcrosswind | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/idlelib/idle_test/test_calltips.py | 27 | 7140 | import unittest
import idlelib.CallTips as ct
CTi = ct.CallTips() # needed for get_entity test in 2.7
import textwrap
import types
import warnings
default_tip = ''
# Test Class TC is used in multiple get_argspec test methods
class TC(object):
'doc'
tip = "(ai=None, *args)"
def __init__(self, ai=None, *b)... | gpl-3.0 |
mogoweb/chromium-crosswalk | remoting/tools/verify_resources.py | 25 | 5148 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Verifies that GRD resource files define all the strings used by a given
set of source files. For file formats where it is not po... | bsd-3-clause |
hydroshare/hydroshare | theme/templatetags/comments_tags.py | 1 | 3173 |
from future.builtins import int
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.template.defaultfilters import linebreaksbr, urlize
from mezzanine import template
from mezzanine.conf import settings
from theme.forms import ThreadedCommentForm
from mezzanine.generic.model... | bsd-3-clause |
gilbertpilz/solum | solum/tests/objects/test_pipeline.py | 2 | 2831 | # Copyright 2014 - Rackspace US, 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 ... | apache-2.0 |
PLyczkowski/Sticky-Keymap | 2.74/python/lib/tarfile.py | 80 | 90965 | #!/usr/bin/env python3
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any pers... | gpl-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/whoosh/query/terms.py | 39 | 17708 | # Copyright 2007 Matt Chaput. 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,
# this list of conditions and the... | bsd-3-clause |
duncanwp/iris | lib/iris/experimental/__init__.py | 17 | 1074 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
veger/ansible | lib/ansible/modules/cloud/azure/azure_rm_containerinstance_facts.py | 33 | 9452 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.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': '1.1',
... | gpl-3.0 |
chirilo/remo | vendor-local/lib/python/rest_framework/utils/serializer_helpers.py | 18 | 3752 | from __future__ import unicode_literals
import collections
from rest_framework.compat import OrderedDict, unicode_to_repr
class ReturnDict(OrderedDict):
"""
Return object from `serialier.data` for the `Serializer` class.
Includes a backlink to the serializer instance for renderers
to use if they need ... | bsd-3-clause |
krdlab/ansible-modules-core | cloud/amazon/ec2_key.py | 51 | 7841 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
yx91490/pgcli | pgcli/packages/counter.py | 20 | 6273 | #copied from http://code.activestate.com/recipes/576611-counter-class/
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
class Counter(dict):
'''Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are stored as dictionary ... | bsd-3-clause |
popazerty/enigma2-4.3 | lib/python/Components/UsageConfig.py | 2 | 55113 | import os
from time import time
from enigma import eDVBDB, eEPGCache, setTunerTypePriorityOrder, setPreferredTuner, setSpinnerOnOff, setEnableTtCachingOnOff, eEnv, Misc_Options, eBackgroundFileEraser, eServiceEvent
from Components.About import about
from Components.Harddisk import harddiskmanager
from config import Con... | gpl-2.0 |
Peter92/MouseTrack | mousetracks/utils/sockets.py | 1 | 2511 | """This is part of the Mouse Tracks Python application.
Source: https://github.com/Peter92/MouseTracks
"""
#Easy to use wrappers for sockets
from __future__ import absolute_import
import psutil
import socket
import struct
from select import select
from .compatibility import pickle
def send_msg(sock, msg):
"""P... | gpl-3.0 |
BackupGGCode/python-for-android | python3-alpha/python3-src/Lib/unittest/test/support.py | 770 | 3379 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... | apache-2.0 |
namccart/gnuradio | gr-digital/python/digital/qa_burst_shaper.py | 18 | 14818 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 versio... | gpl-3.0 |
pombredanne/product-definition-center | pdc/apps/release/lib.py | 3 | 6715 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from django.core.exceptions import ValidationError
from django.db import transaction
import json
import productmd
from productmd.common import create_release_id
from pdc.apps.common import hacks as common_hack... | mit |
drufat/sympy | sympy/functions/special/tests/test_gamma_functions.py | 33 | 16080 | from sympy import (
Symbol, gamma, I, oo, nan, zoo, factorial, sqrt, Rational, log,
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin,
cos, O, lowergamma, exp, erf, erfc, exp_polar, harmonic, zeta,conjugate)
from sympy.core.function import ArgumentIndexError
from sympy.utilities.randtest ... | bsd-3-clause |
ajjl/ITK | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/typedef.py | 12 | 1454 | # Copyright 2014 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
defines class that describes C++ typedef declaration
"""
from . import declaration
from . import dependencies
class typedef... | apache-2.0 |
december-soul/beets-plugin-importplaycount | importplaycount.py | 1 | 3144 | # coding=utf-8
# Copyright 2014, Rafael Bodill http://github.com/rafi
# vim: set ts=8 sw=4 tw=80 et :
import logging
import requests
import json
from beets.plugins import BeetsPlugin
from beets import ui
from beets import dbcore
from beets import config
from pprint import pprint
from beets.dbcore import types
log = ... | gpl-2.0 |
nirmeshk/oh-mainline | vendor/packages/Jinja2/jinja2/testsuite/security.py | 415 | 6204 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~
Checks the sandbox and other security features.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import E... | agpl-3.0 |
kindy61/mako | test/test_filters.py | 1 | 7765 | # -*- coding: utf-8 -*-
from mako.template import Template
import unittest
from util import result_lines, flatten_result
class FilterTest(unittest.TestCase):
def test_basic(self):
t = Template("""
${x | myfilter}
""")
assert flatten_result(t.render(x="this is x", myfilter=lambda t: "MYFILT... | mit |
minorua/QGIS | python/plugins/processing/core/ProcessingResults.py | 15 | 1581 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingResults.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
engdan77/edoAutoHomeMobile | twisted/protocols/htb.py | 51 | 9330 | # -*- test-case-name: twisted.test.test_htb -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Hierarchical Token Bucket traffic shaping.
Patterned after U{Martin Devera's Hierarchical Token Bucket traffic
shaper for the Linux kernel<http://luxik.cdi.cz/~devik/qos/htb/>}.
@seealso: U{HT... | mit |
acsone/Arelle | arelle/plugin/xbrlDB/XbrlSemanticJsonDB.py | 2 | 49520 | '''
XbrlSemanticJsonDB.py implements an JSON database interface for Arelle, based
on a concrete realization of the Abstract Model PWD 2.0 layer. This is a semantic
representation of XBRL information.
This module may save directly to a JSON Server (TBD) or to append to a file of JSON.
This module provides the execu... | apache-2.0 |
akretion/pos-addons | tg_partner_firstname/tg_partner_firstname.py | 11 | 2548 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 - Thierry Godin. All Rights Reserved
# @author Thierry Godin <thierry@lapinmoutardepommedauphine.com>
#
# This program is free softw... | lgpl-3.0 |
purism/pdak | dak/dakdb/update76.py | 8 | 1666 | #!/usr/bin/env python
# coding=utf8
"""
Add list of closed bugs to changes table
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2012 Ansgar Burchardt <ansgar@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
... | gpl-2.0 |
Oleg-k/kernel_source_s8600 | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
antsant/namebench | nb_third_party/graphy/backends/google_chart_api/__init__.py | 205 | 2023 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
papoteur-mga/mageiaSync | setup.py | 1 | 1249 | from distutils.core import setup
import os
LOCALE_DIR= '/usr/share/locale'
locales = []
if os.path.exists('po/locale'):
for lang in os.listdir('po/locale'):
locales.append(os.path.join(lang, 'LC_MESSAGES'))
data_files = [("share/applications/", ["share/applications/mageiasync.desktop"]),
("... | gpl-3.0 |
abstract-open-solutions/OCB | addons/edi/__init__.py | 437 | 1157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
ehashman/oh-mainline | vendor/packages/Django/tests/regressiontests/context_processors/tests.py | 96 | 1344 | """
Tests for Django's bundled context processors.
"""
from django.test import TestCase
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.core.context_processors.request`` processor.
"""
urls = 'regressiontests.context_processors.urls'
def test_request_attributes(self):
... | agpl-3.0 |
tectronics/cortex-vfx | test/IECore/SWAReaderTest.py | 12 | 5143 | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of sou... | bsd-3-clause |
Itxaka/libcloud | docs/examples/compute/vmware_vcloud_1.5.py | 60 | 2076 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
# Skip this step if you are launching nodes on an official vCloud
# provider. It is intended only for self signed SSL certs in
# vanilla vCloud Director v1.5 test deployments.
# Note: Code like this ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.