gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2011 Piston Cloud Computing, 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 # # Unle...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
# 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. import atexit import collections import contextlib import ctypes import logging import os import platform import re import socket import struct import subpro...
from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.db import models from django.test import TestCase from django.contrib.auth.models import User from django.utils.translation import get_language from django.utils.translation import trans_real from django.utils.threa...
"""Experiment access service.""" from decimal import Decimal import dacite from nptdms import TdmsFile from sqlalchemy import and_, create_engine, func from sqlalchemy.orm import sessionmaker from coimbra_chamber.access.experiment.models import ( Base, Experiment, Fit, Observation, Tube, Set...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2011, Nicolas Clairon # 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 abov...
from boto3 import Session from moto.core import BaseBackend from moto.core.utils import unix_time_millis from .exceptions import ( ResourceNotFoundException, ResourceAlreadyExistsException, InvalidParameterException, LimitExceededException, ) class LogEvent: _event_id = 0 def __init__(self, ...
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
#!/usr/bin/env python # # parttool is used to perform partition level operations - reading, # writing, erasing and getting info about the partition. # # Copyright 2018 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
import cffi f = cffi.FFI() f.cdef(""" typedef double cpFloat; typedef struct cpVect{cpFloat x,y;} cpVect; typedef void * cpDataPointer; static const cpVect cpvzero = {0.0f,0.0f}; typedef struct cpBody cpBody; /// Rigid body velocity update function type. typedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gra...
import pytest class SessionTests: def test_basic_testitem_events(self, testdir): tfile = testdir.makepyfile(""" def test_one(): pass def test_one_one(): assert 0 def test_other(): raise ValueError(23) class Test...
""" factor.py """ from operator import attrgetter from numpy import ( apply_along_axis, float64, nan, ) from scipy.stats import rankdata from zipline.errors import ( UnknownRankMethod, UnsupportedDataType, ) from zipline.modelling.term import ( CustomTermMixin, RequiredWindowLengthMixin, ...
#!/usr/bin/env python ################################################################################ # # # drmaa_wrapper.py # # Copyright (C) 2013 Leo Goodstadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software...
""" Placeholder file: translate equations from CAB's "Ramp mechanism_22May.xmcd" workup Calculates the forces required to open/close a ramp """ __author__ = 'ab27' import logging, os, sys import _winreg import numpy as np import matplotlib.pyplot as plt from matplotlib.tri import Triangulation from matplotlib.ticker...
#-*- coding: utf-8 -*- # Copyright 2010, 2011, 2012, 2013 Bastian Bowe # # This file is part of JayDeBeApi. # JayDeBeApi 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 3 of the # Licens...
import abc import re from collections import defaultdict, OrderedDict from kernel.IssuesModel import backlogIssuesModel as entryModel from kernel.IssuesWorkflow import issuesWorkflow as entryWorkflow from kernel import agileCalendar from kconfig import trackersBookByName, trackersBookByKey from kconfig import enablersB...
#!/usr/bin/env python # # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import colander from ichnaea.models import Radio from ichnaea.api.locate.locate_v2.schema import LOCATE_V2_SCHEMA from ichnaea.api.locate.tests.base import ( BaseLocateTest, CommonLocateErrorTest, CommonLocateTest, CommonPositionTest, ) from ichnaea.tests.base import ( AppTestCase, TestCase, ) ...
from __future__ import absolute_import from pychron.core.test_helpers import get_data_dir as mget_data_dir, dvc_db_factory __author__ = "ross" import os import unittest from pychron.core.ui import set_qt set_qt() from pychron.entry.loaders.irradiation_loader import XLSIrradiationLoader TEST_PARSE_XLS = False DEBU...
import os import sys import time import select import re import pty import tty import termios import errno import signal from contextlib import contextmanager import ptyprocess from ptyprocess.ptyprocess import use_native_pty_fork from .exceptions import ExceptionPexpect, EOF, TIMEOUT from .spawnbase import SpawnBase...
""" ''Author'': Atsushi Yamagishi ''File Name'': ellison_sim.py ''License'': MIT license I thank Daisuke Oyama for his guidance and helpful advice. This program can simulate the stochastic evolution model raised by G, Ellison(1993). The class of games this can handle is a symmetric game with n strategies. """ from _...
# -*- coding: iso-8859-1 -*- # Filename: dm3reader.py ################################################################################ ## Python script for parsing GATAN DM3 (DigitalMicrograph) files ## and extracting various metadata ## -- ## warning: *tested on single-image files only* ## -- ## based on the DM3_Rea...
"""Generative Adversarial Networks.""" from deepchem.models import TensorGraph from deepchem.models.tensorgraph import layers from collections import Sequence import numpy as np import tensorflow as tf import time class GAN(TensorGraph): """Implements Generative Adversarial Networks. A Generative Adversarial Ne...
import os import re import sys import unittest class TestDiscovery(unittest.TestCase): # Heavily mocked tests so I can avoid hitting the filesystem def test_get_name_from_path(self): loader = unittest.TestLoader() loader._top_level_dir = '/foo' name = loader._get_name_from_path('/fo...
# Copyright (c) 2016 Comcast Cable Communications Management, 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 a...
import warnings import numpy as np import numbers import collections from warnings import warn from scipy.sparse import csr_matrix from scipy.spatial.distance import cdist from menpo.transform import WithDims from .base import Shape def bounding_box(closest_to_origin, opposite_corner): r""" Return a boundi...
# Copyright (c) 2010, individual contributors (see AUTHORS file) # # Permission to use, copy, modify, and/or 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" ...
#!/usr/bin import probabilisticgraph as pg import graphgenerator as gg import dmarkov as dm import sequenceanalyzer as sa import yaml import matplotlib.pyplot as plt import synchwordfinder as swf def main(config_file, fsw=False, terminate=False, dmark=False, generate=False, gen_seq=False, an_seq=False, plot=False, ...
# # Copyright John Reid 2006 # from _biopsy import * def get_constant_score( h ): return 1.0 def _dist_str( self ): return \ '%(0)0.7f, %(1)0.7f, %(2)0.7f, %(3)0.7f' % { '0' : self.get( 0 ), '1' : self.get( 1 ), '2' : self.get( 2 ), ...
""" Regression tests for Model inheritance behavior. """ from __future__ import unicode_literals import datetime from operator import attrgetter from unittest import expectedFailure from django import forms from django.test import TestCase from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot, Pa...
#!/usr/bin/env python from __future__ import print_function, unicode_literals import inspect import os import re import sys scripts_dir = os.path.abspath(os.path.dirname(__file__)) rb_dir = os.path.abspath(os.path.join(scripts_dir, '..', '..')) sys.path.insert(0, rb_dir) sys.path.insert(0, os.path.join(scripts_dir,...
''' Created on 21 Mar 2013 @author: jafd ''' from collections import OrderedDict class BaseQuery(object): """ The base query which sets API. """ def __init__(self): self.clauses = {} self.bound_parameters = {} def __str__(self): return str(self.__unicode__()) ...
# filename: $heuristicShortName.py # automake heuristic, version 1.0 import os, commands, time, subprocess, log, re, sys heuristicShortName = "automake" heuristicName = "GNU Automake" heuristicVersion = "1.0" heuristicDesc = "This heuristic provides a means to build packages using the GNU Automake method" heuristic...
""" Project Name: Twitter Tagcloud Author: Alexandru Buliga Email: bugaaa92@gmail.com """ import sys import re import logging import json import redis from threading import currentThread, enumerate, Lock, Thread from collections import Counter, OrderedDict from datetime import datetime ...
import tensorflow as tf from networks.network import Network from fcn.config import cfg zero_out_module = tf.load_op_library('lib/triplet_flow_loss/triplet_flow_loss.so') class vgg16_flow_features(Network): def __init__(self, input_format, num_classes, num_units, scales, vertex_reg=False, trainable=True): ...
# -*- coding: utf-8 -*- # File: image.py import copy as copy_mod import numpy as np from contextlib import contextmanager from ..utils import logger from ..utils.argtools import shape2d from .base import RNGDataFlow from .common import MapData, MapDataComponent __all__ = ['ImageFromFile', 'AugmentImageComponent', '...
# Copyright 2013 Red Hat, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# Copyright 2016 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 ConfigParser import contextlib import Queue import base64 import collections import datetime import functools import httplib2 import json import multi...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
from __future__ import division, print_function # built-in libraries import logging import multiprocessing import os import pymongo import re import tqdm import warnings # third-party libraries import pandas import vcf # project libraries import VAPr.vcf_merging import VAPr.annovar_running import VAPr.filtering impo...
#!/usr/bin/python # Converts .json files from Translatewiki into .js files. # # Copyright 2013 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...
from datetime import date from workalendar.tests import GenericCalendarTest from workalendar.europe import CzechRepublic from workalendar.europe import Finland from workalendar.europe import Sweden from workalendar.europe import France, FranceAlsaceMoselle from workalendar.europe import Greece from workalendar.europe i...
# Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
# Copyright 2015 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. """Processes tests and creates new Anomaly entities. This module contains the ProcessTest function, which searches the recent points in a Test for potential...
# -*- coding: utf-8 -*- # # Copyright 2020-2021 BigML # # 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 ...
""" Python enumerations for use with Sublime API methods. In addition to the standard behavior, these enumerations' constructors accept the name of an enumerated value as a string: .. code-block:: python >>> DialogResult(sublime.DIALOG_YES) <DialogResult.YES: 1> >>> DialogResult("YES") <DialogResult.YES:...
# Copyright 2014-2015 Canonical Limited. # # This file is part of jujubigdata. # # jujubigdata is free software: you can redistribute it and/or modify # it under the terms of the Apache License version 2.0. # # jujubigdata is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the i...
from __future__ import unicode_literals import json from collections import namedtuple from django.conf.urls import include, url from django.core.exceptions import ImproperlyConfigured from django.db import models from django.test import TestCase, override_settings from rest_framework import permissions, serializers...
# 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...
# Copyright 2019 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import os import re from textwrap import dedent import pytest from pants.backend.python import target_types_rules from pants.backend.python.dependency...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Natural Language Toolkit: Combinatory Categorial Grammar # # Copyright (C) 2001-2011 NLTK Project # Author: Graeme Gange <ggange@csse.unimelb.edu.au> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import re from nltk import defaultdict from api import * #------------ # Regular expressions ...
# 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...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright 2015 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 logging import re import time from devil.android import device_errors from pylib import flag_changer from pylib.base import base_test_result from pyl...
# -*- coding: utf-8 -*- import pytest from framework.auth import Auth from api.base.settings.defaults import API_BASE from osf_tests.factories import ( AuthUserFactory, ProjectFactory, PrivateLinkFactory, OSFGroupFactory, ) from osf.models import NodeLog from osf.utils import permissions @pytest.fixtur...
from __future__ import print_function, division, absolute_import from datetime import datetime, timedelta import json import logging from multiprocessing import Process, Queue, queues import os import shutil import subprocess import sys import tempfile from time import time, sleep from tornado.ioloop import IOLoop fr...
#!/usr/bin/env python """Efficient compression of pkg installers. Use case: store multiple large .pkg with similar and overlapping content in one zip archive. Solution: a .pkg file is a XAR archive. A XAR archive contains: * a binary header * a gzip-compressed XML table of contents * the concatenated archived fil...
import numpy import os import random # Writes a collection of documents as a GOV2 collection if HTML documents. class HTMLWriter: def __init__(self): pass def on_file_enter(self, stream): self.stream = stream def on_document_enter(self, id): template = ( "<DOC>\n" ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
import collections import functools import json import marshmallow_jsonapi from marshmallow_jsonapi import fields from flask_jsonapi import api from flask_jsonapi import decorators from flask_jsonapi import resource_repository_views JSONAPI_HEADERS = {'content-type': 'application/vnd.api+json', 'accept': 'applicatio...
"""Base class for sparse matrix formats using compressed storage.""" from __future__ import division, print_function, absolute_import __all__ = [] from warnings import warn import operator import numpy as np from scipy._lib.six import xrange, zip as izip from .base import spmatrix, isspmatrix, SparseEfficiencyWarni...
"""Armature and armature animation export classes. @author Michael Reimpell """ # Copyright (C) 2005 Michael Reimpell # # This library 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 # versi...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from warnings import warn import collections import socket import json import urllib.request import urllib.error import urllib.parse import numpy as np import erfa from astropy import units as u from astropy import constants as consts from astropy.units...
# 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 list of conditions and the f...
#!/usr/bin/env python # SDL_DS3231.py Python Driver Code # SwitchDoc Labs 12/19/2014 # V 1.2 # only works in 24 hour mode # now includes reading and writing the AT24C32 included on the SwitchDoc Labs # DS3231 / AT24C32 Module (www.switchdoc.com #encoding: utf-8 # Copyright (C) 2013 @XiErCh # # Permission is hereb...
# Copyright 2007 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import pango import gtk import data_format import do...
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
# Copyright (c) 2020, DjaoDjin 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
"""The blocking connection adapter module implements blocking semantics on top of Pika's core AMQP driver. While most of the asynchronous expectations are removed when using the blocking connection adapter, it attempts to remain true to the asynchronous RPC nature of the AMQP protocol, supporting server sent RPC comman...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import datetime import ipaddress from asn1crypto.core import Integer, Se...
__author__ = 'root' import request_class; from db_mysql_module import SQLiteWraper; import traceback; import random; import time; import math; import threading; import concurrent.futures.thread as thread class proxypool(object): def __init__(self,username,password,host,dbname,loadpool=True,harfile=None): s...
# -*- coding: utf-8 -*- """Tests for core functions.""" from datetime import timedelta import json import pprint import zlib from io import BytesIO from unittest.mock import patch, Mock from urllib.parse import urlparse from click.testing import CliRunner import pytest from flask import request, session from flask_lo...
# 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...
import ConfigParser import StringIO import unittest import UserDict from test import test_support class SortedDict(UserDict.UserDict): def items(self): result = self.data.items() result.sort() return result def keys(self): result = self.data.keys() result.sort() ...
#!/usr/bin/env python3 # Copyright 2016-2018 Brian Warner # # 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...
# 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...
# Copyright 2013 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# 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...
from collections import namedtuple # Melissa import actions_db order_match_factor = 1.5 def query(text): """ Processes the text against the words.sqlite DB to identify which module and function can be best applied. Arguments: text -- user input, typically speech """ text_list = text.sp...
"""Test Z-Wave node entity.""" from unittest.mock import MagicMock, patch import pytest from homeassistant.components.zwave import const, node_entity from homeassistant.const import ATTR_ENTITY_ID import tests.mock.zwave as mock_zwave # Integration is disabled pytest.skip("Integration has been disabled in the manif...
#!/usr/bin/python import math from ctypes import * # Load the library for the CFitsio routines overseer = CDLL("/home/steven/Projects/galaxy_icd/libraries/liboverseer.so.0") def read_cat_fits(reffile): import pyfits hdulist = pyfits.open(reffile) tbdata = hdulist[1].data return tbdata def convert(in...
# coding: utf-8 from __future__ import print_function from datetime import datetime from jinja2.exceptions import TemplateNotFound import mkblogs from mkblogs import toc, utils from mkblogs.compat import urljoin, PY2 from mkblogs.build import html as parser from mkblogs.build import nav import jinja2 import json impo...
import cPickle as pkl import numpy as np import os, socket, time from collections import OrderedDict from scipy.misc import imsave from blocks.extensions import SimpleExtension from deepmonster import config floatX = config.floatX class EpochExtension(SimpleExtension): @property def epoch(self): retu...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
import re import logging from regexp import * logger = logging.getLogger(__name__) dump = logging.getLogger(__name__ + 'dump') fh = logging.FileHandler('simulations_discrard.log') formatter = logging.Formatter("%(asctime)s - %(name)s -\ %(levelname)s - %(message)s") fh.setFormatter(formatter) dump.addHandler(fh) dum...
import pygments import pygments.lexers from pygments.token import Token import PIL, PIL.Image, PIL.ImageFont, PIL.ImageDraw from PIL.ImageColor import getrgb import sys, os import subprocess, re font = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'font.pil') class StyleDict(dict): ''' Store color info...
# 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 ...
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Fujicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact bloc...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
# # 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 (c) 2016 Robert Wolterman # # 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, di...
# -*- coding: utf-8 -*- #!/usr/bin/env python from __future__ import unicode_literals __author__ = 'Dan Tracy' __email__ = 'djt5019 at gmail dot com' import os import logging from PySide import QtGui, QtCore from eplist.show_finder import ShowFinder from eplist.episode import Show, EpisodeFormatter from eplist.cac...
"""Tests for the Device Registry.""" import asyncio from unittest.mock import patch import asynctest import pytest from homeassistant.core import callback from homeassistant.helpers import device_registry from tests.common import mock_device_registry, flush_store @pytest.fixture def registry(hass): """Return an...
# 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. """Utility classes to handle sending and receiving messages.""" import struct import sys import weakref import mojo_bindings.serialization as serializatio...
#!/usr/bin/env python # encoding: utf-8 """ File: cloudforest/core.py Created by Nicholas G. Crawford and Brant C. Faircloth Copyright (c) 2011-2012 Nicholas G. Crawford and Brant C. Faircloth. All rights reserved. Description: Core functions for cloudforest """ import os import re import sys import shutil import ...
# 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...