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 |
|---|---|---|---|---|---|
yeasy/hyperledger-py | hyperledger/api/transaction.py | 2 | 1751 | # 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
# dist... | apache-2.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/IPython/core/display.py | 7 | 26478 | # -*- coding: utf-8 -*-
"""Top-level display functions for displaying object in different formats.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. ... | gpl-3.0 |
tobilg/dcos-commons | tools/github_update.py | 2 | 8749 | #!/usr/bin/python
# Env Vars
# GITHUB_TOKEN: github auth token
# GIT_COMMIT | ghprbActualCommit | sha1 (optional)
# GITHUB_DISABLE (optional): if non-empty, this script performs no action
# GITHUB_REPOSITORY_ROOT (optional): directory in which to look for .git (unused if GIT_COMMIT is set)
# GITHUB_REPO_PATH... | apache-2.0 |
arvinsingla/CouchPotatoServer | libs/guessit/matcher.py | 94 | 7768 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
minhphung171093/OpenERP_V7 | openerp/tools/misc.py | 3 | 38733 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
CopeX/odoo | openerp/addons/test_workflow/tests/test_workflow.py | 392 | 6232 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.tests import common
class test_workflows(common.TransactionCase):
def check_activities(self, model_name, i, names):
""" Check that the record i has workitems in the given activity names.
"""
instance = se... | agpl-3.0 |
junmin-zhu/chromium-rivertrail | third_party/tlslite/tlslite/utils/dateFuncs.py | 407 | 2181 |
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(":")
second = second[:2]
year, month, day = int(year), int(month), int(day)
hour, minute, secon... | bsd-3-clause |
ychen820/microblog | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/cloudsearch2/test_exceptions.py | 4 | 1399 | import mock
from boto.compat import json
from tests.unit import unittest
from .test_search import HOSTNAME, CloudSearchSearchBaseTest
from boto.cloudsearch2.search import SearchConnection, SearchServiceException
def fake_loads_value_error(content, *args, **kwargs):
"""Callable to generate a fake ValueError"""
... | bsd-3-clause |
yfried/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_image_facts.py | 35 | 4218 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | gpl-3.0 |
itsjeyd/edx-platform | lms/djangoapps/courseware/features/problems_setup.py | 12 | 17529 | # pylint: disable=missing-docstring
# EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING:
# -Section in Dictionary containing:
# -factory
# -kwargs
# -(optional metadata)
# -Correct, Incorrect and Unanswered CSS selectors
# -A way to answer the problem correctly and incorrectly
# -A way to check the problem was answer... | agpl-3.0 |
mapr/hue | desktop/core/ext-py/Pygments-1.3.1/setup.py | 42 | 2796 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Hig... | apache-2.0 |
xiandiancloud/edx-platform | lms/djangoapps/courseware/features/common.py | 16 | 7839 | # pylint: disable=C0111
# pylint: disable=W0621
from __future__ import absolute_import
import time
from lettuce import world, step
from lettuce.django import django_url
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from student.models import CourseEnrollment
from xmodule.mo... | agpl-3.0 |
anastue/netforce | netforce_general/netforce_general/models/theme.py | 4 | 4767 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, modify, merge, publ... | mit |
nraynaud/three.js | utils/exporters/blender/addons/io_three/exporter/utilities.py | 225 | 1229 | import uuid
import hashlib
from .. import constants
ROUND = constants.DEFAULT_PRECISION
def bit_mask(flags):
"""Generate a bit mask.
:type flags: dict
:return: int
"""
bit = 0
true = lambda x, y: (x | (1 << y))
false = lambda x, y: (x & (~(1 << y)))
for mask, position in constant... | mit |
mattip/numpy | pavement.py | 8 | 7028 | r"""
This paver file is intended to help with the release process as much as
possible. It relies on virtualenv to generate 'bootstrap' environments as
independent from the user system as possible (e.g. to make sure the sphinx doc
is built against the built numpy, not an installed one).
Building changelog + notes
=====... | bsd-3-clause |
albertomurillo/ansible | test/units/module_utils/xenserver/test_set_vm_power_state.py | 15 | 17604 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from .FakeAnsibleModule import FakeAn... | gpl-3.0 |
ikasumiwt/zulip | zilencer/error_notify.py | 120 | 3370 | from collections import defaultdict
import logging
from django.conf import settings
from django.core.mail import mail_admins
from zerver.lib.actions import internal_send_message
def format_subject(subject):
"""
Escape CR and LF characters.
"""
return subject.replace('\n', '\\n').replace('\r', '\\r')
... | apache-2.0 |
DeepThoughtTeam/tensorflow | tensorflow/python/framework/tensor_shape.py | 1 | 25203 | # Copyright 2015 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 a... | apache-2.0 |
Ant-OS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/tools/build/test/preprocessor.py | 58 | 1070 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the C/C++ preprocessor.
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.... | apache-2.0 |
ioanpocol/superdesk-core | superdesk/factory/sentry.py | 3 | 1067 |
import logging
from raven.contrib.flask import Sentry
from raven.contrib.celery import register_signal, register_logger_signal
SENTRY_DSN = 'SENTRY_DSN'
class SuperdeskSentry():
"""Sentry proxy that will do nothing in case sentry is not configured."""
def __init__(self, app):
if app.config.get(SEN... | agpl-3.0 |
sbbic/core | wizards/com/sun/star/wizards/ui/event/RadioDataAware.py | 13 | 1747 | #
# This file is part of the LibreOffice project.
#
# 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/.
#
# This file incorporates work covered by the following license noti... | gpl-3.0 |
Lektorium-LLC/edx-platform | cms/djangoapps/contentstore/features/course-updates.py | 11 | 2701 | # pylint: disable=missing-docstring
from lettuce import step, world
from nose.tools import assert_in
from cms.djangoapps.contentstore.features.common import get_codemirror_value, type_in_codemirror
@step(u'I go to the course updates page')
def go_to_updates(_step):
menu_css = 'li.nav-course-courseware'
upda... | agpl-3.0 |
ryfeus/lambda-packs | Selenium_PhantomJS/source/concurrent/futures/thread.py | 34 | 4658 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
import atexit
from concurrent.futures import _base
import Queue as queue
import threading
import weakref
import sys
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
# Workers a... | mit |
bryceliu/ansible-modules-core | cloud/openstack/os_security_group_rule.py | 72 | 10710 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
jylaxp/django | tests/auth_tests/test_mixins.py | 274 | 8335 | from django.contrib.auth import models
from django.contrib.auth.mixins import (
LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin,
)
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import Re... | bsd-3-clause |
khazhyk/discord.py | discord/shard.py | 1 | 18068 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
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 u... | mit |
m-labs/linux-milkymist | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
gogoair/lavatory | src/lavatory/commands/stats.py | 1 | 1409 | """Statistics of the repo."""
import logging
import click
from ..utils.get_artifactory_info import get_repos, get_storage
LOG = logging.getLogger(__name__)
@click.command()
@click.pass_context
@click.option(
'--repo',
default=None,
multiple=True,
required=False,
help='Name of specific repositor... | apache-2.0 |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/getpass.py | 233 | 5563 | """Utilities to get a password and/or the current user name.
getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.
GetPassWarning - This UserWarning is issued when getpass() cannot prevent
echoing of the passw... | apache-2.0 |
ehfeng/pipet | tests/test_stripe.py | 2 | 23250 | from inspect import isclass
import json
import logging
import os
import pytest
from urllib.parse import urlparse
from unittest import TestCase
from flask import Flask
import responses
import requests
from pipet import create_app
from pipet.models import db, Organization
from pipet.sources.stripe import StripeAccount
... | mit |
renaelectronics/linuxcnc | src/emc/usr_intf/touchy/listing.py | 35 | 3481 | # Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy 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.
#
# Touchy i... | gpl-2.0 |
Anonymous-X6/django | tests/utils_tests/test_feedgenerator.py | 163 | 4306 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... | bsd-3-clause |
adam111316/SickGear | lib/imdb/utils.py | 14 | 62168 | """
utils module (imdb package).
This module provides basic utilities for the imdb package.
Copyright 2004-2013 Davide Alberani <da@erlug.linux.it>
2009 H. Turgut Uyar <uyar@tekir.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Lic... | gpl-3.0 |
MarnuLombard/namebench | nb_third_party/dns/renderer.py | 248 | 11865 | # Copyright (C) 2001-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 |
quantifiedcode-bot/invenio-utils | invenio_utils/w3c_validator.py | 3 | 7518 | # This file is part of Invenio.
# Copyright (C) 2007, 2008, 2010, 2011, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later v... | gpl-2.0 |
msnorm/forums | dotfiles/.vim/.ycm_extra_conf.py | 2 | 2114 | ##########################################################################
# Simple ycm_extra_conf.py example #
# Copyright (C) <2013> Onur Aslan <onur@onur.im> #
# #
# This file is loade... | mit |
Southpaw-TACTIC/TACTIC | src/context/client/tactic-api-python-4.0.api04/Lib/HTMLParser.py | 4 | 13966 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# a... | epl-1.0 |
yaolinz/rethinkdb | test/rql_test/connections/http_support/werkzeug/testsuite/utils.py | 146 | 11435 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~~~
General utilities.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from datetime import datetime
from functools import part... | agpl-3.0 |
ANR-kamoulox/Telemeta | telemeta/management/commands/telemeta-export-fields.py | 2 | 1633 | from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.utils import translation
from telemeta.models import *
from telemeta.util.unaccen... | agpl-3.0 |
freezmeinster/avagata-site | django/contrib/auth/tests/__init__.py | 231 | 1092 | from django.contrib.auth.tests.auth_backends import (BackendTest,
RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest,
NoBackendsTest, InActiveUserBackendTest, NoInActiveUserBackendTest)
from django.contrib.auth.tests.basic import BasicTestCase
from django.contrib.auth.tests.decorators imp... | bsd-3-clause |
awanke/bokeh | bokeh/charts/builder/tests/test_heatmap_builder.py | 33 | 4145 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
oscarlab/betrfs | ftfs/userspace-testing/default-post.py | 1 | 1387 | #!/usr/bin/python
import subprocess
import sys
import getopt
def usage() :
print "optional args:"
print "\t--test=<name of test>: specify test name"
print "\th, --help: show this dialogue"
if __name__ == "__main__":
test = ""
try :
opts, args = getopt.getopt(sys.argv[1:], "h", ["help", ... | gpl-2.0 |
vasiliykochergin/euca2ools | euca2ools/commands/autoscaling/resumeprocesses.py | 6 | 2010 | # Copyright 2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 t... | bsd-2-clause |
plotly/plotly.py | packages/python/plotly/plotly/graph_objs/sunburst/marker/_colorbar.py | 1 | 73487 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "sunburst.marker"
_path_str = "sunburst.marker.colorbar"
_valid_props = {
"bgcolor"... | mit |
moreati/django-allauth | allauth/socialaccount/providers/dropbox_oauth2/views.py | 66 | 1187 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
import requests
from .provider import DropboxOAuth2Provider
class DropboxOAuth2Adapter(OAut... | mit |
ashcrow/flagon | test/test_backend_db_django.py | 2 | 3643 | # The MIT License (MIT)
#
# Copyright (c) 2014 Steve Milner
#
# 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... | mit |
sambrightman/emacs-for-python | python-libs/rope/refactor/method_object.py | 91 | 3868 | import warnings
from rope.base import pyobjects, exceptions, change, evaluate, codeanalyze
from rope.refactor import sourceutils, occurrences, rename
class MethodObject(object):
def __init__(self, project, resource, offset):
self.pycore = project.pycore
this_pymodule = self.pycore.resource_to_py... | gpl-3.0 |
cikelengfeng/HTTPIDL | Sources/Compiler/SwiftTypeTransfer.py | 1 | 1558 | idl_to_swift_type = {'UINT32': 'UInt32', 'UINT64': 'UInt64', 'INT32': 'Int32', 'INT64': 'Int64', 'BOOL': 'Bool', 'DOUBLE': 'Double', 'STRING': 'String', 'FILE': 'HTTPFile', 'BLOB': 'HTTPData'}
def swift_base_type_name_from_idl_base_type(type_name):
if type_name in idl_to_swift_type:
builtin_type_name = id... | mit |
davenovak/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/message_test.py | 253 | 15707 | #! /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:
#
# ... | gpl-3.0 |
wohnsinn2/Radicale | radicale/storage/filesystem.py | 4 | 4250 | # -*- coding: utf-8 -*-
#
# This file is part of Radicale Server - Calendar Server
# Copyright © 2012-2015 Guillaume Ayoub
#
# This library 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 t... | gpl-3.0 |
huanpc/IoT-1 | gui/controller/.venv/lib/python3.5/site-packages/pip/_vendor/lockfile/__init__.py | 536 | 9371 | # -*- coding: utf-8 -*-
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'some... | mit |
starakaj/wikisonnet | src/precomputer.py | 1 | 4434 | import db.dbconnect as dbconnect
import db.dbreader as dbreader
import wikibard.wikibard as wikibard
import mysql.connector
import argparse
import random
import copy
from multiprocessing import Process
parser = argparse.ArgumentParser(description="Precompute a shitload of wikipoems")
parser.add_argument('dbconfig', ty... | mit |
o5k/openerp-oemedical-v0.1 | openerp/addons/report_webkit/ir_report.py | 49 | 5990 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
spvkgn/youtube-dl | youtube_dl/extractor/normalboots.py | 67 | 2181 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .jwplatform import JWPlatformIE
from ..utils import (
unified_strdate,
)
class NormalbootsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?normalboots\.com/video/(?P<id>[0-9a-z-]*)/?$'
_TEST = {
'u... | unlicense |
fengyuanjs/catawampus | tr/vendor/tornado/demos/blog/blog.py | 8 | 6931 | #!/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 |
valentin-krasontovitsch/ansible | test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py | 51 | 6830 | import pytest
import unittest
import ansible.modules.cloud.amazon.ec2_vpc_nat_gateway as ng
boto3 = pytest.importorskip("boto3")
botocore = pytest.importorskip("botocore")
aws_region = 'us-west-2'
class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_get_nat_gateways(self):
client = bot... | gpl-3.0 |
nkgilley/home-assistant | homeassistant/components/ios/notify.py | 6 | 3314 | """Support for iOS push notifications."""
import logging
import requests
from homeassistant.components import ios
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TARGET,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
BaseNotificationService,
)
import homeassistant.util.dt as dt_ut... | apache-2.0 |
joker946/nova | nova/tests/unit/virt/hyperv/db_fakes.py | 48 | 5464 | # Copyright 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
Scarygami/gae-gcs-push2deploy-secrets | lib/apiclient/http.py | 102 | 52847 | # Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/lexers/hdl.py | 72 | 18250 | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, ... | mit |
ddico/odoo | addons/mrp_subcontracting/tests/common.py | 12 | 2455 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import Form, SavepointCase
class TestMrpSubcontractingCommon(SavepointCase):
@classmethod
def setUpClass(cls):
super(TestMrpSubcontractingCommon, cls).setUpClass()
# 1: Cr... | agpl-3.0 |
YangSongzhou/django | tests/foreign_object/models/article.py | 87 | 3084 | from django.db import models
from django.db.models.fields.related import ForwardManyToOneDescriptor
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import get_language
class ArticleTranslationDescriptor(ForwardManyToOneDescriptor):
"""
The set of articletranslation ... | bsd-3-clause |
ivano666/tensorflow | tensorflow/python/framework/load_library.py | 9 | 4787 | # Copyright 2015 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 a... | apache-2.0 |
ytsapras/robonet_site | scripts/tests/test_lco_api_tools.py | 1 | 4347 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 16:23:33 2018
@author: rstreet
"""
import sys
import os
cwd = os.getcwd()
sys.path.append(os.path.join(cwd,'..'))
import lco_api_tools
from datetime import datetime, timedelta
import pytz
import observation_classes
def run_tests():
"""Function to run the suite of... | gpl-2.0 |
silverpapa/py-flask-signup | tests/application-tests.py | 1 | 1643 | # Copyright 2013. Amazon Web Services, 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 a... | apache-2.0 |
mistoll/ros_buildfarm | scripts/release/run_release_reconfigure_job.py | 3 | 2469 | #!/usr/bin/env python3
# Copyright 2014-2016 Open Source Robotics Foundation, 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
#
# Unle... | apache-2.0 |
rawWhipIT/p22-goldant-buildpack | vendor/setuptools-7.0/setuptools/tests/test_upload_docs.py | 522 | 2139 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... | mit |
SUSE/azurectl | azurectl/utils/xz.py | 1 | 2078 | # Copyright (c) 2015 SUSE Linux GmbH. 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 la... | apache-2.0 |
eLBati/odoo | openerp/tools/cache.py | 41 | 4676 | import lru
import logging
logger = logging.getLogger(__name__)
class ormcache(object):
""" LRU cache decorator for orm methods,
"""
def __init__(self, skiparg=2, size=8192, multi=None, timeout=None):
self.skiparg = skiparg
self.size = size
self.method = None
self.stat_miss... | agpl-3.0 |
kevin-coder/tensorflow-fork | tensorflow/python/data/experimental/ops/resampling.py | 10 | 11934 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ColorFuzzy/tornado | maint/vm/windows/bootstrap.py | 13 | 3239 | r"""Installs files needed for tornado testing on windows.
These instructions are compatible with the VMs provided by http://modern.ie.
The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations,
although tornado's tests do not pass on XP.
1) Install virtualbox guest additions (from the device menu i... | apache-2.0 |
tealover/nova | nova/tests/unit/api/openstack/compute/test_plugins/basic.py | 46 | 1179 | # Copyright 2014 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 by applicable law or agreed t... | apache-2.0 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/dateutil/tzwin.py | 111 | 6149 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
from six.moves import winreg
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Ti... | gpl-2.0 |
Tesora/tesora-project-config | nodepool/scripts/prepare_tempest_testrepository.py | 3 | 1655 | #!/usr/bin/env python2
#
# Copyright 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
#
# Unl... | apache-2.0 |
deniederhut/weather_report | weather_report/classifiers.py | 2 | 4370 | #!/usr/bin/env python
"""
Sentiment classifiers
"""
import collections
import datetime
import json
from nltk import word_tokenize
from nltk.corpus import wordnet as wn
import os
from pkg_resources import resource_string
from textblob import TextBlob
import time
class Classifier(object):
"""MetaClass for classifi... | bsd-2-clause |
fitermay/intellij-community | python/helpers/python-skeletons/StringIO.py | 80 | 2737 | """Skeleton for 'StringIO' stdlib module."""
import StringIO as _StringIO
class StringIO(object):
"""Reads and writes a string buffer (also known as memory files)."""
def __init__(self, buffer=None):
"""When a StringIO object is created, it can be initialized to an existing
string by passin... | apache-2.0 |
welltempered/rpy2-heroku | rpy/rlike/tests/test_functional.py | 5 | 1117 | import unittest
import itertools
import rpy2.rlike.functional as rlf
class TapplyTestCase(unittest.TestCase):
def testSumByString(self):
seq = ( 1, 2, 3, 4, 5, 6)
tags = ('a', 'b', 'a', 'c', 'b', 'a')
expected = {'a': 1+3+6,
'b': 2+5,
'c'... | gpl-2.0 |
robinro/ansible-modules-extras | network/f5/bigip_pool.py | 32 | 19028 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
copperleaftech/django-import-export | tests/core/models.py | 2 | 2427 | from __future__ import unicode_literals
import random
import string
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
birthday = models.DateTimeField(auto_now_add=True)
... | bsd-2-clause |
sahana/Turkey | modules/templates/IFRC/config.py | 4 | 201775 | # -*- coding: utf-8 -*-
import datetime
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
from controllers import deploy_index
def config(settings):
... | mit |
glwu/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_dist.py | 47 | 11394 | """Tests for distutils.dist."""
import os
import io
import sys
import unittest
import warnings
import textwrap
from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
from test.support import TESTFN, captured_stdout, run_unittest
from distutils.tests import support
class test_dis... | apache-2.0 |
longfin/sider | docs/conf.py | 2 | 8883 | # -*- coding: utf-8 -*-
#
# Sider documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 15 06:45:22 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | mit |
heeraj123/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_interpreted.py | 16 | 10332 | #! /usr/bin/env python
# $Id: test_interpreted.py 7514 2012-09-14 14:27:12Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for interpreted text in docutils/parsers/rst/states.py.
"""
from __init__ import DocutilsTestSupport
from docutils.... | agpl-3.0 |
AndBicScadMedia/YouCompleteMe | python/ycm/client/omni_completion_request.py | 48 | 1204 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | gpl-3.0 |
Rob-Johnson/marathon-python | marathon/models/endpoint.py | 8 | 1689 | try:
import json
except ImportError:
import simplejson as json
from .base import MarathonObject
class MarathonEndpoint(MarathonObject):
"""Marathon Endpoint helper object for service discovery. It describes a single port mapping for a running task.
:param str app_id: application id
:param str ho... | mit |
2ndy/RaspIM | usr/lib/python2.6/fileinput.py | 224 | 14143 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | gpl-2.0 |
rwaldron/jenkins | ips/proto.py | 8 | 2169 | # The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
#
# 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 ... | mit |
limao4223127/NCR_Pay | Agent Lead Spanish/AKMII.DMRA.Test/Python Script/check.py | 2 | 1387 | import os
def ScanFolder(path):
fileList = []
for item in os.listdir(path):
filePath = os.path.join(path, item)
if os.path.isfile(filePath):
fileList.append(filePath)
if os.path.isdir(filePath):
ScanFolder(filePath)
if (len(fileLis... | gpl-2.0 |
L-Insomnia-P/kernel-msm | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
flit/pyOCD | pyocd/utility/autoflush.py | 3 | 1642 | # pyOCD debugger
# Copyright (c) 2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... | apache-2.0 |
sabi0/intellij-community | python/lib/Lib/site-packages/django/conf/locale/sv/formats.py | 232 | 1365 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j F Y H:i'
YEAR_MONTH_FORMA... | apache-2.0 |
louietsai/python-for-android | python3-alpha/extra_modules/gdata/apps/migration/__init__.py | 119 | 8582 | #!/usr/bin/python2.4
#
# Copyright 2008 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 |
BrainTech/pre-pisak | modules/spellers/speller1c.py | 1 | 22723 | #!/bin/env python2.7
# -*- coding: utf-8 -*-
# This file is part of AT-Platform.
#
# AT-Platform 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 late... | gpl-3.0 |
piasek1906/Piasek.4.3.JWR | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
holmrenser/holmrenser.github.io | _scripts/table.py | 1 | 1345 | #!/usr/bin/python
__author__ = 'rensholmer'
__created__ = '04/09/15'
import sys
import glob
import json
import copy
_sp = { 'al':0,'at':0,'ar':0,'br':0,
'cp':0,'fv':1,'gm':1,'gr':0,
'mt':1,'pt':1,'sl':0,'st':0,
'ta':0,'vv':0,'os':0,'lj':0,
'rc':1,'zm':0,'ph':1,'md':1,
'cr':0}
... | mit |
lazaronixon/enigma2 | tools/create_picon_links.py | 192 | 1273 | #
# create links for picon
# usage: create_picon_links lamedb
# run in picon directory.
# It will read the servicenames from the lamedb and create symlinks
# for the servicereference names.
import os, sys
f = open(sys.argv[1]).readlines()
f = f[f.index("services\n")+1:-3]
while len(f):
ref = [int(x, 0x10) for x ... | gpl-2.0 |
ales-erjavec/scipy | scipy/optimize/tests/test_cobyla.py | 100 | 3562 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95, 0.66]
... | bsd-3-clause |
glyph/imaginary | imaginary/test/test_wiring.py | 1 | 3706 |
"""
Tests for L{imaginary.wiring}
These tests are not particularly good at the moment. They are, however, a
minor step up from nothing.
"""
from zope.interface.verify import verifyObject
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from axiom.store import Store
from axi... | mit |
mliu7/django-avatar | avatar/migrations/0002_auto__add_field_avatar_existing_thumbnail_sizes.py | 1 | 4545 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Avatar.existing_thumbnail_sizes'
db.add_column('avatar_avatar', 'existing_thumbnail_sizes'... | bsd-3-clause |
python-pillow/pillow-perf | testsuite/cases/pillow.py | 1 | 2653 | import math
from PIL import Image, ImageFilter, ImageOps
from .base import BaseTestCase, root
Image.LANCZOS = Image.ANTIALIAS
class PillowTestCase(BaseTestCase):
filter_ids = {
0: 'ner', 1: 'lzs', 2: 'bil', 3: 'bic',
4: 'box', 5: 'hmn', 6: 'mtc',
}
def create_test_data(self):
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.