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 |
|---|---|---|---|---|---|
gnowledge/ncert_nroer | gstudio/spam_checker/backends/automattic.py | 3 | 4825 | # Copyright (c) 2011, 2012 Free Software Foundation
# 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 the
# License, or (at your option) any later vers... | agpl-3.0 |
darkleons/odoo | addons/mrp_repair/wizard/cancel_repair.py | 384 | 3683 | # -*- 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 |
petteyg/intellij-community | python/lib/Lib/distutils/command/build_scripts.py | 97 | 5528 | """distutils.command.build_scripts
Implements the Distutils 'build_scripts' command."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: build_scripts.py 59668 2008-01-02 18:59:36Z guido.van.rossum $"
import sys, os, re
from stat import ST_MODE
from distutils import sysconfig
from distu... | apache-2.0 |
pyparallel/numpy | numpy/polynomial/polynomial.py | 126 | 48268 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | bsd-3-clause |
RedHatQE/cfme_tests | cfme/utils/tests/test_soft_get.py | 4 | 1361 | import pytest
from cfme.utils.soft_get import MultipleResultsException
from cfme.utils.soft_get import soft_get
def test_soft_get():
class TestObj(object):
a = 1
b = 2
c = 3
aa = 11
bb = 22
bbb = 222
container_image = 'container_image'
image_regist... | gpl-2.0 |
Leibniz137/testinfra | testinfra/backend/ssh.py | 1 | 2940 | # coding: utf-8
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... | apache-2.0 |
forpster/dotfiles | home/.emacs.d/.python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/compat.py | 1039 | 1469 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
try:
import simplejson as json
except (ImportError, SyntaxError):
# si... | mit |
alexandrebarachant/decoding-brain-challenge-2016 | models/pyriemann/utils/distance.py | 1 | 4099 | """Distance utils."""
import numpy
from scipy.linalg import eigvalsh
from .base import logm, sqrtm
def distance_kullback(A, B):
"""Kullback leibler divergence between two covariance matrices A and B.
:param A: First covariance matrix
:param B: Second covariance matrix
:returns: Kullback leibler dive... | bsd-3-clause |
hugegreenbug/libgestures | include/build/protoc_java.py | 90 | 1317 | #!/usr/bin/env python
# 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.
"""Generate java source files from protobufs
Usage:
protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}... | bsd-3-clause |
orvi2014/kitsune | kitsune/customercare/api.py | 11 | 4324 | import json
from rest_framework import generics, serializers, status, decorators
from rest_framework.response import Response
from kitsune.customercare.models import TwitterAccount
from kitsune.sumo.api import GenericAPIException, GenericDjangoPermission
class TwitterAccountBanPermission(GenericDjangoPermission):
... | bsd-3-clause |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Lib/sre_compile.py | 48 | 16292 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import _sre, sys
import sre_parse
from sre_constants impo... | apache-2.0 |
phihag/youtube-dl | youtube_dl/extractor/foxsports.py | 31 | 1391 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
update_url_query,
)
class FoxSportsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*(?P<id>[^/]+)'
_TEST = {
'url': 'http://www.foxsports.com/tennessee/v... | unlicense |
leafclick/intellij-community | plugins/hg4idea/testData/bin/hgext/extdiff.py | 93 | 12642 | # extdiff.py - external diff program support for mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to allow external programs to compare revisions
The ex... | apache-2.0 |
r351574nc3/kualigan-courseware | modules/review/stats.py | 7 | 5775 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
ZachMassia/platformio | platformio/pkgmanager.py | 1 | 5564 | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
chjw8016/GreenOdoo7-haibao | openerp/addons/auth_oauth/controllers/main.py | 20 | 4484 | import functools
import logging
import simplejson
import werkzeug.utils
from werkzeug.exceptions import BadRequest
import openerp
from openerp import SUPERUSER_ID
import openerp.addons.web.http as oeweb
from openerp.addons.web.controllers.main import db_monodb, set_cookie_and_redirect, login_and_redirect
from openerp... | mit |
vlachoudis/sl4a | python/src/Mac/Modules/res/resscan.py | 34 | 2701 | # Scan Resources.h header file, generate resgen.py and Resources.py files.
# Then run ressupport to generate Resmodule.c.
# (Should learn how to tell the compiler to compile it as well.)
import sys
import MacOS
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
def ... | apache-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/scipy/signal/lti_conversion.py | 41 | 13971 | """
ltisys -- a collection of functions to convert linear time invariant systems
from one representation to another.
"""
from __future__ import division, print_function, absolute_import
import numpy
import numpy as np
from numpy import (r_, eye, atleast_2d, poly, dot,
asarray, product, zeros, array,... | mit |
Brett55/moto | tests/test_autoscaling/test_elbv2.py | 4 | 4795 | from __future__ import unicode_literals
import boto3
import sure # noqa
from moto import mock_autoscaling, mock_ec2, mock_elbv2
from utils import setup_networking
@mock_elbv2
@mock_autoscaling
def test_attach_detach_target_groups():
mocked_networking = setup_networking()
INSTANCE_COUNT = 2
client = bot... | apache-2.0 |
jbonofre/incubator-beam | sdks/python/apache_beam/examples/wordcount_minimal.py | 6 | 4919 | #
# 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 |
zofuthan/edx-platform | common/test/acceptance/tests/test_ora.py | 118 | 15617 | """
Tests for ORA (Open Response Assessment) through the LMS UI.
"""
import json
from unittest import skip
from bok_choy.promise import Promise, BrokenPromise
from ..pages.lms.peer_confirm import PeerConfirmPage
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.course_info import CourseInfoPage
from ..p... | agpl-3.0 |
dermoth/gramps | gramps/gui/widgets/basicentry.py | 11 | 1586 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Nick Hall
#
# 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)... | gpl-2.0 |
ramadhane/odoo | addons/product_visible_discount/__init__.py | 433 | 1054 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
trafi/gyp | test/win/gyptest-cl-buffer-security-check.py | 344 | 1612 | #!/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.
"""
Make sure buffer security check setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Tes... | bsd-3-clause |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/requests/packages/charade/langhungarianmodel.py | 184 | 12761 | ######################## 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 Ri... | mit |
Litiks/django_server_stats | server_stats/migrations/0001_initial.py | 1 | 6604 | # -*- 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 model 'PageViewLog'
db.create_table('server_stats_pageviewlog', ... | mit |
vnsofthe/odoo | addons/l10n_pt/__openerp__.py | 380 | 1834 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved
# http://www.thinkopensolutions.com.
# $Id$
#
# This program is free software: you can red... | agpl-3.0 |
tellesnobrega/storm_plugin | sahara/plugins/hdp/hadoopserver.py | 1 | 9095 | # Copyright (c) 2013 Hortonworks, 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 ... | apache-2.0 |
iitis/mutrics | portname/step2_train.py | 1 | 1699 | #!/usr/bin/env python3
# Author: Pawel Foremski <pjf@iitis.pl>
# Copyright (C) 2012-2014 IITiS PAN <http://www.iitis.pl/>
# Licensed under GNU GPL v3
import sys
import argparse
import random
from HTClass import *
def main(param, src, dst, numtrain, numtest):
samples = []
# read data
for line in src:
line = line... | gpl-3.0 |
ucloud/uai-sdk | uai/operation/modify_node_range/modify_node_range.py | 1 | 3803 | # Copyright 2017 The UAI-SDK 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 applicable... | apache-2.0 |
varunagrawal/azure-services | varunagrawal/site-packages/django/db/backends/util.py | 88 | 4767 | import datetime
import decimal
import hashlib
from time import time
from django.conf import settings
from django.utils.log import getLogger
from django.utils.timezone import utc
logger = getLogger('django.db.backends')
class CursorWrapper(object):
def __init__(self, cursor, db):
self.cursor = cursor
... | gpl-2.0 |
arthru/OpenUpgrade | addons/project_issue_sheet/__init__.py | 442 | 1105 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ninuxorg/nodeshot | nodeshot/networking/links/serializers.py | 5 | 2196 | from rest_framework import serializers
from rest_framework_gis import serializers as gis_serializers
from nodeshot.core.base.serializers import DynamicRelationshipsMixin
from .models import Link
__all__ = [
'LinkListSerializer',
'LinkDetailSerializer',
'LinkListGeoJSONSerializer',
'LinkDetailGeoJSON... | gpl-3.0 |
haripradhan/MissionPlanner | Lib/site-packages/scipy/ndimage/__init__.py | 55 | 1880 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 list of conditions and the following d... | gpl-3.0 |
Sorsly/subtle | google-cloud-sdk/lib/surface/genomics/datasets/set_iam_policy.py | 6 | 2074 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | mit |
vmax-feihu/hue | apps/useradmin/src/useradmin/ldap_access.py | 1 | 14369 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
shsingh/ansible | lib/ansible/modules/storage/netapp/na_ontap_disks.py | 23 | 7220 | #!/usr/bin/python
# (c) 2018-2019, 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 |
frenchfrywpepper/ansible-modules-extras | files/patch.py | 26 | 6549 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Luis Alberto Perez Lazaro <luisperlazaro@gmail.com>
# (c) 2015, Jakub Jirutka <jakub@jirutka.cz>
#
# 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... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pbr/tests/base.py | 20 | 5944 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 Lic... | agpl-3.0 |
repotvsupertuga/tvsupertuga.repository | plugin.video.sport365.live/resources/lib/pyaes_new/blockfeeder.py | 59 | 8119 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... | gpl-2.0 |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiatepolicy.py | 3 | 9833 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
yosshy/nova | nova/db/sqlalchemy/migrate_repo/versions/279_fix_unique_constraint_for_compute_node.py | 81 | 1274 | # Copyright (c) Intel 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 ... | apache-2.0 |
akbargumbira/inasafe | safe/messaging/item/success_paragraph.py | 16 | 2322 | """
InaSAFE Disaster risk assessment tool developed by AusAid - **Paragraph.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 versi... | gpl-3.0 |
ktdreyer/firewalld | src/firewall/server/config.py | 2 | 41234 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2012 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# 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 Li... | gpl-2.0 |
kazzz24/deep-learning | transfer-learning/tensorflow_vgg/test_vgg19_trainable.py | 152 | 1435 | """
Simple tester for the vgg19_trainable
"""
import tensorflow as tf
from tensoflow_vgg import vgg19_trainable as vgg19
from tensoflow_vgg import utils
img1 = utils.load_image("./test_data/tiger.jpeg")
img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger
batch1 = img1.reshape((1... | mit |
devGregA/code | build/lib.linux-x86_64-2.7/scrapy/utils/defer.py | 33 | 3241 | """
Helper functions for dealing with Twisted deferreds
"""
from twisted.internet import defer, reactor, task
from twisted.python import failure
from scrapy.exceptions import IgnoreRequest
def defer_fail(_failure):
"""Same as twisted.internet.defer.fail, but delay calling errback until
next reactor loop
... | bsd-3-clause |
mm1ke/portage | pym/portage/util/_desktop_entry.py | 6 | 2619 | # Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import io
import re
import subprocess
import sys
import portage
from portage import _encodings, _unicode_encode, _unicode_decode
from portage.util import writemsg
from portage.util.configparser import (ConfigPar... | gpl-2.0 |
jbenden/ansible | lib/ansible/modules/network/cloudengine/ce_startup.py | 47 | 15451 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
unreal666/youtube-dl | youtube_dl/extractor/parliamentliveuk.py | 30 | 1636 | from __future__ import unicode_literals
from .common import InfoExtractor
class ParliamentLiveUKIE(InfoExtractor):
IE_NAME = 'parliamentlive.tv'
IE_DESC = 'UK parliament videos'
_VALID_URL = r'(?i)https?://(?:www\.)?parliamentlive\.tv/Event/Index/(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]... | unlicense |
venkatarajasekhar/kernel_raybst | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
carljm/django | tests/forms_tests/field_tests/test_splitdatetimefield.py | 12 | 3228 | from __future__ import unicode_literals
import datetime
from django.forms import SplitDateTimeField, ValidationError
from django.forms.widgets import SplitDateTimeWidget
from django.test import SimpleTestCase
from django.utils import six
class SplitDateTimeFieldTest(SimpleTestCase):
def test_splitdatetimefield... | bsd-3-clause |
alexmandujano/django | tests/i18n/commands/extraction.py | 44 | 22998 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import warnings
from django.core import management
from django.test import SimpleTestCase
from django.utils.encoding import force_text
from django.utils._os import upath
from django.utils import six
from djan... | bsd-3-clause |
holmeszyx/pyandroid_tools | aapt.py | 1 | 1392 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
try:
import sys
from os import popen3 as pipe
except ImportError, e:
print("require mode no found")
exit(-1)
class AAPT():
__aapt_path = None
__output = None
__error = None
def __init__(self, aapt_path = None):
self.__aapt_path = a... | apache-2.0 |
fuhongliang/odoo | addons/hw_escpos/escpos/escpos.py | 174 | 31717 | # -*- coding: utf-8 -*-
import time
import copy
import io
import base64
import math
import md5
import re
import traceback
import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
from PIL import Image
try:
import jcconv
except ImportError:
jcconv = None
try:
import qrcode
except ImportError... | agpl-3.0 |
windyuuy/opera | chromium/src/third_party/python_26/Lib/site-packages/win32comext/axdebug/debugger.py | 17 | 6941 | import sys, traceback, string
from win32com.axscript import axscript
from win32com.axdebug import codecontainer, axdebug, gateways, documents, contexts, adb, expressions
from win32com.axdebug.util import trace, _wrap, _wrap_remove
import pythoncom
import win32api, winerror
import os
currentDebugger = None
class Mod... | bsd-3-clause |
basuke/kanshin-export | bin/queue/keyword_parse.py | 1 | 2648 | #!/usr/bin/env python
from queue import *
from kanshin.com.keyword import KeywordPage
from kanshin.data import save_keyword, save_connection
from kanshin.com.export import is_imported
from kanshin.com.browser import KanshinBrowser
keyword_parse = queues.keyword_parse
image_download = queues.image_download
user_downl... | mit |
hassanabidpk/django | django/db/models/deletion.py | 144 | 14337 | from collections import Counter, OrderedDict
from itertools import chain
from operator import attrgetter
from django.db import IntegrityError, connections, transaction
from django.db.models import signals, sql
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protected_ob... | bsd-3-clause |
karaage0703/python-image-processing | extract_color.py | 1 | 1695 | # -*- coding: utf-8 -*-
import cv2
import sys
import numpy as np
# extract color function
def extract_color( src, h_th_low, h_th_up, s_th, v_th ):
hsv = cv2.cvtColor(src, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv)
if h_th_low > h_th_up:
ret, h_dst_1 = cv2.threshold(h, h_th_low, 255, cv2.THRESH_BIN... | mit |
M4rtinK/tsubame | core/bundle/requests/packages/urllib3/util/connection.py | 221 | 4237 | from __future__ import absolute_import
import socket
from .wait import wait_for_read
from .selectors import HAS_SELECT, SelectorError
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
:param conn:
:class:`httplib.HTTPConnecti... | gpl-3.0 |
ntymtsiv/tempest | tempest/api/image/v1/test_image_members.py | 2 | 2476 | # 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 by applicable law or agreed t... | apache-2.0 |
ddzialak/boto | tests/unit/dynamodb/test_batch.py | 136 | 4073 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 restriction, including
# without ... | mit |
incaser/odoo-odoo | addons/anonymization/__openerp__.py | 260 | 2129 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ptitjes/quodlibet | gdist/tests.py | 1 | 5708 | # Copyright 2014-2016 Christoph Reiter
#
# 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,
#... | gpl-2.0 |
ademmers/ansible | hacking/shippable/download.py | 32 | 12281 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# (c) 2016 Red Hat, 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 yo... | gpl-3.0 |
rspavel/spack | lib/spack/external/py/_path/local.py | 24 | 32638 | """
local path implementation.
"""
from __future__ import with_statement
from contextlib import contextmanager
import sys, os, re, atexit, io
import py
from py._path import common
from py._path.common import iswin32, fspath
from stat import S_ISLNK, S_ISDIR, S_ISREG
from os.path import abspath, normcase, normpath, is... | lgpl-2.1 |
mengxn/tensorflow | tensorflow/python/training/sync_replicas_optimizer.py | 23 | 20139 | # 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 |
MicroDreamIT/ShapeCss | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | mit |
yongshengwang/builthue | apps/beeswax/src/beeswax/api.py | 1 | 22722 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
fergalbyrne/nupic | src/nupic/research/monitor_mixin/plot.py | 19 | 5187 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-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 p... | agpl-3.0 |
Onager/dftimewolf | tests/lib/collectors/gcloud.py | 1 | 8609 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests the GoogleCloudCollector."""
import unittest
import mock
from libcloudforensics.providers.gcp.internal import project as gcp_project
from libcloudforensics.providers.gcp.internal import compute
from dftimewolf import config
from dftimewolf.lib import state
from ... | apache-2.0 |
alfa-addon/addon | plugin.video.alfa/lib/python_libtorrent/linux_armv7/1.1.0/__init__.py | 362 | 1240 | #-*- coding: utf-8 -*-
'''
python-libtorrent for Kodi (script.module.libtorrent)
Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman
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 t... | gpl-3.0 |
guillermo-carrasco/MultiQC | multiqc/__init__.py | 1 | 14296 | #!/usr/bin/env python
""" MultiQC modules base class, contains helper functions """
from __future__ import print_function
from collections import OrderedDict
import io
import json
import mimetypes
import os
import random
from multiqc import config
letters = 'abcdefghijklmnopqrstuvwxyz'
class BaseMultiqcModule(obje... | mit |
jorik041/scikit-learn | sklearn/tests/test_base.py | 216 | 7045 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... | bsd-3-clause |
wzhfy/spark | examples/src/main/python/mllib/svd_example.py | 128 | 1773 | #
# 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 |
shahbazn/neutron | neutron/tests/functional/agent/test_l3_agent.py | 8 | 67537 | # Copyright (c) 2014 Red Hat, 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 require... | apache-2.0 |
ESS-LLP/erpnext-healthcare | erpnext/patches/v6_27/fix_recurring_order_status.py | 54 | 1936 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for doc in (
{
"doctype": "Sales Order",
"stock_doctype": "Delivery Note",
"invoice_doctype": "Sales Invoic... | gpl-3.0 |
mashaoze/esp-idf | tools/tiny-test-fw/CIAssignUnitTest.py | 2 | 5360 | """
Command line tool to assign unit tests to CI test jobs.
"""
import re
import os
import sys
import argparse
import yaml
test_fw_path = os.getenv("TEST_FW_PATH")
if test_fw_path:
sys.path.insert(0, test_fw_path)
from Utility import CIAssignTest
class Group(CIAssignTest.Group):
SORT_KEYS = ["config", "SD... | apache-2.0 |
mdibaiee/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py | 499 | 1859 | # 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 of conditions and the f... | mpl-2.0 |
nathanial/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/formwizard/tests.py | 104 | 1813 | import re
from django import forms
from django.test import TestCase
class FormWizardWithNullBooleanField(TestCase):
urls = 'regressiontests.formwizard.urls'
input_re = re.compile('name="([^"]+)" value="([^"]+)"')
wizard_url = '/wiz/'
wizard_step_data = (
{
'0-name': 'Pony',
... | gpl-3.0 |
Aloomaio/googleads-python-lib | examples/ad_manager/v201811/audience_segment_service/update_audience_segments.py | 1 | 2570 | #!/usr/bin/env python
#
# Copyright 2015 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 requir... | apache-2.0 |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py | 77 | 4949 | # 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 |
greut/invenio-kwalitee | tests/test_hooks.py | 3 | 9073 | # -*- coding: utf-8 -*-
#
# This file is part of kwalitee
# Copyright (C) 2014 CERN.
#
# kwalitee 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 late... | gpl-2.0 |
Turlough/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/filesystem.py | 19 | 3473 | """SCons.Tool.filesystem
Tool-specific initialization for the filesystem tools.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons... | apache-2.0 |
anthonylife/TaobaoCompetition2014 | src/feature_based_for_repeated_buy/predict.py | 1 | 2887 | #!/usr/bin/env python
#encoding=utf8
#Copyright [2014] [Wei Zhang]
#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 ... | gpl-2.0 |
omar-AM/python-pgp | pgp/commands/gpg/encrypt.py | 2 | 2820 | from pgp.commands.gpg.exceptions import FatalException
from pgp.commands.gpg.message_ import MessageCommand
class Command(MessageCommand):
multifile = True
def __init__(self, io_helper, recipient_helper,
algorithm_helper,
message_filename, for_your_eyes_only,
... | gpl-3.0 |
andyzsf/edx | lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py | 114 | 16995 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Invoice.purchase_order_number'
db.delete_column('shoppingcart_invoice', 'purchase_order_nu... | agpl-3.0 |
bepitulaz/huntingdimana | env/Lib/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py | 310 | 12909 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElement... | gpl-3.0 |
remynguyen96/webpack-layout | Son/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
phiedulxp/quora-mining | notebook/api.py | 2 | 6352 | #_*_ coding=utf-8 _*_
import requests
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)\
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'authorization':'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',
}
zhihu_page_question_url = 'https://www.zhihu.com/question/{}'
zhih... | apache-2.0 |
mne-tools/mne-tools.github.io | 0.15/_downloads/decoding_rsa.py | 6 | 7255 | """
.. _rsa_noplot:
====================================
Representational Similarity Analysis
====================================
Representational Similarity Analysis is used to perform summary statistics
on supervised classifications where the number of classes is relatively high.
It consists in characterizing the... | bsd-3-clause |
Beyond-Imagination/BlubBlub | RaspberryPI/django-env/lib/python3.4/site-packages/django/contrib/gis/admin/options.py | 47 | 5390 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import OGRGeomType
spherical_mercator_srid = 3857
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... | gpl-3.0 |
prospwro/odoo | openerp/osv/osv.py | 337 | 1384 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
kanagasabapathi/python-for-android | python3-alpha/python3-src/Tools/demo/redemo.py | 45 | 5771 | """Basic regular expression demostration facility (Perl style syntax)."""
from tkinter import *
import re
class ReDemo:
def __init__(self, master):
self.master = master
self.promptdisplay = Label(self.master, anchor=W,
text="Enter a Perl-style regular expression:")
self.p... | apache-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.5/django/contrib/gis/gdal/srs.py | 219 | 11914 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHOR... | mit |
heli522/scikit-learn | sklearn/cluster/affinity_propagation_.py | 224 | 10733 | """ Algorithms for clustering : Meanshift, Affinity propagation and spectral
clustering.
"""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import a... | bsd-3-clause |
vnsofthe/odoo-dev | openerp/tools/win32.py | 457 | 1993 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
WeichenXu123/spark | examples/src/main/python/als.py | 121 | 3267 | #
# 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 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/lib2to3/tests/test_refactor.py | 91 | 11847 | """
Unit tests for refactor.py.
"""
from __future__ import with_statement
import sys
import os
import codecs
import operator
import io
import tempfile
import shutil
import unittest
import warnings
from lib2to3 import refactor, pygram, fixer_base
from lib2to3.pgen2 import token
from . import support
TEST_DATA_DIR ... | lgpl-3.0 |
hmcmooc/muddx-platform | common/test/acceptance/tests/video/test_video_times.py | 1 | 7329 | """
Acceptance tests for Video Times(Start, End and Finish) functionality.
"""
from .test_video_module import VideoBaseTest
class VideoTimesTest(VideoBaseTest):
""" Test Video Player Times """
def setUp(self):
super(VideoTimesTest, self).setUp()
def test_video_start_time(self):
"""
... | agpl-3.0 |
OrangutanGaming/OG_SelfBot | cogs/eval.py | 1 | 3925 | import discord
from discord.ext import commands
import inspect
import io
from contextlib import redirect_stdout
import textwrap, traceback
import argparse
import cogs.utils.formatting as formatting
from sympy import *
import sys
import mpmath
sys.modules["sympy.mpmath"] = mpmath
class Eval():
def __init__(self, b... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.