gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python2
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... | |
from collections import defaultdict
from hashlib import sha1
from itertools import chain
from operator import itemgetter
import os
from os import listdir
from funcy import merge, imap, autocurry
from dxr.filters import LINE
from dxr.indexers import (FileToIndex as FileToIndexBase,
TreeToInde... | |
import os
import json
import copy
import logging
import pprint
import stat
import tempfile
import glob
import urlparse
import pprint
from collections import Iterable
import errno
import shutil
import uuid
import abc
import schema_salad.validate as validate
import schema_salad.schema
from schema_salad.ref_resolver impo... | |
import os
from unittest import mock
from tornado.testing import AsyncTestCase, ExpectLog, gen_test
from remoteappmanager.docker.container import Container
from remoteappmanager.docker.docker_labels import SIMPHONY_NS_RUNINFO
from remoteappmanager.docker.container_manager import ContainerManager, \
OperationInProg... | |
from toontown.toonbase.ToontownGlobals import *
from toontown.toonbase.ToonBaseGlobal import *
from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from direct.distributed impor... | |
# 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... | |
# encoding: utf-8
from testcases import (
TestServerTestCase,
get_client
)
from django.core.management import call_command
from queryset_client.client import (
FieldTypeError,
ObjectDoesNotExist
)
from .utils import id_generator
class ModelTestCase(TestServerTestCase):
def setUp(self):
se... | |
from connection import Connection
from vec3 import Vec3
from event import BlockEvent
from block import Block
import math
from util import flatten
""" Minecraft PI low level api v0.1_1
Note: many methods have the parameter *arg. This solution makes it
simple to allow different types, and variable number of arg... | |
import pytest
from illuminate import *
MOCK_SERVER: str = 'mock.com'
MOCK_USER: str = 'mock'
MOCK_PASS: str = 'mock'
MOCK_INDICATOR: str = 'mock-indicator'
BASE_MOCK_JSON: dict = {
'type': 'domain',
'value': {
'name': f'{MOCK_INDICATOR}',
'classification': 'U'
},
'description': None,
... | |
#!/usr/bin/env python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free ... | |
# Copyright (C) 2016 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public Li... | |
# 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... | |
"""Implementation of python-orcid library."""
import simplejson as json
import requests
import sys
if sys.version_info[0] == 2:
from urllib import urlencode
string_types = basestring,
else:
from urllib.parse import urlencode
string_types = str,
SEARCH_VERSION = "/v1.2"
VERSION = "/v2.0_rc1"
__versio... | |
from mpl_toolkits.basemap import Basemap, cm
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.colors import LogNorm
from matplotlib.colors import Normalize
from osgeo import gdalconst
from PIL import Image, ImageFont, ImageDraw
import numpy as np
import matplotlib.pyplot as plt
import gdal
import sy... | |
from __future__ import division, print_function, absolute_import
import warnings
from numpy import finfo, sign, sqrt
from . import _zeros
_iter = 100
_xtol = 2e-12
_rtol = 4 * finfo(float).eps
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth']
CONVERGED = 'converged'
SIGNERR = 'sign error'
CONVERR = 'co... | |
import curses
from resources.digits import bigDigits,bigDigitsIndexes
NumericWidth = 142
class windowManager:
def __init__(self,stdscr):
curses.curs_set(0)
self.initializeColors()
self.initializeWindows(stdscr)
self.resizeWindows()
self.blinking = False;
def initializeCol... | |
'''Skype settings.
'''
import weakref
import sys
from utils import *
class ISettings(object):
'''Represents Skype settings. Access using L{ISkype.Settings<skype.ISkype.Settings>}.
'''
def __init__(self, Skype):
'''__init__.
@param Skype: Skype
@type Skype: L{ISkype}
'''
... | |
from django.db import models
import reversion
# Create your models here.
@reversion.register()
class Story(models.Model):
title = models.CharField(max_length=1024)
shortname = models.CharField(max_length=64)
def __str__(self):
return self.title
class StoryBased(models.Model):
story = models... | |
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler
from .permissioncommandhandler import PermissionCommandHandler
from .users import UserManager
from .conversations import ConversationManager, ConversationHandler
from .chats import ChatManager
from .blockdispatcher import BlockDispatcher
from thr... | |
import numpy as np
import mxnet as mx
import math
from mxnet.test_utils import *
# Common
def test_lr_wd_mult():
data = mx.sym.Variable('data')
bias = mx.sym.Variable('fc1_bias', lr_mult=1.0)
fc1 = mx.sym.FullyConnected(data=data, bias=bias, name='fc1', num_hidden=10, lr_mult=0)
fc2 = mx.sym.FullyConn... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, 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-... | |
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
from decimal impor... | |
from __future__ import absolute_import, unicode_literals
import json
import mock
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.contrib.wagtailapi import signal_handlers
from wagtail.wagtailimages import get_image_model
cla... | |
import sqlite3
import shutil
import glob
import json
import time
import logging
import os
from os.path import join
from itertools import chain
from .get_subreddit_submissions import GetSubredditSubmissions
# utility
from .general_utility \
import slugify, convert_to_readable_time, move_file, \
get_file_extens... | |
# 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... | |
"""
Django settings for composersCouch project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | |
'''
Helper functions
'''
from datetime import datetime as dt
from datetime import timedelta as td
import re
from InfluxThreader import InfluxThreader
import traceback
def getInfluxStr(**args):
try:
response = args['rsp']
except Exception as e:
pass
hostname = args['hst']
system = args['... | |
ground_truth = (
(
(
("workspace", "Workspace"),
("table", "Block"),
("dock-case", "DockCase"),
("dock-case_1", "Block"),
("dock-body", "DockDrawer"),
("dock-body_2", "DockFrontPanel"),
("dock-body_2_1", "Prism"),
("dock-body_2_2", "Block"),
("dock-body_2_3", "Block"),
("dock-body_4", "DockHandle")... | |
# Copyright 2019 Nexenta by DDN, 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 requ... | |
#!/usr/bin/python
###############################################################################################################
# This library is for using the Jetduino with Scratch
# http://www.NeuroRoboticTech.com/Projects/Jetduino ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# 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 itertools import chain
from subprocess import Popen as Popen, STDOUT, PIPE
from tempfile import TemporaryFile
from testfixtures.compat import basestring, PY3, zip_longest
from testfixtures.utils import extend_docstring
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock
class P... | |
"""
tests the pysat meta object and code
"""
import pysat
import pandas as pds
from nose.tools import raises
import pysat.instruments.pysat_testing
import numpy as np
class TestBasics():
def setup(self):
"""Runs before every method to create a clean testing setup."""
self.meta = pysat.Meta()
... | |
# noqa: D100, D101, D102
import datetime as dt
from pathlib import Path
from urllib.parse import urlparse
import dateutil.parser
from owslib.wps import ComplexDataInput
from ..utils import is_file, sanitize
def filter_case_insensitive(names, complete_list):
"""Filter a sequence of process names into a `known` ... | |
import uuid
import logging
from os import path
from datetime import datetime
from indra.statements import Agent, Statement, stmts_from_json
from indra.assemblers.html import HtmlAssembler
from indra.util.statement_presentation import group_and_sort_statements, \
make_string_from_relation_key, StmtGroup, make_stand... | |
'''
BSD 3-Clause License
Copyright (c) 2019, Donald N. Bockoven III
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 ... | |
# 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... | |
from flask import (
render_template, request, send_from_directory,
abort, jsonify, Response, redirect, url_for
)
import os
import uuid
from six import string_types
import logging
log = logging.getLogger(__name__)
from .bbauth import check_read_authentication_and_create_client
from ... import resources
from ... | |
"""
Channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
from concurrent.futures import TimeoutError as Timeout
from enum import Enum
from functools import wraps
import logging
from random im... | |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | |
# coding: utf-8
"""
This script identifies the structure of a given track using a modified version
of the C-NMF method described here:
Nieto, O., Jehan, T., Convex Non-negative Matrix Factorization For Automatic
Music Structure Identification. Proc. of the 38th IEEE International
Conference on Acoustics, S... | |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Pattern compiler.
The grammer is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
__author__ = "Guido van Rossum <guido@python.org>"
# Python imports
import os
# ... | |
"""Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import inspect
import warnings
import numpy as np
from scipy import sparse
from .externals import six
class ChangedBehaviorWarning(UserWarning):
pass
############################... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.org/... | |
import json
import logging
import os
import shutil
import time
from subprocess import Popen, PIPE
from urllib import parse
import requests
from flask import session
from son_editor.app.database import db_session, scan_project_dir, sync_project_descriptor
from son_editor.app.exceptions import NotFound, InvalidArgument... | |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | |
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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... | |
# Copyright 2013 OpenStack 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
#! /usr/bin/env python3
from sys import argv, stderr, stdout
from collections import defaultdict
import operator
def fix_casing(label):
if label == 'OTHER':
return label
label = label.lower()
return label[0].upper() + label[1:]
def print_err_mat(err_mat, sorted_errs, total_errors):
print('\... | |
# 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... | |
"""
Test the parallel module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import time
import sys
import io
import os
try:
import cPickle as pickle
PickleError = TypeError
except:
import pickle
PickleE... | |
from direct.actor import Actor
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import FSM
from direct.fsm import State
from direct.interval.IntervalGlobal import *
from direct.showbase.PythonUtil import Functor
from direct.task.Task import Task
from pandac.PandaModules import *
import string
import t... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# Copyright 2016 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, s... | |
"""Module for generating wepy systems"""
from copy import copy, deepcopy
import numpy as np
import simtk.openmm.app as omma
import simtk.openmm as omm
import simtk.unit as unit
import mdtraj as mdj
from wepy.util.mdtraj import mdtraj_to_json_topology
from wepy.util.json_top import (json_top_residue_fields,
... | |
import collections
import json
import os
import platform
import random
import string
import tkMessageBox
from Tkinter import *
from ttk import Progressbar
sys.path.append(os.getcwd() + '/bin')
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by impor... | |
import os
import json
from datetime import date
import calendar
import operator
class Player:
MAIN_CMP_FACTOR = "wlr"
def __init__(self, name):
self.name = name
self.gp = 0
self.w = 0
self.l = 0
self.otw = 0
self.otl = 0
self.gf = 0
self.ga = 0
... | |
"""
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import sys
import numpy as np
import scipy.sparse as sp
... | |
"""Serialization utilities."""
import codecs
import os
import pickle
import sys
from collections import namedtuple
from contextlib import contextmanager
from io import BytesIO
from .exceptions import (ContentDisallowed, DecodeError, EncodeError,
SerializerNotInstalled, reraise)
from .utils.co... | |
"""Some utils for SSD."""
import numpy as np
import tensorflow as tf
class BBoxUtility(object):
"""Utility class to do some stuff with bounding boxes and priors.
# Arguments
num_classes: Number of classes including background.
priors: Priors and variances, numpy tensor of shape (num_priors, ... | |
"""Example of Bayesian confirmatory factor analysis in "long form" and the factors are
estimated directly.
"""
from itertools import product
import numpy as np
import pandas as pd
import pymc3 as pm
import theano.tensor as tt
import matplotlib.pyplot as plt
from os.path import exists
from matplotlib import rcParams
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | |
# Copyright 2009-2014 MongoDB, 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 writin... | |
from __future__ import unicode_literals
from future.builtins import super
from datetime import timedelta
from django.contrib.auth.models import User
from django.contrib.messages import info, error
from django.shortcuts import get_object_or_404, redirect
from django.utils.timezone import now
from django.views.generic... | |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | |
from sqlalchemy import (
Boolean,
Column,
DateTime,
ForeignKey,
Integer,
Float,
String,
func,
or_,
)
from sqlalchemy.orm import relationship, backref
import logging
log = logging.getLogger(__name__)
from ..app import db
from .with_offsets import WithOffsets
class Place(db.Mode... | |
"""
Display stats about running Storm topologies.
"""
from __future__ import absolute_import, print_function
import sys
from itertools import chain
from pkg_resources import parse_version
from prettytable import PrettyTable
from six import iteritems
from six.moves import map, zip
from .common import add_environment... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
#!/usr/bin/env python
VERSION='1.02'
import os,sys
import re
import coral
from RecoLuminosity.LumiDB import argparse
class constants(object):
def __init__(self):
self.debug=False
self.runinfodb=''
self.runinfoschema='CMS_RUNINFO'
self.runsessionparameterTable='RUNSESSION_PARAMETER'
... | |
# Copyright 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 agre... | |
# Copyright (c) 2017, MD2K Center of Excellence
# 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 conditio... | |
# 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... | |
# Copyright (c) 2008 Divmod. See LICENSE for details.
"""
Tests for L{epsilon.amprouter}.
"""
import six
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.python.failure import Failure
from twisted.protocols.amp import IBoxReceiver, IBoxSender
from twisted.trial.unit... | |
#!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
"""The image module provides basic functions for working with images in nipy.
Functions are provided to load, save and create image objects, along with
iterators to easily slice through volumes.
load : load an image from a file
save : save an image to a file
fromarray : create an image from a numpy array... | |
from os.path import join,isfile,isdir
import re
import shutil
from spark_package.spark_package import licenses,register_package_http,check_homepage
import sys
if sys.version_info >= (3, 0):
from io import StringIO
else:
from StringIO import StringIO
import subprocess
import tempfile
import unittest
import zipfi... | |
'''
corcle.py
'Imagine super hexagon X two cars'
Nicholas Ruggles
'''
from __future__ import division
import pygame, sys, math, random, os, time, copy
from pygame.locals import *
FPS = 60
WINDOWWIDTH = 1000
WINDOWHEIGHT = 700
# R G B
DARKTURQUOISE = ( 3, 54, 73)
BLACK = ( 0, 0,... | |
#
# 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
# ... | |
from __future__ import unicode_literals
import mock
import os
import shutil
import subprocess
import tempfile
from django.conf import settings
from django.test import SimpleTestCase, override_settings
from semantic_version import Version
from systemjs.base import System, BundleError
from .helpers import mock_Popen
... | |
# -*- coding: utf-8 -*-
"""
This file is part of the PROPheT tool.
Copyright (C) 2016: MKLab <pmitzias@iti.gr; mriga@iti.gr; skontopo@iti.gr>
http://mklab.iti.gr/project/prophet-ontology-populator
https://github.com/MKLab-ITI/prophet
Licensed under the Apache License, Version 2.0 (the "License").
You may use this f... | |
"""Light platform support for yeelight."""
import logging
import voluptuous as vol
import yeelight
from yeelight import (
BulbException,
Flow,
RGBTransition,
SleepTransition,
transitions as yee_transitions,
)
from yeelight.enums import BulbType, LightType, PowerMode, SceneClass
from homeassistant.... | |
# coding=utf-8
# Copyright 2021 Google Health Research.
#
# 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 la... | |
from __future__ import print_function
import uuid
import random
import socket
import sys
import os
import traceback
from threading import Thread, Lock, Event
from multiprocessing.pool import ThreadPool
from contextlib import contextmanager
from datetime import datetime
from time import time, sleep
try:
import cPi... | |
#!/usr/bin/env python
#
#===- run-clang-tidy.py - Parallel clang-tidy runner ---------*- python -*--===#
#
# 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
#
#===---------... | |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# 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 right... | |
# yellowbrick.classifier.class_prediction_error
# Shows the balance of classes and their associated predictions.
#
# Author: Larry Gray
# Author: Benjamin Bengfort
# Created: Fri Jul 20 10:26:25 2018 -0400
#
# Copyright (C) 2018 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: class_pred... | |
# 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... | |
# A comprehensive implementation of Attention Mechanism for Neural Networks
# Supporting:
# * Multi-head attention
# * Self-attention mechanism
# * Using more odin.backend function to make it easier transfer between
# tensorflow and pytorch
#
# Some suggestion for designing attention-based model:
# * Attention F... | |
# 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... | |
import contextlib
import datetime
import functools
import mock
from django.http import HttpRequest
from django.utils import timezone
from nose import SkipTest
from nose.tools import assert_equal, assert_not_equal
from framework.auth import Auth
from framework.celery_tasks.handlers import celery_teardown_request
from ... | |
from SCons.Script import ARGUMENTS
import os
def noColors():
try:
return int(ARGUMENTS['colors']) == 0
except KeyError:
return False
def xterm_color(string, color):
colors = {'none': "0",
'black': "0;30",
'red': "0;31",
'green': "0;32",
... | |
# Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# POX is d... | |
#!/usr/bin/env python
# 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.
import os
import subprocess
import sys
import tempfile
import time
script_dir = os.path.dirname(__file__)
sys.path.append(os.path.... | |
# Copyright 2019 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 __future__ import (
absolute_import, division, print_function, unicode_literals
)
import json
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy a... | |
# Copyright 2020 Google 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
from salt.states import win_dism as dism
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,
patch
)
ensu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.