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
Akrog/sqlalchemy
lib/sqlalchemy/testing/profiling.py
58
8241
# testing/profiling.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Profiling support for unit and performance tests. These are special purpose...
mit
avlach/univbris-ocf
expedient/src/python/expedient/clearinghouse/resources/models.py
4
2370
''' @author: jnaous ''' from django.db import models from expedient.clearinghouse.aggregate.models import Aggregate from expedient.common.extendable.models import Extendable from expedient.clearinghouse.slice.models import Slice from expedient.common.utils.validators import asciiValidator from datetime import datetime ...
bsd-3-clause
debguy0x/PyBitmessage
src/class_smtpServer.py
2
6866
import asyncore import base64 import email from email.parser import Parser from email.header import decode_header import re import signal import smtpd import threading import time from addresses import decodeAddress from debug import logger from helper_sql import sqlExecute from helper_threading import StoppableThread...
mit
memsharded/conan-protobuf
conanfile.py
1
5117
from conans import ConanFile, CMake, tools, ConfigureEnvironment import os import shutil class ProtobufConan(ConanFile): name = "Protobuf" version = "2.6.1" url = "https://github.com/memsharded/conan-protobuf.git" license = "https://github.com/google/protobuf/blob/v2.6.1/LICENSE" requires = "zlib/...
mit
cooperra/antlr4
runtime/Python3/src/antlr4/error/Errors.py
17
8123
# [The "BSD license"] # Copyright (c) 2012 Terence Parr # Copyright (c) 2012 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # 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. Redistr...
bsd-3-clause
Bismarrck/pymatgen
pymatgen/analysis/xas/spectrum.py
8
1581
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from pymatgen.core.spectrum import Spectrum import numpy as np """ This module defines classes to represent all xas """ __author__ = "Chen Zheng" __copyright__ = "Copyright 2012, The Materials Project" __vers...
mit
pinax/pinax-waitinglist
pinax/waitinglist/management/commands/mail_out_survey_links.py
1
1323
from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMessage from django.core.management.base import BaseCommand from django.template.loader import render_to_string from ...models import Survey, WaitingListEntry class Command(BaseCommand): help = "Email...
mit
daeseokyoun/youtube-dl
youtube_dl/extractor/varzesh3.py
23
3236
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_parse_qs, ) from ..utils import ( clean_html, remove_start, ) class Varzesh3IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?video\.varzesh3\.c...
unlicense
openstack/neutron-vpnaas
neutron_vpnaas/db/migration/alembic_migrations/versions/newton/expand/52783a36bd67_support_local_id.py
1
1194
# Copyright 2016 <Yi Jing Zhu/IBM> # # 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
geometryzen/geometryzen
node_modules/lineman/node_modules/testem/node_modules/js-yaml/support/pyyaml-src/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
mit
SinnerSchraderMobileMirrors/django-cms
cms/extensions/admin.py
3
4039
from cms.models import Page, Title from django.contrib import admin from django.contrib.admin.options import csrf_protect_m from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect class ExtensionAdmin(admin.ModelAdmin): pass c...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/feature/tests/test_corner.py
3
18516
import numpy as np from skimage._shared.testing import assert_array_equal from skimage._shared.testing import assert_almost_equal, assert_warns from skimage import data from skimage import img_as_float from skimage import draw from skimage.color import rgb2gray from skimage.morphology import octagon from skimage._share...
gpl-3.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pip/_vendor/distlib/version.py
335
23711
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
agpl-3.0
ojengwa/oh-mainline
vendor/packages/python-social-auth/social/apps/django_app/utils.py
68
2402
import warnings from functools import wraps from django.conf import settings from django.core.urlresolvers import reverse from django.http import Http404 from social.utils import setting_name, module_member from social.exceptions import MissingBackend from social.strategies.utils import get_strategy from social.back...
agpl-3.0
fbidu/namebench
libnamebench/tk.py
173
13586
# Copyright 2009 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 ...
apache-2.0
korealerts1/sentry
src/sentry/migrations/0196_auto__del_field_organization_owner.py
18
38057
# -*- 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): # Deleting field 'Organization.owner' db.delete_column(u'sentry_organizat...
bsd-3-clause
rmcantin/bayesopt
python/demo_dimscaling.py
2
2057
#!/usr/bin/env python # ------------------------------------------------------------------------- # This file is part of BayesOpt, an efficient C++ library for # Bayesian optimization. # # Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es> # # BayesOpt is free software: you can redistribute ...
agpl-3.0
ohadbc/hwspinlock-next
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
doomsterinc/odoo
addons/l10n_ar/__openerp__.py
260
1695
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
luiseduardohdbackup/odoo
addons/point_of_sale/wizard/pos_open_statement.py
387
4217
# -*- 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
streamdataio/EventSource
test_server/evsutils/log.py
4
4140
# -*- coding: utf-8 -*- """ shared.log ~~~~~~~~~~ AmvTek attend to take control of twisted logging :copyright: (c) 2012 by sc AmvTek srl :email: devel@amvtek.com """ import sys from logging import DEBUG,INFO,WARNING,ERROR,FATAL from zope.interface import implements from twisted.python import co...
mit
conductor-tutti/space_for_us
lib/jinja2/testsuite/loader.py
411
8162
# -*- coding: utf-8 -*- """ jinja2.testsuite.loader ~~~~~~~~~~~~~~~~~~~~~~~ Test the loaders. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import tempfile import shutil import unittest from jinja2.testsuite import JinjaTestCase, dic...
apache-2.0
zchee/iTerm2
tools/ply/ply-3.4/ply/cpp.py
192
33040
# ----------------------------------------------------------------------------- # cpp.py # # Author: David Beazley (http://www.dabeaz.com) # Copyright (C) 2007 # All rights reserved # # This module implements an ANSI-C style lexical preprocessor for PLY. # -------------------------------------------------------------...
gpl-2.0
miguelparaiso/PracticaOdoo
addons/base_import_module/models/base_import_module.py
344
2066
import base64 from StringIO import StringIO from io import BytesIO from openerp.osv import osv, fields class base_import_module(osv.TransientModel): """ Import Module """ _name = "base.import.module" _description = "Import Module" _columns = { 'module_file': fields.binary('Module .ZIP file', r...
agpl-3.0
egdetti/91OGAutoScheduler
91OGAutoScheduler_1.2.py
1
20827
############################################################################### # 91 OG Auto-Scheduler v1.2 # # Written in Python v3.5.1 # # Description: Given a squadron roster/schedule input .csv, this program # creates a complete alert schedule for the selected 91 OG # squadron...
agpl-3.0
futurulus/scipy
scipy/weave/blitz_tools.py
97
4159
from __future__ import absolute_import, print_function import parser import sys import warnings import copy import numpy from . import ast_tools from . import slice_handler from . import size_check from . import converters from . import inline_tools from .inline_tools import attempt_function_call function_catalog = ...
bsd-3-clause
kgiusti/dispatch
python/qpid_dispatch_internal/policy/policy_local.py
2
42708
# # 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...
apache-2.0
keen99/SickRage
lib/requests/packages/chardet/universaldetector.py
1776
6840
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
shail2810/nova
nova/tests/unit/scheduler/filters/test_affinity_filters.py
56
8801
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/pythonwin/pywin/scintilla/find.py
13
12052
# find.py - Find and Replace import win32con, win32api import win32ui from pywin.mfc import dialog import afxres from pywin.framework import scriptutils FOUND_NOTHING=0 FOUND_NORMAL=1 FOUND_LOOPED_BACK=2 FOUND_NEXT_FILE=3 class SearchParams: def __init__(self, other=None): if other is None: self.__dict__['findT...
mit
rhololkeolke/apo-website
src/werkzeug/urls.py
73
18959
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ This module implements various URL related functions. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import urlparse from werkzeug._internal import _decode_unicode fr...
bsd-3-clause
meh/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream.py
496
2872
#!/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...
mpl-2.0
mzp/iTerm2
tools/ply/ply-3.4/example/BASIC/basiclog.py
166
1694
# An implementation of Dartmouth BASIC (1964) # import sys sys.path.insert(0,"../..") if sys.version_info[0] >= 3: raw_input = input import logging logging.basicConfig( level = logging.INFO, filename = "parselog.txt", filemode = "w" ) log = logging.getLogger() import basiclex import basparse import ...
gpl-2.0
Y3K/django
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
xsleonard/pystmark
pystmark.py
1
59566
""" pystmark -------- Postmark API library built on :mod:`requests` :copyright: 2013, see AUTHORS for more details :license: MIT, see LICENSE for more details :TODO: Support for bounce and inbound hooks? These should be mostly handled in a framework specific manner but there m...
mit
bcorbet/SickRage
tornado/platform/asyncio.py
36
5086
"""Bridges between the `asyncio` module and Tornado IOLoop. This is a work in progress and interfaces are subject to change. To test: python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop (the tests log a f...
gpl-3.0
tomsilver/nupic
nupic/data/dictutils.py
15
6446
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
Learningtribes/edx-platform
openedx/core/djangoapps/theming/tests/test_commands.py
47
2114
""" Tests for Management commands of comprehensive theming. """ from django.test import TestCase from django.core.management import call_command, CommandError from openedx.core.djangoapps.theming.helpers import get_themes from openedx.core.djangoapps.theming.management.commands.compile_sass import Command class Test...
agpl-3.0
pablocm-aserti/l10n_es_gestion_comercial_v8_WIP
l10n_es_gestion_comercial/wizard/unpaid_wizard.py
1
7283
# -*- 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
jwhitlock/django-allauth
allauth/socialaccount/templatetags/socialaccount.py
46
2979
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers from allauth.utils import get_request_param register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var ...
mit
alexandrucoman/vbox-nova-driver
nova/tests/unit/scheduler/filters/test_trusted_filters.py
56
12674
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/boto/ec2/autoscale/request.py
152
1549
# Copyright (c) 2009 Reza Lotun http://reza.lotun.name/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
mit
AICP/kernel_lge_hammerhead
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
xen0l/ansible
lib/ansible/modules/windows/win_reg_stat.py
52
3157
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
jurcicek/gmail-backup-com
svc/scripting/help.py
26
6128
# Copyright (C) 2008 Jan Svec and Filip Jurcicek # # YOU USE THIS TOOL ON YOUR OWN RISK! # # email: info@gmail-backup.com # # # Disclaimer of Warranty # ---------------------- # # Unless required by applicable law or agreed to in writing, licensor provides # this tool (and each contributor provides its contributio...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pywin32-219/com/win32comext/shell/demos/IUniformResourceLocator.py
19
1531
import pythoncom from win32com.shell import shell, shellcon import win32api, os class InternetShortcut: def __init__( self ): self._base = pythoncom.CoCreateInstance( shell.CLSID_InternetShortcut, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IUniformResourceLocator ) def load( self, filename ): # Get ...
mit
xodus7/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/routing_function_op_test.py
25
2329
# 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
mosbasik/buzhug
javasrc/lib/Jython/Lib/test/zxjdbc/runner.py
19
5996
# Jython Database Specification API 2.0 # # Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com> """ To run the tests, simply invoke this script from the commandline: jython runner.py <xml config file> [vendor, ...] If no vendors are given, then all vendors will be tested. If a vendor is given, then only that vend...
bsd-3-clause
gsehub/edx-platform
openedx/core/djangoapps/course_groups/migrations/0001_initial.py
13
4175
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings from opaque_keys.edx.django.models import CourseKeyField class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MO...
agpl-3.0
dermute/ansible
lib/ansible/utils/cmd_functions.py
61
2044
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
cuckoo5/soap
Soap_know/db/mongo_db.py
1
1436
#coding=utf-8 from pymongo import MongoClient import db_config as config import mongo_init_datas as init_all_datas class MongoDB: def __init__(self): self.db = self.get_connect() def get_connect(self): client = MongoClient(config.uri, config.port) #client = MongoClient('mong...
gpl-3.0
Vauxoo/suds
suds/xsd/sxbasic.py
197
22829
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
goodfeli/pylearn2
pylearn2/sandbox/rnn/costs/gradient_clipping.py
44
2169
""" Implements gradient clipping as a cost wrapper. """ from functools import wraps from theano.compat import six from theano import tensor from pylearn2.compat import OrderedDict from pylearn2.costs.cost import Cost from pylearn2.utils import is_iterable from pylearn2.utils import py_number_types class GradientCli...
bsd-3-clause
heeraj123/oh-mainline
vendor/packages/twisted/twisted/test/testutils.py
110
1525
from cStringIO import StringIO from twisted.internet.protocol import FileWrapper class IOPump: """Utility to pump data between clients and servers for protocol testing. Perhaps this is a utility worthy of being in protocol.py? """ def __init__(self, client, server, clientIO, serverIO): self.cl...
agpl-3.0
ita1024/samba
source4/dsdb/tests/python/sec_descriptor.py
27
106756
#!/usr/bin/env python # -*- coding: utf-8 -*- import optparse import sys import os import base64 import re import random sys.path.insert(0, "bin/python") import samba from samba.tests.subunitrun import SubunitOptions, TestProgram import samba.getopt as options # Some error messages that are being tested from ldb i...
gpl-3.0
jnewland/home-assistant
homeassistant/components/joaoapps_join/notify.py
7
2606
"""Support for Join notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv _LOG...
apache-2.0
adamdoupe/enemy-of-the-state
audit/httpQsRequest.py
1
3029
''' httpQsRequest.py Copyright 2006 Andres Riancho This file is part of w3af, w3af.sourceforge.net . w3af 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 version 2 of the License. w3af is distributed in the hop...
gpl-2.0
batxes/4c2vhic
SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models18585.py
2
17579
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
unconed/three.js
utils/exporters/blender/addons/io_three/exporter/scene.py
24
8788
import os from .. import constants, logger from . import ( base_classes, texture, material, geometry, object as object_, utilities, io, api ) from bpy import context class Scene(base_classes.BaseScene): """Class that handles the contruction of a Three scene""" def __init__(self...
mit
AnilRamachandran/aravis
tests/python/arv-genicam-test.py
1
1529
#!/usr/bin/env python # Aravis - Digital camera library # # Copyright (c) 2011 Emmanuel Pacaud # # 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 Software Foundation; either # version 2 of the License, or (at...
lgpl-2.1
AutomatedTester/selenium
py/test/selenium/webdriver/common/element_equality_tests.py
68
1943
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
ayesandarmoe/microblog_flask_tutorial
flask/lib/python2.7/site-packages/sqlalchemy/orm/mapper.py
7
115074
# orm/mapper.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Logic to map Python classes to and from selectables. Defines the :class:`~sqlalche...
gpl-2.0
mmahut/openshift-ansible
roles/openshift_health_checker/openshift_checks/logging/kibana.py
16
9088
""" Module for performing checks on a Kibana logging deployment """ import json import ssl try: from urllib2 import HTTPError, URLError import urllib2 except ImportError: from urllib.error import HTTPError, URLError import urllib.request as urllib2 from openshift_checks.logging.logging import Logging...
apache-2.0
thnee/ansible
lib/ansible/modules/network/cloudengine/ce_vrf.py
13
10999
#!/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
felixjimenez/django
django/core/management/commands/test.py
117
3750
import logging import sys import os from optparse import make_option, OptionParser from django.conf import settings from django.core.management.base import BaseCommand from django.test.utils import get_runner class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noinput', ...
bsd-3-clause
kohnle-lernmodule/palama
twisted/internet/gtkreactor.py
17
6711
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the PyGTK mainloop. In order to use this support, simply do the following:: | from twisted.internet import gtkreactor | gtkreactor.install() Then use twisted.in...
gpl-2.0
rhli/hadoop-EAR
build/contrib/thriftdatanode/lib/py/hadoopdatanode/ThriftHadoopDatanode.py
8
32949
# # Autogenerated by Thrift Compiler (0.7.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from thrift.Thrift import * from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.pro...
apache-2.0
tntnatbry/tensorflow
tensorflow/python/training/adadelta.py
16
4468
# 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
autosportlabs/kivy
kivy/effects/kinetic.py
54
5520
''' Kinetic effect ============== .. versionadded:: 1.7.0 The :class:`KineticEffect` is the base class that is used to compute the velocity out of a movement. When the movement is finished, the effect will compute the position of the movement according to the velocity, and reduce the velocity with a friction. The mov...
mit
rainwoodman/nbodykit
nbodykit/core/datasource/BigFileGrid.py
2
2715
from nbodykit.core import GridSource import numpy from pmesh.pm import ParticleMesh, RealField, ComplexField class BigFileGridSource(GridSource): """ Class to read field gridded data from a binary file Notes ----- * Reading is designed to be done by `GridPainter`, which reads gridded quantit...
gpl-3.0
mdworks2016/work_development
Python/05_FirstPython/Chapter8_ThirdParty/fpython_develop/lib/python3.7/site-packages/urllib3/contrib/appengine.py
23
11010
""" This module provides a pool manager that uses Google App Engine's `URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_. Example usage:: from urllib3 import PoolManager from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox if is_appengine_sandbox(): ...
apache-2.0
lenstr/rethinkdb
test/common/test_framework.py
31
34126
#/usr/bin/env python '''This test framework is responsible for running the test suite''' from __future__ import print_function from argparse import ArgumentParser from os.path import abspath, join, dirname, pardir, getmtime, relpath import curses import fcntl import fnmatch import math import multiprocessing import ...
agpl-3.0
larsmans/scikit-learn
examples/applications/plot_prediction_latency.py
25
11317
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
kohnle-lernmodule/palama
twisted/pb/copyable.py
14
13337
# -*- test-case-name: twisted.pb.test.test_copyable -*- # this module is responsible for all copy-by-value objects from zope.interface import interface, implements from twisted.python import reflect from twisted.python.components import registerAdapter from twisted.internet import defer import slicer, tokens from to...
gpl-2.0
pjdelport/django
django/db/models/expressions.py
2
5626
import datetime from django.utils import tree class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % operator - it is quoted # because it can be u...
bsd-3-clause
deepfield/ibis
ibis/expr/tests/test_datatypes.py
1
10837
import pytest import datetime import pytz from collections import OrderedDict from multipledispatch.conflict import ambiguities import ibis import ibis.expr.datatypes as dt from ibis.common import IbisTypeError def test_validate_type(): assert dt.validate_type is dt.dtype @pytest.mark.parametrize(('spec', 'exp...
apache-2.0
jun-wan/scilifelab
scilifelab/report/__init__.py
4
2765
"""Reporting utilities module""" import os import sys from mako.template import Template from collections import OrderedDict from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import cm from reportlab.platypus import Paragraph, SimpleDocTemplate from reportlab.lib import colors from reportla...
mit
ScreamingUdder/mantid
scripts/CompareFitMinimizers/post_processing.py
3
5325
# Copyright &copy; 2016 ISIS Rutherford Appleton Laboratory, NScD # Oak Ridge National Laboratory & European Spallation Source # # This file is part of Mantid. # Mantid 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 Foun...
gpl-3.0
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_modify.py
101
2428
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
apache-2.0
jaggu303619/asylum-v2.0
openerp/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
53
2600
# -*- 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
liw/daos
src/tests/ftest/nvme/nvme_fault.py
1
2377
#!/usr/bin/python ''' (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' import os from nvme_utils import ServerFillUp from dmg_utils import DmgCommand from command_utils_base import CommandFailure class NvmeFault(ServerFillUp): # pylint: disable=too-many-ancestors ...
apache-2.0
wildjan/Flask
Work/Trivia - Module 5/env/Lib/site-packages/jinja2/meta.py
659
4190
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
apache-2.0
mellorjc/partition_kernel_gp
part_kernel.py
1
8507
import inspect from numpy import ones, zeros, where, argmin, unique, array from numpy import logical_and, logical_or, arange, sqrt from numpy import maximum, pi, log from numpy.random import choice from numpy.linalg import norm, det from scipy.stats import binom, uniform from sklearn.metrics.pairwise import pairwise_di...
mit
pepetreshere/odoo
addons/mail/models/mail_template.py
2
14882
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import logging from odoo import _, api, fields, models, tools from odoo.exceptions import UserError _logger = logging.getLogger(__name__) class MailTemplate(models.Model): "Templates for sending em...
agpl-3.0
tux-00/ansible
lib/ansible/plugins/action/dellos10_config.py
113
4230
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2017 Dell 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 L...
gpl-3.0
quaquel/EMAworkbench
docs/source/indepth_tutorial/.ipynb_checkpoints/dps_lake_model-checkpoint.py
2
2867
import math import numpy as np from scipy.optimize import brentq def get_antropogenic_release(xt, c1, c2, r1, r2, w1): ''' Parameters ---------- xt : float polution in lake at time t c1 : float center rbf 1 c2 : float center rbf 2 r1 : float ratius rbf ...
bsd-3-clause
nguyentu1602/statsmodels
statsmodels/examples/t_est_rlm.py
33
1127
# -*- coding: utf-8 -*- """ Example from robust test_rlm, fails on Mac Created on Sun Mar 27 14:36:40 2011 """ from __future__ import print_function import numpy as np import statsmodels.api as sm RLM = sm.RLM DECIMAL_4 = 4 DECIMAL_3 = 3 DECIMAL_2 = 2 DECIMAL_1 = 1 from statsmodels.datasets.stackloss import load d...
bsd-3-clause
jtux270/translate
ovirt/3.6_source/packaging/setup/ovirt_engine_setup/domains.py
3
4015
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, 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 # # Unl...
gpl-3.0
jayfans3/pu-learning
src/tests/breastCancer.py
2
4863
""" Created on Dec 22, 2012 @author: Alexandre The goal of this test is to verifiy that the PUAdapter really allows a regular estimator to achieve better accuracy in the case where the \"negative\" examples are contaminated with a number of positive examples. Here we use the breast cancer dataset from UCI. We purpos...
bsd-3-clause
bigfatnoob/optima
problems/dtlz/dtlz2.py
1
1431
from __future__ import print_function, division import sys, os sys.path.append(os.path.abspath(".")) from problems.problem import * __author__ = 'panzer' class DTLZ2(Problem): """ Hypothetical test problem with "m" objectives and "n" decisions """ k = 10 def __init__(self, m, n=None): """ Initiali...
mit
hoehnp/navit_test
lib/python2.7/site-packages/_pytest/debugging.py
26
4000
""" interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import, division, print_function import pdb import sys def pytest_addoption(parser): group = parser.getgroup("general") group._addoption( '--pdb', dest="usepdb", action="store_true", help="start the in...
gpl-2.0
bjohare/cloughjordan.ie
wp-content/themes/executive-pro/api/OpenLayers-2.13.1/tools/closure_library_jscompiler.py
285
2337
# Copyright 2010 The Closure Library 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 a...
cc0-1.0
ddurando/pox.carp
pox/messenger/tcp_transport.py
40
3372
# Copyright 2011,2012 James McCauley # # 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 ...
apache-2.0
BatOnBots-ML/batonbots-ml
battle/vec2d.py
1
15905
""" ######################################################################## # Fonte: http://pygame.org/wiki/2DVectorClass # ######################################################################## """ import operator import math class vec2d(object): """2d vecto...
gpl-3.0
magic0704/neutron
neutron/plugins/ml2/drivers/type_vxlan.py
4
7324
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
supergis/QGIS
python/plugins/processing/algs/qgis/ConcaveHull.py
2
6014
# -*- coding: utf-8 -*- """ *************************************************************************** ConcaveHull.py --------------------- Date : May 2014 Copyright : (C) 2012 by Piotr Pociask Email : piotr dot pociask at gis-support dot pl **************...
gpl-2.0
cjh1/tomviz
acquisition/tests/jsonrpc_test.py
5
2844
import pytest from tomviz.jsonrpc import JsonRpcHandler, jsonrpc_message @pytest.fixture def handler(): return JsonRpcHandler('/some/path') def test_invalid_request(handler): request = {} response = handler.rpc(request) excepted = jsonrpc_message({ 'id': None, 'error': { ...
bsd-3-clause
blueboxgroup/horizon
openstack_dashboard/dashboards/router/nexus1000v/views.py
23
6406
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
relictMarauder/kodi
plugin.video.relict.sovok.tv/resources/lib/requests/requests/adapters.py
27
16961
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
apache-2.0
javelinanddart/android_kernel_3.10_ville
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