text
stringlengths
475
200k
# Copyright 2011 OpenStack Foundation # # 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...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import curses import npyscreen import time from threading import Thread from vent.api.actions import Action from vent.api.plugins import Plugin from vent.helpers.meta import Version from vent.helpers.paths import PathDirs from vent.menus.help import HelpForm from vent...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.conf import settings from django.db.models import F from django.utils import timezone from .managers import Com...
#!/usr/bin/env python3 # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
#! /usr/bin/env python # # Matasano Crypto Pals # Set 1 # import binascii import base64 from freqs import * from Crypto.Cipher import AES def hex2base64(a): '''Convert a string in hex to a string in base64.''' data = binascii.unhexlify(a) return base64.b64encode(data) def fixedXOR(b1, b2): int1 = int(b1.enc...
# Copyright (c) 2009 The Regents of The University of Michigan # 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 ...
# encoding: utf-8 from __future__ import unicode_literals import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( compat_urllib_parse, find_xpath_attr, fix_xml_ampersands, compat_urlparse, compat_str, compat_urllib_request, compat_parse_qs...
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
# -*- coding: utf-8 -*- # Copyright 2012 Mirko Hannemann BUT, [EMAIL] import sys import codecs # for UTF-8/unicode if len(sys.argv) != 2: print 'usage: reverse_arpa arpa.in' sys.exit() arpaname = sys.argv[1] #\data\ #ngram 1=4 #ngram 2=2 #ngram 3=2 # #\1-grams: #-5.234679 a -3.3 #-3.456783 b #0.0000000 <s> -...
# # DBus interface for the device tree module # # Copyright (C) 2019 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This progr...
from __future__ import with_statement import warnings from celery.task import ping, PingTask, backend_cleanup from celery.tests.compat import catch_warnings from celery.tests.utils import unittest def some_func(i): return i * i class test_deprecated(unittest.TestCase): def test_ping(self): warnin...
#!/usr/bin/env python # # Copyright 2008 FriendFeed # # 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...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'XDomainProxyConfiguration' db.create_table('cors_csrf_xdo...
"""Bayesian Data Analysis, 3rd ed Chapter 3, demo 2 Visualise factored sampling and the corresponding marginal and conditional densities. """ from __future__ import division import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # import from util...
#!/usr/bin/env python """ Build call-back mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <[EMAIL]> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2005/07...
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
import os import time import mock from libmproxy import script, flow import tutils def test_simple(): s = flow.State() fm = flow.FlowMaster(None, s) sp = tutils.test_data.path("scripts/a.py") p = script.Script("%s --var 40" % sp, fm) assert "here" in p.ns assert p.run("here") == 41 assert...
""" Test the TestSampleFileUtil module. Execute with py.test -v """ from __future__ import print_function, division, absolute_import, unicode_literals import tempfile import os import numpy import cosmoHammer.Constants as c from cosmoHammer.util.SampleFileUtil import SampleFileUtil class TestSampleFileUtil(object)...
#!/usr/bin/env python # 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 cmdutils import * import os def run(): r=RunTestLib() r.run_test('VMbaseConcurre...
# -*- 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...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import copy import grp import inspect try: import argparse except ImportError: # python 2.6 from . import argparse_compat as argparse import os import pwd import sys import textwrap im...
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division from pygments.formatter import Forma...
# defusedxml # # Copyright (c) 2013 by Christian Heimes <[EMAIL]> # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details. """Common constants, exceptions and helpe functions """ import sys from types import MethodType PY3 = sys.version_info[0] == 3 PY26 = sys.ver...
# -*- coding: utf-8 -*- from ..dUI import * def DamnMainStopButton(panel=None, parent=None): stopbutton = wx.Button(panel, -1, DV.l('Stop')) stopbutton.Disable() if parent is not None: panel.Bind(wx.EVT_BUTTON, parent.onStop, stopbutton) return stopbutton class DamnMainGoPanel(wx.Panel): def __init__(self, par...
#! /usr/bin/env python3 """This script labels the ORFs based on their exon transcript structure with respect to annotated coding sequences """ import argparse import logging import pbio.misc.logging_utils as logging_utils import pbio.utils.bed_utils as bed_utils from rpbp.defaults import default_num_cpus logger = ...
from django.conf import settings from django.template import Library, Node, Template, TemplateSyntaxError from django.template.defaulttags import kwarg_re, include_is_allowed, SsiNode, URLNode from django.utils.encoding import smart_str register = Library() @register.tag def ssi(parser, token): """ Outputs t...
from datetime import datetime import pprint import os import numpy as np from util import mkdir from data import FEATURE_DIR mkdir(FEATURE_DIR) class Config(object): def __init__(self, layers, cnf=None): self.layers = layers self.cnf = cnf pprint.pprint(cnf) def get(self, k, default...
#!/usr/bin/env python3 # Copyright (C) 2013-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modifie...
import copy import chess import chess.syzygy import chess.gaviota import collections from collections import Counter import features from features import * import os.path weight_vector_3_piece = {'black_king_closer_to_winning_square': -1.400000000000001, 'black_opposition': -1.9200000000000015, 'cant catch pawn': 1.0...
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the (Linux) executables produced by gitian only contain allowed gcc, glibc and libstdc++...
# Stock plugin configuration and build methods. These factor out the # common tasks carried out by plugins in order to configure and build # themselves. from waflib.Errors import ConfigurationError from copy import copy def plugin(name, source=None, configure=False, build=False, build_replace=False, libs=[...
""" Copyright (c) 2012-2015 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
""" A series of tests to establish that the command-line bash completion works. """ import os import sys import unittest from django.apps import apps from django.core.management import ManagementUtility from django.utils.six import StringIO class BashCompletionTests(unittest.TestCase): """ Testing the Python...
# -*- coding: utf-8 -*- """ Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups. """ from ..helpers import UniqueCourseTest, create_user_partition_json from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import CoursewarePage from ...pages...
import decimal from decimal import Decimal from unittest import TestCase from StringIO import StringIO import simplejson as json class TestDecimal(TestCase): NUMS = "1.0", "10.00", "1.1", "1234567890.1234567890", "500" def dumps(self, obj, **kw): sio = StringIO() json.dump(obj, sio, **kw) ...
# 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 ...
from __future__ import unicode_literals from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.template.response import TemplateResponse from django.test import TestCase, override_settings from django.urls import reverse from .models import Action, Car, Person @override...
# Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <[EMAIL]> # # 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/LICENS...
#!/usr/bin/python """Interface to OpenShift oc command""" import os import shlex import shutil import subprocess from ansible.module_utils.basic import AnsibleModule ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')] def locate_oc_binary(): """Find and return oc binary file""" # htt...
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
# -*- coding: utf-8 -*- # Copyright 2012 Loris Corazza, Sakis Christakidis # # 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...
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Parameter definition for Flood Vector on Building QGIS IF Contact : [EMAIL] .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software F...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Author: user # Date : 2021 Jun 27 10:16:32 PM import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))) import time import ujson import datetime import requests from lib3.decorator.safe_run import safe_run_wrap # App Confi...
from collections import deque import unittest from test import test_support, seq_tests import gc import weakref import copy import cPickle as pickle import random import struct BIG = 100000 def fail(): raise SyntaxError yield 1 class BadCmp: def __eq__(self, other): raise RuntimeError class Muta...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util from telemetry.testing import tab_test_case class MemoryCacheHTTPServerTest(tab_test_case.TabTestCase): def s...
from django.core.exceptions import FieldError from django.db import connections from django.db.backends.util import truncate_name from django.db.models.sql.constants import * from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sq...
# testing/schema.py # Copyright (C) 2005-2015 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 from . import exclusions from .. import schema, event from . import config __all_...
""" Unit tests for cloning a course between the same and different module stores. """ import json from unittest.mock import Mock, patch from django.conf import settings from opaque_keys.edx.locator import CourseLocator from cms.djangoapps.contentstore.tasks import rerun_course from cms.djangoapps.contentstore.tests...
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
# mako/pygen.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re, string from StringIO ...
import uuid from vnc_api.vnc_api import * from instance_manager import InstanceManager from config_db import ( VirtualMachineSM, VirtualMachineInterfaceSM, ServiceApplianceSetSM, ServiceApplianceSM, PhysicalInterfaceSM, ServiceInstanceSM, PortTupleSM) from cfgm_common import svc_info class...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configurati...
# Natural Language Toolkit: Lexical Functional Grammar # # Author: Dan Garrette <[EMAIL]> # # Copyright (C) 2001-2012 NLTK Project # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from collections import defaultdict from nltk.internals import Counter class FStructure(dict): def safeappen...
#!/usr/bin/env python import RPi.GPIO as GPIO import time colors = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF] LedPinRed = 11 LedPinGreen = 12 LedPinBlue = 13 def setup(Rpin, Gpin, Bpin): global pins global p_R, p_G, p_B pins = {'pin_R': Rpin, 'pin_G': Gpin, 'pin_B': Bpin} GPIO.setmode(GPIO.BOARD...
""" >>> import numpy.core as nx >>> import numpy.lib.ufunclike as U Test fix: >>> a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) >>> U.fix(a) array([[ 1., 1., 1., 1.], [-1., -1., -1., -1.]]) >>> y = nx.zeros(a.shape, float) >>> U.fix(a, y) array([[ 1., 1., 1., 1.], [-1., -1., -1., -...
# 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...
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from pip._vendor.six import text_typ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN. ## ## Invenio 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 ve...
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi ([EMAIL]), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test f...
import logging import six from grab.spider.base import Spider from grab.spider.error import SpiderInternalError from grab.util.config import build_root_config, build_spider_config SPIDER_REGISTRY = {} logger = logging.getLogger('grab.util.module') def build_spider_registry(config): SPIDER_REGISTRY.clear() ...
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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...
#coding=utf-8 import uuid import redis """ 003, 将 0001 题生成的 200 个激活码(或者优惠券)保存到 **Redis** 非关系型数据库中. """ def get_redis_instance(host='localhost', port=6379): return redis.StrictRedis(host=host, port=port) def generate_activation_code(count): code_list = [] for i in xrange(count): code = str(uui...
# -*- coding: utf-8 -*- """ =============================================================================== Script 'mne logo' =============================================================================== This script makes the logo for MNE. """ # @author: drmccloy # Created on Mon Jul 20 11:28:16 2015 # License: BSD ...
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website.models.website import unslug from openerp.tools.translate import _ import werkzeug.urls class WebsiteMembership(http.Controller): _references_per_pa...
# Copyright 2013 Cloudbase Solutions Srl # # 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 ...
""" Image Tag --------- This implements a Liquid-style image tag for Pelican, based on the liquid img tag which is based on the octopress image tag [1]_ Syntax ------ {% b64img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %} Examples -------- {% b64img /images/ni...
import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing impo...
import os from importlib import import_module from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils._os import upath from django.utils.module_loading import module_has_submodule MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django ap...
import unittest from robot.parsing import TestCaseFile from robot.parsing.model import TestCaseTable from robot.utils import ET, ETSource, StringIO from robot.utils.asserts import assert_equal def create_test_case_file(): data = TestCaseFile(source='foo.txt') table = TestCaseTable(data) data.testcase_tab...
#!/usr/bin/env python # # 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 ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingToolbox.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified heade...
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None, indentl...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
# coding: utf-8 # # Monk is an unobtrusive data modeling, manipulation and validation library. # Copyright © 2011—2015 Andrey Mikhaylenko # # This file is part of Monk. # # Monk is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
# -*- coding: utf-8 -*- import importlib from math import sqrt import psycopg2 import psycopg2.extras from izumin import config if config.IS_PRODUCTION_ENVIRONMENT: db = importlib.import_module("izumin.db") else: db = importlib.import_module("izumin.db_local") def is_prime(x): """ 引数が素数であればTrue、そうで...
# -*- coding: utf-8 -*- """ default config file :copyright: 20160204 by [EMAIL] """ #from __future__ import unicode_literals import sys PY3=sys.version>"3" from os.path import dirname, abspath, expanduser, join as joinpath import json import logging logger = logging.getLogger(__name__) config_default = { ...
# # 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 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. _check_webgl_supported_script = """ (function () { var c = document.createElement('canvas'); var gl = c.getContext('webgl'); if (gl == null) { gl =...
#!/usr/bin/env python3 # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 res...
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2013 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...
"""Support for Ubiquiti mFi sensors.""" import logging from mficlient.client import FailedToLogin, MFiClient import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_SSL, CONF_US...
from __future__ import print_function, unicode_literals import json from utils.protocol import Socket as sock from funchain import AsyncCall import traceback tracker = {} cid = 0 def receiver(body): asc = tracker.get(body['cid'], None) if asc: del tracker[body['cid']] asc.fire_callback(body['...
from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly ...
import urllib from django.contrib.auth.models import User from django.utils.encoding import smart_str from django.db import models from django.conf import settings from django.contrib.sites.models import Site ####################################################################### # # "Monkey-pathcing is bad, but co...
# Test the runpy module import unittest import os import os.path import sys import re import tempfile from test.test_support import verbose, run_unittest, forget from test.script_helper import (temp_dir, make_script, compile_script, make_pkg, make_zip_script, make_zip_pkg) from runpy i...
data = ( 'Yao ', # 0x00 'Yu ', # 0x01 'Chong ', # 0x02 'Xi ', # 0x03 'Xi ', # 0x04 'Jiu ', # 0x05 'Yu ', # 0x06 'Yu ', # 0x07 'Xing ', # 0x08 'Ju ', # 0x09 'Jiu ', # 0x0a 'Xin ', # 0x0b 'She ', # 0x0c 'She ', # 0x0d 'Yadoru ', # 0x0e 'Jiu ', # 0x0f 'Shi ', # 0x10 'Tan ...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 res...
#!/usr/bin/env python __all__ = ['ehow_download'] from ..common import * def ehow_download(url, output_dir = '.', merge = True, info_only = False): assert re.search(r'http://www.ehow.com/video_', url), "URL you entered is not supported" html = get_html(url) contentid = r1(r'<meta name="contentid" scheme="DMINS...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pyg...
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...