text stringlengths 3.07k 22.1k |
|---|
import os
import sys
import io
import operator
import csv
from abc import ABC, abstractmethod
from pathlib import Path
from typing import NamedTuple, Callable, Optional, List, Tuple
from urllib.parse import quote
import click
from PIL import Image
from methodtools import lru_cache
from loguru import logger
import requ... |
import allure
import pytest
import os
import json
import logging
from copy import deepcopy
from tests.common.utilities import wait_until
logger = logging.getLogger(__name__)
TEMP_STATUS_FILE = "/tmp/firmwareupdate/fw_au_status"
WARM_REBOOT = "warm"
COLD_REBOOT = "cold"
POWER_CYCLE = "power off"
FAST_REBOOT = "fast... |
import importlib
import sys
from datetime import timedelta as delta
import numpy as np
import parcels
import xarray as xr
sys.path.append("/nethome/4302001/diffusion-hydro-mod/kernels")
import density_elements_sampled
import Le_Sommer_elements
import EM_3D_BC
import M1_3D_BC
import K_Le_Sommer
import K_Redi_smallslop... |
"""Monte Carlo Tree Search, as described in Silver et al 2017.
This is a "pure" implementation of the AlphaGo MCTS algorithm in that it is not specific to the
game of Go; everything in this file is implemented generically with respect to some state, actions,
policy function, and value function.
"""
import numpy as np
... |
"""timeseries_utils provides general functionality for generating and processing time series"""
from functools import reduce
from typing import List, Union
import pandas as pd
import numpy as np
from sfc.modules.utils.enums import Interval
def sample_from_scipy_distribution(dist, size, **kwargs):
""" use a given... |
#!/usr/bin/env python
# coding=utf-8
import logging
import time,Global
from handlers.kbeServer.Editor.Data import data_work
from methods.DBManager import DBManager
from handlers.kbeServer.Editor.Interface import interface_obj,interface_global,interface_project
from handlers.kbeServer.Editor.Interface import interface_... |
"""Definitions for constants exported by OpenLDAP
This file lists all constants we know about, even those that aren't
available in the OpenLDAP version python-ldap is compiled against.
The information serves two purposes:
- Generate a C header with the constants
- Provide support for building documentation without c... |
import scipy
import numpy as np
import os
import sys
from data_profiler.labelers.classification_report_utils import classification_report
import warnings
from sklearn.exceptions import UndefinedMetricWarning
warnings.filterwarnings("ignore", category=UndefinedMetricWarning)
# in case of data profiler in own repo
_f... |
"""Tests for the image module."""
# Copyright 2019 CSIRO (Data61)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# Copyright 2011-2021 IBM Corporation
#
# 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 writ... |
#!/usr/bin/env python3
"""
This script is used to create a release of biocode for submission to PyPi.
Version numbering: This project uses a sequence-based (micro) scheme for
assigning version numbers:
http://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/specification.html#sequence-based-scheme
... |
"""Thermal Image manipulation utilities."""
import cv2 as cv
import numpy as np
from matplotlib import cm
def sensor_vals_to_temp(
raw,
Emissivity=1.0,
ObjectDistance=1,
AtmosphericTemperature=20,
ReflectedApparentTemperature=20,
IRWindowTemperature=20,
IRWindowTransmission=1,... |
# -*- coding: utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
from collections import defaultdict
from typing import Dict
from mido import MidiFile
from dataclasses import dataclass
from map_midi_settings_mdbsl import *
from split_type0_midi import subdivide_midi_tracks
import os;
dry_run = False
overwrite = False
new_file_location = 'Modified'
track_names = [
'dun_boss',
'd... |
import pytest
from prosemirror.model import Schema, Slice
from prosemirror.transform import Transform, can_split, find_wrapping, lift_target
schema = Schema(
{
"nodes": {
"doc": {"content": "head? block* sect* closing?"},
"para": {"content": "text*", "group": "block"},
... |
import dataclasses
import traceback
import itertools
import warnings
import logging
import shutil
import json
import os
from datetime import datetime
from typing import Any, Union
from time import time
from brownie.network.contract import Contract
from brownie import web3, chain
from yearn.special import Backscratch... |
# This file is a part of pyctr.
#
# Copyright (c) 2017-2021 <NAME>
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE in the root of this project.
"""Module for interacting with CTR Importable Archive (CIA) files."""
from enum import IntEnum
from io import BytesIO
fro... |
import logging
from collections import defaultdict
from functools import partial
import numpy as np
from torch.utils import data
def get_label_indices(y):
label_indices = {}
for i in np.unique(y):
label_indices[i] = list(np.where(y == i)[0])
return label_indices
def get_partition_indices_train(... |
import numpy as np
import matplotlib.pyplot as plt
from concentration_lib.empirical_concentration_bounds import empirical_small_samples_ptlm, \
empirical_hedged_capital_bound
from concentration_lib.concentration_variance_bounds import empirical_chernoff_zero_mean_std_dev_bound, \
bentkus_pinelis_std_dev_bound
i... |
# Copyright 2014
# The Cloudscaling Group, 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... |
import math
from pysam import FastaFile, AlignmentFile
from singlecellmultiomics.utils.prefetch import Prefetcher
from collections import Counter
import numpy as np
from pysamiterators import CachedFasta
from array import array
class Reference(Prefetcher):
""" This is a picklable wrapper to pass reference handles ... |
import tqdm
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from datetime import datetime, timedelta
from optparse import OptionParser
import time
from beautifultable import BeautifulTable
from selenium.webdriver.suppo... |
import sys, os
import argparse
from collections import OrderedDict
import gffutils as gff
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from io import StringIO
import numpy as np
from random import sample
codons = [
'ATA', 'ATC', 'ATT', 'ATG', 'ACA', 'ACC', 'ACG', 'ACT', 'AAC', ... |
import math
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import Parameter
import torch.nn.functional as F
from .BBBdistributions import Normal, Normalout, distribution_selector
from torch.nn.modules.utils import _pair, _triple
import numpy as np
DEVICE = torch.device("cuda" if to... |
"""Tests for square-free decomposition algorithms and related tools."""
import pytest
from diofant import FF, QQ, ZZ, DomainError, I, ring, sqrt
from diofant.polys.specialpolys import f_polys
__all__ = ()
f_0, f_1, f_2, f_3, f_4, f_5, f_6 = f_polys()
def test_dmp_sqf():
R, x = ring('x', ZZ)
assert R(0).... |
"""UNIX terminal recording functionalities
This module exposes functions for
- recording the output of a shell process in asciicast v2 format (`record`)
- producing frames (2D array of CharacterCell) from the raw output of
`record` (`timed_frames`)
A context manager named `TerminalMode` is also provided a... |
"""
These utility functions are meant for computing basic statistics in a set of tfrecord
files. They can be used to sanity check the training and testing files.
"""
import argparse
import numpy as np
import tensorflow as tf
def class_stats(tfrecords):
"""
Sum the number of images and compute the number o... |
"""
simpleglfw.py
Simple Python OpenGL program that uses PyOpenGL + GLFW to get an
OpenGL 3.2 context.
Author: <NAME>
"""
import OpenGL
from OpenGL.GL import *
import numpy, math, sys, os
import glutils
from axes import Axes3D
import glfw
strVS = """
#version 330 core
layout(location = 0) in vec3 aVert;
layout(... |
import pytorch_lightning as pl
import math
import torchvision.models as models
import torchvision.transforms as T
from PIL import Image
from src.utils import utils
import os
from dotmap import DotMap
from src.systems.image_systems import PretrainViewMakerSystem
import torch
import torch.nn as nn
from src.dat... |
import json
import warnings
import cassandra
from cqlengine import SizeTieredCompactionStrategy, LeveledCompactionStrategy
from cqlengine.named import NamedTable
from cqlengine.connection import connection_manager, execute
from cqlengine.exceptions import CQLEngineException
import logging
from collections import name... |
#!/usr/bin/env python
import glob
import os
import shutil
import subprocess
from epregressions.structures import ForceRunType
path = os.path.dirname(__file__)
script_dir = os.path.abspath(path)
class ExecutionArguments:
def __init__(self, build_tree, entry_name, test_run_directory,
run_type, mi... |
from __future__ import print_function
import random, py
from rpython.jit.backend.llsupport.asmmemmgr import AsmMemoryManager
from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper
from rpython.jit.backend.llsupport.asmmemmgr import BlockBuilderMixin
from rpython.jit.backend.llsupport.codemap import... |
# import os
import json
from django.http import HttpResponse
from django.utils.module_loading import import_string
import datetime
# from io import BytesIO
# from datetime import datetime
# from pdf2docx import Converter
# from docx import Document
# import fitz
# from pdf2docx import Page
# from appconf.manager impo... |
import hashlib
def migrate_search(tenant_session: object, original_session: object, rule: str, policy_name: str, policy_description: str, logger):
'''
Main function that will get info about the search to be migrated, like the RQL and time range, then dispatches
the proper functions to perform and then save ... |
import os
import datetime
import sys
from flask import (
abort,
flash,
redirect,
render_template,
url_for,
current_app,
request
)
from flask.ext.login import current_user, login_required
from flask.ext.rq import get_queue
from werkzeug.utils import secure_filename
from sqlalchemy.exc import ... |
from chainer import cuda
from chainer import function
from chainer.utils import type_check
from ctypes import *
import numpy as np
import cupy
import time
import os
dllpath = '/home/monica/Documents/chainer-1.17.0-RAP/chainer/functions/cnet/libcnet.so'
lib = CDLL(dllpath, RTLD_GLOBAL)
class data_t(Structure):
_fie... |
#!/usr/bin/env python
import sys
import subprocess
import requests
import os
import datetime
from pathlib import Path
from detect_wrapper import globals
from detect_wrapper import output
from detect_wrapper import init
from detect_wrapper import data
from detect_wrapper import config
def get_detect_jar():
if glo... |
# -*- coding: utf-8 -*-
"""
Functions used to compress and decompress a GraphTransliterator.
"""
import math
def compress_config(config, compression_level=1):
"""
Compress configuration to minimize JSON size.
Compression uses integer lookup for classes, tokens, and graph node types, as well
as numero... |
# 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 errno
import ... |
#!/usr/bin/env python
import torch
from gpytorch.likelihoods import (
GaussianLikelihood, BernoulliLikelihood, MultitaskGaussianLikelihood,
SoftmaxLikelihood)
from selective_gp.models import DeepGPModel, GPLVM
from selective_gp.layers import SVGP
from selective_gp.datasets import SyntheticData, SquareWave, R... |
import os
import math
class Node(object):
def __init__(self, parent, degree):
self.parent = parent
self.degree = degree
self.previous_node = None
self.next_node = None
self.keys = list()
self.children = list()
self.t = 'node'
def property(self):
... |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS
Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file exce... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, Calour development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------... |
import bpy
from bpy_extras.io_utils import ImportHelper
from collections import namedtuple
from enum import IntEnum
from struct import *
import os
file_magic = b'MAT '
required_version = 0x32
required_type = 2
class ColorMode(IntEnum):
Indexed = 0
RGB = 1
RGBA = 2
color_format = named... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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... |
import os
import numpy as np
import json
from PIL import Image
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
def detect_red_light(I, im_name):
'''
This function takes a numpy array <I> and returns a list <bounding_boxes>.
The list <bounding_boxes> should have one element for each... |
import numpy as np
import heapq as heap
from cdfs_rows import Stack
class PriorityQueue:
def __init__(self, maxim=False):
self.heap = []
self.count = 0
self.reverse = dict()
self.maxim = maxim
def push(self, value, item):
if self.maxim:
value = - value
... |
import string
from django.db.models import Q
from rest_framework import generics, mixins, status
from rest_framework.decorators import api_view
from rest_framework.pagination import PageNumberPagination
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from rest_framework.... |
# Adapted from https://github.com/ubisoft/ubisoft-laforge-DisentanglementMetrics/blob/main/src/metrics/dci.py
# coding=utf-8
# Copyright 2018 Ubisoft La Forge 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 Lic... |
from copy import copy
import numpy as np
from ._shapes_constants import Mode
from ._shapes_models import Ellipse, Line, Path, Polygon, Rectangle
from ._shapes_utils import point_to_lines
def highlight(layer, event):
"""Highlight hovered shapes."""
layer._set_highlight()
def select(layer, event):
"""Se... |
# Copyright 2016 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 base64
from google.appengine.ext import ndb
from gae_libs.model.versioned_model import VersionedModel
from model import result_status
from model imp... |
"""
.. module:: utilities
:platform: Unix
:synopsis: Helpful function for ScatterBrane
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME>
"""
from __future__ import print_function
import numpy as np
from scipy.interpolate import RectBivariateSpline
from scipy.ndimage.filters import gaussian_filter
... |
import json
from math import isnan
from itertools import compress
from hashlib import md5
from numbers import Number
from typing import Optional, Tuple, Sequence, Any, List, Iterable, Dict
from coba.pipes import Source, HttpSource
from coba.config import CobaConfig, CobaException
from coba.simulations.core import Co... |
# ==================================================
# Copyright (C) 2017-2020
# author: <NAME>
# email: <EMAIL>
# Date: 2020-01-20
#
# This file is part of ImageClassification project.
# Base model train/valid/test
#
# This can not be copied and/or distributed
# without the express permission of Claire Tang
# ========... |
#!/usr/bin/env python
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import contextlib
import json
import logging
import os
import socket
import sys
import tempfile
import time
import unittest
... |
# python >= 3.4
from typing import (
Callable,
Dict,
Generic,
Iterable,
List,
Mapping,
Tuple,
Type,
TypeVar,
Union,
)
K = TypeVar('K')
T = TypeVar('T')
T_co = TypeVar('T_co', covariant=True)
V = TypeVar('V')
list_of_ints = [42] # type: List[int]
list_of_ints_and_strs = [42, '... |
from datetime import datetime
import itertools
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.template.defaultfilters import date as dj_date, linebreaks, striptags
from caching.base import Cachin... |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: ATLH
# Description: Generates equality queries
# Modifications:
# Date Name Modification
# ---- ---- --------... |
"""Tensorboard summaries for the single graph AdaNet implementation.
Copyright 2018 The AdaNet 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
https://www.apache.... |
import csv
import mne
import pandas as pd
import matplotlib.pyplot as plt
import torch
import math
import numpy as np
import json
import re
import ast
def make_file_list(edf_list: str, csv_list: str, data_dir: str) -> list:
file_list = []
file1 = open(edf_list)
file2 = open(csv_list)
reader1 = csv.rea... |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... |
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
import itertools
import json
import os
import shutil
import tarfile
from datetime import datetime
from leapp.cli.commands import command_utils
from leapp.config import get_config
from leapp.exceptions import CommandError
from leapp.repository.scan import find_and_scan_repositories
from leapp.utils.audit import get_che... |
# Copyright (c) 2012 - 2014 Oodrive
# 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... |
#public variables. the deliminators do not need to be, but in case I want to change them later.
INTEGERS = "0123456789"
STRING_DELIMINATOR = '"'
EOL_DELIMINATOR = ';'
class Token:
def __init__(self, KW_type, value): #takes a type and a value
self.KW_type = KW_type
self.value = value
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 18 02:58:47 2021
@author: kylei
"""
import tensorflow as tf
import keras
import numpy as np
from . import keras_backend as kb
import copy
from numba import jit
class WrappedModel:
def __init__(self, X, y, model, structure, functions, mode, fitness):
"""
... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import os
import numpy as np
import random
import torch
import argparse
fr... |
import github3
from github3.issues.comment import IssueComment
from github3.issues.event import IssueEvent
from github3.issues.label import Label
from github3.issues.milestone import Milestone
from github3.issues import Issue
import datetime
from tests.utils import BaseCase, load, mock
class TestLabel(BaseCase):
... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy
from scipy.interpolate import interp2d
from shapely.geometry import Polygon
import rasterio
import rioxarray
def distance_between_two_points(p1, p2):
x1, y1 = p1
x2, y2 = p2
return np.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
... |
"""
medsenger_api.
Python SDK for Medsenger.AI
"""
__version__ = "0.1.14"
__author__ = '<NAME>'
__credits__ = 'TelePat LLC'
import base64
import uuid
from copy import copy
import requests
from datetime import datetime
class AgentApiClient:
def __init__(self, api_key, host="https://medsenger.ru", agent_id=None, ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import itertools
from datetime import datetime
import sys
from anonymizer.utils.dateutil.parser import parse
import pytest
# Platform info
IS_WIN = sys.platform.startswith("win")
try:
datetime.now().strftime("%-d")
PLATFORM_HAS_DASH_D = True
e... |
import datetime
from warp.utils import GlobalImport
# from warp.graph import Ancestry
import warp.globals
import warp.constants as constants
__all__ = ['create_server']
def add_layout(app, workspace):
# sessions = sorted(workspace.sessions, key=lambda k: float(k))
sessions = workspace.sessions
session_... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... |
#!/usr/bin/env python3
import re
import logging
from pathlib import Path
from dataclasses import dataclass
from itertools import chain
from collections import namedtuple
from typing import Match, Tuple, Sequence, List, Optional
from single_version import get_version
__version__ = get_version('vistickedword', Path(_... |
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import datetime
import urllib2
from collections import OrderedDict
from contextlib import contextmanager
from os import environ, sep, path, remove
import nexusproto.NexusContent_pb2 as nexusproto
import numpy... |
from collections import defaultdict
from random import randint
from csv import reader
from sys import argv
from time import time
import numpy as np
import multiprocessing
"""
Configure for algorithm.
@param K : number of cluster
@param MT : number of main iterate turn
@param RT : number of ranking algorith... |
"""
Copyright (c) 2012-2013 F-Secure
See LICENSE for details
"""
from PySide.QtCore import Qt, QObject, Slot, QFile
from PySide.QtGui import QApplication, QTreeWidgetItem, QMessageBox
from PySide.QtUiTools import QUiLoader
#from PySide import QtXml
import random
import time
from threading import Thread, Event
import Q... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2011/12/08
@author: <NAME>
'''
from cafysis.elements.error import MyError
from cafysis.elements.psf import Psf, Atom
def line2atom(line):
line.rstrip()
atom = Atom()
## Old
#atom.atom_id = int(line[0:8])
#atom.seg_name = line[8:11]
#a... |
# Copyright 2017-2020 TensorHub, 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 writ... |
import numpy as np
from numba import njit
### helpers
### snow module
@njit
def cema_neige(Temp, Prec, params):
'''
Cema-Neige snow model
Input:
1. Data - timeseries:
'T'- mean daily temperature (Celsium degrees)
'P'- mean daily precipitation (mm/day)
2. Params - list of model... |
from zope.interface import implementer
from pyramid.interfaces import ISession
from pyramid.interfaces import ISessionFactory
from pyramid.session import (
signed_deserialize,
signed_serialize,
)
def includeme(config):
"""
This function is detected by Pyramid so that you can easily include
`py... |
# Copyright 2020 Intel Corporation
#
# 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 wri... |
#!/usr/bin/env python
# <NAME> 2019
"""
Automatically compare ground truth map with map created from SLAM.
This functionality exposed as Service.
Visualization runs in seperate Thread to not latch Service server.
"""
import numpy as np
import cv2
import rospy
from math import sqrt
from threading import Thread, Event... |
"""Custom plugin manager for Maya.
:created: 10/07/2017
:author: <NAME> <<EMAIL>>
"""
from collections import defaultdict
import fnmatch
from functools import partial
import os
from PySide2 import QtCore, QtGui, QtWidgets
from maya import cmds, mel
class FrameLayout(QtWidgets.QGroupBox):
"""Improved version of... |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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... |
'''
Created on 30 Jul 2017
@author: tim
'''
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.properties import (NumericProperty, ListProperty,
ObjectProperty, BooleanProperty,
... |
#! /usr/bin/env python3
from __future__ import absolute_import, print_function, unicode_literals
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import unquote, urlparse
from time import time
import os # environment vars
import sys
if "HB_URL" in os.environ:
# NOTE: extract host an... |
""" train arcface model
with pytorch DistributedDataParallel
The learning time has been reduced by 1/5.
"""
import argparse
from email.policy import default
import os
import random
import time
import cv2
import numpy as np
import logging
import warnings
# albumentation
import albumentations as A
# pytorch... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: common/objects.py
# Purpose: Commonly used Objects and Mixins
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2009-2015 <NAME> and the music21 Project
# License: ... |
#!/usr/bin/env python3
''' archivetube - web interface for archived videos '''
import os
import sys
import sqlite3
import argparse
import time
from server import Server
import atcommon as atc
import atstatistics as ats
# --------------------------------------------------------------------------- #
def main(args):
... |
# YOLOv5 reproduction 🚀 by GuoQuanhao
"""
Loss functions
"""
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from utils.metrics import bbox_iou
from utils.paddle_utils import is_parallel
import numpy as np
def smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecomme... |
# TODO Variance can be calculated for the three_fold
# TODO Group Size Effects can be accounted for
# TODO Non-Linear Oaxaca-Blinder can be used
"""
Author: <NAME>
This class implements Oaxaca-Blinder Decomposition. It returns
a OaxacaResults Class:
OaxacaBlinder:
Two-Fold/Pooled (two_fold)
Three-Fold (three_fold)
O... |
import os
import shutil
import warnings
import random
import logging
import msm_pele.constants as cs
import msm_pele.Helpers.helpers as hp
class EnviroBuilder(object):
"""
Base class wher the needed pele selfironment
is build by creating folders and files
"""
def __init__(self, folders, f... |
'''this script is using the gap statistics to run k-means algorithm for many times to
find the best K value for the dataset.
because k-mean really depends on the initial points and thus the results can be different given different initial points;
therefore use sklearn packages to run many times with different initial ... |
# -*- coding: UTF-8 -*-
# Xueqiu.com stock data
import json
import pandas as pd
from .basic import *
import datetime
import time
import traceback
from os.path import dirname
from qcinfo.log import qcinfo_log
logger = qcinfo_log()
base_url = "https://stock.xueqiu.com"
header = {
"Accept": "application/json, text... |
#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 (c) 2010-2021 <NAME> <<EMAIL>>
# Copyright (c) 2008-2016, Neotion
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Miscellaneous helpers"""
#pylint: disable-msg=invalid-name
#pylint: disable-msg=import-outside-toplevel
#pylint: disable-msg=too-many-locals
#pylint: disable-msg=too-many-a... |
# Copyright DataStax, 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, softwa... |
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... |
import torch.nn as nn
import torch
from torchvision import models
import torch.nn.functional as F
import math
from Network.class_func import Class2Count
from Network.merge_func import count_merge_low2high_batch
#import ipdb
#from utils import save_net,load_net
###################
# =====================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.