repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
dwaynebailey/poedit
deps/boost/libs/python/test/pickle2.py
45
1514
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) r'''>>> import pickle2_ext >>> import pickle >>> pickle2_ext.world.__module__ 'pickle2_ext' >>> pickle2_ext.world.__safe...
mit
pwarren/AGDeviceControl
agdevicecontrol/thirdparty/site-packages/win32/twisted/test/test_unix.py
3
8599
# -*- test-case-name: twisted.test.test_unix -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import stat, os, sys from twisted.internet import interfaces, reactor, protocol, error, address, defer, utils from twisted.python import components, lockfile, failure from twisted.protoc...
gpl-2.0
google/google-ctf
third_party/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/importlib/__init__.py
63
1365
"""Backport of importlib.import_module from 3.x.""" # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, ...
apache-2.0
Changaco/oh-mainline
vendor/packages/Django/django/utils/unittest/util.py
751
2821
"""Various utility functions.""" __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...'...
agpl-3.0
imageio/imageio
tests/test_format.py
1
12094
from pytest import raises from imageio.testing import run_tests_if_main, get_test_dir import os import gc import shutil import numpy as np import imageio from imageio.core import Format, FormatManager, Request from imageio.core import get_remote_file test_dir = get_test_dir() def setup_module(): imageio.form...
bsd-2-clause
jdemel/gnuradio
gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py
3
1933
# # Copyright 2003,2004 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # # misc utilities from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import types class seq_with_cursor (object): ...
gpl-3.0
azureplus/hue
desktop/core/ext-py/Paste-2.0.1/paste/url.py
33
14673
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ This module implements a class for handling URLs. """ from six.moves.urllib.parse import quote, unquote, urlencode import cgi from paste import re...
apache-2.0
theknightorc/p2pool-candycoin
p2pool/bitcoin/script.py
282
2589
from p2pool.util import math, pack def reads_nothing(f): return None, f def protoPUSH(length): return lambda f: pack.read(f, length) def protoPUSHDATA(size_len): def _(f): length_str, f = pack.read(f, size_len) length = math.string_to_natural(length_str[::-1].lstrip(chr(0))) data, f...
gpl-3.0
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v2_8_0/device_cpu_stat_broker.py
16
40187
from ..broker import Broker class DeviceCpuStatBroker(Broker): controller = "device_cpu_stats" def index(self, **kwargs): """Lists the available device cpu stats. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this m...
apache-2.0
Osmose/trephub
vendor-local/lib/python/south/management/commands/migrationcheck.py
23
2648
from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command, CommandError from django.core.management.base import BaseCommand from django.conf import settings from django.db.models import loading from django.test import simple from south.migration import Migrations from sout...
bsd-3-clause
M4sse/chromium.src
content/test/gpu/gpu_tests/webgl_conformance_expectations.py
9
14631
# 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. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class WebGLConformanceExpectations(GpuTest...
bsd-3-clause
AuyaJackie/odoo
addons/point_of_sale/wizard/pos_box.py
381
2211
from openerp.osv import osv from openerp.tools.translate import _ from openerp.addons.account.wizard.pos_box import CashBox class PosBox(CashBox): _register = False def run(self, cr, uid, ids, context=None): if not context: context = dict() active_model = context.get('active_mod...
agpl-3.0
onaio/rapidpro
temba/flows/migrations/0098_flowpathrecentmessage.py
3
1055
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-26 14:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('flows', '0097_interrupt_runs_for_archived_flows'), ] ...
agpl-3.0
CBMM/CBaaS
democlients/deepdream.py
1
4018
# imports and basic notebook setup from cStringIO import StringIO import numpy as np import scipy.ndimage as nd import PIL.Image # from IPython.display import clear_output, Image, display from google.protobuf import text_format import caffe import cbaas try: caffe.set_gpu_mode() except: print "CPU mode caffe_roo...
bsd-3-clause
arnif/CouchPotatoServer
libs/bs4/builder/_lxml.py
36
6297
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] from StringIO import StringIO import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, TreeBuilder, XML) from b...
gpl-3.0
sodafree/backend
build/ipython/build/lib.linux-i686-2.7/IPython/parallel/util.py
3
11405
"""some generic utilities for dealing with classes, urls, and serialization Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the ...
bsd-3-clause
sysadmin75/ansible-modules-core
network/junos/junos_config.py
19
6663
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
quentinlautischer/291MiniProject2
lib/python3.5/site-packages/bsddb3/tests/test_compat.py
1
6164
""" Copyright (c) 2008-2015, Jesus Cea Avion <jcea@jcea.es> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of...
apache-2.0
ipafw/version1.0
lib/ipafw_protocol_check.py
2
6061
import yaml import pyshark import time import os import re import pyshark from robot.api import logger from robot.libraries.BuiltIn import BuiltIn from collections import OrderedDict from sip_message_validation import SipMessageValida...
gpl-2.0
nashve/mythbox
resources/lib/twisted/twisted/protocols/finger.py
81
1246
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """The Finger User Information Protocol (RFC 1288)""" from twisted.protocols import basic import string class Finger(basic.LineReceiver): def lineReceived(self, line): parts = string.split(line) if not parts: ...
gpl-2.0
pipermerriam/django
tests/gis_tests/geos_tests/test_geos_mutation.py
183
5388
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from unittest import skipUnless from django.contrib.gis.geos import ( HAS_GEOS, LinearRing, LineString, MultiPoint, Point, P...
bsd-3-clause
bala4901/odoo
openerpcommand/module.py
10
2435
""" Show module information for a given database or from the file-system. """ import os import sys import textwrap from . import common # TODO provide a --rpc flag to use XML-RPC (with a specific username) instead # of server-side library. def run(args): assert args.database import openerp config = opene...
agpl-3.0
xylar/acciv
tests/convertImages/Vicar.py
2
6017
#!/usr/bin/python import numpy # based on the vicar2png module by Jessica McKellar (jesstess at mit.edu) # substantial modifications have been made to the code. However for # thoroughness, I am including her Copyright under the MIT License below: ''' The MIT License (MIT) Copyright (c) 2012-2013 Jessica McKellar ...
mit
RobertABT/heightmap
build/matplotlib/examples/axes_grid/make_room_for_ylabel_using_axesgrid.py
15
1723
from mpl_toolkits.axes_grid1 import make_axes_locatable from mpl_toolkits.axes_grid1.axes_divider import make_axes_area_auto_adjustable if __name__ == "__main__": import matplotlib.pyplot as plt def ex1(): plt.figure(1) ax = plt.axes([0,0,1,1]) # ax = plt.subplot(111) ax...
mit
eventql/eventql
deps/3rdparty/spidermonkey/mozjs/python/pyyaml/lib/yaml/serializer.py
560
4171
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
agpl-3.0
chiller/pytest
_pytest/standalonetemplate.py
203
3281
#! /usr/bin/env python # Hi There! # You may be wondering what this giant blob of binary data here is, you might # even be worried that we're up to something nefarious (good for you for being # paranoid!). This is a base64 encoding of a zip file, this zip file contains # a fully functional basic pytest script. # # Pyt...
mit
awkspace/ansible
lib/ansible/plugins/terminal/ironware.py
49
2700
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
PlunderKnowledge/SumCrawler
SumCrawlerProducer/SumCrawlerSpider/spiders/__init__.py
1
1529
# This package will contain the spiders of your Scrapy project # # Please refer to the documentation for information on how to create and manage # your spiders. import scrapy import functools import requests def _link_is_http(l): return l.startswith('https://') or l.startswith('http://') def _link_is_archive(l): ...
mit
HiSPARC/station-software
user/python/Lib/site-packages/win32comext/adsi/adsicon.py
29
12541
ADS_ATTR_CLEAR = ( 1 ) ADS_ATTR_UPDATE = ( 2 ) ADS_ATTR_APPEND = ( 3 ) ADS_ATTR_DELETE = ( 4 ) ADS_EXT_MINEXTDISPID = ( 1 ) ADS_EXT_MAXEXTDISPID = ( 16777215 ) ADS_EXT_INITCREDENTIALS = ( 1 ) ADS_EXT_INITIALIZE_COMPLETE = ( 2 ) ADS_SEARCHPREF_ASYNCHRONOUS = 0 ADS_SEARCHPREF_DEREF_ALIASES = 1 ADS_SEARCHPREF_SIZE...
gpl-3.0
arborh/tensorflow
tensorflow/python/keras/engine/data_adapter_test.py
3
30720
# Copyright 2019 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
voutilad/courtlistener
cl/audio/tasks.py
1
7928
import hashlib import json import subprocess import traceback from tempfile import NamedTemporaryFile import httplib2 from celery.canvas import chain from django.conf import settings from google.cloud import storage from google.cloud.exceptions import Forbidden, NotFound from google.cloud.storage import Blob from goog...
agpl-3.0
jmetzen/scikit-learn
sklearn/externals/joblib/func_inspect.py
239
11338
""" My own variation on function-specific inspect-like features. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from itertools import islice import inspect import warnings import re import os from ._compat import _basestrin...
bsd-3-clause
dana-i2cat/felix
optin_manager/src/python/openflow/optin_manager/opts/forms.py
4
5414
from django import forms from openflow.optin_manager.flowspace.utils import dotted_ip_to_int, mac_to_int from django.forms.util import ErrorList import re from openflow.optin_manager.opts.models import AdminFlowSpace class MACAddressForm(forms.Field): def clean(self, value): pattern = re.compile(r"^([0...
apache-2.0
pfarnach/altvote
migrations/versions/4517f9cbe1f9_.py
1
1246
"""empty message Revision ID: 4517f9cbe1f9 Revises: 42ef4a834d23 Create Date: 2016-04-13 22:34:37.727821 """ # revision identifiers, used by Alembic. revision = '4517f9cbe1f9' down_revision = '42ef4a834d23' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
gpl-3.0
TomBaxter/waterbutler
waterbutler/providers/figshare/provider.py
2
42750
import json import asyncio import hashlib from http import HTTPStatus import aiohttp from waterbutler.core import streams from waterbutler.core import provider from waterbutler.core import exceptions from waterbutler.providers.figshare.path import FigsharePath from waterbutler.providers.figshare import metadata, set...
apache-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-relay/azure/mgmt/relay/models/relay_management_client_enums.py
2
1280
# 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
vicky2135/lucious
oscar/lib/python2.7/site-packages/django/utils/feedgenerator.py
42
17789
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
bsd-3-clause
cjh1/StarCluster
starcluster/commands/completers.py
19
4704
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ...
gpl-3.0
jdramani/servo
tests/wpt/css-tests/tools/manifest/item.py
148
5139
import urlparse from abc import ABCMeta, abstractmethod, abstractproperty item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] def get_source_file(source_files, tests_root, manifest, path): def make_new(): from sourcefile import SourceFile return SourceFile(tests_root, path, manife...
mpl-2.0
haoxli/web-testing-service
tools/pywebsocket/src/test/test_util.py
449
7538
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
doismellburning/edx-platform
common/djangoapps/track/tracker.py
239
2374
""" Module that tracks analytics events by sending them to different configurable backends. The backends can be configured using Django settings as the example below:: TRACKING_BACKENDS = { 'tracker_name': { 'ENGINE': 'class.name.for.backend', 'OPTIONS': { 'host': ... , ...
agpl-3.0
llvm-mirror/lldb
packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
9
1924
""" Test lldb command aliases. """ from __future__ import print_function import unittest2 import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class LaunchInTerminalTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) ...
apache-2.0
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
1
3139
# 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 f...
gpl-2.0
isida/vi
plugins/event.py
1
4035
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # # # # iSida bot VI plugin # # Copyright (C) diSable...
gpl-3.0
psiinon/addons-server
src/olympia/tags/models.py
3
3249
from django.db import models from django.urls import NoReverseMatch from olympia import activity, amo from olympia.amo.fields import PositiveAutoField from olympia.amo.models import ManagerBase, ModelBase from olympia.amo.urlresolvers import reverse class TagManager(ManagerBase): def not_denied(self): "...
bsd-3-clause
AniruddhaSAtre/dd-agent
checks.d/vsphere.py
27
33304
# stdlib from copy import deepcopy from datetime import datetime, timedelta from hashlib import md5 from Queue import Empty, Queue import re import time import traceback # 3p from pyVim import connect from pyVmomi import vim # project from checks import AgentCheck from checks.libs.thread_pool import Pool from checks....
bsd-3-clause
jannopet/LEGO-WeDo-2.0-Python-SDK
wedo2/bluetooth/service_manager.py
1
1809
from wedo2.bluetooth import bluetooth_helper from wedo2.bluetooth.connect_info import ConnectInfo from wedo2.services.lego_service_factory import LegoServiceFactory HUB_CHARACTERISTIC_ATTACHED_IO = "0x1527" class ServiceManager: def __init__(self, io): self.io = io self.services = set() ...
mit
holmes/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/context_i386.py
102
16108
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
ctrlaltdylan/CouchPotato
app/lib/provider/yarr/sources/x264.py
8
2981
from app.config.cplog import CPLog from app.lib.provider.yarr.base import torrentBase from imdb.parser.http.bsouplxml._bsoup import SoupStrainer, BeautifulSoup from urllib import quote_plus from urllib2 import URLError import time import urllib import urllib2 log = CPLog(__name__) class x264(torrentBase): """Prov...
gpl-3.0
repotvsupertuga/tvsupertuga.repository
script.module.schism.common/lib/requests/packages/chardet/big5freq.py
3133
82594
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
DHI-GRAS/processing_workflow
ProcessingWorkflowPlugin.py
1
3497
""" *************************************************************************** ProcessingWorkflowPlugin.py ------------------------------------- Copyright (C) 2014 TIGER-NET (www.tiger-net.org) *************************************************************************** * This plugin is part of the Water Observ...
gpl-3.0
bokeh/bokeh
bokeh/util/__init__.py
1
2529
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
AloneRoad/Inforlearn
vendor/django/contrib/gis/utils/layermapping.py
1
29869
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. This grew out of my personal needs, specifically the code repetition that went into pulling geometries and fields out of...
apache-2.0
christophlsa/odoo
addons/sales_team/res_config.py
366
1922
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class sales_team_configuration(osv.TransientModel): _name = 'sale.config.settings' _inherit = ['sale.config.settings'] def set_group_multi_salesteams(self, cr, uid, ids, context=None): """ This method is automatically called by res_conf...
agpl-3.0
krintoxi/NoobSec-Toolkit
NoobSecToolkit - MAC OSX/tools/sqli/thirdparty/chardet/langbulgarianmodel.py
235
12820
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
kartoza/geonode
geonode/contrib/metadataxsl/tests.py
8
1090
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
jhawkesworth/ansible-modules-core
cloud/amazon/ec2_snapshot.py
53
9982
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
Taranys/Sick-Beard
lib/hachoir_core/error.py
90
1350
""" Functions to display an error (error, warning or information) message. """ from lib.hachoir_core.log import log from lib.hachoir_core.tools import makePrintable import sys, traceback def getBacktrace(empty="Empty backtrace."): """ Try to get backtrace as string. Returns "Error while trying to get back...
gpl-3.0
LethusTI/supportcenter
vendor/django/django/contrib/sitemaps/tests/https.py
77
2364
from datetime import date from django.test.utils import override_settings from .base import SitemapTestsBase class HTTPSSitemapTests(SitemapTestsBase): protocol = 'https' urls = 'django.contrib.sitemaps.tests.urls.https' def test_secure_sitemap_index(self): "A secure sitemap index can be rendere...
gpl-3.0
blrm/openshift-tools
ansible/roles/lib_zabbix/library/zbx_triggerprototype.py
13
5976
#!/usr/bin/env python ''' ansible module for zabbix triggerprototypes ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix triggerprototypes ansible module # # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wit...
apache-2.0
sergiocorato/partner-contact
partner_multi_relation/tests/test_partner_relation.py
5
10771
# -*- coding: utf-8 -*- # Copyright 2016 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from datetime import date from dateutil.relativedelta import relativedelta from openerp import fields from openerp.exceptions import ValidationError from .test_partner_relation_common import TestPart...
agpl-3.0
bright-sparks/chromium-spacewalk
tools/perf/measurements/thread_times.py
32
2068
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import timeline_controller from metrics import timeline from telemetry.core.platform import tracing_category_filter from telemetry.page impo...
bsd-3-clause
jenalgit/django
tests/view_tests/tests/test_defaults.py
286
5307
from __future__ import unicode_literals import datetime from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import override_settings from ..models import Article, Author, UrlArticle @override_settings(ROOT_URLCONF='view_te...
bsd-3-clause
thrasher-/litecoin
test/functional/interface_zmq.py
6
4367
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the ZMQ notification interface.""" import struct from test_framework.test_framework import Bitcoi...
mit
Jay-Jay-D/LeanSTP
Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py
3
4365
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
apache-2.0
django-leonardo/horizon
tools/install_venv_common.py
166
5958
# Copyright 2013 OpenStack Foundation # Copyright 2013 IBM 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 ...
apache-2.0
jaechankim/namebench
nb_third_party/dns/tsig.py
215
7851
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
Ictp/indico
indico/MaKaC/plugins/Collaboration/RecordingManager/micala.py
1
24361
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
benschmaus/catapult
telemetry/telemetry/internal/backends/chrome/cros_browser_backend.py
1
9477
# Copyright 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. import logging import os from telemetry.core import exceptions from telemetry.core import util from telemetry import decorators from telemetry.internal.back...
bsd-3-clause
raw1z/ultisnips
pythonx/UltiSnips/snippet/parsing/_lexer.py
29
10109
#!/usr/bin/env python # encoding: utf-8 """Not really a lexer in the classical sense, but code to convert snippet definitions into logical units called Tokens.""" import string import re from UltiSnips.compatibility import as_unicode from UltiSnips.position import Position from UltiSnips.text import unescape class...
gpl-3.0
joebowen/LogMyRocket_API
LogMyRocket/libraries/sys_packages/_pytest/helpconfig.py
180
5120
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
gpl-3.0
pandel/Marlin
buildroot/share/scripts/createTemperatureLookupMarlin.py
6
6204
#!/usr/bin/python """Thermistor Value Lookup Table Generator Generates lookup to temperature values for use in a microcontroller in C format based on: http://en.wikipedia.org/wiki/Steinhart-Hart_equation The main use is for Arduino programs that read data from the circuit board described here: http://reprap.org/wiki/...
gpl-3.0
aricoin/Aricoin
qa/rpc-tests/util.py
1
5260
# Copyright (c) 2014 The Aricoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-aricoinrpc to module search path: import os import sys sys.path.append...
mit
JonWel/CoolProp
Web/scripts/fluid_properties.Consistency.py
3
1267
from __future__ import print_function import os.path import CoolProp import subprocess import sys web_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) root_dir = os.path.abspath(os.path.join(web_dir, '..')) fluids_path = os.path.join(web_dir,'fluid_properties','fluids') plots_path = os.path.join(w...
mit
Galaxy-Nexus-Project/android_omap_tuna
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
anisku11/sublimeku
Packages/pygments/all/pygments/lexers/igor.py
35
16982
# -*- coding: utf-8 -*- """ pygments.lexers.igor ~~~~~~~~~~~~~~~~~~~~ Lexers for Igor Pro. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, words from pygments.token import Text, Commen...
mit
doug-fish/horizon
openstack_dashboard/api/rest/config.py
45
1598
# Copyright 2015 IBM Corp. # Copyright 2015, 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 # # Un...
apache-2.0
2015fallproject/2015fallcase1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_opcodes.py
175
2675
# Python test set -- part 2, opcodes from test.support import run_unittest import unittest class OpcodeTest(unittest.TestCase): def test_try_inside_for_loop(self): n = 0 for i in range(10): n = n+i try: 1/0 except NameError: pass except ZeroDivision...
agpl-3.0
Guidobelix/pyload
module/lib/beaker/crypto/pbkdf2.py
43
11924
#!/usr/bin/python # -*- coding: ascii -*- ########################################################################### # PBKDF2.py - PKCS#5 v2.0 Password-Based Key Derivation # # Copyright (C) 2007 Dwayne C. Litzenberger <dlitz@dlitz.net> # All rights reserved. # # Permission to use, copy, modify, and distribute this s...
gpl-3.0
daenamkim/ansible
lib/ansible/modules/net_tools/snmp_facts.py
24
12848
#!/usr/bin/python # This file is part of Networklore's snmp library for Ansible # 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
YinongLong/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
21
10259
"""Testing for the VotingClassifier""" import numpy as np from sklearn.utils.testing import assert_almost_equal, assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raise_message from sklearn.exceptions import NotFittedError from sklearn.linear_model import Logist...
bsd-3-clause
Jorge-Rodriguez/ansible-modules-core
cloud/docker/docker_login.py
39
9349
#!/usr/bin/python # # (c) 2016 Olaf Kilian <olaf.kilian@symanex.com> # Chris Houseknecht, <house@redhat.com> # James Tanner, <jtanner@redhat.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 ...
gpl-3.0
N-Bz/bybop
src/Bybop_Discovery.py
1
3630
# This sample uses https://pypi.python.org/pypi/zeroconf # as its MDNS implementation from zeroconf import ServiceBrowser, Zeroconf import socket import threading class DeviceID(object): # Drones BEBOP_DRONE = '0901' JUMPING_SUMO = '0902' JUMPING_NIGHT = '0905' JUMPING_RACE = '0906' BEBOP_2 =...
bsd-3-clause
SilverIce/JContainers
dep/boost/tools/build/src/tools/gcc.py
5
38692
# Status: being ported by Steven Watanabe # Base revision: 47077 # TODO: common.jam needs to be ported # TODO: generators.jam needs to have register_c_compiler. # # Copyright 2001 David Abrahams. # Copyright 2002-2006 Rene Rivera. # Copyright 2002-2003 Vladimir Prus. # Copyright (c) 2005 Reece H. Dunn. # Copyright 200...
mit
mkieszek/odoo
openerp/addons/base/tests/test_base.py
4
34257
import unittest2 import openerp.tests.common as common from openerp.exceptions import ValidationError class test_base(common.TransactionCase): def setUp(self): super(test_base,self).setUp() self.res_partner = self.registry('res.partner') self.res_users = self.registry('res.users') ...
agpl-3.0
ovnicraft/openerp-restaurant
sale_crm/report/__init__.py
17
1106
# -*- 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
emilybache/texttest-runner
src/main/python/lib/capturemock/replayinfo.py
1
11846
""" Module to manage the information in the file and return appropriate matches """ import logging, difflib, re, os try: # Python 2.7, Python 3.x from collections import OrderedDict except ImportError: # Python 2.6 and earlier from ordereddict import OrderedDict try: # Python 2.x import config except Impo...
mit
manipopopo/tensorflow
tensorflow/python/data/util/sparse_test.py
32
12006
# 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
yencarnacion/jaikuengine
.google_appengine/lib/django-1.3/django/contrib/gis/geos/tests/test_mutable_list.py
244
14587
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import unittest class UserListA(ListMi...
apache-2.0
bbfamily/abu
abupy/UmpBu/ABuUmpEdgeBase.py
1
25925
# -*- encoding:utf-8 -*- """ 边裁基础实现模块 """ from __future__ import division from __future__ import print_function from __future__ import absolute_import import logging import os from abc import abstractmethod import numpy as np import sklearn.preprocessing as preprocessing from enum import Enum from sklearn.metric...
gpl-3.0
RAtechntukan/CouchPotatoServer
libs/html5lib/treebuilders/etree_lxml.py
1724
14031
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
gpl-3.0
dahlia/pghstore
tests/loads.py
1
7351
# -*- coding: utf-8 -*- import unittest import pghstore class LoadsTests(unittest.TestCase): def test_empty(self): self.assertEqual(pghstore.loads(''), {}) def test_simple(self): self.assertEqual(pghstore.loads('"key" => "value"'), {"key": "value"}) self.assertEqual( pghsto...
mit
adkerr/tempest
tempest/openstack/common/local.py
57
1722
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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.apac...
apache-2.0
lcamacho/airmozilla
airmozilla/manage/tests/views/test_channels.py
1
4246
from nose.tools import eq_, ok_ from funfactory.urlresolvers import reverse from airmozilla.main.models import Channel from .base import ManageTestCase class TestChannels(ManageTestCase): def setUp(self): super(TestChannels, self).setUp() Channel.objects.create( name='Testing', ...
bsd-3-clause
googleads/google-ads-python
google/ads/googleads/v6/enums/types/device.py
1
1201
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
4rado/RepositoryForProject
Lib/site-packages/numpy/distutils/cpuinfo.py
51
22808
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" """ cpuinfo Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See ...
gpl-3.0
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/pyqtgraph/graphicsItems/LegendItem.py
34
6755
from .GraphicsWidget import GraphicsWidget from .LabelItem import LabelItem from ..Qt import QtGui, QtCore from .. import functions as fn from ..Point import Point from .ScatterPlotItem import ScatterPlotItem, drawSymbol from .PlotDataItem import PlotDataItem from .GraphicsWidgetAnchor import GraphicsWidgetAnchor __all...
gpl-3.0
SymbiFlow/python-symbiflow-v2x
v2x/vlog_to_model.py
1
8475
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ Convert a Verilog simulation model to a V...
isc
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/win32/Demos/CreateFileTransacted_MiniVersion.py
17
2759
""" This demonstrates the creation of miniversions of a file during a transaction. The FSCTL_TXFS_CREATE_MINIVERSION control code saves any changes to a new miniversion (effectively a savepoint within a transaction). """ import win32file, win32api, win32transaction import win32con, winioctlcon import struct import os ...
gpl-3.0
hrasdt/cult-panel
Taskbar.py
1
7577
from gi.repository import Clutter, Wnck import arrow from PagerModel import PagerModel from PagerModel import is_skipped_tasklist, is_mini, is_urgent, is_active, is_normal def new_pixbuf_texture(ww, hh, pb): t = Clutter.Texture.new() # Set dimensions. t.set_width(ww) t.set_height(hh) # S...
bsd-2-clause