gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2014 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... | |
#!/usr/bin/env python
#
# 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 "Li... | |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | |
'''
Android target, based on python-for-android project
'''
import sys
if sys.platform == 'win32':
raise NotImplementedError('Windows platform not yet working for Android')
from platform import uname
WSL = 'microsoft' in uname()[2].lower()
ANDROID_API = '27'
ANDROID_MINAPI = '21'
APACHE_ANT_VERSION = '1.9.4'
# ... | |
"""Search implementation using a cell database."""
from base64 import b64decode
from collections import defaultdict
import math
import numpy
from sqlalchemy import select
from ichnaea.api.locate.constants import (
CELL_MIN_ACCURACY,
CELL_MAX_ACCURACY,
CELLAREA_MIN_ACCURACY,
CELLAREA_MAX_ACCURACY,
)
f... | |
#!/usr/bin/env python
import argparse
import atexit
import logging
import sys
from datetime import datetime
from functools import partial, reduce
from itertools import groupby
from pprint import pformat
from operator import itemgetter
from docker import APIClient
from humanfriendly import format_size
DEFAULT_DOCKER_B... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import codecs
import... | |
from __future__ import unicode_literals
import pytest
import time
import redis
from redis.exceptions import ConnectionError
from redis._compat import basestring, unichr
from .conftest import _get_client
from .conftest import skip_if_server_version_lt
def wait_for_message(pubsub, timeout=0.1, ignore_subscribe_messag... | |
# 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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import queue
import multiprocessing
import magic
import logging
import dbApi
import signal
import traceback
import os.path
import random
random.seed()
import tqdm
import scanner.runState
import UniversalArchiveInterface as uar
import scanner.hashFile as hasher
IMAGE_... | |
import json
import os
from pathlib import Path
import subprocess
import sys
import signal
import pytest
import requests
import ray
from ray import serve
from ray.tests.conftest import tmp_working_dir # noqa: F401, E501
from ray._private.test_utils import wait_for_condition
from ray.dashboard.optional_utils import RAY... | |
'''
Poll torrent sites checking for number of torrent copies for a select film
'''
import time
import re
import requests
import pandas as pd
from bs4 import BeautifulSoup
from src.my_aws import S3
KEY_OMDB = 'OMDB_API.csv'
KEY_OMDB_TOR = 'OMDB_Torrents.csv'
BUCKET = 'movie-torrents'
class TorrentCount():
'''
... | |
# Copyright 2017 Balazs Nemeth
#
# 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... | |
# 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.
import atexit
import logging
import os
import re
import socket
import struct
import subprocess
from telemetry.internal.util import binary_manager
from telem... | |
# This file is part of DroidGraph.
#
# Copyright (C) 2021, Dario Incalza <dario.incalza at gmail.com>
# 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://ww... | |
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# 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... | |
# Copyright 2012 Twitter
#
# 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, softw... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import datetime
import json
import re
import sys
import sqlalchemy
from flask import request
from ggrc.settings import CUSTOM_URL_ROOT
from ggrc.utils import benchmarks
class GrcEncoder(json.JSONEncoder):... | |
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class IndicesClient(NamespacedClient):
@query_params('format', 'prefer_local')
def analyze(self, index=None, body=None, params=None):
"""
Perform the analysis process on a text and return the tokens breakdown of the tex... | |
"""Tests for the WLED light platform."""
import json
from unittest.mock import MagicMock
import pytest
from wled import Device as WLEDDevice, WLEDConnectionError, WLEDError
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
... | |
#!/usr/bin/env python
import copy
import unittest
from nose.tools import *
import networkx
from test_graph import TestGraph
class TestDiGraph(TestGraph):
def setUp(self):
self.Graph=networkx.DiGraph
# build K3
ed1,ed2,ed3,ed4,ed5,ed6 = ({},{},{},{},{},{})
self.k3adj={0: {1: ed1, 2:... | |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# 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
... | |
# Copyright 2014 OneConvergence, 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 requir... | |
#
# 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... | |
"""
Unified interfaces to root finding algorithms.
Functions
---------
- root : find a root of a vector function.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['root']
import numpy as np
from scipy._lib.six import callable
from warnings import warn
from .optimize import MemoizeJa... | |
# Copyright 2011 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 requ... | |
import json
from django.core import mail
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.amo.tests import (
APITestClient, TestCase, addon_factory, reverse_ns, user_factory)
class AddonAbuseViewSetTestBase(object):
client_class = APITestClient
def setUp(self):
... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from sqlparse import parse, tokens
class SQLParser(object):
"""class used to parse sql statements into a data structure
which can be used to execute the statement"""
def parse_statement(self, statement):
"""converts a statement in string form to tokens and passes off to
the parser"""
... | |
# Copyright (c) 2013 New Dream Network, LLC (DreamHost)
#
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import # So yaml can be imported
import re
import logging
import sys
import copy
import collections
import exceptions
import traceback
import pprint
import json
import StringIO
import salt.fileclient
import salt.client
import salt.renderers.pyobjects
import sa... | |
# -*- coding: utf-8 -*-
#
from __future__ import print_function
import six
from . import color as mycol
from . import path as mypath
def get_legend_label_(line):
'''Check if line is in legend
'''
label = line.get_label()
try:
ax = line.axes
leg = ax.get_legend()
return label ... | |
from __future__ import print_function
from collections import namedtuple
import numpy as np
import tensorflow as tf
from model import LSTMPolicy, MetaPolicy
import six.moves.queue as queue
import scipy.signal
import threading
import distutils.version
use_tf12_api = distutils.version.LooseVersion(tf.VERSION) >= distutil... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates C++ source files from a mojom.Module."""
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom.genera... | |
import numpy as np
from lasso_utils import *
def warm_start_lasso_shooting_solver_strong_rules(X, y, tol, lam_grid_size, lam_min, lam_max=9999, apply_sequential_strong_rules=True):
"""
Parameters:
@X {2D numpy array} matrix of predictor variables
@y {numpy array} continuous response variable
@tol ... | |
"""
Base class for Level Editor
You should write your own LevelEditor class inheriting this.
Refer LevelEditor.py for example.
"""
from direct.showbase.DirectObject import *
from direct.directtools.DirectUtil import *
from direct.gui.DirectGui import *
from CurveEditor import *
from FileMgr import *
from ActionMgr i... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import string
from importlib import import_module
import warnings
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.signals import user_logged_in,... | |
"""
Check metadata in a THREDDS catalog is consistent with the DRS.
Things to check:
1. All DRS components set as properties and validate with drslib
2. drs_id is consistent with properties
3. version is a date
4. dataset urlPath is consistent with the DRS directory structure.
5. Checksums are present and the right f... | |
import logging
import numpy as np
import pandas as pd
import numexpr as ne
from astropy import units as u, constants as const
from tardis.plasma.properties.base import ProcessingPlasmaProperty
from tardis.plasma.properties.util import macro_atom
logger = logging.getLogger(__name__)
__all__ = ['StimulatedEmissionFac... | |
import json
import nibabel
import os
import shutil
import tempfile
import io
import zipfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test import TestCase, Client, override_settings, RequestFactory
from uuid import uuid4
from neurovault.apps... | |
import histogram.hdf as hh, numpy as np
import os, sys
# hide the warnings on divide by zero etc
np.seterr(divide='ignore', invalid='ignore')
def getDOS(sample_nxs, mt_nxs=None, mt_fraction=0.9, const_bg_fraction=0.,
Emin=-100, Emax=100, dE=1.,
Qmin=0, Qmax=15., dQ=0.1, T=300, Ecutoff=50.,
... | |
# 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Document class and its helper functions.
This module also provides a deafult root-document object.
"""
import os
import tempfile
import shutil
from functools import partial
from types import ModuleType
from typing import Any, Callable, Optional, Union
import weakref
... | |
from __future__ import unicode_literals
import mock
import unittest
from nose.tools import * # noqa
from tests.factories import ProjectFactory, NodeFactory, CommentFactory
from website.addons.osfstorage.tests import factories
from website.addons.osfstorage.tests.utils import StorageTestCase
import datetime
from m... | |
# Copyright 2020 The HuggingFace Team. 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 applicabl... | |
from itertools import chain
from typing import NamedTuple, Dict, Sequence, List, Set, Type, Union, TYPE_CHECKING, Tuple
from lightbus.exceptions import TransportNotFound, TransportsNotInstalled
from lightbus.transports.pool import TransportPool
from lightbus.utilities.importing import load_entrypoint_classes
empty = ... | |
# 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) 2017 Yingxin Cheng
#
# 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... | |
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 3/17/14
###Purpose: visualize results of time-based epidemic simulations with varying T values vy age
#### pairs with age_time_T-age.py
###Import data:
###Command Line: python age_time_T-age_viz.py
... | |
# Copyright (c) 2012 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... | |
'''
Created on 10 dec. 2013
@author: TuRz4m
'''
import ConfigParser
import logging
import sys
from api.APIUtils import BetaSerieAPI, BadLoginException, SickBeardAPI
import os.path
logger = logging.getLogger(__name__)
logging.getLogger(__name__).setLevel(logging.INFO)
logging.getLogger(__name__).addHandler(logging.St... | |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_monitor_dns
short... | |
import threading
from PyQt4.Qt import (QDialog, QInputDialog, QLineEdit, QTextEdit, QVBoxLayout, QLabel, SIGNAL)
import PyQt4.QtCore as QtCore
from electrum_vtc.i18n import _
from electrum_vtc.qt.util import *
from electrum_vtc.util import print_msg
import os, hashlib, websocket, threading, logging, json, copy
from ... | |
import copy
from PySide import QtGui, QtCore
from ..fe import FE
from ..widget_factory import EditorFactory
from ..base_editor import BaseValueEditor
from ..core.undo_redo_manager import UndoRedoManager
from ..core.value_controller import ElementController
class ArrayEditor(BaseValueEditor):
def __init__(self, v... | |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | |
import numpy as np
import scipy.optimize as spopt
import cvxopt as cvx
from cvxopt import solvers
from scipy.special import digamma, gammaln, polygamma
import time, math, pdb
# suppress optimizer output
solvers.options['show_progress'] = False
solvers.options['maxiters'] = 40
np.random.seed(10)
# defining some consta... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#...for the logging.
import logging as lg
#...for copying.
from copy import deepcopy
#...for the MATH.
import numpy as np
#...for the data values.
from datavals import *
#...for the pixels.
from pixel import *
#...for the linearity calculations.
from helpers import ge... | |
#!/usr/bin/env python
# Copyright (c) 2011-2021, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
from dataclasses import dataclass
import numpy as np
import pytest
from wradlib import comp, georef, io, ipol, util
from . import requires_data, requires_gdal
@pytest.fixture
de... | |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test case for CERN oauth remote app_rest."""
from flask import g, session, url_fo... | |
r"""Puiseux Series :mod:`abelfunctions.puiseux`
===========================================
Tools for computing Puiseux series. A necessary component for computing
integral bases and with Riemann surfaces.
Classes
-------
.. autosummary::
PuiseuxTSeries
PuiseuxXSeries
Functions
---------
.. autosummary::
... | |
from rpython.jit.backend.arm import registers as r
from rpython.jit.backend.arm import codebuilder
from rpython.jit.backend.arm import conditions
from rpython.jit.backend.arm import instructions
from rpython.jit.backend.arm.test.support import requires_arm_as
from rpython.jit.backend.arm.test.support import get_as_vers... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import six
import sys
import lupa
from ipykernel.kernelapp import IPKernelApp
from ipykernel.eventloops import loop_qt5
from jupyter_client.kernelspec import install_kernel_spec
from twisted.internet import defer
import splash
from splash.lua im... | |
# 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 OpenSSL import SSL, crypto, rand
from socket import socket, AF_INET, SOCK_STREAM
from threading import Thread
from select import select
from log import Logger
class Worker(Thread):
counter = 0
READ_LENGTH = 2048
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
super(Worker, self)... | |
from proteus import Domain, Context
#from proteus.mprans
import SpatialTools as st
from proteus import Gauges as ga
from proteus import WaveTools as wt
from math import *
import numpy as np
opts=Context.Options([
# predefined test cases
("water_level", 0.425, "Height of free surface above bottom"), # Choose w... | |
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# 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 rights ... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# 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.
import collections
import itertools
import logging
import os
import posixpath
import subprocess
import shutil
import time
from devil import base_error
from ... | |
# Copyright (c) 2019-2022 Manfred Moitzi
# License: MIT License
import pytest
import math
from ezdxf.math import Vec3, Matrix44, arc_angle_span_deg
from ezdxf.entities.arc import Arc
from ezdxf.lldxf.const import DXF12, DXF2000
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
from ezdxf.path import... | |
from datetime import datetime, timedelta
from typing import List
import warnings
from dateutil.relativedelta import FR, MO, SA, SU, TH, TU, WE # noqa
import numpy as np
from pandas.errors import PerformanceWarning
from pandas import DateOffset, Series, Timestamp, date_range
from pandas.tseries.offsets import Day, ... | |
# -*- coding: utf-8 -*-
from django.conf import settings
# from mapcache.settings import MAPSERVER_URL
import os
import mapscript
MAPA_DEFAULT_SRS = 3857
MAPA_DEFAULT_SIZE = (110, 150)
MAPA_DEFAULT_EXTENT = (-20037508.3427892480, -20037508.3427892480, 20037508.3427892480, 20037508.3427892480) # 3857 whole world
MAPA_... | |
import pytest, requests
from kubernetes.client.rest import ApiException
from suite.resources_utils import wait_before_test, replace_configmap_from_yaml
from suite.custom_resources_utils import (
read_custom_resource,
)
from suite.vs_vsr_resources_utils import (
delete_virtual_server,
create_virtual_server_f... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | |
import errno
import json
import os
import random
import string
import socket
from concurrent.futures import ThreadPoolExecutor
from collections import deque, namedtuple
from datetime import datetime, timedelta
from tornado import gen
from tornado import ioloop
from tornado.log import app_log
from tornado.httpclient im... | |
import math
import pynq
import pytest
import importlib
import os
import numpy as np
from .mock_devices import MockMemoryMappedDevice
ZYNQ_SLCR_OFFSET = 0xF8000000
ZU_LPD_OFFSET = 0xFF5E0000
ZU_FPD_OFFSET = 0xFD1A0000
class FakeUname:
def __init__(self, machine):
self.machine = machine
def be_zynq():
... | |
# Copyright (C) 2017 by Kevin L. Mitchell <klmitch@mit.edu>
#
# 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 applicabl... | |
#!/usr/bin/env python3
# -+-coding: utf-8 -+-
"""
"""
#--------------------------------------------
# Authors: Frank Boers <f.boers@fz-juelich.de>
#
#--------------------------------------------
# Date: 20.01.20
#--------------------------------------------
# License: BSD (3-clause)
#------------------------------... | |
from __future__ import with_statement
import sys
import socket
import Live
from _Framework.SubjectSlot import subject_slot
from SimpleDeviceComponent import SimpleDeviceComponent
from GUtil import debug_out, register_sender
from _Generic import GenericScript
from _Generic.SpecialMixerComponent import SpecialMixerComp... | |
"""utils.py
Convenience functions to build applications that use pyfsa.
"""
__license__ = "Apache License, Version 2.0"
__author__ = "Roland Kwitt, Kitware Inc., University of Salzburg 2013"
__email__ = "E-Mail: roland.kwitt@kitware.com"
__status__ = "Development"
import os
import sys
import logging
import num... | |
import direct
from pandac.PandaModules import HttpRequest
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.task.TaskManagerGlobal import taskMgr
from direct.task import Task
from LandingPage import LandingPage
from direct.showbase import ElementTree as ET
notify = directNotify.newCategory('W... | |
# Copyright (c) 2015 Ambroz Bizjak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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... | |
"""Tests for selector_events.py"""
import errno
import socket
import unittest
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import selectors
from asyncio import test_utils
from asyncio.selector_events import BaseSelectorEventLoop
from asyncio.selector_eve... | |
"""
:codeauthor: Jorge Schrauwen <info@blackdot.be>
"""
import salt.modules.smartos_imgadm as imgadm
from salt.modules.smartos_imgadm import _parse_image_meta
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
image_orphan = {
"manifest": {"uuid": "07f360fd-12d5-e6... | |
# Copyright 2013 dotCloud 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 t... | |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
import six
import re
import os
from pandas.api.types import is_scalar, is_integer
import numpy as np
import pandas as pd
import h5py
def partition(start, stop... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from QOpenScienceFramework.widgets.projecttree import ProjectTree
from QOpenScienceFramework.util import *
from QOpenScienceFramework.compat impor... | |
from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_... | |
import asyncio
import importlib.util
import json
import logging
import os.path
import queue
import sys
import multiprocessing
from typing import Dict, List, Optional, Union
import click
import websockets
import netdumplings
from netdumplings._shared import (
configure_logging, ND_CLOSE_MSGS, HUB_HOST, HUB_IN_PORT... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
try:
import urlparse
from urllib import unquote, quote
except ImportError:
import urllib.parse as urlparse
from urllib.parse import unquote, quote
import re
import os
__version__ = '0.1.15'
cla... | |
# Copyright 2015 PerfKitBenchmarker 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 appli... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 01 17:47:38 2014
@author: xumiao
"""
import monk.roles.administrator as mra
import monk.roles.worker as mrw
import monk.core.api as monkapi
import pymongo as pm
import logging
from monk.math.flexible_vector import FlexibleVector
from random import sample
import pickle
im... | |
# 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 ... | |
"""Functions for plotting and comparing isotherms."""
import math
import typing as t
from collections import abc
from itertools import cycle
import matplotlib as mpl
import matplotlib.pyplot as plt
from cycler import cycler
from pygaps import logger
from pygaps.graphing.labels import label_lgd
from pygaps.graphing.l... | |
"""Tests for Philips Hue config flow."""
import asyncio
from unittest.mock import Mock, patch
from aiohue.discovery import URL_NUPNP
from aiohue.errors import LinkButtonNotPressed
import pytest
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import ssdp, zeroconf
from h... | |
#!/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.
"""Makes sure that files include headers from allowed directories.
Checks DEPS files in the source tree for rules, and applies tho... | |
# coding: utf-8
from __future__ import unicode_literals
import hashlib
import hmac
import re
import time
import uuid
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
)
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
str_or_none,
try_g... | |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
from __future__ import unicode_literals
import functools... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# Copyright (c) 2012 NTT DOCOMO, INC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.