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 |
|---|---|---|---|---|---|
peterm-itr/edx-platform | common/djangoapps/terrain/stubs/lti.py | 13 | 12432 | """
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
import re
from oauthlib.oauth... | agpl-3.0 |
mitya57/django | django/contrib/admin/helpers.py | 17 | 14265 | import json
from django import forms
from django.conf import settings
from django.contrib.admin.utils import (
display_for_field, flatten_fieldsets, help_text_for_field, label_for_field,
lookup_field,
)
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields.related import ManyToMany... | bsd-3-clause |
bdfoster/blumate | tests/components/notify/test_demo.py | 1 | 1653 | """The tests for the notify demo platform."""
import unittest
import blumate.components.notify as notify
from blumate.components.notify import demo
from tests.common import get_test_home_assistant
class TestNotifyDemo(unittest.TestCase):
"""Test the demo notify."""
def setUp(self): # pylint: disable=inval... | mit |
elijah513/ice | scripts/IceGridAdmin.py | 3 | 11771 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
plotly/python-api | packages/python/plotly/plotly/validators/layout/template/data/__init__.py | 1 | 4498 | import sys
if sys.version_info < (3, 7):
from ._waterfall import WaterfallValidator
from ._volume import VolumeValidator
from ._violin import ViolinValidator
from ._treemap import TreemapValidator
from ._table import TableValidator
from ._surface import SurfaceValidator
from ._sunburst impo... | mit |
amki/pingcat | database.py | 1 | 1090 | __author__ = 'bawki'
import sqlite3
class CatDb():
def __init__(self):
self.db = None
self.c = None
def connect(self):
self.db = sqlite3.connect('pingcat.db')
self.c = self.db.cursor()
'''
def createTables(self):
configured = False
self.c.execute("""SELEC... | agpl-3.0 |
k0ste/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/vyos.py | 47 | 4523 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/twisted/twisted/pair/test/test_ethernet.py | 35 | 6684 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
from twisted.trial import unittest
from twisted.internet import protocol, reactor, error
from twisted.python import failure, components
from twisted.pair import ethernet, raw
from zope.interface import implements
class MyProtocol:
implemen... | agpl-3.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_gdb.py | 8 | 36777 | # Verify that gdb can pretty-print the various PyObject* types
#
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
import os
import re
import pprint
import subprocess
import sys
import sysconfig
import unittest
import locale
# Is this Python configured to support... | gpl-2.0 |
Bitergia/allura | ForgeTracker/forgetracker/tests/unit/test_root_controller.py | 3 | 3065 | from mock import Mock, patch
from ming.orm.ormsession import session
from allura.lib import helpers as h
from allura.model import User
from pylons import c
from forgetracker.tests.unit import TrackerTestWithModel
from forgetracker.model import Ticket, Globals
from forgetracker import tracker_main
class WithUserAndBu... | apache-2.0 |
op3/hdtv | hdtv/plugins/config.py | 1 | 3366 | # -*- coding: utf-8 -*-
# HDTV - A ROOT-based spectrum analysis software
# Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS)
#
# This file is part of HDTV.
#
# HDTV is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# ... | gpl-2.0 |
tardieu/swift | utils/swift_build_support/tests/products/test_ninja.py | 37 | 3759 | # tests/products/test_ninja.py ----------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
bendmorris/retriever | setup.py | 1 | 3832 | """Use the following command to install retriever: python setup.py install"""
from setuptools import setup
import platform
import sys
import warnings
p = platform.platform().lower()
extra_includes = []
if "darwin" in p:
try: import py2app
except ImportError: pass
extra_includes = []
elif "win" in p:
t... | mit |
SuderPawel/api-python-library | src/api_python_library/tools/config.py | 5 | 1040 | import ConfigParser
import sys
__author__ = 'paoolo'
class Config(object):
def __init__(self, *args):
self.__config = ConfigParser.ConfigParser()
self.add_config_ini(*args)
def __getattr__(self, name):
# noinspection PyBroadException
try:
return self.__config.get(... | mit |
EttusResearch/gnuradio | gr-digital/python/digital/modulation_utils.py | 59 | 3782 | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#... | gpl-3.0 |
402231466/40223146 | static/Brython3.1.0-20150301-090019/Lib/xml/etree/ElementTree.py | 730 | 61800 | #
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... | gpl-3.0 |
kenkov/kovot | kovot/stream/mastodon.py | 1 | 5191 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from html.parser import HTMLParser
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from collections import OrderedDict
from queue import Queue
from kovot import Message, Response, Speaker
from logging import Logger
from ty... | mit |
alangwansui/mtl_ordercenter | openerp/addons/project/report/__init__.py | 444 | 1069 | # -*- 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 |
fkazimierczak/flask | examples/flaskr/test_flaskr.py | 157 | 2059 | # -*- coding: utf-8 -*-
"""
Flaskr Tests
~~~~~~~~~~~~
Tests the Flaskr application.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import flaskr
import tempfile
@pytest.fixture
def client(request):
db_fd, flaskr.app.config['... | bsd-3-clause |
binhqnguyen/lena | src/dsr/bindings/modulegen__gcc_LP64.py | 10 | 851128 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
Pardus-Linux/buildfarm | buildfarm/cli.py | 2 | 7177 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2011 TUBITAK/UEKAE
#
# 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.
#
# ... | gpl-2.0 |
netzimme/mbed-os | tools/test/examples/examples_lib.py | 15 | 15213 | """ Import and bulid a bunch of example programs
This library includes functions that are shared between the examples.py and
the update.py modules.
"""
import os
from os.path import dirname, abspath, basename
import os.path
import sys
import subprocess
from shutil import rmtree
from sets import Set
ROO... | apache-2.0 |
nithinmurali/robocomp | tools/robocompdsl/parseCDSL.py | 2 | 9452 | #!/usr/bin/env python
from pyparsing import Word, alphas, alphanums, nums, OneOrMore, CharsNotIn, Literal, Combine
from pyparsing import cppStyleComment, Optional, Suppress, ZeroOrMore, Group, StringEnd, srange
from pyparsing import nestedExpr, CaselessLiteral
import sys, traceback, os
debug = False
#debug = True
f... | gpl-3.0 |
sYnfo/samba-1 | python/samba/tests/dcerpc/misc.py | 44 | 1982 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# 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) a... | gpl-3.0 |
alexryndin/ambari | ambari-server/src/main/resources/stacks/ADH/1.5/services/HIVE/package/alerts/alert_hive_metastore.py | 3 | 9232 | #!/usr/bin/env python
"""
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")... | apache-2.0 |
janusnic/youtube-dl-GUI | youtube_dl/extractor/spankwire.py | 31 | 4129 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
str_to_int,
unified_strdate,
)
from ..aes import aes_decrypt_text
class SpankwireIE(InfoExt... | mit |
mikesun/xen-cow-checkpointing | tools/python/xen/util/xpopen.py | 9 | 6760 | #
# Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved
#
# PSF LICENSE AGREEMENT FOR PYTHON 2.3
# ------------------------------------
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF"), and the Individual or Organization ("Licensee") accessing and
# oth... | gpl-2.0 |
simonbates/bitstructures | substructure/models.py | 1 | 2253 | from django.db import models
class Entry(models.Model):
"""
>>> from datetime import datetime
>>> test1 = Entry()
>>> test1.id = 1
>>> test1.slug = 'testentry1'
>>> test1.is_published()
False
>>> test1.is_draft()
True
>>> test1.get_absolute_url()
'/drafts/testentry1'
>>>... | mit |
janocat/odoo | addons/portal_project_issue/tests/test_access_rights.py | 338 | 10547 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
Seitanas/kvm-vdi | guest_agent/ovirt-guest-agent/LockActiveSession.py | 1 | 4728 | #!/usr/bin/python
#
# 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
# di... | mit |
thesamet/gerrit | contrib/check-valid-commit.py | 21 | 2925 | #!/usr/bin/env python
from __future__ import print_function
import subprocess
import getopt
import sys
SSH_USER = 'bot'
SSH_HOST = 'localhost'
SSH_PORT = 29418
SSH_COMMAND = 'ssh %s@%s -p %d gerrit approve ' % (SSH_USER, SSH_HOST, SSH_PORT)
FAILURE_SCORE = '--code-review=-2'
FAILURE_MESSAGE = 'This commit message d... | apache-2.0 |
garbled1/ansible | lib/ansible/modules/system/authorized_key.py | 26 | 22062 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Brad Olson <brado@movedbylight.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
apache/allura | Allura/allura/tasks/index_tasks.py | 2 | 5711 | # 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 (t... | apache-2.0 |
Abi1ity/uniclust2.0 | SQLAlchemy-0.9.9/test/orm/inheritance/_poly_fixtures.py | 25 | 11682 | from sqlalchemy import Integer, String, ForeignKey, func, desc, and_, or_
from sqlalchemy.orm import interfaces, relationship, mapper, \
clear_mappers, create_session, joinedload, joinedload_all, \
subqueryload, subqueryload_all, polymorphic_union, aliased,\
class_mapper
from sqlalchemy import exc as sa_exc... | bsd-3-clause |
atheed/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/echo_wsh.py | 494 | 2197 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
qedi-r/home-assistant | setup.py | 2 | 2275 | #!/usr/bin/env python3
"""Home Assistant setup script."""
from datetime import datetime as dt
from setuptools import setup, find_packages
import homeassistant.const as hass_const
PROJECT_NAME = "Home Assistant"
PROJECT_PACKAGE_NAME = "homeassistant"
PROJECT_LICENSE = "Apache License 2.0"
PROJECT_AUTHOR = "The Home As... | apache-2.0 |
Yemsheng/collect-exceptions | collect_exceptions/contrib/django/models.py | 1 | 3768 | import sys
import logging
log = logging.getLogger('django')
import traceback
from django.conf import settings as django_settings
def default_exception_collector(exception_str):
log.error(exception_str)
def my_exception_handler(request, **kwargs):
try:
log.debug(dir(request))
request_info = ... | bsd-3-clause |
OSSESAC/odoopubarquiluz | addons/account/wizard/account_report_common_partner.py | 56 | 2031 | # -*- 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 |
GoogleCloudPlatform/gsutil | gslib/addlhelp/wildcards.py | 1 | 9242 | # -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
djo938/supershell | pyshell/arg/test/decorator_test.py | 3 | 5387 | #!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jonathan Delvaux <pyshell@djoproject.net>
# 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... | gpl-3.0 |
arista-eosplus/ansible | lib/ansible/plugins/shell/sh.py | 69 | 4222 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
dfeyer/TranslationTypo3Org | local_apps/pootle_misc/templatetags/baseurl.py | 6 | 1046 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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... | gpl-2.0 |
hanzorama/magenta | magenta/common/testing_lib.py | 3 | 2751 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
sushantgoel/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/jinja2/testsuite/api.py | 402 | 10381 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
import os
import tempfile
import shutil
from jinja2.testsuite import JinjaTestCase... | apache-2.0 |
unreal666/youtube-dl | youtube_dl/extractor/rockstargames.py | 64 | 2248 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class RockstarGamesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rockstargames\.com/videos(?:/video/|#?/?\?.*\bvideo=)(?P<id>\d+)'
_TESTS = [{
'... | unlicense |
payeldillip/django | tests/gis_tests/test_geoip.py | 75 | 6731 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import socket
import unittest
import warnings
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geoip import HAS_GEOIP
from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry
from django.test import ign... | bsd-3-clause |
southerncross/tianchi-monster | AliTianChi-master/preprocess/split_by_date.py | 1 | 1384 | #-*-coding:utf-8-*-
"""
将tianchi_mobile_recommend_train_user.csv按照日期分割为31份**.csv文件,放在'/data/date/'目录下。
生成的**.csv文件内容格式如下:
user_id, item_id, behavior_type,user_geohash,item_category, hour
99512554,37320317, 3, 94gn6nd, 9232, 20
"""
import csv
import os
#记录已存在的date.csv
date_dictionary =... | mit |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/locale.py | 48 | 82594 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for pass... | apache-2.0 |
biokit/biokit | biokit/sequence/seq.py | 1 | 6546 | import string
import collections
import pylab
__all__ = ['Sequence']
class Sequence(object):
"""Common data structure to all sequences (e.g., :meth:`~biokit.sequence.dna.DNA`)
A sequence is a string contained in the :attr:`_data`. If you manipulate this
attribute, you should also changed the :attr:`_N`... | bsd-2-clause |
mytest-e2/ritest-e2 | lib/python/Tools/Notifications.py | 66 | 1963 | notifications = [ ]
notificationAdded = [ ]
# notifications which are currently on screen (and might be closed by similiar notifications)
current_notifications = [ ]
def __AddNotification(fnc, screen, id, *args, **kwargs):
if ".MessageBox'>" in `screen`:
kwargs["simple"] = True
notifications.append((fnc, screen,... | gpl-2.0 |
lauri-codes/GameShop | gameshop/game/facebook.py | 1 | 21613 | #!/usr/bin/env python
#
# Copyright 2010 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... | gpl-2.0 |
hasanferit/trumpcrawler | crawlenv/lib/python3.5/site-packages/pip/compat/__init__.py | 342 | 4672 | """Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import os
import sys
from pip._vendor.six import text_type
try:
from logging.config import dictConfig as logging_dictConfig
except ImportError:
from pip.compat.dictconfig import ... | mit |
google/ml_collections | ml_collections/config_flags/tests/mini_config.py | 1 | 1067 | # Copyright 2021 The ML Collections Authors.
#
# 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... | apache-2.0 |
GenericStudent/home-assistant | homeassistant/components/w800rf32/binary_sensor.py | 21 | 4040 | """Support for w800rf32 binary sensors."""
import logging
import W800rf32 as w800
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_DEVICES, CONF_NAME
from home... | apache-2.0 |
cytec/Sick-Beard | lib/sqlalchemy/dialects/mysql/base.py | 12 | 98649 | # mysql/base.py
# Copyright (C) 2005-2012 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
"""Support for the MySQL database.
Supported Versions and Features
--------------------... | gpl-3.0 |
edx-solutions/edx-platform | openedx/core/djangoapps/cors_csrf/migrations/0001_initial.py | 5 | 1205 | # -*- coding: utf-8 -*-
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(... | agpl-3.0 |
ukanga/SickRage | sickbeard/providers/hounddawgs.py | 3 | 7574 | # coding=utf-8
# Author: Idan Gutman
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
gautam1858/tensorflow | tensorflow/python/ops/init_ops_test.py | 4 | 7576 | # 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 |
thebritican/anovelmous | migrations/versions/273db4d82b38_.py | 1 | 5040 | """empty message
Revision ID: 273db4d82b38
Revises: 1d239589c41f
Create Date: 2015-01-11 22:58:54.093128
"""
# revision identifiers, used by Alembic.
revision = '273db4d82b38'
down_revision = '1d239589c41f'
from alembic import op
import sqlalchemy as sa
from sqlalchemy_utils import ArrowType
def upgrade():
##... | mit |
bigswitch/nova | nova/tests/functional/api_sample_tests/test_consoles.py | 14 | 2211 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
rohit21122012/DCASE2013 | runs/2016/dnn2016med_traps/traps16/task1_scene_classification.py | 40 | 38423 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# DCASE 2016::Acoustic Scene Classification / Baseline System
import argparse
import textwrap
import timeit
import skflow
from sklearn import mixture
from sklearn import preprocessing as pp
from sklearn.externals import joblib
from sklearn.metrics import confusion_matri... | mit |
matthieudumont/dipy | scratch/very_scratch/eddy_currents.py | 22 | 1282 | import numpy as np
import dipy as dp
import nibabel as ni
dname = '/home/eg01/Data_Backup/Data/Eleftherios/CBU090133_METHODS/20090227_145404/Series_003_CBU_DTI_64D_iso_1000'
#dname = '/home/eg01/Data_Backup/Data/Frank_Eleftherios/frank/20100511_m030y_cbu100624/08_ep2d_advdiff_101dir_DSI'
data,affine,bvals,gradients... | bsd-3-clause |
ddrmanxbxfr/servo | tests/wpt/css-tests/tools/html5lib/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | mpl-2.0 |
lihui7115/ChromiumGStreamerBackend | chrome/common/extensions/docs/server2/github_file_system_test.py | 97 | 1617 | #!/usr/bin/env python
# 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.
import json
import os
import sys
import unittest
from appengine_wrappers import files
from fake_fetchers import ConfigureFakeFetch... | bsd-3-clause |
Edraak/edx-platform | lms/djangoapps/ccx/tests/test_utils.py | 27 | 1683 | """
test utils
"""
from nose.plugins.attrib import attr
from lms.djangoapps.ccx.tests.factories import CcxFactory
from student.roles import CourseCcxCoachRole
from student.tests.factories import (
AdminFactory,
)
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase,
TEST_DATA_SPLIT_MODU... | agpl-3.0 |
nprapps/graeae | render_utils.py | 1 | 6337 | #!/usr/bin/env python
import codecs
from datetime import datetime
import json
import time
import urllib
import subprocess
from decimal import Decimal
from flask import Markup, g, render_template, request
from slimit import minify
from smartypants import smartypants
import app_config
import copytext
class BetterJSON... | mit |
arnaudsj/titanium_mobile | support/android/compiler.py | 1 | 9347 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
#
# Resource to Android Page Compiler
# Handles JS, CSS and HTML files only
#
import os, sys, re, shutil, tempfile, run, codecs, traceback, types
import jspacker, simplejson
from xml.sax.saxutils import escape
from sgmllib import SGMLParser
... | apache-2.0 |
glyph/imaginary | imaginary/test/test_text.py | 1 | 17044 | import pprint, string
from twisted.trial import unittest
from twisted.conch.insults import insults, helper
from imaginary.wiring import textserver, terminalui
from imaginary import text as T
from imaginary import unc
from imaginary import __version__ as imaginaryVersion
def F(*a, **kw):
if "currentAttrs" not in ... | mit |
jesiv/soTp1 | tp1/simusched/graph_cores.py | 3 | 5891 | #!/usr/bin/env python
# coding: utf-8
import sys, os
import matplotlib
matplotlib.use('Agg')
from pylab import *
from matplotlib.transforms import TransformedBbox
class EventFactory(object):
#CPU time pid cpu (si pid == -1 -> idle)
cpu_event= lambda x: Event(x[0],EventFactory.Events.keys().index(x[0]),int(x[1... | mit |
ar7z1/ansible | lib/ansible/modules/storage/netapp/na_ontap_net_ifgrp.py | 9 | 11332 | #!/usr/bin/python
# (c) 2018, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
trabacus-softapps/openerp-8.0-cc | openerp/addons/website_blog/controllers/main.py | 3 | 11636 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
tcpcloud/contrail-controller | src/config/utils/create_floating_pool.py | 5 | 4482 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import argparse
import ConfigParser
import json
import copy
from netaddr import IPNetwork
from vnc_api.vnc_api import *
def get_ip(ip_w_pfx):
return str(IPNetwork(ip_w_pfx).ip)
# end get_ip
class VncProvisioner(object):
... | apache-2.0 |
tntnatbry/tensorflow | tensorflow/contrib/graph_editor/util.py | 16 | 16834 | # 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 |
Jorge-Rodriguez/ansible | test/units/mock/yaml_helper.py | 209 | 5267 | import io
import yaml
from ansible.module_utils.six import PY3
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
class YamlTestUtils(object):
"""Mixin class to combine with a unittest.TestCase subclass."""
def _loader(self, stream):
"""Vault r... | gpl-3.0 |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_netrc.py | 99 | 1116 |
import netrc, os, unittest, sys
from test import test_support
TEST_NETRC = """
machine foo login log1 password pass1 account acct1
macdef macro1
line1
line2
macdef macro2
line3
line4
default login log2 password pass2
"""
temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase):
def setUp ... | gpl-2.0 |
ai-ku/langvis | dependencies/jython-2.1/Lib/test/test_jbasic.py | 2 | 3030 | from test_support import *
print_test('Basic Java Integration (test_jbasic.py)', 1)
print_test('type conversions', 2)
print_test('numbers', 3)
from java.lang.Math import abs
assert abs(-2.) == 2., 'Python float to Java double'
assert abs(-2) == 2l, 'Python int to Java long'
assert abs(-2l) == 2l, 'Python long to Jav... | mit |
zhanghenry/stocks | django/conf/locale/zh_CN/formats.py | 634 | 1810 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... | bsd-3-clause |
reyoung/Paddle | python/paddle/trainer_config_helpers/layer_math.py | 8 | 4029 | # Copyright (c) 2016 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 applic... | apache-2.0 |
cainmatt/django | django/test/html.py | 220 | 7928 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html_parser import HTMLParseError, HTMLParser
WHITESPACE = re.compile('\s+')
def normalize_whitespace(str... | bsd-3-clause |
ImmobilienScout24/moto | moto/rds2/responses.py | 10 | 19789 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.models import ec2_backends
from .models import rds2_backends
import json
import re
class RDS2Response(BaseResponse):
@property
def backend(self):
return rds2_backends[self.region]
def _get_db_kwar... | apache-2.0 |
52ai/django-ccsds | django/utils/regex_helper.py | 97 | 12721 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | bsd-3-clause |
liangmingjie/react-native | JSCLegacyProfiler/trace_data.py | 375 | 8013 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import unittest
"""
# _-----=> irqs-off
# / _----=> need-resched
# | / _---... | bsd-3-clause |
PriceChild/ansible | lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py | 6 | 9026 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
shinglyu/moztrap | tests/model/environments/api/test_category_resource.py | 3 | 2140 | """
Tests for EnvironmentResource api.
"""
from tests.case.api.crud import ApiCrudCases
class CategoryResourceTest(ApiCrudCases):
@property
def factory(self):
"""The model factory for this object."""
return self.F.CategoryFactory()
@property
def resource_name(self):
"""Th... | bsd-2-clause |
felipenaselva/felipe.repository | script.module.universalscrapers/lib/universalscrapers/modules/js2py/legecy_translators/objects.py | 11 | 11176 | """ This module removes all objects/arrays from JS source code and replace them with LVALS.
Also it has s function translating removed object/array to python code.
Use this module just after removing constants. Later move on to removing functions"""
OBJECT_LVAL = 'PyJsLvalObject%d_'
ARRAY_LVAL = 'PyJsLvalArray%d_'
fro... | gpl-2.0 |
lixiangning888/whole_project | modules/signatures_merge_tmp/antidbg_windows.py | 3 | 2558 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder)
#
# 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 lat... | lgpl-3.0 |
lowitty/server | libsLinux/twisted/words/test/test_jabbererror.py | 10 | 11430 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.error}.
"""
from twisted.trial import unittest
from twisted.words.protocols.jabber import error
from twisted.words.xish import domish
NS_XML = 'http://www.w3.org/XML/1998/namespace'
NS_STREAMS = 'h... | mit |
benjamindeleener/odoo | openerp/report/render/rml2pdf/customfonts.py | 49 | 2467 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from reportlab import rl_config
import logging
import glob
import os
# .apidoc title: TTF Font Table
"""This module allows the mapping of some system-available TTF fonts to
the reportlab engine.
This file could be cus... | gpl-3.0 |
tjctw/PythonNote | thinkstat/thinkstats_test.py | 2 | 1875 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import unittest
import random
import thinkstats
class Test(unittest.TestCase):
def testMean(self):
t = [1... | cc0-1.0 |
deerwalk/voltdb | third_party/cpp/googletest/googletest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | agpl-3.0 |
aman-iitj/scipy | scipy/spatial/tests/test_kdtree.py | 15 | 24484 | # Copyright Anne M. Archibald 2008
# Released under the scipy license
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_, run_module_suite)
import numpy as np
from scipy.spatial impo... | bsd-3-clause |
TheTeaRex/cmpe281_mongoserver | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | gpl-2.0 |
houstar/libnl | python/netlink/route/qdisc/htb.py | 35 | 3608 | #
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""HTB qdisc
"""
from __future__ import absolute_import
from ... import core as netlink
from ... import util as util
from .. import capi as capi
from .. import tc as tc
class HTBQdisc(object):
def __init__(self, qdisc):
self._qdisc = qdisc
@pr... | lgpl-2.1 |
tudorvio/tempest | tempest/services/data_processing/v1_1/data_processing_client.py | 9 | 10364 | # Copyright (c) 2013 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 |
sniperyen/MyDjango | Lib/crispy_forms/templatetags/crispy_forms_field.py | 11 | 5690 | try:
from itertools import izip
except ImportError:
izip = zip
import django
from django import forms
from django import template
from django.template import loader, Context
from django.conf import settings
from crispy_forms.utils import TEMPLATE_PACK, get_template_pack
register = template.Library()
@regis... | apache-2.0 |
gitseagull/pox | pox/log/color.py | 26 | 5403 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | gpl-3.0 |
deluge-clone/deluge | deluge/ui/console/commands/config.py | 6 | 5738 | #
# config.py
#
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either ... | gpl-3.0 |
Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/scripts/freestyle/styles/haloing.py | 7 | 2005 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | gpl-3.0 |
ericshawlinux/bitcoin | test/functional/rpc_blockchain.py | 5 | 12641 | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPCs related to blockchainstate.
Test the following RPCs:
- getblockchaininfo
- gettxouts... | mit |
sachinkum/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/utils/inspect.py | 323 | 4195 | from __future__ import absolute_import
import inspect
from django.utils import six
def getargspec(func):
if six.PY2:
return inspect.getargspec(func)
sig = inspect.signature(func)
args = [
p.name for p in sig.parameters.values()
if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.