text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# Inspired by https://github.com/silvester747/aio_marantz_avr
#
# This is to control Denon/Marantz AVR devices
#
# Copyright (c) 2020 <NAME>
#
# Note large part of this code was taken from scapy and other opensource software
#
# Permission is hereby granted, free of charg... |
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
"""Build oneVPL-cpu ffmpeg dependencies"""
from io import BytesIO
import sys
import os
import... |
from google.protobuf.symbol_database import Default
import nltk
import random
import pickle
from nltk.corpus.reader.chasen import test
from pandas.core.indexes import period
from statsmodels.tsa.seasonal import _extrapolate_trend
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemm... |
# coding: utf-8
import base64
from decimal import *
from .asset import Asset
from .stellarxdr import Xdr
from .utils import account_xdr_object, signer_key_xdr_object, encode_check, best_rational_approximation as best_r, division, decode_check
from .utils import XdrLengthError, DecodeError
ONE = Decimal(10 ** 7)
cla... |
import csv
import glob
from biothings.utils.dataload import list_split, dict_sweep, unlist, value_convert_to_number
VALID_COLUMN_NO = 245
'''this parser is for dbNSFP v3.5a beta2 downloaded from
https://sites.google.com/site/jpopgen/dbNSFP'''
# convert one snp to json
def _map_line_to_json(df, version, include_gnom... |
from __future__ import absolute_import
from __future__ import print_function
import os,time,cv2,sys,math
import tensorflow as tf
import numpy as np
import time, datetime
import argparse
import random
import os, sys
import subprocess
from utils import utils, helpers
from builders import fusion_model_builde... |
#-
# ==========================================================================
# Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All
# rights reserved.
#
# The coded instructions, statements, computer programs, and/or related
# material (collectively the "Data") in these files contain unpublished
# inf... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe import msgprint, _
from frappe.utils import cstr, flt, cint
from erpnext.controllers.stock_con... |
# Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... |
"""
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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... |
# pyenchant
#
# Copyright (C) 2004-2011, <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libr... |
import os
import h5py
import pandas as pd
import logging
import numpy as np
from progress.bar import Bar
from multiprocessing import Pool, cpu_count
from omegaconf import OmegaConf
from tools.utils import io
# from ANCSH_lib.utils import NetworkType
# from tools.visualization import Viewer, ANCSHVisualizer
import uti... |
import os
import sys
import re
import shutil
import importlib.util
import numpy as np
from datetime import datetime
import time
import pathlib
import logging
import PSICT_UIF._include36._LogLevels as LogLevels
## Worker script breakpoints - DO NOT MODIFY
OPTIONS_DICT_BREAKPOINT = '## OPTIONS DICT BREAKPOINT'
SCRIPT_C... |
"""
Copyright (c) 2018, University of Oxford, Rama Cont and ETH Zurich, <NAME>
This module provides the helper functions and the class LOBSTERReader, a subclass of OBReader to read in limit order book data in lobster format.
"""
######
# Imports
######
import csv
import math
import warnings
import numpy as np
fr... |
import scipy
import scipy.sparse.csgraph
import wall_generation, mesh
import mesh_operations
import utils
import triangulation, filters
from mesh_utilities import SurfaceSampler, tubeRemesh
import numpy as np
def meshComponents(m, cutEdges):
"""
Get the connected components of triangles of a mesh cut along the... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, <NAME>PORATION. 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... |
import asyncio
import datetime
import json
import logging
import os
from collections import Counter
from copy import deepcopy as dc
from io import BytesIO
from random import choice as randchoice
from random import randrange as rrange
from re import match, sub
from statistics import mean as avg
from time import time as ... |
##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
from ..testutils import BaseTestCase, compare_files, temp_files, regenerate_references
import unittest
import numpy as np
import pickle
import time
import warnings
import pygsti
from pygsti.extras import idletomography as idt
#Helper functions
#Global dicts describing how to prep and measure in various bases
prepDict... |
"""
Unit tests over parameter combinations of the library.
TODO ADD MORE
"""
from __future__ import print_function
from minorminer import find_embedding as find_embedding_orig
from warnings import warn
import os
import sys
import time
# Given that this test is in the tests directory, the calibration data shou... |
import props.graph_representation.node
from props.graph_representation.graph_wrapper import GraphWrapper
from props.graph_representation.word import Word, NO_INDEX
from props.graph_representation.node import Node,CopularNode,PossessiveNode,PropNode,\
AppositionNode, PrepNode, CondNode, ConjunctionNode, advNode,... |
from typing import List, Dict, Tuple
from collections import Counter
import random
import lesson3
from lesson5 import inverse_normal_cdf
import math
import matplotlib.pyplot as plt
from lesson4 import correlation, standard_deviation
from lesson3 import Matrix, Vector, make_matrix, vector_mean, subtract, magnitude, sca... |
# Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import collections
import urllib
import re
import six
from concurrent.futures import ThreadPoolExecutor, wait
import requests
from jq import jq
import koji
import gluetool
from gluetool import GlueError
from gluetool.action... |
import csv
import os
import re
from operator import itemgetter
from typing import Tuple
from urllib import parse
import json
from itertools import groupby
from markdown.extensions.toc import slugify
from iir import xml_to_filt
def extract_from_repo(path1: str, path2: str, content_type: str):
'''
extracts b... |
import subprocess
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import proj3d
import scipy
from scipy.sparse.linalg import lsqr
import time
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from matplotlib.widgets import Slider,... |
import pygame
import screen
import os
import socket
import protocol
import logging
from screen import *
clock = pygame.time.Clock()
BACKGROUND_IMAGE_PATH = os.path.join(PICTURES_PATH, 'opening_screen_picture.png')
bg_image = pygame.image.load(BACKGROUND_IMAGE_PATH)
bg_image = pygame.transform.scale(bg_image, (SCREEN_... |
import argparse
import copy
import optuna
import os
from datetime import datetime
import torch
import torch.nn as nn
import torch.optim as optim
from src.dataloader import create_dataloader
from src.model import Model
from src.utils.torch_utils import model_info
from src.utils.common import read_yaml
from src.utils.mac... |
"""Low level module for IgBLAST api calls
You probably only want to interact with this module through airr as the database files are extremely tricky to get right
"""
from __future__ import annotations
import glob
import logging
import os
import subprocess
import tempfile
import warnings
import semantic_version
from ... |
import datetime
import json
import re
import os
import requests
import time
import threading
import pickle
from django.core.mail import send_mail
from django.db import connection
from django.http import JsonResponse
from django.shortcuts import render_to_response, render
from django.core.cache import cache
from ApiMa... |
from tqdm import tqdm
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from scipy.sparse import issparse
import numdifftools as nd
from multiprocessing.dummy import Pool as ThreadPool
import multiprocessing as mp
import itertools, functools
from ..tools.utils import timeit
def is_outsid... |
# pylint: disable-msg=E1101
"""
Wrapper to lowess and stl routines.
LOWESS:
Initial Fortran code available at:
http://netlib.bell-labs.com/netlib/go/lowess.f.gz
initial author: <NAME>, 1979.
Simple to double precision conversion of the Fortran code by Pierre
Gerard-Marchant, 2007/03.
STL:
Initial Fortran code availa... |
import numpy as np
from sas7bdat import SAS7BDAT
import glob
import pandas as pd
from sklearn import preprocessing
from sas7bdat import SAS7BDAT
import glob
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import utils, model_selection, metrics, linear_model, neighbors, ensemble... |
import numpy as np
from math import log10
from math import sqrt
import time
import networkx as nx
import matplotlib.pyplot as plt
import pydot
import csv
class Graph(object):
def __init__(self):
self.root = None #root/source node is the start of the graph/tree and multicast source
self.nodes = []
... |
#!/usr/bin/env python
from __future__ import print_function
import time
import traceback
import os
import base64
import random
import sys
import json
import subprocess
from os import walk
from os.path import splitext, join
import io
if sys.version_info >= (3,):
def unicode(s):
return s
from sandbox import... |
"""
digitalarchive.models
The module provides documented models and an ORM for interacting with the DA API.
"""
from __future__ import annotations
# Standard Library
import dataclasses
import json
import logging
import copy
from datetime import datetime, date
from typing import List, Any, Optional, Union, Dict, Class... |
import objax
from jax import vmap, grad, jacrev
import jax.numpy as np
from jax.scipy.linalg import cholesky, cho_factor
from .utils import inv, solve, gaussian_first_derivative_wrt_mean, gaussian_second_derivative_wrt_mean
from numpy.polynomial.hermite import hermgauss
import numpy as onp
import itertools
class Cuba... |
from copy import deepcopy
from .helpers import set_n_jobs, replace_with_in_params
from sklearn.ensemble import (StackingRegressor, StackingClassifier,
VotingClassifier, VotingRegressor)
from joblib import Parallel, delayed
from sklearn.base import clone, is_classifier
from sklearn.utils... |
# Author: <NAME>
# Copyright (c) 2019, <NAME>
# All rights reserved.
# based on github.com/ClementPinard/SfMLearner-Pytorch
import torch
from torch import nn
from torch.autograd import Variable
from inverse_warp import inverse_warp, flow_warp
from ssim import ssim
from process_functions import depth_occlusion_masks,oc... |
import copy
import warnings
from collections.abc import Iterable
from inspect import Parameter, signature
import numpy as np
from sklearn.utils.validation import (
check_array,
column_or_1d,
assert_all_finite,
check_consistent_length,
check_random_state as check_random_state_sklearn,
)
from ._labe... |
# (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import glob
import logging
import os
import traceback
from collections import Counter
from enum import Enum
from typing import Mapping, List, Sequence, Tuple, Set
import lrtc_lib.data_access.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
query_processing.py - Matches the query against the saved indexed chunks and returns a list of dictionaries with docID
author: <NAME>
email: <EMAIL>
date: 12/1/2017
"""
from bs4 import BeautifulSoup
sample_indexed_chunks_dict = {"'s": {'doc_id': {'0'... |
"""
GradeFast Grader - Runs commands on submissions and controls the grading process.
Licensed under the MIT License. For more, see the LICENSE file.
Author: <NAME> <<EMAIL>>
"""
import difflib
import os
import random
import re
from collections import defaultdict
from typing import Any, Dict, List, Mapping, Optional... |
import json
import zipfile
import importlib
from functools import partial
import numpy as np
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset
import torchero
from torchero.utils.mixins import DeviceMixin
from torchero import meters
from torchero import SupervisedTrainer
class Input... |
#!/usr/bin/env python
'''
Takes in the usgs neic event object, then determines if it
is relevant above the input filter criteria. If it passes
this filter, an aoi type for the event is created and submitted
to create_aoi
'''
from __future__ import division
from builtins import range
from past.utils import old_div
im... |
import argparse
import json
import logging
import os
import pprint
import re
import sys
import click._compat
import pkg_resources
from prettytable import PrettyTable
import beowulf as bwf
from beowulfbase.account import PrivateKey
from beowulfbase.storage import configStorage
from .account import Account
from .amount i... |
"""
Implementation of the `multicodec spec <https://github.com/multiformats/multicodec>`_.
Suggested usage:
>>> from multiformats import multicodec
"""
import importlib.resources as importlib_resources
from io import BufferedIOBase
import json
import re
import sys
from typing import AbstractSet, Any, cas... |
# coding=utf-8
""" General tools for the Jupyter Notebook and Lab """
from ipywidgets import HTML, Tab, Accordion, Checkbox, HBox, Layout, Widget, \
VBox, Button, Box, ToggleButton, IntSlider, FloatText
from traitlets import List, Unicode, observe, Instance, Tuple, Int, Float
from .. import batch
# imports for a... |
# Copyright 2018/2019 The RLgraph 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... |
"""
Utility routines for the maximum entropy module.
Most of them are either Python replacements for the corresponding Fortran
routines or wrappers around matrices to allow the maxent module to
manipulate ndarrays, scipy sparse matrices, and PySparse matrices a
common interface.
Perhaps the logsumexp() function belon... |
from tkinter import *
from tkinter import messagebox, colorchooser
from logging import basicConfig, warning, info, error, DEBUG
from os import getcwd, path, mkdir
from time import strftime, time, localtime
from json import dump, load
from re import findall, search
from hmac import new, compare_digest
from hashl... |
# -*- coding: utf-8 -*-
"""
The goal of this code is to support hosting a client library. This module
should in the end function similarly to the Mendeley Desktop.
Syncing
-------------------------------------------
Jim's next goals
----------------
1) Handle deleted IDs - needs an API update
2) Me... |
# this may need to represent in a better way
DataTypes = [
'float',
'vec2',
'vec3',
'vec4',
'int',
'ivec2',
'ivec3',
'ivec4',
'uint',
'uvec2',
'uvec3',
'uvec4',
'bool',
'bvec2',
'bvec3',
'bvec4',
'mat2',
'mat3',
'mat4',
'mat... |
import numpy as np
import tensorflow as tf
from lib.crf import crf_inference
from lib.CC_labeling_8 import CC_lab
def single_generate_seed_step(params):
"""Implemented seeded region growing
Parameters
----------
params : 3-tuple of numpy 4D arrays
(tag) : numpy 4D array (size: B x 1 x 1 x C),... |
"""
Units models
"""
import logging
from datetime import date
import pint.systems
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext as _
from geocurrency.converters.models import BaseConverter, ConverterResult, \
... |
import argparse
import os
import random
import time
import warnings
from math import cos, pi
import cv2
import numpy as np
import torch
import torch.optim as optim
from DLBio.pt_train_printer import Printer
from DLBio.pytorch_helpers import get_lr
class ITrainInterface():
"""
TrainInterfaces handle the pred... |
import pandas as pd
import numpy as np
from statsmodels.formula.api import ols
import plotly_express
import plotly.graph_objs as go
from plotly.subplots import make_subplots
# Read in data
batter_data = pd.read_csv("~/Desktop/MLB_FA/Data/fg_bat_data.csv")
del batter_data['Age']
print(len(batter_data))
print(batter_dat... |
import os
import csv
import itertools
import datetime
import string
import subprocess
from email.message import EmailMessage
import smtplib
import ssl
import zipfile
import xlwings as xw
import xlsxwriter
"""
This module provides convenient objects for pulling,
cleaning, and writing data between Excel and Python.
It ... |
#!/usr/bin/env python
"""
Southern California Earthquake Center Broadband Platform
Copyright 2010-2016 Southern California Earthquake Center
"""
from __future__ import division, print_function
# Import Python modules
import os
import sys
import shutil
import matplotlib as mpl
mpl.use('AGG', warn=False)
import pylab
im... |
"""Training GCMC model on the MovieLens data set.
The script loads the full graph to the training device.
"""
import os, time
import argparse
import logging
import random
import string
import dgl
import scipy.sparse as sp
import pandas as pd
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.f... |
""" This module is a wrapper for lxu.command.BasicCommand.
It improves and simplifies command implementations including popups,
sPresetText fields, and Form Command Lists.
This is based on Adam O'Hern Commander code but is vastly enhanced.
https://github.com/adamohern/commander
"""
import time
impor... |
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
import re
import typing
import unittest
required_conan_version = ">=1.43.0"
# This recipe includes a selftest to test conversion of os/arch to triplets (and vice verse)
# Run... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import random
import math
import logging
import itertools
from fairseq import utils
from fairseq.data import ... |
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import datetime
import logging
import time
import concurrent.futures
from dataclasses import dataclass, field
from typing import List, Tuple, Dict
import re
import netaddr
import ConfigParser
import os
logg... |
import numpy as np
import inspect
from scipy.linalg import qr as qr_factorization
from copy import deepcopy
from pyapprox.utilities import cartesian_product, outer_product
from pyapprox.univariate_polynomials.quadrature import gauss_jacobi_pts_wts_1D
from pyapprox.barycentric_interpolation import (
compute_barycen... |
# -*- coding: utf-8 -*-
"""
# HarmonicNet.
# Copyright (C) 2021 <NAME>, <NAME>, S.Koppers, <NAME>
#
# 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 Liceense at
#
# http://www.apache.org/licenses/LICE... |
import pandas as pd
from transformers import BertTokenizer, RobertaTokenizer, AutoTokenizer
import os
import numpy as np
import re
import glob
from nltk import sent_tokenize
from utils import num_tokens
import math
def read_generic_file(filepath):
""" reads any generic text file into
list conta... |
#!/usr/bin/python3
'''
NAME:
lf_check.py
PURPOSE:
lf_check.py will run a series of tests based on the test TEST_DICTIONARY listed in lf_check_config.ini.
The lf_check_config.ini file is copied from lf_check_config_template.ini and local configuration is made
to the lf_check_config.ini.
EXAMPLE:
lf_check.py
NOTES:
B... |
from __future__ import annotations
import re
from pathlib import Path
from logging import getLogger, Logger
from fileinput import hook_compressed
from dataclasses import dataclass, field, fields
from typing import Iterator, get_type_hints, Generator
import numpy as np
import numpy.typing as npt
from pysam import Tabix... |
import math
import random
import json
import os
from copy import deepcopy
from datetime import date, timedelta
from itertools import cycle
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from django.utils import timezone
from indicators.models import (
Indicator,
I... |
import pygame as pg
import random, time, sys
import copy,numpy,pyautogui,math
# Define settings and constants
pyautogui.PAUSE = 0.03
pyautogui.FAILSAFE = True
# 게임 가로 세로 사이즈
WINDOWWIDTH = 800
WINDOWHEIGHT = 640
#블록 사이즈,가로,세로 길이
BOXSIZE = 30
BOXWIDTH = 5
BOXHEIGHT = 5
#보드 가로, 세로 길이
BOARDWIDTH = 10
BOARDHEIGHT = 20
... |
# -*- coding: utf-8 -*-
"""
* Pizza delivery prompt example
* run example by writing `python example/pizza.py` in your console
"""
from __future__ import print_function, unicode_literals
import regex
from pprint import pprint
from PyInquirer import style_from_dict, Token, prompt
from PyInquirer import Validator, Vali... |
# Modified work:
# -----------------------------------------------------------------------------
# Copyright (c) 2019 Preferred Infrastructure, Inc.
# Copyright (c) 2019 Preferred Networks, Inc.
# -----------------------------------------------------------------------------
# Original work:
# -------------------------... |
import sys
import struct
import asyncio
import threading
import functools
from concurrent.futures import Future
from .. import pb
__all__ = ['DebugProxy', 'DebugCommand', 'AgentController']
class DebugProxy(threading.Thread):
"""
Debugging class, creating a connection between RobotControl and the Nao (naoth... |
"""WizardKit: Hardware objects (mostly)"""
# vim: sts=2 sw=2 ts=2
import logging
import pathlib
import plistlib
import re
from collections import OrderedDict
from wk.cfg.hw import (
ATTRIBUTE_COLORS,
KEY_NVME,
KEY_SMART,
KNOWN_DISK_ATTRIBUTES,
KNOWN_DISK_MODELS,
KNOWN_RAM_VENDOR_IDS,
REGEX_POWER_ON_TIM... |
#!/usr/bin/env python
#Copyright (c) 2014, <NAME> <<EMAIL>>
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#
#* Redistributions of source code must retain the above copyright notice, this
# list of... |
import os, logging, json, re
import pandas as pd
import numpy as np
from BarSeqPy.translate_R_to_pandas import *
def data_prep_1(data_dir, FEBA_dir, debug_bool=False, meta_ix=7, cfg=None):
""" The first phase of data preparation for the BarSeqR Computations
Args:
data_dir: (str) Path to directory whic... |
"""
Transformers
------------
Transformers defines the mutations that can be applied. The ``CATEGORIES`` dictionary lists all
valid category codes that are valid filters. The primary classes are:
1. ``LocIndex``
2. ``MutateAST``
The ``LocIndex`` is a location index within a given Abstract Syntax Tree (AST) that can ... |
#--------------------------------------------------------------------------#
# This code makes use of all other functions of #
# the package to build a Dash Web App #
#--------------------------------------------------------------------------#
# imports ... |
# GUI Tkinter grid file.
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk # pip install pillow (<- in terminal if not already installed)
import tkinter as tk
import csv
# OTHER PYTHON FILES (OURS)
import menuFunctions
import openData
# import moreFunctions
i... |
# Generate an all-pairs covering test suite
#
# (c) 2007 University of Oregon and <NAME>
# All rights reserved.
#
License = """
(C) 2007,2017 University of Oregon and <NAME>. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the followi... |
#!/usr/bin/env python
r'''
Compare two datasets to determine whether there is a significant
difference between them for a specific confidence level using the
t-test methodology for unpaired observations.
Please note that this is not, strictly, a t-test because it switches
over to the standard normal distribution (SND)... |
'''
#############################################################################
#
# M A I N L O O P & P R I M A R Y F U N C T I O N S
#
#############################################################################
'''
import getopt
import os
import random
import signal
import sys
try:
import numpy... |
# import the needed packages
import pickle
from sklearn import preprocessing
import time
from os import listdir
from os.path import isfile, join
from random import randint, uniform
import numpy as np
from matplotlib import pyplot as plt
import cv2 as cv
from scipy import ndimage
from skimage import morphol... |
from __future__ import division
import random
import pprint
import sys
import time
import numpy as np
from optparse import OptionParser
import pickle
import os
import re
import shutil
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.optimizers import Adam, SGD
from tensorflow.ker... |
"""Govee API client package."""
import asyncio
import logging
import time
import math
from contextlib import asynccontextmanager
from dataclasses import dataclass
from datetime import datetime
from events import Events
from typing import Any, List, Optional, Tuple, Union
import aiohttp
from govee_api_laggat.__versio... |
from datetime import datetime
from collections import Counter, defaultdict, OrderedDict
from itertools import chain
from random import random
import numpy as np
from cma import CMAEvolutionStrategy, CMAOptions
from loguru import logger
from math import sqrt
from sklearn.preprocessing import MinMaxScaler
from sortedcon... |
# 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 t... |
"""
This file contains the logic to generate the master dataset for the INDDEX reports
Overview
--------
Beneficiaries are asked about their diet in a "recall" session. This results in
a "foodrecall" case. Every food they mention results in the creation of a "food"
case that's a child of this foodrecall.
This dataset... |
import functools
import hashlib
import json
import random
from urlparse import urlparse
import uuid
from operator import attrgetter
from django import http
from django.conf import settings
from django.db.models import Q
from django.shortcuts import get_list_or_404, get_object_or_404, redirect
from django.utils.transla... |
# NOTE WARNING NEVER CHANGE THIS FIRST LINE!!!! NEVER EVER
import cudf
from collections import OrderedDict
from enum import Enum
from urllib.parse import urlparse
from threading import Lock
from weakref import ref
from pyblazing.apiv2.filesystem import FileSystem
from pyblazing.apiv2 import DataType
from .hive imp... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Zeng Zhi
#
# Author: <NAME> <<EMAIL>>
# Maintainer: <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... |
import math
import numpy as np
from uam_simulator import my_utils
from uam_simulator import pathPlanning
from uam_simulator import orca
import gurobipy as grb
from gurobipy import GRB
import time as python_time
class Flightplan:
def __init__(self, t0, dt, positions, times=None):
self.start_time = t0
... |
import os
import json
import sys
from tqdm import tqdm
from evaluation.mesh_utils import read_obj, read_ply, calculate_face_area, compute_face_centers, \
nearest_neighbour_of_face_centers
from iou_calculations import *
# BuildNet directories
BUILDNET_BASE_DIR = os.path.join(os.sep, "media", "maria", "BigData1", "M... |
import math
import zlib
from time import sleep
import struct
from timeout_decorator import timeout
from timeout_decorator.timeout_decorator import TimeoutError
from pycrc.algorithms import Crc
from .ISPChip import ISPChip
NXPReturnCodes = {
"CMD_SUCCESS" : 0x0,
"INVALID_COMMAND" ... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, <NAME>
# 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 th... |
"""
Test functions for GEE
External comparisons are to R. The statmodels GEE implementation
should generally agree with the R GEE implementation for the
independence and exchangeable correlation structures. For other
correlation structures, the details of the correlation estimation
differ among implementations and t... |
#! /usr/bin/enc python
# -*- coding: utf-8 -*-
# author: <NAME>
# email: <EMAIL>
"""
Swin Transformer
1. 类似CNN的层次化构建方法(Hierarchical Feature Maps),特征图尺寸中有对图像下采样4倍、8倍、以及16倍;
这样的Backbone有助于再此基础上构建目标检测、实例分割等任务。
2. 使用Windows Multi-Head Self-Attention (W-MSA)概念。减少计算量。计算复杂度从指数级降到线性级,Multi-head
Self-Attention只在每个Window... |
import collections
import logging
import re
from typing import Optional, Pattern, Tuple, Iterable, Set
import django.dispatch
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models, IntegrityError
from django.db.models import Value as V, QuerySet, F
from django.db.mod... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Minibatching utilities."""
import itertools
import operator
import os
import pickle
import numpy as np
import torch
from sklearn.utils import shuffle
from torch.autograd impor... |
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.