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
ATIX-AG/ansible
test/units/modules/packaging/os/test_rhn_channel.py
101
5661
# -*- coding: utf-8 -*- # Copyright (c) 2017 Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from itertools import product import json from ansible.modules.packaging.os import rhn_channel import pytest pytestmark = pyt...
gpl-3.0
shaunbrady/boto
boto/cloudhsm/layer1.py
135
16187
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
as110/as110.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/dalvik.py
364
3442
# -*- coding: utf-8 -*- """ pygments.lexers.dalvik ~~~~~~~~~~~~~~~~~~~~~~ Pygments lexers for Dalvik VM-related languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups from p...
mit
sacharya/nova
nova/tests/cells/test_cells_utils.py
53
4233
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
xtern/ignite
docs/_docs/code-snippets/python/sql.py
7
2172
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
Ballz0fSteel/Umeko
lib/pip/_vendor/requests/packages/urllib3/exceptions.py
515
5599
from __future__ import absolute_import # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(se...
gpl-3.0
RealImpactAnalytics/airflow
airflow/sensors/__init__.py
5
2738
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
naojsoft/ginga
ginga/util/dp.py
3
7176
# # dp.py -- Data pipeline and reduction routines # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import numpy as np from collections import OrderedDict from ginga import AstroImage, colors from ginga.RGBImage import RGBImage from ginga.util import wcs ...
bsd-3-clause
t-wissmann/qutebrowser
scripts/dev/check_doc_changes.py
1
1709
#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
JayShenoy/crossy
lib/jinja2/meta.py
659
4190
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
gpl-3.0
Tesora-Release/tesora-horizon
openstack_dashboard/dashboards/settings/password/forms.py
63
3043
# Copyright 2013 Centrin Data Systems Ltd. # # 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
aakashsinha19/Aspectus
Image Classification/models/transformer/example.py
21
2118
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jose36/jmdl2
servers/downupload.py
36
4934
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para videos externos de downupload # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re impo...
gpl-2.0
TakashiSasaki/ns-3-nat
src/applications/bindings/callbacks_list.py
331
1249
callback_classes = [ ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', ...
gpl-2.0
msarahan/psutil
test/_posix.py
4
9932
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """POSIX specific tests. These are implicitly run by test_psutil.py.""" import datetime import os import subprocess import sys imp...
bsd-3-clause
sarantapichos/faircoop-market
openerp/addons/test_limits/models.py
435
1034
# -*- coding: utf-8 -*- import time import openerp class m(openerp.osv.osv.Model): """ This model exposes a few methods that will consume between 'almost no resource' and 'a lot of resource'. """ _name = 'test.limits.model' def consume_nothing(self, cr, uid, context=None): return True...
agpl-3.0
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_sys.py
60
38258
import unittest, test.support from test.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import platform # count the number of test runs, used to create unique # strin...
lgpl-3.0
KingJiangNet/boo
lib/antlr-2.7.5/examples/python/ASTsupport/astsupport.py
21
2452
import sys import antlr version = sys.version.split()[0] if version < '2.2.1': False = 0 if version < '2.3': True = not False class MyAST(antlr.CommonAST): pass class ASTType49(antlr.CommonAST): pass def testDefaultCreate(): t =factory.create() return checkNode(t, antlr.CommonAST, antlr.INVALID_TYP...
bsd-3-clause
mancoast/CPythonPyc_test
fail/311_test_scope.py
2
16587
import unittest from test.support import check_syntax_error, run_unittest import warnings warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<test string>") warnings.filterwarnings("ignore", r"import \*", SyntaxWarning, "<string>") class ScopeTests(unittest.TestCase): def testSimpleNesting(self): ...
gpl-3.0
paparazzi/libsbp
python/sbp/client/loggers/base_logger.py
6
3259
# Copyright (C) 2015 Swift Navigation Inc. # Contact: Mark Fine <mark@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, #...
lgpl-3.0
abarisain/mopidy
mopidy/utils/jsonrpc.py
1
12385
from __future__ import unicode_literals import inspect import json import traceback import pykka class JsonRpcWrapper(object): """ Wrap objects and make them accessible through JSON-RPC 2.0 messaging. This class takes responsibility of communicating with the objects and processing of JSON-RPC 2.0 m...
apache-2.0
fedya/ajenti
plugins/logs/main.py
5
2406
import gzip import bz2 import os from ajenti.ui import * from ajenti.com import implements from ajenti.api import * from ajenti.utils import * class LogsPlugin(CategoryPlugin): text = 'Logs' icon = '/dl/logs/icon.png' folder = 'system' def on_session_start(self): self._log = '' self....
lgpl-3.0
stefanhenneking/mxnet
docs/mxdoc.py
7
12702
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
shakamunyi/neutron-dvr
neutron/tests/unit/test_neutron_context.py
8
5955
# Copyright 2012 VMware, 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 ...
apache-2.0
hangshisitu/googletest
scripts/release_docs.py
1167
6132
#!/usr/bin/env python # # Copyright 2013 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...
bsd-3-clause
ravibhure/ansible
lib/ansible/modules/windows/win_region.py
47
3785
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, 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 o...
gpl-3.0
vimagick/youtube-dl
youtube_dl/extractor/history.py
121
1126
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import smuggle_url class HistoryIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?history\.com/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])' _TESTS = [{ 'url': 'http://www.history.com/topics/valentines-day/history-of-va...
unlicense
nivieru/ebookdroid
app/src/main/jni/mupdf/freetype/src/tools/docmaker/utils.py
515
3063
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org> # import string, sys, os, glob # current output directory # output_dir = None # This function is used to sort the index. It is a simple lexicographical # sort, except that it places capital letters before lowercase ones. # def index_sort( s1, ...
gpl-3.0
Neurosim-lab/netpyne
examples/M1detailed/cells/ITcell.py
1
12425
from neuron import h from math import sqrt, pi import os from Cell3D import * #################################################################### # Setting up params #################################################################### Vrest = -94.5896010066 h.v_init = -94.5896010066 h.celsius = 34.0 # same as e...
mit
sarantapichos/faircoop-market
addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
zzragida/PythonExamples
MemberShip/web/admin/app/views/index.py
4
2324
# -*- coding:utf-8 -*- from flask import Blueprint from flask import session from flask import request from flask import redirect from flask import render_template from flask import current_app from flask.ext.babel import gettext from flask.ext.login import login_required from flask.ext.login import login_user from ...
mit
vlinhd11/vlinhd11-android-scripting
python/src/Lib/test/test_fnmatch.py
98
1281
"""Test cases for the fnmatch module.""" from test import test_support import unittest from fnmatch import fnmatch, fnmatchcase class FnmatchTestCase(unittest.TestCase): def check_match(self, filename, pattern, should_match=1): if should_match: self.assert_(fnmatch(filename, pattern), ...
apache-2.0
viniciusgama/blog_gae
django/db/backends/postgresql/base.py
241
7448
""" PostgreSQL database backend for Django. Requires psycopg 1: http://initd.org/projects/psycopg1 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.client import DatabaseClient from django.db.backe...
bsd-3-clause
Beauhurst/django
django/contrib/contenttypes/models.py
39
6491
from collections import defaultdict from django.apps import apps from django.db import models from django.utils.translation import gettext_lazy as _ class ContentTypeManager(models.Manager): use_in_migrations = True def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Cac...
bsd-3-clause
jakevdp/vega_datasets
vega_datasets/core.py
1
15450
from io import BytesIO import os import json import pkgutil import textwrap from typing import Any, Dict, Iterable, List from urllib.request import urlopen import pandas as pd def _load_dataset_info() -> Dict[str, Dict[str, Any]]: """This loads dataset info from three package files: vega_datasets/datasets.j...
mit
TopazaPyra/flying_squirrel
views/settingsview.py
1
6713
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'settingsview.ui' # # Created: Mon Oct 21 10:47:04 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except A...
gpl-2.0
andresmrm/brython-experiment
static/brython/Lib/platform.py
102
50499
#!/usr/bin/env python3 """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as pa...
agpl-3.0
pbugni/pheme.util
setup.py
1
1053
#!/usr/bin/env python import os from setuptools import setup docs_require = ['Sphinx'] tests_require = ['nose', 'coverage'] try: here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as r: README = r.read() except IOError: README = '' setup(name='pheme.uti...
bsd-3-clause
walidsa3d/baklava
baklava/providers/cpasbien.py
1
1593
# -*- coding: utf-8 -*- from __future__ import unicode_literals import requests from bs4 import BeautifulSoup as BS from models import Torrent from provider import BaseProvider from utils import string_to_byte class Cpasbien(BaseProvider): def __init__(self, base_url): super(Cpasbien, self).__init__(bas...
mit
kuri65536/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/integration/SMTP_TLS.py
319
4739
"""TLS Lite + smtplib.""" from smtplib import SMTP from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper class SMTP_TLS(SMTP): """This class extends L{smtplib.SMTP} with TLS support.""" def starttls(self, username=None, password...
apache-2.0
xrmx/django
tests/expressions_case/tests.py
1
45503
from __future__ import unicode_literals import unittest from datetime import date, datetime, time, timedelta from decimal import Decimal from operator import attrgetter, itemgetter from uuid import UUID from django.core.exceptions import FieldError from django.db import connection, models from django.db.models import...
bsd-3-clause
liangshan/zask
tests/test_scopesession.py
1
1121
# -*- coding: utf-8 -*- import pytest import gevent import zerorpc from zask import Zask, _request_ctx from zask.ext.zerorpc import * from zask.ext import sqlalchemy from testutils import random_ipc_endpoint def testing_scope_session(): app = Zask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://' ...
bsd-3-clause
alexsh/Telegram
TMessagesProj/jni/boringssl/third_party/googletest/scripts/common.py
1180
2919
# Copyright 2013 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 foll...
gpl-2.0
paulscherrerinstitute/pshell
src/main/assembly/script/Lib/requests/api.py
24
4718
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
gpl-3.0
atsuyim/the-backdoor-factory
backdoor.py
15
29102
#!/usr/bin/env python ''' BackdoorFactory (BDF) v3 - FOUNTAINPATCH Many thanks to Ryan O'Neill --ryan 'at' codeslum <d ot> org-- Without him, I would still be trying to do stupid things with the elf format. Also thanks to Silvio Cesare with his 1998 paper (http://vxheaven.org/lib/vsc01.html) which these ELF patching ...
bsd-3-clause
technologiescollege/s2a_fr
s2a/Python/Lib/distutils/command/build_ext.py
20
32119
"""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import sys, os, string, re from types import * fr...
gpl-3.0
mydongistiny/external_chromium_org
tools/telemetry/telemetry/web_perf/metrics/smoothness_unittest.py
26
9738
# Copyright 2014 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 unittest from telemetry.results import page_test_results from telemetry.page import page as page_module from telemetry.web_perf.metrics import smooth...
bsd-3-clause
EUDAT-B2SHARE/invenio-old
modules/bibauthority/lib/bibauthority_config.py
2
5820
## 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 ## License, or (at your option...
gpl-2.0
Windriver/codelab
programming-collective-intelligence/docfilter/feedfilter.py
1
2335
# -*- coding: utf-8 -*- import feedparser import re #接受一个博客订阅源,并对内容项进行分类 def read(feed,classifier): #f=feedparser.parse('http://kiwitobes.com/feeds/python_search.xml') f=feedparser.parse(feed) #将上面的链接直接存储时会解析出错误的结果 for entry in f['entries']: print print '-----' #打印内容项 ...
apache-2.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/pip/vcs/__init__.py
536
8748
"""Handles all VCS (version control) support""" import os import shutil from pip.backwardcompat import urlparse, urllib from pip.log import logger from pip.util import (display_path, backup_dir, find_command, rmtree, ask_path_exists) __all__ = ['vcs', 'get_src_requirement'] class VcsSupport(...
mit
movingname/laikaboss
laikaboss/modules/tactical.py
20
5901
# Copyright 2015 Lockheed Martin Corporation # # 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 agr...
apache-2.0
niboshi/chainer
chainer/distributions/categorical.py
6
2792
import numpy import chainer from chainer import backend from chainer import distribution from chainer.functions.activation import log_softmax from chainer.functions.math import exponential from chainer.functions.math import sum as sum_mod from chainer.utils import argument from chainer.utils import cache class Categ...
mit
40223135/40223135-
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testcallable.py
739
4234
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ import unittest from unittest.test.testmock.support import is_instance, X, SomeClass from unittest.mock import ( Mock, MagicMock, NonCallableMagicMock, NonCallableM...
gpl-3.0
achals/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/genscript.py
191
4129
""" (deprecated) generate a single-file self-contained version of pytest """ import os import sys import pkgutil import py import _pytest def find_toplevel(name): for syspath in sys.path: base = py.path.local(syspath) lib = base/name if lib.check(dir=1): return lib mo...
mpl-2.0
xyos/horarios
horarios/migrations/0006_auto__add_session.py
1
2676
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Session' db.create_table(u'horarios_session', ( ...
mit
mdiller/MangoByte
cogs/utils/botdatatypes.py
1
7248
from __main__ import settings import discord from discord.ext import commands from abc import abstractmethod from .helpers import * import re class InvalidInputError(UserError): def __init__(self, message): super().__init__(f"Invalid Input. {message}") async def localize_embed(ctx, var, value, example_command): ...
mit
mkaluza/external_chromium_org
chrome/browser/safe_browsing/safe_browsing_testserver.py
74
1483
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Wraps the upstream safebrowsing_test_server.py to run in Chrome tests.""" import os import sys BASE_DIR = os.path.dirname(os.path....
bsd-3-clause
SPKian/Testing2
erpnext/accounts/doctype/payment_tool/test_payment_tool.py
31
6342
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest, frappe, json from frappe.utils import flt from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnex...
agpl-3.0
Tesora/tesora-tempest
tempest/lib/services/identity/v3/endpoints_client.py
2
2765
# Copyright 2013 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 requ...
apache-2.0
andyh616/mne-python
mne/realtime/tests/test_mockclient.py
10
5167
import os.path as op from nose.tools import assert_true from numpy.testing import assert_array_equal import mne from mne import Epochs, read_events, pick_channels from mne.utils import run_tests_if_main from mne.realtime import MockRtClient, RtEpochs base_dir = op.join(op.dirname(__file__), '..', '..', 'io', 'tests'...
bsd-3-clause
PsychoTV/PsychoTeam.repository
plugin.video.PsychoTV/default.py
1
142878
import base64;exec base64.b64decode('IyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KaW1wb3J0IGJhc2U2NAppbXBvcnQgdXJsbGliCmltcG9ydCBtZDUKaW1wb3J0IHVybGxpYjIKaW1wb3J0IGRhdGV0aW1lCmltcG9ydCByZQppbXBvcnQgb3MKaW1wb3J0IHhibWNwbHVnaW4KaW1wb3J0IHhibWNndWkKaW1wb3J0IHhibWNhZGRvbgppbXBvcnQgeGJtY3ZmcwppbXBvcnQgdHJhY2ViYWNrCmltcG9ydCBjb29raWVsaWI...
gpl-2.0
iivic/BoiseStateX
common/lib/xmodule/xmodule/tests/test_course_module.py
14
17131
import unittest from datetime import datetime, timedelta from fs.memoryfs import MemoryFS from mock import Mock, patch import itertools from xblock.runtime import KvsFieldData, DictKeyValueStore import xmodule.course_module from xmodule.modulestore.xml import ImportSystem, XMLModuleStore from opaque_keys.edx.locati...
agpl-3.0
bryback/quickseq
genescript/Bio/Align/Applications/_Dialign.py
3
9713
# Copyright 2009 by Cymon J. Cox. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Command line wrapper for the multiple alignment program DIALIGN2-2. """ __docformat__ = "epy...
mit
yasharmaster/scancode-toolkit
etc/scripts/json2csv.py
4
9466
#!/usr/bin/python2 # # Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. ...
apache-2.0
Zord13appdesa/python-for-android
python-modules/twisted/twisted/python/_inotify.py
57
2830
# -*- test-case-name: twisted.internet.test.test_inotify -*- # Copyright (c) 2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Very low-level ctypes-based interface to Linux inotify(7). ctypes and a version of libc which supports inotify system calls are required. """ import ctypes import ctypes.util ...
apache-2.0
adrienbrault/home-assistant
homeassistant/components/smappee/api.py
19
1450
"""API for Smappee bound to Home Assistant OAuth.""" from asyncio import run_coroutine_threadsafe from pysmappee import api from homeassistant import config_entries, core from homeassistant.const import CONF_PLATFORM from homeassistant.helpers import config_entry_oauth2_flow from .const import DOMAIN class ConfigE...
mit
geekboxzone/lollipop_external_chromium_org_third_party_skia
platform_tools/android/tests/gyp_to_android_tests.py
77
1165
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test gyp_to_android.py """ import os import shutil import sys import tempfile import test_variables import unittest # Path to gyp_to_android sys.path.append(test...
bsd-3-clause
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Utilities/Validation/EmailAddress.py
5
2982
# -*- coding: utf-8 -*- ############################################################################### # # EmailAddress # Verifies that a given email address matches an expected standard pattern. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the ...
apache-2.0
esc/pip
pip/_vendor/progress/spinner.py
510
1314
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 P...
mit
satbirsoni/softwaremonitor
input/source.py
1
1359
""" Copyright [2016] [Satbir Singh] 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, softwa...
apache-2.0
xin3liang/platform_external_chromium_org
mojo/public/tools/bindings/pylib/mojom/parse/translate.py
32
6075
# Copyright 2014 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. """Translates parse tree to Mojom IR.""" import re from . import ast def _MapTreeForType(func, tree, type_to_map): assert isinstance(type_to_map, type...
bsd-3-clause
crotsos/ns-3
src/visualizer/visualizer/higcontainer.py
189
3560
import gtk import gobject try: from gazpacho.widgets.base.base import SimpleContainerAdaptor except ImportError: pass #root_library = 'hig' class HIGContainer(gtk.Bin): __gtype_name__ = 'HIGContainer' __gproperties__ = { 'title': (str, 'Group Title', 'the group title', '', g...
gpl-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.2/tests/regressiontests/comment_tests/tests/templatetag_tests.py
54
4541
from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from django.template import Template, Context from regressiontests.comment_tests.models import Article, Author from regressiontests.comment_tests.tests impo...
apache-2.0
kuiwei/edx-platform
common/test/acceptance/pages/lms/tab_nav.py
19
3026
""" High-level tab navigation. """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise, EmptyPromise class TabNavPage(PageObject): """ High-level tab navigation. """ url = None def is_browser_on_page(self): return self.q(css='ol.course-tabs').present de...
agpl-3.0
christophercrouzet/m4th
doc/conf.py
1
1649
# -*- coding: utf-8 -*- import sys import os # -- General configuration ------------------------------------------------ project = u'm4th' copyright = u'2015, Christopher Crouzet' language = None extensions = [] primary_domain = 'cpp' templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' excl...
mit
pombredanne/pulp_packaging
ci/lib/builder.py
1
24668
#!/usr/bin/env python import fnmatch import glob import json import os import rpm import sys import shutil import subprocess import time import uuid import koji import requests home_directory = os.path.expanduser('~') mysession = None def init_koji(): global mysession opts = { 'cert': os.path.join...
gpl-2.0
plumbum/Espruino
boards/LCTECH_STM32F103RBT6.py
10
2802
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Nic Marcondes <nic@upnic.net> # # 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 htt...
mpl-2.0
neiudemo1/django
django/contrib/contenttypes/migrations/0002_remove_content_type_name.py
582
1168
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_legacy_name(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType') for ct in ContentType.objects.all(): try: ct.name = apps.get_model(ct.app_label, c...
bsd-3-clause
wskplho/sl4a
python/src/Lib/test/pydocfodder.py
194
6329
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
apache-2.0
groutr/numpy
numpy/f2py/tests/test_size.py
145
1154
from __future__ import division, absolute_import, print_function import os from numpy.testing import run_module_suite, assert_equal, dec import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestSizeSumExample(util.F2PyTest): sources = [_path('src', 'size', 'foo.f90')] ...
bsd-3-clause
CaptainThrowback/kernel_android-tegra-flounder-3.10
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
rochapps/django-secure-input
setup.py
1
1303
import os from setuptools import setup, find_packages def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' setup( name='dj...
bsd-3-clause
jhsenjaliya/incubator-airflow
airflow/migrations/versions/2e541a1dcfed_task_duration.py
62
1285
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
BeeeOn/server
t/gws/t1007-new-device-group.py
1
8191
#! /usr/bin/env python3 import config config.import_libs() import unittest import websocket import json import uuid from gws import assureIsClosed, assureNotClosed, registerGateway, ZMQConnection class TestNewDeviceGroup(unittest.TestCase): def setUp(self): self.zmq = ZMQConnection(config.gws_zmq_endpoint) sel...
bsd-3-clause
wenrr89/airtest
airtest/image/auto.py
2
39265
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 2014/09/01 jiaqianghuai: fix the code """ __author__ = 'hzjiaqianghuai,hzsunshx' __version__ = '0.2.09.01' __description__ ='fix the code' import os import time import math import numpy as np import cv2 MIN_MATCH_COUNT = 5 MIN_MATCH = 15 DEBUG = os.getenv('DEBUG') ==...
bsd-3-clause
aurelijusb/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
qijiepan/RecommendationSystem
RecommendSystem/MovieRecommendationScalable.py
1
8358
# coding: utf-8 ''' Author:Qijie Pan This recommendation is based on spark's MLLib ALS function and the data set is from movie lens. ''' import math # read the movies data and define the partition,here we split it into 2 partition ratingsFilename = 'Data/ratings.dat' moviesFilename = 'Data/movies.dat' def get_rat...
mit
anish/phatch
phatch/actions/saturation.py
4
12782
# Phatch - Photo Batch Processor # Copyright (C) 2007-2008 www.stani.be # # 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-3.0
Qalthos/ansible
lib/ansible/plugins/doc_fragments/exoscale.py
31
2142
# -*- coding: utf-8 -*- # Copyright: (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard exoscale documentation fragment DOCUMENTATION = r''' options: api_key: description: ...
gpl-3.0
mathstuf/beets
beetsplug/mpdstats.py
24
11723
# coding=utf-8 # This file is part of beets. # Copyright 2015, Peter Schnebel and Johann Klähn. # # 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 limi...
mit
toshywoshy/ansible
test/units/modules/network/f5/test_bigip_message_routing_peer.py
22
6439
# -*- coding: utf-8 -*- # # Copyright: (c) 2019, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
MayOneUS/pledgeservice
testlib/setuptools/tests/test_test.py
124
3712
# -*- coding: UTF-8 -*- """develop tests """ import os import shutil import site import sys import tempfile import unittest from distutils.errors import DistutilsError from setuptools.compat import StringIO from setuptools.command.test import test from setuptools.command import easy_install as easy_install_pkg from s...
apache-2.0
zookeepr/zookeepr
zkpylons/controllers/photocomp.py
5
14077
import cStringIO import datetime import logging import os import random import re import sys import time import Image from pylons import request, response, session, tmpl_context as c from pylons.controllers.util import abort from zkpylons.lib.helpers import redirect_to from pylons.decorators import validate from pylo...
gpl-2.0
srfarias/cexstel-kernel
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
gfcapalbo/stock-logistics-warehouse
stock_reserve/__openerp__.py
4
2152
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
hgdeoro/pilas
pilas/actores/dialogo.py
6
4858
# -*- encoding: utf-8 -*- # Pilas engine - A video game framework. # # Copyright 2010 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar import pilas class Dialogo: """ Representa una secuencia de mensajes entre varios actores. ...
lgpl-3.0
ericgriffin/metasort
lib/boost/tools/build/v2/test/sort_rule.py
51
2493
#!/usr/bin/python # Copyright (C) 2008. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Tests for the Boost Jam builtin SORT rule. import BoostBuild #########################################...
apache-2.0
beswarm/django-social-auth
social_auth/migrations/0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati.py
17
7111
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings from social_auth.utils import get_custom_user_model_for_migrations, \ custom_user_frozen_models USER_MODEL = get_custom_user_model_for_migrations() UI...
bsd-3-clause
abelkhan/websearch
websearch/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
timsnyder/bokeh
bokeh/command/subcommands/sampledata.py
2
2464
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause