repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
JeyZeta/Dangerous
Dangerous/Golismero/thirdparty_libs/netaddr/ip/intset.py
19
20495
"""Immutable integer set type. Integer set class. Copyright (C) 2010, David Moss. Ported to Python 3.x. Copyright (C) 2006, Heiko Wundram. Released under the MIT license: Copyright (c) 2006, Heiko Wundram. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated ...
mit
peat-psuwit/android_kernel_lge_w7ds
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
pyfisch/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/assertion/util.py
32
11492
"""Utilities for assertion debugging""" from __future__ import absolute_import, division, print_function import pprint import _pytest._code import py import six from ..compat import Sequence u = six.text_type # The _reprcompare attribute on the util module is used by the new assertion # interpretation code and asser...
mpl-2.0
jimcunderwood/MissionPlanner
Lib/site-packages/scipy/optimize/cobyla.py
55
3200
"""Interface to Constrained Optimization By Linear Approximation Functions: fmin_coblya(func, x0, cons, args=(), consargs=None, rhobeg=1.0, rhoend=1e-4, iprint=1, maxfun=1000) Minimize a function using the Constrained Optimization BY Linear Approximation (COBYLA) method """ import _cobyla from nu...
gpl-3.0
dagwieers/ansible
test/units/modules/net_tools/nios/test_nios_zone.py
68
10787
# 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 in the hope that ...
gpl-3.0
koomik/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/spankwire.py
15
4029
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse_urlparse, compat_urllib_request, compat_urllib_parse, unified_strdate, str_to_int, int_or_none, ) from ..aes import aes_decrypt_text class SpankwireIE(InfoExtractor):...
gpl-3.0
dati91/servo
tests/wpt/web-platform-tests/fetch/http-cache/resources/http-cache.py
7
4179
#!/usr/bin/env python import datetime import json import time from base64 import b64decode NOTEHDRS = set(['content-type', 'access-control-allow-origin', 'last-modified', 'etag']) NOBODYSTATUS = set([204, 304]) LOCATIONHDRS = set(['location', 'content-location']) DATEHDRS = set(['date', 'expires', 'last-modified']) ...
mpl-2.0
archifix/settings
sublime/Packages/pymdownx/st3/pymdownx/highlight.py
4
9947
""" Highlight. A library for managing code highlighting. All Changes Copyright 2014-2017 Isaac Muse. --- CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. See <https://pythonhosted.org/Markdown/extensions/code_h...
mit
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/distutils/tests/test_config.py
95
3184
"""Tests for distutils.pypirc.pypirc.""" import sys import os import unittest import tempfile import shutil from distutils.core import PyPIRCCommand from distutils.core import Distribution from distutils.log import set_threshold from distutils.log import WARN from distutils.tests import support from test.test_support...
gpl-2.0
Russell-IO/ansible
test/units/modules/network/f5/test_bigip_virtual_address.py
7
7408
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
gpl-3.0
tokatikato/OIPA
OIPA/api/v3/resources/activity_view_resources.py
1
12434
# Tastypie specific from tastypie import fields from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.resources import ModelResource # Data specific from api.cache import NoTransformCache from iati.models import ContactInfo, Activity, Organisation, AidType, FlowType, Sector, CollaborationType, \ Tie...
agpl-3.0
crossbario/autobahn-testsuite
autobahntestsuite/autobahntestsuite/case/case3_1.py
2
1430
############################################################################### ## ## Copyright (c) Crossbar.io Technologies GmbH ## ## 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...
apache-2.0
TheSeven/p2pool
p2pool/util/fixargparse.py
283
1630
from __future__ import absolute_import import argparse import sys class FixedArgumentParser(argparse.ArgumentParser): ''' fixes argparse's handling of empty string arguments and changes @filename behaviour to accept multiple arguments on each line ''' def _read_args_from_files(self, arg_strings)...
gpl-3.0
mariosky/evo-drawings
venv/lib/python2.7/site-packages/numpy/distutils/fcompiler/absoft.py
229
5612
# http://www.absoft.com/literature/osxuserguide.pdf # http://www.absoft.com/documentation.html # Notes: # - when using -g77 then use -DUNDERSCORE_G77 to compile f2py # generated extension modules (works for f2py v2.45.241_1936 and up) from __future__ import division, absolute_import, print_function import os from...
agpl-3.0
alexissmirnov/donomo
donomo_archive/deps/reportlab/docs/userguide/ch7_custom.py
2
2679
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/userguide/ch7_custom.py from reportlab.tools.docco.rl_doc_utils import * heading1("Writing your own $Flowable$ Objects") disc(""" Flowables are i...
bsd-3-clause
unicri/edx-platform
lms/djangoapps/mobile_api/utils.py
7
2265
""" Common utility methods and decorators for Mobile APIs. """ import functools from rest_framework import permissions from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from courseware.courses import get_course_with_access from openedx.core.lib.api.authentication import ( ...
agpl-3.0
cbenhagen/kivy
kivy/core/image/img_pil.py
6
3534
''' PIL: PIL image loader ''' __all__ = ('ImageLoaderPIL', ) try: from PIL import Image as PILImage except: import Image as PILImage from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderPIL(ImageLoaderBase): '''Image loader based on the PIL...
mit
viki9698/jizhanggroup
django/conf/locale/nl/formats.py
107
3085
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '20 januari 2009' TIME_FORMAT = 'H:i' ...
bsd-3-clause
jundongl/scikit-feature
skfeature/example/test_JMI.py
3
1482
import scipy.io from sklearn.metrics import accuracy_score from sklearn import cross_validation from sklearn import svm from skfeature.function.information_theoretical_based import JMI def main(): # load data mat = scipy.io.loadmat('../data/colon.mat') X = mat['X'] # data X = X.astype(float) y ...
gpl-2.0
joariasl/odoo
addons/stock/partner.py
375
1766
# -*- 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
nprapps/elections14
etc/github.py
17
3835
#!/usr/bin/env python import csv import getpass import json import os import re import requests from requests.auth import HTTPBasicAuth def get_auth(): """ Construct a basic auth object from a username and password """ username = raw_input('Username:') password = getpass.getpass('Password:') ...
mit
muntasirsyed/intellij-community
python/lib/Lib/encodings/cp1256.py
593
13070
""" Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
linovia/django-rest-framework
tests/models.py
7
2697
from __future__ import unicode_literals import uuid from django.db import models from django.utils.translation import ugettext_lazy as _ class RESTFrameworkModel(models.Model): """ Base for test models that sets app_label, so they play nicely. """ class Meta: app_label = 'tests' abs...
bsd-2-clause
kawasaki2013/python-for-android-x86
python-modules/twisted/twisted/conch/test/test_checkers.py
59
10446
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.checkers}. """ try: import pwd except ImportError: pwd = None import os, base64 from twisted.trial.unittest import TestCase from twisted.python.filepath import FilePath from twisted.cred.checkers ...
apache-2.0
garcia/simfile
simfile/timing/tests/test_engine.py
1
10046
from decimal import Decimal import unittest from .helpers import * from .. import * from ..engine import * class TestTimingEngine(unittest.TestCase): def test_init(self): timing_data = testing_timing_data() engine = TimingEngine(timing_data) self.assertEqual(timing_data, engine.timing_dat...
mit
ligaturee/ansible-modules-extras
system/cronvar.py
69
14082
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
usc-isi-i2/WEDC
spark_dependencies/python_lib/nose2/tests/unit/test_outcomes_plugin.py
17
2316
from nose2.plugins import outcomes from nose2 import events, result, session from nose2.tests._common import TestCase class TestOutComesPlugin(TestCase): tags = ['unit'] def setUp(self): self.session = session.Session() self.result = result.PluggableTestResult(self.session) self.plugi...
apache-2.0
dims/nova
nova/api/openstack/compute/schemas/hosts.py
104
1236
# Copyright 2014 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
alexgleith/Quantum-GIS
python/plugins/sextante/algs/Polygonize.py
2
4299
# -*- coding: utf-8 -*- """ *************************************************************************** Polygonize.py --------------------- Date : March 2013 Copyright : (C) 2013 by Piotr Pociask Email : ppociask at o2 dot pl *******************************...
gpl-2.0
ArcherCraftStore/ArcherVMPeridot
Python/Lib/test/test_curses.py
67
12003
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import sys, tempfile, os ...
apache-2.0
swils/heroku-buildpack-python
vendor/pip-pop/docopt.py
283
19784
"""Pythonic command-line interface parser that will make you smile. * http://docopt.org * Repository and issue-tracker: https://github.com/docopt/docopt * Licensed under terms of MIT license (see LICENSE-MIT) * Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com """ import sys import re __all__ = ['doco...
mit
Aorjoa/aiyara-ceph-dash
.tox/flake8/lib/python2.7/site-packages/setuptools/archive_util.py
36
6614
"""Utilities for extracting common archive formats""" import zipfile import tarfile import os import shutil import posixpath import contextlib from distutils.errors import DistutilsError from pkg_resources import ensure_directory, ContextualZipFile __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile...
bsd-2-clause
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_scale_set_instance_view_statuses_summary.py
1
1313
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
anjali009/linux
scripts/gdb/linux/dmesg.py
630
1991
# # gdb helper commands and functions for Linux kernel debugging # # kernel log buffer dump # # Copyright (c) Siemens AG, 2011, 2012 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils class LxDmesg(gdb.Command...
gpl-2.0
endlessm/chromium-browser
third_party/polymer/v1_0/create_components_summary.py
10
1643
# Copyright 2016 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 json import os import re COMPONENTS_DIR = 'components' DESTINATION_COMPONENTS_DIR = 'components-chromium' COMPONENT_SUMMARY =\ """Name: %(name)s Rep...
bsd-3-clause
ds0nt/or-tools
examples/python/data/nonogram_regular/nonogram_soccer_player.py
74
1556
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applica...
apache-2.0
joone/chromium-crosswalk
build/android/devil/android/app_ui.py
10
7607
# 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. """Provides functionality to interact with UI elements of an Android app.""" import re from xml.etree import ElementTree as element_tree from devil.android...
bsd-3-clause
sjperkins/tensorflow
tensorflow/contrib/training/python/training/device_setter.py
52
3947
# 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
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.6.0/Lib/unittest/test/test_assertions.py
4
17030
import datetime import warnings import weakref import unittest from itertools import product class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, ...
mit
iver333/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/queues_unittest.py
123
3417
# 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 the ...
bsd-3-clause
yodalee/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mpl-2.0
jtwhite79/pyemu
pyemu/utils/gw_utils.py
1
110032
"""MODFLOW support utilities""" import os from datetime import datetime import shutil import warnings import numpy as np import pandas as pd import re pd.options.display.max_colwidth = 100 from pyemu.pst.pst_utils import ( SFMT, IFMT, FFMT, pst_config, parse_tpl_file, try_process_output_file, )...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/factorization/python/ops/wals.py
29
27466
# 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...
mit
leb2dg/osf.io
addons/github/tests/test_models.py
12
12794
# -*- coding: utf-8 -*- import mock import pytest import unittest from addons.base.tests.models import (OAuthAddonNodeSettingsTestSuiteMixin, OAuthAddonUserSettingTestSuiteMixin) from addons.github.models import NodeSettings from addons.github.tests import factories from osf_test...
apache-2.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/nntplib.py
157
21135
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
apache-2.0
kvar/ansible
lib/ansible/modules/network/f5/bigip_device_trust.py
38
12094
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
rlowrance/dot-vimrc
.vim/ftplugin/latex-suite/bibtools.py
15
7041
# Author: Srinath Avadhanula # This file is distributed as part of the vim-latex project # http://vim-latex.sf.net import re class Bibliography(dict): def __init__(self, txt, macros={}): """ txt: a string which represents the entire bibtex entry. A typical entry is of the f...
gpl-3.0
sohkis/android_kernel_motorola_shamu
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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 import sys sys.path.append(os.envir...
gpl-2.0
ftomassetti/intellij-community
python/testData/MockSdk3.2/Lib/_abcoll.py
112
15499
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
apache-2.0
xorpaul/check_mk
web/htdocs/weblib.py
6
4891
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
gpl-2.0
rayjim/hadoop_design_pattern
contrib/hod/testing/testThreads.py
182
3075
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
Ninjakow/TrueSkill
lib/numpy/doc/broadcasting.py
231
5565
""" ======================== Broadcasting over arrays ======================== The term broadcasting describes how numpy treats arrays with different shapes during arithmetic operations. Subject to certain constraints, the smaller array is "broadcast" across the larger array so that they have compatible shapes. Broadc...
gpl-3.0
qiuzhong/crosswalk-test-suite
webapi/tct-video-html5-tests/inst.wgt.py
372
6809
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
petecummings/django-cms
cms/south_migrations/0042_auto__del_field_title_meta_keywords__chg_field_title_meta_description_.py
48
16515
# -*- 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...
bsd-3-clause
PyGotham/pygotham
pygotham/manage/events.py
1
1920
"""Event-related management commands.""" import sys import arrow from flask import current_app from flask_script import Command, prompt, prompt_bool from werkzeug.datastructures import MultiDict from pygotham.core import db from pygotham.forms import EventForm from pygotham.models import Event class CreateEvent(Co...
bsd-3-clause
pekeler/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/test/test_win32inet.py
17
1980
from win32inet import * from win32inetcon import * import unittest class CookieTests(unittest.TestCase): def testCookies(self): data = "TestData=Test" InternetSetCookie("http://www.python.org", None, data) got = InternetGetCookie("http://www.python.org", None) self.assertEqual(got,...
apache-2.0
ninefold/libcloud
libcloud/test/test_response_classes.py
3
5361
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
umraniyeacil/umraniyeacil.github.io
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
1283
65086
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
mit
kkk669/mxnet
example/speech-demo/io_func/feat_readers/reader_atrack.py
25
2265
# 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
Bysmyyr/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
188
3699
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
SahilTikale/haas
examples/dbinit.py
2
1653
#!/usr/bin/python """ Register nodes with HIL. This is intended to be used as a template for either creating a mock HIL setup for development or to be modified to register real-life nodes that follow a particular pattern. In the example environment for which this module is written, there are 10 nodes which have IPMI ...
apache-2.0
pwong-mapr/private-hue
desktop/core/ext-py/Mako-0.8.1/mako/ext/autohandler.py
57
1841
# ext/autohandler.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """adds autohandler functionality to Mako templates. requires that the TemplateLookup class is...
apache-2.0
retif/stealthpage
genshi/filters/transform.py
3
47285
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
gpl-3.0
TangHao1987/intellij-community
python/helpers/pydev/tests/test_jysimpleTipper.py
54
9616
#line to run: #java -classpath D:\bin\jython-2.1\jython.jar;D:\bin\eclipse331_1\plugins\org.junit_3.8.2.v200706111738\junit.jar;D:\bin\eclipse331_1\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant.jar org.python.util.jython w:\org.python.pydev\pysrc\tests\test_jysimpleTipper.py import unittest import os import sys ...
apache-2.0
jtushman/state_machine
tests.py
1
11684
import os import nose import functools from pymongo import MongoClient from nose.plugins.skip import SkipTest from nose.tools import * from nose.tools import assert_raises try: import mongoengine except ImportError: mongoengine = None def establish_mongo_connection(): mongo_name = os.environ.get('AASM_MO...
mit
tobast/sysres-pikern
snake/snake_common.py
1
1643
SERVER_PORT = 31412 PSIZE = 20 WIDTH = 30 HEIGHT = 30 PERIOD = 100 def p2add(u, v): return (u[0] + v[0], u[1] + v[1]) DIRS = [(0, 1), (1, 0), (-1, 0), (0, -1)] NB_APPLES = 3 class Packet: def __init__(self, data = b''): self.start_index = 0 self.data = data def add_position(self, p): ...
gpl-3.0
verdurin/bcbio-nextgen
bcbio/structural/cnvkit.py
1
21743
"""Copy number detection with CNVkit with specific support for targeted sequencing. http://cnvkit.readthedocs.org """ import copy import os import shutil import sys import tempfile import pybedtools import numpy as np import toolz as tz from bcbio import install, utils from bcbio.bam import ref from bcbio.distribute...
mit
Habatchii/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso2022_jp_ext.py
61
1108
# # iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_ext') class Codec(codecs.Codec): encode = codec.encode decode = codec.decod...
apache-2.0
tietokilta-saato/tikplay
tikplay/server.py
1
5529
import json import os from hashlib import sha1 from flask import request, jsonify, current_app from flask.ext.restful import Resource import time from werkzeug.utils import secure_filename import traceback from audio import play_file from provider.provider import Provider from provider.task import TaskState from util...
mit
Accelerite/cinder
cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py
5
5927
# 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 # d...
apache-2.0
supersven/intellij-community
python/lib/Lib/types.py
81
2263
"""Define names for all type symbols known in the standard interpreter. Types that are part of optional modules (e.g. array) are not listed. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check...
apache-2.0
n0trax/ansible
lib/ansible/modules/cloud/univention/udm_share.py
29
23152
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # 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 ...
gpl-3.0
flagpoonage/strapon
strapon/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/eclipse.py
437
11894
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
gpl-2.0
jolyonb/edx-platform
lms/djangoapps/course_api/blocks/tests/test_forms.py
1
8460
""" Tests for Course Blocks forms """ from urllib import urlencode import ddt from django.http import Http404, QueryDict from opaque_keys.edx.locator import CourseLocator from rest_framework.exceptions import PermissionDenied from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.models import...
agpl-3.0
trunglq7/horizon
openstack_dashboard/openstack/common/version.py
8
3286
# Copyright 2012 OpenStack LLC # Copyright 2012-2013 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.or...
apache-2.0
davidyezsetz/kuma
kuma/search/migrations/0001_initial.py
5
3918
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'FilterGroup' db.create_table('search_filtergroup', ( ('id', self.gf('django.db.m...
mpl-2.0
jrmccarthy/django-guardian
guardian/migrations/0003_update_objectpermission_object_pk.py
47
5644
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """ Updates ``object_pk`` fields on both ``UserObjectPermission`` and ``GroupObjectPermission`` from ``object_i...
bsd-2-clause
okfn/bibserver
bibserver/ingest.py
4
12956
''' Independent running process. Handling uploads asynchronously. See: https://github.com/okfn/bibserver/wiki/AsyncUploadDesign ''' import os, stat, sys, uuid, time import subprocess from cStringIO import StringIO import requests import hashlib import json from datetime import datetime import traceback import bibserve...
mit
serika00/shadowsocks
shadowsocks/common.py
1
9079
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-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 requi...
apache-2.0
encukou/freeipa
ipatests/test_ipalib/test_x509.py
2
16469
# Authors: # Rob Crittenden <rcritten@redhat.com> # # Copyright (C) 2010 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
borysiasty/QGIS
python/plugins/db_manager/db_plugins/spatialite/info_model.py
71
2411
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
eayunstack/nova
nova/cmd/novnc.py
40
1515
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
shail2810/nova
nova/virt/xenapi/firewall.py
61
4655
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
famish99/pyvisa-sim
pyvisa_sim/tcpip.py
1
2280
# -*- coding: utf-8 -*- """ pyvisa-sim.tcpip ~~~~~~~~~~~~~~~~ TCPIP simulated session class. :copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import time from pyvisa import constants from . import sessions class BaseTCPIPSes...
mit
Learn-Android-app/buck
third-party/py/unittest2/unittest2/test/test_discovery.py
111
13372
import os import re import sys import unittest2 class TestDiscovery(unittest2.TestCase): # Heavily mocked tests so I can avoid hitting the filesystem def test_get_name_from_path(self): loader = unittest2.TestLoader() loader._top_level_dir = '/foo' name = loader._get_name_from_path('...
apache-2.0
waynewolf/abucket
from-tf-web/quickstart/1-get-started-tf-contrib-learn-customize.py
1
1494
import numpy as np import tensorflow as tf # Declare list of features, we only have one real-valued feature def model(features, labels, mode): # Build a linear model and predict values W = tf.get_variable("W", [1], dtype=tf.float64) b = tf.get_variable("b", [1], dtype=tf.float64) y = W*features['x'] + b # Los...
mit
filipenegrao/drawbotScripts
auto_grid_002.py
1
9645
t = '''Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typo...
mit
MadsJensen/agency_connectivity
tf_functions.py
1
5293
""" Functions for TF analysis. @author: mje @email: mads [] cnru.dk """ import mne from mne.time_frequency import (psd_multitaper, tfr_multitaper, tfr_morlet, cwt_morlet) from mne.viz import iter_topography import matplotlib.pyplot as plt import numpy as np def calc_psd_epochs(epochs...
bsd-3-clause
SujaySKumar/django
django/utils/module_loading.py
320
6280
import copy import os import sys from importlib import import_module from django.utils import six def import_string(dotted_path): """ Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed. """ try: module...
bsd-3-clause
Kjuly/bottle
test/test_wsgi.py
15
13523
# -*- coding: utf-8 -*- from __future__ import with_statement import unittest import bottle from tools import ServerTestBase from bottle import tob class TestWsgi(ServerTestBase): ''' Tests for WSGI functionality, routing and output casting (decorators) ''' def test_get(self): """ WSGI: GET routes""" ...
mit
termNinja/Conversion-of-Regex-into-Automatons
pyscripts/classes/resources.py
1
18835
import re, os, sys from Queue import Queue # ----------------------------------------------------------------------------- class term_colors: """ Usage: print term_colors.WARNING + "This is a msg" + term_colors.ENDC """ HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m...
gpl-3.0
youprofit/servo
components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py
158
4183
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestArrayBuffer { attribute ArrayBuffer bufferAttr; void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4); attribute ArrayBufferView viewAttr; ...
mpl-2.0
rohitwaghchaure/alec_frappe5_erpnext
erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py
97
1585
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, Overlappi...
agpl-3.0
saurabh6790/frappe
frappe/core/doctype/user/user.py
1
39931
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from bs4 import BeautifulSoup import frappe import frappe.share import frappe.defaults import frappe.permissions from frappe.model.document import Document from ...
mit
jfrygeo/solutions-geoprocessing-toolbox
suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/netcdf/date_time.py
2
1649
# -*- coding: utf-8 -*- import netCDF4 def _units( variable): assert hasattr(variable, "units") # Don't lowercase this value. The casing is relevant. units = variable.units # netcdf4-python expects milliseconds, while some datasets provide msecs. units = units.replace("msecs", "milliseco...
apache-2.0
FedericoCeratto/firelet
tests/test_local.py
2
1318
# Firelet - Distributed firewall management. # Copyright (C) 2010 Federico Ceratto # # 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 la...
gpl-3.0
ya790206/temp_hg
hgext/convert/filemap.py
2
15584
# Copyright 2007 Bryan O'Sullivan <bos@serpentine.com> # Copyright 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import posixpath import shlex from mercurial.i18n import _ from mer...
gpl-2.0
MyRookie/SentimentAnalyse
venv/lib/python2.7/site-packages/pip/_vendor/retrying.py
934
9972
## Copyright 2013-2014 Ray Holder ## ## 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 ...
mit
py4n6/aff4
scons-local-1.2.0/SCons/Scanner/__init__.py
12
14353
"""SCons.Scanner The Scanner package for the SCons software construction utility. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "So...
gpl-3.0
Lilykos/invenio
invenio/modules/previewer/previewerext/csv_recline.py
19
1149
# This file is part of Invenio. # Copyright (C) 2013, 2014, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # ...
gpl-2.0