text
stringlengths
475
200k
# (c) 2012, Daniel Hokka Zakrisson <[EMAIL]> # (c) 2012-2014, Michael DeHaan <[EMAIL]> and others # (c) 2017, Toshio Kuratomi <[EMAIL]> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_functi...
"""Development settings and globals.""" from __future__ import absolute_import from os.path import join, normpath from .base import * ########## DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-deb...
# vim: set encoding=utf-8 # Copyright (c) 2016 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 require...
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.model_selection.GridS...
#!/usr/bin/env python # Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <[EMAIL]> # # 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 ...
# _*_ coding:utf-8 _*_ import random import pygame __author__ = 'Administrator' class Plane(): def __init__(self, width, height, value, image, type): self.width = width self.height = height self.value = value self.image = image self.type = type self.rect = pygame.R...
#!/usr/bin/env python ### # XPify - An application to gamify learning. # Version: DEV # Timestamp: NULL # # Written by Ethan Guo # Using Google App Engine and the webapp2 framework # ### ### IMPORTS ### import time import uuid import cgi import webapp2 from google.appengine.ext.webapp import util from google.app...
#!/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...
# Copyright (c) AT&T 2012-2013 Yun Mao <[EMAIL]> # Copyright 2012 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 requir...
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Script to print potentially missing source dependencies based on the actual .h and .cc files in the source tree and which files a...
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: [EMAIL] This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Publi...
# Copyright (C) 2012 Zan Dobersek <[EMAIL]> # # 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 following d...
''' Configuration object ==================== The :class:`Config` object is an instance of a modified Python ConfigParser. See the `ConfigParser documentation <http://docs.python.org/library/configparser.html>`_ for more information. Kivy has a configuration file which determines the default settings. In order to cha...
# Copyright 2012 OpenStack Foundation # 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 requ...
import sys import os import shutil me_filename = 'mediaelement' mep_filename = 'mediaelementplayer' combined_filename = 'mediaelement-and-player' # BUILD MediaElement (single file) print('building MediaElement.js') me_files = [] me_files.append('me-header.js') me_files.append('me-namespace.js') me_file...
from __future__ import unicode_literals from django.core import mail from django.core.management import call_command from django.test import SimpleTestCase, override_settings @override_settings( ADMINS=(('Admin', '[EMAIL]'), ('Admin and Manager', '[EMAIL]')), MANAGERS=(('Manager', '[EMAIL]'), ('Admin and Man...
# system call counts # (c) 2010, Tom Zanussi <[EMAIL]> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.environ['PERF_EX...
import flask from ..models import Repository webhooks = flask.Blueprint('webhooks', __name__, url_prefix='/webhook/github') @webhooks.route('', methods=['POST']) def gh_webhook(): """Point for GitHub webhook msgs (POST handler)""" db = flask.current_app.container.get('db') ext_master = flask.current_app...
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.db import transaction, IntegrityError from django.test import TestCase, skipIfDBFeature from .models import Employee, Business, Bar, Foo class CustomPKTests(TestCase): def test_custom_pk(self): dan = Employee.objects.create( ...
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
from Converter import Converter from time import localtime, strftime from Components.Element import cached class ClockToText(Converter, object): DEFAULT = 0 WITH_SECONDS = 1 IN_MINUTES = 2 DATE = 3 FORMAT = 4 AS_LENGTH = 5 TIMESTAMP = 6 FULL = 7 SHORT_DATE = 8 LONG_DATE = 9 VFD = 10 AS_LENGTHHOURS = 11 AS...
# -*- coding: utf-8 -*- ''' FanFilm 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 ...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
# -*- coding: iso-8859-1 -*- ############################################################################################# # Name: unittest_Ingestor.py # Author: Jun Hu # Date: 2012-04-30 # Description: test cases for Ingestor class ######################################################################################...
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire X (FoFiX) # # Copyright (C) 2006 Sami Kyöstilä ...
""" Courseware page. """ from .course_page import CoursePage class CoursewarePage(CoursePage): """ Course info. """ url_path = "courseware/" xblock_component_selector = '.vert .xblock' def is_browser_on_page(self): return self.q(css='body.courseware').present @property def ...
from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType class Award(models.Model): name = models.CharField(max_length=25) object_id = models.PositiveIntegerField() content_type = models.ForeignKey(ContentType) content_obje...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <[EMAIL]> # Copyright (C) 2015 Rackspace US, 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 Lic...
# Copyright 2018, Google, LLC. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPC...
import helium import unittest class TestBitvec(unittest.TestCase): def test_Fingerprint(self): fp = helium.Fingerprint(8) self.assertEqual(8, fp.numWords) fp = helium.Fingerprint(1) self.assertEqual('0000000000000000', fp.hex()) self.assertEqual('0000000000000000 000000000...
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep th...
# -*- encoding: utf-8 -*- from .models import CityDict, CourseOrg, Teacher import xadmin _author_ = 'shishengjia' _date_ = '05/01/2017 13:36' class CityDictAdmin(object): list_display = ['name', 'desc', 'add_time'] search_fields = ['name', 'desc'] list_filter = ['name', 'desc', 'add_time'] class Cour...
""" Developed by [EMAIL] """ import redis from gluon import current from gluon.storage import Storage import time import logging import thread logger = logging.getLogger("web2py.session.redis") locker = thread.allocate_lock() def RedisSession(*args, **vars): """ Usage example: put in models from gluon....
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
""" Django settings for server project. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ NOTE: __generator-djangularjs__ may automatically modified this file. """ # Bu...
#!/usr/bin/env python from nose.tools import assert_equal import networkx as nx from networkx.algorithms import bipartite from networkx.testing import assert_edges_equal, assert_nodes_equal class TestBipartiteProject: def test_path_projected_graph(self): G=nx.path_graph(4) P=bipartite.projected_gr...
# # 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...
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Violin Memory, 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 # # ...
# coding=utf-8 # Copyright 2020 The SqueezeBert authors and The HuggingFace Inc. team. # # 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 # # U...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # 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. ...
#!/usr/bin/env python # # Copyright 2015-2015 breakwa11 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand - XBMC Plugin # Canal para sports-main # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from cor...
# Licensed under an MIT open source license - see LICENSE import numpy as np import warnings from astropy.convolution import convolve_fft, MexicanHat2DKernel import statsmodels.formula.api as sm from pandas import Series, DataFrame try: from scipy.fftpack import fftn, ifftn, fftfreq except ImportError: from ...
# -*- coding: utf-8 -*- # # 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 #...
# DER encoder from pyasn1.type import univ from pyasn1.codec.cer import encoder from pyasn1 import error class SetOfEncoder(encoder.SetOfEncoder): def _cmpSetComponents(self, c1, c2): tagSet1 = isinstance(c1, univ.Choice) and \ c1.getEffectiveTagSet() or c1.getTagSet() tagSet2 = i...
# coding=utf-8 """ Runs third party scripts and collects their output. Scripts need to be +x and should output metrics in the form of ``` metric.path.a 1 metric.path.b 2 metric.path.c 3 ``` They are not passed any arguments and if they return an error code, no metrics are collected. #### Dependencies * [subproce...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.execute("create unique index email on auth_user (email)") pass def backwards(self, orm): db.execut...
from __future__ import absolute_import, print_function, unicode_literals import functools import collections def save_method_args(method): """ Wrap a method such that when it is called, we save the args and kwargs with which it was called. >>> class MyClass(object): ... @save_method_args ...
from django.test import TestCase from rest_framework import status from rest_framework.response import Response from rest_framework.test import APIRequestFactory from rest_framework.viewsets import GenericViewSet factory = APIRequestFactory() class BasicViewSet(GenericViewSet): def list(self, request, *args, **...
# Author: Alexander Fabisch <[EMAIL]> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.utils.testing import assert...
from datetime import date from openerp.tests.common import TransactionCase from openerp.osv.orm import except_orm class TestPeriodState(TransactionCase): """ Forbid creation of Journal Entries for a closed period. """ def setUp(self): super(TestPeriodState, self).setUp() cr, uid = sel...
# -*- coding: utf-8 -*- """ A list of Mexican states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ # All 31 states, plus the `D...
# Copyright (c) 2015 Niklas Rosenstein # # 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, ...
from openerp.addons.account.tests.account_test_classes import AccountingTestCase class AccountTestUsers(AccountingTestCase): """Tests for diffrent type of user 'Accountant/Adviser' and added groups""" def setUp(self): super(AccountTestUsers, self).setUp() self.res_user_model = self.env['res....
# # 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...
# Copyright 2011 OpenStack Foundation # 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 requ...
# (c) 2013, seth vidal <[EMAIL]> 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 versi...
import warnings from django.core.exceptions import ValidationError from django.db.models.query import QuerySet from rest_framework.response import Response class BaseMultipleModelMixin(object): """ Base class that holds functions need for all MultipleModelMixins/Views """ querylist = None # Keys...
# -*- coding: utf-8 -*- """ pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt, get...
# (c) 2016, Steve Kuznetsov <[EMAIL]> # # 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. # # ...
#!/usr/bin/env python from __future__ import unicode_literals try: from setuptools import setup except ImportError: from distutils.core import setup long_description = ( 'Autosub is a utility for automatic speech recognition and subtitle generation. ' 'It takes a video or an audio file as input, perfo...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
import operator import warnings from django import template from django.template.defaultfilters import stringfilter from django.utils import six from django.utils.html import escape, format_html register = template.Library() @register.filter @stringfilter def trim(value, num): return value[:num] @register.fil...
from collections import namedtuple from ..exceptions import LocationParseError class Url(namedtuple('Url', ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'])): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ slots = () def __new...
# -*- coding: utf-8 -*- from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, tools _INTERVALS = { 'hours': lambda interval: relativedelta(hours=interval), 'days': lambda interval: relativedelta(days=interval), 'weeks': lambda interval: r...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # This module provides mixins to perform process execution. from __future__ import absolute_import, unicode_literals i...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import import sqlalchemy as sa from sqlalchemy.orm import relationship from sqlalchemy....
#!/usr/bin/env python # Copyright (c) 2013 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 ...
from __future__ import unicode_literals from ..lint import check_path from .base import check_errors import pytest import six def test_allowed_path_length(): basename = 29 * "test/" for idx in range(5): filename = basename + idx * "a" errors = check_path("/foo/", filename, False) che...
import subprocess from subprocess import PIPE import os import tempfile try: import ctypes except ImportError: import plat if plat.HOST_PLATFORM == plat.WINDOWS: raise EnvironmentError("ctypes module missing for Windows.") ctypes = None def get_startup_info(): # Hide the child process wi...
# Copyright (c) 2008 Chris Moyer http://coredumped.org/ # # 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, ...
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
## # Copyright (c) 2009-2015 Apple 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 l...
# python standard library from collections import namedtuple Parameters = namedtuple("Parameters", "name parameters".split()) class TreeNode(object): """ A Class to represent a node in a tree with arbitrary number of children """ def __init__(self, cargo, children=None): """ :param:...
# # Copyright (C) 2016 Savoir-faire Linux Inc # # Authors: Simon Zeni <[EMAIL]> # # 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 lat...
#!/usr/bin/env python # Last modified: July 23rd, 2009 """ pydiction.py 1.2 by Ryan Kulla (rkulla AT gmail DOT com). Description: Creates a Vim dictionary of Python module attributes for Vim's completion feature. The created dictionary file is used by the Vim ftplugin "python_pydiction.vim...
from django.conf import settings HIGHLIGHTJS_DEFAULTS = { "jquery_url": "//code.jquery.com/jquery.min.js", "base_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js", "css_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/{0}.min.css", "include_jquery": False, "...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
""" Sensor for Steam account status. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.steam_online/ """ from blumate.helpers.entity import Entity from blumate.const import CONF_API_KEY ICON = 'mdi:steam' REQUIREMENTS = ['steamodd==4.21'] # pylin...
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Aggregate, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Valu...
""" Helps to implement authentication and authorization using Auth0. Offers functions for generating the view functions needed to implement Auth0, a login screen, callback maker, and a function decorator for protecting endpoints. """ import flask import requests import functools import json import base64 import jwt ...
__author__ = 'mouton' from unittest import TestCase from triggerExpressions import Rand, Evaluation from database import Variable from test.testsTriggersExpressions import simpleTests from arithmeticExpressions import ALitteral class TestRand(TestCase): @classmethod def setUpClass(cls): import gramm...
""" Middleware decorator for removing headers. """ from __future__ import absolute_import from functools import wraps from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response def remove_headers(*headers): """ Decorator that removes specific headers from the...
""" Utility functions to deal with ppm (qemu screendump format) files. @copyright: Red Hat 2008-2009 """ import os, struct, time, re from autotest_lib.client.bin import utils # Some directory/filename utils, for consistency def find_id_for_screendump(md5sum, dir): """ Search dir for a PPM file whose name en...
apiAttachAvailable = u'API jest dost\u0119pne' apiAttachNotAvailable = u'Niedost\u0119pny' apiAttachPendingAuthorization = u'Autoryzacja w toku' apiAttachRefused = u'Odmowa' apiAttachSuccess = u'Sukces' apiAttachUnknown = u'Nieznany' budDeletedFriend = u'Usuni\u0119ty z listy znajomych' budFriend = u'Znajomy' budNeverB...
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import logging def Memoize(f): """Decorator to cache return values of function.""" memoize_dict = {} @functools.wraps(f) def wrapp...
def stoprockpaperscissors(): global inmoov global human rest() sleep(5) if inmoov < human: i01.mouth.speak("congratulations you won with" + str(human - inmoov) + "points") sleep(3) i01.mouth.speak(str(human) + "points to you and" + str(inmoov) + "points to me") elif inmoov > human: ...
import textwrap import unittest from conda_rpms.build import name_version_release class Test_name_version_release(unittest.TestCase): def _check_output(self, spec): expected = {'name': 'foo', 'release':'2', 'version':'1'} actual = name_version_release(textwrap.dedent(spec).split('\n')) se...
# Copyright (C) 2015 by the Free Software Foundation, Inc. # # This file is part of mailman.client. # # mailman.client 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, version 3 of the License. # # mailm...
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2015 Artem Pavlenko # # Mapnik 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 op...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys import warnings from dataclasses import dataclass from typing import List, Mapping from pants.base.exception_sink import ExceptionSink from pants.base....
from unittest import TestCase import sys from testfixtures import Comparison as C, TempDirectory, compare, diff from testfixtures.compat import PY2, PY3, exception_module from testfixtures.shouldraise import ShouldAssert from testfixtures.tests.sample1 import SampleClassA, a_function import pytest class AClass: ...
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parse's general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this d...
# -*- coding: iso-8859-1 -*- # regression test for SAX 2.0 # $Id: test_sax.py,v 1.13 2004/03/20 07:46:04 fdrake Exp $ import urllib from xml.sax import handler, make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable:...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
# Copyright (c) 2017 Cedric Bellegarde <[EMAIL]> # 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 distr...
# 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...
#!/usr/bin/env python # # 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 # "...