text
stringlengths
475
200k
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # from quantumclient.quantum import client from quantumclient.client import HTTPClient from quantumclient.common import exceptions class CommonQuantumClient(object): def __init__(self, project, user, passwd, api_server_ip): AUTH_URL = 'ht...
# Copyright (C) 2013-2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
# -*- coding: utf-8 -*- import re import time from pyload.plugin.Account import Account class FilerNet(Account): __name = "FilerNet" __type = "account" __version = "0.04" __description = """Filer.net account plugin""" __license = "GPLv3" __authors = [("stickell", "[EMAIL]")] ...
import unittest from io import BytesIO from scrapy.mail import MailSender class MailSenderTest(unittest.TestCase): def test_send(self): mailsender = MailSender(debug=True) mailsender.send(to=['[EMAIL]'], subject='subject', body='body', _callback=self._catch_mail_sent) assert self.catched...
# -*- coding: utf-8 -*- from scrapy.spiders import Spider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from scrapy.conf import settings from beerindex.items import WineIndexItem import logging import lxml.html from urlparse import urlparse import re class WineSpider(Spider): name =...
# -*- 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 #...
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
from fvh import MyTurtle masterHexSet=[] masterHexList=[] distanceBetweenLayers=None points=["sw","se","e","ne","nw","w"] def drawit(circleXfromCenter,rootHex): heading=90 rootHex.turt.pu() rootHex.turt.seth(heading) rootHex.setDistanceBetweenLayers() rootHex.turt.fd(distanceBetweenLayers) newt...
# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab # Copyright 2016, 2017 juga (juga at riseup dot net), MIT license. """.""" from dhcpcanon.dhcpcaplease import DHCPCAPLease LEASE_INIT = DHCPCAPLease(interface='enp0s25', address='', server_id='', next_server='', router='', subnet_mask='', ...
import pytest, py def exvalue(): return py.std.sys.exc_info()[1] def f(): return 2 def test_assert(): try: assert f() == 3 except AssertionError: e = exvalue() s = str(e) assert s.startswith('assert 2 == 3\n') def test_assert_within_finally(): excinfo = py.test.r...
#!/usr/bin/python # coding: utf-8 -*- # (c) 2015-2016, Hewlett Packard Enterprise Development Company LP # # This module 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 # (...
# -*- 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): # Changing field 'Hit.added' db.alter_column(u'cached_hitcount_hit', 'ad...
# -*- coding: utf-8 -*- """Test cases for the WikidataQuery query syntax and API.""" # # (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals import os import time import pywikibot import pywikibot.data.wikidataquery as query from py...
# Copyright 2018 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 cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 # #Copyright (C) 2013- The University of Notre Dame #This software is distributed under the GNU General Public License. #See the file COPYING for details. # # This program implements a way to organize and manage a large number of # concurrently running GATK...
"""Tests for distutils.command.build_py.""" import os import sys import StringIO import unittest from distutils.command.build_py import build_py from distutils.core import Distribution from distutils.errors import DistutilsFileError from distutils.tests import support from test.test_support import run_unittest cla...
########################################################################## # # Copyright (c) 2015, Image Engine Design 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: # # * Redistrib...
#!/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 #...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from collections imp...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import osv from openerp.tools.misc import formatLang from openerp.tools.translate import _ from openerp.report import report_sxw from openerp.exceptions import UserError class report_expens...
# Copyright 2013, 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...
import unittest from betfairlightweight import resources from tests.tools import create_mock_json class ScoreResourcesTest(unittest.TestCase): def test_racedetails(self): mock_response = create_mock_json("tests/resources/racedetails.json") resource = resources.RaceDetails(**mock_response.json()) ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unicodedata class Word(object): """ """ def __init__(self, input): self.original = input if isinstance(input, bytes): self.decoded = input.decode('utf-8', 'ignore') else: self.decoded = i...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the Lic...
"""For more tests on satisfiability, see test_dimacs""" from sympy import symbols, Q from sympy.logic.boolalg import And, Implies, Equivalent, true, false from sympy.logic.inference import literal_symbol, \ pl_true, satisfiable, valid, entails, PropKB from sympy.logic.algorithms.dpll import dpll, dpll_satisfiable...
from __future__ import unicode_literals template = { "Resources": { "HostedZone": { "Type": "AWS::Route53::HostedZone", "Properties": { "Name": "my_zone" } }, "my_health_check": { "Type": "AWS::Route53::HealthCheck", ...
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
# -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
# coding: utf-8 from msgpack._version import version from msgpack.exceptions import * from collections import namedtuple class ExtType(namedtuple('ExtType', 'code data')): """ExtType represents ext type in msgpack.""" def __new__(cls, code, data): if not isinstance(code, int): raise TypeE...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
# -*- coding: utf-8 -*- # Copyright (C) 2010 Yuen Ho Wong # # 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 late...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://...
# -*- 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 model 'XBlockAsidesConfig' db.create_table('lms_xblock_xblockasidesconfig', ( ('id', se...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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...
from doit import exceptions class TestInvalidCommand(object): def test_just_string(self): exception = exceptions.InvalidCommand('whatever string') assert 'whatever string' == str(exception) def test_task_not_found(self): exception = exceptions.InvalidCommand(not_found='my_task') ...
#!/usr/bin/env python3 import subprocess import os import sys import glob import json import anymarkup REPO_PATH = 'git-repo' def git_clone(url): r = subprocess.run(['git', 'clone', url, REPO_PATH]) if r.returncode == 0: return True else: print("[COUT] Git clone error: Invalid argument ...
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.exceptions import ConvergenceWarning from sklearn.utils.testing import assert_true from sklearn.utils.t...
#!/usr/bin/python # encoding=utf-8 #!coding:utf-8 import re import sys import urllib2 import argparse import commands import os import subprocess if __name__ == "__main__" : # 测试正则表达式 reload(sys) sys.setdefaultencoding("utf-8") if len(sys.argv) > 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <[EMAIL]>, and others # # 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 ...
# -*- 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...
# mssql/adodbapi.py # Copyright (C) 2005-2013 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 """ The adodbapi dialect is not implemented for 0.6 at this time. """ import dateti...
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 One Click Software (http://oneclick.solutions) # and Copyright (C) 2013 Michael Telahun Makonnen <[EMAIL]>. # All Rights Reserved. # # This program is free software: you can redistribu...
#!/usr/bin/env python # Copyright 2017 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...
from django.conf import settings from django.contrib.messages import constants, utils from django.utils.encoding import force_text LEVEL_TAGS = utils.get_level_tags() class Message: """ Represent an actual message that can be stored in any of the supported storage classes (typically session- or cookie-ba...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.securecookie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements a cookie that is not alterable from the client because it adds a checksum the server checks for. You can use it as session replacement if all you have is a user id or something to mark ...
# -*- coding: utf-8 -*- # Copyright 2020 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...
"""Unit tests for idlelib.configSectionNameDialog""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox from idlelib import configSectionNameDialog as name_dialog_module name_dialog = name_dialog_module.GetCfgSectionNameDialog class Dummy_name_dialog(object): # Mock for testing the following methods ...
"""SCons.Tool.masm Tool-specific initialization for the Microsoft Assembler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S...
#!/usr/bin/env python # encoding: utf-8 # (c) Siddharth Bharat Purohit, 3DRobotics Inc. """ The **mavgen.py** program is a code generator which creates mavlink header files. """ from waflib import Logs, Task, Utils, Node from waflib.TaskGen import feature, before_method, extension import os import os.path from xml.et...
""" Safe fallback for defaultdict, in order to support 2.4. """ ## From http://code.activestate.com/recipes/523034/ try: from collections import defaultdict except: class defaultdict(dict): def __init__(self, default_factory=None, *a, **kw): if (default_factory is not None and ...
""" Unit-tests and examples of syntax and behavior desired for AST-nodes. """ import unittest import operator import pdb from .node import denode, FASTNode, NodeInterface a, b, c = 5, 4, 2 inner = FASTNode(operator.__mul__, b, c) outer = FASTNode(operator.__add__, a, inner) # tree = FASTNode( # operator.__add__,...
import time import loadmaker from dtest import Tester class TestLoadmaker(Tester): def loadmaker_test(self): cluster = self.cluster cluster.populate(1).start() node1 = cluster.nodelist()[0] time.sleep(.2) host, port = node1.network_interfaces['thrift'] lm = loadm...
#!/usr/bin/env python3 # # 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 "L...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ It generates the list of candidate fusion genes. This list is hard coded in here and it is manually curated from: Greger et al. Tandem RNA Chimeras Contribute to Transcriptome Diversity in Human Population and Are Associated with Intronic Genetic Variants, Plos One,...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2009 Søren Roug, European Environment Agency # # This is free software. You may redistribute it under the terms # of the Apache license and the GNU General Public License Version # 2 or at your option any later version. # # This program is distributed in t...
"""File transfers. """ __docformat__ = 'restructuredtext en' import os from utils import * class FileTransfer(Cached): """Represents a file transfer. """ _ValidateHandle = int def __repr__(self): return Cached.__repr__(self, 'Id') def _Alter(self, AlterName, Args=None): return...
# $Id: tns.py 23 2006-11-08 15:45:33Z dugsong $ # -*- coding: utf-8 -*- """Transparent Network Substrate.""" import dpkt class TNS(dpkt.Packet): __hdr__ = ( ('length', 'H', 0), ('pktsum', 'H', 0), ('type', 'B', 0), ('rsvd', 'B', 0), ('hdrsum', 'H', 0), ('msg', '0s'...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reser...
#!/usr/bin/env python # # Copyright 2008 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 #...
# 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...
# Drop in replace for python 3.2's collections.lru_cache, from... # http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/ # # ... which is under the MIT license. Stem users should *not* rely upon this # module. It will be removed when we drop support for python 3.2 and below. """ M...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
from __future__ import with_statement import py, pytest # test for _argcomplete but not specific for any application def equal_with_bash(prefix, ffc, fc, out=None): res = ffc(prefix) res_bash = set(fc(prefix)) retval = set(res) == res_bash if out: out.write('equal_with_bash %s %s\n' % (retval,...
# Copyright (c) 2012 Citrix Systems, 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 ...
#! /bin/bash # -*- coding: utf-8 -* import urlparse import os import comm_log import tornado.ioloop import tornado.web import tornado.options from tornado.options import define, options # 监听端口 define("port", default=8978, help="run on the given port", type=int) # 日志输出 define("log", default=comm_log.get_logging('gohook...
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
# Copyright 2013: Mirantis 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 b...
from couchpotato import fireEvent from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.automation.base import Automation log = CPLog(__name__) autoload = 'PopularMovies' class PopularMovies(Automation): interval = 1800 url = 'https://s3.amazonaws.com/popular-movies/movies.j...
"""Demo platform that offers fake air quality data.""" from homeassistant.components.air_quality import AirQualityEntity async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Air Quality.""" async_add_entities( [DemoAirQuality("Home", 14, 23, 100), DemoAi...
"""Base implementation of 0MQ authentication.""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import logging import zmq from zmq.utils import z85 from zmq.utils.strtypes import bytes, unicode, b, u from zmq.error import _check_version from .certs import load_certificat...
# 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. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class PolymerPage(page_module.Page):...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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....
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, modi...
# -*- coding: utf-8 -*- """ *************************************************************************** BatchPanel.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
# -*- 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 ...
from test import test_support import unittest from cStringIO import StringIO from quopri import * ENCSAMPLE = """\ Here's a bunch of special=20 =A1=A2=A3=A4=A5=A6=A7=A8=A9 =AA=AB=AC=AD=AE=AF=B0=B1=B2=B3 =B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE =BF=C0=C1=C2=C3=C4=C5=C6 =C7=C8=C9=CA=CB=CC=CD=CE=CF =D0=D1=D2=D3=D4=D5=D6=D7 ...
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <[EMAIL]> # # Copyright 2012 Zearin <[EMAIL]> #...
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test getblockstats rpc call # from test_framework.test_framework import BitcoinTestFramework from tes...
# Copyright 2009-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import array import tempfile from portage import _unicode_decode from portage import _unicode_encode from portage.tests import TestCase class ArrayFromfileEofTestCase(TestCase): def testArrayFromfileEof(self)...
# 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 distributed in the hope that ...
# encoding: utf-8 import datetime import sys from south.db import db from south.v2 import DataMigration from django.db import models from askbot.migrations import TERM_RED_BOLD, TERM_GREEN, TERM_RESET from askbot.utils.console import ProgressBar class Migration(DataMigration): def forwards(self, orm): m...
#!/usr/bin/python3 # -*- coding:utf-8 -*- import socket from urllib.request import urlopen, Request from urllib.error import URLError, HTTPError import threading from gymkhana.aux.printing_format import green_nd_bold, yellow_nd_bold, colorfill, end_format from gymkhana.aux.my_variables import uclm_url, uclm_port3, my...
import os import sys import itertools import imp from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from d...
# (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 python3 # #### # Copyright 2000 by Timothy O'Malley <[EMAIL]> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # cop...
# 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...
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ import json from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import ( GEOSGeometry, ProjectInterpolateM...
data = ( 'Ruo ', # 0x00 'Bei ', # 0x01 'E ', # 0x02 'Yu ', # 0x03 'Juan ', # 0x04 'Yu ', # 0x05 'Yun ', # 0x06 'Hou ', # 0x07 'Kui ', # 0x08 'Xiang ', # 0x09 'Xiang ', # 0x0a 'Sou ', # 0x0b 'Tang ', # 0x0c 'Ming ', # 0x0d 'Xi ', # 0x0e 'Ru ', # 0x0f 'Chu ', # 0x10 'Zi ...
from __future__ import unicode_literals import os.path from django.utils._os import upath TEST_ROOT = os.path.dirname(upath(__file__)) TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') TEST_SETTINGS = { 'DEBUG': True, 'MEDIA_URL': '/media/', 'STATIC_URL': '/static/', 'MEDIA...
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Gouthaman Balaraman # # 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 applic...
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: [EMAIL] # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops = [] f...
# 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...
import logging import random from xmodule.x_module import XModule, STUDENT_VIEW from xmodule.seq_module import SequenceDescriptor from lxml import etree from xblock.fields import Scope, Integer from xblock.fragment import Fragment log = logging.getLogger('edx.' + __name__) class RandomizeFields(object): choic...
from invenio.htmlutils import HTMLWasher import htmlentitydefs import cgi import re RE_HTML_FIRST_NON_QUOTATION_CHAR_ON_LINE = re.compile('[^>]') class EmailWasher(HTMLWasher): """ Wash comments before being sent by email """ line_quotation = '' def handle_starttag(self, tag, attrs): """...