text
stringlengths
475
200k
import json from .. import constants ROUND = constants.DEFAULT_PRECISION ## THREE override function def _json_floatstr(o): if ROUND is not None: o = round(o, ROUND) return '%g' % o def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, _key_separator, _item_separator,...
try: from operator import methodcaller except ImportError: methodcaller = lambda name: lambda o: getattr(o, name)() from django.forms.forms import NON_FIELD_ERRORS, Form from django.forms.formsets import formset_factory from django.forms.models import modelform_factory, _get_foreign_key, BaseInlineFormSet, Bas...
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/test_ElGamal.py: Self-test for the ElGamal primitive # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone ...
"""Middleware for course_wiki""" from urlparse import urlparse from django.conf import settings from django.http import Http404 from django.shortcuts import redirect from django.core.exceptions import PermissionDenied from wiki.models import reverse from courseware.courses import get_course_with_access from courseware...
#!/usr/bin/python # -*- coding: latin-1 -*- # 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, or (at your option) any later # version. # # This program is distributed in the hope...
#!/usr/bin/env python3 # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" import struct # generic big endian MPI format def bn_bytes(v, have...
#!/usr/bin/env python from __future__ import absolute_import from email.utils import parseaddr import functools import htmlentitydefs import itertools import logging import operator import psycopg2 import re from ast import literal_eval from openerp.tools import mute_logger # Validation Library https://pypi.python.org...
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module results = {} # Test import with no from import ansible.module_utils.foo0 results['foo0'] = ansible.module_utils.foo0.data # Test depthful import with no from import ansib...
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # tvalacarta 4 # Copyright 2015 [EMAIL] # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html # ---------------------...
# -*- 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...
""" Provides a sensor to track various status aspects of a UPS. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nut/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATFORM_S...
from __future__ import absolute_import, division, print_function, with_statement import collections from contextlib import closing import errno import gzip import logging import os import re import socket import sys from tornado import gen from tornado.httpclient import AsyncHTTPClient from tornado.httputil import HT...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line scripts in the top-level I{bin/} directory. Tests for actual functionality belong elsewhere, written in a way that doesn't involve launching child processes. """ from os import devnull, getcwd, chdir from sys impor...
#!/usr/bin/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 # "Lic...
# coding=utf-8 import time import math import multiprocessing import os import random import sys import signal try: from setproctitle import getproctitle, setproctitle except ImportError: setproctitle = None from diamond.utils.signals import signal_to_exception from diamond.utils.signals import SIGALRMExcept...
import unittest import os import fudge from fudge.inspector import arg from fabric.contrib import project class UploadProjectTestCase(unittest.TestCase): """Test case for :func: `fabric.contrib.project.upload_project`.""" fake_tmp = "testtempfolder" def setUp(self): fudge.clear_expectations()...
# conding: utf-8 import datetime from datetime import timedelta from django.core.urlresolvers import reverse from . import TestBase, CashForm, Cash, make_validated_form, create_cash class HomeViewTest(TestBase): def setUp(self): self.login() self.url = reverse('statement:home') self.res...
from argparse import ArgumentParser def build_opts(transformers=None): opts = ArgumentParser() opts.add_argument(dest='filename', help='Filename or release name to guess', nargs='*') naming_opts = opts.add_argument_group("Naming") naming_opts.add_argument('-t', '--type', dest='type', default=None, ...
from pyasn1.error import PyAsn1Error from pysnmp.error import PySnmpError class SmiError(PySnmpError, PyAsn1Error): pass class MibLoadError(SmiError): pass class MibNotFoundError(MibLoadError): pass class MibOperationError(SmiError): def __init__(self, **kwargs): self.__outArgs = kwargs def __str__(self): ret...
""" WSGI config for dj project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` setti...
# -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # 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 # lis...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest from gnuradio import blocks import pmt class qa_tag_share(gr_unittest.TestCase): def setUp(sel...
#!/usr/bin/env python # Copyright 2013 Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
# Generated from 'Appearance.h' def FOUR_CHAR_CODE(x): return x kAppearanceEventClass = FOUR_CHAR_CODE('appr') kAEAppearanceChanged = FOUR_CHAR_CODE('thme') kAESystemFontChanged = FOUR_CHAR_CODE('sysf') kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') kThemeDataFileType =...
from __future__ import absolute_import, division, print_function, with_statement from hashlib import md5 from tornado.escape import utf8 from tornado.httpclient import HTTPRequest from tornado.stack_context import ExceptionStackContext from tornado.testing import AsyncHTTPTestCase from tornado.test import httpclient_...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
from __future__ import unicode_literals from .cbs import CBSBaseIE class CBSSportsIE(CBSBaseIE): _VALID_URL = r'https?://(?:www\.)?cbssports\.com/[^/]+/(?:video|news)/(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://www.cbssports.com/nba/video/donovan-mitchell-flashes-star-potential-in-game-2-victory-o...
# -*- 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...
# # 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 # ...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that targets have independent INTERMEDIATE_DIRs. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('test.gyp', chdir=...
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
#!/usr/bin/env python # Copyright 2013 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 python sync server used for testing Chrome Sync. By default, it listens on an ephemeral port and xmpp_port and sends the ...
# # Copyright 2015 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
#!/usr/bin/env python3 import logging from logging import StreamHandler from docopt import docopt from riot_graphs.rg import RiotGraph from riot_graphs import server def fetch(args, graphs): days = None if args['--days']: try: days = int(args['--days']) except: raise ...
import encrypt_bot def test(): for cmd, expected_response in sample_conversation(): message = {'content': cmd, 'subject': 'foo', 'display_recipient': 'bar'} class ClientDummy(object): def __init__(self): self.output = '' def send_message(...
from django.test import TestCase from models import A, B, C, D, DataPoint, RelatedPoint class SimpleTest(TestCase): def setUp(self): self.a1 = A.objects.create() self.a2 = A.objects.create() for x in range(20): B.objects.create(a=self.a1) D.objects.create(a=self.a1...
# -*- 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 #...
# Authors: Alexandre Barachant <[EMAIL]> # Jean-Remi King <[EMAIL]> # # License: BSD (3-clause) import numpy as np import os.path as op from nose.tools import assert_equal, assert_raises, assert_true from numpy.testing import assert_array_equal, assert_array_almost_equal from mne import Epochs, read_events, p...
from difflib import unified_diff import os import sys from conf import hook from exc.test_failed import TestFailed """ Post-Test Hook: ExpectedFiles This is a Post-Test hook that checks the test directory for the files it contains. A dictionary object is passed to it, which contains a mapping of filenames and contents...
from boto.s3.key import Key from mock import Mock from moto import mock_s3 from pyproctor import MonkeyPatcher from shelf.app import app from shelf.error_code import ErrorCode from shelf.metadata.initializer import Initializer from shelf.resource_identity import ResourceIdentity from shelf.search.container import Conta...
# Django settings for wictrl project. import sys import os.path reload(sys) sys.setdefaultencoding('utf-8') gettext = lambda s: s PROJECT_ROOT = os.path.join( os.path.realpath(os.path.dirname(__file__)), os.pardir) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[EMAIL]'), ) MANAGERS = ADM...
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True # PYTHON 3 and PYGAME DEPENDENCIES if module_exists('pygame'): import pygame class _body(object): def __init__(self): self.events = {} def appe...
"""Twilio Call platform for notify component.""" import logging import urllib from twilio.base.exceptions import TwilioRestException import voluptuous as vol from homeassistant.components.notify import ( ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.components.twilio import D...
## # Copyright 2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http://w...
#!/usr/bin/python2.4 # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
""" Support for Dark Sky weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.darksky/ """ import logging from datetime import timedelta import voluptuous as vol from requests.exceptions import ConnectionError as ConnectError, \ HT...
#!/usr/bin/env python2.7 # Copyright 2015, 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 lis...
import argparse import csv import os import json def arguments(): parser = argparse.ArgumentParser() parser.add_argument('-j', '--jsons', help = 'Path to JSON directory') parser.add_argument('-o', '--out', help = 'CSV output file path.') parser.add_argument('-t', '--test', help = 'Name of the MIST t...
# bagofwords.py # # The BagOfWords class implements individual volumes as ordered # lists of features. # import numpy as np import pandas as pd from pandas import Series, DataFrame def all_nonalphanumeric(astring): nonalphanum = True for character in astring: if character.isalpha() or character.isdigi...
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import collections from .compat import cookielib, urlparse, Morsel try: import threading # grr, pyflakes: this fixes "redefinition of unused...
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, parse_duration, qualities, strip_jsonp, unified_strdate, url_basename, ) class NPOBaseIE(InfoExtractor): def _get_token(self, video_id): token_page = self._download_...
#encoding=utf8 from sklearn.ensemble import RandomForestClassifier import pandas as pd import numpy as np import matplotlib.pyplot as plt #导入数据集与设定因变量及响应变量# data=pd.read_csv('data.csv') #data=pd.read_csv('data_p.csv') df=pd.DataFrame(data) df=df.dropna()#去除缺失值# y=df.BAD x=pd.concat([df.LOAN,df.MORTDUE,df.VALUE,df.YOJ...
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011 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,...
# 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...
import os import sys import pygame from common.constants import * from client.constants import * from common import boundint from common.util.rect import Rect class FX(object): def __init__(self, inPos, inFacing, inType): self.preciseLoc = inPos self.facingRight = inFacing self.frames = ...
# $Id: application.py 4798 2014-03-19 21:20:17Z bennylp $ # # pjsua Python GUI Demo # # Copyright (C)2013 Teluu Inc. (http://www.teluu.com) # # 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; eith...
# -*- test-case-name: twisted.words.test.test_xmlstream -*- # # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ XML Stream processing. An XML Stream is defined as a connection over which two XML documents are exchanged during the lifetime of the connection, one for each direction. ...
# -*- coding: utf-8 -*-777777yyy # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class StudentApplicant(Document): def autoname(self): f...
""" Django management command to migrate a course from the old Mongo modulestore to the new split-Mongo modulestore. """ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from xmodule.modulestore.django import modulestore from xmodule.modulestore.split_migrato...
#!/usr/bin/env python __author__ = "Antonio Gonzalez Pena" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Antonio Gonzalez Pena"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Antonio Gonzalez Pena" __email__ = "[EMAIL]" from qiime.plot_semivariogram import hist_bins, fit_semiv...
class Node(object): __slots__ = ('name', 'path', 'local', 'is_leaf') def __init__(self, path): self.path = path self.name = path.split('.')[-1] self.local = True self.is_leaf = False def __repr__(self): return '<%s[%x]: %s>' % (self.__class__.__name__, id(self), s...
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ Pyste version %s Usage: pyste [options] interface-files where options are: ...
"""Config flow for ProgettiHWSW Automation integration.""" from ProgettiHWSW.ProgettiHWSWAPI import ProgettiHWSWAPI import voluptuous as vol from homeassistant import config_entries, core, exceptions from .const import DOMAIN DATA_SCHEMA = vol.Schema( {vol.Required("host"): str, vol.Required("port", default=80)...
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
#!/usr/bin/env python # # See top-level LICENSE file for Copyright information # # -*- coding: utf-8 -*- """ This script converts a LowRedux pixel flat into a PYPIT ready one """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_...
# Copyright 2014 - Mirantis, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # # 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) 2008 Giorgos Verigakis <[EMAIL]> # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE AUTHOR DI...
""" Base class(es) for all DataProviders. """ # there's a blurry line between functionality here and functionality in datatypes module # attempting to keep parsing to a minimum here and focus on chopping/pagination/reformat(/filtering-maybe?) # and using as much pre-computed info/metadata from the datatypes module as...
# (c) 2014, Toshio Kuratomi <[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. # # ...
# Python test set -- math module # XXXX Should not do tests around zero only from test.support import run_unittest, verbose, requires_IEEE_754 import unittest import math import os import sys import random import struct import sysconfig eps = 1E-05 NAN = float('nan') INF = float('inf') NINF = float('-inf') # detect ...
# !/usr/bin/python # This file is part of snavtofamix (Source Navigator to FAMIX). # # snavtofamix 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 ...
import chainer from chainer import backend from chainer.backends import cuda from chainer import function_node import chainer.functions from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn _algorithm = cuda.libcudnn.CUDNN_SOFTMAX_ACCURATE class Softmax(function_node.FunctionNode): ...
# Copyright (C) 2013-2014 The Debsources developers <[EMAIL]>. # See the AUTHORS file at the top-level directory of this distribution and at # https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD # # This file is part of Debsources. Debsources is free software: you can # redistribute it and/...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www....
import logging from graphql.language.ast import FragmentSpread, Variable class QueryCostException(Exception): pass log = logging.getLogger("graphapi") def _get_counts(info, fragments, variable_values): multiplier = 1 inner_multiplier = 0 if isinstance(info, FragmentSpread): for selection ...
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
import os.path import sys from config import BASEDIR from config import WHITE_SPACE from config import SQLALCHEMY_MIGRATE_REPO from database_operations import db_create, db_migrate from controller_generator import generate_controller from template_generator import generate_index_template from template_generator impor...
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from __future__ import absolute_import from grokcore.component import context from zope import schema from zope.component import provideSubscriptionAdapter from zope.interface import Interface, implements from opennode.knot.model.compute import Compute from opennode.knot.model.hangar import Hangar from opennode.oms.m...
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis, inplace_column_scale, ...
""" make file showing boundaries from parcellation """ import numpy,nibabel import nibabel.gifti.giftiio import os from myconnectome.utils import set_structure basedir=os.environ['MYCONNECTOME_DIR'] def mk_parcellation_boundaries(): lh=os.path.join(basedir,'parcellation/all_selected_L_new_parcel_renumbered.func...
# 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 # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
# -*- coding: utf-8 -*- import sys import os import re import urllib import urlparse import xbmc import xbmcgui import xbmcplugin import xbmcaddon import xbmcvfs if sys.version_info < (2, 7): import simplejson else: import json as simplejson # Import the common settings from resources.lib.settings import Sett...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from __future__ import absolute_import import argparse import pytest import os import sys is_python2 = sys.version_info[0] == 2 import bokeh.command.subcommands.json as scjson from bokeh.command.bootstrap import main from bokeh.util.testing import TmpDir, WorkingDir, with_directory_contents from . import basic_scat...
"""Demonstrates how to combine Struct with abstract base classes.""" from abc import ABCMeta, abstractmethod from simplestruct import Struct, Field, MetaStruct # A simple ABC. Subclasses must provide an override for foo(). class Abstract(metaclass=ABCMeta): @abstractmethod def foo(self): pass # ABCs...
import pprint import re import os from globalVars import base_vocab_ns from TropgeneParser import * __author__ = 'elhassouni' def tropGeneToRDF(tropGene_map, output_file): # The differentes variable declaration tropGene_buffer = '' # initilised the buffer at zero population_counter, mapefeature_counter, s...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from indico.modules.events.models.persons import EventPerson from...
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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;...
import os import base64 import logging import platform from datetime import date, timedelta from invoke import run, task # from elasticsearch import helpers # from dateutil.parser import parse # from six.moves.urllib import parse as urllib_parse # import scrapi.harvesters # noqa # from scrapi import linter # from sc...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- mode: python -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distr...
# coding=utf-8 from __future__ import unicode_literals from decimal import Decimal import sys from faker.providers.lorem.la import Provider as Lorem from .. import BaseProvider if sys.version_info[0] == 2: string_types = (basestring,) elif sys.version_info[0] == 3: string_types = (str, bytes) else: ra...