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
DDEFISHER/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/vendored_packages/pluggy.py
178
29861
""" PluginManager, basic initialization and tracing. pluggy is the cristallized core of plugin management as used by some 150 plugins for pytest. Pluggy uses semantic versioning. Breaking changes are only foreseen for Major releases (incremented X in "X.Y.Z"). If you want to use pluggy in your project you should thu...
mpl-2.0
TanguyPatte/phantomjs-packaging
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/descriptor_test.py
295
10605
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
jbking/demo-appengine-django-golang
myproject/django/utils/datastructures.py
102
15759
import copy import warnings from django.utils import six class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given dictionaries, only the f...
mit
wjakob/layerlab
recipes/utils/materials.py
1
6279
# Complex-valued IOR curves for a few metals from scipy import interpolate lambda_gold = [298.75705, 302.400421, 306.133759, 309.960449, 313.884003, 317.908142, 322.036835, 326.274139, 330.624481, 335.092377, 339.682678, 344.400482, 349.251221, 354.240509, 359.37442, 364.659332, 370.10202, 375.709625, 381...
bsd-2-clause
angus-ai/angus-jumpingsumo
wrapper.py
1
3347
# -*- coding: utf-8 -*- #!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licens...
apache-2.0
nhatbui/pysuite
pookeeper/pookeeper/pookeeper.py
1
7385
import os from collections import defaultdict, OrderedDict from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor class ZooKeeper(LineReceiver): def __init__(self, connection_addr, znodes, ephem_nodes): self.address = connection...
mit
TangHao1987/intellij-community
python/lib/Lib/distutils/command/bdist_msi.py
88
30900
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005, 2006 Martin v. Löwis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst """ Implements the bdist_msi command. """ import sys, os, string from distutils.core import Command from distutils.util import get_platfor...
apache-2.0
LiangfengD/code-for-blog
2009/pygame_creeps_game/utils.py
12
1122
class Timer(object): """ A Timer that can periodically call a given callback function. After creation, you should call update() with the amount of time passed since the last call to update() in milliseconds. The callback calls will result synchronously du...
unlicense
muffl0n/ansible-modules-extras
packaging/os/pkgng.py
60
11130
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, bleader # Written by bleader <bleader@ratonland.org> # Based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <http://github.com/afterburn> # that was based on apt module written by Matthew W...
gpl-3.0
RickMohr/otm-core
opentreemap/opentreemap/context_processors.py
3
2411
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import copy from django.conf import settings from django.contrib.staticfiles import finders from django.utils.timezone import now from django.utils.translation import ugettext as _ fr...
agpl-3.0
boto/botoflow
botoflow/constants.py
2
3075
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0 # # or in the "license" file accompa...
apache-2.0
FluidityStokes/fluidity
tests/mms_tracer_P1dg_cdg_diff_steady_3d_cjc_inhNmnnbc/cdg3d.py
1
1504
import os from fluidity_tools import stat_parser from sympy import * from numpy import array,max,abs meshtemplate=''' Point(1) = {0.0,0.0,0,0.1}; Extrude {1,0,0} { Point{1}; Layers{<layers>}; } Extrude {0,1,0} { Line{1}; Layers{<layers>}; } Extrude {0,0,1} { Surface{5}; Layers{<layers>}; } //Z-normal surface, z=...
lgpl-2.1
jpush/jbox
Server/venv/lib/python3.5/site-packages/werkzeug/_reloader.py
144
8336
import os import sys import time import subprocess import threading from itertools import chain from werkzeug._internal import _log from werkzeug._compat import PY2, iteritems, text_type def _iter_module_files(): """This iterates over all relevant Python files. It goes through all loaded files from modules,...
mit
hzlf/openbroadcast
website/apps/__rework_in_progress/importer/api.py
1
7486
from django.conf import settings from django.conf.urls.defaults import * from django.contrib.auth.models import User from django.db.models import Count import json from tastypie import fields from tastypie.authentication import * from tastypie.authorization import * from tastypie.resources import ModelResource, Resourc...
gpl-3.0
snehasi/servo
python/servo/post_build_commands.py
16
9628
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/distutils/emxccompiler.py
250
11931
"""distutils.emxccompiler Provides the EMXCCompiler class, a subclass of UnixCCompiler that handles the EMX port of the GNU C compiler to OS/2. """ # issues: # # * OS/2 insists that DLLs can have names no longer than 8 characters # We put export_symbols in a def-file, as though the DLL can have # an arbitrary len...
apache-2.0
gao-feng/auditns
tools/perf/util/setup.py
2079
1438
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
NEricN/RobotCSimulator
Python/App/Lib/test/test_calendar.py
73
28850
import calendar import unittest from test import test_support import locale import datetime result_2004_text = """ 2004 January February March Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 ...
apache-2.0
wangyikai/grpc
src/python/grpcio_test/grpc_test/framework/interfaces/face/_event_invocation_synchronous_event_service.py
11
15944
# Copyright 2015, 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...
bsd-3-clause
michael-berlin/vitess
py/vtdb/db_object_custom_sharded.py
6
1827
"""Module containing base class for tables in custom sharded keyspace. Vitess sharding scheme is range-sharded. Vitess supports routing for other sharding schemes by allowing explicit shard_name addressing. This implementation is not fully complete as yet. """ from vtdb import db_object from vtdb import dbexceptions f...
bsd-3-clause
crempp/mdweb
mdweb/SiteMapView.py
1
2696
"""MDWeb SiteMap View Object.""" import datetime import logging import numbers import os import pytz import time from flask import ( current_app as app, make_response, render_template_string, url_for, ) from flask.views import View #: Template string to use for the sitemap generation # (is there a bet...
mit
yangbh/Hammer
lib/knock/modules/dns/rdtypes/ANY/LOC.py
3
12894
# Copyright (C) 2003-2007, 2009-2011 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 "...
gpl-2.0
jumping/Diamond
src/collectors/jolokia/jolokia.py
3
8461
# coding=utf-8 """ Collects JMX metrics from the Jolokia Agent. Jolokia is an HTTP bridge that provides access to JMX MBeans without the need to write Java code. See the [Reference Guide](http://www.jolokia.org/reference/html/index.html) for more information. By default, all MBeans will be queried for metrics. All n...
mit
kangkot/arangodb
3rdParty/V8-4.3.61/tools/testrunner/server/status_handler.py
123
4154
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
TemoaProject/temoa
temoa_model/temoa_config.py
1
19245
""" Tools for Energy Model Optimization and Analysis (Temoa): An open source framework for energy systems optimization modeling Copyright (C) 2015, NC State University 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 So...
gpl-2.0
tyagiarpit/servo
tests/wpt/css-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
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/ARB/texture_view.py
9
1978
'''OpenGL extension ARB.texture_view This module customises the behaviour of the OpenGL.raw.GL.ARB.texture_view to provide a more Python-friendly API Overview (from the spec) This extension allows a texture's data store to be "viewed" in multiple ways, either reinterpreting the data format/type as a different ...
mit
Francis-Liu/animated-broccoli
nova/vnc/xvp_proxy.py
16
6278
#!/usr/bin/env python # 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/LICEN...
apache-2.0
reaperhulk/bcrypt
tests/test_bcrypt.py
2
16169
import os import pytest import bcrypt _test_vectors = [ ( b"Kk4DQuMMfZL9o", b"$2b$04$cVWp4XaNU8a4v1uMRum2SO", b"$2b$04$cVWp4XaNU8a4v1uMRum2SO026BWLIoQMD/TXg5uZV.0P.uO8m3YEm", ), ( b"9IeRXmnGxMYbs", b"$2b$04$pQ7gRO7e6wx/936oXhNjrO", b"$2b$04$pQ7gRO7e6wx/936...
apache-2.0
armyofevilrobots/reticulatus
reticulatus/gui/reticulate_main.py
1
13375
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'reticulate_main.ui' # # Created: Thu Oct 25 21:48:45 2012 # by: pyside-uic 0.2.13 running on PySide 1.1.0 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_main_window(object): def ...
gpl-3.0
darklordIN/android_kernel_sony_nicki-1
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
Ichimonji10/robottelo
robottelo/ui/container.py
1
8490
# -*- encoding: utf-8 -*- from robottelo.constants import FILTER from robottelo.ui.base import Base, UINoSuchElementError, UIError from robottelo.ui.locators import common_locators, locators, tab_locators from robottelo.ui.navigator import Navigator class Container(Base): """Provides the CRUD functionality for Do...
gpl-3.0
b-me/django
tests/null_fk_ordering/tests.py
381
2012
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Author, Comment, Forum, Post, SystemInfo class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Key...
bsd-3-clause
Maximilian-Reuter/SickRage-1
lib/unidecode/x05e.py
250
4668
data = ( 'Za ', # 0x00 'Bi ', # 0x01 'Shi ', # 0x02 'Bu ', # 0x03 'Ding ', # 0x04 'Shuai ', # 0x05 'Fan ', # 0x06 'Nie ', # 0x07 'Shi ', # 0x08 'Fen ', # 0x09 'Pa ', # 0x0a 'Zhi ', # 0x0b 'Xi ', # 0x0c 'Hu ', # 0x0d 'Dan ', # 0x0e 'Wei ', # 0x0f 'Zhang ', # 0x10 'Tang ...
gpl-3.0
Atlas-Sailed-Co/oppia
extensions/interactions/MultipleChoiceInput/MultipleChoiceInput.py
9
1636
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
umars/npyscreen
build/lib/npyscreen/fmActionFormV2.py
15
3791
import operator import weakref from . import wgwidget as widget from . import wgbutton from . import fmForm class ActionFormV2(fmForm.FormBaseNew): class OK_Button(wgbutton.MiniButtonPress): def whenPressed(self): return self.parent._on_ok() class Cancel_Button(wgbutton.MiniButtonPress...
bsd-2-clause
tomsilver/nupic
tests/integration/nupic/engine/network_testnode_interchangeability.py
17
6158
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
TonnyXu/Zxing
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/javac.py
34
8563
"""SCons.Tool.javac Tool-specific initialization for javac. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation #...
apache-2.0
caseyrygt/osf.io
tests/test_identifiers.py
33
8807
# -*- coding: utf-8 -*- import httpretty from factory import SubFactory from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import AuthUserFactory from tests.factories import ModularOdmFactory from tests.factories import RegistrationFactory from tests.test_addons import assert_url...
apache-2.0
pvinis/gitxu
sign.py
8
2521
#!/usr/bin/env python # Original work by Rowan James at https://gist.github.com/rowanj/5475988 # This is free and unencumbered software released into the public domain. # http://unlicense.org import argparse import subprocess import os import glob import stat def sign(target, key, verbose=0): print('Signing ' +...
gpl-2.0
Health123/ansible
plugins/inventory/ssh_config.py
108
3198
#!/usr/bin/env python # (c) 2014, Tomas Karasek <tomas.karasek@digile.fi> # # 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 # (a...
gpl-3.0
yugui/grpc
tools/gcp/stress_test/stress_test_utils.py
34
8833
#!/usr/bin/env python2.7 # Copyright 2015, 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 lis...
bsd-3-clause
mitodl/micromasters
cms/migrations/0025_infolinks.py
1
1226
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-05 22:18 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0024_programtabpage'), ...
bsd-3-clause
tinchoss/Python_Android
python-build/python-libs/gdata/src/gdata/service.py
136
67387
#!/usr/bin/python # # Copyright (C) 2006,2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
lidiamcfreitas/FenixScheduleMaker
ScheduleMaker/brython/www/src/Lib/test/test_contains.py
173
2641
from collections import deque from test.support import run_unittest import unittest class base_set: def __init__(self, el): self.el = el class myset(base_set): def __contains__(self, el): return self.el == el class seq(base_set): def __getitem__(self, n): return [self.el][n] cla...
bsd-2-clause
0jpq0/kbengine
kbe/src/lib/python/Lib/encodings/cp1253.py
272
13094
""" Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.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...
lgpl-3.0
sniemi/SamPy
sandbox/src1/examples/font_indexing.py
4
1299
""" A little example that shows how the various indexing into the font tables relate to one another. Mainly for mpl developers.... """ import matplotlib from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, KERNING_UNFITTED, KERNING_UNSCALED #fname = '/usr/share/fonts/sfd/FreeSans.ttf' fname = matplotlib.get_da...
bsd-2-clause
soldag/home-assistant
tests/components/light/test_device_trigger.py
6
8220
"""The test for light device automation.""" from datetime import timedelta import pytest import homeassistant.components.automation as automation from homeassistant.components.light import DOMAIN from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON from homeassistant.helpers import device_registry from ...
apache-2.0
innotechsoftware/Quantum-GIS
python/console/console_editor.py
2
56306
# -*- coding:utf-8 -*- """ /*************************************************************************** Python Console for QGIS ------------------- begin : 2012-09-10 copyright : (C) 2012 by Salvatore Larosa email : lrssvtml (at) gmail (dot) com ***...
gpl-2.0
eagle00789/PythonMiniProbe
test_sensors.py
1
3294
#!/usr/bin/env python from nose.tools import * from sensors import nmap,adns,apt,cpuload,cputemp def test_nmap_get_kind(): """nmap returns the correct kind""" test_nmap = nmap.NMAP() assert_equal(test_nmap.get_kind(), 'mpnmap') def test_nmap_icmp_echo_request(): """nmap const ICMP_ECHO_REQUEST is set...
bsd-3-clause
hurrinico/sale-workflow
sale_order_type/models/sale_order.py
6
2083
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import api, fields, models class SaleOrde...
agpl-3.0
vpelletier/neoppod
neo/master/backup_app.py
1
16200
# # Copyright (C) 2012-2016 Nexedi SA # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed...
gpl-2.0
redhat-openstack/glance
glance/cmd/registry.py
1
2664
#!/usr/bin/env python # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file ...
apache-2.0
abomyi/django
tests/file_uploads/tests.py
118
23513
#! -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import errno import hashlib import json import os import shutil import tempfile as sys_tempfile import unittest from io import BytesIO from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploaded...
bsd-3-clause
askeing/servo
tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/form_controls.py
3
3067
import pytest from tests.support.asserts import assert_error, assert_same_element, assert_success from tests.support.inline import inline def element_send_keys(session, element, text): return session.transport.send( "POST", "/session/{session_id}/element/{element_id}/value".format( se...
mpl-2.0
WarrenWeckesser/numpy
numpy/core/tests/test_records.py
6
19694
import collections.abc import textwrap from os import path from pathlib import Path import pytest import numpy as np from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises, temppath, ) from numpy.compat import pickle class TestFromrecords: def ...
bsd-3-clause
mapr/hue
desktop/core/ext-py/Django-1.6.10/django/shortcuts/__init__.py
116
5748
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http i...
apache-2.0
noba3/KoTos
lib/libUPnP/Platinum/Build/Tools/Scripts/XCodeMake.py
262
2126
#! /usr/bin/env python """ XCode Build Script $Id: XCodeMake.py 655 2010-09-29 22:40:22Z soothe $ """ import os import sys import getopt import subprocess # ------------------------------------------------------------ # usage # ------------------------------------------------------------ def usage(errMsg): ...
gpl-2.0
nolanliou/tensorflow
tensorflow/python/saved_model/tag_constants.py
7
1608
# 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
timoschwarzer/blendworks
BlendWorks Server/python/Lib/site-packages/setuptools/__init__.py
219
3317
"""Extensions to the 'distutils' for large or complex distributions""" import os import sys import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path import setuptools.version from setuptools.extension import Extension from setuptools.dist i...
gpl-2.0
mrquim/mrquimrepo
script.module.youtube.dl/lib/youtube_dl/extractor/vodlocker.py
64
2796
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, NO_DEFAULT, sanitized_Request, urlencode_postdata, ) class VodlockerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vodlocker\.(?:com|city)/(?:embed-)?(?P<id>[0-9a-...
gpl-2.0
darnould/integrations-core
redisdb/check.py
2
15640
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) ''' Redis checks ''' # stdlib from collections import defaultdict import re import time # 3rd party import redis # project from checks import AgentCheck DEFAULT_MAX_SLOW_ENTRIES = 128 MAX_SLOW_ENTRIES_KEY = "sl...
bsd-3-clause
Distrotech/lxc
src/python-lxc/lxc/__init__.py
29
15796
# # -*- coding: utf-8 -*- # python-lxc: Python bindings for LXC # # (C) Copyright Canonical Ltd. 2012 # # Authors: # Stéphane Graber <stgraber@ubuntu.com> # # This library 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 Sof...
lgpl-2.1
gooddata/openstack-nova
nova/tests/functional/api_sample_tests/test_keypairs.py
3
12708
# Copyright 2012 Nebula, Inc. # 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 required...
apache-2.0
wd5/jangr
djangoappengine/db/utils.py
4
1850
from google.appengine.datastore.datastore_query import Cursor from django.db import models, DEFAULT_DB_ALIAS try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. class CursorQueryMixin(object): def clone(self, *args, **kwargs): ...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_vpn_server_configurations_operations.py
1
28218
# 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 may ...
mit
EvanK/ansible
lib/ansible/modules/cloud/cloudscale/cloudscale_server.py
7
12775
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.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 ANSIBLE_METADATA = {'metadata_ve...
gpl-3.0
edhuckle/statsmodels
statsmodels/examples/example_enhanced_boxplots.py
33
3179
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm # Necessary to make horizontal axis labels fit plt.rcParams['figure.subplot.bottom'] = 0.23 data = sm.datasets.anes96.load_pandas() party_ID = np.arange(7) labels = ["Strong Democrat", "Weak Democr...
bsd-3-clause
TRESCLOUD/odoo
addons/lunch/wizard/__init__.py
440
1053
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
beyang/protobuf
python/google/protobuf/internal/encoder.py
484
25695
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
dago/ansible-modules-extras
cloud/cloudstack/cs_loadbalancer_rule.py
31
11531
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # (c) 2015, René Moser <mail@renemoser.net> # # 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 So...
gpl-3.0
adusca/treeherder
treeherder/perf/models.py
1
2417
from django.core.validators import MinLengthValidator from django.db import models from django.utils.encoding import python_2_unicode_compatible from jsonfield import JSONField from treeherder.model.models import (MachinePlatform, OptionCollection, ...
mpl-2.0
Lh4cKg/brython
www/src/Lib/test/unittests/test_netrc.py
123
4607
import netrc, os, unittest, sys, textwrap from test import support temp_filename = support.TESTFN class NetrcTestCase(unittest.TestCase): def make_nrc(self, test_data): test_data = textwrap.dedent(test_data) mode = 'w' if sys.platform != 'cygwin': mode += 't' with open...
bsd-3-clause
lovetox/gajim
src/common/crypto.py
1
4823
# common crypto functions (mostly specific to XEP-0116, but useful elsewhere) # -*- coding:utf-8 -*- ## src/common/crypto.py ## ## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com> ## ## This file is part of Gajim. ## ## Gajim is free software; you can redistribute it and/or modify ## it under the terms of the ...
gpl-3.0
timj/scons
bin/time-scons.py
6
12346
#!/usr/bin/env python # # time-scons.py: a wrapper script for running SCons timings # # This script exists to: # # 1) Wrap the invocation of runtest.py to run the actual TimeSCons # timings consistently. It does this specifically by building # SCons first, so .pyc compilation is not part of the t...
mit
vipulroxx/sympy
sympy/series/acceleration.py
98
3314
""" Convergence acceleration / extrapolation methods for series and sequences. References: Carl M. Bender & Steven A. Orszag, "Advanced Mathematical Methods for Scientists and Engineers: Asymptotic Methods and Perturbation Theory", Springer 1999. (Shanks transformation: pp. 368-375, Richardson extrapolation: pp. 375-3...
bsd-3-clause
python-dirbtuves/it-brandos-egzaminai
exams/E2018/pagrindinis/u2/u2.py
1
1377
from itertools import islice from pathlib import Path from typing import Dict def seconds(v: int, m: int, s: int) -> int: # Ši funkcija verčia valandas, minutes ir sekundes į sekundes. return v * 3600 + m * 60 + s def save_results(path: Path, pabaiga: Dict[str, int]) -> None: with path.open('w') as f: ...
agpl-3.0
Woraufhin/logic
formula.py
1
1112
import itertools import string from abc import ABCMeta, abstractproperty import attr def is_valid_formula(inst, attr, value): if not isinstance(value, (Formula, str)): raise ValueError('{} is not a valid formula type.'.format(value)) class Formula(object): __metaclass__ = ABCMeta group = {'ope...
mit
googleapis/python-dataflow-client
google/cloud/dataflow_v1beta3/types/snapshots.py
1
5677
# -*- 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 or...
apache-2.0
bradleypj823/swift
test/unit/common/middleware/test_slo.py
9
83414
# -*- coding: utf-8 -*- # Copyright (c) 2013 OpenStack Foundation # # 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 appl...
apache-2.0
habibiefaried/ryu
ryu/contrib/ovs/stream.py
46
12200
# Copyright (c) 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
invariantor/ImageSplit-Classification
image split and classification/image_split.py
1
6276
import numpy as np import pylab import mahotas as mh import types # constants upper_distance = 100 #the start searching approxWidth = 40 threshold = 300 border = 1 def pre_process(image): """ pre_process will return black_white image, given a colorful image as input. """ T = mh.threshol...
mit
dancingdan/tensorflow
tensorflow/contrib/checkpoint/python/python_state_test.py
16
4059
# Copyright 2018 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
JulienMcJay/eclock
windows/Python27/Lib/hashlib.py
84
5011
# $Id$ # # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing the given hash function; initializing th...
gpl-2.0
spaceof7/QGIS
python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py
5
1321
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_edgedensity.py ------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ********************...
gpl-2.0
Maselkov/GW2Bot
guildwars2/evtc.py
1
12990
import datetime import aiohttp import discord from discord.ext import commands from discord.ext.commands.cooldowns import BucketType from .exceptions import APIError from .utils.chat import (embed_list_lines, en_space, magic_space, zero_width_space) UTC_TZ = datetime.timezone.utc BASE_URL =...
mit
cloudbase/nova-virtualbox
nova/openstack/common/uuidutils.py
9
1077
# Copyright (c) 2012 Intel 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 re...
apache-2.0
AcalephStorage/ceph-docker
examples/kubernetes/rgw_s3_client.py
5
1326
#!/usr/bin/env python import boto import boto.s3.connection access_key = 'XXXXXXXXXXXXXXXXXXXX' secret_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' conn = boto.connect_s3( aws_access_key_id = access_key, aws_secret_access_key = secret_key, host = '0.0.0.0', port = None, # Leav...
apache-2.0
DhashS/scala_comp_robo_sign_detection
src/main/venv/lib/python3.5/site-packages/setuptools/dist.py
79
37481
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError) from distutils.util import rfc822_escape import six f...
gpl-3.0
juhnowski/FishingRod
production/pygsl-0.9.5/tests/block_test.py
1
60228
#!/usr/bin/env python # Author : Pierre Schnizer import types import tempfile import pygsl import pygsl._numobj as nummodule from pygsl import vector, ArrayType from pygsl import matrix_pierre matrix = matrix_pierre from pygsl import _block, get_typecode from array_check import myord, myorda, array_check import unit...
mit
rawodb/bitcoin
test/functional/interface_bitcoin_cli.py
1
4196
#!/usr/bin/env python3 # Copyright (c) 2017 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 bitcoin-cli""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util ...
mit
wong2/sentry
src/sentry/migrations/0126_auto__add_field_option_last_updated.py
36
25153
# -*- 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 field 'Option.last_updated' db.add_column('sentry_option', 'last_updated', se...
bsd-3-clause
fanghuaqi/mbed
tools/host_tests/tcpecho_server_loop.py
73
1349
""" mbed SDK Copyright (c) 2011-2013 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 or agreed to in wr...
apache-2.0
blokweb/androguard
tests/test_analysis_offset.py
38
4153
#!/usr/bin/env python import sys, re PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from androguard.core.androgen import AndroguardS from androguard.core.analysis import analysis from androguard.core.bytecodes.jvm import BRANCH2_JVM_OPCODES, determineNext TEST_CASE = 'examples/java/TC/orig/TCE.class' VALUES =...
apache-2.0
CitoEngine/cito_engine
app/tests/test_comments_view.py
1
2629
"""Copyright 2014 Cyrus Dasadia 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 distr...
apache-2.0
mit-ll/LO-PHI
lophi-automation/lophi_automation/dataconsumers/logudp.py
1
1294
""" Class to handle logging over UDP (c) 2015 Massachusetts Institute of Technology """ # Native import socket import logging logger = logging.getLogger(__name__) class LogUDP: def __init__(self,address,port): """ Intialize our UDP logger @param addre...
bsd-3-clause
2014cdag11/2014cadg11
wsgi/static/Brython2.1.0-20140419-113919/Lib/importlib/__init__.py
102
3309
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirectly). Since...
gpl-2.0
patrickwind/My_Blog
venv/lib/python2.7/site-packages/werkzeug/testsuite/contrib/wrappers.py
146
3291
# -*- coding: utf-8 -*- """ werkzeug.testsuite.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Added tests for the sessions. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from werkzeug.testsuit...
gpl-2.0
xuegang/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/package/gphdfs/lib/phd_rpm_util.py
21
16341
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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
willingc/oh-mainline
vendor/packages/Pygments/pygments/lexers/dotnet.py
71
24916
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
agpl-3.0