gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# 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 ... | |
import binascii
import os
from django.contrib.auth.models import Group, User
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fields import ArrayField
from django.core.validators import MinLengthValidator
from django.db import models
from django.db.models import Q
from django.db.... | |
"""
Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
import asyncio
from datetime import timedelta
import logging
import os
from typing import Any, Sequence, Callable
import voluptuous a... | |
# Copyright 2015 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 writing, so... | |
from __future__ import unicode_literals
import json
from django.test import TestCase
from rest_framework import fields as drf_fields
from rest_framework.compat import unicode_repr
from rest_framework_mongoengine.serializers import (
DocumentSerializer, DynamicDocumentSerializer, EmbeddedDocumentSerializer
)
fro... | |
# 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 (c) 2014 OpenStack Foundation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# Copyright (c) 2014 OpenStack Foundation, all rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['figure.figsize'] = (12,8)
import pylab as plt
from astrometry.libkd.spherematch import *
from astrometry.util.fits import *
from astrometry.util.multiproc import multiproc
import numpy as np
from astrometry.util.starutil_... | |
import os
from numpy import loadtxt,array,ones,dot,floor,zeros
from qmcpack_input import QmcpackInput
from qaobject import QAobject
from qmcpack_analyzer_base import QAanalyzer
from developer import unavailable
from debug import *
try:
from matplotlib.pyplot import plot,show,figure,xlabel,ylabel,title,legend
exce... | |
import subprocess, atexit, os, sys, time, random, socket, signal, inspect
import multiprocessing.connection
try:
import cPickle as pickle
except ImportError:
import pickle
from .remoteproxy import RemoteEventHandler, ClosedError, NoResultError, LocalObjectProxy, ObjectProxy
from ..Qt import USE_PYSIDE
from ..u... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 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 the fundrawtransaction RPC."""
from decimal import Decimal
from test_framework.test_framework imp... | |
"Implements ConstraintSet"
from collections import defaultdict
import numpy as np
from ..small_classes import HashVector, Numbers
from ..keydict import KeySet, KeyDict
from ..small_scripts import try_str_without
from ..repr_conventions import _str, _repr, _repr_latex_
def add_meq_bounds(bounded, meq_bounded):
"I... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for color conversion functions.
Authors
-------
- the rgb2hsv test was written by Nicolas Pinto, 2009
- other tests written by Ralf Gommers, 2009
:license: modified BSD
"""
from __future__ import division
import os.path
import numpy as np
from numpy.testing im... | |
'''
************************************************************************
FOR THE TIME BEING WHATEVER MODIFICATIONS ARE APPLIED TO THIS FILE
SHOULD ALSO BE APPLIED TO sdk_upgrade IN ANY OTHER PARTNER REPOS
************************************************************************
'''
import json
import logging
import ... | |
import nibabel as nib
import numpy as np
import logging
from time import time
import os.path as op
from AFQ.definitions.utils import Definition, find_file
from dipy.align import syn_registration, affine_registration
import AFQ.registration as reg
import AFQ.data.s3bids as afs
from AFQ.tasks.utils import get_fname
fro... | |
# -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""This is a web-server which integrates with the twisted.internet
infrastructure.
"""
# System Imports
import string
import types
import operator
import copy
import time
import os
... | |
"""Tests for the Huawei LTE config flow."""
from unittest.mock import patch
from huawei_lte_api.enums.client import ResponseCodeEnum
from huawei_lte_api.enums.user import LoginErrorEnum, LoginStateEnum, PasswordTypeEnum
import pytest
from requests.exceptions import ConnectionError
from requests_mock import ANY
from ... | |
"""
Functions for reading and writing spherical harmonic coefficients from text
files that are formatted as [degree, order, value].
"""
import os as _os
import io as _io
import gzip as _gzip
import zipfile as _zipfile
import numpy as _np
import requests as _requests
import shutil as _shutil
def read_dov(filename, lma... | |
import warnings
import numpy as np
import pandas as pd
from numpy.core.multiarray import normalize_axis_index # type: ignore[attr-defined]
from .options import OPTIONS
try:
import bottleneck as bn
_USE_BOTTLENECK = True
except ImportError:
# use numpy methods instead
bn = np
_USE_BOTTLENECK = F... | |
"""
Data context classes.
Model classes that handle persistence and storage.
Jobs and Job represent job storage and individual jobs, respectively.
Job data is controlled by the schemas in ecs_scheduler.serialization module.
All job loading and storing exceptions inherit from JobError.
"""
import collections.abc
impor... | |
from __future__ import print_function
from .prox_fn import ProxFn
from proximal.lin_ops import CompGraph, mul_elemwise
import numpy as np
import numexpr as ne
from proximal.utils.utils import Impl, fftd, ifftd
from scipy.sparse.linalg import lsqr, LinearOperator
from proximal.halide.halide import Halide
class sum_squ... | |
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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
... | |
# 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 ... | |
"""
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
# Important note for the deprec... | |
# -*- coding: utf-8 -*-
"""
odeExample - example of integration of ordinary differential equations in the
form of an understandable physical system that can be visualized
by middle and high school students
Equations of motion of a mass-spring-damper hanging form the ceiling
Defi... | |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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... | |
# 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... | |
#!/usr/bin/env python
#
# The MIT License (MIT)
#
# Copyright (c) 2015 msims04
#
# 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
#... | |
# -*- coding: utf-8 -*-
"""
Parser steps used in the domain-specific language for building up flowmaps.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import itertools
from collections import Counter, namedtuple
from toposort import toposort_flatten... | |
from __future__ import unicode_literals
from __future__ import absolute_import
from . import util
from . import odict
def build_treeprocessors(md_instance):
""" Build the default treeprocessors for Markdown. """
treeprocessors = odict.OrderedDict()
treeprocessors["inline"] = InlineProcessor(md_instance)
... | |
# Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
# Copyright 2015 The 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 numpy as np
import pyqtgraph as pg
import copy
from ..utilities import colors
from ..fitting.filling_table_handler import FillingTableHandler
from .selected_bin_handler import SelectedBinsHandler
from ..utilities.pyqrgraph import Pyqtgrah as PyqtgraphUtilities
from .. import DataType
from . import FittingTabSel... | |
import matplotlib.pyplot as plt
import numpy as np
from sklearn import preprocessing, cluster
wineData = np.array([
[14.23, 1.71, 2.43, 15.6, 127, 2.8, 3.06, .28, 2.29, 5.64, 1.04, 3.92, 1065],
[13.2, 1.78, 2.14, 11.2, 100, 2.65, 2.76, .26, 1.28, 4.38, 1.05, 3.4, 1050],
[13.16, 2.36, 2.67, 18.6, 101, 2.8, ... | |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
## -----------------------------------
## PubNub 3.0 Real-time Push Cloud API
## -----------------------------------
tr... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from fabric.api import *
from fabric.contrib.files import *
import random
import string
import common.ConfigFile
import common.Services
import common.Utils
from common.Utils import *
from common.ConfigFile import *
symfony_version = ''
console_location = ''
@task
@roles('app_primary')
def backup_db(repo, buildtype, b... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for various parts of L{twisted.web}.
"""
from cStringIO import StringIO
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.internet import reactor
from ... | |
# Copyright (c) 2015 OpenStack Foundation.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Fo... | |
def _read_and_write(raw_file_route, pipe_file_route, pairs):
raw_file = open(raw_file_route, 'r')
js_file = open(pipe_file_route, 'w')
desc_dict = {}
codes = []
for line in raw_file:
line = line.strip()
code = line[pairs[0][0] - 1:pairs[0][1]].strip()
codes.append(code)
... | |
# -*- coding: utf-8 -*-
from collections import OrderedDict
import mock
from rest_framework.settings import api_settings
from waffle.testutils import override_switch
from olympia import amo
from olympia.amo.templatetags.jinja_helpers import absolutify
from olympia.amo.tests import TestCase, addon_factory, reverse_ns... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import sys
import json
from xiami_downloader import __version__, core, http
from xiami_downloader._compat import (
binary_type,
ensure_binary,
ensure_text,
htmlparser,
request,
text_type,
URLError,
)
from xia... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import os
import unittest
import time
import jwt
from elasticsearch import Elasticsearch, NotFoundError
from os_package_registry import PackageRegistry
from ..config import LOCAL_ELASTICSEARCH
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
from importlib import impo... | |
import pytest
from io import StringIO
import pandas as pd
from numpy import allclose, int64, float64
from epic.cluster.cluster import trunks_flanks_valleys
@pytest.fixture
def merged_matrix():
c = u"""Chromosome Bin TotalEnriched A B
chr1 0 1.0 1.0 0.0
chr1 200 1.0 1.0 0.0
chr1 400 1.0 0.0 1.0
chr1 800 1.0 0.... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the encoded stream file-like object."""
import os
import unittest
from dfvfs.file_io import encoded_stream_io
from dfvfs.file_io import os_file_io
from dfvfs.lib import definitions
from dfvfs.path import encoded_stream_path_spec
from dfvfs.path import os_path_spe... | |
from guizero import App, Waffle
from threading import Event
from unittest.mock import MagicMock
from common_test import (
schedule_after_test,
schedule_repeat_test,
destroy_test,
enable_test,
display_test,
color_test,
events_test,
cascaded_properties_test,
inherited_properties_test,
... | |
# 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 ... | |
from copy import copy
from corehq.apps.reports.models import TableauVisualization, TableauServer
from functools import partial
from django.utils.translation import ugettext as _
from django.db import transaction
from corehq.apps.data_interfaces.models import (
AutomaticUpdateRule, CaseRuleAction, CaseRuleCriteria... | |
__author__ ='Rahul Chatterjee'
import os, sys, json, csv
import string, re
import unittest, string
from collections import defaultdict
from .correctors import fast_modify, EDITS_NAME_FUNC_MAP
from pwmodel import HistPw, NGramPw
# import heapq
from .common import (PW_FILTER, DATA_DIR_PATH,
get_most_... | |
import scipy
import scipy.optimize
import scipy.linalg
import numpy as np
import sys
import warnings
import simulation
import utils
# Different optimization modes.
ABSOLUTE_AT_LEAST = 0 # Use absolute error (error only when there are traits missing).
ABSOLUTE_EXACT = 1 # Use absolute error (1-norm).
QUADRAT... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
import pyro
import pyro.distributions as dist
from pyro.distributions.stable import _standard_stable, _unsafe_standard_stable
from pyro.infer.util import is_validation_enabled
from .reparam import Repara... | |
from sqlalchemy import create_engine,desc
from sqlalchemy.orm import sessionmaker
import click
from datetime import datetime
from termcolor import cprint
from prettytable import PrettyTable
from models.models import Base,Student,Class,TrackStudent
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm.exc imp... | |
# 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 ... | |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | |
# 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 __future__ import unicode_literals
import os
from unittest import skipUnless
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import Node
from django.template.library import InvalidTemplateLibrary
from django.test import SimpleTestCase
from django.test.utils import exten... | |
#!/usr/bin/env ambari-python-wrap
"""
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... | |
#!/usr/bin/env python
#
# smg_input - Module to read in an SMG file and create a State Machine for it
#
# This module is a subsidiary module to the primary smg.py module. This
# module is called to read and parse the input smg file.
#
# Copyright (c) 2000-2002, Kevin Quick
# All Rights Reserved
# See the LICENSE file... | |
import asyncio
import copy
import random
from functools import partial
import asyncpg
import discord
from discord.ext import commands
from .utils import db, disambiguate
from .utils.context_managers import temp_attr
from .utils.misc import str_join
class Selfroles(db.Table):
id = db.Column(db.Serial, primary_ke... | |
from argparse import ArgumentParser
ap = ArgumentParser()
ap.add_argument('-ns' , '--n_resamp' , required=False, type=int , default=1 , help="Number of resamples to perform (GBR=1; No Resamp=0)")
ap.add_argument('-nt' , '--n_trees' , required=False, type=int , default=100 , help="Number of trees in the fores... | |
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import logging
from calendar import timegm, monthrange
from datetime import datetime
import numpy as np
from nexustiles.nexustiles import NexusTileService
from webservice.NexusHandler import nexus_handler, S... | |
import os.path as osp
from cPickle import dump
from datetime import datetime
from itertools import product
from time import time
import numpy as np
from imblearn.under_sampling import RandomUnderSampler
from sklearn.decomposition import PCA
from sklearn.externals.joblib import Parallel, delayed
from sklearn.metrics im... | |
# 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
# distribu... | |
#
# 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
# distributed under ... | |
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict, Set
import voluptuous as vol
from homeassistant import core, config as conf_util, c... | |
# 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 ... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Vehicle Model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
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 witho... | |
import json
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, render
from django.template import RequestContext
from crits.core.handlers import get_item_na... | |
from rospy.rostime import Time
import rospy
from python_qt_binding.QtCore import QTranslator
from abstract_item import AbstractItem
from helper_functions import prepare_number_for_representation, UPDATE_FREQUENCY, TOPIC_AGGREGATION_FREQUENCY, \
ROUND_DIGITS, MAXIMUM_OFFLINE_TIME
from arni_core.helper import SEUID... | |
import time
import requests
from features.src.support import helpers
from pyshould import should
import os
import json
start_time = time.time()
cheApiAddress = os.getenv("CHE_API")
apiAddress = os.getenv("WIT_API")
githubRepoUrl = os.getenv("GIT_REPO_URL")
class Workspace:
# Query the deleted workspace - shoul... | |
# -*- coding: utf-8 -*-
"""
channle.py
"""
import logging
from datetime import datetime
from mws import mws
from lxml import etree
from lxml.builder import E
from dateutil.relativedelta import relativedelta
from trytond.model import ModelView, fields
from trytond.wizard import Wizard, StateView, Button
from tryto... | |
import tkinter as tk
from tkinter import ttk
from analytical import *
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
#global Variables for every instance
SCT = Scatterer()
ICONST = 1
LARGE_FONT = ("Verdanna", 12)
#CONVINENCE CLASSES FOR R... | |
# Copyright 2016 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright (c) 2011 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 in wr... | |
# coding: utf-8
#
# Copyright 2015 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 requi... | |
import numpy as np
from scipy.stats import skew, kurtosis, shapiro, pearsonr, ansari, mood, levene, fligner, bartlett, mannwhitneyu
from scipy.spatial.distance import braycurtis, canberra, chebyshev, cityblock, correlation, cosine, euclidean, hamming, jaccard, kulsinski, matching, russellrao, sqeuclidean
from sklearn.p... | |
import datetime
import json
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.forms.formsets import formset_factory
from django.shortcuts import get_object_or_404, redirect
from django.utils.datastructures import MultiValueDictKeyError
fro... | |
"""Implements the setuptools command 'antlr'."""
import collections
import datetime
import distutils.errors
import distutils.log
import distutils.version
import os.path
import pathlib
import re
import shutil
import shlex
import subprocess
import typing
import setuptools
from setuptools_antlr import __path__
from setu... | |
"""Helpers to help coordinate updates."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from datetime import timedelta
import logging
from typing import Any
from aiohttp import ServerDisconnectedError
from pyoverkiz.client import OverkizClient
from pyoverkiz.enums import EventName... | |
from __future__ import unicode_literals
import calendar
import datetime
from functools import reduce
from itertools import groupby
import logging
from flask_appbuilder._compat import as_unicode
from flask_babel import lazy_gettext as _
from .. import const as c
log = logging.getLogger(__name__)
def aggregate(labe... | |
# Copyright 2014: Mirantis 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 b... | |
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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... | |
# -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa (PEP8 asserts)
from framework.auth import Auth
from website.addons.dropbox.model import (
DropboxUserSettings, DropboxNodeSettings
)
from tests.base import OsfTestCase, DEFAULT_METASCHEMA
from tests.factories import UserFactory, ProjectFactory
f... | |
"""basic tests of lazy loaded attributes"""
from sqlalchemy import testing
from sqlalchemy.orm import immediateload
from sqlalchemy.orm import relationship
from sqlalchemy.testing import eq_
from sqlalchemy.testing.fixtures import fixture_session
from test.orm import _fixtures
class ImmediateTest(_fixtures.FixtureTe... | |
#
# UAVCAN DSDL compiler for libuavcan
#
# Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
#
'''
This module implements the core functionality of the UAVCAN DSDL compiler for libuavcan.
Supported Python versions: 3.2+, 2.7.
It accepts a list of root namespaces and produces the set of C++ header files for ... | |
import pickle
from lasagne.layers import ConcatLayer
from lasagne.layers import DenseLayer
from lasagne.layers import InputLayer
from lasagne.layers import Layer
from lasagne.nonlinearities import identity
from lasagne.nonlinearities import softmax
from lasagne.objectives import categorical_crossentropy
from lasagne.u... | |
# 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 time
import web
from weasyl import (
character, collection, commishinfo, define, errorcode, favorite, folder,
followuser, frienduser, journal, media, profile, shout, submission,
template, pagination)
from weasyl.controllers.base import controller_base
from weasyl.error import WeasylError
from weasy... | |
"""Support for performing TensorFlow classification on images."""
import logging
import os
import sys
import voluptuous as vol
from homeassistant.components.image_processing import (
CONF_CONFIDENCE,
CONF_ENTITY_ID,
CONF_NAME,
CONF_SOURCE,
PLATFORM_SCHEMA,
ImageProcessingEntity,
draw_box,
... | |
# -*- coding: utf-8 -*-
"""Unittest module for XML testing purpose."""
from __future__ import unicode_literals
import io
import unittest
from lxml import etree
from lxml.doctestcompare import PARSE_XML, LXMLOutputChecker
from lxml.etree import XMLSyntaxError, XPathSyntaxError
__all__ = ['XmlTestMixin', 'XmlTestCase'... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | |
# exdoc_support_module_1.py
# Copyright (c) 2013-2019 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0411,R0205,R0903,W0107,W0613
import decorator
import pexdoc.exh
import pexdoc.pcontracts
import tests.support.trie
import tests.support.exdoc_support_module_2
###
# Module functions
###
de... | |
"""
Name: core.py
Description: It implements the select and epoll based reactors and the most basic events.
"""
from select import *
from usual import Root, Kill
from socket import *
# Whenever we use get_event it increases
# So we don't get events messed.
event_count = 0
rmap = lambda obj: obj.base.get(READ)
... | |
from __future__ import unicode_literals
import csv
import pytz
from furl import furl
from datetime import datetime, timedelta
from django.db.models import Q
from django.views.defaults import page_not_found
from django.views.generic import FormView, DeleteView, ListView, TemplateView
from django.contrib.auth.mixins imp... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import itertools
from collections import defaultdict
from concurrent.futures import as_completed
from datetime import datetime, timedelta
import botocore.exceptions
from c7n.actions import BaseAction
from c7n.exceptions import PolicyValida... | |
"""Websocket API for Z-Wave JS."""
from __future__ import annotations
import dataclasses
import json
from aiohttp import hdrs, web, web_exceptions
import voluptuous as vol
from zwave_js_server import dump
from zwave_js_server.const import LogLevel
from zwave_js_server.exceptions import InvalidNewValue, NotFoundError,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.