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 |
|---|---|---|---|---|---|
dablak/boto | boto/ec2/reservedinstance.py | 17 | 12948 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
afaheem88/tempest_neutron | tempest/api/volume/test_volumes_actions.py | 2 | 6440 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
impowski/servo | tests/wpt/web-platform-tests/tools/manifest/manifest.py | 26 | 14426 | import json
import os
from collections import defaultdict, OrderedDict
from six import iteritems
from .item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest
from .log import get_logger
from .sourcefile import SourceFile
from .utils import from_os_path, to_os_path
CURRENT_VERSION = 3
... | mpl-2.0 |
atiqueahmedziad/addons-server | src/olympia/github/tests/test_tasks.py | 3 | 2079 | import json
from django.test.utils import override_settings
import mock
from olympia.amo.templatetags.jinja_helpers import absolutify
from olympia.amo.tests import AMOPaths
from olympia.amo.urlresolvers import reverse
from olympia.files.models import FileUpload
from olympia.github.tasks import process_results, proce... | bsd-3-clause |
ebesson/ansible-roles | library/apm.py | 2 | 4966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Hiroaki Nakamura <hnakamur@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... | apache-2.0 |
mtekel/digitalmarketplace-api | migrations/versions/597e346723ee_.py | 3 | 1493 | """empty message
Revision ID: 597e346723ee
Revises: 56b57f01c4b4
Create Date: 2015-03-25 16:36:11.552342
"""
# revision identifiers, used by Alembic.
revision = '597e346723ee'
down_revision = '56b57f01c4b4'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import column, table
from sqlalchemy impor... | mit |
adamsumm/SMBRNN | LevelParsing/lpBiSML.py | 2 | 6406 | import cv2
import json
import numpy as np
import json
tileSize = 8
def clamp(val,minimum,maximum):
return max(min(val, maximum), minimum)
def findSubImageLocations(image,subImages,confidence):
allLocations = [ np.array([]) , np.array([])];
for subImage in subImages:
result = ... | mit |
mesheven/pyOCD | pyocd/board/mbed_board.py | 1 | 2220 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2018 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 ... | apache-2.0 |
sumihai-tekindo/account_sicepat | invoice_supplier_dept_seq/models/account_invoice.py | 1 | 9250 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 STI (<https://github.com/sumihai-tekindo>).
# @author Pambudi Satria <pambudi.satria@yahoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it u... | gpl-3.0 |
iterativ/djangojames | djangojames/templatetags/truncate.py | 1 | 2059 | # -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2012 ITerativ GmbH. All rights reserved.
#
# 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 ... | gpl-2.0 |
dimasad/numpy | numpy/distutils/command/build.py | 187 | 1618 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... | bsd-3-clause |
XueqingLin/tensorflow | tensorflow/contrib/training/python/training/bucket_ops.py | 7 | 16249 | # 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 |
gem/oq-engine | openquake/hazardlib/tests/acceptance/_peer_test_data.py | 1 | 12043 | """
Data is taken from the report "PEER 2010/106 - Verification of Probabilistic
Seismic Hazard Analysis Computer Programs" by Patricia Thomas, Ivan Wong,
Norman Abrahamson, see
`http://peer.berkeley.edu/publications/peer_reports/reports_2010/web_PEER_10106_THOMASetal.pdf`_.
"""
from openquake.hazardlib.geo import Pol... | agpl-3.0 |
sysadminmatmoz/OCB | addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 9 | 32596 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
from pytz import timezone
import pytz
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, ... | agpl-3.0 |
zouyapeng/horizon-newtouch | openstack_dashboard/api/fwaas.py | 22 | 7990 | # Copyright 2013, Big Switch Networks, 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 applic... | apache-2.0 |
felix-d/boto | scripts/rebuild_endpoints.py | 79 | 1281 | import json
from pyquery import PyQuery as pq
import requests
class FetchError(Exception):
pass
def fetch_endpoints():
# We utilize what the Java SDK publishes as a baseline.
resp = requests.get('https://raw2.github.com/aws/aws-sdk-java/master/src/main/resources/etc/regions.xml')
if int(resp.status... | mit |
lmprice/ansible | test/runner/lib/cloud/opennebula.py | 16 | 1681 | """OpenNebula plugin for integration tests."""
import os
from lib.cloud import (
CloudProvider,
CloudEnvironment
)
from lib.util import (
find_executable,
ApplicationError,
display,
is_shippable,
)
class OpenNebulaCloudProvider(CloudProvider):
"""Checks if a configuration file has been ... | gpl-3.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/ete2/parser/fasta.py | 3 | 4335 | # #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | mit |
OCA/bank-statement-import | account_bank_statement_import_txt_xlsx/wizards/account_bank_statement_import_sheet_mapping_wizard.py | 1 | 6596 | # Copyright 2019 ForgeFlow, S.L.
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from base64 import b64decode
import json
from os import path
class AccountBankStatementImportSheetMappingWizard(models.Tra... | agpl-3.0 |
mvaled/sentry | src/sentry/south_migrations/0274_auto__add_index_commit_repository_id_date_added.py | 1 | 87281 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Commit', fields ['repository_id', 'date_added']
db.crea... | bsd-3-clause |
matthewwardrop/python-hdf5storage | hdf5storage/datatypes.py | 1 | 6963 | import os, math, copy
import tables
import numpy as np
from .interfaces import DataNode,DataGroup,DataLeaf,HDF5Node,HDF5Group,HDF5Leaf,HDF5LeafTable,HDF5LeafArray
from .data import Storage
#################### DATA TYPE CLASSES #########################################
#
# Get the appropriate data type for the input... | mit |
yotchang4s/cafebabepy | src/main/python/idlelib/searchbase.py | 7 | 7449 | '''Define SearchDialogBase used by Search, Replace, and Grep dialogs.'''
from tkinter import Toplevel, Frame
from tkinter.ttk import Entry, Label, Button, Checkbutton, Radiobutton
class SearchDialogBase:
'''Create most of a 3 or 4 row, 3 column search dialog.
The left and wide middle column contain:
1 o... | bsd-3-clause |
gsehub/edx-platform | cms/envs/devstack_with_worker.py | 23 | 1050 | """
This config file follows the devstack enviroment, but adds the
requirement of a celery worker running in the background to process
celery tasks.
When testing locally, run lms/cms with this settings file as well, to test queueing
of tasks onto the appropriate workers.
In two separate processes on devstack:
pav... | agpl-3.0 |
bikong2/django | tests/test_client_regress/views.py | 143 | 5161 | import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import render_to_response
from django.template import RequestC... | bsd-3-clause |
aorti017/rcrawler | src/page_interface.py | 1 | 2577 | import urllib2
import re
from bs4 import BeautifulSoup
#opens and reads the page associated with the passed in URL
def open_link(url):
try:
#print "Opening page - " + url
#returns the contents of the page
return urllib2.urlopen(url).read()
except urllib2.HTTPError, error:
#print "un... | bsd-3-clause |
pythonvietnam/scikit-learn | examples/covariance/plot_covariance_estimation.py | 250 | 5070 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
SpamExperts/OrangeAssassin | tests/profiling/test_match.py | 2 | 2226 | from __future__ import absolute_import, print_function
import os
import unittest
import platform
import tests.util
GTUBE = "XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X"
IS_PYPY = "pypy" in platform.python_implementation().lower()
@unittest.skipIf(IS_PYPY, "Psutil doesn't work on PyPy")
cla... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/sqlite3/test/py25tests.py | 127 | 2736 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
#... | mit |
paulluo/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
amilan/mxcube3 | mxcube3/routes/Collection.py | 3 | 6894 | from flask import session, redirect, url_for, render_template, request, Response
from mxcube3 import app as mxcube
import logging
###----COLLECTION----###
@mxcube.route("/mxcube/api/v0.1/samples/<id>/collections/<colid>/mode", methods=['POST'])
def set_collection_method(method):
"""Define the collection method, s... | gpl-2.0 |
auduny/chains | lib/chains/commandline/describe.py | 1 | 1436 | from chains.commandline import commands
from chains.common import utils, introspect
import os
def getCommands():
result = {}
for dir in commands.getCommandDirs():
for file in os.listdir(dir):
if file[0] == '_': continue
file = file.split('.')
if file[-1:][0] != 'py'... | gpl-2.0 |
viewdy/phantomjs2 | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/png.py | 170 | 3914 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# 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 lis... | bsd-3-clause |
whn09/tensorflow | tensorflow/python/kernel_tests/norm_op_test.py | 53 | 4705 | # 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 |
whn09/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/transform.py | 18 | 10559 | # 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 |
peterheim1/robbie_ros | robbie_bringup/nodes/right_follow_joint.py | 1 | 6251 | #!/usr/bin/env python
# freely inspired by http://www.ros.org/wiki/arbotix_python/follow_controller
import roslib
import rospy, actionlib
from control_msgs.msg import FollowJointTrajectoryAction
from dynamixel_msgs.msg import JointState as JointControllerState
#from control_msgs.msg import Join... | bsd-3-clause |
lthurlow/Network-Grapher | proj/external/networkx-1.7/build/lib.linux-i686-2.7/networkx/classes/multidigraph.py | 40 | 28598 | """Base class for MultiDiGraph."""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph # for doc... | mit |
ZhaoCJ/django | django/contrib/admin/templatetags/log.py | 114 | 2125 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | bsd-3-clause |
zhenshengcai/floodlight-hardware | src/main/python/debugserver.py | 110 | 2124 | #!/usr/bin/env python
import sys
from threading import currentThread
from SocketServer import BaseRequestHandler, TCPServer
from code import InteractiveConsole
_locals = None
class DebugLogger(object):
def do_print(self, *args):
for i in args:
print i,
print
info = do_print
wa... | apache-2.0 |
prataprc/tss | tss/tyrstyle.py | 1 | 3681 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
# Copyright (c) 2011 R Pratap Chakravarthy
from argparse import ArgumentParser
from os.path import isfile, join,... | gpl-3.0 |
deep0892/jitendrachatbot | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
centrumholdings/cthulhubot | tests/example_project/tests/test_api.py | 1 | 2383 | from urllib2 import urlopen
import os
from cthulhubot.views import create_job_assignment
from django.conf import settings
from cthulhubot.models import Job, BuildComputer, ProjectClient
from django.utils.simplejson import dumps
from tests.helpers import BuildmasterTestCase
class TestMasterApi(BuildmasterTestCase):
... | bsd-3-clause |
himleyb85/django | django/utils/timesince.py | 409 | 2671 | from __future__ import unicode_literals
import calendar
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
... | bsd-3-clause |
darkenk/scripts | android/project_creator/venv/lib/python3.5/site-packages/pip/_vendor/requests/structures.py | 615 | 3012 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
from .compat import OrderedDict
class CaseInsensitiveDict(collections.MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
`... | bsd-3-clause |
BT-ojossen/sale-workflow | sale_quotation_sourcing_stock_route_transit/model/sale_order_line.py | 34 | 1998 | # -*- coding: utf-8 -*-
#
# Author: Alexandre Fayolle, Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | agpl-3.0 |
sylarcp/anita | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py | 838 | 1384 | '''
Debian and other distributions "unbundle" requests' vendored dependencies, and
rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
The problem with this is that not only requests itself imports those
dependencies, but third-party code outside of the distros' control too.
In reaction to t... | mit |
makermade/arm_android-19_arm-linux-androideabi-4.8 | lib/python2.7/collections.py | 35 | 25883 | __all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict']
# For bootstrapping reasons, the collection ABCs are defined in _abcoll.py.
# They should however be considered an integral part of collections.py.
from _abcoll import *
import _abcoll
__all__ += _abcoll.__all__
from _collections import deque, ... | gpl-2.0 |
bchavez/rethinkdb | test/common/http_support/jinja2/testsuite/filters.py | 394 | 19169 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.filters
~~~~~~~~~~~~~~~~~~~~~~~~
Tests for the jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
fro... | agpl-3.0 |
chokribr/PIST | modules/bibclassify/lib/bibclassify_acronym_analyzer.py | 32 | 9391 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | gpl-2.0 |
nickhdamico/py | lib/requests/auth.py | 120 | 6669 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... | gpl-3.0 |
home-assistant/home-assistant | tests/components/powerwall/test_binary_sensor.py | 8 | 2556 | """The binary sensor tests for the powerwall platform."""
from unittest.mock import patch
from homeassistant.components.powerwall.const import DOMAIN
from homeassistant.const import CONF_IP_ADDRESS, STATE_ON
from .mocks import _mock_powerwall_with_fixtures
from tests.common import MockConfigEntry
async def test_s... | apache-2.0 |
breadchris/CTFd | CTFd/scoreboard.py | 1 | 2698 | from flask import current_app as app, session, render_template, jsonify, Blueprint, redirect, url_for, request
from CTFd.utils import unix_time, authed, get_config
from CTFd.models import db, Teams, Solves, Challenges
scoreboard = Blueprint('scoreboard', __name__)
@scoreboard.route('/scoreboard')
def scoreboard_view... | apache-2.0 |
timlinux/inasafe | safe/report/expressions/html_report.py | 1 | 23685 | # coding=utf-8
"""QGIS Expressions which are available in the QGIS GUI interface."""
import codecs
from os.path import dirname, join, exists
from xml.etree import ElementTree as ET
from qgis.core import (
qgsfunction,
QgsExpressionContextUtils,
QgsProject,
QgsLayerTreeGroup,
QgsLayerTreeLayer)
f... | gpl-3.0 |
moondrop-entertainment/django-nonrel-drawp | django/utils/unittest/main.py | 332 | 9388 | """Unittest main program"""
import sys
import os
import types
from django.utils.unittest import loader, runner
try:
from django.utils.unittest.signals import installHandler
except ImportError:
installHandler = None
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = ... | bsd-3-clause |
linkdesu/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
woodscn/scipy | tools/win32/build_scripts/pavement.py | 89 | 8536 | import os
from os.path import join as pjoin, normpath, exists as pexists, dirname
import subprocess
from shutil import rmtree, move as shmove
import re
from zipfile import ZipFile
from lib import get_svn_version, get_scipy_version
BUILD_MSI = False
SRC_ROOT = normpath(pjoin(os.getcwd(), os.pardir, os.pardir, os.pardi... | bsd-3-clause |
voltaicsca/deluge | deluge/core/torrent.py | 1 | 40341 | #
# torrent.py
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 ... | gpl-3.0 |
jmesteve/saas3 | openerp/addons/stock/report/stock_inventory_move_report.py | 63 | 1789 | # -*- 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 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/openshift_health_checker/openshift_checks/logging/logging.py | 35 | 3827 | """
Util functions for performing checks on an Elasticsearch, Fluentd, and Kibana stack
"""
import json
import os
from openshift_checks import OpenShiftCheck, OpenShiftCheckException
class MissingComponentPods(OpenShiftCheckException):
"""Raised when a component has no pods in the namespace."""
pass
class... | apache-2.0 |
hiaselhans/OpenGlider | openglider/glider/parametric/import_ods.py | 2 | 15496 | from __future__ import division
import numbers
import re
import ezodf
import numpy as np
import logging
import typing
from openglider.airfoil import BezierProfile2D, Profile2D
from openglider.vector.spline import Bezier, SymmetricBezier, SymmetricBSpline
from openglider.vector import Interpolation
from openglider.g... | gpl-3.0 |
KarchinLab/2020plus | src/classify/python/vogelstein_classifier.py | 1 | 7309 | from __future__ import division
import numpy as np
class VogelsteinClassifier(object):
"""Oncogene and TSG classifier based on the 20/20 rule.
Essentially the 20/20 rule states that oncogenes have at least
20% recurrent missense mutations. While tumor suppressor genes
have atleast 20% deleterius mutat... | apache-2.0 |
DedMemez/ODS-August-2017 | toptoons/PeriodPicker.py | 1 | 2726 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.toptoons.PeriodPicker
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from toontown.toonbase import ToontownGlobals, TTLocalizer
from CategoryPicker import CategoryPicker
class PeriodPicker(DirectFrame):
de... | apache-2.0 |
GoogleCloudPlatform/training-data-analyst | courses/developingapps/python/appengine/end/frontend/quiz/gcp/languageapi.py | 39 | 1413 | # Copyright 2017 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 law or agreed to in writing, ... | apache-2.0 |
kadamski/func | func/minion/modules/filetracker.py | 2 | 6112 | ## func
##
## filetracker
## maintains a manifest of files of which to keep track
## provides file meta-data (and optionally full data) to func-inventory
##
## (C) Vito Laurenza <vitolaurenza@gmail.com>
## + Michael DeHaan <mdehaan@redhat.com>
##
## This software may be freely redistributed under the terms of the GNU... | gpl-2.0 |
teriyakichild/ansible-modules-extras | system/svc.py | 5 | 9591 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@ansible.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 Licen... | gpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/networkx/algorithms/components/biconnected.py | 35 | 14462 | # -*- coding: utf-8 -*-
"""
Biconnected components and articulation points.
"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from itertools import chain
import networkx as nx
__author... | agpl-3.0 |
Tinysymphony/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
SCAII/SCAII | glue/python/scaii/protos/scaii_pb2.py | 1 | 68324 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: scaii.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... | bsd-3-clause |
nanditav/15712-TensorFlow | tensorflow/python/tools/strip_unused_lib.py | 25 | 3759 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
chintak/scikit-image | doc/examples/plot_hog.py | 2 | 4351 | """
===============================
Histogram of Oriented Gradients
===============================
The `Histogram of Oriented Gradient
<http://en.wikipedia.org/wiki/Histogram_of_oriented_gradients>`__ (HOG) feature
descriptor [1]_ is popular for object detection.
In the following example, we compute the HOG descript... | bsd-3-clause |
CiscoSystems/quantum | neutron/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py | 4 | 20175 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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/l... | apache-2.0 |
powellb/seapy | seapy/qserver.py | 3 | 2886 | #!/usr/bin/env python
"""
This module will execute any number of tasks using a queue of the
specified number of threads.
Define a list of qserver.task objects and then tell the server to
execute the list with a given number of threads.
**Examples**
>>> tasks = (qserver.os_task("list files","ls -1"),
>>... | mit |
dgjustice/ansible | lib/ansible/modules/cloud/openstack/os_subnet.py | 14 | 13512 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
reinout/django | tests/view_tests/tests/test_default_content_type.py | 60 | 1761 | import sys
from types import ModuleType
from django.conf import Settings
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango30Warning
class DefaultContentTypeTests(SimpleTestCase):
msg = 'The DEFAULT_CONTENT_TYPE setting is deprecated.'
@ignore_warnin... | bsd-3-clause |
amarzavery/AutoRest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/fixtures/acceptancetestslro/operations/lr_os_custom_header_operations.py | 14 | 15784 | # 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 |
Antiun/odoomrp-wip | mrp_production_project_estimated_cost/wizard/wiz_create_fictitious_of.py | 4 | 3345 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class WizCreateFi... | agpl-3.0 |
technologiescollege/s2a_fr | s2a/Python/Lib/test/test_commands.py | 130 | 2640 | '''
Tests for commands module
Nick Mathewson
'''
import unittest
import os, tempfile, re
from test.test_support import run_unittest, reap_children, import_module, \
check_warnings
# Silence Py3k warning
commands = import_module('commands', deprecated=True)
# The module says:
# "... | gpl-3.0 |
beni55/scrapy | scrapy/utils/sitemap.py | 146 | 1410 | """
Module for processing Sitemaps.
Note: The main purpose of this module is to provide support for the
SitemapSpider, its API is subject to change without notice.
"""
import lxml.etree
class Sitemap(object):
"""Class to parse Sitemap (type=urlset) and Sitemap Index
(type=sitemapindex) files"""
def __in... | bsd-3-clause |
xunzhang/orc | c++/libs/protobuf-2.6.0/gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | apache-2.0 |
detiber/ansible-modules-core | cloud/openstack/os_image.py | 12 | 6329 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
lexor90/node-compiler | node/tools/icu/icutrim.py | 11 | 12101 | #!/usr/bin/python
#
# Copyright (C) 2014 IBM Corporation and Others. All Rights Reserved.
#
# @author Steven R. Loomis <srl@icu-project.org>
#
# This tool slims down an ICU data (.dat) file according to a config file.
#
# See: http://bugs.icu-project.org/trac/ticket/10922
#
# Usage:
# Use "-h" to get help options.
im... | mit |
BoltzmannBrain/nupic.research | projects/sequence_prediction/reberGrammar/reberSequence_CompareTMvsLSTM.py | 13 | 2320 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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... | agpl-3.0 |
iTyran/CocosBuilder | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 141 | 117912 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mit |
G-P-S/depot_tools | third_party/logilab/common/urllib2ext.py | 92 | 3416 | from __future__ import print_function
import logging
import urllib2
import kerberos as krb
class GssapiAuthError(Exception):
"""raised on error during authentication process"""
import re
RGX = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
def get_negociate_value(headers):
for authreq in headers.geth... | bsd-3-clause |
mstriemer/zamboni | mkt/api/tests/test_authentication.py | 19 | 8078 | from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
from mock import Mock, patch
from multidb.pinning import this_thread_is_pinned, unpin_this_thread
from nose.tools import eq_, ok_
from rest_framework.reques... | bsd-3-clause |
frodrigo/navitia | source/jormungandr/jormungandr/modules/v1_routing/v1_routing.py | 6 | 9118 | # coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open p... | agpl-3.0 |
google/offline-content-packager | third_party/nkata/scripts/utils/content.py | 1 | 4034 | # Copyright 2015 The Offline Content Packager 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 |
silenceli/nova | nova/tests/functional/v3/test_security_groups.py | 10 | 6114 | # 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 |
igurrutxaga/tvalacarta | python/main-classic/channels/mtv.py | 3 | 7778 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para MTV
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,re
import urllib
from core import logger
from core import... | gpl-3.0 |
pataquets/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/revertrevision.py | 147 | 1769 | # 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 th... | bsd-3-clause |
manipopopo/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot.py | 14 | 13765 | # 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 |
ZLLab-Mooc/edx-platform | common/lib/xmodule/xmodule/split_test_module.py | 33 | 29834 | """
Module for running content split tests
"""
import logging
import json
from webob import Response
from uuid import uuid4
from operator import itemgetter
from xmodule.progress import Progress
from xmodule.seq_module import SequenceDescriptor
from xmodule.studio_editable import StudioEditableModule, StudioEditableDe... | agpl-3.0 |
tinfoil/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py | 117 | 46271 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
PeterPetrik/QGIS | python/plugins/processing/tests/GdalAlgorithmsVectorTest.py | 17 | 44507 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GdalAlgorithmVectorTest.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Matthias Kuhn
Email : matthias@opengis.ch
******************... | gpl-2.0 |
drankye/SSM | smart-zeppelin/travis_check.py | 30 | 4073 | #
# 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 us... | apache-2.0 |
elena/django | tests/unmanaged_models/tests.py | 133 | 2135 | from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created without
any database errors. We ca... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/protobuf/python/google/protobuf/internal/message_test.py | 224 | 22295 | #! /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:
#
# ... | mit |
cjaymes/pyscap | src/scap/model/oval_5/sc/unix/SymlinkItemElement.py | 1 | 1133 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/212_test_getopt.py | 15 | 4035 | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
import getopt
from getopt import GetoptError
from test_support import verify, verbose
def expectException(teststr, expected, failure=AssertionError):
"""Executes a statement passed in teststr, and raises an exception
(failure) if the expect... | gpl-3.0 |
achals/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_config.py | 166 | 19617 | import py, pytest
import _pytest._code
from _pytest.config import getcfg, get_common_ancestor, determine_setup
from _pytest.main import EXIT_NOTESTSCOLLECTED
class TestParseIni:
def test_getcfg_and_config(self, testdir, tmpdir):
sub = tmpdir.mkdir("sub")
sub.chdir()
tmpdir.join("setup.cfg"... | mpl-2.0 |
winest/PEInfo | PEInfo/HandleBasicInfo.py | 1 | 9317 | import os
import sys
import logging
import traceback
import configparser
import time
import subprocess
import pefile
import peutils
import hashlib
import xlsxwriter
import chardet
from collections import defaultdict
from Singleton import *
from ExcelInfo import *
from HashInfo import *
class CPeid( metaclass = Sin... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.