gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from jsonschema import ValidationError import io import logging import os import pkg_resources import pytest from textwrap import dedent impo...
__all__ = ['imread', 'imsave'] import numpy as np from six import string_types from PIL import Image from ...util import img_as_ubyte, img_as_uint from ...external.tifffile import imread as tif_imread, imsave as tif_imsave def imread(fname, dtype=None, img_num=None, **kwargs): """Load an image from file. P...
# 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...
# -*- coding: utf-8 -*- from datetime import datetime import json from bson import ObjectId from flask import Blueprint, current_app, jsonify, request, Response, \ make_response from flask.ext.login import current_user, login_required from flask.ext.mail import Message from pymongo.errors import DuplicateKeyError im...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
# Copyright 2019 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 __future__ import print_function from __future__ import division from __future__ import absolute_import import collections import itertools import logg...
import time import pymongo import urllib2 import simplejson import praw import pytumblr import twython from songkick import * #setting up mongodb connection def connect_to_mongo(): client = pymongo.MongoClient() db = client.newonspotify global collection collection = db.albums #calling spotify API def get_api_da...
#!/usr/bin/env python # All the CFC relatd matlab code converted to python # Translated from matlab code by Mark Kramer (math.bu.edu/people/mak/MA666/) import numpy as np from scipy.signal import hilbert import matplotlib.pyplot as pl import mne from mne.filter import band_pass_filter def filter_and_make_analytic_s...
from sqlalchemy import util, schema, topological from sqlalchemy.sql import expression, visitors """Utility functions that build upon SQL and Schema constructs.""" class ClauseParameters(object): """Represent a dictionary/iterator of bind parameter key names/values. Tracks the original [sqlalchemy.sql#_BindP...
from nose.tools import assert_true, assert_equal, assert_raises from unittest import TestCase import numpy as np import numpy.linalg as npla import numbers from CrKr.crkr import CrKr class TestCrKr(TestCase): def setUp(self): self.S_2x3 = np.array([[1, 2, 3], [4, 5, 6]]) self.C_2x2 = np.array([[1...
#!/usr/bin/env python import numpy as np from pandas.io.data import get_quote_yahoo import json import locale locale.setlocale(locale.LC_ALL, '') class Portfolio(object): def __init__(self): self.ideal_allocation = {} self.stocks_owned = {} self.class_total = {} self.cash = 0.0 ...
#!/usr/bin/env python3 # Copyright (c) 2010 ArtForz -- public domain half-a-node # Copyright (c) 2012 Jeff Garzik # Copyright (c) 2010-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Bitcoin test...
# Copyright (c) 2012-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
''' Modular Input Script Copyright (C) 2012 Splunk, Inc. All Rights Reserved ''' import os,sys,logging import xml.dom.minidom, xml.sax.saxutils import time SPLUNK_HOME = os.environ.get("SPLUNK_HOME") sys.path.append(SPLUNK_HOME + "/etc/apps/snmp_ta/bin/pyasn1-0.1.6-py2.7.egg") sys.path.append(SPLUNK_HOME + "/etc/ap...
# 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...
""" pygments.lexers.int_fiction ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for interactive fiction languages. :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, \ th...
# Copyright 2015, A10 Networks # # 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...
import unittest from harparser import HAR class TestLog(unittest.TestCase): def test_json_scaffold_on_derived_classes(self): class derived(HAR.log): pass tmp = derived({ "version":"1.2", "creator":{"name":"MITMPROXY HARExtractor","version":"0.1","commen...
#!/usr/bin/env python """ @package mi.dataset.parser.ctdpf_ckl_wfp_sio_mule @file marine-integrations/mi/dataset/parser/ctdpf_ckl_wfp_sio.py @author cgoodrich @brief Parser for the ctdpf_ckl_wfp_sio dataset driver Release notes: Initial Release """ __author__ = 'cgoodrich' __license__ = 'Apache 2.0' import re impor...
import sys, gc, inspect from pympler import asizeof from datetime import datetime as dt from IPython import embed import numpy as np import theano from lasagne.objectives import * from lasagne.regularization import l1, l2 from lasagne.updates import * from theano import tensor as tensor from theano.compile.nanguardmod...
# coding: utf-8 from distutils.version import LooseVersion from dtest import Tester, debug, create_ks from tools.decorators import since from tools.jmxutils import make_mbean, JolokiaAgent, remove_perf_disable_shared_mem class TestCqlTracing(Tester): """ Smoke test that the default implementation for tracing...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
from __future__ import absolute_import import datetime import pytz from django.test import TestCase from schedule.conf.settings import FIRST_DAY_OF_WEEK from schedule.models import Event, Rule, Calendar from schedule.periods import Period, Month, Day, Year, Week from six.moves import range from six.moves import zip ...
import discord_logging from sqlalchemy.sql import func from classes.subscription import Subscription from classes.subreddit import Subreddit from classes.user import User from classes.notification import Notification log = discord_logging.get_logger() class _DatabaseSubscriptions: def __init__(self): self.sessio...
""" This module defines the mpf, mpc classes, and standard functions for operating with them. """ __docformat__ = 'plaintext' import re from string import strip from ctx_base import StandardBaseContext import libmp from libmp import (MPZ, MPZ_ZERO, MPZ_ONE, int_types, repr_dps, round_floor, round_ceiling, dps_...
#!/usr/bin/env python """ Matrix-vector multiplication using blocks of 256 threads (and global memory). It is designed for computing x = A.dot(b) where: A is "skinny-tall" b is a vector # of rows in A is large (e.g., numnber of pixels in an image) # of columns in A (or rows in b) is not too large (e...
"""The test for sensor device automation.""" import pytest import homeassistant.components.automation as automation from homeassistant.components.sensor import DOMAIN from homeassistant.components.sensor.device_condition import ENTITY_CONDITIONS from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN from homeass...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from collections imp...
""" LRU caches - LRUCache: base class. No constraints. Will grow indefinitely. - FixedSizeLRUCache: fixed number of entries in the cache. - MemSizeLRUCache: fixed amount of memory (according to getsize) Not thread safe. Could be made thread-save easily with a lock but that's overhead, and if we're not using multi-thr...
# 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 os import json # Import global settings to make it easier to extend settings. from django.conf.global_settings import * # Import the project module to calculate directories relative to the module # location. PROJECT_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..') PROJECT_ROOT, PROJEC...
#!/usr/bin/env python # this script: # 1) outputs each TE insertion call into new files based on family # 2) collapses TEs of same famly within 50 base pairs of one another # 3) outputs all the unqiue TE positions to a new file # 4) calculates the coverage for each sample at each insertion postion +/- 25 base pairs # 5...
# 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...
# Python Substrate Interface Library # # Copyright 2018-2021 Stichting Polkascan (Polkascan Foundation). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
"""Mongodb implementations of osid managers.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allowed in ...
"""Routine to "compile" a .py file to a .pyc file. This module has intimate knowledge of the format of .pyc files. """ import enum import importlib._bootstrap_external import importlib.machinery import importlib.util import os import os.path import sys import traceback __all__ = ["compile", "main", "PyCompileError",...
import os from typing import Any, Iterator, List, Optional, Tuple from django.conf import settings from zerver.lib.redis_utils import get_redis_client from zerver.models import UserProfile import redis import time import logging # Implement a rate-limiting scheme inspired by the one described here, but heavily mo...
#!/usr/bin/env python import sys import os import re import numpy from PIL import Image import StringIO # you need to install this library yourself # recent versions handle bigtiff too... import tifffile """ Extract pyramidal TIFF files with JPEG tiled storage into a tree of separate JPEG files into DZI compliant di...
# -*- 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...
# 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 agreed to in writing, ...
speakerdeck = { "endpoint": "https://speakerdeck.com/oembed.{format}", "urls": [ r'^https?://speakerdeck\.com/.+$', ], } app_net = { "endpoint": "https://alpha-api.app.net/oembed", "urls": [ r'^https?://alpha\.app\.net/[^#?/]+/post/.+$', r'^https?://photos\.app\.net/[^#?/]+/...
import numpy import random import string import cv2 from imageresolve.puzzlesolver.metrics.helper import * class Puzzle: def __init__(self, pieces, orig, x, y, videopath=None): maxx = x maxy = y self.xsize = maxx + 1 self.ysize = maxy + 1 self.pieces = pieces # solu...
"""This module provides plugins used in the hairball paper.""" from collections import defaultdict, Counter from hairball.plugins import HairballPlugin class Animation(HairballPlugin): """Plugin that checks for instances of 'complex animation'. Animation should include loops, motion, timing, and costume ch...
import warnings import numpy as np import pandas as pd import pandas.util.testing as tm try: from pandas.api.types import union_categoricals except ImportError: try: from pandas.types.concat import union_categoricals except ImportError: pass from .pandas_vb_common import setup # noqa cla...
from __future__ import absolute_import from __future__ import unicode_literals import functools import logging import ntpath import os import string import sys from collections import namedtuple import six import yaml from cached_property import cached_property from ..const import COMPOSEFILE_V1 as V1 from ..const i...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Metadata.annotation_area' db.add_column('images_metadata', 'annotation_area', self.gf('dja...
# -*- coding: utf-8 -*- # Copyright 2022 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011-2013 OpenStack, LLC # 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...
# 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 ...
""" Core components of Home Assistant. Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ import asyncio from concurrent.futures import ThreadPoolExecutor import datetime import enum import functools import logging import os import pathlib import threading from ...
# Copyright 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# This class is a subclass FoxySheepListener that rewrites the # parse tree generated by ANTLR4. It "flattens" flat operators that ANTLR # parses as left associative. from antlr4.RuleContext import RuleContext from antlr4.ParserRuleContext import ParserRuleContext from antlr4.tree.Tree import TerminalNodeImpl, ParseTr...
""" Fast image interpolation using a pyramid. """ from __future__ import print_function # TODO: This allows you to use "true" div (vs floordiv) in Python2 for the / operator; # unfortunately it appears to also replace the overloads we've carefully added for Halide. # Figure out if it's possible to allow this to leave...
# Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest import numpy as np import pandas as pd from pymatgen.core.structure import Molecule from pymatgen.io.vasp.inputs import Poscar from pymatgen.io.xyz import XYZ from pymatgen.util.testing import Pymat...
# -*- coding: utf-8 -*- import json import asyncio import aiohttp import datetime import time class Exchanges(): def __init__(self): header = { 'User-Agent': 'curl/7.35.0', 'Accept': '*/*'} self.session = aiohttp.ClientSession(headers=header) self.order_types = ["b...
import optparse import sys import re import string from pyang import plugin from pyang import statements paths_in_module = [] leafrefs = [] key = '' class_keywords = ["container", "list", "case", "choice", "augment"] servicepoints = ["servicepoint", "productpoint"] classnamecolor = " {0.113725, 0.352941, 0.670588}" ...
# file build system # # The purpose of this file is to load a system configuration # in the graphic data base # import json import redis from . import farm_template_py3 if __name__ == "__main__" : print( "constructing graph") cf = farm_template_py3.Construct_Farm() # # # Construct Systems # ...
import xml.etree.ElementTree as ET from pyposterous.error import PyposterousError from pyposterous.models import element_map, attribute_map class Parser(object): """This object is responsible for parsing the Pyposterous API data and returning nice Python objects.""" def __init__(self, api, resource,...
import copy import operator from functools import wraps, update_wrapper import sys from django.utils import six # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools.partial (on # CPython) is a type and its instances don't bind. def ...
# -*- encoding: utf-8 -*- __author__ = 'kotaimen' __date__ = '04/12/2016' from troposphere import Base64, FindInMap, GetAtt, Join, Select, Sub, Split from troposphere import ImportValue, Export from troposphere import Condition, And, Equals, If, Not, Or from troposphere import Template, Parameter, Ref, Tags, Output f...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import unittest from mock import Mock, patch from c7n_mailer import utils class FormatStruct(unittest.TestCase): def test_formats_struct(self): expected = '{\n "foo": "bar"\n}' actual = u...
import sys,os, pickle, numpy, pylab, operator, itertools import cv2 from shutil import copy as copyfile from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib.pyplot as plt from DataParseApp import dataparseDialog from sklearn.decomposition import NMF projectpath=os.path.split(os.path.abspath(__file__)...
from __future__ import absolute_import, unicode_literals from anyjson import loads from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.views import main as main_views from django.shortcuts import render_to_respon...
# Copyright (c) 2010-2012 OpenStack, 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 ...
# encoding: 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): # Deleting model 'GroupBallotPositionDocEvent' db.delete_table('doc_groupballotpositiondocevent') ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function import os import sys import numpy as np import matplotlib.pyplot as plt import george from george.kernels import ExpSquaredKernel, RBFKernel from ktransit import LCModel, FitTransit from scipy import optimize def ret_opt...
""" Base/mixin classes for the spatial backend database operations and the `SpatialRefSys` model the backend. """ import re from django.contrib.gis import gdal from django.utils import six class BaseSpatialOperations(object): """ This module holds the base `BaseSpatialBackend` object, which is instantiated...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit...
""" Handles routing and form processing for the PowerToken Flask app.\n Created by Jasmine Jones in 11/2017.\n Modified by Abigail Franz, J. Jones. Last on July 2019. """ import logging, sys logging.basicConfig(stream=sys.stderr, level=logging.INFO) from datetime import datetime import json from flask import redirect,...
# PyAlgoTrade # # Copyright 2011-2015 Gabriel Martin Becedillas Ruiz # # 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 ap...
""" CIF format file I/O operations. """ import shlex from datetime import date class CIF(object): def __init__(self, name="structure", file=None): self.name = name self._data = {} self._headings = {} self._element_labels = {} self.non_loops = ["data", "cell", "sym", "end"]...
"""Tests the changelog activity.""" import os from rever import vcsutils from rever.logger import current_logger from rever.main import env_main REVER_XSH = """ $ACTIVITIES = ['changelog'] $DAG['changelog'].kwargs = { 'filename': 'CHANGELOG.rst', 'ignore': ['TEMPLATE.rst'], 'news': 'nuws', } """ CHANGEL...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from indra.statements import * from indra.assemblers.cyjs import CyJSAssembler mek = Agent('MAP2K1', db_refs={'HGNC': '6840', 'TEXT': 'mek1'}) erk = Agent('MAPK1', db_refs={'UP': 'P28482'}) dusp = Agent('DUSP4') st_...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
""" Interval Arithmetic for plotting. This module does not implement interval arithmetic accurately and hence cannot be used for purposes other than plotting. If you want to use interval arithmetic, use mpmath's interval arithmetic. The module implements interval arithmetic using numpy and python floating points. The ...
import collections import copy import heapq import traceback import warnings import weakref import numpy import six import chainer from chainer import cuda from chainer import initializers from chainer.initializers import constant from chainer import utils from chainer.utils import argument def _check_grad_type(fun...
# flake8: noqa """ Tests for matcher base classes. """ import callee.base as __unit__ from tests import MatcherTestCase, TestCase class BaseMatcherMetaclass(TestCase): """Tests for the BaseMatcherMetaclass.""" def test_validate_class_definition(self): """Test for BaseMatcherMetaclass._validate_class_...
# -*- coding: utf-8 -*- # # 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 ...
# Copyright 2013 IBM Corp. # 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 app...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import tempfile from wsgiref.util import FileWrapper from django import forms from django.conf.urls import url from django.contrib import admin from django.contrib.admin import BooleanFieldListFilter from django.contrib.admin.views.main import ...
#!/usr/bin/python # -*- coding: utf-8 -*- import pandas as pd import unittest import warnings class TestConfig(unittest.TestCase): _multiprocess_can_split_ = True def __init__(self, *args): super(TestConfig, self).__init__(*args) from copy import deepcopy self.cf = pd.core.config ...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 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 processing of unrequested blocks. Since behavior differs when receiving unrequested blocks from w...
""" This script has been used to compute the Neumann results of the paper On efficient Chebyshev-Galerkin methods for second-order equations The results have been computed using Python 3.9 and Shenfun 3.2.2. The results have been computed with the Numba optimization you get by calling this script with argument --...
""" Provides functionality for mailboxes. For more details about this component, please refer to the documentation at https://home-assistant.io/components/mailbox/ """ import asyncio from contextlib import suppress from datetime import timedelta import logging from aiohttp import web from aiohttp.web_exceptions impor...
from lib import log from lib.log import exception, warning from version import VERSION_FOR_BUG_REPORTS from paths import CLIENT_LOG_PATH log.set_version(VERSION_FOR_BUG_REPORTS) log.add_secure_file_handler(CLIENT_LOG_PATH, "w") log.add_http_handler("http://jlpo.free.fr/soundrts/metaserver") log.add_console_handler() i...
# 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...
"""Provides functionality to interact with lights.""" from __future__ import annotations from collections.abc import Iterable import csv import dataclasses from datetime import timedelta import logging import os from typing import cast, final import voluptuous as vol from homeassistant.config_entries import ConfigEn...
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
# -*- coding: utf-8 -*- #MIT License #Copyright (c) 2017 Marton Kelemen #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, c...
import demistomock as demisto from CommonServerPython import * from datetime import timezone from typing import List, Dict, Any import json import requests # Disable insecure warnings requests.packages.urllib3.disable_warnings() class Client(BaseClient): """ Client will implement the service API, and shoul...
# -*- coding: utf-8 -*- # Copyright 2014 Google Inc. All Rights Reserved. """Table format resource printer.""" import cStringIO import json import operator import os from googlecloudsdk.core import log from googlecloudsdk.core.console import console_attr from googlecloudsdk.core.resource import resource_printer_base...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, NodeFactory, ) from website.util import permissions @pytest.fixture() def user(): return AuthUserFactory() @pytest.fixture() def read_only_user(): ...
#!/usr/bin/env python import sys # Usage: # # #Create object # your_map = EECSMap() # # #Use Object (examples) # your_map.printObstacleMap() # your_map.clearObstacleMap() # your_map.printCostMap() # your_map.setObstacle(3, 4, 1, DIRECTION.North) # isBlocked = your_map.getObstacle(3, 4, DIRECTION.North) # cell_cost = y...
# Copyright (c) 2006-2021 Andrey Golovizin # # 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, publi...
"""Test an Edition that tracks LSST document releases (``lsst_doc``).""" from __future__ import annotations from typing import TYPE_CHECKING from keeper.testutils import MockTaskQueue if TYPE_CHECKING: from unittest.mock import Mock from keeper.testutils import TestClient def test_lsst_doc_edition(client...
# 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 ...
import os import base64 from cryptography.hazmat.backends import default_backend import cryptography.hazmat.primitives.hashes as c_hashes import cryptography.hazmat.primitives.asymmetric.rsa as c_rsa import cryptography.hazmat.primitives.asymmetric.padding as c_padding import cryptography.hazmat.primitives.serializat...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function __metaclass__ = type # Copyright 2018 Palo Alto Networks, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...