text
stringlengths
475
200k
# 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 u...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from django.db import models from django.db import utils import datetime import hashlib import re class BadSequenceError(Exception): def __init__(self,why): self.why = why def __str__(self): return repr(self.why) class Giraffe_Mappable_Model(models.Model): """ This is an abstract cla...
# Copyright (C) 2004, 2005 Canonical 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 2 of the License, or # (at your option) any later version. # # This program is distribut...
from tornado import gen from . import spotifyMix as spot from lib.database.auth import save_token from lib.basehandler import OAuthRequestHandler class SpotifyAuth(OAuthRequestHandler, spot.SpotifyOAuth2Mixin): scope = [ 'playlist-read-private', 'playlist-read-collaborative', 'user-follow...
# Copyright 2016 Ansible (RedHat, 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. # #...
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2016 ## ## ...
# Copyright 2015 VMware, 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 agree...
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
#!/usr/bin/python # xorcheck.py - find xor values for 8-bit LRC # # Adam Laurie <[EMAIL]> # http://rfidiot.org/ # # This code is copyright (c) Adam Laurie, 2009, All rights reserved. # For non-commercial use only, the following terms apply - for all other # uses, please contact the author: # # This code is ...
#!/usr/bin/python3 -u # given an arbitrary piece of Python data, encode it in such a manner # that it can be later encoded into JSON. # http://json.org/ # # Format: # * None, int, float, str, bool - unchanged (long is removed in Python 3) # (json.dumps encodes these fine verbatim) # * list - ['LIST', ...
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import Templat...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Order.refunded_time' db.add_column('shoppingcart_order', 'refunded_time', ...
# Copyright (C) 2001-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 "...
#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1+ # # networkd integration test # This uses temporary configuration in /run and temporary veth devices, and # does not write anything on disk or change any system configuration; # but it assumes (and checks at the beginning) that networkd is not currently # runn...
from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader, TemplateDoesNotExist, RequestContext from django.utils import feedgenera...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary from pants.backend.jvm.targets.junit_tests import JUnitTests class JavaLibrary(ExportableJvmLibrary): ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form from odoo.tests.common import TransactionCase class TestOnchangeProductId(TransactionCase): """Test that when an included tax is mapped by a fiscal position, the included tax must be ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( get_element_by_attribute, clean_html, ) class TechTalksIE(InfoExtractor): _VALID_URL = r'https?://techtalks\.tv/talks/[^/]*/(?P<id>\d+)/' _TEST = { 'url': 'http://techtalks.tv/talks/lea...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the data directory support. """ from __future__ import division, absolute_import try: from twisted.python import _appdirs except ImportError: _appdirs = None from twisted.trial import unittest class AppdirsTests(unittest...
# GitSuperRepository.py # # Copyright (C) 2011 Barry Wardell <[EMAIL]> # # This program 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 later...
# Copyright 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...
#!/usr/bin/env python import sys, time # sys.path.append('gen-py') from ThriftSecureEventTransmissionService import ThriftSecureEventTransmissionService from ThriftSecureEventTransmissionService.ttypes import * from thrift import Thrift from thrift.transport import TSSLSocket from thrift.transport import TTransport ...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} columns = get_columns(filters) data = get_...
import sys import numpy as np import matplotlib.pyplot as plt def ssdwpfunc(individuals, frequencies): """ Returns the sums squares deviation within populations from the population frequencies. individuals[pop] = counts frequencies[pop, haplotype] = freq """ ssdwp = 0.0 n_pop = frequencie...
# Copyright (c) 2019 PaddlePaddle 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 appli...
from __future__ import unicode_literals from collections import defaultdict from django.core import checks from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db import models, router, transaction, DEFAULT_DB_ALIAS from django.db.models import signals, FieldDoesNotExist,...
# coding: utf-8 """ Acceptance tests for Studio's Setting pages """ from __future__ import unicode_literals from nose.plugins.attrib import attr from base_studio_test import StudioCourseTest from bok_choy.promise import EmptyPromise from ...fixtures.course import XBlockFixtureDesc from ..helpers import create_user_par...
import random params = {} def run(graph, setup, params): """ Color a graph using min-conflicts: First generate a random coloring for the graph. Until there are no conflicts in the graph, choose a random node in the graph, and change it to have the color which reduces the number of co...
# -*- 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...
""" .. module:: editor_subscribe_label_deleted The **Editor Subscribe Label Deleted** Model. PostgreSQL Definition --------------------- The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as: .. code-block:: sql CREATE TABLE editor_subscribe_label_deleted ( editor...
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
from __future__ import division, absolute_import, print_function import os import sys import warnings __all__ = ['PackageLoader'] class PackageLoader(object): def __init__(self, verbose=False, infunc=False): """ Manages loading packages. """ if infunc: _level = 2 else...
"""return a jumbled version of a string. eg, the lazy hamster is jumping becomes the lzay hmasetr si jmunipg shuffles insides of words. """ import random #okay, so this will be the jmuble algorythim #variables, passed #string_to_jumble = "" #yeah #jumble_mode = true # do u switch words of two letters d...
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove from unittest import TestCase, makeSuite; from pkg_resources import * from setuptools.command.easy_install import get_script_header, is_sh import os, pkg_resources, sys, StringIO, tempfile, shutil t...
# -*- coding: utf-8 -*- import base64 import datetime import json import os from django import http from django.conf import settings from django.conf.urls import url from django.contrib import admin from django.core import urlresolvers from django.core.cache import cache from django.core.exceptions import ( Valida...
import cuttsum.events import cuttsum.corpora from cuttsum.pipeline import InputStreamResource from cuttsum.classifiers import NuggetRegressor import cuttsum.judgements import pandas as pd import numpy as np from datetime import datetime from cuttsum.misc import event2semsim from sklearn.cluster import AffinityPropagat...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
# Copyright (c) 2013 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 agreed to in writ...
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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,errors...
# 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 applicable ...
"""Truncation utility module""" __author__ = "Jens Thomas, and Felix Simkovic" __date__ = "10 Jul 2018" __version__ = "1.0" import collections from enum import Enum import logging import os import sys from ample.ensembler._ensembler import model_core_from_fasta from ample.util import ample_util, pdb_edit, theseus lo...
from django.core.urlresolvers import reverse_lazy from django.template import Context, Template, TemplateSyntaxError from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import View from braces.views import LoginRequiredMixin, AjaxResponseM...
from django.contrib.auth.management.commands.createsuperuser import * from django.db.models.signals import pre_save, post_save class Command(Command): def handle(self, *args, **options): username = options.get('username', None) email = options.get('email', None) interactive = options.get('...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
"""Weather component that handles meteorological data for your location.""" from datetime import timedelta import logging from homeassistant.const import PRECISION_TENTHS, PRECISION_WHOLE, TEMP_CELSIUS from homeassistant.helpers.config_validation import ( # noqa PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE) from homeass...
from otp.ai.AIBaseGlobal import * from direct.directnotify import DirectNotifyGlobal import random from toontown.suit import SuitDNA import CogDisguiseGlobals from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier MeritMultiplier = 0.5 class PromotionManagerAI: notify = DirectNotifyGlobal.direct...
#!/usr/bin/python2.4 # Copyright (c) 2011 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. """This is a simple HTTP server used for testing Chrome. It supports several test URLs, as specified by the handlers in TestPageHan...
import pickle import matplotlib.pyplot as plt from datetime import datetime criteriaA = 4.0 criteriaB = 4.0 criteriaC = 10.0 dirName = r'F:\simulations\asphaltenes\production\longtime\athInHeptane\nvt\analysis\fullmatrix/' # dirName = r'F:\simulations\asphaltenes\production\longtime\athInHeptane-illite\nvt\a...
"""Miscellaneous helper functions ported from Compass. See: http://compass-style.org/reference/compass/helpers/ This collection is not necessarily complete or up-to-date. """ from __future__ import absolute_import from __future__ import unicode_literals import logging import math import os.path import six from . i...
"""Support for UK Met Office weather service.""" import logging import voluptuous as vol from homeassistant.components.sensor.metoffice import ( CONDITION_CLASSES, ATTRIBUTION, MetOfficeCurrentData) from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity from homeassistant.const import ( C...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
#!/usr/bin/env python # coding=utf8 from __future__ import absolute_import EMPTY_LIST = [] class AnnoSpan(object): """ A span of text with an annotation applied to it. """ __slots__ = ["start", "end", "doc", "metadata", "label", "base_spans"] def __init__(self, start, end, doc, label=None, meta...
# -*- coding: utf-8 -*- __author__ = """Chris Tabor ([EMAIL])""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section DEBUG = True if __name__ == '__main__' else False class BlobOfMatter(object): def __str__(self): ...
# -*- coding: utf-8 -*- """ plnt.views ~~~~~~~~~~ Display the aggregated feeds. :copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ from datetime import datetime, date from plnt.database import Blog, Entry from plnt.utils import Pagination, expose, render_te...
import html from visidata import * option('html_title', '<h2>{sheet.name}</h2>', 'table header when saving to html') def open_html(p): return HtmlTablesSheet(p.name, source=p) open_htm = open_html class HtmlTablesSheet(IndexSheet): rowtype = 'sheets' # rowdef: HtmlTableSheet (sheet.html = lxml.html.HtmlEle...
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # Selecting Between Same Triggers {{{# class _MultipleMatches(_VimTest): snippets = (('test', 'Case1', 'This is Case 1'), ('test', 'Case2', 'This is Case 2')) class Multiple_SimpleCaseSelectFirst_ECR(_MultipleMa...
import io import locale import mimetypes import sys import unittest from test import support # Tell it we don't know about external files: mimetypes.knownfiles = [] mimetypes.inited = False mimetypes._default_mime_types() class MimeTypesTestCase(unittest.TestCase): def setUp(self): self.db = mimetypes.M...
# # QAPI helper library # # Copyright IBM, Corp. 2011 # Copyright (c) 2013 Red Hat Inc. # # Authors: # Anthony Liguori <[EMAIL]> # Markus Armbruster <[EMAIL]> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import re from ordereddict import Orde...
""" Support for Orvibo S20 Wifi Smart Switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.orvibo/ """ import logging import voluptuous as vol from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) from homeassistant.con...
''' Created on Aug 4, 2011 @author: sean ''' from __future__ import print_function from graphlab.meta.asttools.visitors import Visitor, visit_children from graphlab.meta.asttools.visitors.symbol_visitor import get_symbols import ast from graphlab.meta.utils import py2op class ConditionalSymbolVisitor(Visitor): ...
# Copyright 2000-2010 Michael Hudson-Doyle <[EMAIL]> # Armin Rigo # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice a...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...app import App class TestAssembleApp(unittest.TestC...
# -*- 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...
"""Test for RFlink switch components. Test setup of rflink switch component/platform. State tracking and control of Rflink switch devices. """ from homeassistant.components.rflink import EVENT_BUTTON_PRESSED from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_ON, STATE_OFF)...
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, NoneSet, Bool, Integer, MinMax, NoneSet, Set, String, Alias, ) from openpyxl.descriptors.excel i...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Matt Davis <[EMAIL]> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSI...
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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...
# -*- coding: utf-8 -*- """ This file is part of GEOVAL. (c) Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ import sys sys.path.append('..') import unittest from geoval.core import GeoData from geoval.statistic.mintrend import MintrendPlot try: import cPickle # p2 except: ...
# This test is temporary until we can import test_decorators from CPython 3.x # The reason for not doing that already is that in Python 3.x the name of a # function is stored in func.__name__, in 2.x it's func.func_name import unittest from test import test_support class TestClassDecorators(unittest.TestCase): de...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" Dropbox OAuth support. This contribution adds support for Dropbox OAuth service. The settings DROPBOX_APP_ID and DROPBOX_API_SECRET must be defined with the values given by Dropbox application registration process. By default account id and token expiration time are stored in extra_data field, check OAuthBackend ...
""" .. inheritance-diagram:: pyopus.misc.sobol :parts: 1 **Sobol sequence generator** Details can be found in [joekuo1] S. Joe and F. Y. Kuo, Remark on Algorithm 659: Implementing Sobol's quasirandom sequence generator, ACM Trans. Math. Softw. 29, 49-57 (2003). [joekuo2] S. Joe and F. Y. Kuo, Const...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution Addon # Copyright (C) 2009-2013 IRSID (<http://irsid.ru>), # Paul Korotkov ([EMAIL]). # # This program is free software: you can redistribute it and/or modify #...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012 Adobe Systems Incorporated # # This file is part of TMX to Moses Corpus Tool. # # TMX to Moses Corpus Tool 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 Sof...
# -*- coding: utf-8 -*- from django.contrib.messages.storage.cookie import CookieStorage from django.forms.models import model_to_dict from django.test.utils import override_settings from cms.models.permissionmodels import PageUserGroup from cms.test_utils.testcases import CMSTestCase from cms.utils.urlutils import ad...
"""Translation helper functions.""" import locale import os import re import sys import warnings import gettext as gettext_module from cStringIO import StringIO from google.appengine._internal.django.utils.importlib import import_module from google.appengine._internal.django.utils.safestring import mark_safe, SafeDat...
"""Dev server used for running a chalice app locally. This is intended only for local development purposes. """ import functools from collections import namedtuple from BaseHTTPServer import HTTPServer from BaseHTTPServer import BaseHTTPRequestHandler from chalice.app import Chalice # noqa from typing import List,...
#-*- coding: utf-8 -*- """ EOSS catalog system Implementation of ESA sentinel1/2 catalog access (https://scihub.copernicus.eu) Users need to register at the scihub page to get access to their catalog system. These credentials are set by SENTINEL_USER and SENTINEL_PASSWORD """ __author__ = "Thilo Wehrmann, Steffen Ge...
# Simple test suite for Cookie.py from test.test_support import run_unittest, run_doctest, check_warnings import unittest import Cookie class CookieTests(unittest.TestCase): # Currently this only tests SimpleCookie def test_basic(self): cases = [ { 'data': 'chips=ahoy; vienna=finger', ...
"""The main API for the v3 notebook format. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. __all__ = ['NotebookNode', 'new_code_cell', 'new_text_cell', 'new_notebook', 'new_output', 'new_worksheet', 'new_metadata', 'new_author', 'new_head...
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.uic import * from blur.Stone import * from blur.Classes import * from blur.absubmit import Submitter from blur.Classesui import * import sys, os class Cinema4DRenderDialog(QDialog): def __init__(self,parent=None): QDialo...
#!/usr/bin/python # Copyright: (c) 2020, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r''' --- module: test_perrcert short_description: Test getting t...
"""Utility functions for killing the wrapper softly. Copyright (C) 2013, Joshua More and Michele Ceriotti 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...
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id: UnicodeData.py,v 1.1.1.1 2011/06/10 09:34:43 andrew Exp $ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
# 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 # distributed under the Li...
# 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...
"""Acceptance tests for LMS-hosted Programs pages""" from nose.plugins.attrib import attr from common.test.acceptance.fixtures.catalog import CatalogFixture, CatalogConfigMixin from common.test.acceptance.fixtures.programs import ProgramsFixture, ProgramsConfigMixin from common.test.acceptance.fixtures.course import C...
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5日 TIME_FORMAT = 'H:i' # 20:45 DATETIME_FORMAT ...
import requests import threading import time import traceback from . import TelegramConnection, MessageHandler class LongPollingConnection(TelegramConnection): def __init__(self, token: str, handler: MessageHandler) -> None: super().__init__(token, handler) self._connected = False self.la...
# 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 ...
r"""HTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyt...
import numpy as np from skimage.segmentation import clear_border from skimage._shared.testing import assert_array_equal, assert_ def test_clear_border(): image = np.array( [[0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [1, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 1, 1, 1,...
#!/usr/bin/python2 # (C) Copyright IBM Corporation 2004 # 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 limitation # on the ri...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id$ """ version ...
# # # File: io_controller_class.py # # # # # import struct import os import sys import time import select import socket import json import redis class Click_Controller_Base_Class(object): def __init__(self,instrument, click_io = [], m_tags = {}): self.instrument = instrument s...
# Copyright (c) 2009, 2010, 2011, 2012 Brendon J. Brewer. # # This file is part of DNest3. # # DNest3 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 ...