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 |
|---|---|---|---|---|---|
DirtyUnicorns/android_kernel_xiaomi_cancro | tools/perf/util/setup.py | 4998 | 1330 | #!/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 |
mjirayu/sit_academy | common/test/acceptance/tests/test_ora.py | 118 | 15617 | """
Tests for ORA (Open Response Assessment) through the LMS UI.
"""
import json
from unittest import skip
from bok_choy.promise import Promise, BrokenPromise
from ..pages.lms.peer_confirm import PeerConfirmPage
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.course_info import CourseInfoPage
from ..p... | agpl-3.0 |
OneEducation/kernel-rk310-kitkat-firefly | scripts/gcc-wrapper.py | 8 | 3546 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
aioue/ansible | lib/ansible/plugins/cliconf/aireos.py | 42 | 2670 | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
sebalix/OpenUpgrade | addons/delivery/delivery.py | 24 | 13544 | # -*- 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 |
MebiusHKU/flask-web | flask/lib/python2.7/site-packages/pbr/version.py | 47 | 18561 |
# Copyright 2012 OpenStack Foundation
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
#
# 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.ap... | bsd-3-clause |
zerobatu/edx-platform | common/djangoapps/embargo/tests/test_api.py | 60 | 13295 | """
Tests for EmbargoMiddleware
"""
from contextlib import contextmanager
import mock
import unittest
import pygeoip
import ddt
from django.conf import settings
from django.test.utils import override_settings
from django.core.cache import cache
from django.db import connection, transaction
from student.tests.factori... | agpl-3.0 |
scolladogsp/wiki | extensions/BlueSpiceDistribution/MobileFrontend/scripts/message.py | 3 | 1848 | #!/usr/bin/python
import json
import sys
json_file = open( 'i18n/en.json' )
json_object_en = json.loads(json_file.read())
json_file.close()
json_file = open( 'i18n/qqq.json' )
json_object_qqq = json.loads(json_file.read())
json_file.close()
key = raw_input("Choose a message key e.g. `mobile-frontend-xxx`:\n")
if not ... | gpl-2.0 |
corbett/parastro | ExamplePython/PlotData.py | 1 | 4815 | try: paraview.simple
except: from paraview.simple import *
Profile1 = GetActiveSource()
PlotData1 = PlotData()
XYPlotView1 = CreateXYPlotView()
DataRepresentation13 = Show()
DataRepresentation13.AttributeType = 'Row Data'
DataRepresentation13.SeriesVisibility = ['velocity_total (0)', '0', 'velocity_total (1)', '0', ... | lgpl-3.0 |
jamesyli/solum | solum/api/controllers/v1/datamodel/extension.py | 6 | 1867 | # 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 |
ddayguerrero/blogme | flask/lib/python3.4/site-packages/setuptools/command/upload_docs.py | 332 | 6811 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
import os
import socket
import zipfile
import tempfile
import sys
import shutil
from base64 import standard_b64encode
from pkg_resources import iter_entry_points
from distuti... | mit |
kisom/pypcapfile | pcapfile/test/linklayer_test.py | 3 | 1323 | #!/usr/bin/env python
"""
This is the test case for the savefile.
"""
import unittest
from pcapfile import savefile
from pcapfile import linklayer
from pcapfile.protocols.linklayer import ethernet
class TestCase(unittest.TestCase):
"""
Validate the linklayer utility functions.
"""
capfile = None
... | isc |
mnahm5/django-estore | Lib/site-packages/pip/utils/packaging.py | 343 | 2080 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import sys
from pip._vendor.packaging import specifiers
from pip._vendor.packaging import version
from pip._vendor import pkg_resources
from pip import exceptions
logger = logging.getLogger(__name__)
def check_requires_pyth... | mit |
chandlercr/aima-python | submissions/Fritz/puzzles.py | 19 | 2406 | import search
from math import(cos, pi)
AK_map = search.UndirectedGraph(dict(
#Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
#Cottontown=dict(Portland=18),
#Fairfield=dict(Mitchellville=21, Portland=17),
#Mitchellville=dict(Portland=7, Fairfield=21),
Angoon=dict(Juneau=10, Hoonah... | mit |
hsoft/pluginbuilder | pluginbuilder/util.py | 1 | 12467 | import os, sys, zipfile, time
from modulegraph.find_modules import PY_SUFFIXES
from modulegraph.modulegraph import os_listdir
import macholib.util
def os_path_islink(path):
"""
os.path.islink with zipfile support.
Luckily zipfiles cannot contain symlink, therefore the implementation is
trivial.
""... | mit |
shootstar/novatest | nova/cloudpipe/pipelib.py | 3 | 7066 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
hypnotika/namebench | nb_third_party/dns/reversename.py | 248 | 2931 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
jimcarreer/hpack | setup.py | 1 | 1691 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open('hpack/__init__.py', 'r') as f:
text = f.read()
match = r... | mit |
gooftroop/Zeus | contrib/sqlalchemy/types.py | 48 | 1650 | # types.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Compatibility namespace for sqlalchemy.sql.types.
"""
__all__ = ['TypeEngine', 'TypeDe... | mit |
ByteInternet/libcloud | libcloud/test/common/test_openstack.py | 9 | 1830 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
CliMT/climt-future | climt/_lib/rrtmg_lw/setup.py | 1 | 2948 | from setuptools import setup, Extension
from Cython.Distutils import build_ext
# This line only needed if building with NumPy in Cython file.
from numpy import get_include
from os import system
import os
# compile the fortran modules without linking
module_list = [
'parkind.f90',
'parrrtm.f90',
'rrlw_cld.f... | bsd-3-clause |
chienlieu2017/it_management | odoo/addons/account_budget/tests/test_theoreticalamount.py | 26 | 4341 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .common import TestAccountBudgetCommon
from mock import patch
from odoo.fields import Datetime
# ---------------------------------------------------------
# Tests
# ------------------------------------------------... | gpl-3.0 |
SVoxel/R7800 | git_home/linux.git/sourcecode/scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
supriyantomaftuh/antlr4 | runtime/Python2/src/antlr4/dfa/DFAState.py | 14 | 6889 | #
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... | bsd-3-clause |
hachreak/invenio-accounts | invenio_accounts/models.py | 1 | 5487 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 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... | gpl-2.0 |
BKreisel/letsencrypt | letsencrypt/validator.py | 44 | 2825 | """Validators to determine the current webserver configuration"""
import logging
import socket
import requests
import zope.interface
from acme import crypto_util
from acme import errors as acme_errors
from letsencrypt import interfaces
logger = logging.getLogger(__name__)
class Validator(object):
# pylint: dis... | apache-2.0 |
bjzhang/xen | tools/python/xen/xend/uuid.py | 48 | 2410 | #============================================================================
# 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 |
Serag8/Bachelor | google_appengine/lib/django-1.2/django/contrib/gis/tests/relatedapp/tests.py | 123 | 13948 | from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati... | mit |
xiaoxiamii/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 251 | 2022 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
linan7788626/adventures_in_opencl | experiments/radix/amd/radix.py | 5 | 1198 | #http://documen.tician.de/pyopencl/
import pyopencl as cl
import numpy as np
import struct
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
mf = cl.mem_flags
f = open("radix.cl", 'r')
fstr = "".join(f.readlines())
#print fstr
#create the program
prg = cl.Program(ctx, fstr).build()
"""
def add(a, b):
... | mit |
super-test/webexam | node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py | 260 | 4932 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# By Yusuke Suzuki <utatane.tea@gmail.com>
# Modified by Mathias Bynens <http://mathiasbynens.be/>
# http://code.google.com/p/esprima/issues/detail?id=110
import sys
import string
import re
class RegExpGenerator(object):
def __init__(self, detector):
self.detector = det... | mit |
mwv/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
meghana1995/sympy | sympy/physics/quantum/tests/test_cartesian.py | 129 | 3856 | """Tests for cartesian.py"""
from sympy import S, Interval, symbols, I, DiracDelta, exp, sqrt, pi
from sympy.physics.quantum import qapply, represent, L2, Dagger
from sympy.physics.quantum import Commutator, hbar
from sympy.physics.quantum.cartesian import (
XOp, YOp, ZOp, PxOp, X, Y, Z, Px, XKet, XBra, PxKet, Px... | bsd-3-clause |
flingone/frameworks_base_cmds_remoted | libs/boost/tools/regression/src/smoke.py | 4 | 6273 | # smoke test - every so many minutes, check svn revision, and if changed:
# update working copy, run tests, upload results
# Copyright Beman Dawes 2007
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#... | apache-2.0 |
ShashaQin/erpnext | erpnext/patches/v4_2/set_item_has_batch.py | 91 | 2481 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("update tabItem set has_batch_no = 0 where ifnull(has_batch_no, '') = ''")
frappe.db.sql("update tabItem s... | agpl-3.0 |
caseyrygt/osf.io | scripts/github/update_hooks.py | 55 | 3460 | """
Ensure that all GitHub web hooks have a secret key for verification.
"""
import logging
from github3.models import GitHubError
from modularodm import Q
import mock
from nose.tools import *
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
from framework.mongo import StoredObject
from... | apache-2.0 |
cjqhenry14/localOrcCppLib | c++/libs/protobuf-2.6.0/python/google/protobuf/internal/message_python_test.py | 27 | 2346 | #! /usr/bin/python
#
# 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:
#
# ... | apache-2.0 |
minhphung171093/GreenERP_V7 | openerp/addons/account/tests/test_tax.py | 449 | 1740 | from openerp.tests.common import TransactionCase
class TestTax(TransactionCase):
"""Tests for taxes (account.tax)
We don't really need at this point to link taxes to tax codes
(account.tax.code) nor to companies (base.company) to check computation
results.
"""
def setUp(self):
super(T... | agpl-3.0 |
JshWright/home-assistant | tests/components/config/test_zwave.py | 10 | 4020 | """Test Z-Wave config panel."""
import asyncio
import json
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from tests.common import mock_http_component_app
VIEW_NAME = 'api:config:zwave:device_config'
@asyncio.coroutine
def test_... | apache-2.0 |
slohse/ansible | test/units/config/manager/test_find_ini_config_file.py | 27 | 10595 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, 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)
__metaclass__ = type
import os
import os.path
import stat
import pytest
from a... | gpl-3.0 |
RockySteveJobs/python-for-android | python-modules/twisted/twisted/enterprise/sqlreflector.py | 61 | 11875 | # -*- test-case-name: twisted.test.test_reflector -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.enterprise import reflector
from twisted.enterprise.util import DBError, getKeyColumn, quote, safe
from twisted.enterprise.util import _TableInfo
from twisted.enterprise... | apache-2.0 |
mitchcapper/mythbox | resources/lib/twisted/twisted/test/test_newcred.py | 56 | 15084 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.cred}, now with 30% more starch.
"""
import hmac
from zope.interface import implements, Interface
from twisted.trial import unittest
from twisted.cred import portal, checkers, credentials, error
from twisted.py... | gpl-2.0 |
yujikato/DIRAC | src/DIRAC/Resources/Computing/PilotBundle.py | 2 | 2190 | ########################################################################
# File : PilotBundle.py
# Author : Ricardo Graciani
########################################################################
"""
Collection of Utilities to handle pilot jobs
"""
from __future__ import absolute_import
from __future__ import di... | gpl-3.0 |
Sutil/netanimations | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | cc0-1.0 |
aseigneurin/ansible-modules-core | packaging/os/apt_repository.py | 57 | 16227 | #!/usr/bin/python
# encoding: utf-8
# (c) 2012, Matt Wright <matt@nobien.net>
# (c) 2013, Alexander Saltanov <asd@mokote.com>
# (c) 2014, Rutger Spiertz <rutger@kumina.nl>
#
# 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... | gpl-3.0 |
jindaxia/xbmc-addons-chinese | plugin.video.pps/resources/lib/etree/__init__.py | 1200 | 1604 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | gpl-2.0 |
ytrstu/gae-cms | framework/subsystems/configuration/__init__.py | 2 | 2667 | """
@org: GAE-CMS.COM
@description: Python-based CMS designed for Google App Engine
@(c): gae-cms.com 2012
@author: Imran Somji
@license: GNU GPL v2
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; ei... | gpl-2.0 |
zzzeek/alembic | tests/test_environment.py | 2 | 5158 | #!coding: utf-8
import os
import sys
from alembic import command
from alembic import testing
from alembic import util
from alembic.environment import EnvironmentContext
from alembic.migration import MigrationContext
from alembic.script import ScriptDirectory
from alembic.testing import config
from alembic.testing impo... | mit |
asposewords/Aspose_Words_Java | Plugins/Aspose_Words_Java_for_Jython/asposewords/programming_documents/RemoveBreaks.py | 4 | 2010 | from asposewords import Settings
from com.aspose.words import Document
from com.aspose.words import NodeType
from com.aspose.words import ControlChar
class RemoveBreaks:
def __init__(self):
dataDir = Settings.dataDir + 'programming_documents/'
# Open the document.
doc = Document(d... | mit |
TemplateVoid/mapnik | tests/python_tests/cairo_test.py | 2 | 8371 | #!/usr/bin/env python
import os
import shutil
import mapnik
from nose.tools import *
from utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
def make_tmp_map():
m = m... | lgpl-2.1 |
Rav3nPL/p2pool-myriadcoin | SOAPpy/WSDL.py | 294 | 5100 | """Parse web services description language to get SOAP methods.
Rudimentary support."""
ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $'
from version import __version__
import wstools
import xml
from Errors import Error
from Client import SOAPProxy, SOAPAddress
from Config import Config
import urllib
class... | gpl-3.0 |
zangree/ryu | ryu/contrib/tinyrpc/server/__init__.py | 40 | 2682 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# FIXME: needs unittests
# FIXME: needs checks for out-of-order, concurrency, etc as attributes
from tinyrpc.exc import RPCError
class RPCServer(object):
"""High level RPC server.
:param transport: The :py:class:`~tinyrpc.transports.RPCTransport` to use.
:par... | apache-2.0 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/names/test/test_tap.py | 39 | 3856 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.names.tap}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.usage import UsageError
from twisted.names.tap import Options, _buildResolvers
from twisted.names.dns import PORT
from twisted.names.secondary... | agpl-3.0 |
CodeDJ/qt5-hidpi | qt/qtwebkit/Tools/Scripts/webkitpy/common/net/web.py | 194 | 1811 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lgpl-2.1 |
khertan/KhtNotes | khtnotes/merge3/merge3.py | 1 | 18192 | # Copyright (C) 2005-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | gpl-3.0 |
OpenPymeMx/OCB | addons/document/__init__.py | 434 | 1128 | # -*- 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 |
spxtr/bazel | third_party/protobuf/3.4.0/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py | 51 | 1867 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
olapaola/olapaola-android-scripting | python/src/Lib/test/sample_doctest.py | 228 | 1037 | """This is a sample module that doesn't really test anything all that
interesting.
It simply has a few tests, some of which succeed and some of which fail.
It's important that the numbers remain constant as another test is
testing the running of these tests.
>>> 2+2
4
"""
def foo():
"""
>>> 2+2
5
... | apache-2.0 |
tschalch/pyTray | src/setup.py | 1 | 6933 | #!/usr/bin/env python
#this installer script uses InnoSetup to generate a complete Installer
from distutils.core import setup
import py2exe
import os, os.path, sys
import glob
#adding lib directory to module search path
libpath = os.path.abspath(os.path.dirname(sys.argv[0])) + "/lib"
sys.path.append(os.path.abs... | bsd-3-clause |
jkbradley/spark | python/pyspark/mllib/fpm.py | 28 | 6682 | #
# 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 |
campbe13/openhatch | vendor/packages/django-invitation/invitation/tests.py | 16 | 6820 | """
Unit tests for django-invitation.
These tests assume that you've completed all the prerequisites for
getting django-invitation running in the default setup, to wit:
1. You have ``invitation`` in your ``INSTALLED_APPS`` setting.
2. You have created all of the templates mentioned in this
application's documenta... | agpl-3.0 |
adrienbrault/home-assistant | homeassistant/components/wolflink/const.py | 18 | 3328 | """Constants for the Wolf SmartSet Service integration."""
DOMAIN = "wolflink"
COORDINATOR = "coordinator"
PARAMETERS = "parameters"
DEVICE_ID = "device_id"
DEVICE_GATEWAY = "device_gateway"
DEVICE_NAME = "device_name"
STATES = {
"Ein": "ein",
"Deaktiviert": "deaktiviert",
"Aus": "aus",
"Standby": "s... | mit |
romankagan/DDBWorkbench | python/helpers/docutils/transforms/misc.py | 183 | 4882 | # $Id: misc.py 6314 2010-04-26 10:04:17Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Miscellaneous transforms.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.transforms import Transform, TransformError
clas... | apache-2.0 |
batxes/4c2vhic | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/SHH_WT_models_highres28239.py | 4 | 88217 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
minhphung171093/OpenERP_V8 | openerp/addons/account/account_cash_statement.py | 283 | 15868 | # encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
minhphung171093/OpenERP_V8 | openerp/addons/account/report/common_report_header.py | 386 | 6479 | # -*- 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 |
tdegeus/GooseEYE | docs/examples/clusters_dilate_periodic.py | 1 | 2926 | r'''
Plot and/or check.
Usage:
script [options]
Options:
-s, --save Save output for later check.
-c, --check Check against earlier results.
-p, --plot Plot.
-h, --help Show this help.
'''
# <snippet>
import numpy as np
import GooseEYE
# generate image
I = np.zeros((21, 21)... | gpl-3.0 |
chukong/sdkbox-facebook-sample-v2 | external/emscripten/third_party/ply/example/BASIC/basiclog.py | 166 | 1694 | # An implementation of Dartmouth BASIC (1964)
#
import sys
sys.path.insert(0,"../..")
if sys.version_info[0] >= 3:
raw_input = input
import logging
logging.basicConfig(
level = logging.INFO,
filename = "parselog.txt",
filemode = "w"
)
log = logging.getLogger()
import basiclex
import basparse
import ... | mit |
jaredweiss/nupic | nupic/regions/ImageSensorFilters/AddNoise.py | 15 | 5599 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
NovikovMA/python_training_mantis | test/test_project_del.py | 1 | 3996 | # -*- coding: utf-8 -*-
__author__ = 'M.Novikov'
from model.project import Project # Проекты Mantis
from random import randrange # Случайности
import random # Случайнос... | apache-2.0 |
raffazizzi/vexflow | site_scons/vexflow_scons.py | 120 | 2838 | """
VexFlow / TabDiv Build Script
Requires: SCons, Git, and Google Closure Compiler
Copyright Mohit Cheppudira 2010
"""
import os
from datetime import datetime
from SCons.Script import *
"""
Make the default zip action use the external zip command. Also
add -j (--junk-paths) to the command to store only the name of ... | mit |
Shaps/ansible | test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py | 68 | 1726 | #!/usr/bin/env python
# a script to check for illegal filenames on various Operating Systems. The
# main rules are derived from restrictions on Windows
# https://msdn.microsoft.com/en-us/library/aa365247#naming_conventions
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ... | gpl-3.0 |
drupdates/Slack | __init__.py | 1 | 1072 | """ Send report using Slack. """
from drupdates.settings import Settings
from drupdates.utils import Utils
from drupdates.constructors.reports import Report
import json, os
class Slack(Report):
""" Slack report plugin. """
def __init__(self):
current_dir = os.path.dirname(os.path.realpath(__file__))
... | mit |
mdibaiee/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/standalone.py | 410 | 46785 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
maxime-beck/compassion-modules | mobile_app_connector/mappings/compassion_project_mapping.py | 1 | 8179 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Quentin Gigon <gigon.quentin@gmail.com>
#
# The licence is in the file __manifest__.py
#
############################################... | agpl-3.0 |
sxjscience/mxnet | example/gluon/super_resolution/super_resolution.py | 9 | 8717 | # 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 |
shineyear/catawampus | tr/vendor/bup/lib/tornado/ioloop.py | 8 | 18036 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
rschnapka/odoo | openerp/addons/base/module/__init__.py | 462 | 1088 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
drsounds/mingus | unittest/test_notes.py | 12 | 3783 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path = ['../'] + sys.path
import mingus.core.notes as notes
from mingus.core.mt_exceptions import RangeError
import unittest
class test_notes(unittest.TestCase):
def setUp(self):
self.base_notes = ['C', 'D', 'E', 'F', 'G', 'A', 'B']
self.shar... | gpl-3.0 |
RudolfCardinal/pythonlib | cardinal_pythonlib/wsgi/headers_mw.py | 1 | 4487 | #!/usr/bin/env python
# cardinal_pythonlib/headers_mw.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (... | apache-2.0 |
RueLaLaTech/savory-pie | savory_pie/tests/django/mock_orm.py | 2 | 7685 | import operator
import random
from django.db.models import Q
from django.db.models.signals import post_init
from mock import Mock
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
class QuerySet(Mock):
def __init__(self, *elements):
super(QuerySet, self).__init__()
i... | mit |
simonzhangsm/voltdb | tests/sqlcoverage/config/all-config.py | 1 | 15894 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# 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 limitati... | agpl-3.0 |
adamcandy/QGIS-Meshing | extras/old_release_versions/mesh_netcdf/meshnetcdf.py | 3 | 8544 | """
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Adam S. Candy, adam.candy@im... | lgpl-2.1 |
charleswhchan/ansible | lib/ansible/new_inventory/host.py | 236 | 1551 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... | gpl-3.0 |
aep124/TwitterAnalyticsTools | textonly.py | 1 | 2405 | # this is a script to retrieve and process text-only data for classification
# This process includes four main tasks
# 1) getting raw tweets
# 2) apply labels (this step can be conducted at any time)
# 2) filtering those tweets (e.g., according to CMU POS tagger)
# 3) deriving a set of features (a.k.a. wo... | mit |
ayepezv/GAD_ERP | openerp/addons/base/module/report/ir_module_reference_print.py | 5 | 1574 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class IrModelReferenceReport(models.AbstractModel):
_name = 'report.base.report_irmodulereference'
@api.model
def _object_find(self, module):
Data = self.env['ir.model.d... | gpl-3.0 |
andriibekker/biddingsbase | django/contrib/localflavor/sk/sk_districts.py | 543 | 2453 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... | bsd-3-clause |
maxsocl/django | tests/custom_managers/models.py | 56 | 6047 | """
Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial ``Q... | bsd-3-clause |
tta/gnuradio-tta | gr-noaa/apps/file_rx_hrpt.py | 9 | 11669 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: USRP HRPT Receiver
# Generated: Mon Nov 9 07:47:17 2009
##################################################
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import noaa
from gnuradio im... | gpl-3.0 |
SouthStar/portia | slyd/slyd/projectspec.py | 12 | 9052 | from __future__ import absolute_import
import json, re, shutil, errno, os
import slyd.errors
from os.path import join, splitext
from twisted.web.resource import NoResource, ForbiddenResource
from jsonschema.exceptions import ValidationError
from .resource import SlydJsonResource
from .html import html4annotation
from... | bsd-3-clause |
AsgerPetersen/QGIS | python/plugins/processing/algs/grass7/ext/v_net_alloc.py | 10 | 1348 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_net_alloc.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Médéric Ribreux
Email : medspx at medspx dot fr
***********************... | gpl-2.0 |
jdemel/gnuradio | gr-qtgui/examples/pyqt_time_c.py | 3 | 6213 | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import blocks
import sys
try:
f... | gpl-3.0 |
apache/incubator-cotton | mysos/common/pkgutil.py | 5 | 1875 | import os
from twitter.common.dirutil import safe_mkdir
import pkg_resources
def unpack_assets(output_dir, module, asset_path, execute=lambda x: None):
"""
Extract files from a module in a package into 'output_dir'.
:param output_dir: The directory to copy the assets *root* to.
:param module: The mod... | apache-2.0 |
daicang/Leetcode-solutions | 146-lru-cache.py | 1 | 1792 | class DLNode(object):
def __init__(self):
self.key = None
self.value = None
self.prev = None
self.next = None
class LRUCache(object):
def __init__(self, capacity):
"""
:type capacity: int
"""
self.head = DLNode()
self.tail = DLNode()
... | mit |
naousse/odoo | addons/pos_discount/discount.py | 315 | 1468 | # -*- 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 |
brettchien/LeetCode | 9_PalindromeNumber.py | 1 | 3651 | class Solution:
# @param {integer} x
# @return {boolean}
def isPalindrome(self, x):
if x < 0:
return False
if x > 0 and x % 10 == 0:
return False
reverse = 0
while x > reverse:
reverse = reverse * 10 + x % 10
x /= 10
ret... | mit |
AlexHill/mezzanine | mezzanine/blog/migrations/0005_auto__del_comment__add_field_blogpost_comments_count__chg_field_blogpo.py | 8 | 10953 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label = '%s... | bsd-2-clause |
tchellomello/home-assistant | homeassistant/components/cups/sensor.py | 10 | 10686 | """Details about printers which are connected to CUPS."""
from datetime import timedelta
import importlib
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_PORT, PERCENTAGE
from homeassistant.exceptions import PlatformNo... | apache-2.0 |
paran0ids0ul/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/treewalkers/lxmletree.py | 436 | 5992 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isinstance(s, text_type):
... | gpl-3.0 |
DoreeUrner3/Doreen | py/openage/convert/cabextract/__main__.py | 46 | 1073 | #!/usr/bin/env python3
from . import cab
def dump_cabfolder(folder, outfile):
while True:
data = folder.pseudofile.read(4096)
if data == b"":
break
outfile.write(data)
def print_cabfile(cabfile):
print("\x1b[1mHeader\x1b[m")
print(cabfile.header)
for number, folder... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.