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 |
|---|---|---|---|---|---|
TeamJB/kernel_samsung_i9300 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
lrp/tftools | tftools.py | 2 | 9758 | # tftools.py: Utilities for optimizing transfer function excitation signals
# Copyright (C) 2013 Larry Price
#
# 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 ... | gpl-3.0 |
Godmaster49/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/decoder.py | 261 | 25883 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | gpl-3.0 |
fuselock/odoo | addons/point_of_sale/wizard/pos_confirm.py | 343 | 2403 | # -*- 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 |
ejeschke/ginga | ginga/examples/gw/clocks.py | 3 | 14675 | #! /usr/bin/env python
#
# clocks.py -- Ginga clocks
#
# eric@naoj.org
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
"clocks" displays a grid of clocks in different time zones.
Usage:
$ clock.py HST Asia/Tokyo UTC US/Eastern US/Pacific Hongkong Po... | bsd-3-clause |
UOMx/edx-platform | common/lib/capa/capa/tests/test_util.py | 47 | 5662 | """
Tests capa util
"""
import unittest
from lxml import etree
from . import test_capa_system
from capa.util import compare_with_tolerance, sanitize_html, get_inner_html_from_xpath
class UtilTest(unittest.TestCase):
"""Tests for util"""
def setUp(self):
super(UtilTest, self).setUp()
self.syst... | agpl-3.0 |
arauzoliver/uip-iiig2016-prog3 | FinalPC3/noteapp.py | 1 | 1122 | import bottle
import pymongo
import book
"""
Ruta por defecto para el index
"""
@bottle.route('/')
def book_index():
mynames_list = book.find_names()
return bottle.template('index', dict(mynames = mynames_list))
"""
Postea las nuevas entrada para ser insertadas a MongoDB
"""
@bottle.route('/newgues... | mit |
mmckinst/pykickstart | tests/commands/sshpw.py | 3 | 4586 | #
# Peter Jones <pjones@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be useful... | gpl-2.0 |
lhuriguen/tophandball | utils/models.py | 1 | 1767 | import urllib
import json
from decimal import Decimal
from django.db import models
class Marker(models.Model):
"""
Abstract model that provides geocoding for models with address.
"""
address = models.CharField(max_length=200, blank=True,
help_text="Separate address item... | mit |
zenodo/invenio | invenio/modules/workflows/worker_result.py | 15 | 2118 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 option) any later... | gpl-2.0 |
litchfield/django | django/contrib/gis/geos/prototypes/errcheck.py | 486 | 2954 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOSFuncFactory
# Getting the `free` routine used to free the memory allocated for
# string pointers returne... | bsd-3-clause |
exu/poligon | python/python_koans/python3/koans/about_none.py | 79 | 1473 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(__, isinstance(None, object))
def test_none_is_universal(self):
... | mit |
maurofaccenda/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py | 42 | 4772 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
chop-dbhi/django-concerns | concerns/migrations/0004_auto__chg_field_concern_reporter.py | 1 | 4938 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Concern.reporter'
db.alter_column('concerns_concern', 'reporter_id', self.gf('django.db.... | bsd-2-clause |
larsmans/scipy | scipy/spatial/tests/test__procrustes.py | 102 | 5132 | from __future__ import absolute_import, division, print_function
import numpy as np
from numpy.testing import (TestCase, run_module_suite, assert_allclose,
assert_equal, assert_almost_equal, assert_raises)
from scipy.spatial import procrustes
class ProcrustesTests(TestCase):
def setUp... | bsd-3-clause |
jollyroger/debian-buildbot | buildbot/db/sourcestampsets.py | 2 | 1255 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
temasek/android_external_chromium_org | third_party/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | bsd-3-clause |
JP-Ellis/django-select2-forms | select2/views.py | 1 | 6241 | import copy
import json
from django.apps import apps
from django.db import models
from django.forms.models import ModelChoiceIterator
from django.http import HttpResponse
from django.utils.encoding import force_text
import logging
logger = logging.getLogger(__name__)
class ViewException(Exception):
pass
class... | bsd-2-clause |
mnahm5/django-estore | Lib/encodings/shift_jis_2004.py | 816 | 1059 | #
# shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | mit |
zhuwenping/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/utils/Cryptlib_AES.py | 359 | 1364 | """Cryptlib AES implementation."""
from cryptomath import *
from AES import *
if cryptlibpyLoaded:
def new(key, mode, IV):
return Cryptlib_AES(key, mode, IV)
class Cryptlib_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "cryptlib")
sel... | apache-2.0 |
joopert/home-assistant | homeassistant/components/wink/climate.py | 2 | 16343 | """Support for Wink thermostats and Air Conditioners."""
import logging
import pywink
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE... | apache-2.0 |
MounirMesselmeni/django | django/db/migrations/operations/special.py | 374 | 7425 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... | bsd-3-clause |
v1bri/gnuradio | gr-wxgui/python/wxgui/gui.py | 76 | 4565 | #
# Copyright 2009 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 (at your option)
# any later version.
#
#... | gpl-3.0 |
marioaugustorama/yowsup | yowsup/layers/protocol_notifications/protocolentities/notification.py | 60 | 2064 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from yowsup.layers.protocol_receipts.protocolentities import OutgoingReceiptProtocolEntity
class NotificationProtocolEntity(ProtocolEntity):
'''
<notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="{{NOTIFICATION_TYPE}}" ... | gpl-3.0 |
bearstech/nuka | nuka/task.py | 1 | 20281 | # Copyright 2017 by Bearstech <py@bearstech.com>
#
# This file is part of nuka.
#
# nuka 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 |
jobsafran/mediadrop | mediadrop/lib/tests/xhtml_normalization_test.py | 3 | 3403 | # -*- coding: utf-8 -*-
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.... | gpl-3.0 |
535521469/crawler_sth | scrapy/log.py | 6 | 4258 | """
Scrapy logging facility
See documentation in docs/topics/logging.rst
"""
import sys
import logging
import warnings
from twisted.python import log
import scrapy
from scrapy.utils.python import unicode_to_str
# Logging levels
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ER... | bsd-3-clause |
zygmuntz/pybrain | pybrain/rl/learners/directsearch/enac.py | 25 | 1478 | from __future__ import print_function
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.learners.directsearch.policygradient import PolicyGradientLearner
from scipy import ones, dot, ravel
from scipy.linalg import pinv
class ENAC(PolicyGradientLearner):
""" Episodic Natural Actor-Critic. See... | bsd-3-clause |
maurofaccenda/ansible | lib/ansible/modules/network/vyos/vyos_system.py | 37 | 6270 | #!/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 |
cuongnv23/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_tag.py | 26 | 6604 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# 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 |
sander76/home-assistant | homeassistant/components/simulated/sensor.py | 5 | 4506 | """Adds a simulated sensor."""
from datetime import datetime
import math
from random import Random
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
import homeassistant.util... | apache-2.0 |
ingenioustechie/zamboni | mkt/feed/tests/test_fakedata.py | 19 | 2143 | from nose.tools import eq_
import mkt.site.tests
from mkt.feed.models import FeedItem
from mkt.feed.fakedata import app_item, brand, collection, shelf
from mkt.site.fixtures import fixture
from mkt.webapps.models import Webapp
class TestFeedGeneration(mkt.site.tests.TestCase):
fixtures = fixture('webapp_337141'... | bsd-3-clause |
sumspr/scikit-learn | sklearn/feature_selection/from_model.py | 224 | 4316 | # Authors: Gilles Louppe, Mathieu Blondel
# License: BSD 3 clause
import numpy as np
from ..base import TransformerMixin
from ..externals import six
from ..utils import safe_mask, check_array
from ..utils.validation import NotFittedError, check_is_fitted
class _LearntSelectorMixin(TransformerMixin):
# Note beca... | bsd-3-clause |
makinacorpus/odoo | addons/project/__init__.py | 436 | 1141 | # -*- 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 |
craynot/django | django/core/management/color.py | 309 | 1807 | """
Sets up the terminal color scheme.
"""
import os
import sys
from django.utils import lru_cache, termcolors
def supports_color():
"""
Returns True if the running system's terminal supports color,
and False otherwise.
"""
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (pl... | bsd-3-clause |
Setheri/ProjectFrontier | bot/C_sarcasticball.py | 67 | 1479 | from random import choice as fsample
sarcastic_responses = ["Yeah right","What do I look like to you?","Are you kidding me?",#UsF
"As much as you","You don't believe that yourself","When pigs fly",#UsF
"Like your grandma","You would like to know, wouldn't you?", #UsF
... | agpl-3.0 |
pwong-mapr/private-hue | desktop/core/ext-py/Pygments-1.3.1/pygments/cmdline.py | 75 | 13055 | # -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, highlight
fro... | apache-2.0 |
biomassives/mezzanine | mezzanine/generic/views.py | 21 | 6280 | from __future__ import unicode_literals
from future.builtins import str
from json import dumps
from string import punctuation
from django.apps import apps
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.messages import error
from django.core.urlresolvers import reverse
from... | bsd-2-clause |
yosshy/nova | nova/api/auth.py | 13 | 5832 | # Copyright (c) 2011 OpenStack Foundation
#
# 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 ... | apache-2.0 |
sevaivanov/ring-api | tests/rest-api/0.1/unit-tests.py | 1 | 18477 | #!/usr/bin/env python3
import unittest
import requests
import json
API_URL = 'http://127.0.0.1:8080/api/v1'
def print_json(data):
print(json.dumps(data, sort_keys=True, indent=4))
class TestAccount(unittest.TestCase):
def test_accounts_get(self):
print("\nGET /accounts/")
res = requests.ge... | gpl-3.0 |
simonluijk/pyFilesystem | fs/remote.py | 2 | 26660 | """
fs.remote
=========
Utilities for interfacing with remote filesystems
This module provides reusable utility functions that can be used to construct
FS subclasses interfacing with a remote filesystem. These include:
* RemoteFileBuffer: a file-like object that locally buffers the contents of
... | bsd-3-clause |
was4444/chromium.src | third_party/Python-Markdown/markdown/extensions/codehilite.py | 100 | 9769 | """
CodeHilite Extension for Python-Markdown
========================================
Adds code/syntax highlighting to standard Python-Markdown code blocks.
See <https://pythonhosted.org/Markdown/extensions/code_hilite.html>
for documentation.
Original code Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/... | bsd-3-clause |
blazek/QGIS | tests/code_layout/test_qgsdoccoverage.py | 15 | 5336 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for API documentation coverage.
.. 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 ver... | gpl-2.0 |
yeraydiazdiaz/nonrel-blog | django/core/serializers/__init__.py | 101 | 3969 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_query_set)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | bsd-3-clause |
crosswalk-project/chromium-crosswalk-efl | tools/perf/page_sets/page_cycler/dom.py | 34 | 1349 | # 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 DomPage(page_module.Page):
def __init__(self,... | bsd-3-clause |
phunehehe/microgram | to-nix/python/python2nix/__main__.py | 3 | 3044 | import sys
import requests
from python2nix import pip_deps
PACKAGE = """\
{{ {args_str} }}:
buildPythonPackage rec {{
name = "{name}";
src = fetchurl {{
url = "{url}";
md5 = "{md5}";
}};
propagatedBuildInputs = [ {inputs_str} ];
meta = with stdenv.lib; {{
description = "{description}";
... | mit |
corcor67/SMPL_M8_GPE | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
pam-bot/SMSQuery | lib/twilio/rest/resources/base.py | 8 | 13752 | import logging
import os
import platform
from six import (
integer_types,
string_types,
binary_type,
iteritems
)
from ...compat import urlparse
from ...compat import urlencode
from ... import __version__
from ...exceptions import TwilioException
from ..exceptions import TwilioRestException
from .conne... | gpl-2.0 |
Designist/pybuilder | setup.py | 1 | 1823 | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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 |
steveklabnik/servo | tests/wpt/css-tests/tools/wptserve/wptserve/request.py | 136 | 16506 | import base64
import cgi
import Cookie
import os
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about... | mpl-2.0 |
jasonkying/pip | tests/unit/test_locations.py | 19 | 3847 | """
locations.py tests
"""
import os
import sys
import shutil
import tempfile
import getpass
from mock import Mock
from pip.locations import distutils_scheme
if sys.platform == 'win32':
pwd = Mock()
else:
import pwd
class TestLocations:
def setup(self):
self.tempdir = tempfile.mkdtemp()
... | mit |
nens/sufriblib | setup.py | 1 | 1083 | from setuptools import setup
version = '0.5.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'setuptools',
'pyproj',
],
tests_require = [
'nose',
'coverage',
]
setup(name='sufrib... | gpl-3.0 |
pdevetto/super-duper-disco | movies/migrations/0001_initial.py | 1 | 1056 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-28 14:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | gpl-3.0 |
Dfelker/ansible | lib/ansible/plugins/shell/powershell.py | 34 | 5527 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
fafaman/scrapy | scrapy/loader/processors.py | 145 | 2850 | """
This module provides some commonly used processors for Item Loaders.
See documentation in docs/topics/loaders.rst
"""
from scrapy.utils.misc import arg_to_iter
from scrapy.utils.datatypes import MergeDict
from .common import wrap_loader_context
class MapCompose(object):
def __init__(self, *functions, **def... | bsd-3-clause |
jun66j5/trac-ja | sample-plugins/workflow/VoteOperation.py | 1 | 2994 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2013 Edgewall Software
# Copyright (C) 2007 Eli Carter <retracile@gmail.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.... | bsd-3-clause |
mderomph-coolblue/dd-agent | setup.py | 4 | 5017 | # stdlib
from datetime import date
import os
import sys
# 3p
from setuptools import find_packages, setup
from requests.certs import where
# project
from config import get_version
from utils.jmx import JMX_FETCH_JAR_NAME
# Extra arguments to pass to the setup function
extra_args = {}
# Prereqs of the build. Won't ge... | bsd-3-clause |
sinhrks/chainer | chainer/links/connection/linear.py | 2 | 2272 | import numpy
from chainer.functions.connection import linear
from chainer import link
class Linear(link.Link):
"""Linear layer (a.k.a. fully-connected layer).
This is a link that wraps the :func:`~chainer.functions.linear` function,
and holds a weight matrix ``W`` and optionally a bias vector ``b`` as
... | mit |
CloudVLab/professional-services | tools/gsuite-exporter/setup.py | 1 | 2139 | # Copyright 2018 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 wr... | apache-2.0 |
hughperkins/clBLAS | src/scripts/perf/errorHandler.py | 29 | 2824 | # ########################################################################
# Copyright 2013 Advanced Micro Devices, 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.apach... | apache-2.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/trace.py | 153 | 29890 | #!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | gpl-2.0 |
UTNkar/moore | src/home/migrations/0027_manual_paragraph_data.py | 1 | 1268 | # Generated by Django 2.2.10 on 2020-04-02 21:08
from django.db import migrations
from itertools import chain
from utils.data_migrations import stream_field_filter_map
def richtext_to_paragraph(block):
return {
'type': 'paragraph',
'value': {
'text': block['value'],
'align... | agpl-3.0 |
matmutant/sl4a | python/src/Lib/encodings/euc_jisx0213.py | 816 | 1051 | #
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | apache-2.0 |
JonnyH/pyra-kernel | GTA04/root/vibra.py | 2 | 3531 | #!/usr/bin/env python
import fcntl, struct, time, array
#
# There are two steps to creating a rumble effect
# 1/ describe the effect and give it to the driver using an
# ioctl.
# There a 3 paramaters:
# strength: from 0 to 0xffff - this code takes a value from 0 to
# 1 and ... | gpl-2.0 |
serge-sans-paille/pythran | pythran/transformations/remove_nested_functions.py | 1 | 4044 | """ RemoveNestedFunctions turns nested function into top-level functions. """
from pythran.analyses import GlobalDeclarations, ImportedIds
from pythran.passmanager import Transformation
from pythran.tables import MODULES
from pythran.conversion import mangle
import pythran.metadata as metadata
import gast as ast
c... | bsd-3-clause |
lduarte1991/edx-platform | cms/djangoapps/contentstore/tests/test_import_draft_order.py | 25 | 2843 | """
Tests Draft import order.
"""
from django.conf import settings
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.xml_importer import import_course_from_xml
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
# This test ... | agpl-3.0 |
viru/ansible | test/units/parsing/test_unquote.py | 152 | 2073 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o... | gpl-3.0 |
jhonatajh/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py | 229 | 1444 | #!/usr/bin/env python
# Copyright (c) 2013 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 *_wrapper in make_global_settings.
"""
import os
import sys
import TestGyp
test_format = ['ninja']
if sys.platform in ('linux... | gpl-3.0 |
Hikasgai/HikasgaiApp | placeForMe/settings.py | 1 | 4053 | """
Django settings for gettingstarted project, on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/se... | mit |
systemsoverload/aquameta | core/002-filesystem/pgfs/pgfs.py | 2 | 10817 | #!/usr/bin/env python2
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn, fuse_get_context, ENOENT, EROFS
from os.path import normpath
from psycopg2 import connect, ProgrammingError, DataError, InternalError
from psycopg2.extensions import QuotedString
from stat import S_IFDIR, S_IFREG
from sys import exit
f... | gpl-3.0 |
sanjuro/RCJK | confirm/views.py | 33 | 1184 | # Copyright 2009 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 |
sdcooke/django | tests/forms_tests/models.py | 261 | 3805 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
callable_default_counter = itertools.count()
def callab... | bsd-3-clause |
landism/pants | contrib/go/src/python/pants/contrib/go/tasks/go_task.py | 3 | 6874 | # 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 json
import r... | apache-2.0 |
tako0910/android_kernel_htc_valentewx | 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 |
2014c2g3/w16b_test | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | agpl-3.0 |
Zarokka/exaile | xl/player/gst/engine.py | 4 | 23626 | # Copyright (C) 2008-2010 Adam Olsen
# Copyright (C) 2014-2015 Dustin Spicuzza
#
# 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, or (at your option)
# any later version.
#
# Th... | gpl-2.0 |
SrNetoChan/QGIS | python/plugins/db_manager/info_viewer.py | 67 | 5508 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
necioerrante/kernel | 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 |
pombredanne/invenio | modules/bibindex/lib/bibindex_engine_stemmer.py | 1 | 18378 | ## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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, ... | gpl-2.0 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/doc/mpl_examples/api/histogram_path_demo.py | 6 | 1464 | """
This example shows how to use a path patch to draw a bunch of
rectangles. The technique of using lots of Rectangle instances, or
the faster method of using PolyCollections, were implemented before we
had proper paths with moveto/lineto, closepoly etc in mpl. Now that
we have them, we can draw collections of regul... | mit |
gurneyalex/odoo | addons/account/models/digest.py | 6 | 1557 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class Digest(models.Model):
_inherit = 'digest.digest'
kpi_account_total_revenue = fields.Boolean('Revenue')
kpi_account_total_rev... | agpl-3.0 |
miguelinux/vbox | src/VBox/ValidationKit/testboxscript/testboxscript.py | 1 | 3651 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: testboxscript.py $
"""
TestBox Script Wrapper.
This script aimes at respawning the Test Box Script when it terminates
abnormally or due to an UPGRADE request.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Ope... | gpl-2.0 |
yangrongwei/gyp | test/generator-output/gyptest-rules.py | 198 | 1768 | #!/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 |
aselle/tensorflow | tensorflow/python/debug/lib/debug_gradients.py | 16 | 15445 | # 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 |
mbaijal/incubator-mxnet | example/caffe/train_model.py | 21 | 4207 | # 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 |
phil0522/anote | anote-web/anoteweb/data/anote_pb2.py | 1 | 9335 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: anote.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
... | mit |
sclabs/sitestatus-nonrel | django/utils/unittest/__init__.py | 571 | 3069 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... | bsd-3-clause |
kirca/odoo | addons/hr_timesheet_invoice/report/account_analytic_profit.py | 96 | 5733 | # -*- 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 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/opsworks/layer1.py | 132 | 129869 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | apache-2.0 |
RedlineResearch/ardupilot | Tools/LogAnalyzer/tests/TestCompass.py | 66 | 6392 | from LogAnalyzer import Test,TestResult
import DataflashLog
from functools import reduce
import math
class TestCompass(Test):
'''test for compass offsets and throttle interference'''
def __init__(self):
Test.__init__(self)
self.name = "Compass"
def run(self, logdata, verbose):
s... | gpl-3.0 |
mitchcapper/mythbox | resources/lib/tvrage/tvrage/feeds.py | 4 | 2734 | # Copyright (c) 2009, Christian Kreutzer
# 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 condition... | gpl-2.0 |
vadimtk/chrome4sdp | chrome/test/mini_installer/test_installer.py | 34 | 15601 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script tests the installer with test cases specified in the config file.
For each test case, it checks that the machine states after the execution o... | bsd-3-clause |
ozamiatin/glance | glance/db/sqlalchemy/models_artifacts.py | 5 | 12959 | # Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
mfitzp/padua | setup.py | 1 | 1035 | from setuptools import setup, find_packages
version = '0.1.16'
setup(
name='padua',
version=version,
url='http://github.com/mfitzp/padua',
author='Martin Fitzpatrick',
author_email='martin.fitzpatrick@gmail.com',
description='A Python interface for Proteomic Data Analysis, working with MaxQuan... | bsd-2-clause |
shaanlan/youtube-dl | youtube_dl/extractor/funnyordie.py | 64 | 2887 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class FunnyOrDieIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?funnyordie\.com/(?P<type>embed|articles|videos)/(?P<id>[0-9a-f]+)(?:$|[?#/])'
_TESTS = [{
'url': 'ht... | unlicense |
PlayUAV/MissionPlanner | Lib/distutils/command/sdist.py | 42 | 18344 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id$"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive... | gpl-3.0 |
Chetox/RCode | Cannon_Basico/test/join_tests.py | 2 | 5402 | # -*- mode:python; coding:utf-8; tab-width:4 -*-
from unittest import TestCase
from hamcrest import assert_that, is_
from matrix_utils import matrix_join
from common import M2, M3, M4, M6, M8
class MatrixJoinTests(TestCase):
def test_join_4_2x2_blocks_in_4x4_matrix(self):
# given
A0 = M2(1, 2,... | apache-2.0 |
solymosin/maps2winbugs | plugin/xdist.py | 1 | 1633 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
maps2WinBUGS
A QGIS plugin a tool to facilitate data processing for Bayesian spatial modeling
-------------------
begin : 2015-... | gpl-2.0 |
highweb-project/highweb-webcl-html5spec | third_party/google_appengine_cloudstorage/cloudstorage/common.py | 120 | 11732 | # 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 |
whbrewer/spc | src/gluino/utils.py | 4 | 10460 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This file specifically includes utilities for security.
"""
import threading
import struct
import hashlib
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.