gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import urllib
import hashlib
from datetime import datetime
import pytz
import bcrypt
from mongoalchemy.document import Index
from mongoalchemy.fields import (
EnumField,
StringField,
BoolField
)
from validate_email import validate_email
from jobs.send_email import send_email
from server.utils import SafeS... | |
# Copyright (c) 2015-2021 Patricio Cubillos and contributors.
# MC3 is open-source software under the MIT license (see LICENSE).
import pytest
import numpy as np
import mc3
import mc3.stats as ms
# Preamble for time-averaging runs:
np.random.seed(12)
N = 1000
white = np.random.normal(0, 5, N)
red = np.sin(np.arange(... | |
# 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... | |
# 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
# d... | |
# Mrs
# Copyright 2008-2012 Brigham Young University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
import numpy as np
import pysal
import scipy.sparse as SP
import itertools as iter
from scipy.stats import f, chisqprob
import numpy.linalg as la
from utils import spbroadcast
"""
Tools for different regimes procedure estimations
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, \
Daniel Arribas-Bel darribas... | |
# -*- coding: utf-8 -*-
import functools
import inspyred
import pyvotune
from pyvotune.log import logger
from pyvotune.util.id_generator import get_id
log = logger()
def mutator(mutate):
"""
Creates an inspyred mutator function which will always return either the current genome
or a new and valid genom... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
from . import links as L
from . import varfuncs as V
class Family(object):
"""
A class to model one-parameter exponential
families.
INPUTS:
link -- a Link ... | |
#!/usr/bin/env python
# Copyright 2012 Cloudera 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 ag... | |
# 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... | |
#!/usr/bin/python2.4
# Copyright (c) 2010 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.
"""A bare-bones and non-compliant XMPP server.
Just enough of the protocol is implemented to get it to work with
Chrome's sync noti... | |
import os
import sys
import stat
import time
import atexit
import base64
import select
import signal
import socket
import datetime
import tempfile
import threading
import subprocess
import SocketServer
import sjq.client
import sjq.config
import handler
import jobqueue
def start(verbose=False, args=None, daemon=False... | |
"""
Main Random Variables Module
Defines abstract random variable type.
Contains interfaces for probability space object (PSpace) as well as standard
operators, P, E, sample, density, where, quantile
See Also
========
sympy.stats.crv
sympy.stats.frv
sympy.stats.rv_interface
"""
from __future__ import print_function... | |
import numpy as np
from sirius import inner, l2norm, CoefficientArray, Logger, diag
import h5py
from copy import deepcopy
from scipy.constants import physical_constants
from mpi4py import MPI
from .free_energy import FreeEnergy, s
logger = Logger()
def _constraint34(u, tau, T, pe, vkw):
"""
Keywoard Argumen... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 15 23:25:31 2015
@author: ibackus
"""
import os
import glob
import re
from subprocess import Popen, PIPE
import pynbody
from diskpy import global_settings
from diskpy.utils import configparser, configsave, units_from_param
def pbs_script(workdir, param='snapshot.param... | |
# 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.
"""Run specific test on specific environment."""
import json
import logging
import os
import sys
import tempfile
import time
import zipfile
from pylib impo... | |
import re
import sys
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import clear_url_caches
from django.db import transaction, connection,... | |
#!/bin/env python
# Copyright (c) 2006-2009 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.
"""Rebaselining tool that automatically produces baselines for all platforms.
The script does the following for each platform spe... | |
###
# Copyright (c) 2002-2009, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# 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 copyr... | |
# Django settings for dojo project.
import os
from datetime import timedelta
DEBUG = True
LOGIN_REDIRECT_URL = '/'
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
# SECURE_SSL_REDIRECT = True
# SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_HTTPONLY = True
CSRF_COOKIE_HTTPONLY = True
TEST_RUNNER = ... | |
import paramiko
import time
MAX_BUFFER = 65535
class SSHConnection(object):
'''
Base class is based upon Cisco IOS behavior.
Should subclass this class for different vendors.
'''
def __init__(self, net_device):
self.net_device = net_device
self.ip = net_device.ip_address
... | |
import os
import time
import math
import logging
import mimetypes
import requests
from requests.auth import HTTPDigestAuth
from urlparse import urljoin
from xml.parsers.expat import ExpatError
from cStringIO import StringIO
from django.db import transaction
from django.core.files.base import ContentFile
from django.c... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
"""The tests for the MQTT binary sensor platform."""
import copy
from datetime import datetime, timedelta
import json
from unittest.mock import patch
import pytest
from homeassistant.components import binary_sensor
from homeassistant.const import (
EVENT_STATE_CHANGED,
STATE_OFF,
STATE_ON,
STATE_UNAV... | |
"""
::
from prompt_toolkit.contrib.python_import import PythonCommandLineInterface
cli = PythonCommandLineInterface()
cli.read_input()
"""
from __future__ import unicode_literals
from pygments.lexers import PythonLexer
from pygments.style import Style
from pygments.token import Keyword, Operator, Number... | |
from __future__ import unicode_literals
import copy
import json
import re
import itertools
import six
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores, amz_crc32, amzn_request_id
from .exceptions import (
InvalidIndexNameError,
ItemSizeTooLarge,
MockValida... | |
#!/usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os, sys, time, os, math
from multiprocessing.pool import ThreadPool
thread_... | |
# 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 numpy as np
import openmc
from openmc.source import Source
from openmc.stats import Box
class InputSet(object):
def __init__(self):
self.settings = openmc.Settings()
self.materials = openmc.Materials()
self.geometry = openmc.Geometry()
self.tallies = None
self.plots... | |
from sympy.polys.domains import QQ, EX, RR
from sympy.polys.rings import ring
from sympy.polys.ring_series import (_invert_monoms, rs_integrate,
rs_trunc, rs_mul, rs_square, rs_pow, _has_constant_term, rs_hadamard_exp,
rs_series_from_list, rs_exp, rs_log, rs_newton, rs_series_inversion,
rs_compose_add, rs_a... | |
import os, random, struct, time, socket, base64
from disco.compat import BytesIO, file, httplib, basestring, str_to_bytes
from disco.error import CommError
from disco.settings import DiscoSettings
from disco.util import iterify, urlresolve, urlsplit
BUFFER_SIZE = int(1024**2)
CHUNK_SIZE = int(10 * 1024**2)
settings =... | |
'''
Peach Logging System
This is the Peach logging sub-system. To implement a new logging method
extend from Logger.
@author: Michael Eddington
@version: $Id: logger.py 2979 2012-08-28 20:32:13Z meddingt $
'''
#
# Copyright (c) Michael Eddington
#
# Permission is hereby granted, free of charge, to any person obtain... | |
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public ... | |
# Copyright 2016 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 ... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Dec 17 2009)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################
impo... | |
#!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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,
# t... | |
import datetime
import django.test
import shutil
import logging
from django.core.urlresolvers import reverse
from django.test.client import Client
from metashare import test_utils, settings
from metashare.recommendations.models import TogetherManager, ResourceCountPair, \
ResourceCountDict
from metashare.recommenda... | |
import os; #for Linux terminal commands
import numpy as np; #numeric python library
import math; #for negative power function
import subprocess; #for running difmap on Linux
import pylab; #for data reading
from astropy.io import fits; #for reading .fits file header
def data_setup(path_to_original_data,visibility_file)... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
import os
import time
import configparser
from pathlib import Path
import numpy as np
from .dataio import DataIO
from . catalogueconstructor import CatalogueConstructor, _dtype_peak
from .autoparams import get_auto_params_for_catalogue
try:
import h5py
HAVE_H5PY = True
except:
HAVE_H5PY = False
try:... | |
"""Tests for aiohttp/worker.py"""
import asyncio
import os
import pathlib
import socket
import ssl
from unittest import mock
import pytest
from aiohttp import web
from aiohttp.test_utils import make_mocked_coro
base_worker = pytest.importorskip('aiohttp.worker')
try:
import uvloop
except ImportError:
uvlo... | |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2013 CRS4.
#
# 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 2013 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... | |
# ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... | |
from collections import Mapping, defaultdict
from commands import getstatusoutput
from contextlib import contextmanager
from datetime import datetime
from errno import ENOENT
import fnmatch
from functools import wraps
from itertools import izip, imap
from os import chdir, dup, fdopen, getcwd
from os.path import join
fr... | |
"""
Test script for src=9 provisioning
Below are some odd examples and notes:
Adding a class
{
'src': '9',
'uln': 'Githens',
'ufn': 'Steven',
'aid': '56021',
'utp': '2',
'said': '56021',
'fid': '2',
'username': 'swgithen',
'ctl': 'CourseTitleb018b622-b425-4af7-bb3d-d0d2b4deb35c',
'diagnost... | |
"""
This is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss
"""
import ctypes
import ctypes.util
import sys
from ctypes import (
POINTER,
Structure,
c_double,
c_float,
c_int32,
c_uint64,
c_ubyte,
c_uint32,
c_void_p,
)
from platform import mac_ver
from ... | |
#!/usr/bin/python
# Copyright AllSeen Alliance. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS ... | |
##########################################################################
#
# Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
"""MARTA related data classes"""
from datetime import datetime
from breezeminder.app import app
from breezeminder.models.base import BaseQuerySet
from breezeminder.util.date import timesince
class Route(app.db.Document):
"""
One describable MARTA bus/train route. Consists of "trips"
"""
id = app.db.I... | |
# 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 use ... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | |
"""The System Bridge integration."""
from __future__ import annotations
import asyncio
import logging
import shlex
import async_timeout
from systembridge import Bridge
from systembridge.client import BridgeClient
from systembridge.exceptions import BridgeAuthenticationException
from systembridge.objects.command.respo... | |
#!/usr/bin/python
"""
Usage:
update_translations.py -p <project-key>
"""
import urllib, sys, getopt, os, json, shutil
from zipfile import ZipFile
PROJECT_ID = "bemyeyes"
ENDPOINT = "https://api.crowdin.com/api/project/{projectID}/download/{package}.zip?key={projectKey}"
LANG_STATUS_ENDPOINT = "https://api.crowdin.c... | |
# Copyright 2008-2011 WebDriver committers
# Copyright 2008-2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.topolib import TreeTopo
from ripl.dctopo import FatTreeTopo
from time import sleep
from mininet.node import RemoteController
from mininet.node import UserSwitch
import subprocess
ip = '172.16.29.1'
port = 6633
httpport = 8080
class Rect( Top... | |
# coding: utf-8
# Copyright (c) Materials Virtual Lab
# Distributed under the terms of the BSD License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import os
import abc
import io
import subprocess
import itertools
import six
import numpy as np
from monty.tempfile import S... | |
import unittest
from test import test_support
import errno
import itertools
import socket
import select
import time
import traceback
import Queue
import sys
import os
import array
import contextlib
import signal
import math
import weakref
try:
import _socket
except ImportError:
_socket = None
def try_address... | |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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 r... | |
"""Implement the Google Smart Home traits."""
import logging
from typing import List, Optional
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
input_select,
light,
lock,
media_player,
scene,
script,... | |
"""
Easy-to-use UMFPACK interface
=============================
.. currentmodule:: scikits.umfpack
The following functions can be used for LU decompositions and solving
equation systems:
.. autosummary::
:toctree: reference/
spsolve
splu
UmfpackLU
"""
from __future__ import division, print_function, a... | |
import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import (
BaseSpatialOperations,
)
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, RasterField
from django.contrib.gis.gdal import GDALRaster
from d... | |
"""Logic expressions handling
NOTE
----
at present this is mainly needed for facts.py , feel free however to improve
this stuff for general purpose.
"""
from __future__ import print_function, division
from sympy.core.compatibility import range
def _fuzzy_group(args, quick_exit=False):
"""Return True if all arg... | |
"""
Support pre-0.12 series pickle compatibility.
"""
import copy
import pickle as pkl
import sys
from pandas import Index
def load_reduce(self):
stack = self.stack
args = stack.pop()
func = stack[-1]
if len(args) and type(args[0]) is type:
n = args[0].__name__ # noqa
try:
sta... | |
"""Support for interfacing with the XBMC/Kodi JSON-RPC API."""
from collections import OrderedDict
from functools import wraps
import logging
import re
import socket
import urllib
import aiohttp
import voluptuous as vol
from homeassistant.components.kodi import SERVICE_CALL_METHOD
from homeassistant.components.kodi.c... | |
##########
# Contribution by the Center on Long-Term Risk:
# https://github.com/longtermrisk/marltoolbox
##########
import copy
from collections import Iterable
import gym
import logging
import numpy as np
from gym.spaces import Discrete
from gym.utils import seeding
from ray.rllib.env.multi_agent_env import MultiAge... | |
# -*- coding: utf-8 -*-
"""Field classes for various types of data."""
from __future__ import absolute_import, unicode_literals
import datetime as dt
import uuid
import warnings
import decimal
from operator import attrgetter
from marshmallow import validate, utils, class_registry
from marshmallow.base import FieldAB... | |
# 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 ... | |
#
# 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... | |
# -*- coding: utf-8 -*-
##########################################################################
# Copyright 2013-2021 Aerospike, 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
#
# ... | |
# Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections.abc import Mapping, Iterable
from operator import itemgetter
from numbers import Number
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMix... | |
import threading
from ophyd import ProsilicaDetector, EpicsSignal, Device, EpicsScaler, TetrAMM, EpicsSignalRO
from ophyd import Component as Cpt
from ophyd.ophydobj import StatusBase
from ophyd.status import wait
from hxntools.detectors.zebra import Zebra, EpicsSignalWithRBV
from collections import OrderedDict
import... | |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | |
from effigy.QNodeSceneNode import QNodeSceneNode, QNodeSceneNodeUndeletable
from effigy.NodeIO import NodeIO, NodeOutput, NodeInput, NodeIODirection, NodeIOMultiplicity
from PyQt5.QtWidgets import QGraphicsRectItem, QGraphicsTextItem
from PyQt5.QtCore import QRectF, QPointF, Qt
from PyQt5.QtGui import QPen, QColor, QB... | |
# 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 the Li... | |
from __future__ import unicode_literals, division, absolute_import
import logging
from datetime import datetime, timedelta
from sqlalchemy import Table, Column, Integer, Float, Unicode, Boolean, DateTime, func
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relation
from sqlal... | |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/textobject.py
__version__=''' $Id: textobject.py 3207 2008-02-13 10:58:03Z rgbecker $ '''
__doc__="""
PDFTextObject is an efficient way to add t... | |
#!/usr/bin/env python
# Copyright (c) 2011 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.
'''This utility cleans up the html files as emitted by doxygen so
that they are suitable for publication on a Google documentation ... | |
#!/usr/bin/env python
'''
Phillip Kuznetsov
2017
'''
from __future__ import print_function
import os, sys
os.environ['GLOG_minloglevel'] = '2' # suprress Caffe verbose prints
import re
import settings
sys.path.insert(0, settings.caffe_root)
import caffe
import numpy as np
from numpy.linalg import norm
import scipy.... | |
"""The test for the here_travel_time sensor platform."""
import logging
from unittest.mock import patch
import urllib
import herepy
import pytest
from homeassistant.components.here_travel_time.sensor import (
ATTR_ATTRIBUTION,
ATTR_DESTINATION,
ATTR_DESTINATION_NAME,
ATTR_DISTANCE,
ATTR_DURATION,
... | |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import unittest
import itertools
import datetime
import time
import random
import os
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import context
from streamsx.topology.context... | |
"""
Tests for field rendering functions
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2014, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import logging
l... | |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import PurePath
from typing import Iterable
from pants.backend.codegen.avro.java.subsystem impo... | |
# -*- coding: utf-8 -*-
from nose.tools import * # noqa (PEP8 asserts)
from tests.factories import (
ProjectFactory,
UserFactory,
RegistrationFactory,
NodeFactory,
NodeLogFactory,
CollectionFactory,
)
from tests.base import OsfTestCase
from framework.auth import Auth
from framework import ut... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 13 23:21:29 2016
Defines a set of utility functions to be used for prediction
@author: Rupak Chakraborty
"""
import math
from trip import Trip
from gift import Gift
import random
import time
import pandas as pd
import operator
RADIUS_EARTH = 6773
NORTH_POLE_LAT = 90
NOR... | |
import sys
from expr.weighted_hs import WeightedLGBPHS
from facerec_py.facerec.distance import *
from facerec_py.facerec.classifier import NearestNeighbor, SVM
from facerec_py.facerec.model import PredictableModel, FeaturesEnsemblePredictableModel
from facerec_py.facerec.validation import KFoldCrossValidation, shuffle... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
import hashlib
import pytest
from aiohttp.test_utils import make_mocked_coro
import virtool.errors
from virtool.db.transforms import apply_transforms
from virtool.users.db import (
AttachUserTransform,
B2CUserAttributes,
compose_force_reset_update,
compose_groups_update,
compose_password_update,
... | |
# Copyright (C) 2018-2019 OpenIO SAS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software, 2013-2021 the Babel team
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
... | |
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('AppsPages')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import random
from dustWeb import web
from DustLinkData import DataVaultException, \
DustLinkData
from dus... | |
# -*- coding: utf-8 -*-
import json
import logging
import os
import sqlite3
from string import Template
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry
from osgeo import gdal, osr
from eventkit_cloud.feature_selection.feature_selection import slugify
from eventkit_cloud.tasks.helpers... | |
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 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... | |
#!/usr/bin/env python
__author__ = 'Adam R. Smith, Michael Meisinger, Dave Foster <dfoster@asascience.com>'
import threading
import traceback
import gevent
from gevent import greenlet, Timeout
from gevent.event import Event, AsyncResult
from gevent.queue import Queue
from pyon.core import MSG_HEADER_ACTOR
from pyon.... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Bayesian Blocks for Time Series Analysis
========================================
Dynamic programming algorithm for solving a piecewise-constant model for
various datasets. This is based on the algorithm presented in Scargle
et al 2012 [1]_. This cod... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import contextlib
import decimal
import errno
from enum import E... | |
##
# Copyright (c) 2009-2014 Apple 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 l... | |
import json
import logging
import re
from datetime import datetime
from random import random
from typing import List, NamedTuple, Optional
from urllib.parse import urlparse
import requests
from streamlink.exceptions import NoStreamsError, PluginError
from streamlink.plugin import Plugin, PluginArgument, PluginArgumen... | |
# Copyright (C) 2011-2012 Canonical Services Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.