repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
sangh/LaserShow | pyglet-hg/pyglet/font/freetype_lib.py | 32 | 14009 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
jacebrowning/dropthebeat | setup.py | 1 | 2371 | #!/usr/bin/env python
"""Setup script for DropTheBeat."""
import os
import sys
import setuptools
PACKAGE_NAME = 'dtb'
MINIMUM_PYTHON_VERSION = 3, 4
def check_python_version():
"""Exit when the Python version is too low."""
if sys.version_info < MINIMUM_PYTHON_VERSION:
sys.exit("Python {}.{}+ is r... | lgpl-3.0 |
jeremyh/eo-datasets | tests/integration/test_tostac.py | 2 | 3045 | import json
import shutil
from pathlib import Path
import pytest
from eodatasets3 import serialise
from eodatasets3.scripts import tostac
from tests.common import run_prepare_cli, assert_same
TO_STAC_DATA: Path = Path(__file__).parent.joinpath("data/tostac")
ODC_METADATA_FILE: str = "ga_ls8c_ard_3-1-0_088080_2020-05-... | apache-2.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_ipv6.py | 117 | 2847 | from __future__ import unicode_literals
from django.utils import unittest
from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address
class TestUtilsIPv6(unittest.TestCase):
def test_validates_correct_plain_address(self):
self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a'))
... | apache-2.0 |
jiachenning/odoo | addons/stock_landed_costs/product.py | 364 | 1611 | # -*- 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 |
hradec/gaffer | python/GafferSceneTest/PointConstraintTest.py | 5 | 6359 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
MeanEYE/Sunflower | sunflower/gui/preferences/toolbar.py | 1 | 8025 | import json
from gi.repository import Gtk
from sunflower.widgets.settings_page import SettingsPage
class Column:
NAME = 0
DESCRIPTION = 1
TYPE = 2
ICON = 3
CONFIG = 4
class ToolbarOptions(SettingsPage):
"""Toolbar options extension class"""
def __init__(self, parent, application):
SettingsPage.__init__(se... | gpl-3.0 |
raiden-network/raiden | raiden/utils/notifying_queue.py | 1 | 1422 | from typing import Generic, Iterable, List, TypeVar
from gevent.event import Event
from gevent.queue import Queue
T = TypeVar("T")
class NotifyingQueue(Event, Generic[T]):
"""This is not the same as a JoinableQueue. Here, instead of waiting for
all the work to be processed, the wait is for work to be availa... | mit |
bacaldwell/ironic | ironic/common/safe_utils.py | 17 | 2062 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
ccn-2m/django | django/contrib/gis/tests/__init__.py | 113 | 4367 | from django.conf import settings
from django.test.simple import build_suite, DjangoTestSuiteRunner
from django.utils import unittest
from .test_geoforms import GeometryFieldTest
from .test_measure import DistanceTest, AreaTest
from .test_spatialrefsys import SpatialRefSysTest
def geo_apps(namespace=True, runtests=Fa... | bsd-3-clause |
Maspear/odoo | addons/l10n_ma/__openerp__.py | 260 | 2074 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 kazacube (http://kazacube.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
yanheven/neutron | neutron/plugins/brocade/nos/nctemplates.py | 63 | 6386 | # Copyright (c) 2013 Brocade Communications Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | apache-2.0 |
s-crow-project/s-crow | test/functional/keypool-topup.py | 18 | 2808 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test HD Wallet keypool restore function.
Two nodes. Node1 is under test. Node0 is providing transactions an... | mit |
mukilan/servo | python/servo/devenv_commands.py | 3 | 1240 | from __future__ import print_function, unicode_literals
import subprocess
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)
from servo.command_base import CommandBase
@CommandProvider
class MachCommands(CommandBase):
@Command('cargo',
description='Run Cargo',
... | mpl-2.0 |
duhzecca/cinder | cinder/volume/drivers/emc/emc_vmax_fc.py | 12 | 14891 | # Copyright (c) 2015 EMC 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 requ... | apache-2.0 |
pwarren/AGDeviceControl | agdevicecontrol/tests/test_aggregator.py | 1 | 9428 | # AGDeviceControl
# Copyright (C) 2005 The Australian National University
#
# This file is part of AGDeviceControl.
#
# AGDeviceControl 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 L... | gpl-2.0 |
kaiweifan/vse-lbaas-plugin-poc | quantum/tests/unit/nicira/fake_nvpapiclient.py | 3 | 24284 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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... | apache-2.0 |
vallemrv/tpvB3 | tpv_for_eetop/valle_libs/valleorm/models/relatedfields.py | 1 | 9703 | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <vallemrv>
# @Date: 29-Aug-2017
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 18-Feb-2018
# @License: Apache license vesion 2.0
import sys
import inspect
import importlib
from constant import constant
class RelationShip(object... | apache-2.0 |
alrusdi/python-social-auth | social/apps/tornado_app/utils.py | 76 | 1546 | import warnings
from functools import wraps
from social.utils import setting_name
from social.strategies.utils import get_strategy
from social.backends.utils import get_backend
DEFAULTS = {
'STORAGE': 'social.apps.tornado_app.models.TornadoStorage',
'STRATEGY': 'social.strategies.tornado_strategy.TornadoStr... | bsd-3-clause |
DivineHime/seishirou | lib/youtube_dl/extractor/southpark.py | 35 | 4150 | # coding: utf-8
from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class SouthParkIE(MTVServicesInfoExtractor):
IE_NAME = 'southpark.cc.com'
_VALID_URL = r'https?://(?:www\.)?(?P<url>southpark\.cc\.com/(?:clips|(?:full-)?episodes)/(?P<id>.+?)(\?|#|$))'
_FEED_URL = 'http://... | gpl-3.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/test/test_email/test_parser.py | 90 | 1230 | import io
import email
import unittest
from email.message import Message
from test.test_email import TestEmailBase
class TestCustomMessage(TestEmailBase):
class MyMessage(Message):
def __init__(self, policy):
self.check_policy = policy
super().__init__()
MyPolicy = TestEmailB... | lgpl-3.0 |
AunShiLord/sympy | examples/advanced/pyglet_plotting.py | 15 | 7157 | #!/usr/bin/env python
"""
Plotting Examples
Suggested Usage: python -i plotting.py
"""
from sympy import symbols
from sympy.plotting.pygletplot import PygletPlot
from sympy import sin, cos, pi, sqrt, exp
from time import sleep, clock
def main():
x, y, z = symbols('x,y,z')
# toggle axes visibility wit... | bsd-3-clause |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/sql/tools/ssl_certs/create.py | 2 | 3612 | # Copyright 2013 Google Inc. All Rights Reserved.
"""Creates an SSL certificate for a Cloud SQL instance."""
import os
from googlecloudsdk.core.util import files
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core.util i... | apache-2.0 |
gasseluk/htc-vision-kernel-ics | scripts/build-all.py | 308 | 9473 | #! /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 |
sassoftware/saspy | saspy/sasiocom.py | 1 | 37140 | #
# Copyright SAS Institute
#
# 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 |
CindyvdVries/News_Crawler | Sat2/sat/pipelines.py | 1 | 2575 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.utils.conf import get_config
from scrapy.exceptions import DropItem
import pika.credentials
import pika
import json
... | gpl-3.0 |
hyperized/ansible | test/units/module_utils/xenserver/test_netaddr_functions.py | 21 | 5154 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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 pytest
from ansible.module_utils.common.netw... | gpl-3.0 |
popazerty/obh-sh4 | lib/python/Components/PluginList.py | 47 | 2742 | from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
from enigma import eListboxPythonMultiContent, gFont, BT_SCALE, BT_KEEP_ASPECT_RATIO
from Tools.LoadPixmap import LoadPixmap
impor... | gpl-2.0 |
ltn100/prompty | test/test_functionContainer.py | 1 | 1265 | #!/usr/bin/env python
# vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import os
from test import prompty
from test import UnitTestWrapper
class My... | mit |
hackerbot/DjangoDev | tests/validation/test_picklable.py | 576 | 2010 | import pickle
from unittest import TestCase
from django.core.exceptions import ValidationError
class PickableValidationErrorTestCase(TestCase):
def test_validationerror_is_picklable(self):
original = ValidationError('a', code='something')
unpickled = pickle.loads(pickle.dumps(original))
... | bsd-3-clause |
RealDigitalMediaAndroid/linux-imx6 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
girving/tensorflow | tensorflow/python/autograph/utils/__init__.py | 27 | 1302 | # 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 |
OscarSwanros/swift | utils/cmpcodesize/cmpcodesize/compare.py | 13 | 10505 | # ====--- compare.py - Compare built products' sizes -*- coding: utf-8 -*-===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.t... | apache-2.0 |
toomoresuch/pysonengine | eggs/Werkzeug-0.6.2-py2.6.egg/werkzeug/contrib/sessions.py | 24 | 12250 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... | mit |
acsone/odoo | addons/auth_oauth/controllers/main.py | 55 | 8005 | import functools
import logging
import simplejson
import urlparse
import werkzeug.utils
from werkzeug.exceptions import BadRequest
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_... | agpl-3.0 |
sargas/scipy | scipy/integrate/odepack.py | 3 | 6824 | # Author: Travis Oliphant
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
from . import _odepack
from copy import copy
_msgs = {2: "Integration successful.",
-1: "Excess work done on this call (perhaps wrong Dfun type).",
-2: "Excess accuracy requested (toleran... | bsd-3-clause |
thurt/arangodb | 3rdParty/V8-4.3.61/build/gyp_environment.py | 25 | 1668 | # Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_v8 and landmines.py which run at different stages of runhooks. To
make sure ... | apache-2.0 |
jonnyhtw/cylc | lib/cylc/gui/view_tree.py | 2 | 16794 | #!/usr/bin/env python
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2018 NIWA
#
# 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 yo... | gpl-3.0 |
rrohan/scikit-learn | sklearn/manifold/mds.py | 257 | 15138 | """
Multi-dimensional Scaling (MDS)
"""
# author: Nelle Varoquaux <nelle.varoquaux@gmail.com>
# Licence: BSD
import numpy as np
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_array, check_symmetric
from ..externals.joblib impo... | bsd-3-clause |
indictranstech/tele-erpnext | erpnext/accounts/doctype/c_form/c_form.py | 54 | 2713 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from frappe.model.document import Document
class CForm(Document):
def validate(self):
... | agpl-3.0 |
sushantgoel/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | apache-2.0 |
joachimmetz/plaso | plaso/formatters/default.py | 4 | 1240 | # -*- coding: utf-8 -*-
"""The default event formatter."""
from plaso.formatters import interface
from plaso.lib import definitions
class DefaultEventFormatter(interface.BasicEventFormatter):
"""Formatter for events that do not have any defined formatter."""
DATA_TYPE = 'event'
FORMAT_STRING = '<WARNING DEFAU... | apache-2.0 |
tsheasha/fullerite | src/diamond/collectors/memory_docker/memory_docker.py | 35 | 1143 | # coding=utf-8
"""
The MemoryDockerCollector collects memory statistics from docker containers
#### Dependencies
* docker
"""
import os
import sys
try:
import docker
except ImportError:
docker = None
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)),
'm... | apache-2.0 |
PieterMostert/Lipgloss | model/serializers/oxideserializer.py | 1 | 2233 | import json
try:
from lipgloss.core_data import Oxide
except:
from ..lipgloss.core_data import Oxide
class OxideSerializer(object):
"""A class to support serializing/deserializing of a single oxide and dictionaries of oxides. Needs improvement"""
@staticmethod
def get_serializable_oxide(oxide):
... | gpl-3.0 |
4rch0x0/void-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 |
akashsinghal/Speech-Memorization-App | Python_Backend/env/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 714 | 5988 | from __future__ import absolute_import
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen... | apache-2.0 |
hosseinmh/jango_learning | .venv/lib/python2.7/site-packages/wheel/signatures/djbec.py | 566 | 6755 | # Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... | mit |
djmaze/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py | 122 | 5545 | # Copyright (C) 2011 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 |
nishad-jobsglobal/odoo-marriot | addons/account/project/report/__init__.py | 427 | 1175 | # -*- 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 |
fnordahl/nova | tools/colorizer.py | 67 | 11774 | #!/usr/bin/env python
# Copyright (c) 2013, Nebula, Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file exce... | apache-2.0 |
metafisica/yowdaemon | yowsup/layers/axolotl/protocolentities/test_iq_keys_get_result.py | 48 | 2793 | from yowsup.layers.protocol_iq.protocolentities.test_iq_result import ResultIqProtocolEntityTest
from yowsup.layers.axolotl.protocolentities import ResultGetKeysIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
from axolotl.util.keyhelper import KeyHelper
from axolotl.ecc.curve import Curve
class ResultGetK... | gpl-3.0 |
darongliu/Lstm_Turing_LM | lstm-neural-turing-machines-lm/analysis/v1-one-weight-same/controller.py | 29 | 1213 | import theano
import theano.tensor as T
import numpy as np
from theano_toolkit import utils as U
import controller
import model
import head
from collections import namedtuple
#from theano_toolkit.parameters import Parameters
def build(P, input_size, output_size, mem_width):
"""
Create controller function for... | mit |
sharhar/USB-Thing | UpdaterFiles/Lib/python-3.5.1.amd64/Lib/ssl.py | 7 | 41781 | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O erro... | apache-2.0 |
4eek/edx-platform | openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py | 80 | 5764 | """
Course Structure api.py tests
"""
from .api import course_structure
from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tes... | agpl-3.0 |
lukeiwanski/tensorflow | tensorflow/contrib/autograph/pyct/static_analysis/type_info_test.py | 6 | 6587 | # 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 |
Infinite-Code/PyChart | pychart/afm/NewCenturySchlbk_BoldItalic.py | 1 | 1559 | from __future__ import absolute_import
# AFM font NewCenturySchlbk-BoldItalic (path: /usr/share/fonts/afms/adobe/pncbi8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
from . import dir
dir.afm["NewCenturySchlbk-BoldItalic"] = (500, 500, 500, 500, 500, 5... | gpl-2.0 |
marcanpilami/MAGE | ref/graph_mlg2.py | 2 | 4629 | # coding: utf-8
## Python imports
## Django imports
from django.db.models.query import Prefetch
## MAGE imports
from ref.models import ComponentInstance
from ref.models.instances import ComponentInstanceRelation
from ref.models.parameters import getParam
def getNetwork(instances_to_draw, select_related={'dependsOn... | apache-2.0 |
sajuptpm/contrail-controller | src/config/common/tests/test_cache_container.py | 13 | 1250 | import unittest
from cfgm_common.utils import CacheContainer
class TestCachContainer(unittest.TestCase):
def test_cache_container_trimming(self):
c = CacheContainer(5)
l = ['a','b','c','d','e','f','h','i','j','k','m']
for index, value in enumerate(l):
c[value] = index+1
... | apache-2.0 |
tudorvio/nova | nova/tests/unit/objects/test_fixed_ip.py | 46 | 15204 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
gmittal/aar-nlp-research-2016 | src/pygame-pygame-6625feb3fc7f/test/sysfont_test.py | 21 | 1666 | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | mit |
factorlibre/openerp-server-6.1 | openerp/pychart/legend_doc.py | 15 | 1949 | # -*- coding: utf-8 -*-
# automatically generated by generate_docs.py.
doc="""Attributes supported by this class are:
inter_col_sep(type:length in points (\\xref{unit})) default="Space between each column in the legend.".
loc(type:(x,y)) default="Bottom-left corner of the legend.
The default location of... | agpl-3.0 |
supergis/QGIS | tests/src/python/test_qgscoordinatetransform.py | 9 | 2444 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsComposition.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
saginoam/RedisModuleTimeSeries | benchmark/redis_ts.py | 1 | 1285 | import random
import redis
import json
client = redis.Redis()
client.execute_command('TS.CREATEDOC', "tsdoctest", json.dumps({
"interval": "hour",
"timestamp": "2016:01:01 00:00:00",
"key_fields": ["userId", "deviceId"],
"ts_fields": ["pagesVisited", "storageUsed", "trafficUsed"]
... | mit |
FelixLoether/blog-project | tests/posts/test_edit.py | 1 | 3272 | from tests.conftest import get_token
def edit_post(postsetup, token, title='title', content='content', tags='',
action='save', url='/1/edit'):
return postsetup.app.post(url, data={
'token': token,
'title': title,
'content': content,
'tags': tags,
'action': action
... | mit |
jhaux/tensorflow | tensorflow/python/debug/cli/debugger_cli_common.py | 68 | 38908 | # 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 |
NoahFlowa/glowing-spoon | venv/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_results.py | 35 | 11736 | from .. import fixtures, config
from ..config import requirements
from .. import exclusions
from ..assertions import eq_
from .. import engines
from ... import testing
from sqlalchemy import Integer, String, select, util, sql, DateTime, text, func
import datetime
from ..schema import Table, Column
class RowFetchTest... | apache-2.0 |
Lujeni/ansible | lib/ansible/modules/net_tools/ldap/ldap_attrs.py | 9 | 10241 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Maciej Delmanowski <drybjed@gmail.com>
# Copyright: (c) 2017, Alexander Korinek <noles@a3k.net>
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
# GNU General Public License v3.0+ (see COPY... | gpl-3.0 |
motion2015/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py | 137 | 4028 | """
Unittests for migrating a course to split mongo
"""
import unittest
from django.core.management import CommandError, call_command
from contentstore.management.commands.migrate_to_split import Command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestC... | agpl-3.0 |
WeblateOrg/weblate | weblate/api/routers.py | 2 | 2159 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... | gpl-3.0 |
grammarware/slps | topics/recovery/hunter/getgrammar.py | 1 | 4880 | #!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
# -*- coding: utf-8 -*-
import os, sys
import xml.etree.ElementTree as ET
sys.path.append(os.getcwd().split('projects')[0]+'projects/slps/shared/python')
import BGF3
from functools import reduce
debug = False
#debug = True
defaults = {'definition-separat... | bsd-3-clause |
nikoonia/gem5v | src/python/m5/util/smartdict.py | 88 | 5995 | # Copyright (c) 2005 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
pridemusvaire/youtube-dl | youtube_dl/extractor/kankan.py | 124 | 1738 | from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
_md5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest()
class KankanIE(InfoExtractor):
_VALID_URL = r'https?://(?:.*?\.)?kankan\.com/.+?/(?P<id>\d+)\.shtml'
_TEST = {
'url': 'http://yinyue.kankan... | unlicense |
wemanuel/smry | smry/Crypto/Util/py3compat.py | 145 | 3912 | # -*- coding: utf-8 -*-
#
# Util/py3compat.py : Compatibility code for handling Py3k / Python 2.x
#
# Written in 2010 by Thorsten Behrens
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the publi... | apache-2.0 |
kulbirsaini/pdfrw-fork | examples/rl1/booklet.py | 1 | 1588 | #!/usr/bin/env python
'''
usage: booklet.py my.pdf
Uses Form XObjects and reportlab to create booklet.my.pdf.
Demonstrates use of pdfrw with reportlab.
'''
import sys
import os
from reportlab.pdfgen.canvas import Canvas
import find_pdfrw
from pdfrw import PdfReader
from pdfrw.buildxobj import pagexobj
from pd... | mit |
mogoweb/webkit_for_android5.1 | webkit/Tools/QueueStatusServer/model/activeworkitems.py | 140 | 3975 | # Copyright (C) 2010 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 ... | apache-2.0 |
Bysmyyr/blink-crosswalk | Tools/Scripts/webkitpy/style/checkers/png_unittest.py | 41 | 5651 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# 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 lis... | bsd-3-clause |
TRESCLOUD/odoopub | extra-addons/l10n_pe_hr_payroll/__init__.py | 5 | 1394 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2014 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
denehs/hostap | wpa_supplicant/examples/wpas-dbus-new-wps.py | 114 | 2221 | #!/usr/bin/python
import dbus
import sys, os
import time
import gobject
from dbus.mainloop.glib import DBusGMainLoop
WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface"
... | gpl-2.0 |
osh/gnuradio | gr-digital/python/digital/qa_correlate_access_code.py | 37 | 3173 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 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 version 3, or... | gpl-3.0 |
MicroWorldwide/namebench | nb_third_party/dns/ipv6.py | 248 | 4995 | # 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 |
varunarya10/oslo.utils | oslo_utils/tests/test_reflection.py | 1 | 8493 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! 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... | apache-2.0 |
kybriainfotech/iSocioCRM | addons/procurement_jit_stock/__openerp__.py | 241 | 1738 | # -*- 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 |
yukaritan/qtbot3 | qtbot3_service/plugins/achievements.py | 1 | 2926 | from util import irc
from util.garbage import rainbow
from util.handler_utils import prehook, get_value, set_value, get_target, cmdhook, fetch_all
from qtbot3_common.types.message import Message
disconnection_ladder = {
1: "Connection reset by peer",
5: "Connection reset by beer",
10: "Connection reset by... | gpl-3.0 |
CobwebOrg/cobweb-django | core/migrations/0014_auto_20181026_1019.py | 1 | 1216 | # Generated by Django 2.1.2 on 2018-10-26 17:19
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0013_user_terms_accepted'),
]
operations = [
migrations.AddField(
model_name='organization'... | mit |
candy7393/VTK | ThirdParty/Twisted/twisted/trial/test/sample.py | 41 | 2105 | """This module is used by test_loader to test the Trial test loading
functionality. Do NOT change the number of tests in this module. Do NOT change
the names the tests in this module.
"""
import unittest as pyunit
from twisted.trial import unittest
from twisted.python.util import mergeFunctionMetadata
class FooTes... | bsd-3-clause |
alex/boto | tests/integration/s3/test_connection.py | 89 | 9892 | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2011 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 r... | mit |
bulletproofsysadmin/bulletproofsysadmin.github.io | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 426 | 56534 | # 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 filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | gpl-2.0 |
jarvys/django-1.7-jdb | django/utils/lru_cache.py | 270 | 7647 | try:
from functools import lru_cache
except ImportError:
# backport of Python's 3.3 lru_cache, written by Raymond Hettinger and
# licensed under MIT license, from:
# <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/>
# Should be removed when Django only sup... | bsd-3-clause |
pearsonlab/nipype | nipype/workflows/smri/freesurfer/recon.py | 6 | 3402 | from ....pipeline import engine as pe
from ....interfaces import freesurfer as fs
from ....interfaces import utility as niu
def create_skullstripped_recon_flow(name="skullstripped_recon_all"):
"""Performs recon-all on voulmes that are already skull stripped.
FreeSurfer failes to perform skullstrippig on some ... | bsd-3-clause |
stannynuytkens/youtube-dl | youtube_dl/extractor/youku.py | 14 | 11404 | # coding: utf-8
from __future__ import unicode_literals
import random
import re
import string
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_class,
js_to_json,
str_or_none,
strip_jsonp,
)
class YoukuIE(InfoExtractor):
IE_NAME = 'youku'
... | unlicense |
mitar/django | django/views/generic/edit.py | 9 | 7494 | from django.forms import models as model_forms
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
from django.views.generic.detail import (SingleObjectMixin,
SingleOb... | bsd-3-clause |
sudosurootdev/external_chromium_org | third_party/google_appengine_cloudstorage/cloudstorage/errors.py | 102 | 3860 | # Copyright 2012 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 ag... | bsd-3-clause |
github4ry/Skoarcery | Skoarcery/laboaratoary/Test_Sclang.py | 2 | 3063 |
import unittest
from subprocess import Popen, PIPE
import subprocess
class Test_Sclang(unittest.TestCase):
#home = "/p/supercollider/build/Install/SuperCollider/SuperCollider.app/Contents/Resources/"
#home = "C:\\supercollider\\SuperCollider\\"
home = "C:\\Users\\lucas\\Documents\\GitHub\\supercollider\... | artistic-2.0 |
arnedesmedt/dotfiles | .config/sublime-text-3/Packages.symlinkfollow/SublimeCodeIntel/libs/codeintel2/pythoncile1.py | 7 | 73315 | #!/usr/bin/env python
# Copyright (c) 2004-2006 ActiveState Software Inc.
#
# Contributors:
# Trent Mick (TrentM@ActiveState.com)
"""
pythoncile - a Code Intelligence Language Engine for the Python language
Module Usage:
from pythoncile import scan
mtime = os.stat("foo.py")[stat.ST_MTIME]
... | mit |
mablae/weblate | weblate/trans/models/dictionary.py | 2 | 6807 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
darkleons/lama | addons/project_issue_sheet/__openerp__.py | 52 | 1873 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
MattCrystal/tripping-wookie | 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 |
citrix-openstack-build/neutron | neutron/db/extradhcpopt_db.py | 4 | 5714 | # Copyright (c) 2013 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... | apache-2.0 |
Stanford-Legal-Tech-Design/legaltech-rapidpro | temba/ivr/migrations/0001_initial.py | 7 | 3479 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('flows', '0001_initial'),
('contac... | agpl-3.0 |
handroissuazo/tensorflow | tensorflow/tools/docs/generate_test.py | 3 | 3930 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.