repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Jeff-Tian/mybnb | Python27/Lib/lib-tk/test/test_ttk/test_functions.py | 2 | 17810 | # -*- encoding: utf-8 -*-
import sys
import unittest
import ttk
class MockTkApp:
def splitlist(self, arg):
if isinstance(arg, tuple):
return arg
return arg.split(':')
def wantobjects(self):
return True
class MockTclObj(object):
typename = 'test'
... | apache-2.0 |
laurentb/weboob | modules/journaldesfemmes/module.py | 1 | 2124 | # -*- coding: utf-8 -*-
# Copyright(C) 2018 Phyks (Lucas Verney)
#
# This file is part of a weboob module.
#
# This weboob module 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 o... | lgpl-3.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/py2.5/lib/python2.5/lib-tk/Tkconstants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | mit |
RT-Thread/rt-thread | bsp/tm4c129x/rtconfig.py | 12 | 3663 | # BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D)
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
#device options
PART_TYPE = 'PART_TM4C129XNCZAD'
# cross_tool provides the cross compiler
# EXEC_... | apache-2.0 |
nhr/openshift-ansible | roles/lib_openshift/src/lib/project.py | 82 | 2503 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class ProjectConfig(OpenShiftCLIConfig):
''' project config object '''
def __init__(self, rname, namespace, kubeconfig, project_options):
super(ProjectConfig, self).__init__(rname, None, kubeconfig, project_options)
cl... | apache-2.0 |
nicobot/electron | tools/mac/apply_locales.py | 202 | 1454 | #!/usr/bin/env python
# Copyright (c) 2009 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.
# TODO: remove this script when GYP has for loops
import sys
import optparse
def main(argv):
parser = optparse.OptionParser()
... | mit |
klen/peewee_migrate | tests/test_cli.py | 1 | 3157 | from click.testing import CliRunner
import pytest
from peewee_migrate.cli import cli, get_router
runner = CliRunner()
@pytest.fixture
def dir_option(tmpdir):
return '--directory=%s' % tmpdir
@pytest.fixture
def db_url(tmpdir):
db_path = '%s/test_sqlite.db' % tmpdir
open(db_path, 'a').close()
retur... | bsd-3-clause |
akretion/bank-statement-reconcile-simple | account_statement_completion_label_simple/wizard/account_statement_label_create.py | 1 | 1772 | # Copyright 2018-2019 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountStatementLabelCreate(models.TransientModel):
_name = 'account.statement.lab... | agpl-3.0 |
jumpserver/jumpserver | apps/ops/inventory.py | 2 | 5220 | # -*- coding: utf-8 -*-
#
from django.conf import settings
from .ansible.inventory import BaseInventory
from common.utils import get_logger
__all__ = [
'JMSInventory', 'JMSCustomInventory',
]
logger = get_logger(__file__)
class JMSBaseInventory(BaseInventory):
windows_ssh_default_shell = settings.WINDOWS... | gpl-2.0 |
Logan213/is210-week-05-warmup | tests/test_task_04.py | 28 | 1434 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests Task 04."""
# Import Python libs
import unittest
import task_04
class Task04TestCase(unittest.TestCase):
"""Test cases for Task 04."""
testmap = {
'not_enough_litterboxes': [2, 1, True, True],
'plenty_of_litterboxes': [1, 2, True, False... | mpl-2.0 |
tudorvio/nova | nova/cmd/dhcpbridge.py | 41 | 4778 | # 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 compliance with the License. You may obtain
# a ... | apache-2.0 |
ragnarstroberg/ragnar_imsrg | src/pybind11/tests/test_modules.py | 4 | 2208 |
def test_nested_modules():
import pybind11_tests
from pybind11_tests.submodule import submodule_func
assert pybind11_tests.__name__ == "pybind11_tests"
assert pybind11_tests.submodule.__name__ == "pybind11_tests.submodule"
assert submodule_func() == "submodule_func()"
def test_reference_interna... | gpl-2.0 |
brunobergher/dotfiles | sublime/pygments/all/pygments/lexers/textedit.py | 47 | 6057 | # -*- coding: utf-8 -*-
"""
pygments.lexers.textedit
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for languages related to text processing.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer im... | mit |
tliber/scrapy | setup.py | 83 | 1605 | from os.path import dirname, join
from setuptools import setup, find_packages
with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:
version = f.read().decode('ascii').strip()
setup(
name='Scrapy',
version=version,
url='http://scrapy.org',
description='A high-level Web Crawling and Web... | bsd-3-clause |
oVirt/ovirt-hosted-engine-setup | src/plugins/gr-he-common/sanlock/lockspace.py | 1 | 2295 | #
# ovirt-hosted-engine-setup -- ovirt hosted engine setup
# Copyright (C) 2013-2017 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, o... | lgpl-2.1 |
emd/boutanalysis | varyped.py | 1 | 4568 | '''Tools for interacting with VARYPED model equilibria'''
import numpy as np
from sys import argv
import string
import copy
def create_db(file_path):
'''Create a dictionary from a VARYPED results text file.
Parameters:
file_path -- string, path to the text file containing VARYPED results.
The fi... | lgpl-3.0 |
SM-G920P/G92XP-R4_COI9 | 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 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/pandas/tseries/tests/test_base.py | 9 | 82416 | from __future__ import print_function
import re
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
from pandas.tseries.base import DatetimeIndexOpsMixin
from pandas.util.testing import assertRaisesRegexp, assertIsInstance
from pandas.tseries.common import is_datetimelike
from pandas import ... | gpl-2.0 |
maistrovas/My-Courses-Solutions | Coursera Algorithmic Thinking (Part 1)/Module 2/Application/Application2.py | 1 | 7494 | """
Provided code for Application portion of Module 2
Answers 4/6
Application Grade is 13 out of 15
Text Answers
-Question 2:
All three graphs are resilient in this case.
Question5:
-UPA and ER graphs are steel resilient
(UPA is very close to overcoming 25% roughnes)
in this type of attack.
"""
# general imports... | mit |
blink1073/scikit-image | skimage/color/tests/test_adapt_rgb.py | 19 | 2591 | from functools import partial
import numpy as np
from skimage import img_as_float, img_as_uint
from skimage import color, data, filters
from skimage.color.adapt_rgb import adapt_rgb, each_channel, hsv_value
from skimage._shared._warnings import expected_warnings
# Down-sample image for quicker testing.
COLOR_IMAGE =... | bsd-3-clause |
cyberden/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/collegehumor.py | 150 | 3638 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import int_or_none
class CollegeHumorIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?collegehumor\.com/(video|embed|e)/(?P<videoid>[0-9]+)/?(?P<shorttitle>.*)$'
_TESTS = [
{
... | gpl-3.0 |
wooga/airflow | tests/providers/amazon/aws/sensors/test_sagemaker_base.py | 1 | 4679 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
Timurdov/bionic | bionic/Lib/site-packages/django/db/backends/sqlite3/base.py | 52 | 23862 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.conf import settings
from django.db import utils
from django.db.backends import (utils... | apache-2.0 |
PeterMosmans/letsencrypt | letsencrypt/tests/auth_handler_test.py | 4 | 18143 | """Tests for letsencrypt.auth_handler."""
import functools
import logging
import unittest
import mock
from acme import challenges
from acme import client as acme_client
from acme import messages
from letsencrypt import errors
from letsencrypt import le_util
from letsencrypt.tests import acme_util
TRANSLATE = {
... | apache-2.0 |
aospx-kitkat/platform_external_chromium_org | ui/resources/resource_check/resource_scale_factors.py | 41 | 4151 | # 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.
"""Presubmit script for Chromium browser resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about t... | bsd-3-clause |
Panos512/invenio | modules/websubmit/lib/websubmitadmin_engine.py | 25 | 240715 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
## ... | gpl-2.0 |
darkleons/odoo | addons/mrp_repair/mrp_repair.py | 4 | 36646 | # -*- 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 |
repotvsupertuga/repo | plugin.video.jami/resources/lib/resolvers/fastvideo.py | 23 | 1471 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
MRigal/django | django/contrib/gis/admin/options.py | 379 | 5649 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
from django.core.exceptions import ImproperlyConfigured
spherical_mercator_srid = 3857
class GeoModelAdmin(Model... | bsd-3-clause |
thaihungle/deepexp | kbtext-mann/get_stats.py | 3 | 2790 | import json
import util
from collections import defaultdict
def get_fb_stats(freebase_data_file):
with open(freebase_data_file) as fb:
fact_counter = 0
relation_set = set()
entity_set = set()
for line in fb:
line = line.strip()
line = line[1:-1]
... | mit |
sunzhongwei/pelican | pelican/readers.py | 4 | 21032 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import logging
import os
import re
import docutils
import docutils.core
import docutils.io
from docutils.writers.html4css1 import HTMLTranslator
import six
# import the directives to have pygments support
from pelican import rstdirective... | agpl-3.0 |
BillKeenan/lets-encrypt-preview | letsencrypt/tests/proof_of_possession_test.py | 37 | 3484 | """Tests for letsencrypt.proof_of_possession."""
import os
import tempfile
import unittest
import mock
from acme import challenges
from acme import jose
from acme import messages
from letsencrypt import achallenges
from letsencrypt import proof_of_possession
from letsencrypt.display import util as display_util
from... | apache-2.0 |
marcore/edx-platform | common/djangoapps/terrain/stubs/lti.py | 44 | 12380 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
from oauthlib.oauth1.rfc5849 ... | agpl-3.0 |
python-tap/tappy | tap/tests/test_result.py | 2 | 3581 | # Copyright (c) 2019, Matt Layman and contributors
import contextlib
import os
import unittest
import unittest.case
from tap.i18n import _
from tap.runner import TAPTestResult
from tap.tests import TestCase
from tap.tracker import Tracker
class FakeTestCase(unittest.TestCase):
def runTest(self):
pass
... | bsd-2-clause |
pedrobaeza/OpenUpgrade | openerp/cli/server.py | 187 | 5869 | # -*- 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 |
h3biomed/luigi | luigi/execution_summary.py | 7 | 17170 | # -*- coding: utf-8 -*-
#
# Copyright 2015-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 |
mKeRix/home-assistant | homeassistant/components/freebox/config_flow.py | 6 | 3504 | """Config flow to configure the Freebox integration."""
import logging
from aiofreepybox.exceptions import AuthorizationError, HttpRequestError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from .const import DOMAIN # pylint: disable=unused-im... | mit |
FireballDWF/cloud-custodian | tools/c7n_gcp/tests/test_notify_gcp.py | 5 | 2961 | # Copyright 2019 Capital One Services, LLC
#
# 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... | apache-2.0 |
joeyli/qemu-acpitad | tests/qemu-iotests/qed.py | 248 | 7194 | #!/usr/bin/env python
#
# Tool to manipulate QED image files
#
# Copyright (C) 2010 IBM, Corp.
#
# Authors:
# Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
import sys
import struct
import r... | gpl-2.0 |
sugruedes/bitcoin | contrib/testgen/gen_base58_test_vectors.py | 1000 | 4343 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
rmboggs/django | django/core/files/utils.py | 395 | 1338 | from django.utils import six
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
... | bsd-3-clause |
levkar/odoo | addons/hw_scale/controllers/main.py | 20 | 15524 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import os
import re
import time
from collections import namedtuple
from os import listdir
from threading import Thread, Lock
from odoo import http
import odoo.addons.hw_proxy.controllers.main as hw_prox... | agpl-3.0 |
CollabQ/CollabQ | vendor/gdata/spreadsheet/__init__.py | 147 | 17942 | #!/usr/bin/python
#
# Copyright (C) 2007 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 |
pku9104038/edx-platform | lms/djangoapps/courseware/management/commands/export_course.py | 7 | 2593 | """
A Django command that exports a course to a tar.gz file.
If <filename> is '-', it pipes the file to stdout
"""
import os
import shutil
import tarfile
from tempfile import mktemp, mkdtemp
from textwrap import dedent
from path import path
from django.core.management.base import BaseCommand, CommandError
from xm... | agpl-3.0 |
fanne/june | june/forms/node.py | 11 | 1204 | # coding: utf-8
from wtforms import TextField, TextAreaField, SelectField, BooleanField
from wtforms.validators import DataRequired
from flask.ext.babel import lazy_gettext as _
from ._base import BaseForm
from ..models import Node
class NodeForm(BaseForm):
title = TextField(
_('Title'), validators=[Dat... | bsd-3-clause |
justajeffy/arsenalsuite | cpp/apps/bach/data_export/FixCachedKeywords.py | 10 | 7224 | #!/usr/bin/env python2.5
#
# Copyright (c) 2009 Dr. D Studios. (Please refer to license for details)
# SVN_META_HEADURL = "$HeadURL: $"
# SVN_META_ID = "$Id: FixCachedKeywords.py 9408 2010-03-03 22:35:49Z brobison $"
#
import sys
import os
from PyQt4.QtSql import *
#--------------------------------------------------... | gpl-2.0 |
manastech/de-bee | gdata/Crypto/Cipher/__init__.py | 271 | 1145 | """Secret-key encryption algorithms.
Secret-key encryption algorithms transform plaintext in some way that
is dependent on a key, producing ciphertext. This transformation can
easily be reversed, if (and, hopefully, only if) one knows the key.
The encryption modules here all support the interface described in PEP
272... | mit |
jordiclariana/ansible | lib/ansible/modules/cloud/amazon/iam_mfa_device_facts.py | 48 | 3696 | #!/usr/bin/python
# 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... | gpl-3.0 |
crobinso/pkgdb2 | pkgdb2/ui/collections.py | 4 | 6211 | # -*- coding: utf-8 -*-
#
# Copyright © 2013-2014 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, or (at your option) any later
# version. This program is distributed... | gpl-2.0 |
rghe/ansible | test/units/modules/network/nxos/test_nxos_bgp_neighbor_af.py | 18 | 4920 | # (c) 2016 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 dis... | gpl-3.0 |
stweil/letsencrypt | acme/acme/fields.py | 53 | 1742 | """ACME JSON fields."""
import logging
import pyrfc3339
from acme import jose
logger = logging.getLogger(__name__)
class Fixed(jose.Field):
"""Fixed field."""
def __init__(self, json_name, value):
self.value = value
super(Fixed, self).__init__(
json_name=json_name, default=val... | apache-2.0 |
cernops/nova | nova/tests/unit/console/test_websocketproxy.py | 10 | 13858 | # 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 agreed to in... | apache-2.0 |
spacy-io/spaCy | spacy/displacy/render.py | 2 | 13219 | from typing import Dict, Any, List, Optional, Union
import uuid
from .templates import TPL_DEP_SVG, TPL_DEP_WORDS, TPL_DEP_WORDS_LEMMA, TPL_DEP_ARCS
from .templates import TPL_ENT, TPL_ENT_RTL, TPL_FIGURE, TPL_TITLE, TPL_PAGE
from .templates import TPL_ENTS
from ..util import minify_html, escape_html, registry
from ..... | mit |
daonb/obudget | src/server/budget_lines/management/commands/budget_lines_csv_to_db.py | 1 | 1996 | import sys
import csv
import re
from obudget.budget_lines.models import BudgetLine
from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = '<csv-file>'
help = 'Parses csv''d budget data into the DB'
def handle(self, *args, **options):
reader = csv.DictReader(file(... | bsd-3-clause |
CloudServer/nova | nova/api/openstack/compute/contrib/baremetal_nodes.py | 60 | 6552 | # Copyright (c) 2013 NTT DOCOMO, 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 requ... | apache-2.0 |
HewlettPackard/oneview-ansible | build-doc/module_docs_fragments/oneview.py | 1 | 2367 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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/licen... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/unittest/main.py | 84 | 9759 | """Unittest main program"""
import sys
import argparse
import os
from . import loader, runner
from .signals import installHandler
__unittest = True
MAIN_EXAMPLES = """\
Examples:
%(prog)s test_module - run tests from test_module
%(prog)s module.TestClass - run tests from module.TestClass
... | gpl-2.0 |
farodin91/servo | components/script/dom/bindings/codegen/parser/tests/test_replaceable.py | 138 | 1833 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def should_throw(parser, harness, message, code):
parser = parser.reset();
threw = False
try:
parser... | mpl-2.0 |
noroot/zulip | api/integrations/codebase/zulip_codebase_config.py | 124 | 2537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, 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 limitation the rights
#... | apache-2.0 |
evfredericksen/pynacea | pynhost/pynhost/platforms/winconstants.py | 1 | 3710 | import ctypes as ct
class POINT(ct.Structure):
_fields_ = [("x", ct.c_ulong), ("y", ct.c_ulong)]
PUL = ct.POINTER(ct.c_ulong)
GMEM_DDESHARE = 0x2000
class KEYBOARD_INPUT(ct.Structure):
_fields_ = [("wVk", ct.c_ushort),
("wScan", ct.c_ushort),
("dwFlags", ct.c_ulong),
... | mit |
navycrow/Sick-Beard | lib/hachoir_parser/game/blp.py | 90 | 11108 | """
Blizzard BLP Image File Parser
Author: Robert Xiao
Creation date: July 10 2007
- BLP1 File Format
http://magos.thejefffiles.com/War3ModelEditor/MagosBlpFormat.txt
- BLP2 File Format (Wikipedia)
http://en.wikipedia.org/wiki/.BLP
- S3TC (DXT1, 3, 5) Formats
http://en.wikipedia.org/wiki/S3_Texture_Compression
... | gpl-3.0 |
zhoulingjun/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
vityurkiv/Ox | python/MooseDocs/database/items.py | 2 | 3034 | """
The following objects are designed to work with the Database class,
see Database.py for usage.
"""
import os
import re
import subprocess
import MooseDocs
from markdown.util import etree
import logging
log = logging.getLogger(__name__)
class DatabaseItem(object):
"""
Base class for database items.
Args:
... | lgpl-2.1 |
mihailignatenko/erp | openerp/addons/base/tests/test_ir_sequence.py | 39 | 9375 | # -*- coding: utf-8 -*-
# Run with one of these commands:
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy nosetests tests/test_ir_se... | agpl-3.0 |
PatrickOReilly/scikit-learn | examples/linear_model/plot_ridge_path.py | 55 | 2138 | """
===========================================================
Plot Ridge coefficients as a function of the regularization
===========================================================
Shows the effect of collinearity in the coefficients of an estimator.
.. currentmodule:: sklearn.linear_model
:class:`Ridge` Regressi... | bsd-3-clause |
gorjuce/odoo | addons/website_sale_options/models/sale_order.py | 237 | 2831 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.tools.translate import _
class sale_order_line(osv.Model):
_inherit = "sale.order.line"
_columns = {
'linked_line_id': fields.many2one('sale.order.line', 'Linked Order Line', domain="[('orde... | agpl-3.0 |
chrissimpkins/hsh | setup.py | 1 | 2256 | import os
import re
from setuptools import setup, find_packages
def docs_read(fname):
return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read()
def version_read():
settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', 'hsh', 'settings.py')).read()
major_regex = """major_ve... | mit |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/db/backends/postgresql/introspection.py | 51 | 10204 | from __future__ import unicode_literals
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
class DatabaseIntr... | bsd-3-clause |
yyoshinori/CastlePortal | public/assets/adminlte/bower_components/jvectormap/converter/converter.py | 129 | 10451 | #
# jVectorMap version 2.0.4
#
# Copyright 2011-2013, Kirill Lebedev
#
import sys
import shapely.geometry
import shapely.wkb
import shapely.affinity
from osgeo import ogr
from osgeo import osr
import json
import codecs
import copy
class Map:
def __init__(self, name, language):
self.paths = {}
self.name = na... | mit |
winndows/cinder | cinder/openstack/common/scheduler/filters/json_filter.py | 22 | 4914 | # Copyright (c) 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
cneill/barbican | barbican/queue/keystone_listener.py | 2 | 6732 | # Copyright (c) 2014 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
emergebtc/muddery | evennia/evennia/players/players.py | 1 | 26439 | """
Typeclass for Player objects
Note that this object is primarily intended to
store OOC information, not game info! This
object represents the actual user (not their
character) and has NO actual precence in the
game world (this is handled by the associated
character object, so you should customize that
instead for m... | bsd-3-clause |
bhamza/ntu-dsi-dcn | src/core/bindings/modulegen_customizations.py | 19 | 20774 | import re
import os
import sys
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.typehandlers import ctypepars... | gpl-2.0 |
sqlfocus/linux | tools/perf/python/twatch.py | 625 | 2726 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
inares/edx-platform | openedx/core/djangoapps/user_api/preferences/api.py | 48 | 17601 | """
API for managing user preferences.
"""
import logging
import analytics
from eventtracking import tracker
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError
from django.utils.translation import ugettext as _
from django.utils.translation impor... | agpl-3.0 |
franchenstein/master_project | main.py | 1 | 18773 | #!/usr/bin
import probabilisticgraph as pg
import graphgenerator as gg
import dmarkov as dm
import sequenceanalyzer as sa
import yaml
import matplotlib.pyplot as plt
import synchwordfinder as swf
def main(config_file, fsw=False, terminate=False, dmark=False, generate=False, gen_seq=False, an_seq=False, plot=False,
... | mit |
zaxliu/deepnap | experiments/kdd-exps/experiment_message_2016-6-11_BUF2_G5_FR100_legacy.py | 1 | 4371 | # System built-in modules
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('... | bsd-3-clause |
jemsbhai/otp | lib/asn1/test/asn1_SUITE_data/SwCDR.py | 97 | 5470 | SwCDR DEFINITIONS
IMPLICIT TAGS ::=
BEGIN
EXPORTS
SwCDR;
SwCDR ::= CHOICE
{
origSvcCallRecord [0] OrigSvcCallRecord,
termSvcCallRecord [1] TermSvcCallRecord
}
--OrigSvcCallRecord ::= SET
OrigSvcCallRecord ::= SEQUENCE
{
callCorrelationId [0] INTEGER ,
chargingIndicator [1] ChargingIndicator,
... | apache-2.0 |
xiejianying/pjsip_trunk | pjsip-apps/src/pygui/call.py | 26 | 3368 | # $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
#
# 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) ... | gpl-2.0 |
huntxu/fuel-web | nailgun/nailgun/test/unit/test_db_migrations.py | 4 | 1070 | # Copyright 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 ... | apache-2.0 |
JRock007/boxxy | dist/Boxxy.app/Contents/Resources/lib/python2.7/numpy/lib/stride_tricks.py | 35 | 4228 | """
Utilities that manipulate strides to achieve desirable effects.
An explanation of strides can be found in the "ndarray.rst" file in the
NumPy reference guide.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
__all__ = ['broadcast_arrays']
class DummyArray(object):
"""... | mit |
DirtyUnicorns/android_external_chromium_org | tools/telemetry/telemetry/core/possible_browser.py | 25 | 2112 | # Copyright 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.
class PossibleBrowser(object):
"""A browser that can be controlled.
Call Create() to launch the browser and begin manipulating it..
"""
def __ini... | bsd-3-clause |
aospx-kitkat/platform_external_chromium_org | chrome/test/pyautolib/bookmark_model.py | 80 | 3206 | # Copyright (c) 2011 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.
"""BookmarkModel: python representation of the bookmark model.
Obtain one of these from PyUITestSuite::GetBookmarkModel() call.
"""
import os
import si... | bsd-3-clause |
haoyangw/android_kernel_xiaomi_dior-1 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
icebreaker/dotfiles | gnome/gnome2/gedit/plugins.symlink/snapopen/__init__.py | 1 | 10248 | # VERSION 1.1.5
# Updated by Alexandre da Silva for GMate Project (http://blog.siverti.com.br/gmate)
import gedit, gtk, gtk.glade
import gconf
import gnomevfs
import pygtk
pygtk.require('2.0')
import os, os.path, gobject
# set this to true for gedit versions before 2.16
pre216_version = False
max_result = 50
ui_str... | mit |
keerts/home-assistant | homeassistant/components/switch/dlink.py | 11 | 4665 | """
Support for D-link W215 smart switch.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.dlink/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const impo... | apache-2.0 |
jbowes/yselect | test/mainmenutests.py | 1 | 2556 | # yselect - An RPM/Yum package handling frontend.
# Copyright (C) 2006 James Bowes <jbowes@redhat.com>
# Copyright (C) 2006 Devan Goodwin <dg@fnordia.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | gpl-2.0 |
bealdav/OCB | addons/account/__openerp__.py | 41 | 7694 | # -*- 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 |
dllsf/odootest | openerp/addons/test_new_api/tests/test_new_fields.py | 51 | 15560 | #
# test cases for new-style fields
#
from datetime import date, datetime
from collections import defaultdict
from openerp.tests import common
from openerp.exceptions import except_orm
class TestNewFields(common.TransactionCase):
def test_00_basics(self):
""" test accessing new fields """
# find... | agpl-3.0 |
alajara/servo | components/script/dom/bindings/codegen/parser/tests/test_implements.py | 264 | 5961 | # Import the WebIDL module, so we can do isinstance checks and whatnot
import WebIDL
def WebIDLTest(parser, harness):
# Basic functionality
threw = False
try:
parser.parse("""
A implements B;
interface B {
attribute long x;
};
interface ... | mpl-2.0 |
QinerTech/QinerApps | openerp/addons/decimal_precision/decimal_precision.py | 47 | 2671 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import openerp
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.osv import orm, fields
from openerp.modules.registry import RegistryManager
class decimal_precision(orm.Model):
_name = 'decim... | gpl-3.0 |
psztorc/Truthcoin | lib-other/pylib/consensus/custommath.py | 2 | 4765 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Supporting math for the consensus mechanism.
"""
from __future__ import division
from numpy import *
from numpy.linalg import *
def WeightedMedian(data, weights):
"""Calculate a weighted median.
Args:
data (list or numpy.array): data
weights (list... | mit |
felipenaselva/repo.felipe | plugin.video.uwc/tubepornclassic.py | 1 | 3359 | '''
Ultimate Whitecream
Copyright (C) 2015 mortael
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | gpl-2.0 |
ebsaral/django-rest-framework | rest_framework/permissions.py | 71 | 6444 | """
Provides a set of pluggable permission policies.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework.compat import get_model_name
SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')
class BasePermission(object):
"""
A base class from which all permission classes should... | bsd-2-clause |
jcoady9/beets | test/testall.py | 1 | 1320 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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... | mit |
kkdd/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_with.py | 53 | 23715 | #!/usr/bin/env python
"""Unit tests for the with statement specified in PEP 343."""
__author__ = "Mike Bland"
__email__ = "mbland at acm dot org"
import sys
import unittest
from collections import deque
from contextlib import GeneratorContextManager, contextmanager
from test.test_support import run_unittest
class... | apache-2.0 |
BaconPancakes/valor | lib/youtube_dl/extractor/mitele.py | 9 | 8002 | # coding: utf-8
from __future__ import unicode_literals
import uuid
from .common import InfoExtractor
from .ooyala import OoyalaIE
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
int_or_none,
extract_attributes,
determine_ext,
smug... | gpl-3.0 |
LaboratoireMecaniqueLille/Ximea | old/ximea_display_REC.py | 1 | 8856 | import numpy as np
import cv2
import time
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import rcParams
import SimpleITK as sitk
from multiprocessing import Process, Pipe, Value
from matplotlib.widgets import Slider, Button
rcParams['font.family'] = 'serif'
#ps aux | grep pyth... | gpl-2.0 |
jeasoft/odoo | addons/purchase_requisition/__openerp__.py | 260 | 2424 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
chenc10/Spark-PAF | dist/ec2/lib/boto-2.34.0/boto/vpc/networkacl.py | 151 | 4976 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.