repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
cuboxi/android_external_chromium_org
native_client_sdk/src/build_tools/build_updater.py
44
6348
#!/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. """Build script to generate a new sdk_tools bundle. This script packages the files necessary to generate the SDK updater -- the to...
bsd-3-clause
richlanc/KaraKara
website/karakara/auth/__init__.py
1
1672
from externals.lib.social._login import IUserStore from sqlalchemy.orm.exc import NoResultFound from ..model import DBSession, commit from ..model.model_comunity import ComunityUser, SocialToken from ..templates import helpers as h class ComunityUserStore(IUserStore): def get_user_from_token(self, provider_to...
gpl-3.0
SpectraLogic/samba
third_party/dnspython/dns/namedict.py
99
2106
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
octocoin-project/octocoin
qa/rpc-tests/invalidateblock.py
2
3176
#!/usr/bin/env python2 # Copyright (c) 2014 The Octocoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test InvalidateBlock code # from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy im...
mit
javierTerry/odoo
openerp/cli/start.py
240
2748
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import glob import os import sys from . import Command from .server import main from openerp.modules.module import get_module_root, MANIFEST from openerp.service.db import _create_empty_database, DatabaseExists class Start(Command): """Quick start the...
agpl-3.0
bootswithdefer/ansible
plugins/inventory/spacewalk.py
137
4999
#!/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use thi...
gpl-3.0
glomex/gcdt
tests/resources/simple_cloudformation_stack_with_ec2/cloudformation.py
1
3689
#!/usr/bin/env python # Converted from RDS template located at: # https://github.com/cloudtools/troposphere/blob/master/examples/RDS_with_DBParameterGroup.py import os import troposphere from troposphere import Base64, Join, Parameter, Output, Ref, Template, Tags from troposphere.rds import DBInstance, DBParameterGrou...
mit
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/tensorflow/python/debug/cli/tensor_format.py
13
15691
# 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...
gpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/comtypes/test/test_msscript.py
1
2790
import unittest from ctypes import POINTER from comtypes.automation import IDispatch from comtypes.client import CreateObject from comtypes import GUID ##from test import test_support ##from comtypes.unittests import support try: GUID.from_progid("MSScriptControl.ScriptControl") except WindowsError: # doesn't...
agpl-3.0
jaruba/chromium.src
third_party/pycoverage/coverage/phystokens.py
160
7401
"""Better tokenizing for coverage.py.""" import codecs, keyword, re, sys, token, tokenize from coverage.backward import set # pylint: disable=W0622 from coverage.parser import generate_tokens def phys_tokens(toks): """Return all physical tokens, even line continuations. tokenize.genera...
bsd-3-clause
Xeralux/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/geometric_test.py
68
9868
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
xiaotdl/ansible
contrib/inventory/zone.py
138
1466
#!/usr/bin/env python # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # # 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 # ...
gpl-3.0
krisys/django
django/contrib/auth/migrations/0004_alter_user_username_opts.py
200
1040
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0003_alter_user_email_max_length'), ] # No database changes; modifies validators and error_mes...
bsd-3-clause
timothsp/where2ate
venv/lib/python3.3/site-packages/werkzeug/contrib/fixers.py
148
10197
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
cc0-1.0
anjakisek/Mlin
racunalnik_igralec.py
1
1948
import threading from igra import * from minimax import * import time class Racunalnik(): def __init__(self, gui, algoritem): self.gui = gui self.algoritem = algoritem #izbran algoritem, minimax ali alphabeta self.mislec = None #vlakno za razmisljanje self.je_treba_prekiniti = False...
gpl-3.0
yeyanchao/calibre
src/routes/route.py
41
29396
import re import sys import urllib if sys.version < '2.4': from sets import ImmutableSet as frozenset from routes.util import _url_quote as url_quote, _str_encode class Route(object): """The Route object holds a route recognition and generation routine. See Route.__init__ docs for usage. ...
gpl-3.0
LittleLama/Sick-Beard-BoxCar2
sickbeard/clients/requests/packages/charade/__init__.py
122
1327
######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any late...
gpl-3.0
zauonlok/server
server/server/server.py
1
5551
import logging import socket import sys from ..common import Message, monitor from .connection import Connection, ConnectionBroken, ConnectionClosed from .multiplexer import EpollMultiplexer, SelectMultiplexer class Server: def __init__(self, host='', port=0, backlog=socket.SOMAXCONN): if sys.platform.s...
mit
jonathanverner/brython
www/gallery/sudoku.py
16
1493
# Boris Borcic 2006 # Quick and concise Python 2.5 sudoku solver # # Adapted for Brython by Pierre Quentel # load pre-computed tables import json data = json.loads(open('sudoku.json').read()) w2q = data['w2q'] q2w = data['q2w'] w2q2w = data['w2q2w'] class Completed(Exception) : pass def sudoku99(problem) : given...
bsd-3-clause
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/typ/typ/tests/main_test.py
33
26960
# Copyright 2014 Dirk Pranke. 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 a...
bsd-3-clause
JackonYang/shadowsocks
shadowsocks/daemon.py
694
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
uzh/vm-mad
vmmad/test/test_util.py
1
1527
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Run tests for the `vmmad.util` module. """ # Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved. # # Authors: # Riccardo Murri <riccardo.murri@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not ...
apache-2.0
pmarques/ansible
test/lib/ansible_test/_internal/commands/sanity/pslint.py
13
3265
"""Sanity test using PSScriptAnalyzer.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import re from ... import types as t from . import ( SanityVersionNeutral, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, SANITY...
gpl-3.0
looooo/paraBEM
examples/plots/lifting_line.py
1
1404
from __future__ import division import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import paraBEM from paraBEM.liftingline import LiftingLine from paraBEM.utils import check_path # WingGeometry spw = 2 numpos = 50 z_fac_1 = -0.3 z_fac_2 = -0.7 y = np.sin(np.linspace(0, np.pi/2...
gpl-3.0
glebb/mopidy-appletv
mopidy_appletv/frontend.py
1
6287
# -*- coding: utf-8 -*- import pykka import socket import select import sys import pybonjour import time from mopidy import core, utils from threading import Thread import netifaces import logging import traceback logger = logging.getLogger(__name__) class AppleTvFrontend(pykka.ThreadingActor, core.CoreListene...
apache-2.0
nclsHart/glances
glances/core/glances_client.py
1
8024
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
lgpl-3.0
szlin/gitsome
gitsome/compat.py
1
1032
# -*- coding: utf-8 -*- # Copyright 2015 Donne Martin. 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. A copy of # the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "lice...
gpl-3.0
jandecaluwe/myhdl
myhdl/test/conversion/general/test_hec.py
4
3708
import os path = os.path from random import randrange import myhdl from myhdl import * COSET = 0x55 def calculateHecRef(header): """ Return hec for an ATM header. Reference version. The hec polynomial is 1 + x + x**2 + x**8. """ hec = intbv(0) for bit in header[32:]: hec[8:] = concat...
lgpl-2.1
sanjaymeena/ProgrammingProblems
python/CZITest/CZI_Test_Problem1.py
1
2325
# coding: utf-8 # `` # Task 1: Identifying common words between documents # For this task, you need to generate a matrix, where each entry contains the number of unique # common tokens (words) between each pair of documents. The output should include no headers for # rows or columns. The matrix should be symmetric, a...
apache-2.0
google/trax
trax/tf_numpy/public_symbol_test.py
1
1130
# coding=utf-8 # Copyright 2021 The Trax 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 a...
apache-2.0
jelmer/pydoctor
pydoctor/test/test_zopeinterface.py
3
7725
from pydoctor.zopeinterface import ZopeInterfaceSystem from pydoctor.test.test_astbuilder import fromText from pydoctor.test.test_packages import processPackage # we set up the same situation using both implements and # classImplements and run the same tests. def test_implements(): src = ''' import zope.inter...
isc
christer155/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso8859_6.py
93
11396
""" Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.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,i...
apache-2.0
jemekite/youtube-dl
youtube_dl/extractor/cbsnews.py
96
3204
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor class CBSNewsIE(InfoExtractor): IE_DESC = 'CBS News' _VALID_URL = r'http://(?:www\.)?cbsnews\.com/(?:[^/]+/)+(?P<id>[\da-z_-]+)' _TESTS = [ { 'url': 'http://www.cbsnews....
unlicense
jnewbery/bitcoin
contrib/devtools/circular-dependencies.py
29
3219
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import sys import re from typing import Dict, List, Set MAPPING = { 'core_read.cpp': 'core_io.cpp', ...
mit
ondrokrc/gramps
gramps/gui/views/treemodels/familymodel.py
1
6542
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 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 v...
gpl-2.0
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py
3
2318
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
gpl-2.0
luisgg/iteexe
exe/engine/configparser.py
4
15800
"""A more user friendly configParser Copyright 2005-2006 Matthew Sherborne. Copyright 2005-2007 eXe Project, New Zealand Tertiary Education Commisssion Released under the GPL2 license found at http://www.fsf.org/licensing/licenses/gpl.txt """ import re, os import codecs exSection = re.compile('\[(?P<sectionname>(\...
gpl-2.0
eerorika/ansible
lib/ansible/template/vars.py
2
3756
# (c) 2012, 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) any lat...
gpl-3.0
rizumu/django
tests/forms_tests/widget_tests/test_splitdatetimewidget.py
202
1943
from datetime import date, datetime, time from django.forms import SplitDateTimeWidget from .base import WidgetTest class SplitDateTimeWidgetTest(WidgetTest): widget = SplitDateTimeWidget() def test_render_empty(self): self.check_html(self.widget, 'date', '', html=( '<input type="text" ...
bsd-3-clause
akretion/openerp-server
openerp/workflow/workitem.py
61
9046
# -*- 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
GheRivero/ansible
lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py
43
105166
#!/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
ltsimps/Midterm
vendor/googletest/googlemock/test/gmock_test_utils.py
769
3684
#!/usr/bin/env python # # Copyright 2006, 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...
mit
tdhopper/scikit-learn
examples/svm/plot_svm_scale_c.py
223
5375
""" ============================================== Scaling the regularization parameter for SVCs ============================================== The following example illustrates the effect of scaling the regularization parameter when using :ref:`svm` for :ref:`classification <svm_classification>`. For SVC classificati...
bsd-3-clause
peterjoel/servo
tests/wpt/web-platform-tests/webdriver/tests/take_element_screenshot/screenshot.py
8
1221
from tests.support.asserts import assert_error, assert_png, assert_success from tests.support.image import png_dimensions from tests.support.inline import inline from . import element_rect def take_element_screenshot(session, element_id): return session.transport.send( "GET", "session/{session_id...
mpl-2.0
sahilshekhawat/sympy
sympy/printing/tests/test_mathml.py
62
16917
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \ tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \ pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float from sympy.core.compatibility import u from sympy.printing.mathml import mathml, MathMLPrinter from s...
bsd-3-clause
janol77/flask-app
app/manage.py
2
1082
from flask_script import Manager from werkzeug import generate_password_hash from app.db import db from flask import Flask, g from app.modules.user.models import User import os def create_app(config="config.ini"): app = Flask(__name__, static_url_path='/static') app.config.from_object(__name__) if os.path...
gpl-3.0
vietch2612/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committers_unittest.py
121
20173
# Copyright (C) 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...
bsd-3-clause
JulyKikuAkita/PythonPrac
cs15211/MaximumSizeSubarraySumEqualsk.py
1
4810
__source__ = 'https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/' # https://github.com/kamyu104/LeetCode/blob/master/Python/maximum-size-subarray-sum-equals-k.py # Time: O(n) # Space: O(n) # # Description: Leetcode # 325. Maximum Size Subarray Sum Equals k # # Given an array nums and a target value k, f...
apache-2.0
dbestm/mbed
workspace_tools/tests.py
1
47117
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
assuming/infiltrator
infiltrator/spiders/auto_base.py
1
1356
__author__ = 'ohmyxm' # coding: utf-8 import json import codecs def design_sites(filepath='infiltrator/sitesbase/design_sites.json'): fd = codecs.open(filepath, 'r', encoding='utf-8') result = json.loads(fd.read()) fd.close() return result['ui'], result['view'] UI_DESIGN_SITES, VIEW_DESIGN_SITES = ...
gpl-2.0
02agarwalt/FNGS_website
fngs/fngs/settings.py
1
3882
""" Django settings for fngs project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os #...
apache-2.0
acrsilva/animated-zZz-machine
bundle_final_app/libs/pyqtgraph-develop/examples/relativity/relativity.py
20
28294
import numpy as np import collections import sys, os import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.parametertree import Parameter, ParameterTree from pyqtgraph.parametertree import types as pTypes import pyqtgraph.configfile from pyqtgraph.python2_3 import xrange class RelativityGUI(QtG...
lgpl-3.0
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/pygments/lexers/praat.py
31
12556
# -*- coding: utf-8 -*- """ pygments.lexers.praat ~~~~~~~~~~~~~~~~~~~~~ Lexer for Praat :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, words, bygroups, include from pygments.token import Name, T...
gpl-3.0
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_tuple_params.py
203
5565
"""Fixer for function definitions with tuple parameters. def func(((a, b), c), d): ... -> def func(x, d): ((a, b), c) = x ... It will also support lambdas: lambda (x, y): x + y -> lambda t: t[0] + t[1] # The parens are a syntax error in Python 3 lambda (x): x + y -> lambda x: x + y """...
apache-2.0
whitepyro/debian_server_setup
lib/tvdb_api/tvdb_exceptions.py
31
1232
#!/usr/bin/env python2 #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Custom exceptions used or raised by tvdb_api """ __author__ = "dbr/Ben" __version__ = "1.9" __all__ = ["tvdb_error", "tvdb_userabort", "tvdb_shownotfound",...
gpl-3.0
genome-vendor/cython
setup.py
1
12652
from distutils.core import setup, Extension from distutils.sysconfig import get_python_lib import os, os.path import sys try: import platform is_cpython = not hasattr(platform, 'python_implementation') or platform.python_implementation() == 'CPython' except (ImportError, NameError): is_cpython = True # CPy...
apache-2.0
idosekely/python-lessons
lesson_1/python_types.py
1
1595
__author__ = 'sekely' # this is a comment. we use it for code documentation. ''' this is comment block. everything between those markers, is considered as a string, or block ''' 1 + 1 # these are pure integers, complete numbers. the result is '2' 3 / 1 # division ot integers will produce an integer. in that case,...
mit
theochem/horton
horton/part/test/test_becke.py
4
4428
#!/usr/bin/env python # -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2017 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Licens...
gpl-3.0
IUNO-TDM/CouponGenerator
python-printer/Adafruit_Thermal.py
1
16561
#************************************************************************* # This is a Python library for the Adafruit Thermal Printer. # Pick one up at --> http://www.adafruit.com/products/597 # These printers use TTL serial to communicate, 2 pins are required. # IMPORTANT: On 3.3V systems (e.g. Raspberry Pi), use a 1...
gpl-3.0
minhphung171093/GreenERP_V8
openerp/addons/project/report/__init__.py
444
1069
# -*- 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
sloshedpuppie/LetsGoRetro
addons/plugin.video.emby-master/resources/lib/userclient.py
1
15585
# -*- coding: utf-8 -*- ################################################################################################## import hashlib import threading import xbmc import xbmcgui import xbmcaddon import xbmcvfs import artwork import utils import clientinfo import downloadutils #################...
gpl-2.0
PetePriority/home-assistant
tests/helpers/test_discovery.py
6
7760
"""Test discovery helpers.""" from unittest.mock import patch import pytest from homeassistant import loader, setup from homeassistant.core import callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import discovery from tests.common import ( get_test_home_assistant, MockM...
apache-2.0
wonwon0/StrategyIA
ai/Util/ai_command.py
2
1866
from RULEngine.Util.Pose import Pose from RULEngine.Util.Position import Position from enum import Enum class AICommandType(Enum): STOP = 0 MOVE = 1 KICK = 2 class AICommand(object): """ Sert a emmagasiner les états demandés par l'IA avant transformation en commandes d'envoie aux robots ...
mit
spatialdev/onadata
onadata/apps/restservice/views.py
8
2973
import json from django.contrib.auth.decorators import login_required from django.db.utils import IntegrityError from django.http import HttpResponse from django.shortcuts import render from django.shortcuts import get_object_or_404 from django.template.base import Template from django.template.context import Context ...
bsd-2-clause
oandrew/home-assistant
tests/components/test_logger.py
16
1989
"""The tests for the Logger component.""" from collections import namedtuple import logging import unittest from homeassistant.bootstrap import setup_component from homeassistant.components import logger from tests.common import get_test_home_assistant RECORD = namedtuple('record', ('name', 'levelno')) class TestU...
mit
gluwer/przepisymm
lib/markdown/odict.py
143
5157
class OrderedDict(dict): """ A dictionary that keeps its keys in the order in which they're inserted. Copied from Django's SortedDict with some modifications. """ def __new__(cls, *args, **kwargs): instance = super(OrderedDict, cls).__new__(cls, *args, **kwargs) instance.keyOrd...
bsd-3-clause
amir-qayyum-khan/edx-platform
lms/djangoapps/courseware/model_data.py
7
36374
""" Classes to provide the LMS runtime data storage to XBlocks. :class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which stores a subset of xblocks scopes as Django ORM objects. It wraps :class:`~FieldDataCache` to provide an XBlock-friendly interface. :class:`FieldDataCache`: A object which pro...
agpl-3.0
tudorbarascu/QGIS
tests/src/python/test_qgssinglesymbolrenderer.py
43
3309
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgssinglesymbolrenderer.py --------------------- Date : December 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch *****...
gpl-2.0
dmitry-r/incubator-airflow
airflow/www/app.py
12
5467
# -*- 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 ...
apache-2.0
pytorch/fairseq
fairseq/modules/transformer_sentence_encoder_layer.py
1
4326
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Callable, Optional import torch import torch.nn as nn from fairseq import utils from fairseq.modules import LayerNorm, Mul...
mit
aseigneurin/ansible-modules-core
cloud/openstack/keystone_user.py
39
12541
#!/usr/bin/python # -*- coding: utf-8 -*- # Based on Jimmy Tang's implementation DOCUMENTATION = ''' --- module: keystone_user version_added: "1.2" short_description: Manage OpenStack Identity (keystone) users, tenants and roles description: - Manage users,tenants, roles from OpenStack. options: login_user: ...
gpl-3.0
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/pydub/playback.py
1
1790
""" Support for playing AudioSegments. Pyaudio will be used if it's installed, otherwise will fallback to ffplay. Pyaudio is a *much* nicer solution, but is tricky to install. See my notes on installing pyaudio in a virtualenv (on OSX 10.10): https://gist.github.com/jiaaro/9767512210a1d80a8a0d """ import subprocess fr...
gpl-2.0
glwu/python-for-android
python3-alpha/extra_modules/gdata/webmastertools/__init__.py
128
17900
#!/usr/bin/python # # Copyright (C) 2008 Yu-Jie Lin # # 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 o...
apache-2.0
rlindner81/pyload
module/plugins/accounts/MyfastfileCom.py
1
1806
# -*- coding: utf-8 -*- import time from module.plugins.internal.misc import json from module.plugins.internal.MultiAccount import MultiAccount class MyfastfileCom(MultiAccount): __name__ = "MyfastfileCom" __type__ = "account" __version__ = "0.10" __status__ = "testing" __config__ = [("mh_mode"...
gpl-3.0
martinhoaragao/hour-of-code
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
waheedahmed/edx-platform
common/lib/xmodule/xmodule/capa_module.py
3
10916
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys import re from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progr...
agpl-3.0
chrisjdavie/Cookit
5-a-day-thing/data_out/save_all_as_xls.py
1
1065
''' Extracts the 5-a-day data from the different excel spreadsheets, and saves it all in one big spreadsheet. Created on 14 Nov 2014 @author: chris ''' def main(): base_dir = '/home/chris/Projects/Cookit/family-food-datasets/' import xlwt workbook = xlwt.Workbook() from pickle_this imp...
mit
Buggaarde/youtube-dl
youtube_dl/extractor/gfycat.py
147
3555
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, qualities, ExtractorError, ) class GfycatIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gfycat\.com/(?:ifr/)?(?P<id>[^/?#]+)' _TESTS = [{ '...
unlicense
alexschlueter/cern-root
interpreter/llvm/src/utils/release/findRegressions-nightly.py
123
3193
#!/usr/bin/env python import re, string, sys, os, time DEBUG = 0 testDirName = 'llvm-test' test = ['compile', 'llc', 'jit', 'cbe'] exectime = ['llc-time', 'jit-time', 'cbe-time',] comptime = ['llc', 'jit-comptime', 'compile'] (tp, exp) = ('compileTime_', 'executeTime_') def parse(file): f=open(file, '...
lgpl-2.1
gangadhar-kadam/adb-erp
selling/utils.py
5
1499
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
agpl-3.0
StefanRijnhart/OpenUpgrade
addons/l10n_ve/__init__.py
975
1058
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
signed/intellij-community
python/testData/types/NumpyArrayType/numpy/core/multiarray.py
79
7955
def array(p_object, dtype=None, copy=True, order=None, subok=False, ndmin=0): # real signature unknown; restored from __doc__ """ array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0) Create an array. Parameters ---------- object : array_like An arr...
apache-2.0
betoesquivel/CIE
flask/lib/python2.7/site-packages/sqlalchemy/connectors/zxJDBC.py
33
1868
# connectors/zxJDBC.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sys from . import Connector class ZxJDBCConnector(Connector): driv...
mit
chirilo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/zipfileset_mock.py
167
2166
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
jiadaizhao/LeetCode
0401-0500/0407-Trapping Rain Water II/0407-Trapping Rain Water II.py
1
1241
import heapq class Solution: def trapRainWater(self, heightMap: List[List[int]]) -> int: m = len(heightMap) if m == 0: return 0 n = len(heightMap[0]) if n == 0: return 0 visited = [[False]*n for _ in range(m)] pq = [] for i in range(m):...
mit
lukas-hetzenecker/home-assistant
homeassistant/components/notify/syslog.py
11
2564
""" Syslog notification service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.syslog/ """ import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificati...
mit
aricchen/openHR
openerp/addons/l10n_gr/__init__.py
438
1102
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
mattnenterprise/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_runner.py
13
25655
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import _pytest._code import os import py import pytest import sys from _pytest import runner, main, outcomes class TestSetupState(object): def test_setup(self, testdir): ss = runner.SetupState() item = testdi...
mpl-2.0
Kozea/Radicale
radicale/tests/custom/auth.py
1
1080
# This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2017 Guillaume Ayoub # Copyright © 2017-2018 Unrud <unrud@outlook.com> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
gpl-3.0
smithab/azure-quickstart-templates
hortonworks-on-centos/scripts/vm-bootstrap.py
89
53170
# # vm-bootstrap.py # # This script is used to prepare VMs launched via HDP Cluster Install Blade on Azure. # # Parameters passed from the bootstrap script invocation by the controller (shown in the parameter order). # Required parameters: # action: "bootstrap" to set up VM and initiate cluster deployment. "check" f...
mit
CSC301H-Fall2013/JuakStore
site-packages/django/contrib/localflavor/us/forms.py
101
4555
""" USA-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_text from django.u...
mit
IceCubeDev/SpaceOrNot
psycopg2/setup.py
1
22843
# setup.py - distutils packaging # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at...
apache-2.0
drajen/resthome
app/smartthings.py
1
5032
# # smartthings.py # # David Janes # IOTDB.org # 2014-01-31 # # Demonstrate how to use the SmartThings API from Python. # # See also: # Example App explanation: # http://build.smartthings.com/blog/tutorial-creating-a-custom-rest-smartapp-endpoint/ # # Example PHP code: # https://www.dropbox.com/s/7m...
bsd-3-clause
overtherain/scriptfile
software/googleAppEngine/google/appengine/ext/ndb/tasklets.py
4
36759
"""A tasklet decorator. Tasklets are a way to write concurrently running functions without threads; tasklets are executed by an event loop and can suspend themselves blocking for I/O or some other operation using a yield statement. The notion of a blocking operation is abstracted into the Future class, but a tasklet ...
mit
dataxu/ansible-modules-core
cloud/google/gce_lb.py
20
12539
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
USGSDenverPychron/pychron
pychron/processing/analyses/view/main_view.py
1
16975
# =============================================================================== # Copyright 2013 Jake Ross # # 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...
apache-2.0
twz915/django
django/contrib/auth/views.py
2
21880
import warnings from urllib.parse import urlparse, urlunparse from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contr...
bsd-3-clause
guorendong/iridium-browser-ubuntu
tools/gyp/test/intermediate_dir/gyptest-intermediate-dir.py
100
1400
#!/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. """ Verifies that targets have independent INTERMEDIATE_DIRs. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('test.gyp', chdir=...
bsd-3-clause
nimzco/Environment
Sublime/Packages/mdpopups/st3/mdpopups/x11colors.py
7
18277
""" X11 colors. A simple name to hex and hex to name map of X11 colors. """ name2hex_map = { "black": "#000000", "aliceblue": "#f0f8ff", "blueviolet": "#8a2be2", "cadetblue": "#5f9ea0", "cadetblue1": "#98f5ff", "cadetblue2": "#8ee5ee", "cadetblue3": "#7ac5cd", "cadetblue4": "#53868b", ...
mit
Integral-Technology-Solutions/ConfigNOW-4.3
core/validators/machines.py
2
5255
# ============================================================================ # # Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd, # All Rights Reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL...
mit