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 |
|---|---|---|---|---|---|
rspavel/spack | var/spack/repos/builtin/packages/hbase/package.py | 3 | 1402 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Hbase(Package):
"""Apache HBase is an open-source, distributed, versioned, column-oriented... | lgpl-2.1 |
kaphka/catconv | convert.py | 1 | 1091 | import argparse
import signal
from tqdm import tqdm
import catconv.operations as co
import catconv.stabi as sb
exit = False
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
exit = True
parser = argparse.ArgumentParser()
parser.add_argument("source")
parser.add_argument("target")
parser.add_a... | apache-2.0 |
supersven/intellij-community | python/helpers/coverage/data.py | 209 | 9188 | """Coverage data for Coverage."""
import os
from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622
from coverage.files import PathAliases
from coverage.misc import file_be_gone
class CoverageData(object):
"""Manages collected coverage data, including file storage.
The data file for... | apache-2.0 |
DavidNorman/tensorflow | tensorflow/python/ops/image_grad.py | 5 | 15565 | # 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 |
Bysmyyr/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py | 39 | 13796 | # Copyright (C) 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 of conditions and the ... | bsd-3-clause |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/numpy/testing/decorators.py | 66 | 8409 | """
Decorators for labeling and modifying behavior of test objects.
Decorators that merely return a modified version of the original
function object are straightforward. Decorators that return a new
function object need to use
::
nose.tools.make_decorator(original_function)(decorator)
in returning the decorator, i... | mit |
alirizakeles/zato | code/zato-zmq/src/zato/zmq_/mdp/worker.py | 1 | 9531 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import logging
import time
from datetime import datetime, timedelta
# Z... | gpl-3.0 |
mahinthjoe/bedrock | py3env/lib/python3.4/site-packages/pip/index.py | 237 | 47847 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mpl-2.0 |
halwai/cvxpy | cvxpy/problems/iterative.py | 12 | 4961 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... | gpl-3.0 |
jeffheaton/aifh | vol3/vol3-python-examples/examples/example_timeseries.py | 2 | 1695 | #!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 3: Deep Learning and Neural Networks
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2015 by Jeff Heaton
Licensed under the Apache License, V... | apache-2.0 |
pcingola/server | ga4gh/cli.py | 1 | 32399 | """
Command line interface programs for the GA4GH reference implementation.
TODO: document how to use these for development and simple deployment.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import unittest
import uni... | apache-2.0 |
cgwalters/pykickstart | tests/orderedset.py | 3 | 1277 | import unittest
from pykickstart.orderedset import OrderedSet
class OrderedSet_TestCase(unittest.TestCase):
def runTest(self):
# __eq__, __len__, etc.
self.assertEqual(OrderedSet([]), OrderedSet([]))
self.assertEqual(OrderedSet([1, 2, 3]), OrderedSet([1, 2, 3]))
self.assertEqual(Or... | gpl-2.0 |
antonygc/liblightbase | liblightbase/lbdoc/metaclass.py | 1 | 6065 | from liblightbase import lbutils
from liblightbase.lbdoc.metadata import DocumentMetadata
def generate_metaclass(struct, base=None):
"""
Generate document metaclass. The document metaclass
is an abstraction of document model defined by base
structures.
@param struct: Field or Group object.
@... | gpl-2.0 |
aio-libs/aiozmq | examples/core_dealer_router.py | 1 | 1579 | import asyncio
import aiozmq
import zmq
class ZmqDealerProtocol(aiozmq.ZmqProtocol):
transport = None
def __init__(self, queue, on_close):
self.queue = queue
self.on_close = on_close
def connection_made(self, transport):
self.transport = transport
def msg_received(self, msg... | bsd-2-clause |
pyfa-org/eos | eos/item/mixin/effect_stats/remote_repair.py | 1 | 1829 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 |
bfirsh/django-old | django/contrib/localflavor/ie/ie_counties.py | 503 | 1127 | """
Sources:
Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland
"""
from django.utils.translation import ugettext_lazy as _
IE_COUNTY_CHOICES = (
('antrim', _('Antrim')),
('armagh', _('Armagh')),
('carlow', _('Carlow')),
('cavan', _('Cavan')),
('clare', _('Clare')),
('cork... | bsd-3-clause |
netfirms/erpnext | erpnext/crm/doctype/newsletter_list/newsletter_list.py | 15 | 3079 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import validate_email_add
from frappe import... | agpl-3.0 |
bollu/polymage | sandbox/apps/python/img_proc/harris/init.py | 1 | 1485 | import sys
import os.path
from PIL import Image
import numpy as np
from arg_parser import parse_args
from printer import print_header, print_usage, print_line
def init_images(app_data):
print("[init.py] : initializing images...")
app_args = app_data['app_args']
# input image:
img_path = app_args.im... | apache-2.0 |
fanjunwei/depot_tools | testing_support/auto_stub.py | 53 | 2301 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__version__ = '1.0'
import collections
import inspect
import unittest
class AutoStubMixIn(object):
"""Automatically restores stubbed functions on un... | bsd-3-clause |
lucalianas/openmicroscopy | components/tools/OmeroPy/test/integration/test_files.py | 9 | 2553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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... | gpl-2.0 |
CharlieGreenman/codeIllustrator | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
zhanrnl/ag | webapp/models/roomassignment.py | 1 | 2751 | from google.appengine.ext import ndb
from models.grading import SITTING_ROOM_TYPES
from models.team import (
Team,
Contestant,
)
from models.sitting import Sitting
import random
SINGLE_TEST_SITTING = {
'alg' : 'alg,at',
'at' : 'at,calc',
'calc' : 'calc,geo',
'geo' : 'at,geo',
'team' : 'pow... | mit |
google/tf-quant-finance | tf_quant_finance/experimental/pricing_platform/framework/market_data/market_data_test.py | 1 | 5816 | # Lint as: python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
liluo/pygments-main | external/markdown-processor.py | 42 | 2041 | # -*- coding: utf-8 -*-
"""
The Pygments Markdown Preprocessor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Markdown_ preprocessor that renders source code
to HTML via Pygments. To use it, invoke Markdown like so::
import markdown
html = markdown.markdown(someText, extension... | bsd-2-clause |
eLBati/server-tools | dbfilter_from_header/__init__.py | 44 | 1534 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
# This module copyright (C) 2014 ACSONE SA/NV (<http://acsone.eu>).
#
# This program is free soft... | agpl-3.0 |
towerjoo/DjangoNotes | Django-1.5.1/tests/modeltests/model_forms/models.py | 44 | 8840 | """
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | mit |
syaiful6/django | django/contrib/gis/geos/prototypes/topology.py | 338 | 2145 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
from ctypes import c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_string... | bsd-3-clause |
Endika/mitmproxy | libmproxy/contentviews.py | 1 | 16688 | """
Mitmproxy Content Views
=======================
mitmproxy includes a set of content views which can be used to format/decode/highlight data.
While they are currently used for HTTP message bodies only, the may be used in other contexts
in the future, e.g. to decode protobuf messages sent as WebSocket frames.
Thus,... | mit |
airspeed-velocity/asv | asv/plugins/virtualenv.py | 2 | 5810 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
from distutils.version import LooseVersion
import sys
import re
import os
import six
from .. import environment
from ..console import log
from ..... | bsd-3-clause |
akirk/youtube-dl | youtube_dl/extractor/pyvideo.py | 158 | 1983 | from __future__ import unicode_literals
import re
import os
from .common import InfoExtractor
class PyvideoIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?pyvideo\.org/video/(?P<id>\d+)/(.*)'
_TESTS = [
{
'url': 'http://pyvideo.org/video/1737/become-a-logging-expert-in-30-minutes',
... | unlicense |
armando-migliaccio/tempest | tempest/api/compute/images/test_images_oneserver_negative.py | 1 | 6602 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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
#... | apache-2.0 |
jay-tyler/ansible | lib/ansible/plugins/lookup/flattened.py | 103 | 2506 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... | gpl-3.0 |
bennojoy/ansible | v1/ansible/runner/__init__.py | 77 | 69625 | # (c) 2012-2014, 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) an... | gpl-3.0 |
lesserwhirls/scipy-cwt | scipy/odr/models.py | 57 | 4522 | """ Collection of Model instances for use with the odrpack fitting package.
"""
import numpy as np
from scipy.odr.odrpack import Model
def _lin_fcn(B, x):
a, b = B[0], B[1:]
b.shape = (b.shape[0], 1)
return a + (x*b).sum(axis=0)
def _lin_fjb(B, x):
a = np.ones(x.shape[-1], float)
res = np.conca... | bsd-3-clause |
resmo/ansible | lib/ansible/modules/network/netvisor/pn_admin_syslog.py | 38 | 6606 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | gpl-3.0 |
koniiiik/django | django/utils/text.py | 7 | 14950 | from __future__ import unicode_literals
import re
import unicodedata
from gzip import GzipFile
from io import BytesIO
from django.utils import six
from django.utils.encoding import force_text
from django.utils.functional import (
SimpleLazyObject, keep_lazy, keep_lazy_text, lazy,
)
from django.utils.safestring im... | bsd-3-clause |
dropbox/changes | changes/listeners/mail.py | 1 | 8772 | from __future__ import absolute_import, print_function
from itertools import imap
import logging
import toronado
from email.utils import parseaddr
from flask import current_app, render_template
from flask_mail import Message, sanitize_address
from jinja2 import Markup
from typing import List # NOQA
from changes.con... | apache-2.0 |
cecep-edu/edx-platform | lms/djangoapps/instructor/views/coupons.py | 61 | 6574 | """
E-commerce Tab Instructor Dashboard Coupons Operations views
"""
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.http import require_POST
from django.utils.translation import ugettext as _
from util.json_request import Json... | agpl-3.0 |
qz267/zerorpc-python | zerorpc/core.py | 53 | 15303 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
KyleJamesWalker/ansible | lib/ansible/utils/module_docs_fragments/avi.py | 48 | 1616 | #
# Created on December 12, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Avi Version: 16.3.4
#
#
# 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... | gpl-3.0 |
noiselabs/box-linux-sync | src/noiselabs/box/pms/apt.py | 1 | 1248 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of box-linux-sync.
#
# Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org>
#
# box-linux-sync 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... | lgpl-3.0 |
rhyolight/nupic.research | projects/l2_pooling/convergence_activity.py | 10 | 9793 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 |
pwollstadt/trentoolxl | dev/search_GPU/test_neighbour_search_cuda.py | 2 | 28060 | """Provide unit tests for neighbour searches using CUDA GPU-code.
Tests are based on unit tests by Pedro Mediano
https://github.com/pmediano/jidt/tree/master/java/source/infodynamics/
measures/continuous/kraskov/cuda
"""
import pytest
import numpy as np
from idtxl.neighbour_search_cuda import cudaFindKnnSetGPU, knn_s... | gpl-3.0 |
pidydx/grr | grr/lib/flows/general/audit.py | 1 | 2003 | #!/usr/bin/env python
"""This implements the auditing system.
How does it work?
Noteworthy events within the GRR system (such as approval granting, flow
execution etc) generate events to notify listeners about the event.
The audit system consists of a group of event listeners which receive these
events and act upon ... | apache-2.0 |
jmmease/pandas | pandas/tests/tseries/test_timezones.py | 2 | 69288 | # pylint: disable-msg=E1101,W0612
import pytest
import pytz
import dateutil
import numpy as np
from dateutil.parser import parse
from pytz import NonExistentTimeError
from distutils.version import LooseVersion
from dateutil.tz import tzlocal, tzoffset
from datetime import datetime, timedelta, tzinfo, date
import pan... | bsd-3-clause |
AtomLinter/linter-pylama | bin/deps/astroid/rebuilder.py | 2 | 39135 | # Copyright (c) 2009-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2013-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2013-2014 Google, Inc.
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.... | mit |
fbocharov/au-linux-kernel-spring-2016 | linux/Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
eamosov/thrift | test/py/TestRenderedDoubleConstants.py | 17 | 10576 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
gatagat/lapjv | bench/overview_sparse.py | 1 | 2203 | from pytest import mark
from joblib import Memory
import numpy as np
from lap import lapjv, lapmod
from lap.lapmod import get_cost
try:
from lap_old import lapjv as lapjv_old
except ImportError:
print(
'''If you get here, you do not have the old lapjv to compare to.
git clone git@github... | bsd-2-clause |
ryfeus/lambda-packs | Opencv_pil/source36/numpy/polynomial/tests/test_hermite.py | 6 | 18758 | """Tests for hermite module.
"""
from __future__ import division, absolute_import, print_function
from functools import reduce
import numpy as np
import numpy.polynomial.hermite as herm
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
assert_almost_equal, assert_raises, assert_equal, a... | mit |
nvoron23/statsmodels | statsmodels/sandbox/regression/tests/results_gmm_griliches_iter.py | 34 | 7976 | import numpy as np
est = dict(
rank = 13,
N = 758,
Q = .0150568875809373,
J = 11.41312078635046,
J_df = 2,
k_1 = 13,
converged = 1,
has_xtinst = 0,
type = 1,
n_eq = 1,
k = 13,
n_moments =... | bsd-3-clause |
jbenden/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 51 | 14301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (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 Software Foundation, either version 3 of the Lice... | gpl-3.0 |
khughitt/ete | ete_dev/tools/ete_ncbi_update.py | 2 | 4129 | import sys
import os
from string import strip
import tarfile
from common import Tree
from utils import ask, ask_filename
def load_ncbi_tree_from_dump(tar):
# Download: ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
parent2child = {}
name2node = {}
node2taxname = {}
synonyms = set()
name2ran... | gpl-3.0 |
montyly/manticore | tests/ethereum/EVM/test_EVMEXP.py | 1 | 79538 | import struct
import unittest
import json
from manticore.platforms import evm
from manticore.core import state
from manticore.core.smtlib import Operators, ConstraintSet
import os
class EVMTest_EXP(unittest.TestCase):
_multiprocess_can_split_ = True
maxDiff = None
def _execute(self, new_vm):
last... | apache-2.0 |
thaumos/ansible-modules-extras | monitoring/boundary_meter.py | 35 | 8359 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to add boundary meters.
(c) 2013, curtis <curtis@serverascode.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 Foundati... | gpl-3.0 |
amitaekbote/dcos | gen/tests/utils.py | 3 | 1714 | """
Utilities for tests for ``gen``.
"""
import copy
import json
import pkg_resources
import gen
true_false_msg = "Must be one of 'true', 'false'. Got 'foo'."
def make_arguments(new_arguments):
"""
Fields with default values should not be added in here so that the
default values are also tested.
"... | apache-2.0 |
tiagofrepereira2012/tensorflow | tensorflow/python/kernel_tests/matrix_inverse_op_test.py | 20 | 4503 | # 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 |
kevin-intel/scikit-learn | examples/multioutput/plot_classifier_chain_yeast.py | 23 | 4637 | """
============================
Classifier Chain
============================
Example of using classifier chain on a multilabel dataset.
For this example we will use the `yeast
<https://www.openml.org/d/40597>`_ dataset which contains
2417 datapoints each with 103 features and 14 possible labels. Each
data point has ... | bsd-3-clause |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/boto/rds/regioninfo.py | 167 | 1513 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... | mit |
tartavull/google-cloud-python | speech/google/cloud/speech/alternative.py | 2 | 2466 | # Copyright 2016 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 |
glennrub/micropython | examples/rp2/pio_pinchange.py | 7 | 1199 | # Example using PIO to wait for a pin change and raise an IRQ.
#
# Demonstrates:
# - PIO wrapping
# - PIO wait instruction, waiting on an input pin
# - PIO irq instruction, in blocking mode with relative IRQ number
# - setting the in_base pin for a StateMachine
# - setting an irq handler for a StateMachine
# ... | mit |
sauliusl/scipy | scipy/stats/tests/test_multivariate.py | 35 | 30527 | """
Test functions for multivariate normal distributions.
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_allclose, assert_almost_equal,
assert_array_almost_equal, assert_equal,
assert_raises, run_module_suite... | bsd-3-clause |
adamtiger/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v1_test.py | 49 | 18431 | # 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 |
3nids/QGIS | python/plugins/processing/algs/grass7/ext/r_shade.py | 45 | 1527 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_shade.py
----------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************************************... | gpl-2.0 |
chylli/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/png_unittest.py | 124 | 5663 | # 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 |
MicBrain/Tic_Tac_Toe | Tic_Tac_Toe.py | 1 | 8653 | ###################
### DESCRIPTION ###
###################
"""
Tic-tac-toe (or Noughts and crosses, Xs and Os) is a game for two players, X and O, who take
turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks
in a horizontal, vertical, or diagonal row wins the game.
... | gpl-3.0 |
osu-cass/whats-fresh-api | whats_fresh/whats_fresh_api/tests/views/entry/test_new_image.py | 2 | 3620 | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Image
from django.contrib.auth.models import User, Group
import os
class NewImageTestCase(TestCase):
"""
Test that the New Image page works as expected.
Things tested:
URL... | apache-2.0 |
danakj/chromium | chrome/test/data/nacl/debug_stub_browser_tests.py | 42 | 3536 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import sys
import xml.etree.ElementTree
import gdb_rsp
def AssertRaises(exc_class, func):
try:
func()
except exc_class:
pass
e... | bsd-3-clause |
jpetto/bedrock | bedrock/firefox/helpers.py | 1 | 8778 | from collections import OrderedDict
from django.core.cache import cache
from django.conf import settings
import jingo
import jinja2
from bedrock.firefox.models import FirefoxOSFeedLink
from bedrock.firefox.firefox_details import firefox_desktop, firefox_android, firefox_ios
from bedrock.base.urlresolvers import reve... | mpl-2.0 |
PeterSurda/PyBitmessage | src/kivymd/bottomsheet.py | 3 | 6751 | # -*- coding: utf-8 -*-
'''
Bottom Sheets
=============
`Material Design spec Bottom Sheets page <http://www.google.com/design/spec/components/bottom-sheets.html>`_
In this module there's the :class:`MDBottomSheet` class which will let you implement your own Material Design Bottom Sheets, and there are two classes ca... | mit |
Metaswitch/calico-neutron | neutron/db/migration/alembic_migrations/versions/236b90af57ab_ml2_refactor_for_dynamic_segments.py | 17 | 1170 | # Copyright 2014 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 applicable law ... | apache-2.0 |
Elettronik/SickRage | lib/pgi/cffilib/gir/giunioninfo.py | 20 | 1903 | # Copyright 2013 Christoph Reiter
#
# 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.1 of the License, or (at your option) any later version.
from .._compat import xran... | gpl-3.0 |
KohlsTechnology/ansible | test/runner/lib/docker_util.py | 16 | 5429 | """Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
)
from lib.config im... | gpl-3.0 |
satish-avninetworks/murano | murano/dsl/murano_package.py | 1 | 7758 | # Copyright (c) 2014 Mirantis, 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... | apache-2.0 |
40223235/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/contextlib.py | 737 | 8788 | """Utilities for with-statement contexts. See PEP 343."""
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"]
class ContextDecorator(object):
"A base class or mixin that enables context managers to work as decorators."
... | gpl-3.0 |
DevHugo/zds-site | zds/utils/tutorials.py | 1 | 2669 | # coding: utf-8
import os
# Used for indexing tutorials, we need to parse each manifest to know which content have been published
class GetPublished:
published_part = []
published_chapter = []
published_extract = []
def __init__(self):
pass
@classmethod
def get_published_content(cls... | gpl-3.0 |
piyushroshan/xen-4.3.2 | tools/python/xen/xm/help.py | 52 | 3242 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
HPPTECH/hpp_IOSTressTest | Refer/IOST_OLD_SRC/IOST_0.18/IOST.py | 1 | 8248 | #!/usr/bin/env python
#======================================================================
#
# Project : hpp_IOStressTest
# File : IOST.py
# Date : Sep 21, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT License
# Copyright : 2016
# Descri... | mit |
yuanguo8/nubiaz5s_kernel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
LUTAN/tensorflow | tensorflow/examples/learn/text_classification_cnn.py | 53 | 4430 | # 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 appl... | apache-2.0 |
gkarlin/django-jenkins | build/pylint/reporters/html.py | 5 | 2481 | # Copyright (c) 2003-2006 Sylvain Thenault (thenault@gmail.com).
# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE).
# 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 L... | lgpl-3.0 |
Antiun/odoomrp-wip | quality_control_force_valid/__openerp__.py | 19 | 1379 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2014 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
zeroincombenze/tools | zar/restdb.py | 2 | 29848 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) SHS-AV s.r.l. (<http://www.zeroincombenze.it>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
iruga090/python-social-auth | social/pipeline/disconnect.py | 88 | 1082 | from social.exceptions import NotAllowedToDisconnect
def allowed_to_disconnect(strategy, user, name, user_storage,
association_id=None, *args, **kwargs):
if not user_storage.allowed_to_disconnect(user, name, association_id):
raise NotAllowedToDisconnect()
def get_entries(strate... | bsd-3-clause |
Hubert51/AutoGrading | learning/number_recognization/test.py | 1 | 1250 | from pytesseract import image_to_string
from PIL import Image
import cv2
import numpy
import sys
if __name__ == '__main__':
f = open("test1.txt")
f = f.read()
for element in f:
str1 = element
position = ((712, 571), (725, 587))
dh = position[1][1] - position[0][1]
upper = position[0][... | mit |
bblais/Tech-SIE | Estimating_Proportion/Estimating_Proportion.py | 1 | 4755 |
# coding: utf-8
# #Statistical Inference for Everyone: Technical Supplement
#
#
#
# This document is the technical supplement, for instructors, for [Statistical Inference for Everyone], the introductory statistical inference textbook from the perspective of "probability theory as logic".
#
# <img src="http://web... | mit |
gpndata/grpc | src/python/grpcio_test/grpc_test/framework/interfaces/face/test_cases.py | 14 | 3176 | # 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 |
openaire/iis | iis-3rdparty-madis/src/main/resources/eu/dnetlib/iis/3rdparty/scripts/madis/functions/row/util.py | 4 | 10746 | # coding: utf-8
import setpath
from gzip import zlib
import subprocess
import functions
import time
import urllib2
import urllib
from lib import jopts
from functions.conf import domainExtraHeaders
import lib.gzip32 as gzip
try:
from collections import OrderedDict
except ImportError:
# Python 2.6
from lib.co... | apache-2.0 |
guymakam/Kodi-Israel | plugin.video.reshet.video/resources/appCaster/APEpgLoader.py | 3 | 1230 | # -*- coding: utf-8 -*-
'''
Created on 21/01/2012
Copyright (c) 2010-2012 Shai Bentin.
All rights reserved. Unpublished -- rights reserved
Use of a copyright notice is precautionary only, and does
not imply publication or disclosure.
Licensed under Eclipse Public License, Version 1.0
In... | gpl-2.0 |
vimagick/youtube-dl | youtube_dl/extractor/thvideo.py | 151 | 3033 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate
)
class THVideoIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P<id>[0-9]+)'
_TEST = {
'url': 'http://thvideo.tv/v/... | unlicense |
Giftingnation/GN-Oscar-Custom | sites/demo/apps/order/migrations/0005_auto__add_field_orderdiscount_offer_name.py | 16 | 32848 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'OrderDiscount.offer_name'
db.add_column('order_orderdiscount', 'offer_name', self.gf('djan... | bsd-3-clause |
peterfpeterson/mantid | scripts/Interface/reduction_gui/widgets/sans/hfir_background.py | 3 | 12637 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
#pyl... | gpl-3.0 |
enzochiau/tablib | tablib/packages/openpyxl3/reader/worksheet.py | 55 | 3839 | # file openpyxl/reader/worksheet.py
# Copyright (c) 2010 openpyxl
#
# 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, cop... | mit |
mikkylok/mikky.lu | venv/lib/python2.7/site-packages/markdown/extensions/abbr.py | 123 | 2738 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/abbreviations.html>
for documentation.
Oringinal code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/) ... | mit |
SebDieBln/QGIS | python/ext-libs/pygments/lexers/_luabuiltins.py | 275 | 6863 | # -*- coding: utf-8 -*-
"""
pygments.lexers._luabuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit th... | gpl-2.0 |
blackye/luscan-devel | thirdparty_libs/django/db/backends/dummy/base.py | 106 | 2276 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | gpl-2.0 |
wylee/django-local-settings | src/local_settings/util.py | 1 | 5070 | import importlib
import io
import os
import dotenv
NO_DEFAULT = type(
"NO_DEFAULT",
(),
{
"__nonzero__": (lambda self: False), # Python 2
"__bool__": (lambda self: False), # Python 3
"__str__": (lambda self: self.__class__.__name__),
"__repr__": (lambda self: str(self)),... | mit |
ngageoint/voxel-globe | voxel_globe/tests/tasks.py | 2 | 1124 | from voxel_globe.common_tasks import shared_task, VipTask
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@shared_task(base=VipTask, bind=True)
def success(self):
import time
time.sleep(0.5)
return 123
@shared_task(base=VipTask, bind=True)
def python_crash(self):
import time
... | mit |
ngageoint/scale | scale/data/models.py | 1 | 24039 | """Defines the database models for datasets"""
from __future__ import absolute_import, unicode_literals
import copy
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import models, transaction
from django.db.models import Q, Count
from data.data import data_util
f... | apache-2.0 |
jordigh/mercurial-crew | mercurial/mdiff.py | 92 | 11609 | # mdiff.py - diff and patch routines for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import bdiff, mpatch, util
import re, struct, base85, zl... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.