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 |
|---|---|---|---|---|---|
mccheung/kbengine | kbe/res/scripts/common/Lib/email/errors.py | 120 | 3535 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message parsing errors... | lgpl-3.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/test_internals.py | 7 | 47893 | # -*- coding: utf-8 -*-
# pylint: disable=W0102
from datetime import datetime, date
import nose
import numpy as np
import re
import itertools
from pandas import (Index, MultiIndex, DataFrame, DatetimeIndex,
Series, Categorical)
from pandas.compat import OrderedDict, lrange
from pandas.sparse.arra... | apache-2.0 |
python-spain/symposion | symposion/schedule/timetable.py | 7 | 1605 | import itertools
import operator
from django.db.models import Count, Min
from symposion.schedule.models import Room, Slot, SlotRoom
class TimeTable(object):
def __init__(self, day):
self.day = day
def slots_qs(self):
qs = Slot.objects.all()
qs = qs.filter(day=self.day)
... | bsd-3-clause |
MSeifert04/astropy | astropy/extern/ply/cpp.py | 22 | 33538 | # -----------------------------------------------------------------------------
# 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.
# -------------------------------------------------------------... | bsd-3-clause |
manasi24/tempest | tempest/api/compute/images/test_images_negative.py | 5 | 6775 | # Copyright 2012 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 |
ossdemura/django-miniblog | src/Lib/encodings/iso2022_jp_ext.py | 816 | 1069 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... | mit |
datalogics-robb/scons | test/TEX/LATEXFLAGS.py | 2 | 3568 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... | mit |
shakamunyi/neutron | neutron/tests/unit/plugins/embrane/test_embrane_neutron_plugin.py | 40 | 2774 | # Copyright 2013 Embrane, 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... | apache-2.0 |
scifiswapnil/Project-LoCatr | lib/python2.7/site-packages/pip/_vendor/webencodings/x_user_defined.py | 341 | 4306 | # coding: utf8
"""
webencodings.x_user_defined
~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the x-user-defined encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
import codecs
### Codec APIs
class Codec... | mit |
ttfseiko/openerp-trunk | openerp/addons/mail/tests/test_mail_group.py | 44 | 3965 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
jeromeetienne/three.js | utils/exporters/blender/addons/io_three/exporter/api/light.py | 104 | 1461 | from bpy import data, types
from .. import utilities, logger
def _lamp(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Lamp):
lamp = name
... | mit |
ecoal95/servo | tests/wpt/web-platform-tests/tools/third_party/py/setup.py | 51 | 2222 | import os
import sys
from setuptools import setup, find_packages
def get_version():
p = os.path.join(os.path.dirname(
os.path.abspath(__file__)), "py", "__init__.py")
with open(p) as f:
for line in f.readlines():
if "__version__" in line:
return line.s... | mpl-2.0 |
uppsaladatavetare/foobar-api | src/shop/migrations/0015_auto_20170213_2104.py | 1 | 2723 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-13 21:04
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swapp... | mit |
ujenmr/ansible | test/units/vars/test_module_response_deepcopy.py | 118 | 1473 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.vars.clean import module_response_deepcopy
import pytest
def... | gpl-3.0 |
Lektorium-LLC/edx-platform | common/lib/capa/capa/responsetypes.py | 3 | 164397 | #
# File: courseware/capa/responsetypes.py
#
"""
Problem response evaluation. Handles checking of student responses,
of a variety of types.
Used by capa_problem.py
"""
# pylint: disable=attribute-defined-outside-init
# standard library imports
import abc
# TODO: Refactor this code and fix this issue.
import cgi
im... | agpl-3.0 |
pgmillon/ansible | lib/ansible/modules/database/postgresql/postgresql_query.py | 1 | 7823 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Felix Archambault
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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)... | gpl-3.0 |
lanniaoershi/git-repo | subcmds/list.py | 48 | 2535 | #
# Copyright (C) 2011 The Android Open Source Project
#
# 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 la... | apache-2.0 |
jiajiax/crosswalk-test-suite | webapi/webapi-imports-w3c-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
odoousers2014/odoo | addons/stock_landed_costs/stock_landed_costs.py | 3 | 18290 | # -*- 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 |
asimshankar/tensorflow | tensorflow/contrib/optimizer_v2/adam_test.py | 20 | 14036 | # 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 |
ActiveState/code | recipes/Python/146306_Http_client_POST_using/recipe-146306.py | 2 | 1813 | import httplib, mimetypes
def post_multipart(host, selector, fields, files):
"""
Post fields and files to an http host as multipart/form-data.
fields is a sequence of (name, value) elements for regular form fields.
files is a sequence of (name, filename, value) elements for data to be uploaded as files... | mit |
I-sektionen/i-portalen | wsgi/iportalen_django/bookings/views.py | 1 | 12219 | import ast
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from django.shortcuts import render, get_object_or_404, re... | mit |
thoraxe/openshift-ansible | test/openshift_version_tests.py | 5 | 3670 | """ Tests for the openshift_version Ansible filter module. """
# pylint: disable=missing-docstring,invalid-name
import os
import sys
import unittest
sys.path = [os.path.abspath(os.path.dirname(__file__) + "/../filter_plugins/")] + sys.path
# pylint: disable=import-error
import openshift_version # noqa: E402
class... | apache-2.0 |
Rio517/pledgeservice | lib/requests/packages/urllib3/util/url.py | 304 | 4273 | from collections import namedtuple
from ..exceptions import LocationParseError
class Url(namedtuple('Url', ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'])):
"""
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
"""
slots = ()
def __new... | apache-2.0 |
cmelange/ansible | lib/ansible/modules/windows/win_find.py | 12 | 10238 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
alxgu/ansible | test/units/module_utils/basic/test_selinux.py | 78 | 11565 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# 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
... | gpl-3.0 |
bottompawn/kbengine | kbe/res/scripts/common/Lib/test/test_importlib/builtin/test_finder.py | 81 | 2798 | from .. import abc
from .. import util
from . import util as builtin_util
frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
import sys
import unittest
class FindSpecTests(abc.FinderTests):
"""Test find_spec() for built-in modules."""
def test_module(self):
# Common ... | lgpl-3.0 |
melissaihrig/namebench | tools/split_instance_in_csv.py | 174 | 1077 | #!/usr/bin/env python
# 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... | apache-2.0 |
sinhrks/numpy | 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... | bsd-3-clause |
Code4SA/gmmp | forms/models.py | 1 | 12257 | from collections import OrderedDict
from django.db import models
from django.utils.translation import ugettext_lazy as _
from modelutils import *
def prepend_verbose(mydict, field_name, num):
field = mydict[field_name]
field.verbose_name = '(%s) %s' % (num, field_name)
class InternetNewsJournalist(Journalist... | apache-2.0 |
alexbruy/QGIS | python/plugins/processing/algs/taudem/gridnet.py | 3 | 4755 | # -*- coding: utf-8 -*-
"""
***************************************************************************
gridnet.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*****************... | gpl-2.0 |
NOMORECOFFEE/otp | lib/asn1/test/asn1_SUITE_data/SwCDR.py | 97 | 5470 | SwCDR DEFINITIONS
IMPLICIT TAGS ::=
BEGIN
EXPORTS
SwCDR;
SwCDR ::= CHOICE
{
origSvcCallRecord [0] OrigSvcCallRecord,
termSvcCallRecord [1] TermSvcCallRecord
}
--OrigSvcCallRecord ::= SET
OrigSvcCallRecord ::= SEQUENCE
{
callCorrelationId [0] INTEGER ,
chargingIndicator [1] ChargingIndicator,
... | apache-2.0 |
lyceel/engine | build/gn_helpers.py | 117 | 1344 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper functions useful when writing scripts that are run from GN's
exec_script function."""
class GNException(Exception):
pass
def ToGNString(value,... | bsd-3-clause |
hanghang177/robo-i-star | Dronekit-Examples/drone_delivery/drone_delivery.py | 4 | 7855 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
© Copyright 2015-2016, 3D Robotics.
drone_delivery.py:
A CherryPy based web application that displays a mapbox map to let you view the current vehicle position and send the vehicle commands to fly to a particular latitude and longitude.
Full documentation is provided... | gpl-3.0 |
theunissenlab/python-neo | neo/io/nestio.py | 5 | 32456 | # -*- coding: utf-8 -*-
"""
Class for reading output files from NEST simulations
( http://www.nest-simulator.org/ ).
Tested with NEST2.10.0
Depends on: numpy, quantities
Supported: Read
Authors: Julia Sprenger, Maximilian Schmidt, Johanna Senk
"""
# needed for Python3 compatibility
from __future__ import absolute_... | bsd-3-clause |
dhruve/spark | examples/src/main/python/ml/correlation_example.py | 46 | 1792 | #
# 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 |
alfayez/gnuradio | gnuradio-core/src/python/gnuradio/gr/__init__.py | 2 | 1609 | #
# Copyright 2003-2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
mightbejosh/dj-braintree | djbraintree/webhooks.py | 1 | 1978 | # # -*- coding: utf-8 -*-
# """
# .. module:: djbraintree.webhooks
# :synopsis: dj-braintree - Utils related to processing or registering for webhooks
#
# .. moduleauthor:: Bill Huneke (@wahuneke)
#
# A model registers itself here if it wants to be in the list of processing
# functions for a particular webhook. Each... | bsd-3-clause |
fenixbinario/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_msgs.py | 215 | 11646 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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... | gpl-3.0 |
andrewsmedina/horizon | horizon/horizon/dashboards/nova/containers/tests.py | 1 | 10727 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
darkrho/scrapy-scrapy | scrapy/downloadermiddlewares/cookies.py | 128 | 3330 | import os
import six
import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.http import Response
from scrapy.http.cookies import CookieJar
from scrapy.utils.python import to_native_str
logger = logging.getLogger(__name__)
class CookiesMiddleware(object):
"""Th... | bsd-3-clause |
fivejjs/copperhead | samples/laplace.py | 5 | 1287 | from copperhead import *
from numpy import zeros
@cu
def initialize(N):
nx, ny = N
def el(i):
y = i / nx
if y==0:
return 1.0
else:
return 0.0
return map(el, range(nx * ny))
@cu
def solve(u, N, D2, it):
nx, ny = N
dx2, dy2 = D2
def el(i):
... | apache-2.0 |
edx-solutions/edx-platform | openedx/core/djangoapps/content/block_structure/exceptions.py | 6 | 1045 | """
Application-specific exceptions raised by the block structure framework.
"""
class BlockStructureException(Exception):
"""
Base class for all Block Structure framework exceptions.
"""
pass
class TransformerException(BlockStructureException):
"""
Exception class for Transformer related er... | agpl-3.0 |
sasukeh/cinder | cinder/wsgi/common.py | 10 | 9167 | # 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 agreed to in... | apache-2.0 |
bbossola/robotframework-selenium2library | src/Selenium2Library/keywords/_selectelement.py | 9 | 14906 | from selenium.webdriver.support.ui import Select
from keywordgroup import KeywordGroup
class _SelectElementKeywords(KeywordGroup):
# Public
def get_list_items(self, locator):
"""Returns the values in the select list identified by `locator`.
Select list keywords work on both lists and combo b... | apache-2.0 |
mogoweb/chromium-crosswalk | tools/telemetry/telemetry/page/page_runner.py | 1 | 16316 | # 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 collections
import glob
import logging
import os
import sys
import tempfile
import time
import traceback
import random
from telemetry.core import ... | bsd-3-clause |
Swind/TuringCoffee | src/process/process.py | 1 | 7244 | import re
from collections import namedtuple
Point = namedtuple('Point', ['x', 'y', 'z', 'e1', 'e2'])
class Point(object):
def __init__(self, x=None, y=None, z=None, e1=None, e2=None, f=None):
self.x = x
self.y = y
self.z = z
self.e1 = e1
self.e2 = e2
self.f = f
... | mit |
fw1121/CheckM | scripts/geneCountDict.py | 3 | 3107 | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 |
emulbreh/vacuous | vacuous/backends/dulwich/utils.py | 1 | 2465 | import os
import stat
def clean_path(path):
try:
path = str(path)
except UnicodeEncodeError:
raise ValueError("dulwich requires bytestring path names")
path = os.path.normpath(path)
if '..' in path:
raise ValueError("found '..' in path")
return path
def iter_blob_paths(re... | mit |
DROPCitizenShip/e-cidadania | src/core/spaces/views/documents.py | 1 | 5783 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 |
rsvip/Django | django/db/migrations/graph.py | 351 | 10956 | from __future__ import unicode_literals
import warnings
from collections import deque
from functools import total_ordering
from django.db.migrations.state import ProjectState
from django.utils.datastructures import OrderedSet
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import Circu... | bsd-3-clause |
cbitstech/Purple-Robot-Django | formatters/services_fitbitbetaprobe.py | 1 | 2888 | # pylint: disable=line-too-long, unused-argument
import json
from django.template.loader import render_to_string
def format_reading(probe_name, json_payload):
item = json.loads(json_payload)
heart = '?'
steps = '?'
distance = '?'
calories = '?'
floors = '?'
elevation = '?'
if 'HEAR... | gpl-3.0 |
8l/beri | cheritest/trunk/fuzz_dma/build_tests.py | 2 | 2340 | #
# Copyright (c) 2015 Colin Rothwell
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to B... | apache-2.0 |
glaubitz/fs-uae-debian | arcade/OpenGL/GL/NV/fragment_program2.py | 9 | 1966 | '''OpenGL extension NV.fragment_program2
This module customises the behaviour of the
OpenGL.raw.GL.NV.fragment_program2 to provide a more
Python-friendly API
Overview (from the spec)
This extension, like the NV_fragment_program_option extension, provides
additional fragment program functionality to extend the s... | gpl-2.0 |
matys18/sublime_kattis | requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/mako/compat.py | 61 | 4961 | import sys
import time
py3k = sys.version_info >= (3, 0)
py33 = sys.version_info >= (3, 3)
py2k = sys.version_info < (3,)
py26 = sys.version_info >= (2, 6)
py27 = sys.version_info >= (2, 7)
jython = sys.platform.startswith('java')
win32 = sys.platform.startswith('win')
pypy = hasattr(sys, 'pypy_version_info')
if py3k... | mit |
glewis17/cvxpy | cvxpy/problems/solvers/ecos_intf.py | 11 | 5068 | """
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 |
alivecor/tensorflow | tensorflow/tools/dist_test/python/mnist_replica.py | 44 | 10714 | # 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 |
wildux/tfg | codi/test.py | 1 | 2682 | import MORAS as vc
import cv2
import numpy as np
'''**********************
IMAGES
**********************'''
img1 = cv2.imread('images/experiments/jardi2.jpg')
img1, imgROIGray = vc.imgPrep(img1)
img2 = cv2.imread('images/experiments/jardi_2.jpg')
img2, imgRobotGray = vc.imgPrep(img2)
psAlg = vc._HARRIS
feAlg = vc._S... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/263_double_const.py | 237 | 1217 | from test.test_support import TestFailed
# A test for SF bug 422177: manifest float constants varied way too much in
# precision depending on whether Python was loading a module for the first
# time, or reloading it from a precompiled .pyc. The "expected" failure
# mode is that when test_import imports this after al... | gpl-3.0 |
gam-phon/taiga-back | tests/unit/conftest.py | 3 | 1070 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández <hello@anler.me>
# This ... | agpl-3.0 |
foobarbazblarg/stayclean | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_vendor/html5lib/constants.py | 54 | 83464 | from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
"invalid-codepoint":
"Invalid codepoint in stream.",
"incorrectly-placed-solidus":
"Solidus (/) incorrectly ... | mit |
zadgroup/edx-platform | common/djangoapps/auth_exchange/tests/utils.py | 116 | 3688 | """
Test utilities for OAuth access token exchange
"""
import provider.constants
from social.apps.django_app.default.models import UserSocialAuth
from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin
class AccessTokenExchangeTestMixin(ThirdPartyOAuthTestMixin):
"""
A mixin to define test cases fo... | agpl-3.0 |
zhounanshu/Flask-AppBuilder | examples/quicktemplates/config.py | 14 | 1815 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
OPENID_PROVIDERS = [
{'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id'},
{'name': 'Yahoo', 'url': 'https://me.yahoo.com'},
{'name': 'AOL', 'url': 'http://open... | bsd-3-clause |
jamiefolsom/edx-platform | cms/djangoapps/contentstore/views/tabs.py | 125 | 7890 | """
Views related to course tabs
"""
from student.auth import has_course_author_access
from util.json_request import expect_json, JsonResponse
from django.http import HttpResponseNotFound
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.views.dec... | agpl-3.0 |
imtapps/django-imt-fork | tests/regressiontests/forms/tests/util.py | 111 | 3318 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms.util import flatatt, ErrorDict, ErrorList
from django.test import TestCase
from django.utils.safestring import mark_safe
from django.utils import six
from django.utils.translation import... | bsd-3-clause |
ddcrjlalumiere/pyvmomi-community-samples | samples/sessions_list.py | 12 | 3067 | #!/usr/bin/env python
# VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, 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/lic... | apache-2.0 |
ligovirgo/gwdetchar | gwdetchar/const.py | 4 | 2952 | # coding=utf-8
# Copyright (C) Duncan Macleod (2015)
#
# This file is part of the GW DetChar python package.
#
# GW DetChar 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
#... | gpl-3.0 |
COSMOGRAIL/COSMOULINE | pipe/6_extract_scripts/12_extrnancosm.py | 1 | 7605 | # I extract according to objkey, replace NAN, and find cosmics.
# All in one script.
# The database update is done right at the beginning, i.e.
# no need to wait that I'm done before launching the next scripts
# that modify the db.
execfile("../config.py")
from kirbybase import KirbyBase, KBError
from variousfct im... | gpl-3.0 |
ramielrowe/magnum | magnum/common/pythonk8sclient/client/models/V1beta3_PersistentVolumeClaimSpec.py | 15 | 1714 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... | apache-2.0 |
peihe/incubator-beam | sdks/python/apache_beam/coders/coders.py | 5 | 24772 | #
# 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 |
rohitw1991/smartfrappe | frappe/model/delete_doc.py | 3 | 5591 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.model.meta
import frappe.defaults
from frappe.utils.file_manager import remove_all
from frappe import _
from rename_doc import dynamic_link_queries... | mit |
turbhrus/pixhg | mk/PX4/Tools/gencpp/src/gencpp/__init__.py | 214 | 9473 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... | gpl-3.0 |
rahulunair/nova | nova/virt/configdrive.py | 1 | 6491 | # Copyright 2012 Michael Still and Canonical 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
#
# ... | apache-2.0 |
javelinanddart/android_kernel_3.10_ville | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
arambadk/django-datatable | setup.py | 1 | 1197 | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
try:
import pypandoc
README = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
README = open('README.md').read()
setup(
name='django-datatable',
version='0.2.1',
author='shymonk',
author_ema... | mit |
Dandandan/wikiprogramming | jsrepl/extern/python/closured/lib/python2.7/xml/dom/xmlbuilder.py | 239 | 12337 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | mit |
ssdoz2sk/Telegram_ENL-Bot | plugins/ohiyo.py | 1 | 1788 | import logging, time
import plugins
logger = logging.getLogger( __name__ )
# logger.setLevel( 'DEBUG' )
bot = plugins.tracking.bot
@bot.message_handler( func=lambda message: True )
def reply( message ):
localtime = time.localtime( time.time() )
t_hour = localtime.tm_hour
if message.chat.id < 0:
lo... | agpl-3.0 |
catroot/rethinkdb | test/common/http_support/werkzeug/testapp.py | 294 | 9398 | # -*- coding: utf-8 -*-
"""
werkzeug.testapp
~~~~~~~~~~~~~~~~
Provide a small test application that can be used to test a WSGI server
and check it for WSGI compliance.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
impo... | agpl-3.0 |
vfulco/ansible | lib/ansible/parsing/__init__.py | 15 | 9296 | # (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 |
DimensionSoftware/Flask-User | flask_user/tokens.py | 7 | 3297 | """ This file contains functions to generate and verify tokens for Flask-User.
Tokens contain an encoded user ID and a signature. The signature is managed by the itsdangerous module.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE... | bsd-2-clause |
epssy/hue | desktop/core/ext-py/Django-1.6.10/django/db/models/sql/datastructures.py | 114 | 1853 | """
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
... | apache-2.0 |
yinquan529/platform-external-chromium_org-tools-gyp | test/hard_dependency/gyptest-no-exported-hard-dependency.py | 350 | 1226 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verify that a hard_dependency that is not exported is not pulled in as a
dependency for a target if the target does not explicitly speci... | bsd-3-clause |
photoninger/ansible | lib/ansible/modules/network/eos/eos_linkagg.py | 9 | 10433 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
JimCircadian/ansible | lib/ansible/modules/storage/netapp/netapp_e_volume_copy.py | 22 | 16460 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# 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': ['preview'],
... | gpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/writer/write_only.py | 13 | 7030 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Write worksheets to xml representations in an optimized way"""
import atexit
from inspect import isgenerator
import os
from tempfile import NamedTemporaryFile
from openpyxl.cell import Cell
from openpyxl.worksheet import Worksheet
from ope... | apache-2.0 |
aerius/aerius-imaer-templates | farmLodging/gml_templating_lib.py | 7 | 7143 | """
Copyright [Participants AERIUS Masterclass: Marco Duiker, Peer vd Sande, Alex Bouthoorn, Laurens vd Burgt, Rik Zegers, Lotte Dijk, Kaj Fabri, Esther Kokmeyer, Christa Blokhuis, Anneke Donkersloot, Japer Harbers, Roy Laurijsse, Luc Meegens, Marike Aalbers]
Licensed under the Apache License, Version 2.0 (the "Licens... | apache-2.0 |
charany1/googlecl | src/googlecl/calendar/date.py | 2 | 18185 | # Copyright (C) 2010 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 writ... | mit |
campagnola/neuroanalysis | neuroanalysis/ui/cell_selector.py | 1 | 3836 | from collections import OrderedDict
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph.parametertree as pt
import numpy as np
class CellSelector(QtCore.QObject):
"""Select a single cell from a list of cells or from a pre-segmented image.
Signals
-------
cell_selection_... | mit |
zangree/ryu | ryu/log.py | 36 | 3413 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
zouyapeng/horizon | openstack_dashboard/dashboards/admin/networks/ports/views.py | 20 | 2422 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
tartley/pyweek11-cube | source/model/item/room.py | 2 | 1202 | from __future__ import division
from .gameitem import GameItem
from .wall import WallShape
def RoomBounds(xsize, ysize, zsize):
bounds = set()
bounds = bounds.union( set(
(x, y, z)
for x in [-1, xsize]
for y in xrange(0, ysize)
for z in xrange(0, zsize)
) )
bounds = bo... | bsd-3-clause |
trezor/micropython | tests/perf_bench/misc_raytrace.py | 2 | 7278 | # A simple ray tracer
# MIT license; Copyright (c) 2019 Damien P. George
INF = 1e30
EPS = 1e-6
class Vec:
def __init__(self, x, y, z):
self.x, self.y, self.z = x, y, z
def __neg__(self):
return Vec(-self.x, -self.y, -self.z)
def __add__(self, rhs):
return Vec(self.x + rhs.x, self... | mit |
fragaria/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 |
cdgallahue/atomic-turbine | web/lib/python2.7/site-packages/werkzeug/contrib/iterio.py | 104 | 10814 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... | mit |
SofiaReis/django-cms | cms/utils/copy_plugins.py | 43 | 1621 | # -*- coding: utf-8 -*-
from django.utils.six.moves import zip
def copy_plugins_to(old_plugins, to_placeholder,
to_language=None, parent_plugin_id=None, no_signals=False):
"""
Copies a list of plugins to a placeholder to a language.
"""
# TODO: Refactor this and copy_plugins to cle... | bsd-3-clause |
adhoc-dev/purchase-workflow | purchase_partial_invoicing/tests/test_purchase_partial_invoicing.py | 11 | 13931 | # -*- coding: utf-8 -*-
#
##############################################################################
#
# Authors: Adrien Peiffer
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
DCSaunders/tensorflow | tensorflow/python/ops/io_ops.py | 5 | 15285 | # 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 |
joaoarthurbm/ciframe | lib/flask/app.py | 345 | 76786 | # -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... | apache-2.0 |
duducosmos/pgs4a | python-install/lib/python2.7/distutils/tests/test_build_scripts.py | 95 | 3600 | """Tests for distutils.command.build_scripts."""
import os
import unittest
from distutils.command.build_scripts import build_scripts
from distutils.core import Distribution
import sysconfig
from distutils.tests import support
from test.test_support import run_unittest
class BuildScriptsTestCase(support.TempdirMana... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.