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
Peddle/hue
apps/sqoop/src/sqoop/urls.py
33
2308
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
fangxingli/hue
desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/management/commands/openid_cleanup.py
45
1691
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2009-2013 Canonical Ltd. # # 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 ...
apache-2.0
Vishluck/sympy
sympy/simplify/tests/test_cse.py
47
12493
import itertools from sympy import (Add, Pow, Symbol, exp, sqrt, symbols, sympify, cse, Matrix, S, cos, sin, Eq, Function, Tuple, RootOf, IndexedBase, Idx, Piecewise, O) from sympy.simplify.cse_opts import sub_pre, sub_post from sympy.functions.special.hyper import meijerg from sy...
bsd-3-clause
ritchyteam/odoo
openerp/addons/test_workflow/tests/test_workflow.py
392
6232
# -*- coding: utf-8 -*- import openerp from openerp import SUPERUSER_ID from openerp.tests import common class test_workflows(common.TransactionCase): def check_activities(self, model_name, i, names): """ Check that the record i has workitems in the given activity names. """ instance = se...
agpl-3.0
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/idlelib/rpc.py
9
20150
"""RPC Implementation, originally written for the Python Idle IDE For security reasons, GvR requested that Idle's Python execution server process connect to the Idle process, which listens for the connection. Since Idle has only one client per server, this was not a limitation. +---------------------------------+...
bsd-3-clause
gemalto/pycryptoki
pycryptoki/cryptoki/ck_defs.py
1
25581
""" Structure & PKCS11-specific definitions. """ from ctypes import CFUNCTYPE, Structure from pycryptoki.cryptoki.c_defs import * from pycryptoki.cryptoki.helpers import struct_def # values for unnamed enumeration CK_MECHANISM_TYPE = CK_ULONG CK_MECHANISM_TYPE_PTR = POINTER(CK_MECHANISM_TYPE) CK_USER_TYPE = CK_ULON...
apache-2.0
zx8/youtube-dl
youtube_dl/extractor/comedycentral.py
92
12008
from __future__ import unicode_literals import re from .mtv import MTVServicesInfoExtractor from ..compat import ( compat_str, compat_urllib_parse, ) from ..utils import ( ExtractorError, float_or_none, unified_strdate, ) class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = r'''(?x)...
unlicense
ArcherSys/ArcherSys
Lib/test/test_strptime.py
1
79523
<<<<<<< HEAD <<<<<<< HEAD """PyUnit testing against strptime""" import unittest import time import locale import re import sys from test import support from datetime import date as datetime_date import _strptime class getlang_Tests(unittest.TestCase): """Test _getlang""" def test_basic(self): self.as...
mit
cython-testbed/pandas
pandas/tests/test_downstream.py
4
3443
# -*- coding: utf-8 -*- """ Testing that we work in the downstream packages """ import subprocess import sys import pytest import numpy as np # noqa from pandas import DataFrame from pandas.compat import PY36 from pandas.util import testing as tm import importlib def import_module(name): # we *only* want to ski...
bsd-3-clause
chatchavan/pcl
doc/tutorials/content/conf.py
66
4604
# All configuration values have a default; values that are commented out # serve to show the default. import sys, os # -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext...
bsd-3-clause
goldshtn/windbg-extensions
heap_stat.py
1
4876
from pykd import * import re import sys import pickle # TODO list: # 1) better parameter parsing and validation # 2) cleaner printing code stats_only = False save_info = False short_output = False pointer_size = ptrSize() pointer_format = "%016x" if pointer_size == 8 else "%08x" if '-stat' in sys.argv: stats_only ...
apache-2.0
parinporecha/backend_gtgonline
GTG/tests/test_backend_tomboy.py
1
15680
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
avlach/univbris-ocf
optin_manager/src/python/scripts/setup_ch.py
2
3214
''' Created on Jul 19, 2010 @author: jnaous ''' from django.core.urlresolvers import reverse from django.test import Client from expedient.common.tests.client import test_get_and_post_form from django.contrib.auth.models import User from pyquery import PyQuery as pq from openflow.plugin.models import OpenFlowInterface...
bsd-3-clause
julien78910/CouchPotatoServer
libs/apscheduler/jobstores/redis_store.py
98
2815
""" Stores jobs in a Redis database. """ from uuid import uuid4 from datetime import datetime import logging from apscheduler.jobstores.base import JobStore from apscheduler.job import Job try: import cPickle as pickle except ImportError: # pragma: nocover import pickle try: from redis import StrictRedi...
gpl-3.0
hello-base/web
apps/events/models.py
1
5284
# -*- coding: utf-8 -*- from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models from model_utils import Choices from apps.accounts.models import ContributorMixin from apps.people.models import ParticipationMixin class Event(ContributorMixin, Parti...
apache-2.0
ohsu-computational-biology/common-workflow-language
draft-3/salad/schema_salad/makedoc.py
10
15362
import mistune import schema import json import yaml import os import copy import re import sys import StringIO import logging import urlparse from aslist import aslist import re import argparse _logger = logging.getLogger("salad") def has_types(items): r = [] if isinstance(items, dict): if items["typ...
apache-2.0
nwjs/chromium.src
mojo/public/tools/bindings/pylib/mojom/parse/lexer.py
2
6258
# 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 imp import os.path import sys def _GetDirAbove(dirname): """Returns the directory "above" this file containing |dirname| (which must also be "abo...
bsd-3-clause
dlazz/ansible
lib/ansible/modules/network/ios/ios_linkagg.py
57
9433
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
adamklawonn/CityCircles
citycircles_iphone/build_back2/iphoneDistribution-iphoneos/CityCircles.app/pntsandrects.py
17
6225
"""Point and Rectangle classes. This code is in the public domain. Point -- point with (x,y) coordinates Rect -- two points, forming a rectangle """ import math class Point: """A point identified by (x,y) coordinates. supports: +, -, *, /, str, repr length -- calculate length of vecto...
gpl-3.0
rosjat/python-scsi
pyscsi/pyscsi/scsi_enum_command.py
1
23775
# coding: utf-8 # Copyright (C) 2014 by Ronnie Sahlberg<ronniesahlberg@gmail.com> # Copyright (C) 2015 by Markus Rosjat<markus.rosjat@gmail.com> # SPDX-FileCopyrightText: 2014 The python-scsi Authors # # SPDX-License-Identifier: LGPL-2.1-or-later from pyscsi.pyscsi.scsi_opcode import OpCode from pyscsi.utils.enum imp...
lgpl-2.1
forrestv/myhdl
myhdl/test/conversion/toVerilog/test_inc.py
3
5163
import os path = os.path import unittest from unittest import TestCase import random from random import randrange random.seed(2) from myhdl import * from util import setupCosimulation ACTIVE_LOW, INACTIVE_HIGH = 0, 1 def incRef(count, enable, clock, reset, n): """ Incrementer with enable. count -- outp...
lgpl-2.1
grap/OpenUpgrade
setup/package.py
180
22070
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
miptliot/edx-platform
openedx/core/djangoapps/ccxcon/tasks.py
19
1672
""" This file contains celery tasks for ccxcon """ from celery.task import task # pylint: disable=no-name-in-module, import-error from celery.utils.log import get_task_logger # pylint: disable=no-name-in-module, import-error from opaque_keys.edx.keys import CourseKey from requests.exceptions import ConnectionError, ...
agpl-3.0
neharejanjeva/techstitution
venv/lib/python2.7/site-packages/flask/testsuite/reqctx.py
557
5960
# -*- coding: utf-8 -*- """ flask.testsuite.reqctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the request context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest try: from greenlet import greenlet except ImportError: greenlet = None...
cc0-1.0
lichia/luigi
luigi/contrib/hdfs/__init__.py
12
3160
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
ubiar/odoo
addons/note/tests/__init__.py
260
1076
# -*- 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
mathgl67/pymmr
tests/file.py
1
4005
#!/usr/bin/env python # vi:ai:et:ts=4 sw=4 # # -*- coding: utf8 -*- # # PyMmr My Music Renamer # Copyright (C) 2007-2010 mathgl67@gmail.com # # 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 Foundatio...
gpl-2.0
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_int_literal.py
138
9128
"""Test correct treatment of hex/oct constants. This is complex because of changes due to PEP 237. """ import unittest from test import test_support class TestHexOctBin(unittest.TestCase): def test_hex_baseline(self): # A few upper/lowercase tests self.assertEqual(0x0, 0X0) self.assertE...
mit
jkkummerfeld/1ec-graph-parser
properties/count_unique_dev_spines.py
1
2799
#!/usr/bin/env python3 from __future__ import print_function import argparse import string import sys def read(filename): sent = [] spines = [] for line in open(filename): line = line.strip() if line.startswith("# Sentence"): spines.append([]) sent = line.strip().s...
isc
ABaldwinHunter/django-clone-classic
tests/template_tests/test_logging.py
117
4628
from __future__ import unicode_literals import logging from django.template import Context, Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase class TestHandler(logging.Handler): def __init__(self): super(TestHandler, self).__init__() self.log_record = None def em...
bsd-3-clause
BeyondTheClouds/nova
nova/api/openstack/compute/cells.py
9
12036
# Copyright 2011-2012 OpenStack Foundation # 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/lic...
apache-2.0
tkremenek/swift
utils/build_swift/tests/build_swift/test_driver_arguments.py
5
24206
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
apache-2.0
googlecodelabs/nest-tensorflow
wwn/access_token.py
1
1354
#!/usr/bin/python # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
RomanKharin/lrmq
test/async_agent_socket.py
1
3459
# -*- coding: utf8 -*- # Low-resource message queue framework # Access hub with tcp socket # Copyright (c) 2016 Roman Kharin <romiq.kh@gmail.com> # 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 Soft...
mit
ChromiumWebApps/chromium
base/android/jni_generator/jni_generator.py
1
48419
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
bsd-3-clause
yvaucher/purchase-workflow
__unported__/purchase_group_orders/purchase_group_orders.py
4
9678
# -*- coding: utf-8 -*- ############################################################################## # # Author: Alexandre Fayolle # Copyright 2012 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 # p...
agpl-3.0
glwu/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_install_data.py
147
2603
"""Tests for distutils.command.install_data.""" import sys import os import unittest import getpass from distutils.command.install_data import install_data from distutils.tests import support from test.support import run_unittest class InstallDataTestCase(support.TempdirManager, support.Logg...
apache-2.0
yugangw-msft/azure-cli
src/azure-cli-core/azure/cli/core/extension/tests/latest/test_extension_commands.py
2
24452
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
openstack/taskflow
taskflow/examples/resume_many_flows/run_flow.py
7
1433
# -*- coding: utf-8 -*- # Copyright (C) 2013 Yahoo! 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...
apache-2.0
jehine-MSFT/azure-storage-python
tests/blob_performance.py
4
5539
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
apache-2.0
MeirKriheli/Open-Knesset
mks/urls.py
14
2520
from django.conf import settings from django.conf.urls import url, patterns from . import views as mkv from feeds import MemberActivityFeed mksurlpatterns = patterns('mks.views', url(r'^parties-members/$', mkv.PartiesMembersRedirctView.as_view(), name='parties-members-index'), url(r'^parties-members/(?P<pk>\d+...
bsd-3-clause
Froggiewalker/geonode
geonode/base/enumerations.py
15
13719
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 versio...
gpl-3.0
moio/spacewalk
client/solaris/smartpm/smart/transaction.py
3
61738
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
yewang15215/django
tests/m2m_through_regress/models.py
273
2771
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible # Forward declared intermediate model @python_2_unicode_compatible class Membership(models.Model): person = models.ForeignKey('Person', mo...
bsd-3-clause
danstoner/python_experiments
pgu/pgu/gui/menus.py
13
3333
""" """ from .const import * from . import table from . import basic, button class _Menu_Options(table.Table): def __init__(self,menu,**params): table.Table.__init__(self,**params) self.menu = menu def event(self,e): handled = False arect = self.get_abs_rect() ...
gpl-2.0
jeffery9/mixprint_addons
account_check_writing/__openerp__.py
58
1721
# -*- 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
jolyonb/edx-platform
openedx/core/djangoapps/credentials/signals.py
1
6466
""" This file contains signal handlers for credentials-related functionality. """ from logging import getLogger from course_modes.models import CourseMode from django.contrib.sites.models import Site from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate from lms.djangoapps.grades.api...
agpl-3.0
mcalhoun/ansible-modules-core
cloud/openstack/quantum_router_interface.py
99
8558
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
gpl-3.0
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/editor/ModuleBrowser.py
17
7082
# ModuleBrowser.py - A view that provides a module browser for an editor document. import pywin.mfc.docview import win32ui import win32con import commctrl import win32api from pywin.tools import hierlist, browser import pywin.framework.scriptutils import afxres import pyclbr class HierListCLBRModule(hierlist.HierList...
apache-2.0
utamaro/youtube-dl
youtube_dl/extractor/tv2.py
113
4640
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, float_or_none, parse_iso8601, remove_end, ) class TV2IE(InfoExtractor): _VALID_URL = 'http://(?:www\.)?tv2\.no/v/(?P<id>\d+)' _TEST = { ...
unlicense
simsong/grr-insider
lib/objectfilter.py
2
26902
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """Classes to perform filtering of objects based on their data members. Given a list of objects and a textual filter expression, these classes allow you to determine which objects match the filter. The system has two main pieces: A parser for the...
apache-2.0
synologix/enigma2
lib/python/Tools/Notifications.py
66
1963
notifications = [ ] notificationAdded = [ ] # notifications which are currently on screen (and might be closed by similiar notifications) current_notifications = [ ] def __AddNotification(fnc, screen, id, *args, **kwargs): if ".MessageBox'>" in `screen`: kwargs["simple"] = True notifications.append((fnc, screen,...
gpl-2.0
BMan-L/shadowsocks
tests/nose_plugin.py
1072
1164
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
slint/zenodo
zenodo/modules/exporter/__init__.py
2
1189
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2018 CERN. # # Zenodo is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later v...
gpl-2.0
flos-club/eekk
libmat2/abstract.py
1
1460
import abc import os import re from typing import Set, Dict, Union assert Set # make pyflakes happy class AbstractParser(abc.ABC): """ This is the base class of every parser. It might yield `ValueError` on instantiation on invalid files, and `RuntimeError` when something went wrong in `remove_all`. ...
gpl-3.0
aragos/tichu-tournament
api/src/welcome_handler.py
1
3909
import webapp2 import json from generic_handler import GenericHandler from google.appengine.api import mail from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.api.app_identity import get_application_id from handler_utils import CheckUserOwnsTournamentAndMaybeReturnStatus ...
mit
PHOTOX/fuase
ase/ase/tasks/io.py
9
1499
import numpy as np from ase.parallel import world try: import json except ImportError: json = None if json is None: def dumps(obj): if isinstance(obj, str): return '"' + obj + '"' if isinstance(obj, (int, float)): return repr(obj) if isinstance(obj, dict):...
gpl-2.0
luser/socorro
socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py
3
17117
import os import shutil from mock import Mock from configman import ConfigurationManager from nose.tools import eq_, ok_, assert_raises from socorro.external.fs.crashstorage import ( FSLegacyDatedRadixTreeStorage, FSTemporaryStorage ) from socorro.external.crashstorage_base import ( CrashIDNotFound, Me...
mpl-2.0
ianan/demreg
python/dem_reg_map.py
1
1067
import numpy as np def dem_reg_map(sigmaa,sigmab,U,W,data,err,reg_tweak,nmu=500): """ dem_reg_map computes the regularisation parameter Inputs sigmaa: gsv vector sigmab: gsv vector U: gsvd matrix V: gsvd matrix data: dn ...
gpl-2.0
guorendong/iridium-browser-ubuntu
third_party/webpagereplay/third_party/dns/resolver.py
215
28920
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
bsd-3-clause
ezequielpereira/Time-Line
autopilot/autopilotlib/instructions/selectmenu.py
2
3493
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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...
gpl-3.0
xbmc/atv2
xbmc/lib/libPython/Python/Tools/scripts/combinerefs.py
102
4381
#! /usr/bin/env python """ combinerefs path A helper for analyzing PYTHONDUMPREFS output. When the PYTHONDUMPREFS envar is set in a debug build, at Python shutdown time Py_Finalize() prints the list of all live objects twice: first it prints the repr() of each object while the interpreter is still fully intact. Aft...
gpl-2.0
matthew-tucker/mne-python
examples/inverse/plot_read_inverse.py
42
1384
""" =========================== Reading an inverse operator =========================== The inverse operator's source space is shown in 3D. """ # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) from mne.datasets import sample from mne.minimum_norm import read_inverse_o...
bsd-3-clause
swapnakrishnan2k/tp-qemu
qemu/tests/nx.py
9
2652
import os import logging from autotest.client.shared import error from virttest import data_dir @error.context_aware def run(test, params, env): """ try to exploit the guest to test whether nx(cpu) bit takes effect. 1) boot the guest 2) cp the exploit prog into the guest 3) run the exploit ...
gpl-2.0
juanmont/one
.vscode/extensions/tht13.rst-vscode-2.0.0/src/python/docutils/transforms/frontmatter.py
9
19456
# $Id: frontmatter.py 7897 2015-05-29 11:48:20Z milde $ # Author: David Goodger, Ueli Schlaepfer <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Transforms related to the front matter of a document or a section (information found before the main text): - `DocTitle`: Used to tra...
apache-2.0
fnp/pylucene
test/test_BooleanPrefixQuery.py
1
2671
# ==================================================================== # 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 re...
apache-2.0
cython-testbed/pandas
pandas/tests/extension/base/dtype.py
2
2874
import warnings import numpy as np import pandas as pd from .base import BaseExtensionTests class BaseDtypeTests(BaseExtensionTests): """Base class for ExtensionDtype classes""" def test_name(self, dtype): assert isinstance(dtype.name, str) def test_kind(self, dtype): valid = set('biuf...
bsd-3-clause
andreparames/odoo
addons/website_membership/models/product.py
338
1264
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
jylaxp/django
django/db/migrations/operations/models.py
290
21735
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property cl...
bsd-3-clause
zanderle/django
tests/template_tests/syntax_tests/test_filter_tag.py
521
1795
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class FilterTagTests(SimpleTestCase): @setup({'filter01': '{% filter upper %}{% endfilter %}'}) def test_filter01(self): output = self.engine.render_to_string('filter01') self.ass...
bsd-3-clause
jamesmarva/docker-py
docker/errors.py
39
2469
# Copyright 2014 dotCloud 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 agre...
apache-2.0
Zanzibar82/script.module.urlresolver
lib/urlresolver/plugins/vidstream.py
4
2431
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 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-2.0
varunnaganathan/django
django/utils/dateformat.py
110
11592
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
bsd-3-clause
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/find_files_unittest.py
3
2675
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
gpl-2.0
coecms/CMIP5-utils
fetch_step2.py
1
17182
# Paola Petrelli - paolap@utas.edu.au 4th March 2014 # Last changed on 26th of March 2014 # Updates list: # 26/03/2014 - output files and table csv file are created after # collecting data; calling process_file with multiprocessing # module to speed up hash checksum (md5/sha256) # 0...
apache-2.0
Dexhub/MTX
src/mem/slicc/ast/OutPortDeclAST.py
92
2802
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
geomapdev/idea-box
src/idea/tests/editidea_tests.py
5
6582
from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import TestCase from idea import models, views from idea.forms import IdeaForm, PrivateIdeaForm from idea.tests.utils import mock_req, random_user, login, create_superuser from datetime import date from mock imp...
cc0-1.0
boyuegame/kbengine
kbe/res/scripts/common/Lib/test/test_bz2.py
72
32972
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO import os import pickle import random import subprocess import sys from test.support import unlink try: import threading except ImportError: threading = None # Skip tests if the bz2 module doesn't exist. ...
lgpl-3.0
chylli/phantomjs
src/qt/qtwebkit/Source/WebCore/inspector/compile-front-end.py
116
15388
#!/usr/bin/env python # Copyright (c) 2012 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 ...
bsd-3-clause
lxml/lxml
src/lxml/tests/test_relaxng.py
1
8434
# -*- coding: utf-8 -*- """ Test cases related to RelaxNG parsing and validation """ from __future__ import absolute_import import unittest from .common_imports import ( etree, BytesIO, _bytes, HelperTestCase, fileInTestDir, make_doctest, skipif ) try: import rnc2rng except ImportError: rnc2rng = None ...
bsd-3-clause
robertwb/incubator-beam
sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query1.py
5
1608
# # 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 us...
apache-2.0
jiaweizhou/kubernetes
cluster/juju/charms/trusty/kubernetes-master/hooks/kubernetes_installer.py
213
4138
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
loopCM/chromium
media/tools/constrained_network_server/cn.py
186
4311
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A script for configuring constraint networks. Sets up a constrained network configuration on a specific port. Traffic on this p...
bsd-3-clause
muntasirsyed/intellij-community
plugins/hg4idea/testData/bin/hgext/largefiles/wirestore.py
97
1336
# Copyright 2010-2011 Fog Creek Software # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''largefile store working over Mercurial's wire protocol''' import lfutil import remotestore class wirestore(remotestore.remotestore): ...
apache-2.0
komsas/OpenUpgrade
addons/crm/wizard/crm_phonecall_to_phonecall.py
40
4562
# -*- 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
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/django/contrib/flatpages/tests/views.py
77
6226
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.test import TestCase class FlatpageViewTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): ...
mit
turbokongen/home-assistant
tests/components/nx584/test_binary_sensor.py
6
7175
"""The tests for the nx584 sensor platform.""" from unittest import mock from nx584 import client as nx584_client import pytest import requests from homeassistant.components.nx584 import binary_sensor as nx584 from homeassistant.setup import async_setup_component class StopMe(Exception): """Stop helper.""" @p...
apache-2.0
GabrielNicolasAvellaneda/chemlab
chemlab/db/toxnetdb.py
6
2107
'''Database for toxnet''' from .base import AbstractDB, EntryNotFound # Python 2-3 compatibility try: from urllib.parse import quote_plus from urllib.request import urlopen except ImportError: from urllib import quote_plus from urllib2 import urlopen import re class ToxNetDB(AbstractDB): def __in...
gpl-3.0
akozumpl/dnf
tests/test_commands.py
1
39804
# Copyright (C) 2012-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will...
gpl-2.0
jrief/easy-thumbnails
easy_thumbnails/tests/fields.py
2
3792
import os from django.core.files.base import ContentFile from django.db import models from easy_thumbnails import test from easy_thumbnails.fields import ThumbnailerField, ThumbnailerImageField from easy_thumbnails.exceptions import InvalidImageFormatError class TestModel(models.Model): avatar = ThumbnailerFiel...
bsd-3-clause
watson-developer-cloud/discovery-starter-kit
server/python/server.py
1
4953
import os import sys import json from helpers import get_constants, get_questions from flask import Flask, jsonify, render_template, request from flask_sslify import SSLify from flask_cors import CORS from flask_limiter import Limiter from flask_limiter.util import get_remote_address from requests.exceptions import HTT...
mit
jordanemedlock/psychtruths
temboo/Library/Microsoft/OAuth/RefreshToken.py
4
4495
# -*- coding: utf-8 -*- ############################################################################### # # RefreshToken # Retrieves a new refresh token and access token by exchanging the refresh token that is associated with the expired access token. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. #...
apache-2.0
huahbo/src
book/Recipes/m1d.py
5
10916
from rsf.proj import * from decimal import * # --- User set --- # # model model = { 'X' : 2000, # meter 'dx': 10.0, 'dt': 0.001, 'SelT': 0.25, # selected time for snapshot show 'snpintvl': 1.0, # nterval of snapshot output 'size' : 8, # FD order 'frqcut' : 1.0, 'pm...
gpl-2.0
stewartsmith/bzr
bzrlib/tests/http_utils.py
2
20784
# Copyright (C) 2005-2011 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribute...
gpl-2.0
radicalbit/ambari
ambari-common/src/main/python/ambari_commons/get_ambari_version.py
3
1589
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
apache-2.0
abomyi/django
tests/shortcuts/views.py
87
2274
from django.shortcuts import render, render_to_response from django.template import RequestContext def render_to_response_view(request): return render_to_response('shortcuts/render_test.html', { 'foo': 'FOO', 'bar': 'BAR', }) def render_to_response_view_with_multiple_templates(request): ...
bsd-3-clause
wisechengyi/pants
tests/python/pants_test/repo_scripts/test_git_hooks.py
2
8029
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import datetime import os import shutil import subprocess import unittest from contextlib import contextmanager from pathlib import Path from textwrap import dedent from typing import Opti...
apache-2.0
apbard/scipy
scipy/sparse/linalg/dsolve/tests/test_linsolve.py
1
24049
from __future__ import division, print_function, absolute_import import threading import numpy as np from numpy import array, finfo, arange, eye, all, unique, ones, dot, matrix import numpy.random as random from numpy.testing import ( assert_array_almost_equal, assert_raises, assert_almost_equal, asse...
bsd-3-clause
microcom/odoo
addons/survey/wizard/survey_email_compose_message.py
29
10120
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv from openerp.osv import fields from openerp.tools.translate import _ from datetime import datetime from openerp.exceptions import UserError import re import uuid import urlparse emails_split...
agpl-3.0
freephys/python_ase
ase/transport/calculators.py
2
11688
import numpy as np from numpy import linalg from ase.transport.selfenergy import LeadSelfEnergy, BoxProbe from ase.transport.greenfunction import GreenFunction from ase.transport.tools import subdiagonalize, cutcoupling, tri2full, dagger class TransportCalculator: """Determine transport properties of device sand...
gpl-3.0