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 |
|---|---|---|---|---|---|
ajgallegog/gem5_arm | src/mem/ruby/network/BasicLink.py | 53 | 2758 | # Copyright (c) 2011 Advanced Micro Devices, 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... | bsd-3-clause |
miracle2k/graphql-relay-py | graphql_relay/node/tests/test_plural.py | 1 | 3850 | from collections import namedtuple
from graphql import graphql
from graphql.type import (
GraphQLSchema,
GraphQLObjectType,
GraphQLField,
GraphQLString,
)
from graphql_relay.node.plural import plural_identifying_root_field
userType = GraphQLObjectType(
'User',
fields=lambda: {
'userna... | mit |
tqchen/tvm | python/tvm/micro/debugger.py | 1 | 6484 | # 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 |
nbenoit/bitcoin | contrib/seeds/makeseeds.py | 24 | 5717 | #!/usr/bin/env python3
# Copyright (c) 2013-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.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
#... | mit |
gylian/sickrage | sickbeard/notifiers/trakt.py | 1 | 9490 | # Author: Dieter Blomme <dieterblomme@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 t... | gpl-3.0 |
osharim/xhtml2pdf | test/pdfjoiner.py | 154 | 1447 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
adiyengar/Spirit | spirit/core/utils/markdown/markdown.py | 8 | 1352 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import mistune
from .block import BlockLexer
from .inline import InlineLexer
from .renderer import Renderer
class Markdown(mistune.Markdown):
def __init__(self, renderer=None, **kwargs):
if renderer is None:
render... | mit |
spektom/incubator-airflow | airflow/providers/amazon/aws/sensors/sqs.py | 4 | 3705 | #
# 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... | apache-2.0 |
Danfocus/Flexget | flexget/utils/qualities.py | 2 | 17972 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import re
import copy
import logging
log = logging.getLogger('utils.qualities')
class QualityComponent(object):
""""""
def ... | mit |
gundalow/ansible | test/units/plugins/become/test_sudo.py | 11 | 1252 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from an... | gpl-3.0 |
xukunfeng/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/msgs.py | 161 | 12254 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | gpl-3.0 |
madprime/django_study_enrollment | users/views.py | 2 | 2215 | from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from registration import signals
from registration.models import RegistrationProfile
from registration.backends.default.views import RegistrationView as BaseRegistrationView
from registration.backends.default.views import ... | mit |
Zentyal/samba | third_party/pep8/testsuite/test_api.py | 36 | 15157 | # -*- coding: utf-8 -*-
import os.path
import shlex
import sys
import unittest
import pep8
from testsuite.support import ROOT_DIR, PseudoFile
E11 = os.path.join(ROOT_DIR, 'testsuite', 'E11.py')
class DummyChecker(object):
def __init__(self, tree, filename):
pass
def run(self):
if False:
... | gpl-3.0 |
dbmi-pitt/DIKB-Micropublication | scripts/mp-scripts/Bio/PopGen/Async/Local.py | 5 | 2004 | # Copyright 2007 by Tiago Antao <tiagoantao@gmail.com>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
'''
Asynchronous local execution.
Supports multicore architectures.
'''
... | apache-2.0 |
Fat-Zer/FreeCAD_sf_master | src/Mod/Fem/femsolver/elmer/equations/linear.py | 12 | 4560 | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... | lgpl-2.1 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib-tk/FixTk.py | 96 | 2938 | import sys, os
# Delay import _tkinter until we have set TCL_LIBRARY,
# so that Tcl_FindExecutable has a chance to locate its
# encoding directory.
# Unfortunately, we cannot know the TCL_LIBRARY directory
# if we don't know the tcl version, which we cannot find out
# without import Tcl. Fortunately, Tcl will itself ... | gpl-2.0 |
jostep/tensorflow | tensorflow/python/estimator/canned/metric_keys.py | 48 | 1578 | # 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 |
fxia22/ASM_xf | PythonD/lib/python2.4/UserString.py | 13 | 7963 | #!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
"""
from types import StringTypes
import sys
__all__ = ["UserString","MutableString"]
class UserString:
def __init__(self, se... | gpl-2.0 |
le9i0nx/ansible | lib/ansible/modules/cloud/openstack/os_port.py | 25 | 12185 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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 |
cgwalters/imagefactory | imgfac/PersistentImageManager.py | 4 | 2885 | # encoding: utf-8
# Copyright 2012 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 applica... | apache-2.0 |
kusha/dialog | dialog/link_parser.py | 1 | 4683 | #!/usr/bin/env python3
"""
Link parser Python bindings.
"""
__author__ = "Mark Birger"
__date__ = "19 Jan 2015"
import subprocess, re, shelve, sys
from dialog import STORAGEPATH
def parse(string):
"""
Link-parser output data parser.
"""
global STORAGEPATH
cache = shelve.open(STORAGEPATH + "/sente... | mit |
roopali8/keystone | keystone/tests/unit/backend/core_ldap.py | 5 | 5520 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
chacoroot/planetary | openerp/tools/image.py | 26 | 10435 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
bpilania/SDNGini | backend/src/gloader/xml/dom/expatbuilder.py | 10 | 36484 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... | mit |
hmit/livestreamer | src/livestreamer/packages/flashmedia/amf.py | 37 | 3315 | from .error import AMFError
from .packet import Packet
from .types import AMF0String, AMF0Value, U8, U16BE, U32BE
class AMFHeader(Packet):
exception = AMFError
def __init__(self, name, value, must_understand=False):
self.name = name
self.value = value
self.must_understand = must_under... | bsd-2-clause |
xzturn/tensorflow | tensorflow/python/distribute/device_util_test.py | 22 | 3457 | # 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 |
pansapiens/mytardis | tardis/tardis_portal/tests/test_ands_doi.py | 5 | 2809 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are per... | bsd-3-clause |
vriera/micropython | drivers/nrf24l01/nrf24l01test.py | 70 | 2887 | """Test for nrf24l01 module."""
import struct
import pyb
from pyb import Pin, SPI
from nrf24l01 import NRF24L01
pipes = (b'\xf0\xf0\xf0\xf0\xe1', b'\xf0\xf0\xf0\xf0\xd2')
def master():
nrf = NRF24L01(SPI(2), Pin('Y5'), Pin('Y4'), payload_size=8)
nrf.open_tx_pipe(pipes[0])
nrf.open_rx_pipe(1, pipes[1])
... | mit |
wkschwartz/django | tests/messages_tests/test_fallback.py | 18 | 6869 | import random
from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from django.utils.crypto import get_random_string
from .base import BaseTests
from .test_cookie import set_cookie_data, stored... | bsd-3-clause |
sramsay64/python-iview | cherrypy/test/test_httpauth.py | 5 | 6357 | from hashlib import md5, sha1
import cherrypy
from cherrypy._cpcompat import ntob
from cherrypy.lib import httpauth
from cherrypy.test import helper
class HTTPAuthTest(helper.CPWebCase):
def setup_server():
class Root:
def index(self):
return "This is public."
i... | gpl-3.0 |
roselleebarle04/django | tests/migrations/test_loader.py | 165 | 13346 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from djang... | bsd-3-clause |
rahuldan/sympy | sympy/stats/tests/test_continuous_rv.py | 12 | 19866 | from __future__ import division
from sympy.stats import (P, E, where, density, variance, covariance, skewness,
given, pspace, cdf, ContinuousRV, sample,
Arcsin, Benini, Beta, BetaPrime, Cauchy,
Chi, ChiSquared,
ChiNoncen... | bsd-3-clause |
mmagnus/rna-pdb-tools | rna_tools/tools/mini_moderna3/moderna/sequence/ModernaAlphabet.py | 2 | 6090 | #!/usr/bin/env python
#
# ModernaAlphabet.py
#
# Defines alphabet for RNA including modifications.
#
# http://iimcb.genesilico.pl/moderna/
#
__author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother"
__copyright__ = "Copyright 2008, The Moderna Project"
__credits__ = ["Janusz Bujnicki"]
__license__ = "GPL"
__main... | gpl-3.0 |
dsfsdgsbngfggb/odoo | addons/delivery/sale.py | 42 | 4541 | # -*- 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 |
YOTOV-LIMITED/kuma | vendor/packages/translate/filters/decoration.py | 25 | 10556 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | mpl-2.0 |
EzyInsights/Diamond | src/diamond/handler/multigraphite.py | 58 | 2412 | # coding=utf-8
"""
Send metrics to a [graphite](http://graphite.wikidot.com/) using the default
interface. Unlike GraphiteHandler, this one supports multiple graphite servers.
Specify them as a list of hosts divided by comma.
"""
from Handler import Handler
from graphite import GraphiteHandler
from copy import deepco... | mit |
wkoathp/glance | glance/tests/functional/db/base.py | 5 | 92939 | # Copyright 2010-2012 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# Copyright 2013 IBM Corp.
# 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
#
#... | apache-2.0 |
acharguruprasad/team4 | contrib/jb2bz.py | 10 | 11004 | #!/usr/local/bin/python
# -*- mode: python -*-
"""
jb2bz.py - a nonce script to import bugs from JitterBug to Bugzilla
Written by Tom Emerson, tree@basistech.com
This script is provided in the hopes that it will be useful. No
rights reserved. No guarantees expressed or implied. Use at your own
risk. May be dangerous... | mpl-2.0 |
robhudson/django | tests/template_tests/test_parser.py | 288 | 4109 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Library, TemplateSyntaxError
from django.template.base import (
TOKEN_BLOCK, FilterExpression, Parser, To... | bsd-3-clause |
Hot2-Kernel/Mystery-Kernel | tools/perf/util/setup.py | 989 | 1543 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
UBERTC/binutils | gdb/testsuite/gdb.python/py-recurse-unwind.py | 6 | 2790 | # Copyright (C) 2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is... | gpl-2.0 |
BT-ojossen/odoo | addons/l10n_in_hr_payroll/report/payment_advice_report.py | 340 | 3967 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
spxiwh/pycbc-glue | test/segments_verify.py | 3 | 16031 | import doctest
import pickle
import random
import sys
import unittest
import verifyutils
#
# How many times to repeat the algebraic tests
#
algebra_repeats = 8000
algebra_listlength = 200
#
# Some useful code.
#
def set1():
return (
segments.segment(-2, 2),
segments.segment(-2, 2),
segments.segment(-2, ... | gpl-3.0 |
namlook/mongokit | tests/test_helpers.py | 5 | 6576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... | bsd-3-clause |
rahul67/hue | desktop/core/src/desktop/redaction/__init__.py | 35 | 1504 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
agry/NGECore2 | scripts/mobiles/generic/faction/imperial/elite_sand_trooper_commando_75.py | 2 | 1453 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... | lgpl-3.0 |
jdsika/TUM_HOly | openrave/docs/preprocess_doxygen.py | 2 | 2409 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 Rosen Diankov (rosen.diankov@gmail.com)
#
# 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/lic... | mit |
Fkawala/gcloud-python | resource_manager/google/cloud/resource_manager/connection.py | 3 | 1594 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
robgolding/tasklib | docs/conf.py | 2 | 8139 | # -*- coding: utf-8 -*-
#
# tasklib documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 10 15:19:07 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | bsd-3-clause |
Supernomad/quantum | docs/conf.py | 1 | 5259 | # -*- coding: utf-8 -*-
#
# quantum documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 12 01:36:36 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | mpl-2.0 |
wedaly/django-rest-framework | tests/test_parsers.py | 81 | 3752 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.files.uploadhandler import MemoryFileUploadHandler
from django.test import TestCase
from django.utils.six.moves import StringIO
from rest_framework.exceptions import ParseError
from rest_framework.parsers import... | bsd-2-clause |
roman-yepishev/mediafire-python-open-sdk | tests/api/test_error.py | 2 | 1379 | import unittest
import responses
from tests.api.base import MediaFireApiTestCase
from mediafire.api import MediaFireApiError
class TestErrorResponse(MediaFireApiTestCase):
def __init__(self, *args, **kwargs):
super(MediaFireApiTestCase, self).__init__(*args, **kwargs)
self.url = self.build_url(... | bsd-2-clause |
janebeckman/gpdb | gpMgmt/bin/gppylib/operations/test/unit/test_unit_dump.py | 10 | 70055 | #
# Copyright (c) Greenplum Inc 2012. All Rights Reserved.
#
import unittest
from datetime import datetime
from gppylib.commands.base import Command, CommandResult
from gppylib.gparray import GpArray, GpDB
from gppylib.operations.backup_utils import *
from gppylib.operations.dump import *
from mock import patch, Magic... | apache-2.0 |
mammique/django | django/core/cache/backends/filebased.py | 112 | 4798 | "File-based cache backend"
import hashlib
import os
import shutil
import time
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache
from django.utils.encoding import force_bytes
class FileBasedCache(BaseCache):
de... | bsd-3-clause |
analyseuc3m/ANALYSE-v1 | lms/djangoapps/course_blocks/transformers/tests/test_visibility.py | 9 | 1377 | """
Tests for VisibilityTransformer.
"""
import ddt
from ..visibility import VisibilityTransformer
from .helpers import BlockParentsMapTestCase, update_block
@ddt.ddt
class VisibilityTransformerTestCase(BlockParentsMapTestCase):
"""
VisibilityTransformer Test
"""
TRANSFORMER_CLASS_TO_TEST = Visibilit... | agpl-3.0 |
renatofb/weblate | weblate/accounts/captcha.py | 8 | 4889 | # -*- 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 |
terbolous/SickRage | lib/github/GistComment.py | 72 | 5098 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
deltreey/ansible | v1/ansible/module_utils/basic.py | 81 | 63055 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
windyuuy/opera | chromium/src/third_party/tlslite/tlslite/mathtls.py | 80 | 11862 | """Miscellaneous helper functions."""
from utils.compat import *
from utils.cryptomath import *
import hmac
# The sha module is deprecated in Python 2.6
try:
import sha
except ImportError:
from hashlib import sha1 as sha
# The md5 module is deprecated in Python 2.6
try:
import md5
except ImportError:
... | bsd-3-clause |
prampey/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hixie75.py | 681 | 8842 | # Copyright 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... | mpl-2.0 |
vlinhd11/vlinhd11-android-scripting | python/src/Lib/lib2to3/fixes/fix_has_key.py | 49 | 3209 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for has_key().
Calls to .has_key() methods are expressed in terms of the 'in'
operator:
d.has_key(k) -> k in d
CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
fixer will chan... | apache-2.0 |
vegetableman/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/main.py | 126 | 2186 | # 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 ... | bsd-3-clause |
jtrobec/pants | src/python/pants/backend/android/tasks/unpack_libraries.py | 2 | 12554 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from hashl... | apache-2.0 |
xtenex/raft | core/network/InMemoryCache.py | 11 | 3444 | #
# Implementation of in-memory cache
#
# Author: Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 Foundatio... | gpl-3.0 |
ramezquitao/pyoptools | pyoptools/all.py | 2 | 2955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2007, 2008, 2009,2010 Ricardo Amézquita Orozco
# <ramezquitao@unal.edu.co>,
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# m... | gpl-3.0 |
dparks1134/UniteM | unitem/tree_common_bases.py | 1 | 7409 | ###############################################################################
# #
# 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 ... | gpl-3.0 |
ttm/oscEmRede | venv/share/doc/networkx-1.8.1/examples/graph/football.py | 17 | 1366 | #!/usr/bin/env python
"""
Load football network in GML format and compute some network statistcs.
Shows how to download GML graph in a zipped file, unpack it, and load
into a NetworkX graph.
Requires Internet connection to download the URL
http://www-personal.umich.edu/~mejn/netdata/football.zip
"""
__author__ = """... | gpl-3.0 |
miketry0313/test | Tools/autotest/pysim/sim_multicopter.py | 54 | 5967 | #!/usr/bin/env python
from multicopter import MultiCopter
import util, time, os, sys, math
import socket, struct
import select, errno
from pymavlink import fgFDM
def sim_send(m, a):
'''send flight information to mavproxy and flightgear'''
global fdm
from math import degrees
earth_rates = util.BodyRa... | gpl-3.0 |
B-Stefan/prov-simple-rest-service | api/document.py | 1 | 1855 | from logging import Logger
from connexion import NoContent, problem
from provdbconnector.provapi import ProvApiException
from provdbconnector import ProvApi
from provdbconnector.db_adapters import SimpleInMemoryAdapter
prov_api = ProvApi(adapter=SimpleInMemoryAdapter, auth_info=None)
pets = {}
logger = Logger(__na... | apache-2.0 |
lgarren/spack | var/spack/repos/builtin/packages/xrandr/package.py | 3 | 1826 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
pshen/ansible | lib/ansible/modules/network/aos/aos_logical_device_map.py | 78 | 8922 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
mcgachey/edx-platform | common/djangoapps/util/disable_rate_limit.py | 164 | 2640 | """Utilities for disabling Django Rest Framework rate limiting.
This is useful for performance tests in which we need to generate
a lot of traffic from a particular IP address. By default,
Django Rest Framework uses the IP address to throttle traffic
for users who are not authenticated.
To disable rate limiting:
1)... | agpl-3.0 |
sintefmath/Splipy | splipy/utils/nutils.py | 1 | 1605 | __doc__ = 'Implementation of convenience methods with respect to nutils integration.'
from splipy import Curve, Surface, Volume
import numpy as np
def controlpoints(spline):
""" Return controlpoints according to nutils ordering """
n = len(spline)
dim = spline.dimension
if isinstance(spline, Curve):
... | gpl-3.0 |
szezso/T.E.S.C.O-kernel_vivo | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
nugget/home-assistant | homeassistant/components/mqtt/cover.py | 2 | 20645 | """
Support for MQTT cover devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.components import cover, mqtt
from homeassistant.components.cover import (
ATTR_POSITION, ... | apache-2.0 |
jckarter/swift | benchmark/scripts/test_utils.py | 16 | 3878 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ===--- test_utils.py ---------------------------------------------------===//
#
# 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... | apache-2.0 |
vipul-sharma20/oh-mainline | vendor/packages/gdata/src/atom/http.py | 23 | 12907 | #!/usr/bin/python
#
# Copyright (C) 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 ... | agpl-3.0 |
Nikea/VisTrails | vistrails/core/repository/poster/streaminghttp.py | 2 | 11131 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | bsd-3-clause |
dvitme/odoo-addons | account_analytic_and_plans/__openerp__.py | 1 | 1492 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 |
furf/pledge_service | lib/validictory/tests/test_schema_schema.py | 40 | 3783 | from unittest import TestCase
import validictory
schema = {
"$schema": "http://json-schema.org/draft-03/schema#",
"id": "http://json-schema.org/draft-03/schema#",
"type": "object",
"properties": {
"type": {
"type": ["string", "array"],
"items": {
"type"... | apache-2.0 |
nick-thompson/servo | components/script/dom/bindings/codegen/parser/tests/test_enum.py | 134 | 2866 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
enum TestEnum {
"",
"foo",
"bar"
};
interface TestEnumInterface {
TestEnum doFoo(boolean arg);
readonly attribute TestEnum foo;
};
""")
results = parser.finish... | mpl-2.0 |
tafaRU/odoo | addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 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 |
manipopopo/tensorflow | tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py | 3 | 33533 | # 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 |
LLNL/spack | var/spack/repos/builtin/packages/py-maestrowf/package.py | 2 | 2065 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyMaestrowf(PythonPackage):
"""A general purpose workflow conductor for running multi-step... | lgpl-2.1 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/pymongo/__init__.py | 10 | 2997 | # Copyright 2009-2015 MongoDB, 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 writin... | mit |
yasserglez/tagfs | packages/tagfs/contrib/django/core/urlresolvers.py | 4 | 14911 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
import re
from django.http import Http404
from django.core.exception... | mit |
rimbalinux/LMD3 | django/db/models/expressions.py | 3 | 5146 | import datetime
from django.utils import tree
from django.utils.copycompat import deepcopy
class ExpressionNode(tree.Node):
"""
Base class for all query expressions.
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%' # This is a quoted % o... | bsd-3-clause |
abstract-open-solutions/l10n-italy | account_fiscal_year_closing/fyc.py | 13 | 29800 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Pexego Sistemas Informáticos. All Rights Reserved
# Copyright (C) 2011 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
#
#... | agpl-3.0 |
broodplank/glass-omap-xrr02 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
gsehub/edx-platform | openedx/core/djangoapps/schedules/tests/test_resolvers.py | 18 | 2866 | import datetime
from unittest import skipUnless
import ddt
from django.conf import settings
from mock import Mock
from openedx.core.djangoapps.schedules.resolvers import BinnedSchedulesBaseResolver
from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory
from openedx.core.djangoapps.site_co... | agpl-3.0 |
sideffect0/django-tastypie | tastypie/utils/formatting.py | 47 | 1142 | from __future__ import unicode_literals
import email
import datetime
import time
from django.utils import dateformat
from tastypie.utils.timezone import make_aware, make_naive, aware_datetime
# Try to use dateutil for maximum date-parsing niceness. Fall back to
# hard-coded RFC2822 parsing if that's not possible.
try:... | bsd-3-clause |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/test/test_minidom.py | 45 | 62440 | # test for xml.dom.minidom
import pickle
from StringIO import StringIO
from test.test_support import verbose, run_unittest, findfile
import unittest
import xml.dom
import xml.dom.minidom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplemen... | gpl-2.0 |
kmonsoor/python-for-android | python3-alpha/python3-src/Lib/test/test_poplib.py | 49 | 11406 | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import time
import errno
from unittest import TestCase
from test import support as test_support
threading = test_suppo... | apache-2.0 |
samuknet/servo | components/script/dom/bindings/codegen/parser/tests/test_interface.py | 117 | 12227 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("interface Foo { };")
results = parser.finish()
harness.ok(True, "Empty interface parsed without error.")
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Sh... | mpl-2.0 |
preo/pylpsolve | pylpsolve/__init__.py | 1 | 1078 | # PyLPSolve is an object oriented wrapper for the open source LP
# solver lp_solve. Copyright (C) 2010 Hoyt Koepke.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of... | lgpl-2.1 |
erichilarysmithsr/givinggraph | givinggraph/twitter/tweets.py | 3 | 1683 | from givinggraph.twitter.common import twitter_get
def get_tweets_by_id(user_id, include_retweets, since_id=1):
"""Takes a Twitter user id (a string) as input and returns all of that user's tweets. If since_id is not set, it will go back as far as the API will let you."""
params = {'user_id': user_id,
... | mit |
quantopian/qdb | qdb/tracer.py | 1 | 23389 | #
# Copyright 2015 Quantopian, 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 writin... | apache-2.0 |
t-abe/chainer | tests/chainer_tests/links_tests/connection_tests/test_bilinear.py | 3 | 8202 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import array
def _check_forward(e1, e2, f, y_expect):
e1 = chain... | mit |
eadgarchen/tensorflow | tensorflow/python/layers/convolutional_test.py | 31 | 43050 | # 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 |
eadgarchen/tensorflow | tensorflow/contrib/receptive_field/python/util/examples/compute_rf.py | 26 | 3507 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.