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 |
|---|---|---|---|---|---|
plcode7/rad2py | ide2py/database.py | 8 | 18990 | #!/usr/bin/env python
# coding:utf-8
"Database utilities API (sqlite3)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2014 Mariano Reingart"
__license__ = "GPL 3.0"
import os
import sqlite3
import UserDict
DEBUG = True
SQL_TYPE_MAP = {int: "INTEGER", float: "... | gpl-3.0 |
mastizada/kuma | vendor/packages/setuptools/setuptools/command/install.py | 32 | 3984 | import setuptools, sys, glob
from distutils.command.install import install as _install
from distutils.errors import DistutilsArgError
class install(_install):
"""Use easy_install to install the package, w/dependencies"""
user_options = _install.user_options + [
('old-and-unmanageable', None, "Try not ... | mpl-2.0 |
bhargav2408/python-for-android | python3-alpha/extra_modules/pyxmpp2/ext/__init__.py | 47 | 1026 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
zstars/weblabdeusto | experiments/managed/libs/server/python/weblab_server.py | 1 | 2986 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals, ... | bsd-2-clause |
hgl888/blink-crosswalk-efl | LayoutTests/imported/web-platform-tests/serve.py | 3 | 10389 | # -*- coding: utf-8 -*-
import argparse
import json
import logging
import os
import signal
import socket
import sys
import threading
import time
import urllib2
import uuid
from collections import defaultdict
from multiprocessing import Process, Event
repo_root = os.path.abspath(os.path.split(__file__)[0])
sys.path.i... | bsd-3-clause |
xsynergy510x/android_external_chromium_org | ppapi/generators/idl_ast.py | 104 | 6017 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Nodes for PPAPI IDL AST."""
from idl_namespace import IDLNamespace
from idl_node import IDLNode
from idl_option import GetOption
from idl_visitor imp... | bsd-3-clause |
juliushaertl/i3pystatus | i3pystatus/updates/__init__.py | 1 | 3829 | import threading
from i3pystatus import SettingsBase, Module, formatp
from i3pystatus.core.util import internet, require
class Backend(SettingsBase):
settings = ()
updates = 0
class Updates(Module):
"""
Generic update checker.
To use select appropriate backend(s) for your system.
For list o... | mit |
r3b/phantomjs | src/breakpad/src/tools/gyp/test/defines/gyptest-defines-env-regyp.py | 151 | 1312 | #!/usr/bin/env python
# Copyright (c) 2009 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 build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py | 6 | 6185 | # Copyright 2019 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 |
trishnaguha/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_video.py | 27 | 14168 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Diane Wang <dianew@vmware.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
... | gpl-3.0 |
cattleprod/XCeLL | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
Wafflespeanut/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/stash.py | 125 | 5248 | import base64
import json
import os
import uuid
from multiprocessing.managers import BaseManager, DictProxy
class ServerDictManager(BaseManager):
shared_data = {}
def _get_shared():
return ServerDictManager.shared_data
ServerDictManager.register("get_dict",
callable=_get_shared,
... | mpl-2.0 |
krisys/django | tests/annotations/models.py | 43 | 2901 | # coding: utf-8
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str__(self... | bsd-3-clause |
lmotta/Roam | src/roam/floatingtoolbar.py | 4 | 1435 | from PyQt4.QtGui import QToolBar, QActionGroup
from PyQt4.QtCore import Qt, QPoint
from roam.utils import log
class FloatingToolBar(QToolBar):
"""
A floating QToolBar with no border and is offset under its parent
"""
def __init__(self, name, parent):
"""
parent: The parent of this toolbar. Shou... | gpl-2.0 |
git-pedro-77/PROYECTOFINALPYTHON | proyectoITSAE/ec/edu/itsae/dao/ventaDao.py | 1 | 2654 | # coding:utf-8
'''
Created on 27/1/2015
@author: Programacion
'''
from ec.edu.itsae.conn import DBcon
#from flask import redirect, url_for
import json
class VentaDao(DBcon.DBcon):#heredando
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
... | gpl-2.0 |
jcpowermac/ansible | lib/ansible/compat/__init__.py | 241 | 1087 | # (c) 2014, 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 option) any later... | gpl-3.0 |
olivierdalang/QGIS | python/plugins/processing/algs/qgis/RasterCalculator.py | 26 | 12515 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerCalculator.py
---------------------
Date : November 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
TC01/pelican | pelican/utils.py | 10 | 23526 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import codecs
import errno
import fnmatch
import locale
import logging
import os
import pytz
import re
import shutil
import sys
import traceback
import pickle
import datetime
from collections import Hashable
from contextlib imp... | agpl-3.0 |
brodyh/tensorflow | tensorflow/python/ops/gradients_test.py | 5 | 12673 | """Tests for tensorflow.ops.gradients."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import tensorflow.python.platform
import numpy as np
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
fr... | apache-2.0 |
jamesrp/pyeq2 | Examples/Simple/FitWeightedData_2D.py | 3 | 5048 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import os, sys, inspect
# ensure pyeq2 can be imported
if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout directory from "pyeq2-master" to "pyeq2"')
exampleFileDirect... | bsd-2-clause |
apagac/cfme_tests | cfme/tests/containers/test_tables_fields.py | 3 | 4585 | import pytest
from cfme.containers.container import Container
from cfme.containers.image import Image
from cfme.containers.image_registry import ImageRegistry
from cfme.containers.node import Node
from cfme.containers.pod import Pod
from cfme.containers.project import Project
from cfme.containers.provider import Conta... | gpl-2.0 |
theflofly/tensorflow | tensorflow/python/compiler/tensorrt/test/unary_test.py | 6 | 3755 | # Copyright 2018 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 |
toolforger/sympy | examples/advanced/relativity.py | 89 | 4384 | #!/usr/bin/env python
"""
This example calculates the Ricci tensor from the metric and does this
on the example of Schwarzschild solution.
If you want to derive this by hand, follow the wiki page here:
http://en.wikipedia.org/wiki/Deriving_the_Schwarzschild_solution
Also read the above wiki and follow the reference... | bsd-3-clause |
tashigaofei/BlogSpider | scrapy/utils/reactor.py | 178 | 1360 | from twisted.internet import reactor, error
def listen_tcp(portrange, host, factory):
"""Like reactor.listenTCP but tries different ports in a range."""
assert len(portrange) <= 2, "invalid portrange: %s" % portrange
if not hasattr(portrange, '__iter__'):
return reactor.listenTCP(portrange, factory... | mit |
cntnboys/410Lab6 | build/django/django/db/backends/utils.py | 52 | 6379 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(objec... | apache-2.0 |
hifly/OpenUpgrade | openerp/openupgrade/openupgrade_loading.py | 2 | 8154 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
koparasy/faultinjection-gem5 | ext/ply/ply/cpp.py | 128 | 33042 | # -----------------------------------------------------------------------------
# cpp.py
#
# Author: David Beazley (http://www.dabeaz.com)
# Copyright (C) 2007
# All rights reserved
#
# This module implements an ANSI-C style lexical preprocessor for PLY.
# -------------------------------------------------------------... | bsd-3-clause |
RobinD42/shiboken | tests/samplebinding/nonzero_test.py | 6 | 1330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms... | gpl-2.0 |
erfannoury/capgen-lasagne | another no-ft-ln-hs-largelr.py | 1 | 13876 | from __future__ import division, print_function
import logging
import numpy as np
import scipy as sc
import skimage
from skimage import transform
import theano
import theano.tensor as T
import lasagne
import sys
import cPickle as pickle
from datetime import datetime
from collections import OrderedDict
from mscoco_threa... | mit |
goulu/Goulib | Goulib/plot.py | 1 | 4898 | """
plotable rich object display on IPython/Jupyter notebooks
"""
__author__ = "Philippe Guglielmetti"
__copyright__ = "Copyright 2015, Philippe Guglielmetti"
__credits__ = []
__license__ = "LGPL"
# import matplotlib and set backend once for all
from . import itertools2
import os
import io
import sys
i... | lgpl-3.0 |
asnt/fablablux-schedule | fablab_schedule/config.py | 1 | 2177 | import logging
import os
from pkg_resources import resource_filename
try:
# Python 3
import configparser
except ImportError:
# Python 2
import ConfigParser as configparser
logger = logging.getLogger(__name__)
config_dir = "/etc/fablab_schedule/"
config_filename = "fablab_schedule.cfg"
example_config... | gpl-3.0 |
sorenk/ansible | lib/ansible/modules/identity/ipa/ipa_dnszone.py | 33 | 3834 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Fran Fitzpatrick (francis.x.fitzpatrick@gmail.com)
# Borrowed heavily from other work by Abhijeet Kasurde (akasurde@redhat.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_i... | gpl-3.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/requests/models.py | 151 | 28156 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | apache-2.0 |
ybellavance/python-for-android | python3-alpha/python3-src/Mac/Tools/fixapplepython23.py | 47 | 4589 | #!/usr/bin/python
"""fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3)
Python 2.3 (and 2.3.X for X<5) have the problem that building an extension
for a framework installation may accidentally pick up the framework
of a newer Python, in stead of the one that was used to build the extension.
This scr... | apache-2.0 |
simonwydooghe/ansible | lib/ansible/modules/windows/win_command.py | 59 | 4500 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATIO... | gpl-3.0 |
hmronline/home-assistant | homeassistant/components/switch/acer_projector.py | 2 | 4769 | """
Use serial protocol of acer projector to obtain state of the projector.
This component allows to control almost all projectors from acer using
their RS232 serial communication protocol.
"""
import logging
import re
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import (STATE_ON,... | mit |
squarefeet/three.js | utils/exporters/blender/addons/io_three/exporter/geometry.py | 28 | 19629 | """
Module for creating Three.js geometry JSON nodes.
"""
import os
from .. import constants, logger
from . import base_classes, io, api
FORMAT_VERSION = 3
class Geometry(base_classes.BaseNode):
"""Class that wraps a single mesh/geometry node."""
def __init__(self, node, parent=None):
logger.debug(... | mit |
kizbitz/tippet | docs/source/conf.py | 1 | 8141 | # -*- coding: utf-8 -*-
#
# tippet documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 23 09:56:57 2014.
#
# 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.
#
# Al... | apache-2.0 |
elegion/djangodash2012 | fortuitus/fcore/migrations/0003_auto__add_unique_company_slug__add_unique_company_name.py | 1 | 4714 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Company', fields ['slug']
db.create_unique('fcore_company', ['slug'])
... | mit |
RenaudParis/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_handlers.py | 293 | 9198 | import json
import os
import unittest
import urllib2
import uuid
import wptserve
from base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_GET(self):
resp = self.request("/document.txt")
self.assertEquals(200, resp.getcode())
self.assertEquals("text/plain"... | mpl-2.0 |
shakamunyi/tensorflow | tensorflow/python/debug/cli/stepper_cli.py | 123 | 21329 | # 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 |
Gagaro/django | tests/template_tests/syntax_tests/test_cache.py | 299 | 6777 | from django.core.cache import cache
from django.template import Context, Engine, TemplateSyntaxError
from django.test import SimpleTestCase, override_settings
from ..utils import setup
class CacheTagTests(SimpleTestCase):
libraries = {
'cache': 'django.templatetags.cache',
'custom': 'template_tes... | bsd-3-clause |
daymer/xWIKI_Karma | CustomModules/mysql-connector-python-2.1.7/tests/test_optionfiles.py | 6 | 8680 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | apache-2.0 |
sumanau7/Ele_CC_Sumanau | lib/IPython/core/payload.py | 22 | 1758 | # -*- coding: utf-8 -*-
"""Payload system for IPython.
Authors:
* Fernando Perez
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in... | apache-2.0 |
ppwwyyxx/tensorflow | tensorflow/python/kernel_tests/partitioned_variables_test.py | 22 | 26657 | # 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 |
mattcaldwell/django-cms | cms/migrations/0029_limit_visibility_in_menu_step2of3_data.py | 385 | 19523 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Dummy migration
pass
def backwards(self, orm):
# Dummy migration
pass
models = {
... | bsd-3-clause |
ecederstrand/django | django/middleware/common.py | 145 | 7274 | import logging
import re
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.utils.cache import get_conditional_response, set_response_etag
from django.utils.encoding imp... | bsd-3-clause |
drpeteb/scipy | scipy/spatial/tests/test_distance.py | 26 | 56733 | #! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# 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 copy... | bsd-3-clause |
chouseknecht/ansible | lib/ansible/plugins/action/net_base.py | 34 | 8618 | # Copyright: (c) 2015, Ansible Inc,
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import copy
from ansible import constants as C
from ansible.module_utils._text import to_... | gpl-3.0 |
WebAssembly/binaryen | test/unit/test_asyncify.py | 2 | 4247 | import os
import subprocess
import tempfile
from scripts.test import shared
from . import utils
class AsyncifyTest(utils.BinaryenTestCase):
def test_asyncify_js(self):
def test(args):
print(args)
shared.run_process(shared.WASM_OPT + args + [self.input_path('asyncify-sleep.wat'), '... | apache-2.0 |
euanlau/django-registration | registration/forms.py | 38 | 4537 | """
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
from django.contrib.... | bsd-3-clause |
xiandiancloud/edx-platform-Y | common/test/acceptance/pages/lms/peer_calibrate.py | 206 | 1526 | """
Page that allows the student to grade calibration essays
(requirement for being allowed to grade peers).
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from .rubric import RubricPage
class PeerCalibratePage(PageObject):
"""
Grade calibration essays.
"""
url ... | agpl-3.0 |
willthames/ansible | lib/ansible/utils/module_docs_fragments/cloudengine.py | 126 | 2957 | #
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope t... | gpl-3.0 |
nuxeh/morph | morphlib/plugins/deploy_plugin.py | 1 | 29928 | # Copyright (C) 2013-2015 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_genexps.py | 97 | 7286 | doctests = """
Test simple loop with conditional
>>> sum(i*i for i in range(100) if i&1 == 1)
166650
Test simple nesting
>>> list((i,j) for i in range(3) for j in range(4) )
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Test nesting with the inner ... | mit |
zadgroup/edx-platform | common/djangoapps/dark_lang/tests.py | 80 | 10264 | """
Tests of DarkLangMiddleware
"""
from django.contrib.auth.models import User
from django.http import HttpRequest
import ddt
from django.test import TestCase
from mock import Mock
import unittest
from dark_lang.middleware import DarkLangMiddleware
from dark_lang.models import DarkLangConfig
# TODO PLAT-671 Import f... | agpl-3.0 |
sravanimantha/yaml-cpp.core | test/gmock-1.7.0/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
koomik/CouchPotatoServer | libs/rsa/__init__.py | 111 | 1568 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 |
jrouzierinverse/gord | gord/gae_transport/gae_sdchttp.py | 3 | 2302 | #!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/test/test_capi.py | 6 | 4554 | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import sys
import time
import random
import unittest
from test import test_support
try:
import threading
except ImportError:
... | apache-2.0 |
damiansoriano/odoo | openerp/tests/common.py | 48 | 11734 | # -*- coding: utf-8 -*-
"""
The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import glob
import json
import logging
import os
import select
import subprocess
import threading
import time
import unittest2
import urllib2
import xmlrpclib
... | agpl-3.0 |
reyoung/Paddle | python/paddle/fluid/tests/unittests/test_warpctc_op.py | 2 | 8652 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
pravsripad/jumeg | examples/connectivity/plot_grouped_connectivity_circle.py | 2 | 1374 | #!/usr/bin/env python
'''
Example showing how to read grouped aparc labels from yaml file and plot
grouped connectivity circle with these labels.
Author: Praveen Sripad <pravsripad@gmail.com>
'''
import numpy as np
from jumeg import get_jumeg_path
from jumeg.connectivity import plot_grouped_connectivity_circle
impor... | bsd-3-clause |
GodBlessPP/W17test_2nd_1 | static/Brython3.1.1-20150328-091302/Lib/site-packages/header.py | 409 | 2444 | from browser import document as doc
from browser.html import *
trans_menu = {
'menu_console':{'en':'Console','es':'Consola','fr':'Console', 'pt':'Console'},
'menu_editor':{'en':'Editor','es':'Editor','fr':'Editeur', 'pt':'Editor'},
'menu_gallery':{'en':'Gallery','es':'Galería','fr':'Galerie', 'pt':'Galeri... | gpl-3.0 |
openthread/openthread | tests/scripts/thread-cert/border_router/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py | 3 | 6792 | #!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
sankha93/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | mpl-2.0 |
davidyezsetz/kuma | vendor/packages/ipython/test/test_irunner.py | 5 | 3324 | #!/usr/bin/env python
"""Test suite for the irunner module.
Not the most elegant or fine-grained, but it does cover at least the bulk
functionality."""
# Global to make tests extra verbose and help debugging
VERBOSE = True
# stdlib imports
import cStringIO as StringIO
import sys
import unittest
# IPython imports
fr... | mpl-2.0 |
fintech-circle/edx-platform | openedx/core/djangoapps/embargo/fixtures/country_codes.py | 259 | 1693 | """
List of valid ISO 3166-1 Alpha-2 country codes, used for
validating entries on entered country codes on django-admin page.
"""
COUNTRY_CODES = set([
"AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT",
"AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "... | agpl-3.0 |
camradal/ansible-modules-extras | packaging/os/pkgin.py | 59 | 11607 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com>
# Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to>
# Copyright (c) 2016 Jasper Lievisse Adriaanse <j at jasper.la>
#
# Written by Shaun Zinck
# Based on pacman module written by Afterburn <http://github.com/... | gpl-3.0 |
sunny-wyb/xen-4.1.2 | tools/python/xen/xend/XendConstants.py | 13 | 4011 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
eonpatapon/nova | doc/ext/nova_todo.py | 64 | 3385 | # -*- coding: utf-8 -*-
# This is a hack of the builtin todo extension, to make the todo_list
# more user friendly.
from sphinx.ext.todo import *
import re
def _(s):
return s
def process_todo_nodes(app, doctree, fromdocname):
if not app.config['todo_include_todos']:
for node in doctree.traverse(tod... | apache-2.0 |
projectcalico/calico-nova | nova/api/openstack/compute/contrib/cells.py | 4 | 13035 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 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/lic... | apache-2.0 |
52ai/django-ccsds | tests/gis_tests/maps/tests.py | 25 | 2087 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import TestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX'
@s... | bsd-3-clause |
Skin1980/bass | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
jakirkham/bokeh | bokeh/core/property/tests/test_bases.py | 3 | 6867 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
Botong/songtaste | lib/requests/packages/urllib3/request.py | 567 | 5808 | # urllib3/request.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencod... | apache-2.0 |
Emergya/icm-openedx-educamadrid-platform-basic | common/test/acceptance/tests/video/test_video_events.py | 50 | 13897 | """Ensure videos emit proper events"""
import datetime
import json
import ddt
import unittest
from ..helpers import EventsTestMixin
from .test_video_module import VideoBaseTest
from ...pages.lms.video.video import _parse_time_str
from openedx.core.lib.tests.assertions.events import assert_event_matches, assert_event... | agpl-3.0 |
JioCloud/keystone | keystone/tests/unit/catalog/test_core.py | 2 | 2707 | # 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 |
nitzmahone/ansible | lib/ansible/modules/monitoring/logstash_plugin.py | 72 | 4748 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Loic Blot <loic.blot@unix-experience.fr>
# 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.... | gpl-3.0 |
buckets1337/UOMUMM | src/Renderer.py | 1 | 5959 | # Renderer.py
# Various ways to format text output to players
class Renderer():
'''
A renderer component just contains methods for formatting text output in various ways
'''
def __init__(self, server):
self.owner = server
def formatMessage(self, message, width):
'''
splits a <message> string into lines th... | apache-2.0 |
chouseknecht/ansible | test/lib/ansible_test/_internal/sanity/integration_aliases.py | 15 | 11391 | """Sanity test to check integration test aliases."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import textwrap
import re
import os
from .. import types as t
from ..sanity import (
SanityVersionNeutral,
SanityMessage,
SanityFailure,
SanitySuccess,
Sani... | gpl-3.0 |
maciekswat/dolfin_1.3.0 | test/unit/mesh/python/MeshEditor.py | 3 | 1414 | "Unit tests for the MeshEditor class"
# Copyright (C) 2006-2011 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | gpl-3.0 |
vikatory/kbengine | kbe/src/lib/python/Lib/email/parser.py | 86 | 5045 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
'FeedParser', 'BytesFeedParser']
from io ... | lgpl-3.0 |
wildjan/Flask | Work/TriviaMVAWjut/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/auth.py | 174 | 7550 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import pa... | apache-2.0 |
shvets/etvnet-plex-plugin | test/archive_service_test.py | 1 | 7248 | import test_helper
import unittest
import json
from etvnet_service import EtvnetService
from config import Config
class EtvnetServiceTest(unittest.TestCase):
def setUp(self):
config = Config("../etvnet.config")
self.service = EtvnetService(config)
def test_channels(self):
result = s... | mit |
tdlong/YeastRobot | UserPrograms/ASE/Rearray_day3_pilot_1.py | 1 | 1439 | import sys
# where RobotControl.py, etc lives
sys.path.append('/home/pi/Desktop/ADL/YeastRobot/PythonLibrary')
from RobotControl import *
#################################
### Define Deck Layout
#################################
deck="""\
DW96W SW96P SW96P SW96P SW96P SW96P SW96P BLANK
BLANK BLANK BLANK B... | gpl-3.0 |
andim27/magiccamp | tests/regressiontests/m2m_through_regress/models.py | 11 | 1710 | from datetime import datetime
from django.contrib.auth.models import User
from django.core import management
from django.db import models
# Forward declared intermediate model
class Membership(models.Model):
person = models.ForeignKey('Person')
group = models.ForeignKey('Group')
price = models.IntegerFie... | bsd-3-clause |
DirtyUnicorns/android_external_chromium_org | tools/telemetry/telemetry/core/bitmap.py | 42 | 11785 | # 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.
"""
Bitmap is a basic wrapper for image pixels. It includes some basic processing
tools: crop, find bounding box of a color and compute histogram of color va... | bsd-3-clause |
partyajak/android_kernel_lge_g2m | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
oxnz/NZChat | exp/NZContactPane.py | 3 | 3919 | #-*- coding: utf-8 -*-
from NZQt import *
from NZChatWindow import NZChatWindow
from NZChatWindow import NZChatTab
from NZConfig import NZConfig
from NZContact import NZContact
from NZMessage import NZMsgType
from NZMessage import NZMessage
from NZStatus import NZStatus
class NZContactGroup(QtGui.QGroupBox):
def __i... | mit |
tumbl3w33d/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_video.py | 23 | 15184 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Diane Wang <dianew@vmware.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
... | gpl-3.0 |
cchristelis/watchkeeper | django_project/healthsites/utils.py | 1 | 1525 | __author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '25/04/16'
__license__ = "GPL"
__copyright__ = 'kartoza.com'
import os
import json
from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
from healthsites.map_clustering import cluster, parse_bbox
from healthsites.mod... | bsd-2-clause |
xpansa/purchase-workflow | vendor_consignment_stock/model/rule.py | 25 | 1027 | # -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... | agpl-3.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/test_loadables.py | 95 | 5425 | # Copyright 2012 OpenStack Foundation # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
Lekanich/intellij-community | python/testData/inspections/PyMethodMayBeStaticInspection/abc.py | 488 | 7145 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A d... | apache-2.0 |
tcc-unb-fga/debile | debile/slave/wrappers/cppcheck.py | 4 | 2142 | # Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2013 Leo Cavaille <leo@cavaille.net>
#
# 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, inc... | mit |
drincruz/luigi | luigi/rpc.py | 14 | 5624 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
ThatOneRoadie/Button | RFM69.py | 3 | 16138 | #!/usr/bin/env python2
from RFM69registers import *
import spidev
import RPi.GPIO as GPIO
import time
class RFM69(object):
def __init__(self, freqBand, nodeID, networkID, isRFM69HW = False, intPin = 18, rstPin = 29, spiBus = 0, spiDevice = 0):
self.freqBand = freqBand
self.address = nodeID
... | mit |
kmerenkov/clitter | setup.py | 1 | 1981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2008, Konstantin Merenkov <kmerenkov@gmail.com>
# 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 cod... | bsd-3-clause |
zero323/spark | python/pyspark/tests/test_serializers.py | 8 | 9189 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.