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
curlyjr25/FrogWebsite
frogs/apps/frogblog/migrations/0001_initial.py
1
1050
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-20 06:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depen...
bsd-3-clause
endlessm/chromium-browser
third_party/catapult/telemetry/telemetry/internal/image_processing/_bitmap.py
1
8160
# Copyright 2013 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. """ Bitmap is a basic wrapper for image pixels. It includes some basic processing tools: crop, find bounding box of a color and compute histogram of color va...
bsd-3-clause
temasek/android_external_chromium_org
third_party/ply/lex.py
482
40739
# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
bsd-3-clause
jtg-gg/skia
tools/skp/page_sets/skia_mlb_nexus10.py
9
1216
# 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. # pylint: disable=W0401,W0614 from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SkiaBuildbotDesk...
bsd-3-clause
RedHatInsights/insights-core
examples/rules/skip_component.py
1
5043
#!/usr/bin/env python """ Skip Component Example ====================== This module simulates a situation where you might need different parsers that use the same spec to parse a log file or a configuration file that may have different formats across RHEL versions. The idea is that, for efficiency, you only want the pa...
apache-2.0
teosz/servo
tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py
133
1053
def main(request, response): headers = [] request_headers = [] if "headers" in request.GET: checked_headers = request.GET.first("headers").split("|") for header in checked_headers: if header in request.headers: headers.append(("x-request-" + header, request.headers.ge...
mpl-2.0
rubenmak/PokemonGo-SlackBot
pokemon_pb2.py
32
78759
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pokemon.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _refle...
mit
yuvadm/django-storages
examples/cloudfiles_project/settings.py
33
2842
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS CLOUDFILES_USERNAME = 'yourusername' CLOUDFILES_API_KEY = 'yourapikey' CLOUDFILES_CONTAINER = 'test-container' CLOUDFILES_TTL = 600 DEFAULT_FILE_STORAGE = 'backends.mosso.CloudFilesStorage' DATABASE_ENGI...
bsd-3-clause
yongwen/makahiki
makahiki/apps/widgets/badges/views.py
2
2008
"""Views handler for Badge widget rendering.""" from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.template.context import RequestContext from apps.widgets.badges.models import Badge, BadgeAward from apps.managers.player_mgr.models import Profile def...
mit
courtarro/gnuradio
gr-fec/python/fec/polar/channel_construction_awgn.py
24
8560
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # 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. # # GNU Radio is...
gpl-3.0
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## 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
PsychoTV/PsychoTeam.repository
plugin.video.specto/resources/lib/resolvers/grifthost.py
23
1930
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 3 of the License, or (at your option) any l...
gpl-2.0
SonamYeshe/AStarPathPlanning
vendor/googletest/googletest/scripts/fuse_gtest_files.py
346
8884
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-3.0
Xtrend-Official/Xtrend-E2
keymapparser.py
49
2079
import enigma import xml.etree.cElementTree from keyids import KEYIDS # these are only informational (for help)... from Tools.KeyBindings import addKeyBinding class KeymapError(Exception): def __init__(self, message): self.msg = message def __str__(self): return self.msg def parseKeys(conte...
gpl-2.0
houglum/apitools
apitools/base/py/exceptions_test.py
5
2961
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
loads/molotov
molotov/tests/statsd.py
1
1670
import asyncio # taken from aiostatsd.tests.test_client class ServerProto: def __init__(self, received_queue): self.received_queue = received_queue self.transport = None def connection_made(self, transport): self.transport = transport def datagram_received(self, data, addr): ...
apache-2.0
jay3sh/vispy
examples/demo/gloo/high_frequency.py
18
3406
#! /usr/bin/env python # -*- coding: utf-8 -*- # vispy: gallery 20 # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier, Guillaume Bâty. All Rights Reserved. # Distributed under the (new) BSD License. # -------------------------------------------------...
bsd-3-clause
devendermishrajio/nova_test_latest
nova/compute/resources/base.py
95
2723
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
ztmtoosm/ztmtoosm-django
ProjektSuper/settings.py
1
3519
""" Django settings for ProjektSuper project. Generated by 'django-admin startproject' using Django 1.9.3. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import ...
mit
frankrousseau/weboob
modules/groupamaes/browser.py
1
2378
# -*- coding: utf-8 -*- # Copyright(C) 2014 Bezleputh # # This file is part of weboob. # # weboob 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 opt...
agpl-3.0
blackye/luscan-devel
thirdparty_libs/django/db/backends/mysql/creation.py
210
3064
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict_...
gpl-2.0
tkf/railgun
railgun/cfuncs.py
1
3408
import itertools import re from railgun._helper import iteralt CJOINSTR = '_' RE_CFDEC_FUNC = re.compile( r"(?:(?P<ret>[\w]+) )?(?P<fname>[^\( ][^\(]*)\((?P<args>[^\)]*)\)" ) # matches "ret func(a, b, c)" as "RET FNAME(ARGS)" RE_CFDEC_CHOSET = re.compile( r"{ *(?P<key>[a-zA-Z]\w*) *\| *(?P<choices>[\w, ...
mit
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/encodings/mac_roman.py
272
13480
""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
gpl-3.0
jthatch12/STi2_M7
arm-eabi-4.8/share/gdb/python/gdb/command/prompt.py
107
2135
# Extended prompt. # Copyright (C) 2011-2012 Free Software Foundation, Inc. # 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 3 of the License, or # (at your option) any later vers...
gpl-2.0
diogenesjf/userinfuser
client_tools/python/userinfuser/ui_constants.py
12
1290
# Copyright (C) 2011, CloudCaptive # 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 3 of the License, or # (at your option) any later version. # # This program is distributed in t...
gpl-3.0
toshywoshy/ansible
lib/ansible/plugins/action/edgeos_config.py
10
1406
# # Copyright 2018 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 your option) any later version. # # Ansibl...
gpl-3.0
cindyyu/kuma
vendor/packages/pygments/styles/trac.py
135
1933
# -*- coding: utf-8 -*- """ pygments.styles.trac ~~~~~~~~~~~~~~~~~~~~ Port of the default trac highlighter design. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Na...
mpl-2.0
ebar0n/django
tests/select_related_onetoone/models.py
106
2382
from django.db import models class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __str__(self): return self.username class UserProfile(models.Model): user = models.OneToOneField(User, models.CASCADE) city = models.CharField(max_length=10...
bsd-3-clause
peoplepower/botlab
com.ppc.Microservices/intelligence/analytics_mixpanel/location_mixpanel_microservice.py
2
5766
''' Created on May 14, 2020 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss ''' from intelligence.intelligence import Intelligence import mixpanel import domain # Mixpanel HTTP Timeout in seconds MIXPANEL_HTTP_TIMEOUT...
apache-2.0
bibekluitel/ntu-dsi-dcn
bindings/python/ns3modulegen_core_customizations.py
21
18022
from __future__ import print_function import sys import re from pybindgen.typehandlers import base as typehandlers from pybindgen import ReturnValue, Parameter from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper from pybindgen.typehandlers.codesink import MemoryCodeSink from pybindgen.t...
gpl-2.0
DiptoDas8/Biponi
lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py
679
3293
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
mit
systemadev/jira-python
examples/basic_use.py
2
1605
# This script shows how to use the client in anonymous mode # against jira.atlassian.com. from jira.client import JIRA # By default, the client will connect to a JIRA instance started from the Atlassian Plugin SDK # (see https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK for details). # ...
bsd-2-clause
Fity/magic_box
sichuan_menu/app.py
1
4896
# -*- coding:utf-8 -*- import codecs from collections import defaultdict from decimal import Decimal import random meat_set = set() vegetable_set = set() hot_set = set() cold_set = set() drinks_set = set() class Dish(object): def __init__(self): self.name = None self.is_drinks = False s...
mit
ionrock/designate
designate/cmd/zone_manager.py
6
1404
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Author: Endre Karlson <endre.karlson@hp.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/lice...
apache-2.0
2014c2g4/w16b_test
static/Brython3.1.1-20150328-091302/Lib/http/cookies.py
735
20810
#!/usr/bin/env python3 # #### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in...
gpl-3.0
MattDevo/edk2
AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_types.py
13
30479
# Python test set -- part 6, built-in types from test.test_support import run_unittest, have_unicode, run_with_locale, \ check_py3k_warnings import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fa...
bsd-2-clause
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/idlelib/OutputWindow.py
67
4396
from Tkinter import * from EditorWindow import EditorWindow import re import tkMessageBox import IOBinding class OutputWindow(EditorWindow): """An editor window that can serve as an output file. Also the future base class for the Python shell window. This class has no input facilities. """ def _...
mit
kubevirt/client-python
kubevirt/models/v1_gpu.py
1
3775
# coding: utf-8 """ KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1GPU(ob...
apache-2.0
isabela-angelo/scratch-tangible-blocks
node_modules/scratch-blocks/gh-pages/closure-library/closure/bin/labs/code/generate_jsdoc.py
222
4318
#!/usr/bin/env python # # Copyright 2013 The Closure Library Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
bsd-3-clause
King-of-Alravia/AlraviaOrb
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
feluxe/very_hungry_pi
vhpi/exceptions.py
1
1106
# Copyright (C) 2016-2017 Felix Meyer-Wolters # # This file is part of 'Very Hungry Pi' (vhpi) - An application to create # backups. # # 'Very Hungry Pi' is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License v3 as published by # the Free Software Foundatio...
agpl-3.0
hastexo/edx-platform
cms/djangoapps/xblock_config/models.py
2
2919
""" Models used by Studio XBlock infrastructure. Includes: StudioConfig: A ConfigurationModel for managing Studio. """ from config_models.models import ConfigurationModel from django.db.models import TextField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField from request_cache.middleware ...
agpl-3.0
Eric-Zhong/odoo
openerp/tools/func.py
276
3622
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010, 2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you c...
agpl-3.0
JShadowMan/package
python/gui/tcl_tkinter/draw/line.py
2
1348
#!/usr/bin/env python3 import tkinter as tk import tkinter.ttk as ttk class CanvasDraw(ttk.Frame): def __init__(self, parent): super(CanvasDraw, self).__init__(parent) self.__init_window_ui() def __init_window_ui(self): self.master.title('Canvas Draw Line') self....
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_genericpath.py
15
10492
""" Tests common to genericpath, macpath, ntpath and posixpath """ import unittest from test import test_support import os import genericpath import sys def safe_rmdir(dirname): try: os.rmdir(dirname) except OSError: pass class GenericTest(unittest.TestCase): # The path module to be tes...
gpl-2.0
tigercomputing/nagios-mass-scheduler
utils.py
1
2904
""" This file is part of mass-scheduler. mass-scheduler 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. mass-scheduler is distributed in th...
gpl-3.0
cmvelo/ansible-modules-extras
monitoring/librato_annotation.py
138
5556
#!/usr/bin/python # -*- coding: utf-8 -*- # # (C) Seth Edwards, 2014 # # 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 ...
gpl-3.0
AASHE/hub
hub/apps/content/migrations/0067_auto_20160707_1932.py
1
1358
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('content', '0066_auto_20160701_2047'), ] operations = [ migrations.AddField( model_name='contenttype', ...
mit
watchdogpolska/poradnia
poradnia/keys/models.py
3
1242
from django.db import models from django.db.models.query import QuerySet from django.utils.translation import ugettext_lazy as _ from poradnia.users.models import User from .utils import make_random_password from django.urls import reverse class KeyQuerySet(QuerySet): def for_user(self, user): return s...
mit
murgatroid99/grpc
src/python/grpcio_tests/tests/unit/_cython/test_utilities.py
1
1602
# Copyright 2015 gRPC authors. # # 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
grdlok/UStar-dl
src/youtube_dl/extractor/grooveshark.py
24
7179
# coding: utf-8 from __future__ import unicode_literals import time import math import os.path import re from .common import InfoExtractor from ..compat import ( compat_html_parser, compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ExtractorError class GroovesharkHt...
unlicense
kostaspl/SpiderMonkey38
python/pyasn1/pyasn1/codec/cer/decoder.py
261
1230
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
mpl-2.0
SeveQ/OctoPrint
src/octoprint/slicing/__init__.py
17
23087
# coding=utf-8 """ In this module the slicing support of OctoPrint is encapsulated. .. autoclass:: SlicingProfile :members: .. autoclass:: TemporaryProfile :members: .. autoclass:: SlicingManager :members: """ from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ =...
agpl-3.0
CXQERP/ODOOERP
addons/purchase/stock.py
19
17422
# -*- 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
unaizalakain/django
tests/admin_scripts/tests.py
87
92488
# -*- coding: utf-8 -*- """ A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ from __future__ import unicode_literals import codecs import os import re import shutil import ...
bsd-3-clause
ezequielpereira/Time-Line
libs/wx/lib/ogl/_bmpshape.py
6
1962
# -*- coding: iso-8859-1 -*- #---------------------------------------------------------------------------- # Name: bmpshape.py # Purpose: Bitmap shape # # Author: Pierre Hjälm (from C++ original by Julian Smart) # # Created: 2004-05-08 # RCS-ID: $Id: _bmpshape.py 27884 2004-06-18 16:32:03Z...
gpl-3.0
prune998/ansible
lib/ansible/utils/module_docs_fragments/backup.py
427
1071
# Copyright (c) 2015 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 option) any later version. # # Ansi...
gpl-3.0
ofir123/CouchPotatoServer
libs/suds/sax/parser.py
180
4461
# 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 ...
gpl-3.0
scorphus/thefuck
tests/rules/test_heroku_multiple_apps.py
4
1723
# -*- coding: utf-8 -*- import pytest from thefuck.types import Command from thefuck.rules.heroku_multiple_apps import match, get_new_command suggest_output = ''' ▸ Multiple apps in git remotes ▸ Usage: --remote heroku-dev ▸ or: --app myapp-dev ▸ Your local git repository has more than 1 app referenc...
mit
golismero/golismero
thirdparty_libs/nltk/corpus/reader/timit.py
12
16652
# Natural Language Toolkit: TIMIT Corpus Reader # # Copyright (C) 2001-2007 NLTK Project # Author: Haejoong Lee <haejoong@ldc.upenn.edu> # Steven Bird <sb@ldc.upenn.edu> # Jacob Perkins <japerk@gmail.com> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT # [xx] this docstring is ...
gpl-2.0
cyphactor/lifecyclemanager
src/requirement/upgrades/db10.py
1
11222
# # Copyright 2007-2008 Lifecycle Manager Development Team # http://www.insearchofartifice.com/lifecyclemanager/wiki/DevTeam # # This file is part of Lifecycle Manager. # # Lifecycle Manager is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by ...
gpl-3.0
jaygoswami2303/course_dashboard_api
v2/CourseAPI/api.py
1
32081
from django.http import HttpResponse import MySQLdb import pymongo from course_dashboard_api.v2.dbv import * sql_user = MYSQL_USER sql_pswd = MYSQL_PSWD mysql_db = MYSQL_DB mongo_db = MONGO_DB """ Description: Function to get list of all the courses Input Parameters: None Output Type: List of cour...
mit
alduxvm/rpi-opencv
color-4-thread.py
1
2740
#!/usr/bin/env python """color-4.py: Color detection using openCV.""" """ Performance @ 640x480 resolution: RMBP -> 0.005s each detection or 20hz RPI 2 -> 0.15s each detection or 6.6hz RPI 3 -> 0.124s each detection or 8.06hz """ __author__ = "Aldo Vargas" __copyright__ = "Copyright 2015 Altax.net" __licens...
gpl-3.0
RiccardoPecora/MP
Lib/lib2to3/fixes/fix_intern.py
59
1451
# Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from .. import pytree from .. import fixer_base from ..fixer_util import Name, Attr, touch_import class FixIntern(fixer_base.BaseFix): BM_compatible...
gpl-3.0
cfairbanks/calibre-comicvine
pycomicvine/__init__.py
1
40891
# Copyright (c) 2013 Martin Lenders # # 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
SUSE/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/compute/v2015_06_15/models/ssh_public_key.py
9
1296
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
fuzeman/trakt.py
examples/lists.py
1
1259
from __future__ import absolute_import, division, print_function from examples.helpers import authenticate import logging import os if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) from trakt import Trakt # Configure Trakt.configuration.defaults.client( id=os.environ.get...
mit
kumar303/olympia
src/olympia/activity/serializers.py
3
2038
from django.utils.translation import ugettext from rest_framework import serializers from olympia.activity.models import ActivityLog from olympia.api.utils import is_gate_active class ActivityLogSerializer(serializers.ModelSerializer): action = serializers.SerializerMethodField() action_label = serializers....
bsd-3-clause
py4n6/pyflag
src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/object.py
7
6681
# Volatility # Copyright (C) 2007,2008 Volatile Systems # # Original Source: # Volatools Basic # Copyright (C) 2007 Komoku, Inc. # # 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 ...
gpl-2.0
lucperkins/heron
integration_test/src/python/integration_test/topology/one_spout_multi_tasks/one_spout_multi_tasks.py
1
1363
#!/usr/bin/env python # -*- encoding: utf-8 -*- # copyright 2016 twitter. 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...
apache-2.0
EmuxEvans/Wox
PythonHome/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
unreal666/outwiker
src/test/plugins/snippets/test_utils.py
2
8704
# -*- coding: utf-8 -*- from tempfile import mkdtemp import os import unittest from outwiker.core.pluginsloader import PluginsLoader from test.basetestcases import BaseOutWikerGUIMixin from test.utils import removeDir class SnippetsUtilsTest(unittest.TestCase, BaseOutWikerGUIMixin): def setUp(self): sel...
gpl-3.0
Microvellum/Fluid-Designer
win64-vc/2.78/scripts/modules/bl_i18n_utils/utils_spell_check.py
2
15752
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 is distrib...
gpl-3.0
Hao-Liu/avocado-vt
scripts/github/label_issues.py
8
1884
#!/usr/bin/env python import getpass from github import Github from github_issues import GithubIssues, MutableIssue def set_labels(mutable_issue): print "Enter replacement github labels, blank to end:" labels = [] while True: label = raw_input("labels[%d]: " % (len(labels) + 1)) label = ...
gpl-2.0
alessioricco/html_it-androidvideo
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
eayunstack/oslo.messaging
oslo/messaging/_drivers/protocols/amqp/controller.py
2
25983
# Copyright 2014, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Zhongqilong/kbengine
kbe/src/lib/python/Lib/test/list_tests.py
106
17676
""" Tests common to list and UserList.UserList """ import sys import os from functools import cmp_to_key from test import support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # ...
lgpl-3.0
pfalcon/ScratchABlock
tests_unit/test_graph.py
1
1498
from graph import * def test_nodes_on_path_trivial(): g = Graph() g.add_node("a") g.add_node("b") g.add_edge("a", "b") g.number_postorder() res = find_all_nodes_on_path(g, "a", "b") assert res == set(["a"]), res def test_nodes_on_path_trivial_loop(): g = Graph() g.add_node("a") ...
gpl-3.0
ondra-novak/blink
LayoutTests/http/tests/websocket/deflate-frame_wsh.py
5
3513
# Copyright 2012, 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 fo...
bsd-3-clause
lucastheis/cmt
code/cmt/python/tools/colors.py
1
1823
""" Tools for converting color images. """ __license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>' __author__ = 'Lucas Theis <lucas@theis.io>' __docformat__ = 'epytext' __version__ = '0.2.0' from numpy import array, dot from numpy.linalg import inv, det Kr = .299 Kg = .587 Kb = 1. - Kr - Kg ...
mit
vitan/django
tests/mail/tests.py
16
51149
# -*- coding: utf-8 -*- from __future__ import unicode_literals import asyncore import os import shutil import smtpd import sys import tempfile import threading from email.mime.text import MIMEText from smtplib import SMTP, SMTPException from ssl import SSLError from django.core import mail from django.core.mail impo...
bsd-3-clause
berndporr/reversal-learning-5ht
prism_model/run_models.py
2
4801
#!/usr/bin/python3 import os import subprocess import csv import re import math from pathlib import Path currentdir = os.getcwd() logfilename = "log_results.txt" pval_filename = "pval_results.txt" DRN_OFFSET = 0.5 _5HTR2_OFFSET = 0.5 standard_food_delay = 15 shorter_food_delay = 10 uncertainty = 0.1 # visual inpu...
gpl-3.0
Novasoft-India/OperERP-AM-Motors
openerp/addons/event/report/__init__.py
435
1079
# -*- 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
kohnle-lernmodule/exe201based
exe/engine/winconfig.py
7
5266
# =========================================================================== # eXe config # Copyright 2004-2006, University of Auckland # Copyright 2007 eXe Project, New Zealand Tertiary Education Commission # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-2.0
iLampard/alphaware
alphaware/const.py
1
3072
# -*- coding: utf-8 -*- from collections import namedtuple from empyrical import (annual_return, max_drawdown, calmar_ratio, sharpe_ratio, excess_sharpe, beta, alpha) INDEX_FACTOR...
apache-2.0
mweisman/QGIS
python/plugins/processing/parameters/ParameterBoolean.py
6
1945
# -*- coding: utf-8 -*- """ *************************************************************************** ParameterBoolean.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
dmach/dnf
tests/cli/commands/test_remove.py
4
2404
# -*- coding: utf-8 -*- # Copyright (C) 2014-2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed ...
gpl-2.0
Kazade/NeHe-Website
google_appengine/lib/webob-1.2.3/webob/etag.py
80
4531
""" Does parsing of ETag-related headers: If-None-Matches, If-Matches Also If-Range parsing """ from webob.datetime_utils import ( parse_date, serialize_date, ) from webob.descriptors import _rx_etag from webob.util import ( header_docstring, warn_deprecation, ) __all__ = ['AnyETag', 'NoETag...
bsd-3-clause
zace-yuan/viewfinder
backend/storage/test.py
13
1151
#!/usr/bin/env python # # Copyright 2011 Viewfinder Inc. All Rights Reserved. import boto import sys from boto.exception import S3ResponseError from tornado import ioloop, options, web from viewfinder.backend.base import asyncboto, secrets options.define("port", default=8888, help="Port to serve HTTP requests") clas...
apache-2.0
alexgorban/models
research/street/python/fsns_urls.py
14
1873
# 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
wileeam/airflow
airflow/contrib/sensors/ftp_sensor.py
5
1131
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
miguelparaiso/PracticaOdoo
addons/crm/sales_team.py
321
5053
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.Model): _inherit = 'crm.case.section' _inherits = {'mail.alias': 'alias_id'} def _get_opportunities_d...
agpl-3.0
signal18/replication-manager
share/opensvc/compliance/com.replication-manager/authkey.py
2
17322
#!/usr/bin/env python data = { "default_prefix": "OSVC_COMP_AUTHKEY_", "example_value": """ { "action": "add", "authfile": "authorized_keys", "user": "testuser", "key": "ssh-dss AAAAB3NzaC1kc3MAAACBAPiO1jlT+5yrdPLfQ7sYF52NkfCEzT0AUUNIl+14Sbkubqe+TcU7U3taUtiDJ5YOGOzIVFIDGGtwD0AqNHQbvsiS...
gpl-3.0
sslavic/kafka
tests/kafkatest/services/streams.py
1
28631
# 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 use ...
apache-2.0
djkonro/client-python
kubernetes/client/models/v1beta1_network_policy_peer.py
2
4857
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
lllcho/CAPTCHA-breaking
keras-master/tests/auto/test_sequential_model.py
33
12248
from __future__ import absolute_import from __future__ import print_function import unittest import numpy as np np.random.seed(1337) from keras.models import Sequential from keras.layers.core import Dense, Activation, Merge from keras.utils import np_utils from keras.utils.test_utils import get_test_data input_dim = ...
mit
otron/zenodo
zenodo/legacy/tasklets/bst_openaire_check_rights.py
2
2797
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2012, 2013 CERN. # # Zenodo 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 l...
gpl-3.0
barbuza/django
tests/select_related/tests.py
28
9588
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import SimpleTestCase, TestCase from .models import ( Bookmark, Domain, Family, Genus, HybridSpecies, Kingdom, Klass, Order, Phylum, Pizza, Species, TaggedItem, ) class SelectRelatedTests(TestCase): @...
bsd-3-clause
mosbasik/buzhug
javasrc/lib/Jython/Lib/colorsys.py
92
3449
"""Conversion functions between RGB and other color systems. This modules provides two functions for each color system ABC: rgb_to_abc(r, g, b) --> a, b, c abc_to_rgb(a, b, c) --> r, g, b All inputs and outputs are triples of floats in the range [0.0...1.0] (with the exception of I and Q, which covers a slightly...
bsd-3-clause
BambooL/jeeves
test/testJeevesWrite.py
3
12881
''' This tests write policies. ''' import unittest from sourcetrans.macro_module import macros, jeeves from fast.ProtectedRef import ProtectedRef, UpdateResult import JeevesLib class DummyUser: def __init__(self, userId): self.userId = userId def __eq__(self, other): return self.userId == other.userId class Tes...
mit