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
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/openstack/os_volume_snapshot.py
63
6004
#!/usr/bin/python # coding: utf-8 -*- # Copyright (c) 2016, Mario Santos <mario.rf.santos@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'status': ['prev...
gpl-3.0
laterpay/amphtml
validator/validator_gen.py
112
11182
# # Copyright 2015 The AMP HTML Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
popazerty/e2-gui
lib/python/Screens/InputBox.py
14
5004
from enigma import getPrevAsciiCode from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Input import Input from Components.config import config from Tools.BoundFunction import boundFunction from T...
gpl-2.0
DepthDeluxe/ansible
lib/ansible/utils/display.py
45
11885
# (c) 2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
wakermahmud/sync-engine
inbox/models/secret.py
6
1400
from sqlalchemy import Column, Enum, Integer from sqlalchemy.types import BLOB from sqlalchemy.orm import validates from inbox.models.base import MailSyncBase from inbox.security.oracles import get_encryption_oracle, get_decryption_oracle class Secret(MailSyncBase): """Simple local secrets table.""" _secret ...
agpl-3.0
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py
199
2167
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check vi...
gpl-3.0
codeworldprodigy/lab4
lib/jinja2/defaults.py
659
1068
# -*- coding: utf-8 -*- """ jinja2.defaults ~~~~~~~~~~~~~~~ Jinja default filters and tags. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import range_type from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner # defaults for ...
apache-2.0
CallaJun/hackprince
indico/networkx/algorithms/components/tests/test_strongly_connected.py
11
5264
#!/usr/bin/env python from nose.tools import * import networkx as nx from networkx import NetworkXNotImplemented class TestStronglyConnected: def setUp(self): self.gc=[] G=nx.DiGraph() G.add_edges_from([(1,2),(2,3),(2,8),(3,4),(3,7), (4,5),(5,3),(5,6),(7,4),(7,6),...
lgpl-3.0
Ross-cz/shaka-player
third_party/gjslint/closure_linter-2.3.13/closure_linter/not_strict_test.py
129
2318
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
apache-2.0
sajeeshcs/nested_quota_final
nova/cells/rpc_driver.py
63
7123
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2013 Red Hat, 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/license...
apache-2.0
12AngryMen/votca-scripts
xtp/xtp_sendjobstocluster.py
2
5551
#!/usr/bin/env python from __tools__ import MyParser from __tools__ import XmlParser from __tools__ import XmlWriter from __tools__ import make_sure_path_exists from __tools__ import addsuffixtofile from __cluster__ import write_cluster_batch from __xtpJobfile__ import splittjobfile from __xtpJobfile__ import mergejobf...
apache-2.0
alexanderturner/ansible
lib/ansible/playbook/conditional.py
12
9210
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
rjoudrey/volatility
volatility/win32/lsasecrets.py
44
4501
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # This file is part of Volatility. # # Volatility 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...
gpl-2.0
rantonmattei/garcon
tests/test_decider.py
1
1045
from unittest.mock import MagicMock import boto.swf.layer2 as swf from boto.swf import layer1 import pytest from garcon import activity from garcon import decider def mock(monkeypatch): for base in [swf.Decider, swf.WorkflowType, swf.ActivityType, swf.Domain]: monkeypatch.setattr(base, '__init__', MagicM...
mit
jferreir/mbed
workspace_tools/host_tests/mbedrpc.py
111
7047
# mbedRPC.py - mbed RPC interface for Python # ##Copyright (c) 2010 ARM 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 ##t...
apache-2.0
moio/spacewalk
backend/upload_server/handlers/package_push/package_push.py
1
5519
# # Code that drops files on the filesystem (/PKG-UPLOAD) # # # Copyright (c) 2008--2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITN...
gpl-2.0
bert9bert/statsmodels
statsmodels/sandbox/distributions/tests/__init__.py
219
6354
''' Econometrics for a Datarich Environment ======================================= Introduction ------------ In many cases we are performing statistical analysis when many observed variables are available, when we are in a data rich environment. Machine learning has a wide variety of tools for dimension reduction an...
bsd-3-clause
crayzeewulf/android-quill
jni/libhpdf-2.3.0RC2/if/python/demo/outline_demo_jp.py
32
3955
### ## * << Haru Free PDF Library 2.0.0 >> -- outline_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
gpl-3.0
mjfarmer/scada_py
env/lib/python2.7/site-packages/pip/download.py
45
22491
import cgi import email.utils import hashlib import getpass import mimetypes import os import platform import re import shutil import sys import tempfile import pip from pip.backwardcompat import urllib, urlparse, raw_input from pip.exceptions import InstallationError, HashMismatch from pip.util import (splitext, rmt...
gpl-3.0
fjbatresv/odoo
addons/account/wizard/account_fiscalyear_close.py
222
15660
# -*- 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
AgrAlert/AgrAlert_Backend
lib/python2.7/site-packages/pip/_vendor/requests/models.py
151
28156
# -*- 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 ...
mit
tiagoantao/virtual-core
docker/file_router/copy/usr/bin/change_password.py
1
1624
#!/usr/bin/python2 import getpass import sys import pexpect boot = False if len(sys.argv) > 1 and sys.argv[1] == 'boot': print "Boot mode" boot = True def get_passes(): old = getpass.getpass('Old password: ') new1 = 'a' new2 = 'b' while new1 != new2: new1 = getpass.getpass('New pass...
agpl-3.0
scivey/mockthink
mockthink/test/functional/test_logic.py
2
2727
import rethinkdb as r from mockthink.test.common import as_db_and_table, assertEqUnordered, assertEqual from mockthink.test.functional.common import MockTest from pprint import pprint class TestLogic1(MockTest): @staticmethod def get_data(): data = [ {'id': 'joe', 'has_eyes': True, 'age': 2...
mit
fenglu-g/incubator-airflow
airflow/contrib/sensors/weekday_sensor.py
4
4291
# -*- 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
SRabbelier/Melange
thirdparty/google_appengine/lib/django_1_2/django/utils/encoding.py
44
7087
import types import urllib import locale import datetime import codecs from decimal import Decimal from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj UnicodeDecodeError.__init__(self, *args) def __str_...
apache-2.0
mgit-at/ansible
test/units/modules/network/onyx/test_onyx_config.py
16
4592
# # (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
monopole/test-infra
gubernator/view_logs.py
22
11302
# Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-1.5/django/http/multipartparser.py
82
22856
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import cgi from django.conf import settings from django.core.exceptions import SuspiciousOperation fro...
lgpl-3.0
KohlsTechnology/ansible
lib/ansible/modules/inventory/group_by.py
67
1457
# -*- mode: python -*- # # Copyright: Ansible Team # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stablein...
gpl-3.0
DavidHerzogTU-Berlin/cassandraToRun
test/system/test_thrift_server.py
1
103505
# 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
EliAndrewC/ensconce
ensconce/util/cpjsonrpc.py
1
11059
# coding: utf-8 """ From http://code.google.com/p/cherrypy-jsonrpc (LGPL) Some modifications: - Content-Type (application/json) """ import sys import httplib import cherrypy import traceback try: import jsonlib2 as json _ParseError = json.ReadError except ImportError: import json _ParseError = ValueEr...
bsd-3-clause
guewen/odoo
addons/portal_project_issue/tests/__init__.py
167
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
github-account-because-they-want-it/django
tests/db_functions/models.py
245
1332
""" Tests for built in Function expressions. """ from __future__ import unicode_literals 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=50) alias = models.CharField(max_leng...
bsd-3-clause
suyashdb/hcp2bids
setup.py
1
2182
from setuptools import setup import os, glob, shutil import re, json, numpy import nibabel as ni here = os.path.abspath(os.path.dirname(__file__)) setup( name="hcp2bids", # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see ...
mit
Endika/mitmproxy
libmproxy/contrib/jsbeautifier/__init__.py
50
41216
import sys import getopt import re import string # # Originally written by Einar Lielmanis et al., # Conversion to python by Einar Lielmanis, einar@jsbeautifier.org, # MIT licence, enjoy. # # Python is not my native language, feel free to push things around. # # Use either from command line (script displays its usage ...
mit
detiber/ansible
test/sanity/validate-modules/utils.py
33
3443
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # 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 ...
gpl-3.0
captiosus/treadmill
treadmill/infra/setup/ldap.py
2
1481
from treadmill.infra.setup import base_provision from treadmill.infra import configuration, connection, constants, instances from treadmill.api import ipa import time class LDAP(base_provision.BaseProvision): def setup( self, image, count, key, cidr_bloc...
apache-2.0
dethos/cloudroutes-service
src/actions/actions/saltstack-generic/__init__.py
6
1476
#!/usr/bin/python ###################################################################### # Cloud Routes Bridge # ------------------------------------------------------------------- # Actions Module ###################################################################### import requests import time def action(**kwargs)...
agpl-3.0
nextgis/NextGIS_QGIS_open
python/plugins/processing/script/WrongScriptException.py
46
1234
# -*- coding: utf-8 -*- """ *************************************************************************** WrongScriptException.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************...
gpl-2.0
raiabril/arduino_logger
py2app-0.9-py2.7.egg/py2app/script_py2applet.py
9
5469
""" Create an applet from a Python script. You can drag in packages, Info.plist files, icons, etc. It's expected that only one Python script is dragged in. """ from __future__ import print_function import os, sys from distutils.core import setup from plistlib import Plist import py2app import tempfile import shutil ...
gpl-2.0
goddino/libjingle
trunk/third_party/yasm/source/patched-yasm/tools/python-yasm/tests/test_symrec.py
32
2976
from tests import TestCase, add from yasm import SymbolTable, Expression, YasmError class TSymbolTable(TestCase): def setUp(self): self.symtab = SymbolTable() def test_keys(self): self.assertEquals(len(self.symtab.keys()), 0) self.symtab.declare("foo", None, 0) keys = self.symt...
bsd-3-clause
stanlyxiang/incubator-hawq
tools/bin/gppylib/gpMgmttest/__init__.py
12
3044
# 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
frioux/offlineimap
offlineimap/mbnames.py
10
3676
# Mailbox name generator # # Copyright (C) 2002-2015 John Goerzen & contributors # # 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 opti...
apache-2.0
llonchj/sentry
tests/sentry/utils/auth/tests.py
30
1779
from __future__ import absolute_import from django.core.urlresolvers import reverse from django.http import HttpRequest from sentry.models import User from sentry.testutils import TestCase from sentry.utils.auth import EmailAuthBackend, get_login_redirect class EmailAuthBackendTest(TestCase): def setUp(self): ...
bsd-3-clause
jburger424/MediaQueueHCI
m-q-env/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
982
19608
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
sporksmith/polygraph
experiments/workloads/generate_workloads.py
2
2794
#!/usr/bin/env python # Polygraph (release 0.1) # Signature generation algorithms for polymorphic worms # # Copyright (c) 2004-2005, Intel Corporation # All Rights Reserved # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file ...
epl-1.0
iychoi/syndicate
old/ms/django_lib/gatewayforms.py
2
4283
''' John Whelchel Summer 2013 Forms used just for gateways (AG, RG, and UG). ''' from django import forms from django_lib.forms import LONGEST_CHAR_FIELD, LONGEST_PASS_FIELD, LONGEST_JSON_FIELD, ReadOnlyWidget LARGEST_PORT = 65535 class ModifyGatewayConfig(forms.Form): json_config = forms.FileField(required...
apache-2.0
OmnesRes/onco_lnc
mrna/cox/LGG/patient_info.py
1
7037
## A script for extracting info about the patients used in the analysis ## Load necessary modules from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') import re ##This call will only work if you are running python from the command line. ##If you are not running from the command lin...
mit
shootstar/ctest
ceilometer/compute/manager.py
2
3043
# -*- encoding: utf-8 -*- # # Copyright © 2012-2013 eNovance <licensing@enovance.com> # # Author: Julien Danjou <julien@danjou.info> # # 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 # # h...
apache-2.0
sshleifer/object_detection_kitti
inception/inception/slim/variables.py
23
10358
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
PingaxAnalytics/koob_auth
testproject/ptvs_virtualenv_proxy.py
1
4166
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If # you can...
mit
MiniSEC/GRR_clone
client/client_actions/linux/ko_patcher.py
6
7766
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """A kernel module rewriter. This is a hack that rewrites kernel modules such that they can be loaded on kernels they were not compiled for. """ import os import platform import struct import sys import logging from grr.lib import flags c...
apache-2.0
40223117cda/w16cdaa
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/display.py
603
25179
#!/usr/bin/env python '''Pygame module to control the display window and screen. This module offers control over the pygame display. Pygame has a single display Surface that is either contained in a window or runs full screen. Once you create the display you treat it as a regular Surface. Changes are not immediately ...
gpl-3.0
airbnb/streamalert
streamalert/apps/_apps/aliyun.py
1
8258
""" Copyright 2018-present Airbnb, 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 writing, sof...
apache-2.0
bingwen/shadowsocks
setup.py
929
1321
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.8.2", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
apache-2.0
agaffney/ansible
test/support/windows-integration/plugins/modules/win_acl.py
85
4112
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Phil Schwartz <schwartzmx@gmail.com> # Copyright: (c) 2015, Trond Hindenes # Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'m...
gpl-3.0
fiunchinho/ansible-modules-extras
notification/telegram.py
42
2670
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Artem Feofanov <artem.feofanov@gmail.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...
gpl-3.0
saurabh6790/pow-app
accounts/doctype/sales_invoice/pos.py
29
1618
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes @webnotes.whitelist() def get_items(price_list, sales_or_purchase, item=None, item_group=None): condition = "" args = {"price_list...
agpl-3.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/third_party/webdriver/pylib/test/selenium/webdriver/common/webserver.py
20
4133
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 # # Un...
mit
adalekin/django-balancer
docs/conf.py
4
7200
# -*- coding: utf-8 -*- # # django-balancer documentation build configuration file, created by # sphinx-quickstart on Mon Oct 18 10:17:32 2010. # # 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....
bsd-3-clause
htygithub/bokeh
bokeh/state.py
2
8592
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
bsd-3-clause
sysadmin75/ansible-modules-core
cloud/rackspace/rax_dns_record.py
16
11455
#!/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
sebalix/OpenUpgrade
addons/base_action_rule/__init__.py
438
1098
# -*- 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...
agpl-3.0
ghostsquad/pytest
testing/test_assertinterpret.py
30
8937
"PYTEST_DONT_REWRITE" import pytest, py from _pytest.assertion import util def exvalue(): return py.std.sys.exc_info()[1] def f(): return 2 def test_not_being_rewritten(): assert "@py_builtins" not in globals() def test_assert(): try: assert f() == 3 except AssertionError: e = e...
mit
sparklyballs/XBMC-Headless
xbmcdata/addons/service.xbmc.versioncheck/lib/common.py
82
7008
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # 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 versio...
mit
apurvbhartia/gnuradio-routing
gr-wxgui/src/python/forms/__init__.py
16
4222
# # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
oasiswork/odoo
openerp/addons/base/tests/test_qweb.py
289
4814
# -*- coding: utf-8 -*- import cgi import json import os.path import glob import re import collections from lxml import etree import openerp.addons.base.ir.ir_qweb import openerp.modules from openerp.tests import common from openerp.addons.base.ir import ir_qweb class TestQWebTField(common.TransactionCase): def ...
agpl-3.0
carsongee/edx-platform
cms/djangoapps/contentstore/management/commands/course_id_clash.py
18
2127
""" Script for finding all courses whose org/name pairs == other courses when ignoring case """ from django.core.management.base import BaseCommand from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStoreEnum # # To run from command line: ./manage.py cms --settings dev course_id_...
agpl-3.0
codingcommando/tmtp
standalone/New_Jeans2.py
1
23537
#!/usr/bin/env python # New_Jeans2.py # PatternMaker: Susan Spencer Conklin # pants shell pattern from tmtpl.constants import * from tmtpl.pattern import * from tmtpl.client import Client from math import sqrt class PatternDesign(): def __init__(self): self.styledefs={} self.markerdefs={} ...
gpl-3.0
twinaphex/pcsx2
3rdparty/portaudio/doc/utils/checkfiledocs.py
70
2415
import os import os.path import string paRootDirectory = '../../' paHtmlDocDirectory = os.path.join( paRootDirectory, "doc", "html" ) ## Script to check documentation status ## this script assumes that html doxygen documentation has been generated ## ## it then walks the entire portaudio source tree and check that ##...
lgpl-3.0
Asana/boto
tests/unit/vpc/test_vpc.py
100
13752
# -*- coding: UTF-8 -*- from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, VPC from boto.ec2.securitygroup import SecurityGroup DESCRIBE_VPCS = b'''<?xml version="1.0" encoding="UTF-8"?> <DescribeVpcsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-0...
mit
Parrot-Developers/ardupilot
mk/PX4/Tools/gencpp/src/gencpp/__init__.py
214
9473
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
analyseuc3m/ANALYSE-v1
openedx/core/djangolib/markup.py
5
1091
""" Utilities for use in Mako markup. """ import markupsafe # Text() can be used to declare a string as plain text, as HTML() is used # for HTML. It simply wraps markupsafe's escape, which will HTML-escape if # it isn't already escaped. Text = markupsafe.escape # pylint: disable=invalid-name ...
agpl-3.0
dagwieers/ansible
test/units/modules/network/aireos/test_aireos_command.py
52
4292
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
felliott/osf.io
osf_tests/test_registration_moderation_notifications.py
4
24500
import pytest import mock from mock import call from django.utils import timezone from osf.management.commands.add_notification_subscription import add_reviews_notification_setting from osf.management.commands.populate_registration_provider_notification_subscriptions import populate_registration_provider_notification_...
apache-2.0
SSSD/sssd
src/tests/multihost/adsites/test_adsites.py
1
13157
from __future__ import print_function import time import pytest from sssd.testlib.common.utils import sssdTools @pytest.mark.adsites class Testadsites(object): """ @Title: IDM-SSSD-TC: ad_provider: adsites: Improve AD site discovery process Test cases for BZ: 1819012 @Steps: 1. Join client to...
gpl-3.0
Solanar/CMPUT410-Project
DisSoNet/front/views/author.py
1
4859
from django.http import HttpResponse import json import socket from data.models import Comment def processRequestFromOtherServer(obj, dict_type): json_dict = {} json_dict_list = [] if dict_type is "author": json_dict_list.append(getAuthorDict(obj)) elif dict_type is "posts": for posts...
apache-2.0
apache/incubator-mxnet
tests/python/unittest/test_gluon_control_flow.py
2
25390
# 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
KaelChen/numpy
numpy/ma/tests/test_mrecords.py
64
20867
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for mrecords. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, absolute_import, print_function import warnings import pickle import numpy as np import numpy.ma as ma from numpy import recarray from n...
bsd-3-clause
geopython/pywps-demo
docs/conf.py
3
10208
# -*- coding: utf-8 -*- # # PyWPS-Flask documentation build configuration file, created by # sphinx-quickstart on Thu Aug 11 21:27:33 2016. # # 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. #...
mit
sam-m888/gprime
gprime/db/dbconst.py
1
4144
# # gPrime - A web-based genealogy program # # Copyright (C) 2004-2007 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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 versi...
gpl-2.0
mmnelemane/neutron
neutron/plugins/embrane/plugins/embrane_fake_plugin.py
59
1274
# Copyright 2013 Embrane, 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
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/pandas/tseries/plotting.py
7
9969
""" Period formatters and locators adapted from scikits.timeseries by Pierre GF Gerard-Marchant & Matt Knox """ # TODO: Use the fact that axis can have units to simplify the process import numpy as np from matplotlib import pylab from pandas.tseries.period import Period from pandas.tseries.offsets import DateOffset ...
apache-2.0
brunojppb/porque-rails
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
tjsavage/full_nonrel_starter
django/core/exceptions.py
292
2767
""" Global Django exception and warning classes. """ class DjangoRuntimeWarning(RuntimeWarning): pass class ObjectDoesNotExist(Exception): "The requested object does not exist" silent_variable_failure = True class MultipleObjectsReturned(Exception): "The query returned multiple objects when only one w...
bsd-3-clause
RUedx/configuration
tests/test_mongodb_replica_set.py
25
5499
# Tests for mongodb_replica_set ansible module # # How to run these tests: # 1. move this file to playbooks/library # 2. rename mongodb_replica_set to mongodb_replica_set.py # 3. python test_mongodb_replica_set.py import mongodb_replica_set as mrs import unittest, mock from urllib import quote_plus from copy import de...
gpl-2.0
sudeepdutt/mic
tools/perf/scripts/python/syscall-counts-by-pid.py
1996
2105
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/_bootlocale.py
40
1801
"""A minimal subset of the locale module used at interpreter startup (imported by the _io module), in order to reduce startup time. Don't import directly from third-party code; use the `locale` module instead! """ import sys import _locale if sys.platform.startswith("win"): def getpreferredencoding(do_setlocale=...
apache-2.0
mixja/eap-sim-lab
lib/pyscard-1.6.16/build/lib.macosx-10.10-x86_64-2.7/smartcard/CardConnection.py
2
7754
"""The CardConnection abstract class manages connections with a card and apdu transmission. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you can redistribute it and/or modif...
mit
mcepl/youtube-dl
youtube_dl/extractor/charlierose.py
12
1709
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import remove_end class CharlieRoseIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?charlierose\.com/video(?:s|/player)/(?P<id>\d+)' _TESTS = [{ 'url': 'https://charlierose.com/videos/27996', 'md5': 'fd...
unlicense
ttfseiko/openerp-trunk
openerp/addons/resource/faces/observer.py
433
2328
#@+leo-ver=4 #@+node:@file observer.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # ...
agpl-3.0
ax003d/openerp
openerp/addons/plugin_thunderbird/plugin_thunderbird.py
92
2075
# -*- 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
qmagico/sampleappqm
src/django/db/backends/postgresql_psycopg2/introspection.py
82
4121
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: '...
mit
MattDevo/edk2
AppPkg/Applications/Python/Python-2.7.2/Lib/multifile.py
67
4982
"""A readline()-style interface to the parts of a multipart message. The MultiFile class makes each part of a multipart message "feel" like an ordinary file, as long as you use fp.readline(). Allows recursive use, for nested multipart messages. Probably best used together with module mimetools. Suggested use...
bsd-2-clause
kbdick/RecycleTracker
recyclecollector/scrap/gdata-2.0.18/samples/apps/marketplace_sample/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...
gpl-3.0
dunkhong/grr
grr/server/grr_response_server/gui/api_plugins/artifact_test.py
2
4766
#!/usr/bin/env python """This modules contains tests for artifact API handler.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import io import os from absl import app from grr_response_core import config from grr_response_core.lib.rdfvalues import ar...
apache-2.0
ngageoint/voxel-globe
voxel_globe/tiepoint_registration/views.py
2
2848
from django.shortcuts import render from django.http import HttpResponse from django.template import RequestContext, loader def tiepoint_registration_1(request): from voxel_globe.meta import models image_set_list = models.ImageSet.objects.all() return render(request, 'tiepoint_registration/html/tiepoint_registra...
mit
freeflightsim/fg-flying-club
google_appengine/lib/webob/tests/test_response.py
32
1407
from webob import * def simple_app(environ, start_response): start_response('200 OK', [ ('Content-Type', 'text/html; charset=utf8'), ]) return ['OK'] def test_response(): req = Request.blank('/') res = req.get_response(simple_app) assert res.status == '200 OK' assert res.status...
gpl-2.0
wreckJ/intellij-community
python/helpers/pydev/pydevd_console.py
42
7593
'''An helper file for the pydev debugger (REPL) console ''' from code import InteractiveConsole import sys import traceback import _pydev_completer from pydevd_tracing import GetExceptionTracebackStr from pydevd_vars import makeValidXmlValue from pydev_imports import Exec from pydevd_io import IOBuf from pydev_console...
apache-2.0
aringh/odl
odl/contrib/solvers/spdhg/misc.py
1
22813
# Copyright 2014-2018 The ODL contributors # # This file is part of ODL. # # 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 https://mozilla.org/MPL/2.0/. """Functions for folders and files.""" from...
mpl-2.0