text stringlengths 3.07k 22.1k |
|---|
"""
Smartplug: control your sonoff device using MQTT
This assumes to run under a custom firmware which contains the following
frozen modules:
- uasyncio.core
- asyn.py, aswitch.py [https://github.com/peterhinch/micropython-async]
- mqtt_as [https://github.com/peterhinch/micropython-mqtt]
"""
import sys
import ... |
import asyncio
import numpy as np
import json
import logging
import datetime
import math
from fifo import Fifo
from run_task import run_task
import location_mapper
ACCEL_FIFO_CAPACITY = 6000 # number of samples in Acceleration Data Fifo ~1 minute
ACCEL_NOMINAL_SAMPLE_PERIOD = 0.01 # sample rate we except the sample... |
"""Low-level linear systems solver. """
from sympy.utilities.iterables import connected_components
from sympy.matrices import MutableDenseMatrix
from sympy.polys.domains import EX
from sympy.polys.rings import sring
from sympy.polys.polyerrors import NotInvertible
from sympy.polys.domainmatrix import DomainMatrix
... |
from __future__ import print_function, division
from contextlib import contextmanager
from functools import wraps
from time import sleep, time
# Use relative/cpu timer to have reliable timings when there is a sudden load
try:
from time import process_time
except ImportError:
from time import clock
process_t... |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.conf import settings
from django.contrib.auth.decorators import login_required, permission_required
from otree_manager.om.models import OTreeInstance
from otree_manager.om.utils imp... |
from __future__ import division
from nose.tools import *
import numpy as np
import causalinference.causal as c
from utils import random_data
def test_est_propensity():
D = np.array([0, 0, 0, 1, 1, 1])
X = np.array([[7, 8], [3, 10], [7, 10], [4, 7], [5, 10], [9, 8]])
Y = random_data(D_cur=D, X_cur=X)
causal = c.... |
"""
utility functions for narps analysis
"""
import os
import glob
import nilearn.input_data
import numpy
import pandas
import nibabel
from scipy.stats import norm, t
import scipy.stats
from datetime import datetime
from sklearn.metrics import cohen_kappa_score
def stringify_dict(d):
"""create a pretty version o... |
"""Support for interface with a Gree climate systems."""
import logging
from typing import List
from greeclimate.device import (
FanSpeed,
HorizontalSwing,
Mode,
TemperatureUnits,
VerticalSwing,
)
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.cons... |
import wikipedia
import webbrowser
import requests
from bs4 import BeautifulSoup
import threading
import smtplib
import urllib.request
import os
from geopy.geocoders import Nominatim
from geopy.distance import great_circle
class COVID:
def __init__(self):
self.total = 'Not Available'
... |
"""
"""
"""
_abnf.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
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) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the LICENSE.txt file at the root of this distribution. If
# you cannot locate the Apache License, Version 2.0, please send an email to
# <EM... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import unicodedata
import Levenshtein
import six
from . import metaphone
_mappings = {
'de': {
'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'ä': 'ae',
'ö': 'oe', 'ü': 'ue', 'ß': 'ss', 'ẞ': 'SS' },
'latin': {
'À': 'A', 'Á': ... |
# Copyright 2021 Amazon.com, Inc. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
from __future__ import print_function
import logging
import pprint
import math
import numpy
import traceback
import operator
import theano
from six.moves import input
from picklable_itertools.extras import equizip
from theano import tensor
from blocks.bricks import Tanh, Initializable
from blocks.bricks.base import a... |
# -*- coding: utf-8 -*-
"""
eTOX ALLIES Applicability Domain Analysis
As described in:
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>.,
<NAME>. and <NAME>. "eTOX ALLIES: an automated pipeLine for linear
interaction energy-based simulations" Journal of Cheminformatics, 2017, 9, 58.
http://doi.org/10.1186/s13321-017-0243-x... |
"""
Copyright 2019 Samsung SDS
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 ... |
# Copyright 2018 Amazon.com, Inc. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
##
## Copyright (c) 2014-2017 Leidos.
##
## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
##
##
## Developed under contract #FA8750-14-C-0241
##
from bs4 import BeautifulSoup
from datetime import datetime
import sys
sys.path.insert(0, '../')
from metadata_generator import generateMetadata
#... |
import os
import sys
import logging
import numpy as np
import json
import re
import random
work_dir = os.getcwd() # 当前路径
sys.path.extend([os.path.abspath(".."), work_dir])
from basic.basic_task import Basic_task, Task_Mode
from basic.register import register_task, find_task
from utils.build_vocab import Vocab
from u... |
#!/usr/bin/env python3
## cl-Jupyter installation script
## Note: since the kernel of Jupyter is written itself in Python,
## it is much simpler to have a Python-based installation script.
import subprocess
import sys
import shutil
import os
import json
class RequirementException(BaseException):
pass
d... |
"""
Checks a sample if it matches PHE defined recipes for VOC/VUIs. Outputs to stdout
a tab delimited list of the following:
- PHE name for the matching VOC/VUI. "none" if no match. "multiple" if multiple matches.
- pangolin name for the matching VOC/VUI. "none" if no match. "multiple" if multiple matches.
- conf... |
"""Tests for the configuration routines."""
import os
import sys
from sqlfluff.core.config import ConfigLoader, nested_combine, dict_diff
from sqlfluff.core import Linter, FluffConfig
from sqlfluff.core.templaters import (
RawTemplater,
PythonTemplater,
JinjaTemplater,
PlaceholderTemplater,
)
from pa... |
import pathlib
import numpy as np
import xarray as xr
from numpy import ma
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.style
from matplotlib.colors import LogNorm
from ._base_saver import _BaseSaver
def save_loss(loss_data_dir, img_dir, run_number, vmin=0, vmax=0.01):
... |
import mxnet as mx
import mxnet.gluon.nn as nn
def get_shape(x):
if isinstance(x, mx.nd.NDArray):
return x.shape
elif isinstance(x, mx.symbol.Symbol):
_, x_shape, _ = x.infer_shape_partial()
return x_shape[0]
class Dense(nn.HybridBlock):
def __init__(self, output, drop_rate=0, a... |
import numpy as np
import spectral
from matplotlib import pyplot as plt
# minimum noise filter
def MNF(hydata, output_bands=20, denoise_bands=40, band_range=None, inplace=False):
"""
Apply a minimum noise filter to a hyperspectral image.
*Arguments*:
- hydata = A HyData instance containing the sourc... |
#
# Oriented projective 3-space primitives
#
from typing import Any
from dataclasses import dataclass
import math
from . import euclidean3
from .commonOps import determinant2, determinant3, isZero, are_dependent4, inner_product4
@dataclass(frozen=True)
class LineOP3:
__slots__ = ["p01", "p02", "p03", "p12", "p1... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from django.shortcuts import redirect
from django.views.generic.base import TemplateView
from django.http import Http404, HttpResponse
from django.urls import reverse
from scorecard.profiles import get_profile
from scorecard.models import Geography, LocationNotFound
from infrastructure.models import Project
from house... |
from typing import Any
class DoublyNode:
"""A node element containing a value and references to next and previous nodes."""
def __init__(self, value) -> None:
"""Initialize node with given value and provide reference to previous and next."""
self.value = value
self.previous = None
... |
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import dynet as dy
import dynet_modules as dm
import numpy as np
import random
from utils import *
from data import flatten
from time import time
from modules.seq_encoder import SeqEncoder
from modules.bag_encoder imp... |
# 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 python3
#naive cli json datastore to quickly archive works
import json
import sys
import readline
import time
import meta #meta.py
import dqwork #dqwork.py
#open existing database or create anew
## save old data in case of error
#filen="tmp.data" #testing
filen="data.nu"
try:
fin=open(filen,"r")
... |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn import init
import numpy as np
import json
import os.path
import subprocess
import random
from operator import itemgetter
import sklearn.metrics as metrics
np.set_printoptions... |
from keras.applications.imagenet_utils import _obtain_input_shape
from keras.utils.data_utils import get_file
import keras.backend as K
from keras.layers import Input
from keras.layers.convolutional import Conv2D, Conv2DTranspose, UpSampling2D
from keras.regularizers import l2
from keras.layers.normalization import Bat... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Acrisel LTD
# Copyright (C) 2008- Acrisel (acrisel.com) . All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... |
from photons_protocol.errors import BadConversion
from photons_protocol.types import Optional
from delfick_project.norms import sb, dictobj
from bitarray import bitarray
import binascii
import struct
def val_to_bitarray(val, doing):
"""Convert a value into a bitarray"""
if val is sb.NotSpecified:
val... |
# encoding: utf-8
"""
@author: l1aoxingyu
@contact: <EMAIL>
"""
import functools
import inspect
import logging
import os
from typing import Any
import yaml
from yacs.config import CfgNode as _CfgNode
from ..utils.file_io import PathManager
BASE_KEY = "_BASE_"
class CfgNode(_CfgNode):
"""
Our own extended... |
# Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... |
import bagel
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from typing import Sequence, Tuple, Dict, Optional
class AutoencoderLayer(tf.keras.layers.Layer):
def __init__(self, hidden_dims: Sequence[int], output_dim: int):
super().__init__()
self._hidden = tf.ker... |
from . import connection
from . import process_path
import re
__all__ = [
"Organization",
"Configuration",
"ConfigurationType",
"ConfigurationStatus",
"ConfigurationInterface",
"Location",
"FlexibleAsset",
"FlexibleAssetField",
"FlexibleAssetType"
]
class ResourceBase(object):
... |
import glob
import json
import logging
import multiprocessing
import os
import shutil
import struct
import subprocess
from enum import Enum, auto
from dataclasses import dataclass, field
from pathlib import Path
from typing import (
Mapping,
NewType,
Optional,
Sequence,
)
logger = logging.getLogger(_... |
# Copyright 2016 Quora, 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... |
# coding: utf-8
#
# Copyright 2021 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... |
"""Data objects related to building, signing, and broadcasting transactions."""
from __future__ import annotations
import json
from dataclasses import dataclass, field
from typing import List, Optional
from jigu.core.event import Event
from jigu.core.msg import MSG_TYPES, StdMsg
from jigu.core.sdk import Coin, Coins... |
#!/usr/bin/env python3
# Copyright (c) 2021 The Danxome Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
""" Interactive danxomed P2P network traffic monitor utilizing USDT and the
net:inbound_message and net:ou... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, French National Center for Scientific Research (CNRS)
# Distributed under the (new) BSD License. See LICENSE for more info.
import threading, time, logging
from teleprox import RPCClient, RemoteCallException, RPCServer, QtRPCServer, ObjectProxy, ProcessSpawner
from telepro... |
import math
import random
import requests
import time
from itertools import groupby
class ExchangeProvider:
"""Exchange data provider interface"""
def get_name(self):
"""Returns exchange name for use in user interface"""
raise NotImplementedError()
def get_markets(self):
"""Retur... |
'''Module provides quick solution for auto-deploying docker from git.
Wish:
-> have argument handler, when running from terminal: python3 bootdocker.py
-> test against older versions than 3.7, as older not supported
Subprocess:
Changed in version 3.7: Added the text parameter, as a more unders... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import datetime
import random
import re
import requests
import string
from lxml import html
from werkzeug import urls, utils
from odoo import models, fields, api, _
URL_REGEX = r'(\bhref=[\'"](?!mailto:... |
"""
Belize API Client
This script will do:
1- Creates a local directory where to download the data.
2- Request the ENDPOINT and download the data in XML format.
3- Saves the original XML compress by GZIP.
4- Converts the XML to a NEWLINEJSON and compress with GZIP.
5- Upload the files to GCS.
"""
from datetime import... |
# Copyright (c) 2020. <NAME>, <EMAIL>
# Ref: https://github.com/WangYueFt/dgcnn/blob/master/pytorch/main.py
import sys, os, torch, shutil, argparse, torch.nn as nn, torch.nn.functional as F
sys.path.append('models')
sys.path.append('utils')
from PC_Augmentation import random_point_dropout, random_scale_point_cloud, ... |
# 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
from metrics import Metric
from telemetry.core.timeline import bounds
class TimelineMetric(Metric):
def __init__(self, model=None, ren... |
import random
import numpy as np
import torch
import torch.nn as nn
from torch.nn.utils import clip_grad_value_
from pytorl.lib import PrioritizedReplay
from pytorl.utils import Setting
from ._base_agent import Agent
class DQN_Agent(Agent):
def __init__(self,
device,
q_net,
target_ne... |
"""Testsuite for flashfocus.config."""
from copy import deepcopy
from pytest import fixture, mark, raises
from pytest_lazyfixture import lazy_fixture
from flashfocus.config import (
construct_config_error_msg,
dehyphen,
get_default_config_file,
hierarchical_merge,
load_config,
load_merged_conf... |
# map-ephys interative shell module
import os
import sys
import logging
from code import interact
import time
import numpy as np
import pandas as pd
import datetime
import datajoint as dj
from pipeline import lab
from pipeline import experiment
from pipeline import ccf
from pipeline import ephys
from pipeline import... |
# -*- coding:utf-8 -*-
"""
@Author : g1879
@Contact : <EMAIL>
@File : session_element.py
"""
import re
from html import unescape
from typing import Union, List
from requests_html import Element, BaseParser
from .common import DrissionElement, get_loc_from_str, translate_loc_to_xpath
class SessionElement(D... |
#!/usr/bin/env python
'''variant_example.py
This is a comprehensive example variant script. It extends the base_example
script by leveraging a few of its sections & testcases, and adding a few of its
own.
This is called the 'variant' script: it provides varianting (eg, extends, adds
more to) to the base script. What ... |
# Freddy @DC, uWaterloo, ON, Canada
# Nov 13, 2017
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
import numpy as np
import pandas as pd
import sys
import math
import time
from tqdm import *
from data_preprocess ... |
"""Server that handles all the requests for DRLVis frontend."""
import argparse
import timeit
from flask import Flask, request
from flask_cors import CORS
import os
import sys
import signal
from threading import Thread
from http import server
import socketserver
from drlvis.data_preprocessor import DataPreprocessor
A... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
from scipy.sparse import csc_matrix
import os, sys
import functools as fct
# import from parent directory
nb_dir = os.path.split(os.getcwd())[0]
if nb_dir not in sys.path:
print('Appending directory as path: {}'.format(nb_dir))
sys.path.append(nb_dir... |
from pypy.interpreter.error import oefmt
from pypy.interpreter.astcompiler import consts
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.objectmodel import we_are_translated
from rpython.rlib.rarithmetic import widen
from pypy.module.cpyext.api import (
cpython_api, CANNOT_FAIL, CONST_STRING,... |
#Aici este citirea exact ca la svm si la naive bayes doar ca testez parametri diferite pentru mlpclassifier.
#Rezultatul nu a trecut de 0.72 din ce imi amintesc (stiu ca era mai slaba solutia decat svm si nu am notat-o).
#Am luat MLPCLASSIFIER-ul din laborator si m-am jucat cu valorile ce erau oferite in documentat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, <NAME> <<EMAIL>>
# 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: dnf_versionlock
versio... |
"""
Copyright 2020, <NAME>, <EMAIL>, All rights reserved.
Borrowed from https://github.com/sidhantagar/ConnectX under the MIT license.
"""
import numpy as np
import random
max_score = None
def score_move_a(grid, col, mark, config, start_score, n_steps=1):
global max_score
next_grid, pos = drop_piece(grid, co... |
import traceback
from functools import partial
from textx import metamodel_from_str, get_location
from strictdoc.backend.dsl.error_handling import StrictDocSemanticError
from strictdoc.backend.source_file_syntax.grammar import SOURCE_FILE_GRAMMAR
from strictdoc.helpers.string import get_lines_count
class Req:
d... |
"""Module for searching the toolshed repositories"""
import logging
import whoosh.index
from whoosh import scoring
from whoosh.fields import KEYWORD, NUMERIC, Schema, STORED, TEXT
from whoosh.qparser import MultifieldParser
from whoosh.query import And, Every, Term
from galaxy import exceptions
from galaxy.exceptions... |
#################################
# Code Memory Usage Measurement #
#################################
import gc
import logging
import os
import statistics
from collections import defaultdict
from functools import wraps
from memory_profiler import Pipe, Process, choose_backend, _get_memory
from ._meta import AutoContex... |
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
# (c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
"""
Extended base class for fenpei job that runs through an executable (incl. shell script);
this should be considered abstract.
As with :ref:Job, your custom job(s) should inherit from this job and extend the relevant methods.
Instead of :ref: prepare and :ref: start, you can override:
* get_files
* run_file
"""
f... |
from threading import Thread, Event
from PySide6.QtCore import Slot, QSize, Qt, QThreadPool, QRunnable, QObject, Signal
from PySide6.QtGui import QAction
from PySide6.QtWidgets import QMenu, QComboBox, QFileDialog, QSystemTrayIcon, QStyle, QCheckBox, QWidget, QPushButton, QMainWindow, QLabel, QLineEdit, QVBoxLayout, QH... |
r"""
===============
CORS Middleware
===============
.. versionadded:: 0.2.0
Dealing with CORS headers for aiohttp applications.
**IMPORTANT:** There is a `aiohttp-cors
<https://pypi.org/project/aiohttp_cors/>`_ library, which handles CORS
headers by attaching additional handlers to aiohttp application for
OPTIONS (... |
# Copyright 2014 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... |
# IBM_PROLOG_BEGIN_TAG
#
# Copyright 2019,2020 IBM International Business Machines Corp.
#
# 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/LICENS... |
import sys
import pickle
import argparse
import re
import rouge
from nltk.translate.bleu_score import corpus_bleu, sentence_bleu
from myutils import prep, drop, statusout, batch_gen, seq2sent, index2word
def prepare_results(p, r, f, metric):
return '\t{}:\t{}: {:5.2f}\t{}: {:5.2f}\t{}: {:5.2f}'.format(metric, 'P... |
"""Adapted from:
@longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch
@rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn
Licensed under The MIT License [see LICENSE for details]
"""
from __future__ import print_function
import torch
import torch.nn as nn
import to... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
import json
import pandas as pd
import re
import ir_thermography.thermometry as irt
import matplotlib.ticker as ticker
from scipy import interpolate
from scipy.signal import savgol_filter
from scipy import interpolate
import platform
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Compute WWTP technical potential
==================================
"""
import math
import os
import secrets
import shutil
from typing import Any, Dict, List
import pandas as pd
from grass_session import Session # isort:skip
from grass.pygrass.modules import Modu... |
"""iCloud account."""
from datetime import timedelta
import logging
import operator
from typing import Dict
from pyicloud import PyiCloudService
from pyicloud.exceptions import PyiCloudFailedLoginException, PyiCloudNoDevicesException
from pyicloud.services.findmyiphone import AppleDevice
from homeassistant.components... |
#!/usr/bin/env python3
from os.path import abspath, basename, dirname, join
import argparse, glob, packaging, requests, subprocess, sys
from packaging.version import parse
from natsort import natsorted
# The base name of our generated images
PREFIX = 'adamrehn/ue4-runtime'
# The list of supported Ubuntu LTS releases... |
#
# Copyright (c) 2013, Digium, Inc.
#
"""Code for handling the base Swagger API model.
"""
import json
import os
import urllib.request, urllib.parse, urllib.error
import urllib.parse
from swaggerpy.http_client import SynchronousHttpClient
from swaggerpy.processors import SwaggerProcessor, SwaggerError
SWAGGER_VERS... |
#
# 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
# ... |
import subutai
import subuco
import hashlib
import datetime
import os
import stat
import tarfile
from shutil import copyfile
from subprocess import call
from time import sleep
from subprocess import run, Popen, PIPE
# This file provides functions and classes specific to
# Linux platform
def GetVirtualMachineName():... |
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from scipy.ndimage import gaussian_filter1d
import tensorflow as tf
import os
from scipy import signal
import scipy
from skued import baseline_dt
def make_prediction(X, model, crystal_system)... |
"""
Phase Estimation Benchmark Program - Qiskit
"""
import sys
import time
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
sys.path[1:1] = ["_common", "_common/qiskit", "quantum-fourier-transform/qiskit"]
sys.path[1:1] = ["../../_common", "../../_common/qiskit", "../../quantu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
from datetime import datetime as dt
from sharedutils import gcount
from sharedutils import openjson
from sharedutils import postcount
from sharedutils import hostcount
from sharedutils import groupcount
from sharedutils import postssince
from sharedu... |
import datetime
import os
import tempfile
from collections import OrderedDict
import boto3
import pandas as pd
import pytest
import yaml
from moto import mock_s3
from numpy.testing import assert_almost_equal
from pandas.testing import assert_frame_equal
from unittest import mock
from triage.component.catwalk.storage ... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import time
import numpy as np
from acq4.devices.Stage import Stage, MoveFuture
from pyqtgraph import ptime
from acq4.util import Qt
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
class MockStage(Stage):
def __init__(self, dm... |
from dataclasses import dataclass
from typing import Any, Dict, Generator, List, Optional
try:
import boto3 # type:ignore
from botocore.client import ClientError
from botocore.exceptions import ParamValidationError
S3NativeClient = Any
S3NativeBucket = Any
except (ImportError, ModuleNotFoundError... |
#!/usr/bin/env python
#
# Copyright (c) 2020, The OpenThread Authors.
# 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
# notic... |
import pandas as pd
import numpy as np
import random
from random import expovariate as nexttime
import matplotlib.pyplot as plt
import sys
import cv2
import glob
sys.path.append('../../Python')
from time import time as t
import seaborn as sns
import os
import math
import sympy
import datetime as dt
from sympy import *... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 16:54:33 2019
@author: TMaysGGS
"""
'''Updated on 07/31/2019 11:14'''
'''Problem
There is an intermediate layer that has the shape (m, m), which means a 26928 * 26928 matrix.
Each element takes 32 bit so that the total space needed is more than 21G, which w... |
import os
import tempfile
import zipfile
from io import BytesIO
import cv2
import click
import numpy as np
from skimage import filters
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from dataset import rtranspose
from loader import get_loaders
from loss import ... |
# -*- coding: utf-8 -*-
# Copyright 2022, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of eoreader project
# https://github.com/sertit/eoreader
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... |
# -*- coding: utf-8 -*-
import argparse
import logging
import random
from collections import Counter
import math
import numpy as np
import pandas as pd
import torch
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from pytorch_lightning.core.lightning import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CS224N 2019-20: Homework 5
vocab.py: Vocabulary Generation
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
Usage:
vocab.py --train-src=<file> --train-tgt=<file> [options] VOCAB_FILE
Options:
-h --help Show this screen.
--train-src=<file> File ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 30 12:26:38 2012
Author: <NAME>
"""
'''
function jc = c_sja(n,p)
% PURPOSE: find critical values for Johansen maximum eigenvalue statistic
% ------------------------------------------------------------
% USAGE: jc = c_sja(n,p)
% where: n = dimension of the VAR system
... |
import torch
import numpy as np
import pandas as pd
import SimpleITK as sitk
from torch.utils.data import Dataset, DataLoader
class ImageRegistrationDataset(Dataset):
"""Dataset for pairwise image registration."""
def __init__(self, csv_file_img, csv_file_msk=None, normalizer=None, resampler=None):
"... |
#!/usr/bin/env python3
#
# Pocket SDR Python AP - GNSS Signal Tracking Log Plot
#
# Author:
# T.TAKASU
#
# History:
# 2022-02-11 1.0 new
#
import sys, re
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import sdr_rtk
mpl.rcParams['toolbar'] = 'None';
mpl.rcParams['font.size'] = 9
# ... |
"""
Implementation of Termbox Python API in tdl.
See README.md for details.
"""
import tdl
"""
Implementation status:
[ ] tdl.init() needs a window, made 132x60
[ ] Termbox.close() is not implemented, does nothing
[ ] poll_event needs review, because it does not
completely follows the original logic
[ ] pee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.