repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
Eyepea/pytest-asyncio
tests/test_simple.py
1
2346
"""Quick'n'dirty unit tests for provided fixtures and markers.""" import asyncio import os import pytest @asyncio.coroutine def async_coro(loop): yield from asyncio.sleep(0, loop=loop) return 'ok' def test_event_loop_fixture(event_loop): """Test the injection of the event_loop fixture.""" assert eve...
apache-2.0
beni55/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
137
2495
""" Unittests for creating a course in an chosen modulestore """ import unittest import ddt from django.core.management import CommandError, call_command from contentstore.management.commands.create_course import Command from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.django_utils import...
agpl-3.0
kurikaesu/arsenalsuite
cpp/lib/PyQt4/examples/mainwindows/menus.py
20
11396
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
eri-trabiccolo/exaile
xl/version.py
1
2005
# Copyright (C) 2019 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that it w...
gpl-2.0
tdfischer/organizer
organizer/viewsets.py
1
1313
from rest_framework import viewsets, status from rest_framework.decorators import list_route, detail_route from django.db.models import Q class IntrospectiveViewSet(viewsets.ModelViewSet): @list_route(methods=['get']) def fields(self, request): fields = [] for fieldName, field in self.get_seria...
agpl-3.0
NetDBNCKU/GAE-Conference-Web-App
django/contrib/localflavor/gb/gb_regions.py
199
3504
""" Sources: English regions: http://www.statistics.gov.uk/geography/downloads/31_10_01_REGION_names_and_codes_12_00.xls Northern Ireland regions: http://en.wikipedia.org/wiki/List_of_Irish_counties_by_area Welsh regions: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales Scottish regions: http://...
bsd-3-clause
svenstaro/ansible
lib/ansible/modules/cloud/amazon/rds_subnet_group.py
71
5419
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
root-mirror/root
bindings/pyroot/pythonizations/python/ROOT/pythonization/_drawables.py
22
2760
# Author: Enric Tejedor CERN 04/2019 ################################################################################ # Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. # # All rights reserved. # # ...
lgpl-2.1
anubhav929/eden
modules/tests/hrm/create_volunteer.py
1
2605
""" Sahana Eden Automated Test - HRM002 Create Volunteer @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 wit...
mit
akretion/project-service
analytic_hours_block/__openerp__.py
21
2052
# -*- coding: utf-8 -*- ############################################################################## # # Author: Vincent Renaville, ported by Joel Grand-Guillaume # Copyright 2010-2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Af...
agpl-3.0
rocopartners/django-oscar
src/oscar/templatetags/history_tags.py
27
1936
from django.utils import six from django.utils.six.moves.urllib import parse from django import template from oscar.core.loading import get_model from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import resolve, Resolver404 from oscar.apps.customer import history Site = get_model(...
bsd-3-clause
flipjack/suventa
allauth/socialaccount/providers/__init__.py
7
1349
from django.conf import settings from allauth.compat import importlib class ProviderRegistry(object): def __init__(self): self.provider_map = {} self.loaded = False def get_list(self): self.load() return self.provider_map.values() def register(self, cls): self.pr...
bsd-3-clause
roadmapper/ansible
lib/ansible/modules/network/meraki/meraki_syslog.py
6
9145
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net> # 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 = { ...
gpl-3.0
edmorley/django
tests/sites_tests/tests.py
40
13012
from django.apps import apps from django.apps.registry import Apps from django.conf import settings from django.contrib.sites import models from django.contrib.sites.management import create_default_site from django.contrib.sites.middleware import CurrentSiteMiddleware from django.contrib.sites.models import Site, clea...
bsd-3-clause
philoniare/horizon
openstack_dashboard/dashboards/project/stacks/resource_types/views.py
51
2821
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/rfc822.py
30
33542
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not worth rena...
bsd-3-clause
0Chencc/CTFCrackTools
Lib/Lib/markupbase.py
173
14643
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the HTMLParser and sgmllib modules (indirectly, for htmllib as well). It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z...
gpl-3.0
j00bar/ansible
contrib/inventory/zabbix.py
47
4204
#!/usr/bin/env python # (c) 2013, Greg Buehler # # This file is part of Ansible, # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
ScreamingUdder/mantid
scripts/Muon/MaxentTools/outspec.py
1
1776
from __future__ import (absolute_import, division, print_function) import numpy as np from Muon.MaxentTools.zft import ZFT def OUTSPEC( datum, f, sigma, datt, CHANNELS_itzero, CHANNELS_itotal, PULSESHAPE_convol, FAC_ratio, DETECT_a, DETECT_b, DETECT_d, DETE...
gpl-3.0
cselis86/edx-platform
common/djangoapps/track/shim.py
13
5643
"""Map new event context values to old top-level field values. Ensures events can be parsed by legacy parsers.""" import json import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey log = logging.getLogger(__name__) CONTEXT_FIELDS_TO_INCLUDE = [ 'username', 'session...
agpl-3.0
kvar/ansible
test/units/modules/network/vyos/test_vyos_config.py
68
5136
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
dominicelse/scipy
scipy/signal/_upfirdn.py
40
6587
# Code adapted from "upfirdn" python library with permission: # # Copyright (c) 2009, Motorola, 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 re...
bsd-3-clause
mluscon/ci-dnf-stack
dnf-docker-test/features/steps/command_utils.py
1
2910
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import codecs import shlex import subprocess import six __all__ = ["run"] class CommandResult(object): def __init__(self, **kwargs): self.command = kwargs.pop("command", None) sel...
gpl-3.0
nguyenphanhuynh/metasyntactic
protobuf-2.2.0/python/google/protobuf/internal/message_listener.py
17
2635
# 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: # # * Redistributions o...
apache-2.0
RedHat-Eng-PGM/python-schedules-tools
schedules_tools/tests/test_check_tasks.py
1
2681
import os import pytest from . import create_test_schedule DATA_DIR = 'data' # tests PARENT_DIRNAME = os.path.basename(os.path.dirname(os.path.realpath(__file__))) # schedules_tools BASE_DIR = os.path.dirname(os.path.realpath( os.path.join(__file__, os.pardir))) # schedules_tools/tests CURR_DIR = os.path.join(...
gpl-3.0
blackzw/openwrt_sdk_dev1
staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/tests/pytree_idempotency.py
129
2385
#!/usr/bin/env python # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Main program for testing the infrastructure.""" __author__ = "Guido van Rossum <guido@python.org>" # Support imports (need to be imported first) from . import support # Python imports import ...
gpl-2.0
adobecs5/urp2015
lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py
203
12894
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, detect_encoding, ZipFi...
apache-2.0
acsone/account-financial-tools
account_auto_fy_sequence/models/account_journal.py
38
1795
# coding=utf-8 ############################################################################## # # account_auto_fy_sequence module for Odoo # Copyright (C) 2014 ACSONE SA/NV (<http://acsone.eu>) # @author Laetitia Gangloff <laetitia.gangloff@acsone.eu> # # account_auto_fy_sequence is free software: # you ...
agpl-3.0
darkleons/lama
addons/knowledge/__init__.py
436
1064
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
thurt/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/sqlite3/dbapi2.py
161
2615
#-*- coding: ISO-8859-1 -*- # pysqlite2/dbapi2.py: the DB-API 2.0 interface # # Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # aris...
apache-2.0
madhurrajn/samashthi
lib/gevent/_ssl2.py
9
17240
# Wrapper module for _ssl. Written by Bill Janssen. # Ported to gevent by Denis Bilenko. """SSL wrapper for socket objects on Python 2.7.8 and below. For the documentation, refer to :mod:`ssl` module manual. This module implements cooperative SSL socket wrappers. """ from __future__ import absolute_import import ssl...
bsd-3-clause
gcanal/Mono
mono/test/ex_start_stop.py
1
1214
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Mar 10 15:28:50 2017 @author: robert """ from scapy.all import IP,sendrecv, ICMP, utils, STP, Ether, Dot3, Dot1Q, ARP, IPv6, TCP import mono import MySQLdb import threading import sys import mono_config as mc #Test the start/stop functions of the MONO ...
mit
o3project/ryu-oe
ryu/lib/packet/icmp.py
42
9194
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli...
apache-2.0
ResearchSoftwareInstitute/MyHPOM
myhpom/tests/test_documentreview_task.py
1
1045
from django.test import TestCase from django.core import mail from myhpom.models import CloudFactoryDocumentRun, DocumentUrl from myhpom.tasks import EmailUserDocumentReviewCompleted from myhpom.tests.factories import AdvanceDirectiveFactory class EmailUserDocumentReviewCompletedTestCase(TestCase): """ * If t...
bsd-3-clause
chennan47/osf.io
addons/wiki/routes.py
22
4851
""" Routes associated with the wiki page """ from framework.routing import Rule, json_renderer from website.routes import OsfWebRenderer from . import views TEMPLATE_DIR = './addons/wiki/templates/' settings_routes = { 'rules': [], 'prefix': '/api/v1', } # NOTE: <wname> refers to a wiki page's key, e.g. 'H...
apache-2.0
google/starthinker
starthinker_ui/website/management/commands/scripts_to_csv.py
1
1997
########################################################################### # # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
apache-2.0
Jmainguy/ansible-modules-extras
cloud/centurylink/clc_group.py
25
17067
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/weakref.py
187
10693
"""Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ """ # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function imported from ...
gpl-3.0
JeremyAgost/gemrb
gemrb/GUIScripts/iwd2/GUIMA.py
5
11109
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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 opt...
gpl-2.0
falkerson/fuel-plugin-service
config.py
1
1445
# Server Specific Configurations server = { 'port': '8080', 'host': '0.0.0.0' } # Pecan Application Configurations app = { 'root': 'fuel_plugin_service.controllers.root.RootController', 'modules': ['fuel_plugin_service'], 'template_path': '%(confdir)s/fuel_plugin_service/templates', 'debug': Tr...
apache-2.0
frmichel/vo-support-tools
CE/monitor-ce/processors/running_ratio_day_night.py
1
4813
#!/usr/bin/python # # This tools exploits the data of csv files produced by script collect-ce-job-status.py, to # compute the average ratio R/(R+W) during day time (12h, 16h, 20h) or night time (0h, 4h, 8h), # as a function of time. # # Results are stored in file running_ratio_day_night.csv. import os import csv im...
mit
laurb9/rich-traceback
test/formatter_test.py
1
1347
# # Copyright (C)2014 Laurentiu Badea # """ Test RichTracebackFormatter class. """ import unittest import logging import rich_traceback.formatter import StringIO class LogTest(unittest.TestCase): def testLogException(self): output = StringIO.StringIO() self.logger = logging.getLogger('root') ...
apache-2.0
johnsonlau/multivimdriver-vmware-vio
vio/vio/swagger/views/image/views.py
1
5495
# Copyright (c) 2017 VMware, 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 w...
apache-2.0
mancoast/CPythonPyc_test
fail/313_test_pep352.py
4
7156
import unittest import builtins import warnings from test.support import run_unittest import os from platform import system as platform_system class ExceptionClassTests(unittest.TestCase): """Tests for anything relating to exception objects themselves (e.g., inheritance hierarchy)""" def test_builtins_n...
gpl-3.0
stewgeo/fmepedia-data-upload-validation-display
pythonLibraries/setuptools-0.6c11/build/lib/site.py
108
2362
def __boot(): import sys, imp, os, os.path PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys....
mit
Big-B702/python-for-android
python-build/python-libs/xmpppy/doc/examples/logger.py
87
2608
#!/usr/bin/python # -*- coding: koi8-r -*- from xmpp import * import time,os #BOT=(botjid,password) BOT=('test@penza-gsm.ru','test') #CONF=(confjid,password) CONF=('talks@conference.jabber.ru','') LOGDIR='./' PROXY={} #PROXY={'host':'192.168.0.1','port':3128,'username':'luchs','password':'secret'} ####################...
apache-2.0
isandlaTech/cohorte-devtools
org.cohorte.eclipse.runner.basic/files/test/pelix/shell/remote.py
3
15312
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ iPOPO remote shell Provides a remote interface for the Pelix shell that can be accessed using telnet or netcat. :author: Thomas Calmant :copyright: Copyright 2016, Thomas Calmant :license: Apache License 2.0 :version: 0.6.4 .. Copyright 2016 Thomas Calma...
apache-2.0
hyperized/ansible
lib/ansible/modules/network/eos/eos_lacp_interfaces.py
1
5527
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is au...
gpl-3.0
AlexBoYang/Unblock-Youku
test/run-all-tests.py
12
3293
#!/usr/bin/env python """ Allow you smoothly surf on many websites blocking non-mainland visitors. Copyright (C) 2012 - 2014 Bo Zhu http://zhuzhu.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by t...
agpl-3.0
ralphjzhang/profitpy
profit/session/collection.py
18
4963
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Troy Melhase, Yichun Wei # Distributed under the terms of the GNU General Public License v2 # Author: Troy Melhase <troy@gci.net> # Yichun Wei <yichun.wei@gmail.com> import os from cPickle import PicklingError, UnpicklingError, dump, load from P...
gpl-2.0
shakamunyi/neutron-dvr
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
1
68138
# Copyright 2013 Cisco Systems, 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 o...
apache-2.0
reddraggone9/youtube-dl
youtube_dl/extractor/sina.py
107
2755
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, compat_urllib_parse, ) class SinaIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(.*?\.)?video\.sina\.com\.cn/ ( ...
unlicense
NetApp/cinder
cinder/volume/drivers/synology/synology_common.py
6
48891
# Copyright (c) 2016 Synology 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 ...
apache-2.0
t0mk/ansible
lib/ansible/modules/cloud/misc/xenserver_facts.py
16
5392
#!/usr/bin/python -tt # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distrib...
gpl-3.0
srznew/heat
heat/db/sqlalchemy/models.py
5
17313
# # 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
XiWenRen/you-get
src/you_get/extractors/yinyuetai.py
15
1341
#!/usr/bin/env python __all__ = ['yinyuetai_download', 'yinyuetai_download_by_id'] from ..common import * def yinyuetai_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False): assert title html = get_html('http://www.yinyuetai.com/insite/get-video-info?flex=true&videoId=' + id) ...
mit
odubno/microblog
venv/lib/python2.7/site-packages/pip/_vendor/requests/models.py
277
26436
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
bsd-3-clause
butozerca/fireplace
fireplace/cards/blackrock/brawl.py
1
1297
from ..utils import * ## # Hero Powers # Wild Magic class TBA01_5: activate = Buff(Give(CONTROLLER, RandomMinion()), "TBA01_5e") class TBA01_5e: cost = lambda self, i: 0 # Molten Rage class TBA01_6: activate = Summon(CONTROLLER, "CS2_118") ## # Minions # Dragonkin Hatcher class BRMC_84: play = Summon(CONTR...
agpl-3.0
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/scipy/linalg/decomp.py
15
31227
# # Author: Pearu Peterson, March 2002 # # additions by Travis Oliphant, March 2002 # additions by Eric Jones, June 2002 # additions by Johannes Loehnert, June 2006 # additions by Bart Vandereycken, June 2006 # additions by Andrew D Straw, May 2007 # additions by Tiziano Zito, November 2008 # # April 2010: Functio...
mit
manaris/jythonMusic
library/jython2.5.3/Lib/test/test_jser.py
9
1144
from test_support import * print 'Java Serialization (test_jser.py)' from java import io, awt import os, sys object1 = 42 object2 = ['a', 1, 1.0] class Foo: def bar(self): return 'bar' object3 = Foo() object3.baz = 99 object4 = awt.Color(1,2,3) print 'writing' sername = os.path.join(sys.prefix, "...
gpl-3.0
micwypych/github-cmake-project-checker
project_checker/tests/branchtest.py
1
1977
from unittest import TestCase from project_checker.checker.gitservice import Branches from project_checker.checker.gitservice import RemoteBranch from project_checker.checker.gitservice import LocalBranch class ServiceStub: pass class BranchTest(TestCase): def test_branches_creation_no_branches(self): ...
mit
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/test_conv3d_layer.py
1
8512
# Copyright (c) 2020 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 appli...
apache-2.0
twitchyliquid64/misc-scripts
s3tool/boto-develop/boto/pyami/bootstrap.py
150
5748
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
heeraj123/oh-mainline
vendor/packages/gdata/src/gdata/tlslite/BaseDB.py
238
3508
"""Base class for SharedKeyDB and VerifierDB.""" import anydbm import thread class BaseDB: def __init__(self, filename, type): self.type = type self.filename = filename if self.filename: self.db = None else: self.db = {} self.lock = thre...
agpl-3.0
ahaym/eden
modules/s3log.py
17
11312
# -*- coding: utf-8 -*- """ S3 Logging Facility @copyright: (c) 2015 Sahana Software Foundation @license: MIT 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 rest...
mit
snf/servo
components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py
276
1292
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface OneNullableInUnion { void foo((object? or DOMString?) arg); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Two ...
mpl-2.0
kvar/ansible
test/units/modules/remote_management/oneview/test_oneview_ethernet_network_info.py
21
3595
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import unittest from oneview_module_loader import EthernetNetworkInfoModule from hpe_test_utils import FactsParamsTestCase ERROR_MSG = 'Fa...
gpl-3.0
malcolmgreaves/support-tools
wiki_to_md/wiki2gfm_test.py
136
31840
# Copyright 2014 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
pteichman/cobe
tests/test_tokenizers.py
1
6195
import unittest from cobe.tokenizers import CobeStemmer, CobeTokenizer, MegaHALTokenizer class testMegaHALTokenizer(unittest.TestCase): def setUp(self): self.tokenizer = MegaHALTokenizer() def testSplitEmpty(self): self.assertEqual(len(self.tokenizer.split("")), 0) def testSplitSentence(...
mit
fnordahl/nova
nova/api/ec2/cloud.py
1
86863
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
apache-2.0
benschulz/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_encoding.py
445
2228
from __future__ import absolute_import, division, unicode_literals import os import unittest try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals from .support import get_data_files, TestData, test_dir, errorMessage from html5lib import HTML...
mpl-2.0
toshywoshy/ansible
lib/ansible/plugins/lookup/random_choice.py
157
1573
# (c) 2013, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # 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 DOCUMENTATION = """ lookup: random_choice author:...
gpl-3.0
RandallDW/Aruba_plugin
plugins/org.python.pydev.jython/Lib/distutils/unixccompiler.py
90
12314
"""distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library...
epl-1.0
stefwalter/sssd
src/config/SSSDConfig/ipachangeconf.py
7
19190
# # ipachangeconf - configuration file manipulation classes and functions # partially based on authconfig code # Copyright (c) 1999-2007 Red Hat, Inc. # Author: Simo Sorce <ssorce@redhat.com> # # This is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as publi...
gpl-3.0
SamuelDauzon/Improllow-up
users/views.py
1
4768
# coding:utf-8 import json import datetime import csv from django.shortcuts import render from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedirect, HttpResponse, JsonResponse from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from...
mit
drjeep/django
django/contrib/gis/db/backends/oracle/schema.py
608
4050
from django.contrib.gis.db.models.fields import GeometryField from django.db.backends.oracle.schema import DatabaseSchemaEditor from django.db.backends.utils import truncate_name class OracleGISSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_metadata = (""" INSERT INTO USER_SDO_GEOM_METADATA ...
bsd-3-clause
Fougere87/unsec
test_art.py
1
2473
import os import glob from unsec import Email from unsec import Tools from unsec import Collection from unsec import Clustering from sklearn import cluster import matplotlib.pyplot as plt import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D from sklearn import decomposition # Tools.vectorize("data/bioinfo...
unlicense
bguillot/OpenUpgrade
addons/event/res_partner.py
43
1265
# -*- 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
fyffyt/scikit-learn
sklearn/linear_model/base.py
66
16933
""" Generalized Linear models. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Vincent Michel <vincent.michel@inria.fr> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # ...
bsd-3-clause
jldaniel/Athena
AthenaOpt/islands.py
1
6334
__author__ = 'jldaniel' from algorithm_base import AlgorithmBase from common import Individual from converger import Converger from history import History class Islands(AlgorithmBase): """ The Islands optimization algorithm. """ def __init__(self): """ Initialize the Islands algorithm...
mit
kevintaw/django
tests/annotations/tests.py
96
18622
from __future__ import unicode_literals import datetime from decimal import Decimal from django.core.exceptions import FieldDoesNotExist, FieldError from django.db.models import ( F, BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, Func, IntegerField, Sum, Value, ) from django.test import Tes...
bsd-3-clause
CenterForOpenScience/osf.io
api/preprints/urls.py
6
1988
from django.conf.urls import url from . import views app_name = 'osf' urlpatterns = [ url(r'^$', views.PreprintList.as_view(), name=views.PreprintList.view_name), url(r'^(?P<preprint_id>\w+)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name), url(r'^(?P<preprint_id>\w+)/bibliographi...
apache-2.0
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/Crypto/SelfTest/Signature/test_pkcs1_15.py
3
9473
# -*- coding: utf-8 -*- # # SelfTest/Signature/test_pkcs1_15.py: Self-test for PKCS#1 v1.5 signatures # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyon...
gpl-3.0
hrishioa/Aviato
flask/Lib/site-packages/requests/packages/chardet/gb2312freq.py
3132
36011
######################## 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-2.0
zerobatu/edx-platform
common/djangoapps/student/tests/test_microsite.py
47
3772
""" Test for User Creation from Micro-Sites """ from django.test import TestCase from student.models import UserSignupSource import mock import json from django.core.urlresolvers import reverse from django.contrib.auth.models import User FAKE_MICROSITE = { "SITE_NAME": "openedx.localhost", "university": "fakeu...
agpl-3.0
Julian/Minion
minion/tests/test_integration.py
1
1668
from unittest import TestCase import json from hyperlink import URL from minion.core import Application from minion.http import Headers from minion.renderers import JSON from minion.request import Request, Response from minion.routing import Router, SimpleMapper class TestMinion(TestCase): def test_it_routes_si...
mit
chares-zhang/you-get
src/you_get/extractors/youtube.py
14
12808
#!/usr/bin/env python from ..common import * from ..extractor import VideoExtractor class YouTube(VideoExtractor): name = "YouTube" # YouTube media encoding options, in descending quality order. # http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs. Retrieved July 17, 2014. stream_types = [ ...
mit
Omegaphora/external_chromium_org
third_party/tlslite/scripts/tlsdb.py
110
3763
#!/usr/bin/env python # Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. from __future__ import print_function import sys import os import socket import math if __name__ != "__main__": raise "This must be run as a command...
bsd-3-clause
oscarsaleta/P4
mpir/build.vc/mpir_config.py
1
19187
''' Set up Visual Sudio to build a specified MPIR configuration Copyright (C) 2011, 2012, 2013, 2014 Brian Gladman ''' from __future__ import print_function from operator import itemgetter from os import listdir, walk, unlink, makedirs, sep from os.path import split, splitext, isdir, relpath, join, exists from os.pa...
lgpl-3.0
procangroup/edx-platform
cms/djangoapps/contentstore/features/course-settings.py
20
6300
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from django.conf import settings from lettuce import step, world from nose.tools import assert_false, assert_true from selenium.webdriver.common.keys import Keys from cms.djangoapps.contentstore.features.common import type_in_codemirror TEST_...
agpl-3.0
willingc/oh-mainline
vendor/packages/Django/django/conf/locale/pt/formats.py
106
1499
# -*- 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 = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \d\e F \d\e...
agpl-3.0
LumaPictures/rez
src/rez/exceptions.py
1
4824
""" Exceptions. """ from contextlib import contextmanager class RezError(Exception): """Base-class Rez error.""" def __init__(self, value=None): self.value = value def __str__(self): return str(self.value) class RezSystemError(RezError): """Rez system/internal error.""" pass c...
lgpl-3.0
memo/tensorflow
tensorflow/tensorboard/backend/event_processing/io_wrapper.py
77
1818
# 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
denys-duchier/kivy
examples/keyboard/main.py
30
7441
""" Custom Keyboards ================ This demo shows how to create and display custom keyboards on screen. Note that the new "input_type" property of the TextInput means that this is rarely needed. We provide this demo for the sake of completeness. """ # Author: Zen-CODE from kivy.app import App from kivy.lang import...
mit
thundernixon/dailydecode
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/easy_xml.py
1049
4803
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
ahtn/keyplus
host-software/keyplus/utility/crc16.py
2
1245
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 jem@seethis.link # Licensed under the MIT license (http://opensource.org/licenses/MIT) def u16(x): return x & 0xffff def crc16_step(crc, byte): crc_poly = 0x1021 for n in range(7, -1, -1): crc_carry = crc >> 15 # bit that is shifted o...
mit
gkotton/neutron
tools/i18n_cfg.py
65
3491
import compiler import re def is_log_callfunc(n): """LOG.xxx('hello %s' % xyz) and LOG('hello')""" if isinstance(n.parent, compiler.ast.Mod): n = n.parent if isinstance(n.parent, compiler.ast.CallFunc): if isinstance(n.parent.node, compiler.ast.Getattr): if isinstance(n.parent....
apache-2.0
kunato/s3-u6
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
avasenin/mzbench
node/scripts/report_network_usage.py
5
2867
#!/usr/bin/env python """ Prints network usage in erlang-friendly format """ import os import re import subprocess def main(): uname = os.uname()[0] if uname == 'Darwin': p = subprocess.Popen(['netstat', '-ib'], stdout=subprocess.PIPE) (netstat_output, err) = p.communicate() lines = ...
bsd-3-clause
cognitiveclass/edx-platform
common/lib/xmodule/xmodule/tests/test_annotator_mixin.py
223
1932
""" This test will run for annotator_mixin.py """ import unittest from lxml import etree from xmodule.annotator_mixin import get_instructions, get_extension, html_to_text class HelperFunctionTest(unittest.TestCase): """ Tests to ensure that the following helper functions work for the annotation tool """...
agpl-3.0