gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2011 OpenStack Foundation
# 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 compliance wi... | |
"""Support for Nexia / Trane XL Thermostats."""
from nexia.const import UNIT_CELSIUS
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
PERCENTAGE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
from .const import DOMAIN
f... | |
import operator
import math
from wydget import util
from wydget.widgets.label import Label
TOP = 'top'
BOTTOM = 'bottom'
LEFT = 'left'
RIGHT = 'right'
CENTER = 'center'
FILL = 'fill'
intceil = lambda i: int(math.ceil(i))
class Layout:
"""Absolute positioning layout -- also base class for other layouts.
E... | |
import unittest
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.base import BaseEstimator
from diogenes import utils
from diogenes import modify
import utils_for_tests as uft
class TestUtils(unittest.... | |
from binascii import hexlify
from datetime import datetime
from math import floor
from socket import inet_aton
from struct import unpack
from typing import Union, List, Dict, Any
TypeGeoDict = Dict[str, Any]
MODE_FILE = 0
MODE_MEMORY = 1
MODE_BATCH = 2
def chr_(val: Union[int, bytes]):
try:
return chr(v... | |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
import collections
import inspect
import json
import os
import sys
import time
from datetime import datetime, timedelta
from pprint import pprint
from apscheduler.schedulers.background import BackgroundScheduler
from pymongo import MongoClient
from steem import Steem
from steem.blockchain import Blockchain
from steem.... | |
'''Trains ACGAN on MNIST using Keras
This version of ACGAN is similar to DCGAN. The difference mainly
is that the z-vector of geneerator is conditioned by a one-hot label
to produce specific fake images. The discriminator is trained to
discriminate real from fake images and predict the corresponding
one-hot labels.
[... | |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | |
#! /usr/bin/env python
"""Grid element mappers that are specific to raster grids.
Mapping functions unique to raster grids
++++++++++++++++++++++++++++++++++++++++
.. autosummary::
~landlab.grid.raster_mappers.map_sum_of_inlinks_to_node
~landlab.grid.raster_mappers.map_mean_of_inlinks_to_node
~landlab.gr... | |
#!/usr/bin/env python
# encoding: utf-8
from ast import literal_eval
import codecs
import io
from nose.tools import *
from nose import SkipTest
import networkx as nx
from networkx.readwrite.gml import literal_stringizer, literal_destringizer
import os
import tempfile
try:
unicode
except NameError:
unicode = s... | |
"""Test ZHA Core channels."""
import asyncio
from unittest import mock
import pytest
import zigpy.profiles.zha
import zigpy.types as t
import zigpy.zcl.clusters
import homeassistant.components.zha.core.channels as zha_channels
import homeassistant.components.zha.core.channels.base as base_channels
import homeassistan... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AdvertPlacement'
db.create_table(u'demo_advertplacement',... | |
# Copyright (c) 2008-13, Walter Bender
# 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 -*-
from __future__ import absolute_import
import os
from rest_framework import status as http_status
import requests
from future.moves.urllib.parse import urljoin
import json
import waffle
from waffle.utils import get_setting
from flask import request
from flask import send_from_directory
from fl... | |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.request_token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the request token provider logic of
OAuth 1.0 RFC 5849. It validates the correctness of request token requests,
creates and persists tokens as well as create t... | |
"""
Matplotlib Exporter
===================
This submodule contains tools for crawling a matplotlib figure and exporting
relevant pieces to a renderer.
"""
import warnings
import io
from . import utils
import matplotlib
from matplotlib import transforms, collections
from matplotlib.backends.backend_agg import FigureCa... | |
# -*- coding: utf-8 -*-
#
# Apache Traffic Server documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 4 06:23:15 2013.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional ... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements various equation of states.
Note: Most of the code were initially adapted from ASE and deltafactor by
@gmatteo but has since undergone major refactoring.
"""
import logging
import warnings
from abc... | |
# -*- coding: utf-8 -*-
import unittest
from nose.tools import raises
from bauhinia.queues import *
class QueueTestCase(unittest.TestCase):
"""Creates a basic testcase to test different data structures.
"""
def setUp(self):
"""Does nothing
"""
pass
class QueueTest(QueueTestCase)... | |
import threading
import time
import random
import string
import requests
from abc import ABCMeta, abstractmethod
from oml4py import OMLBase
class Agent(threading.Thread):
__metaclass__ = ABCMeta
@abstractmethod
def define_measurements(self):
pass
@abstractmethod
def action(self):
... | |
"""
sentry.models.file
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from hashlib import sha1
from uuid import uuid4
from django.conf import settings
from django.core.files.base i... | |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | |
"""Class to perform under-sampling based on the edited nearest neighbour
method."""
from __future__ import print_function
from __future__ import division
import numpy as np
from collections import Counter
from scipy.stats import mode
from sklearn.neighbors import NearestNeighbors
from ..base import SamplerMixin
... | |
"""Support for IKEA Tradfri lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
PLATFORM_SCHEMA as LIGHT_PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_TRANSITION,
... | |
#!/usr/bin/env python
# encoding: utf-8
#===========================================================
#
# This file is part of PyOscope
#
# oscope.py
# 06-Sept-2011
#
# Copyright (c) 2011 Michael Hadmack (michael.hadmack@gmail.com)
# This code is distributed under the MIT license
#
# derived from PyUSBtmc, Copyright (c)... | |
"""
The :mod:`layer.layer` module provides the classes for data access and manipulation.
"""
import sys, math
from java import io
from java import net
from cursor import Cursor
from geoscript import core, geom, proj, feature
from geoscript.filter import Filter
from geoscript.util.data import readFeatures
from org.geoto... | |
# 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... | |
# TODO
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
from inspect import getargspec
from itertools import takewhile
from types import FunctionType
from diamond import event
from diamond.helper.weak_ref import Wrapper
from diamond.helper.ordered_set... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Items for the wireframe view
"""
import logging
import numpy as np
from OpenGL import GL
from OpenGL.GL import (
GL_BLEND,
GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA,
glEnable,
glDisable,
GL_LINE_SMOOTH,
GL_POLYGON_SMOOTH,
GL_LINE_SMOOTH_HI... | |
import sys
import json
from tkinter import filedialog
def getFiles(failedargs):
newfiles = []
if failedargs:
if failedargs == -1:
answer = input("""\
You didn't specify any files as input, would you like to continue? y/n
>""")
if answer in ["n", ""]:
raise S... | |
"""Fetch from conda database all available versions of the xarray dependencies and their
publication date. Compare it against requirements/py36-min-all-deps.yml to verify the
policy on obsolete dependencies is being followed. Print a pretty report :)
"""
import subprocess
import sys
from concurrent.futures import Threa... | |
#!/usr/bin/env python3
# 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.
import re
import textwrap
from style_variable_generator.opacity import Opacity
def split_args(arg_str):
'''Splits a string of ar... | |
#!/usr/bin/python
# $Id: SparqlQueryTestCase.py 1461 2010-10-02 15:55:16Z graham $
"""
Module to test simple queries against LGPN sample data
$Rev: 1461 $
"""
import os, os.path
import sys
import re
import unittest
import logging
import httplib
import urllib
try:
# Running Python 2.5 with simplejson?
import ... | |
# Copyright (c) 2012 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.
"""Class for running instrumentation tests on a single device."""
import logging
import os
import re
import sys
import time
from pylib import android_c... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Native Client 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 fnmatch
import glob
import optparse
import os
import shutil
import sys
import time
def IncludeFiles(filters, files):
... | |
"""Graphviz's dot language Python interface.
This module provides with a full interface to create handle modify
and process graphs in Graphviz's dot language.
References:
pydot Homepage: http://www.dkbza.org/pydot.html
Graphviz: http://www.research.att.com/sw/tools/graphviz/
DOT Language: http://www.research.att.com... | |
# Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from tcunittest import TeamcityTestRunner, TeamcityTestResult
from tcmessages import TeamcityServiceMessages
import sys
from pycharm_run_utils import adjust_django_sys_path
from django.test.utils import get_runner
adjust_django_sys_path()
from django.conf import settings
def is_nosetest(settings):
"""
Checks if ... | |
# Mrs
# Copyright 2008-2012 Brigham Young University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2018 (ita)
"""
Java support
Javac is one of the few compilers that behaves very badly:
#. it outputs files where it wants to (-d is only for the package root)
#. it recompiles files silently behind your back
#. it outputs an undefined amount of files (inn... | |
# -*- coding: utf-8 -*-
from collections import deque
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QGraphicsRectItem
from cadnano.gui.palette import getNoPen
from cadnano.proxies.cnenum import StrandEnum
from .pathextras import PreXoverItem
from . import (
PathNucleicAcid... | |
#Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import pandas as pd
from textblob import TextBlob
from time import strptime
import numpy as np
import re
import time
import zipcode
import sys, errno
from n... | |
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim
import maya.mel
import ctypes
import os
import sys
import shutil
from math import fabs
import subprocess
import threading
import sys
import time
import Queue
from maya import OpenMaya
print OpenMaya... | |
# Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
STATE_NOT_STARTED = "NOT_STARTED"
STATE_COIN_FLIPPED = "COIN_FLIPPED"
STATE_DRAFT_COMPLETE = "COMPLETE"
STATE_BANNING = "BANNING"
STATE_PICKING = "PICKING"
STATE_RESTRICTING = "RESTRICTING"
STATE_FIRST_ROUND_BANNING = "FIRST_ROUND_BANNING"
STATE_FIRST_ROUND_PICKING = "FIRST_ROUND_PICKING"
STATE_SECOND_ROUND_BANNING = ... | |
# Copyright 2017 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 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.
"""Module to implement the JSON-RPC protocol.
This module uses xmlrpclib as the base and only overrides those
portions that implement the XML-RPC protocol. ... | |
from collections import defaultdict
from hashlib import sha1
from lxml import etree
from sqlalchemy.exc import IntegrityError
from zeus.config import db, redis
from zeus.models import FileCoverage
from zeus.utils import sentry
from zeus.utils.diff_parser import DiffParser
from .base import ArtifactHandler
class Cov... | |
#
# soaplib - Copyright (C) Soaplib contributors.
#
# 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
# version 2.1 of the License, or (at your option) any later version.
#
# This l... | |
import wx
import sys
import os
from copy import deepcopy
from sas.sascalc.dataloader.loader import Loader
from sas.sascalc.dataloader.data_info import Data2D
from detector_editor import DetectorDialog
from collimation_editor import CollimationDialog
from console import ConsoleDialog
from sas.sasgui.guiframe.events i... | |
# -*- coding: UTF-8 -*-
from django.http import HttpResponse, HttpResponseBadRequest
from .myparser import *
from xml.etree.ElementTree import Element, tostring, fromstring
from django.utils import timezone
from django.db.models import Q
from django.db.models.query import QuerySet
from django.db import transaction
from... | |
# 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/env python2.7
# -*- coding: utf-8 -*-
"""
Bike Share Indigo Plugin
Author: DaveL17
Update Checker by: berkinet (with additional features by Travis Cook)
The Bike Share Plugin takes JSON data provided by services and makes it
available in Indigo. Users create individual devices that represent
bike dock stat... | |
from __future__ import print_function
import logging
import multiprocessing
from collections import defaultdict
import pybedtools
from defaults import MIN_INV_SUBALIGN_LENGTH, MIN_DEL_SUBALIGN_LENGTH
logger = logging.getLogger(__name__)
def get_insertion_breakpoints(age_records, intervals, expected_bp_pos, window=20... | |
# -*- 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 o... | |
from django.db import models
from uuidfield import UUIDField
from user import APIUser
from api_settings import settings
import os
class Author(APIUser):
"""
Extends the existing Django User model as reccomended in the docs.
https://docs.djangoproject.com/en/1.7/topics/auth/customizing/
"""
bio = m... | |
from rpython.rlib import jit
from rpython.jit.metainterp.test.support import LLJitMixin
@jit.dont_look_inside
def escape(x):
return x
class ImmutableFieldsTests:
def test_fields(self):
class X(object):
_immutable_fields_ = ["x"]
def __init__(self, x):
self.x =... | |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Point-and-shoot camera for Raspberry Pi w/camera and Adafruit PiTFT.
# This must run as root (sudo python cam.py) due to framebuffer, etc.
#
# Adafruit invests time and resources providing this open source code,
# please support Adafruit and open-source development by purc... | |
__author__ = 'juan'
# -*- coding: utf-8 -*-
import json
from termcolor import colored
import mysql.connector
import time
config = {
'user': 'elec',
'password': 'elec',
'host': 'thor.deusto.es',
'database': 'eu_test2',
}
class database:
def __init__(self):
self.con = mysql.connector.connec... | |
# Copyright 2016 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, ... | |
from __future__ import unicode_literals
import json
import os
import re
import shutil
import subprocess
import time
import random
from uuid import uuid4
from . import config
def download_video(self, media_id, filename=None, media=False, folder="videos"):
video_urls = []
if not media:
self.media_info... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.optim
from . import LegacyFairseqOptimizer, register_optimizer
@register_optimizer("adafactor")
clas... | |
# Copyright (c) 2021 PaddlePaddle 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 ap... | |
ARCGIS=False
try:
import arcpy
ARCGIS=True
except:
ARCGIS=False
import os
from osgeo import ogr
from osgeo import osr
import shutil
import tempfile
import logging
class Toolbox(object):
"""Some nasty ArcGIS class
"""
def __init__(self):
"""Define the toolbox (the name of the toolbox is... | |
from django.conf import settings
from django import template
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from classytags.core import Tag, Options
from classytags.arguments import Argument
import reviews
"... | |
# 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 agreed to in... | |
# 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 tensorflow as tf
import numpy as np
import random
import os
from gym.monitoring import VideoRecorder
import datetime
import csv
from drl.replaybuffer import ReplayBuffer
from drl.nn import NN
from drl.utilities import print_dict, color_print
# Algorithm info
info = {
'name': 'DQN'
}
class DQN_Options(obj... | |
# Copyright 2007 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 a... | |
# 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 unicode_literals
import unittest
from datetime import datetime
from django.core.paginator import (
EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
)
from django.test import TestCase
from django.utils import six
from .custom import ValidAdjacentNumsPaginator
from .models import Article... | |
#
# 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... | |
#!/usr/bin/env python
#
# Copyright (C) 2014 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 l... | |
"""
Copyright 2020 Google LLC
Copyright 2020 PerfectVIPs 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... | |
# -*- 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... | |
# yacon.utils.py
import logging, json, urllib, os, locale, re, time, tarfile
from datetime import datetime
from PIL import Image
from zipfile import ZipFile
from django.conf import settings
from django.http import Http404
from yacon import conf
logger = logging.getLogger(__name__)
locale.setlocale(locale.LC_ALL, '')... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import shutil
from tempfile import mkdtemp
from shutil import rmtree
import numpy as np
import nibabel as nb
from nipype.testing import (assert_equal, assert_not_equal,
... | |
# Copyright 2016 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 a... | |
# 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... | |
import configparser
import uuid
import os
import sys
import requests
import json
from queue import Queue
from ripple import Singleton, logger
from globus_sdk import (NativeAppAuthClient, TransferClient,
RefreshTokenAuthorizer)
class RippleConfig(object, metaclass=Singleton):
"""
Statef... | |
# 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
from cryptography import utils
from cryptography.exceptions import Invali... | |
# Copyright 2012 Nebula, 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 agree... | |
from __future__ import division, print_function, absolute_import
import os
from distutils.version import LooseVersion
import functools
import numpy as np
from numpy.testing import assert_
import pytest
import scipy.special as sc
__all__ = ['with_special_errors', 'assert_func_equal', 'FuncData']
#---------------... | |
import os
import sys
import tempfile
from io import BytesIO
import numpy as np
import pytest
import torch
import torchvision.transforms.functional as F
import torchvision.utils as utils
from common_utils import assert_equal
from PIL import Image, __version__ as PILLOW_VERSION, ImageColor
PILLOW_VERSION = tuple(int(x... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import os
import time
import redis
from functools import wraps
from frappe.utils import get_site_path
from frappe import... | |
#===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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 required by applicable law... | |
"""Support for HomematicIP Cloud lights."""
import logging
from homematicip.aio.device import (
AsyncBrandSwitchMeasuring, AsyncDimmer, AsyncPluggableDimmer,
AsyncBrandDimmer, AsyncFullFlushDimmer,
AsyncBrandSwitchNotificationLight)
from homematicip.base.enums import RGBColorState
from homeassistant.compo... | |
# This file is part of EAP.
#
# EAP 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 License, or (at your option) any later version.
#
# EAP is distributed in ... | |
# 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 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, print_function
import os
import sys
from contextlib import contextmanager
from distutils import sysconfig
from site import USER_SITE
import pkg_re... | |
# -*- coding: utf-8 -*-
#
# Copyright 2013 Simone Campagna
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
from __future__ import absolute_import, division, print_function
import time
import numpy as np
import os
import glob
import warnings
import json
from PIL import Image
from ..datasets import VOT
from ..utils.metrics import poly_iou
from ..utils.viz import show_frame
class ExperimentVOT(object):
r"""Experiment p... | |
"""
Unit tests for core app models.py.
"""
import pytz
from datetime import datetime, timedelta
from random import choice
from django.test import TestCase
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
from django.db.models.query import QuerySet
from django... | |
""" a panflute filter to find raw elements
and convert them to format agnostic Span elements
"""
import re
from typing import Union # noqa: F401
from panflute import Element, Doc, Cite, RawInline, Link # noqa: F401
import panflute as pf
from ipypublish.filters_pandoc.definitions import (
ATTRIBUTE_CITE_CLASS,
... | |
# 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 2021 The HuggingFace Inc. team.
#
# 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... | |
# 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 (c) 2013 Mirantis 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 writi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.