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
hhuang05/ardupilot
Tools/autotest/param_metadata/xmlemit.py
23
3194
#!/usr/bin/env python from xml.sax.saxutils import escape, quoteattr from emit import Emit from param import known_param_fields, known_units # Emit APM documentation in an machine readable XML format class XmlEmit(Emit): def __init__(self): Emit.__init__(self) wiki_fname = 'apm.pdef.xml' ...
gpl-3.0
aj700/nxzimg
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
wasade/picrust
scripts/parallel_predict_traits.py
1
9826
#!/usr/bin/env python from __future__ import division __author__ = "Morgan Langille" __copyright__ = "Copyright 2011-2013, The PICRUSt Project" __credits__ = ["Morgan Langille"] __license__ = "GPL" __version__ = "1.0.0-dev" __maintainer__ = "Morgan Langille" __email__ = "morgan.g.i.langille@gmail.com" __status__ = "De...
gpl-3.0
ceph/graphite-web
webapp/graphite/whitelist/views.py
5
1960
"""Copyright 2008 Orbitz WorldWide 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
jmesteve/saas3
openerp/addons_extra/ibeacon/pexpect-3.2/tests/PexpectTestCase.py
2
1633
''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WITHOUT FEE IS HEREBY GR...
agpl-3.0
wangqingbaidu/aliMusic
gen_X_features/user_and_artist_features.py
1
1245
# -*- coding: UTF-8 -*- ''' Authorized by vlon Jang Created on May 30, 2016 Email:zhangzhiwei@ict.ac.cn From Institute of Computing Technology All Rights Reserved. ''' import datetime featueName = 'and_artist_features' from utils.combineTables import gen as gen_u_a_f def gen(table_name = None): as...
gpl-3.0
saradbowman/osf.io
api_tests/providers/preprints/views/test_preprint_provider_list.py
13
3037
import mock import pytest from waffle.testutils import override_switch from osf import features from api.base.settings.defaults import API_BASE from osf_tests.factories import ( AuthUserFactory, PreprintProviderFactory, ) @pytest.fixture(params=['/{}preprint_providers/?version=2.2&', '/{}providers/preprints/?...
apache-2.0
tboyce021/home-assistant
homeassistant/components/lutron/binary_sensor.py
9
1783
"""Support for Lutron Powr Savr occupancy sensors.""" from pylutron import OccupancyGroup from homeassistant.components.binary_sensor import ( DEVICE_CLASS_OCCUPANCY, BinarySensorEntity, ) from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice def setup_platform(hass, config, add_entities, discovery_...
apache-2.0
heroku/sf-suds
suds/transport/options.py
200
2211
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
LabKey/argos_nlp
make_text_output_directory.py
3
1864
'''author@esilgard''' # # Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center # # Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 # __version__ = 'output_text1.0' import os, shutil, sys import global_strings as gb def main(input_file): ''' output text...
apache-2.0
JioCloud/neutron
neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py
20
12887
# Copyright (c) 2014 Cisco Systems 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 re...
apache-2.0
QianBIG/odoo
openerp/service/model.py
62
8421
# -*- coding: utf-8 -*- from functools import wraps import logging from psycopg2 import IntegrityError, OperationalError, errorcodes import random import threading import time import openerp from openerp.tools.translate import translate from openerp.osv.orm import except_orm from contextlib import contextmanager imp...
agpl-3.0
shizunge/leetcode_python
algorithms/python/207_course schedule_DFS.py
1
1240
# http://www.tangjikai.com/algorithms/leetcode-207-208-course-schedule-i-ii # If node v has not been visited, then mark it as 0. # If node v is being visited, then mark it as -1. If we find a vertex marked as -1 in DFS, then there is a cycle. # If node v has been visited, then mark it as 1. If a vertex was marked as...
gpl-2.0
xodus7/tensorflow
tensorflow/python/ops/distributions/identity_bijector.py
18
1814
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Ballz0fSteel/Umeko
lib/youtube_dl/extractor/musicplayon.py
60
2310
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, js_to_json, mimetype2ext, ) class MusicPlayOnIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl...
gpl-3.0
Dave667/service
script.module.brightcove/tests/test_objects.py
3
1194
#from unittest import TestCase #from brightcove.objects import Video, item_collection_factory #TOKEN = 'cE97ArV7TzqBzkmeRVVhJ8O6GWME2iG_bRvjBTlNb4o.' #class TestBrightcove(TestCase): #def test_init(self): #b = Brightcove(TOKEN) #self.assertEqual(b.token, TOKEN) #class TestVideoApis(TestCase): ...
gpl-2.0
amarack/python-rl
scripts/spearmint_config.py
2
2209
# Author: Will Dabney #import csv, os, json, numpy, copy import numpy, sys sys.path.append("..") from pyrl.misc.parameter import * def gen_numeric_pbvar(name, size, type, min, max): config = ["variable {", ' name: "' + name + '"'] if type is int: config.append(" type: INT") else: config.a...
gpl-3.0
jacquerie/inspire-next
inspirehep/modules/crossref/ext.py
5
1517
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
Rudloff/youtube-dl
youtube_dl/extractor/streetvoice.py
23
1614
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import unified_strdate class StreetVoiceIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)' _TESTS = [{ 'url': 'http://s...
unlicense
tongwang01/tensorflow
tensorflow/python/framework/registry.py
166
3085
# 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
Perferom/android_kernel_samsung_msm
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
pombredanne/pants
src/python/pants/backend/jvm/register.py
2
10289
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.j...
apache-2.0
Venturi/cms
env/lib/python2.7/site-packages/cms/south_migrations/0001_initial.py
48
30500
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
gpl-2.0
kouk/boto
tests/integration/sqs/test_connection.py
77
10863
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without res...
mit
NukeAOSP/external_chromium
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/smtp.py
884
1680
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/libpasteurize/fixes/fix_raise_.py
70
1225
u"""Fixer for raise E(V).with_traceback(T) to: from future.utils import raise_ ... raise_(E, V, T) TODO: FIXME!! """ from lib2to3 import fixer_base from lib2to3.fixer_util import Comma, Node, Leaf, token, syms class FixRaise(fixer_base.BaseFix): PATTE...
gpl-3.0
tscohen/chainer
tests/chainer_tests/functions_tests/evaluation_tests/test_accuracy.py
19
1253
import unittest import numpy import six import chainer from chainer import cuda from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class TestAccuracy(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(-1,...
mit
bavardage/statsmodels
statsmodels/distributions/tests/test_ecdf.py
34
1640
import numpy as np import numpy.testing as npt from statsmodels.distributions import StepFunction, monotone_fn_inverter class TestDistributions(npt.TestCase): def test_StepFunction(self): x = np.arange(20) y = np.arange(20) f = StepFunction(x, y) npt.assert_almost_equal(f( np.array...
bsd-3-clause
HPAC/ELAPS
elaps/report.py
2
12257
"""Result for an ELAPS:Experiment.""" from __future__ import division from math import sqrt from collections import Iterable from copy import deepcopy from elaps import signature from elaps.experiment import Experiment stat_funs = { "min": min, "med": lambda l: (sum(sorted(l)[((len(l) - 1) // 2):(len(l) // ...
bsd-3-clause
wang1352083/pythontool
python-2.7.12-lib/test/test_compiler.py
112
11233
import test.test_support compiler = test.test_support.import_module('compiler', deprecated=True) from compiler.ast import flatten import os, sys, time, unittest from random import random from StringIO import StringIO # How much time in seconds can pass before we print a 'Still working' message. _PRINT_WORKING_MSG_INTE...
mit
PircK/six
racunalnik.py
1
2002
import threading # za vzporedno izvajanje import logging from alfabeta import * ###################################################################### ## Igralec računalnik class Racunalnik(): def __init__(self, gui, algoritem): self.gui = gui self.algoritem = algoritem # Algoritem, ki izračuna ...
mit
googleinterns/learnbase
learnbase/src/main/webapp/WEB-INF/Lib/distutils/command/upload.py
60
7045
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" import os import socket import platform from urllib2 import urlopen, Request, HTTPError from base64 import standard_b64encode import urlparse import cStringIO as StringIO from hashlib import md5 from distutils.errors...
apache-2.0
hynekcer/django
django/contrib/admin/helpers.py
79
14890
from __future__ import unicode_literals import warnings from django import forms from django.conf import settings from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field,...
bsd-3-clause
ThinkOpen-Solutions/odoo
openerp/addons/test_workflow/models.py
337
2268
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
agpl-3.0
jakirkham/ilastik
bin/downsample_pointcloud.py
3
17044
import sys import os import csv import numpy import logging logger = logging.getLogger(__name__) # NOTE: This file depends on numpy.add.at(), which requires numpy v1.8.0 def downsample_pointcloud( pointcloud_csv_filepath, output_filepath, scale_xyz=None, ...
gpl-3.0
detrout/debian-statsmodels
statsmodels/iolib/summary2.py
8
19601
from statsmodels.compat.python import (lrange, iterkeys, iteritems, lzip, reduce, itervalues, zip, string_types, range) from statsmodels.compat.collections import OrderedDict import numpy as np import pandas as pd import datetime import textw...
bsd-3-clause
janssen/kivy
kivy/uix/scrollview.py
7
42110
''' ScrollView ========== .. versionadded:: 1.0.4 The :class:`ScrollView` widget provides a scrollable/pannable viewport that is clipped at the scrollview's bounding box. Scrolling Behavior ------------------ The ScrollView accepts only one child and applies a viewport/window to it according to the :attr:`~ScrollV...
mit
mfherbst/spack
var/spack/repos/builtin/packages/py-python-gitlab/package.py
5
1868
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Hiyorimi/scikit-image
doc/examples/features_detection/plot_brief.py
32
1879
""" ======================= BRIEF binary descriptor ======================= This example demonstrates the BRIEF binary description algorithm. The descriptor consists of relatively few bits and can be computed using a set of intensity difference tests. The short binary descriptor results in low memory footprint and ve...
bsd-3-clause
tmuelle2/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/postdiffforcommit.py
147
1879
# Copyright (C) 2010 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 th...
bsd-3-clause
doomsterinc/odoo
addons/mail/mail_followers.py
168
12482
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
frwickst/django-guardian
guardian/shortcuts.py
12
26841
""" Convenient shortcuts to manage or check object permissions. """ from __future__ import unicode_literals from django.contrib.auth.models import Group from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import...
bsd-2-clause
teran/bootloader-web
bootloader/servers/api/v1alpha2/views.py
1
1893
from rest_framework import viewsets from servers.models import Interface, Network, Label, Location, Server from servers.api.v1alpha2.serializers import InterfaceSerializer from servers.api.v1alpha2.serializers import LabelSerializer from servers.api.v1alpha2.serializers import LocationSerializer from servers.api.v1al...
gpl-2.0
streamlio/heron
heron/tools/ui/src/python/handlers/common/graph.py
11
3946
# Copyright 2016 Twitter. 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
labx-technologies-llc/mb-qemu-labx
scripts/tracetool/format/events_h.py
95
1183
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate .h for event description. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajn...
gpl-2.0
adrinjalali/Network-Classifier
Raccoon/core/raccoon.py
1
8312
import numpy as np import scipy.stats.stats import sklearn.svm import sklearn.base import sklearn.preprocessing import sklearn.grid_search from sklearn import cross_validation as cv from common import FCE class Raccoon: """ FCE_type in: {"RidgeBasedFCE", "PredictBasedFCE"} """ def __init__(self, verb...
gpl-3.0
wsricardo/mcestudos
reqdados2.py
1
1031
#!/usr/binpython3 # By: Wandeson Ricardo import sys import time import pprint import requests if len(sys.argv)>1: payload = {'idLegislatura':'55', 'pagina':str(sys.argv[1]), 'itens':'513','ordem':'asc'} else: print('Faltou numero da página') exit(1) header = {'content-type': 'application/json'} query = 'deputados...
gpl-3.0
tboudreaux/PHY-2002
General.py
1
2497
import platform import matplotlib as mpl import imp import math import numpy as np class PreChecks(object): @staticmethod def oscheck(): operatings = platform.system() print('Checking Operating System') if operatings == 'Windows': print('Program does not run on Windows mach...
lgpl-3.0
wkeyword/pip
tests/lib/git_submodule_helpers.py
58
2960
from __future__ import absolute_import import textwrap def _create_test_package_submodule(env): env.scratch_path.join("version_pkg_submodule").mkdir() submodule_path = env.scratch_path / 'version_pkg_submodule' env.run('touch', 'testfile', cwd=submodule_path) env.run('git', 'init', cwd=submodule_path...
mit
jessada/pyCMM
pycmm/proc/db/test/test_dbms.py
1
35636
# This Python file uses the following encoding: utf-8 import unittest import filecmp from os.path import join as join_path from pycmm.settings import FULL_SYSTEM_TEST from pycmm.settings import DB_TEST from pycmm.template import SafeTester from pycmm.utils import file_size from pycmm.proc.db.dbinput import AVDBReader f...
gpl-2.0
hfp/tensorflow-xsmm
tensorflow/python/data/experimental/kernel_tests/make_csv_dataset_test.py
5
22113
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
zmike/servo
etc/ci/chaos_monkey_test.py
140
1676
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
tensorflow/models
research/object_detection/builders/decoder_builder.py
1
3332
# Lint as: python2, python3 # Copyright 2020 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 # ...
apache-2.0
dnanexus/rseqc
rseqc/lib/bx/intervals/operations/merge.py
7
1478
""" Merge overlapping regions in two sets of genomic intervals. """ import psyco_full import traceback import fileinput from warnings import warn from bx.intervals.io import * from bx.intervals.operations import * # sorting could make this a less memory intensive operation(?) def merge( interval, mincols=1 ): #...
gpl-3.0
txomon/vdsm
tests/functional/supervdsmFuncTests.py
2
1360
# Copyright 2013 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in the ...
gpl-2.0
davidcusatis/horizon
openstack_dashboard/dashboards/project/volumes/backups/urls.py
65
1043
# 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 t...
apache-2.0
colonelnugget/pychess
lib/pychess/System/command.py
20
1903
#! /usr/bin/env python from __future__ import print_function import threading import subprocess import traceback import shlex from pychess.compat import basestring class Command(object): """ Enables to run subprocess commands in a different thread with TIMEOUT option. Based on jcollado's solution: h...
gpl-3.0
ghedsouza/django
tests/app_loading/tests.py
133
2998
import os from django.apps import apps from django.test import SimpleTestCase from django.test.utils import extend_sys_path class EggLoadingTest(SimpleTestCase): def setUp(self): self.egg_dir = '%s/eggs' % os.path.dirname(__file__) def tearDown(self): apps.clear_cache() def test_egg1(s...
bsd-3-clause
tobes/py3status
py3status/modules/player_control.py
2
5727
# -*- coding: utf-8 -*- """ Control Audacious or VLC media player. Provides an icon to control simple functions of audio/video players: - start (left click) - stop (left click) - pause (middle click) Configuration parameters: cache_timeout: how often to update in seconds (default 10) debug: enabl...
bsd-3-clause
nitzmahone/ansible
lib/ansible/modules/files/find.py
7
16054
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Ruggero Marchei <ruggero.marchei@daemonzone.net> # Copyright: (c) 2015, Brian Coca <bcoca@ansible.com> # Copyright: (c) 2016-2017, Konstantin Shalygin <k0ste@k0ste.ru> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING...
gpl-3.0
zzxuanyuan/root
main/python/rootmkdir.py
31
1220
#!/usr/bin/env @python@ # ROOT command line tools: rootmkdir # Author: Julien Ripoche # Mail: julien.ripoche@u-psud.fr # Date: 20/08/15 """Command line to add directories in ROOT files""" import cmdLineUtils import sys # Help strings COMMAND_HELP = "Add directories in ROOT files" PARENT_HELP = "make parent directo...
lgpl-2.1
jriehl/numba
numba/cuda/tests/cudapy/test_multiprocessing.py
2
1272
import os import multiprocessing as mp import numpy as np from numba import cuda from numba import unittest_support as unittest from numba.cuda.testing import skip_on_cudasim, SerialMixin has_mp_get_context = hasattr(mp, 'get_context') is_unix = os.name == 'posix' def fork_test(q): from numba.cuda.cudadrv.erro...
bsd-2-clause
krintoxi/NoobSec-Toolkit
NoobSecToolkit - MAC OSX/tools/inject/extra/mssqlsig/update.py
10
5123
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import os import re import urllib2 import urlparse from xml.dom.minidom import Document # Path to the XML file with signatures MSSQL_XML = os.path.abspath("../...
gpl-2.0
hagberg/nx3k
convert.py
1
14268
"""Functions to convert NetworkX graphs to and from other formats. The preferred way of converting data to a NetworkX graph is through the graph constuctor. The constructor calls the to_networkx_graph() function which attempts to guess the input type and convert it automatically. Examples -------- Create a graph wit...
bsd-3-clause
Maspear/odoo
addons/im_livechat/im_livechat.py
239
12432
# -*- 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
zlfben/gem5
src/dev/alpha/Tsunami.py
46
5344
# Copyright (c) 2005-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
napkindrawing/ansible
test/units/playbook/role/test_include_role.py
54
8862
# (c) 2016, Daniel Miranda <danielkza2@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 later v...
gpl-3.0
DoctorJellyface/powerline
powerline/renderer.py
19
20103
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import os import re from itertools import chain from powerline.theme import Theme from powerline.lib.unicode import unichr, strwidth_ucs_2, strwidth_ucs_4 NBSP = ' ' np_control_character_...
mit
sanderator/lab-o-matic
src/lab_o_matic/diagram.py
1
1429
''' module diagram.py Creates and displays a UML class diagram. @author: (c)2013-2015 Peter Sander ''' import os import shutil import subprocess from lab_o_matic import dot from lab_o_matic import doxygen from lab_o_matic import doxygen_config from lab_o_matic import doxygraph_home from lab_o_matic import okular fro...
gpl-2.0
andrewyoung1991/scons
test/explain/function-actions.py
4
3176
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
fiji-flo/servo
tests/wpt/web-platform-tests/webdriver/tests/sessions/new_session/invalid_capabilities.py
12
4145
#META: timeout=long import pytest from webdriver import error from conftest import product, flatten @pytest.mark.parametrize("value", [None, 1, "{}", []]) def test_invalid_capabilites(new_session, value): with pytest.raises(error.InvalidArgumentException): new_session({"capabilities": value}) @pytest....
mpl-2.0
pgmillon/ansible
lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py
3
12654
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
wyc/django
django/utils/translation/__init__.py
165
7180
""" Internationalization support. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.decorators import ContextDecorator from django.utils.encoding import force_text from django.utils.functional import lazy __all__ = [ 'activate', 'deactivate', 'override', 'deacti...
bsd-3-clause
reedloden/ansible
contrib/inventory/softlayer.py
150
6108
#!/usr/bin/env python """ SoftLayer external inventory script. The SoftLayer Python API client is required. Use `pip install softlayer` to install it. You have a few different options for configuring your username and api_key. You can pass environment variables (SL_USERNAME and SL_API_KEY). You can also write INI fil...
gpl-3.0
pombredanne/bokeh
bokeh/util/string.py
11
1425
""" Functions useful for string manipulations or encoding. """ from __future__ import absolute_import import re def encode_utf8(u): """ Encode a UTF-8 string to a sequence of bytes. Args: u (str) : the string to encode Returns: bytes """ import sys if sys.version_info[0] ==...
bsd-3-clause
landryb/QGIS
python/ext-libs/jinja2/testsuite/core_tags.py
412
11858
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
gpl-2.0
atyoung/synergy-osx
ext/gtest-1.6.0/test/gtest_shuffle_test.py
3023
12549
#!/usr/bin/env python # # Copyright 2009 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...
gpl-2.0
davandev/davanserver
davan/http/service/keypad/KeypadAliveService.py
1
5969
''' @author: davandev ''' import logging import os import urllib import urllib2 import traceback from datetime import datetime import davan.config.config_creator as configuration import davan.util.constants as constants import davan.util.helper_functions as helper from davan.http.service.reoccuring_base...
mit
dalejung/ibis
ibis/tasks.py
7
7836
# Copyright 2014 Cloudera 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, so...
apache-2.0
KendyllD/boukenda-project
makahiki/apps/managers/challenge_mgr/admin.py
9
11140
"""Implements the admin interface for game settings.""" from django.contrib import admin from django.db import models from django import forms from django.forms.util import ErrorList from django.forms.widgets import Textarea from apps.managers.challenge_mgr import challenge_mgr from apps.managers.challenge_mgr.models i...
mit
tsaarni/ssh-subprocess
ssh_subprocess.py
1
3859
# # Copyright 2015 tero.saarni@gmail.com # # 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
sethwoodworth/py3status
doc/example_module.py
10
3846
# -*- coding: utf-8 -*- # This is an example module to be used as a template. # See https://github.com/ultrabug/py3status/wiki/Write-your-own-modules # for more details. # # NOTE: py3status will NOT execute: # - methods starting with '_' # - methods decorated by @property and @staticmethod # # NOTE: reserved m...
bsd-3-clause
google/grumpy
testing/op_test.py
6
1996
# 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 a...
apache-2.0
vipulkanade/EventbriteDjango
lib/python2.7/site-packages/django/utils/http.py
115
10153
from __future__ import unicode_literals import base64 import calendar import datetime import re import sys import unicodedata from binascii import Error as BinasciiError from email.utils import formatdate from django.utils import six from django.utils.datastructures import MultiValueDict from django.utils.encoding im...
mit
ArcherCraftStore/ArcherVMPeridot
Python/Lib/ctypes/test/test_init.py
169
1039
from ctypes import * import unittest class X(Structure): _fields_ = [("a", c_int), ("b", c_int)] new_was_called = False def __new__(cls): result = super().__new__(cls) result.new_was_called = True return result def __init__(self): self.a = 9 sel...
apache-2.0
jenshnielsen/jenkins-job-builder
tests/cachestorage/test_cachestorage.py
20
1641
# # - Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
davidlt/openloops
scons-local/scons-local-2.3.0/SCons/Script/Main.py
11
51840
"""SCons.Script This file implements the main() function used by the scons script. Architecturally, this *is* the scons script, and will likely only be called from the external "scons" wrapper. Consequently, anything here should not be, or be considered, part of the build engine. If it's something that we expect ot...
gpl-3.0
SlimRemix/android_external_chromium_org
tools/idl_parser/idl_ppapi_lexer.py
44
2001
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Lexer for PPAPI IDL The lexer uses the PLY library to build a tokenizer which understands both WebIDL and Pepper tokens. WebI...
bsd-3-clause
fiber-space/pip
tests/scripts/test_all_pip.py
5
3780
import os import re import sys import subprocess from os.path import dirname, abspath from pip._vendor.six.moves.urllib import request as urllib_request from pip.utils import rmtree src_folder = dirname(dirname(abspath(__file__))) if sys.platform == 'win32': bin_dir = 'Scripts' else: bin_dir = 'bin' def ...
mit
MortimerGoro/servo
tests/wpt/css-tests/tools/py/py/_process/cmdexec.py
273
1814
import sys import subprocess import py from subprocess import Popen, PIPE def cmdexec(cmd): """ return unicode output of executing 'cmd' in a separate process. raise cmdexec.Error exeception if the command failed. the exception will provide an 'err' attribute containing the error-output from the comma...
mpl-2.0
cpanelli/-git-clone-https-chromium.googlesource.com-chromium-tools-depot_tools
recipes/dart.py
13
1043
# Copyright 2015 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232 cla...
bsd-3-clause
porcobosso/spark-ec2
lib/boto-2.34.0/boto/s3/key.py
10
82319
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
apache-2.0
thinkerou/grpc
src/python/grpcio_tests/tests/unit/_auth_test.py
13
2515
# Copyright 2016 gRPC 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 in writing...
apache-2.0
oysstu/pyopencl-in-action
ch4/float_config.py
1
1092
''' Listing 4.3: Testing a device’s floating-point features ''' import pyopencl as cl import utility # Get device and context, create command queue and program dev = utility.get_default_device() # Check for double floating point features fp_flag = dev.single_fp_config fp_masks = [('Denorm', cl.device_f...
mit
mmetak/streamlink
tests/plugins/testplugin.py
2
1906
from io import BytesIO from streamlink import NoStreamsError from streamlink.plugins import Plugin from streamlink.options import Options from streamlink.stream import * from streamlink.plugin.api.support_plugin import testplugin_support class TestStream(Stream): __shortname__ = "test" def open(self): ...
bsd-2-clause
miquelramirez/LAPKT-public
2.0/external/fd/graph.py
12
1345
#! /usr/bin/env python from __future__ import print_function class Graph: def __init__(self, nodes): self.nodes = nodes self.neighbours = dict((u, set()) for u in nodes) def connect(self, u, v): self.neighbours[u].add(v) self.neighbours[v].add(u) def connected_components(se...
gpl-3.0
wwj718/edx-platform
lms/djangoapps/shoppingcart/utils.py
103
2782
""" Utility methods for the Shopping Cart app """ from django.conf import settings from microsite_configuration import microsite from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import PDF...
agpl-3.0
wilebeast/FireFox-OS
B2G/gecko/media/webrtc/trunk/tools/gyp/test/mac/gyptest-xcode-env-order.py
24
2704
#!/usr/bin/env python # Copyright (c) 2012 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. """ Verifies that dependent Xcode settings are processed correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = T...
apache-2.0
makerbot/s3g
tests/pi_test_Factory.py
2
2989
import os import sys lib_path = os.path.abspath('./') sys.path.insert(0, lib_path) import unittest import mock import tempfile import makerbot_driver class TestFactory(unittest.TestCase): def setUp(self): self.real_from_filename = makerbot_driver.s3g.from_filename self.from_filename_mock = mock...
agpl-3.0
tedye/leetcode
tools/leetcode.105.Construct Binary Tree from Preorder and Inorder Traversal/leetcode.105.Construct Binary Tree from Preorder and Inorder Traversal.submission8.py
1
1072
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {integer[]} preorder # @param {integer[]} inorder # @return {TreeNode} def buildTree(self, preorder, inorder): ...
mit