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
djcapelis/lockbox-hw-kernel-sparc
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
vivekananda/fbeats
django/contrib/gis/db/backends/oracle/introspection.py
388
1777
import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, # but it is the only o...
bsd-3-clause
scarriere/CSGames-AI2015
AIClient_Python/test/test_mathUtils.py
1
1127
from unittest import TestCase from mathUtils.Vector2 import Vector2 from mathUtils.MathUtils import MathUtils from mathUtils.Direction import Direction class TestMathUtils(TestCase): def test_getDirectionVector(self): a = Vector2(1, 1) b = Vector2(7, 7) self.assertEqual(Vector2(6, 6), Math...
mit
Zhongqilong/kbengine
kbe/src/lib/python/Lib/test/test_minidom.py
60
64328
# test for xml.dom.minidom import pickle from test.support import run_unittest, findfile import unittest import xml.dom.minidom from xml.dom.minidom import parse, Node, Document, parseString from xml.dom.minidom import getDOMImplementation tstfile = findfile("test.xml", subdir="xmltestdata") # The tests of Docume...
lgpl-3.0
datagrok/python-misc
datagrok/math/stats.py
1
1192
"""Utilities for statistics""" def sorted(xs): """Return a sorted copy of the list xs""" _xs = list(xs) _xs.sort() return _xs def stemleaf(ns): """Given a list of integers ns, print a stem-and-leaf display.""" return _stemleaf(sorted(ns)) def dsd(ns): """Given a list of integers ns, print...
agpl-3.0
funson/rt-xen
tools/python/xen/remus/qdisc.py
22
4860
import socket, struct import netlink qdisc_kinds = {} TC_H_ROOT = 0xFFFFFFFF class QdiscException(Exception): pass class request(object): "qdisc request message" def __init__(self, cmd, flags=0, dev=None, handle=0): self.n = netlink.nlmsg() self.t = netlink.tcmsg() self.n.nlmsg_fla...
gpl-2.0
skillness/OpenNI
Externals/PSCommon/Windows/CreateRedist/CopyToRepository.py
7
3337
import os import sys import re import time import traceback packageFullPath = "..\..\..\..\..\PrimeSenseVersions.nsh" def find_package_number(findStr, text): for line in text: temp = re.search(findStr, line) if temp != None: packageNumber = temp.group(1) return packageNumbe...
apache-2.0
letolab/airy
airy/utils/translation/trans_null.py
1
2647
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. import warnings from airy.core.conf import settings from airy.utils.encoding import force_un...
bsd-2-clause
shakamunyi/tensorflow
tensorflow/contrib/keras/python/keras/layers/convolutional_recurrent.py
2
24940
# 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
wrongtest/nnlight
src/computation_on_java_impl/layers/pooling.py
1
1033
from layer.basic.pooling import MaxPoolingWithTimeLayer as MaxPoolingWithTimeLayerBase class MaxPoolingWithTimeLayer(MaxPoolingWithTimeLayerBase): def get_computation_on_java_code(self, code, binder): datatype = binder.get_base_type(self.input) input_var = binder.get_name(self.input) outp...
gpl-2.0
bitpay/bitcoin
qa/rpc-tests/getchaintips.py
66
2133
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. We introduce a network split, work # on chains of different lengths, an...
mit
denys-duchier/Scolar
config/softs/jaxml-3.01/jaxml.py
2
49250
# Module for XML, HTML and CGI output # jaxml # (C) Jerome Alet <alet@librelogiciel.com> 2000-2002 # You're welcome to redistribute this software under the # terms of the GNU General Public Licence version 2.0 # or, at your option, any higher version. # # You can read the complete GNU GPL in the file COPYING # which sh...
gpl-2.0
arun6582/django
tests/forms_tests/field_tests/test_nullbooleanfield.py
49
3555
from django.forms import Form, HiddenInput, NullBooleanField, RadioSelect from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class NullBooleanFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_nullbooleanfield_clean(self): f = NullBooleanField() self.assertI...
bsd-3-clause
tridao/cvxpy
cvxpy/atoms/affine/sum_entries.py
5
2288
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0
cdsgroup/qcdb
databases/A24.py
2
34755
# # @BEGIN LICENSE # # QCDB: quantum chemistry common driver and databases # # Copyright (c) 2011-2017 The QCDB Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of QCDB. # # QCDB is free software; you can redistribute it and/or modify # it ...
lgpl-3.0
codeforamerica/heroku-buildpack-pygeo
vendor/pip-1.3.1/pip/baseparser.py
63
12283
"""Base option parser setup""" import sys import optparse import pkg_resources import os import textwrap from distutils.util import strtobool from pip.backwardcompat import ConfigParser, string_types, ssl from pip.locations import default_config_file, default_log_file from pip.util import get_terminal_size, get_prog ...
mit
akhilari7/pa-dude
lib/python2.7/site-packages/pyrfc3339/generator.py
3
2170
import pytz from pyrfc3339.utils import timezone, timedelta_seconds def generate(dt, utc=True, accept_naive=False, microseconds=False): ''' Generate an :RFC:`3339`-formatted timestamp from a :class:`datetime.datetime`. >>> from datetime import datetime >>> generate(datetime(2009,1,1,12,59,59,0,p...
mit
sbalde/edx-platform
cms/djangoapps/contentstore/features/signup.py
111
2821
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module @step('I fill in the registration form$') def i_fill_in_the_registration_form(step): def fill_in_reg_form(): reg...
agpl-3.0
dmsimard/ansible
test/lib/ansible_test/_internal/test.py
7
15062
"""Classes for storing and processing test results.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import datetime import re from . import types as t from .util import ( display, get_ansible_version, ) from .util_common import ( write_text_test_results, wr...
gpl-3.0
canwe/NewsBlur
apps/rss_feeds/migrations/0044_favicon_color.py
18
7246
# encoding: utf-8 import sys import datetime from south.db import db from south.v2 import DataMigration from django.db import models from apps.rss_feeds.models import Feed try: from apps.rss_feeds.models import FeedIcon except ImportError: pass class Migration(DataMigration): def forwards(self, orm): ...
mit
MathieuDuponchelle/my_patched_photologue
photologue/tests/test_gallery.py
3
2220
from .. import models from .helpers import PhotologueBaseTest from .factories import GalleryFactory, PhotoFactory class GalleryTest(PhotologueBaseTest): def setUp(self): """Create a test gallery with 2 photos.""" super(GalleryTest, self).setUp() self.test_gallery = GalleryFactory() ...
bsd-3-clause
ansrivas/pylogging
pylogging/formatters.py
1
1932
# !/usr/bin/env python # -*- coding: utf-8 -*- """Bunch of log formatters to be used.""" import logging try: import ujson as json except Exception as ex: import json class TextFormatter(logging.Formatter): """Format the meta data in the log message to fix string length.""" datefmt = '%Y-%m-%d %H:%M...
mit
xchenum/quantum
quantum/plugins/cisco/client/cli.py
6
6937
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 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...
apache-2.0
anomitra/articleScraper
PyQt-gpl-5.4.1/examples/qml/referenceexamples/methods.py
2
4326
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENSE:BSD$ #...
gpl-2.0
liucode/tempest-master
tempest/api/compute/volumes/test_volume_snapshots.py
5
3040
# Copyright 2015 Fujitsu(fnst) 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...
apache-2.0
PHSCRC/phsled
nfc/clf/rcs380.py
4
38231
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2012-2015 Stephen Tiedemann <stephen.tiedemann@gmail.com> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (t...
mit
nlholdem/icodoom
.venv/lib/python2.7/site-packages/google/protobuf/internal/text_encoding_test.py
126
2903
#! /usr/bin/env python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
gpl-3.0
hynekcer/django
django/db/migrations/operations/base.py
356
4370
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
bsd-3-clause
jose51197/Infernal
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
Gitlab11/odoo
addons/calendar/controllers/main.py
329
3390
import simplejson import openerp import openerp.http as http from openerp.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(self, db, token, action, ...
agpl-3.0
toddpalino/kafka-tools
kafka/tools/protocol/requests/update_metadata_v3.py
1
2339
# 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
gauribhoite/personfinder
env/site-packages/pygments/lexers/data.py
72
18277
# -*- coding: utf-8 -*- """ pygments.lexers.data ~~~~~~~~~~~~~~~~~~~~ Lexers for data file format. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \ ...
apache-2.0
travisreed-wf/PyGithub
github/PaginatedList.py
23
7707
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
katyhuff/moose
python/MooseDocs/extensions/MooseCSS.py
1
2028
from markdown.blockprocessors import BlockProcessor from MooseCommonExtension import MooseCommonExtension import re from markdown.util import etree class MooseCSS(BlockProcessor, MooseCommonExtension): """ Markdown extension for applying CSS styles to paragraph Markdown syntax is: !css <options> ...
lgpl-2.1
karrtikr/ete
ete3/test/test_treeview/item_faces.py
1
4140
# We will need to create Qt4 items from PyQt4 import QtCore from PyQt4.QtGui import QGraphicsRectItem, QGraphicsSimpleTextItem, \ QGraphicsEllipseItem, QColor, QPen, QBrush from ... import Tree, faces, TreeStyle, NodeStyle # To play with random colors import colorsys import random class InteractiveItem(QGraphics...
gpl-3.0
alexandrucoman/vbox-neutron-agent
neutron/db/api.py
6
1693
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
MrLoick/python-for-android
python-modules/twisted/twisted/python/dispatch.py
64
1187
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import warnings warnings.warn( "Create your own event dispatching mechanism, " "twisted.python.dispatch will soon be no more.", DeprecationWarning, 2) class EventDispatcher: """ A global event dispatcher for events....
apache-2.0
0xc0170/pyOCD
pyOCD/test/test_utility/test_cmdline.py
11
1600
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
apache-2.0
mementum/backtrader
samples/sigsmacross/sigsmacross.py
1
3835
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
cchanning/Impala
tests/common/failure_injector.py
16
3806
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Failure injection module for the Impala service. There are two main ways this module # can be used - the first is to initialize the failure injector and then call start() # which will kick off a timer that chooses a random impalad/state store process # to fai...
apache-2.0
parthea/pydatalab
google/datalab/bigquery/_query.py
4
13135
# Copyright 2015 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 agreed ...
apache-2.0
kmacinnis/sympy
sympy/assumptions/tests/test_context.py
126
1153
from sympy.assumptions import ask, Q from sympy.assumptions.assume import assuming, global_assumptions from sympy.abc import x, y def test_assuming(): with assuming(Q.integer(x)): assert ask(Q.integer(x)) assert not ask(Q.integer(x)) def test_assuming_nested(): assert not ask(Q.integer(x)) ass...
bsd-3-clause
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/ina.py
55
1062
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class InaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ina\.fr/video/(?P<id>I?[A-Z0-9]+)' _TEST = { 'url': 'http://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.ht...
mit
cmyr/keras
keras/preprocessing/sequence.py
4
4010
from __future__ import absolute_import # -*- coding: utf-8 -*- import numpy as np import random from six.moves import range def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre'): """ Pad each sequence to the same length: the length of the longuest sequence. If maxlen is ...
mit
GenericMappingTools/gmt-python
pygmt/tests/test_helpers.py
1
3568
""" Tests the helper functions/classes/etc used in wrapping GMT. """ import os import numpy as np import pytest from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( GMTTempFile, args_in_kwargs, data_kind, kwargs_to_strings, unique_name, ) @pytest.mark.parametrize( "data,x,...
bsd-3-clause
linktlh/Toontown-journey
toontown/dna/DNALandmarkBuilding.py
3
2519
from panda3d.core import LVector4f import DNANode import DNAUtil import DNAError class DNALandmarkBuilding(DNANode.DNANode): COMPONENT_CODE = 13 def __init__(self, name): DNANode.DNANode.__init__(self, name) self.code = '' self.wallColor = LVector4f(1, 1, 1, 1) self.title = '' ...
apache-2.0
mvaled/gunicorn
gunicorn/selectors.py
107
18997
"""Selectors module. This module allows high-level and efficient I/O multiplexing, built upon the `select` module primitives. The following code adapted from trollius.selectors. """ from abc import ABCMeta, abstractmethod from collections import namedtuple, Mapping import math import select import sys from gunicor...
mit
xiangel/hue
desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/data/setup.py
42
1045
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 # ============================================================================= # $Id: setup.py 114 2007-06-14 21:17:14Z palgarvio $ # ============================================================================= # $URL: http://svn.edgewall...
apache-2.0
rabitt/mir_eval
evaluators/beat_eval.py
4
1856
#!/usr/bin/env python ''' CREATED:2014-01-24 12:42:43 by Brian McFee <brm2132@columbia.edu> Compute beat evaluation metrics Usage: ./beat_eval.py REFERENCE.TXT ESTIMATED.TXT ''' from __future__ import print_function import argparse import sys import os import eval_utilities import mir_eval def process_arguments...
mit
LukeM12/samba
source4/scripting/devel/speedtest.py
31
8527
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Unix SMB/CIFS implementation. # This speed test aims to show difference in execution time for bulk # creation of user objects. This will help us compare # Samba4 vs MS Active Directory performance. # Copyright (C) Zahari Zahariev <zahari.zahariev@postpath.com> 2010 # #...
gpl-3.0
jakar/odoo-bank-statement-reconcile
__unported__/account_statement_completion_label/partner.py
18
1385
# -*- coding: utf-8 -*- ############################################################################### # # account_statement_completion_label for OpenERP # Copyright (C) 2013 Akretion (http://www.akretion.com). All Rights Reserved # @author Benoît GUILLOT <benoit.guillot@akretion.com> # # This program is free ...
agpl-3.0
tvibliani/odoo
addons/document/report/__init__.py
444
1068
# -*- 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
kgullikson88/IGRINS_Scripts
Search_Fast.py
1
2751
import sys import os import GenericSearch import pandas # Define regions contaminated by telluric residuals or other defects. We will not use those regions in the cross-correlation badregions = [[0, 1510], # Blue end of H band (lots of water absorption) #[1561, 1615], # CO2 band that is often poorly c...
mit
RubenKelevra/rethinkdb
external/v8_3.30.33.16/build/gyp/PRESUBMIT.py
496
3373
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
agpl-3.0
jarvys/django-1.7-jdb
django/middleware/common.py
52
7351
import hashlib import logging import re import warnings from django.conf import settings from django.core.mail import mail_managers from django.core import urlresolvers from django import http from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_text from django.utils.h...
bsd-3-clause
waseem18/oh-mainline
mysite/search/migrations/0041_add_created_and_modified_timestamps_to_all_models.py
17
14730
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
fbossy/SickRage
lib/guessit/plugins/transformers.py
33
9580
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
jedi22/osquery
tools/tests/test_osqueryi.py
5
9121
#!/usr/bin/env python # Copyright (c) 2014-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the Apache 2.0 license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree)...
bsd-3-clause
sonuyos/couchpotato
libs/html5lib/treebuilders/etree.py
721
12609
from __future__ import absolute_import, division, unicode_literals from six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(Elemen...
gpl-3.0
srene/ns-3-inrpp
src/dsdv/bindings/callbacks_list.py
151
1222
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3...
gpl-2.0
bq/bitbloq-offline
app/res/web2board/linux/res/Scons/sconsFiles/SCons/Tool/rpmutils.py
6
17072
"""SCons.Tool.rpmutils.py RPM specific helper routines for general usage in the test framework and SCons core modules. Since we check for the RPM package target name in several places, we have to know which machine/system name RPM will use for the current hardware setup. The following dictionaries and functions try t...
gpl-3.0
Etxea/gestion_eide_web
grupos/migrations/0003_auto__add_field_alumno_activo.py
1
2078
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Alumno.activo' db.add_column(u'alumnos_alumno', 'activo',...
mit
Dhivyap/ansible
lib/ansible/module_utils/network/eos/providers/module.py
20
2106
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import Connection from ansible.module_utils.network.eos.providers import providers from ansible.m...
gpl-3.0
ArneBachmann/configr
configr/test.py
1
3339
import doctest import json import logging import os import unittest import sys sys.path.insert(0, "..") import configr class Tests(unittest.TestCase): ''' Test suite. ''' def tests_metadata(_): _.assertTrue(hasattr(configr, "version")) _.assertTrue(hasattr(configr.version, "__version__")) _.assertT...
mit
fnugrahendi/petuk.corp
installer/pysource/source/installer.py
1
6796
import os,sys from PyQt4 import QtCore from PyQt4 import QtGui import functools import itertools import re from subprocess import Popen import pythoncom #-- shortcut from win32com.shell import shell, shellcon from installer_ui import Ui_MainWindow class MainGUI(QtGui.QMainWindow,Ui_MainWindow): def __init__(self,pa...
gpl-2.0
cristianquaglio/odoo
addons/hr_attendance/report/attendance_errors.py
377
3669
# -*- 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...
apache-2.0
enigmampc/catalyst
catalyst/support/issue_227.py
1
1521
import pytz from datetime import datetime from catalyst.api import symbol from catalyst.utils.run_algo import run_algorithm coin = 'btc' quote_currency = 'usd' n_candles = 5 def initialize(context): context.symbol = symbol('%s_%s' % (coin, quote_currency)) def handle_data_polo_partial_candles(context, data): ...
apache-2.0
ArchiDroid/ArchiKernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
atmark-techno/atmark-dist
user/python/Lib/lib-tk/turtle.py
4
10917
# LogoMation-like turtle graphics from math import * # Also for export import Tkinter class Error(Exception): pass class RawPen: def __init__(self, canvas): self._canvas = canvas self._items = [] self._tracing = 1 self.degrees() self.reset() def degrees(self, full...
gpl-2.0
jbobron/node-workshop
challenge6/start/node_modules/browserify/node_modules/syntax-error/node_modules/esprima-six/tools/generate-unicode-regex.py
341
5096
#!/usr/bin/python # -*- coding: utf-8 -*- # By Yusuke Suzuki <utatane.tea@gmail.com> # Modified by Mathias Bynens <http://mathiasbynens.be/> # http://code.google.com/p/esprima/issues/detail?id=110 import sys import string import re class RegExpGenerator(object): def __init__(self, detector): self.de...
mit
bfurtaw/thrust
performance/report.py
12
1519
from build import plot_results, print_results #valid formats are png, pdf, ps, eps and svg #if format=None the plot will be displayed format = 'png' #output = print_results output = plot_results for function in ['fill', 'reduce', 'inner_product', 'gather', 'merge']: output(function + '.xml', 'InputType', 'InputSi...
apache-2.0
IT-Department-Projects/OOAD-Project
Flask_App/oakcrest/lib/python2.7/site-packages/requests/auth.py
68
9541
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading import warnings from base64 import b64encode from .compat import urlparse, str, basestring from .cookies import extract_cookies_...
mit
obeattie/sqlalchemy
lib/sqlalchemy/sql/functions.py
19
3067
from sqlalchemy import types as sqltypes from sqlalchemy.sql.expression import ( ClauseList, Function, _literal_as_binds, text, _type_from_args ) from sqlalchemy.sql import operators from sqlalchemy.sql.visitors import VisitableType class _GenericMeta(VisitableType): def __call__(self, *args, **kwargs): ...
mit
calebfoss/tensorflow
tensorflow/contrib/metrics/python/metrics/classification.py
23
2583
# 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
elhuhdron/knossos
python/user/custom_graphics_view.py
2
2659
#!/home/amos/anaconda/bin/python from PythonQt.Qt import * from PythonQt.QtGui import * class CGScene(QGraphicsScene): def __init__(self, parent = None): super(CGScene, self).__init__(self) class Texture(QGraphicsItem): def __init__(self, pos, tex): super(Texture, self).__init__(self) self.tex = tex s...
gpl-2.0
franky88/emperioanimesta
env/Lib/site-packages/pip/utils/outdated.py
513
5455
from __future__ import absolute_import import datetime import json import logging import os.path import sys from pip._vendor import lockfile from pip._vendor.packaging import version as packaging_version from pip.compat import total_seconds, WINDOWS from pip.models import PyPI from pip.locations import USER_CACHE_DI...
gpl-3.0
b3c/VTK-5.8
Wrapping/Python/vtk/util/misc.py
9
1984
"""Miscellaneous functions and classes that dont fit into specific categories.""" import sys, os, vtk #---------------------------------------------------------------------- # the following functions are for the vtk regression testing and examples def vtkGetDataRoot(): """vtkGetDataRoot() -- return vtk example d...
bsd-3-clause
ActiveState/code
recipes/Python/577760_Change_a_Functions_Closure/recipe-577760.py
1
1282
"""inject_closure module""" INJECTEDKEY = "injected_{}" OUTERLINE = " outer_{0} = injected_{0}" INNERLINE = " inner_{0} = outer_{0}" SOURCE= ("def not_important():", " def also_not_important():", " return also_not_important") def inject_closure(f, *args): """Ret...
mit
HackSoftware/hackconf.bg
home/website/migrations/0002_auto_20160903_1043.py
1
12244
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-03 10:43 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ (...
mit
duhzecca/cinder
cinder/tests/unit/fake_service.py
13
1787
# Copyright 2015 Intel Corp. # # 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 agr...
apache-2.0
beiko-lab/gengis
bin/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/flashwin.py
6
8028
#---------------------------------------------------------------------- # Name: wx.lib.flashwin # Purpose: A class that allows the use of the Shockwave Flash # ActiveX control # # Author: Robin Dunn # # Created: 22-March-2004 # RCS-ID: $Id: flashwin.py 54040 2008-06-08 23:03:22Z RD...
gpl-3.0
aliyun/oss-ftp
python27/win32/Lib/site-packages/pip/_vendor/html5lib/constants.py
963
87346
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
mit
sencha/chromium-spacewalk
third_party/libxml/src/check-xsddata-test-suite.py
343
10682
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 verbose = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml") LOG=...
bsd-3-clause
Learningtribes/edx-platform
openedx/core/djangolib/nose.py
32
1212
""" Utilities related to nose. """ from django.core.management import call_command from django.db import DEFAULT_DB_ALIAS, connections, transaction import django_nose class NoseTestSuiteRunner(django_nose.NoseTestSuiteRunner): """Custom NoseTestSuiteRunner.""" def setup_databases(self): """ Setup dat...
agpl-3.0
ran5515/DeepDecision
tensorflow/contrib/rnn/python/kernel_tests/core_rnn_cell_test.py
21
34945
# 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
geseib/kubernetes
cluster/juju/return-node-ips.py
310
1024
#!/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
crisisking/udbraaains
brains/namelist/migrations/0006_auto.py
1
2967
# encoding: 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 index on 'Player', fields ['is_dead'] db.create_index('namelist_player', ['is_dead']) # ...
bsd-3-clause
SimVascular/VTK
ThirdParty/Twisted/twisted/test/test_manhole.py
41
2092
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.manhole import service from twisted.spread.util import LocalAsRemote class Dummy: pass class DummyTransport: def getHost(self): return 'INET', '127.0.0.1', 0 class DummyManholeCl...
bsd-3-clause
jab1982/opennsa
opennsa/config.py
1
8668
""" Configuration reader and defaults. Author: Henrik Thostrup Jensen <htj@nordu.net> Copyright: NORDUnet (2011) """ import os import ConfigParser from opennsa import constants as cnt # defaults DEFAULT_CONFIG_FILE = '/etc/opennsa.conf' DEFAULT_LOG_FILE = '/var/log/opennsa.log' DEFAULT_TLS ...
bsd-3-clause
jrwdunham/old-webapp
onlinelinguisticdatabase/lib/app_globals.py
1
16584
# −*− coding: UTF−8 −*− # Copyright (C) 2010 Joel Dunham # # This file is part of OnlineLinguisticDatabase. # # OnlineLinguisticDatabase 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...
gpl-3.0
Hellowlol/PyTunes
libs/mutagen/monkeysaudio.py
16
2785
# A Monkey's Audio (APE) reader/tagger # # Copyright 2006 Lukas Lalinsky <lalinsky@gmail.com> # # 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. """Monkey's Audio streams with APEv2 ta...
gpl-3.0
bdang2012/taiga-back-casting
taiga/projects/mixins/on_destroy.py
1
1879
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
klundberg/swift-corelibs-foundation
lib/target.py
2
12322
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
apache-2.0
marcelometal/Django-facebook
facebook_example/facebook_example/urls.py
2
1535
try: from django.conf.urls import include, patterns, url except ImportError: from django.conf.urls.defaults import include, patterns, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', ...
bsd-3-clause
hirokihamasaki/irma
probe/modules/antivirus/avg/avg.py
1
3787
# # Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
apache-2.0
nullishzero/Portage
pym/_emerge/create_depgraph_params.py
2
3934
# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import logging from portage.util import writemsg_level def create_depgraph_params(myopts, myaction): #configure emerge engine parameters # # self: include _this_ package regardless of if it is merged. #...
gpl-2.0
ghold/OneKeySql
onekey/oracle/OkSqlHandler.py
1
1458
import cx_Oracle import logging import os os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' class OkSqlHandler(object): @classmethod def setupConn(cls): # dsn = cx_Oracle.makedsn("10.0.44.99", "1521", "ompdb") dsn = cx_Oracle.makedsn("10.0.76.128", "1521", "omp2st") conn = cx_...
apache-2.0
einaru/cconverter
cconverter.py
1
1284
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Date: Thu Jun 30 17:17:35 CEST 2011 :Version: 1 :Authors: Einar Uvsløkk <einar.uvslokk@linux.com> :Copyright: (c) 2011 Einar Uvsløkk :License: GNU General Public License (GPL) version 3 or later vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 """ import gettext i...
gpl-3.0
Thraxis/SickRage
lib/hachoir_parser/image/bmp.py
95
6682
""" Microsoft Bitmap picture parser. - file extension: ".bmp" Author: Victor Stinner Creation: 16 december 2005 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, UInt8, UInt16, UInt32, Bits, String, RawBytes, Enum, PaddingBytes, NullBytes, createPaddingField) from hachoir_cor...
gpl-3.0
pshen/ansible
docs/docsite/rst/conf.py
37
7361
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
gpl-3.0