text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/python3
# encoding: utf-8
'''
-- Imports an xlsx sheet, converts it to a csv file, reads it, and checks the fields
@author: <NAME>
@contact: <EMAIL>
@deffield updated: Updated
'''
import sys
import uuid
import io
import rdflib
import yaml
import pandas as pd
import numpy as np
import datetime as... |
#!/usr/bin/python
# coding: utf-8
import os
import shutil
import sys
import argparse
import textwrap
import json
import csv
import logging
import pathlib
from copy import deepcopy
import fs
import packtools
from fs import path, copy, errors
from lxml import etree
from tqdm import tqdm
from documentstore_migracao impo... |
import os
import math
import subprocess
import shutil
from appionlib import apImage
from appionlib import apDisplay
from appionlib import apFile
import time
from appionlib import apTomo
from pyami import mrc
def writeRawtltFile(path,seriesname,tilts):
rawtltname = os.path.join(path,seriesname+'.rawtlt')
f = open(raw... |
import argparse
# average / weighted_average / bitwise_or
ENSEMBLE_METHOD = "average"
CREDIBILITY_THRESHOLD = 0.3
VIABLE_COUNTABILITY = -1
AVERAGE_ACCEPTABILITY = -1
DEVIATION_THRESHOLD = 0.5
#For Weighted Average
AVERAGE_ACCEPTABILITY_2 = 0.3
#SEGMENTATION MODEL DICTIONARY
model_dict = {}
model_dict['mask_rcnn_X-101... |
import copy
import typing
import logging
from itertools import product
from pprint import pprint
import numpy as np
from d3m import container, exceptions, utils, index as d3m_index
from d3m.metadata import base as metadata_base
from d3m.metadata.pipeline import Pipeline, PrimitiveStep
from .configuration_space impo... |
##!/usr/bin/env python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2010-2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), t... |
import csv
import os
import random
import math
import numpy as np
import networkx as nx
import scipy.sparse as sp
import torch
from torch import Tensor
import matplotlib.pyplot as plt
import numpy.random as rnd
from signet_utils import sqrtinvdiag
from sklearn.preprocessing import normalize, StandardScaler
def SSBM(n... |
# Copyright 2020 The Chromium OS 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 hashlib
import os
import re
import typing
from google.protobuf import text_format
from cros.factory.probe_info_service.app_engine import bundle_b... |
import os
import torch
import pickle
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.lines import Line2D
from matplotlib.ticker import FormatStrFormatter
from scipy.stats import pearsonr
from sklearn import metrics
from sklearn.linear_model i... |
# MIT License
# Copyright (c) 2018 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... |
import smbus
import time
import traceback
# TODO: direct_control and MCP23017 share a lot of code, with minor changes spread
# throughout. The structure and logic of the code is mostly the same. A bug in one
# file may implicate a bug in the other. Eventually, should cleanly split shared functions.
class MCP23017:
I... |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import os
import errno
from typing import Any, Dict, List, Tuple, Union
import cv2
import pdb
import configparser
import torch
import numpy as np
import imageio
import trimesh
import glob
import matplotlib.cm
import torch.nn.functional as F
from sc... |
import tkinter as tk
from tkinter import ttk, simpledialog
import json
import os
from tkinter.constants import E, END
from tkinter import filedialog as fd
from tkinter.messagebox import showinfo
from typing import Dict, Callable
import uuid
from datetime import datetime
import re
# WINDOW AND FRAMES SETUP
# window set... |
from __future__ import division
import os
import time
import math
from glob import glob
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
from six.moves import xrange
from ops import *
from utils import *
def conv_out_size_same(size, stride):
return int(math.ceil(float(size) / float(st... |
#!/usr/bin/env python2.7
"""
Installer for the Dataplicity agent.
This script prepares your Raspberry Pi or other Linux device for use
with the Dataplicity agent, an open source application that powers
remote terminals and other features on https://www.dataplicity.com
See the following repository on GitHub for the so... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date, datetime
import re
import cast
import fmt
import split
def date_by_pattern(s, pattern, return_match_str=False):
"""
>>> date_by_pattern('4/20/2014', '%m/%d/%Y')
datetime.date(2014, 4, 20)
>>> date_by_pattern('4/20/2014 is a da... |
import time # 引入time模块
import pandas as pd
import re
import sqlparse
attributeNameArray = ['tableName', 'createTime', 'lastModifyTime', 'owner', 'rowNumber', 'columnNumber',
'primaryKey', 'uniqueKey', 'foreignKey', 'notNullColumn', 'indexColumn', 'columnDataType']
remarksList = ['表名', '创建时间', '最... |
# Python modules
# 3rd party modules
import numpy as np
from xml.etree.cElementTree import Element
# Our modules
import vespa.analysis.block_prep_identity as block_prep_identity
import vespa.analysis.chain_prep_fidsum as chain_prep_fidsum
import vespa.analysis.block as block
import vespa.common.util.xml_ as util_xm... |
"""
-------------------------------------------------------------------------------
Name: V4
Purpose: Model-predictive controller with optimization designated as V4a and V4b in the paper
Author: <NAME>, <NAME>
Created: 01.12.2021
Copyright: Chair of Sustainable Manufacturing and Life Cycle Engin... |
# Copyright 2020 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 applicable law or agreed to... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# sugarcane.py
# projects
#
# Created by <NAME> on 12/02/19
# Copyright © 2019 <NAME>. All rights reserved.
#
import logging
import os.path as op
import sys
from random import random, sample
from itertools import groupby
from collections import Counter
import numpy as np
... |
#!/usr/bin/env python3
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import array
import math
import socket
import struct
import threading
import time
import traceback
from enum import Enum
from fcntl import ioctl
import pyroslib as pyros
DEBUG_AXES = False
DEBUG_BUTTONS = False
DEBUG_JOYSTICK = Fal... |
# coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
if __name__ == '__main__':
import os
gpu_use = 2
print('GPU use: {}'.format(gpu_use))
os.environ["KERAS_BACKEND"] = "tensorflow"
os.environ["CUDA_VISIBLE_DEVICES"] = "{}".format(gpu_use)
import random
import cv2
import time
impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 09:11:28 2019
@author: bressler
"""
import SBCcode as sbc
from os import listdir
from os.path import isfile,join
import numpy as np
import matplotlib.pyplot as plt
import scipy
from random import randrange
import random
# Global variable becaus... |
"""
As the name implies this module contains the functions related to
autoconverting, which is a fancy way of saying cut silence
adjust audio volume and use a standard formula for output
Dependent on:
mediainfo
ffmpeg
mkclean
Authors: Zolhungaj
FokjeM / <NAME> (really minor tweaks)
"""
import sys
import re
im... |
"""
main.py
This file contains the public facing API for using memento.
"""
import numpy as np
import pandas as pd
from patsy import dmatrix
import scipy.stats as stats
from scipy.sparse.csr import csr_matrix
import sys
from joblib import Parallel, delayed
from functools import partial
import itertools
import log... |
import zipfile
import yaml
import re
import io
import os
import pandas as pd
import numpy as np
from scipy.sparse import csr_matrix
import h5py as h5
import tempfile
import copy
import arrow
import importlib
import inspect
import pkgutil
from collections import defaultdict
def scalar_constructor(loader, node):
va... |
# including fnn, fnn_complex, fnn_crelu, rnn, lstm, gru
import os
import torch
from torch import nn
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torch.nn.parameter import Parameter
import torch.utils
import torch.nn.functional as F
from sklearn.metrics import confusion_matrix
import itertool... |
#!/usr/bin/env python
#
# render.py - Generate screenshots of overlays using OpenGL.
#
# Author: <NAME> <<EMAIL>>
#
"""The ``render`` module is a program which provides off-screen rendering
capability for scenes which can otherwise be displayed via *FSLeyes*.
"""
import os.path as op
import sys
import ... |
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('utils')
from jazz_rnn.utilspy.meters import accuracy
from jazz_rnn.utils.music.vectorXmlConverter import input_2_groups
from jazz_rnn.A_data_prep.gather_data_from_xml import EOS_SYMBOL
OFFSET_TO_5OCT = 72
class Positiona... |
#! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 <NAME> and <NAME>.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this work or any portio... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import logging
logger = logging.getLogger('StRADRL.model')
SEED = 1337
# weight initialization based on muupan's code
# https://github.com/m... |
#!/usr/bin/python
# Python Imports
import collections
import datetime
import numbers
import swapper
from hashlib import sha256
# Django Imports
from django.conf import settings
from django.db import models
import utils
# Local Imports
from mwbase.models import PhoneCall, Practitioner, Visit, Connection
from transport... |
################################################
# RISC-V RV32I definitions and helper methods. #
################################################
from nmigen import *
# ALU operation definitions. These implement the logic behind math
# instructions, e.g. 'ADD' covers 'ADD', 'ADDI', etc.
ALU_ADD = 0b0000
ALU_SUB ... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import datetime
import json
import random
import time
from pathlib import Path
import os, pdb
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
import datasets
import util.misc as utils
fro... |
import numpy as np
import scipy.ndimage as ndi
import math
import sys
import cv2
import enum
from skimage import exposure
import tensorflow as tf
from typing import Union, Callable
try:
import imgaug as ia
from imgaug import augmenters as iaa
except ImportError:
print("Error in loading augmentation, can't i... |
"""Code to interface with the SMA inverters and return the results."""
import os
import asyncio
import datetime
import time
import logging
# from pprint import pprint
from dateutil import tz
from astral.sun import sun, elevation, azimuth
from astral import LocationInfo, now
import clearsky
import version
from inve... |
#!/usr/bin/env python
# coding: utf-8
# Authors: <NAME> & <NAME>
# Tools for working with model ensemble members. These
# tools estimate the probability of exceeding or
# being below some threshold, which enables the user to
# calculate the probability of some event occuring given
# a set of ensemble members. This ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 19 01:57:58 2018
@author: Aman
"""
import pandas as pd
import numpy as np, os
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
import xgboost as xgb #GBM algorithm
from xgboost import XGBRegressor
os.chdir("F:/Data Science... |
import logging
from contextlib import suppress
from functools import lru_cache, partial
from ._lexer import *
from ._decoders import decode
from ._security.securityhandler import StandardSecurityHandler
from .exceptions import PDFSyntaxError, PDFUnsupportedError
class XRefTable:
"""
Implements the functional... |
# -*- coding: utf-8 -*-
import time
import numpy as np
from app.rangechecker import RangeChecker
from framepreprocess import FramePreprocessor
from model.framedecision import DecisionModel
from videoholder import VideoHolder
from track import centroidtracker
import util
__all__ = ['CarRecord', 'FeatureExtractor'... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
# DESCRIPTION: The class below is the implementation of convolution process from scratch.
# INPUT: Refer to the __init__() function below.
class Convolution():
# DESCRIPTION: This function will got called when a new Convolut... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
# colours https://github.com/gravitystorm/openstreetmap-carto/blob/master/style/landcover.mss
# default value already set as 'other'
tag_styles = {
'aerialway': {
'cable_car': {'linecolor': '#80808... |
from itertools import chain
from math import factorial
from permuta.patterns.meshpatt import MeshPatt
from permuta.patterns.perm import Perm
def mine(goodperms, M, N=None, report=False):
"""
goodperms the set of permutations you are investigating
M longest mesh patterns you want to consider
N longest... |
# -*- coding: utf-8 -*-
# Copyright 2019 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import os
import sys
import json
import argparse
from collections import abc
import time
from collections import defaultdict
from easydict import EasyDict
from tqdm import tqdm
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, PretrainedConfig
from utils.logger import LOGGER, TB_LOGGE... |
# The MIT License (MIT)
#
# Copyright (c) 2017 <NAME> for Adafruit Industries
# 2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including with... |
#
import os
import glob
import json
import datetime
import time
import pymysql
import math
import numpy
import gateway.runtime as rt
import gateway.metadata as md
import gateway.task as ta
import gateway.transform as tr
def get_all_files(path, extensions, channel) :
files = []
for e... |
from dojo.models import Product, Engagement, Test, Finding, \
JIRA_Issue, Tool_Product_Settings, Tool_Configuration, Tool_Type, \
User, ScanSettings, Scan, Stub_Finding, Endpoint, JIRA_PKey, JIRA_Conf, \
Finding_Template, Note_Type, App_Analysis, Endpoint_Status, \
Sonarqube_Issue, Sonarqube_Issue_Trans... |
# Copyright 2019 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... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The rapidart module provides routines for artifact detection and region of
interest analysis.
These functions include:
* ArtifactDetect: performs artifact detection on functi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 17 13:23:03 2018
@author: amaity
This module primarily is used to validate/compare the
the estimated PDF with the actual PDF for each
phases as well as for the total execution
"""
... |
from operator import index
import spacy
import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
from clf_utils import MultiLabelClassifier, ContentTypeData
class Plotter:
"""
Class for plotting the results of the classifier or message distribution
"""
... |
"""Conll training algorithm"""
import os
import time
import argparse
import socket
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.optim import RMSprop
from torch.utils.data import DataLoader
from tensorb... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This plugin provides advanced doctest support and enables the testing of .rst
files.
"""
import doctest
import fnmatch
import os
import re
import sys
import warnings
from pathlib import Path
from textwrap import indent
import pytest
from packaging.ver... |
# -*- coding: utf-8 -*-
import pytest
import sqlparse
from sqlparse.exceptions import SQLParseError
class TestFormat(object):
def test_keywordcase(self):
sql = 'select * from bar; -- select foo\n'
res = sqlparse.format(sql, keyword_case='upper')
assert res == 'SELECT * FROM bar; -- selec... |
import sqlite3
import urllib
import jinja2
from sanic.exceptions import NotFound
from sanic.request import RequestParameters
from datasette.utils import (
Filters,
InterruptedError,
compound_keys_after_sql,
escape_sqlite,
filters_should_redirect,
is_url,
path_from_row_pks,
path_with_ad... |
import os
import io
import re
import sys
import asyncio
import logging
import subprocess
import tempfile
import yaml
import dpkt
import pytest
from signature import (
BrowserSignature,
TLSClientHelloSignature,
HTTP2Signature
)
@pytest.fixture
def browser_signatures():
with open("signatures.yaml", "r... |
#!/usr/bin/env python3
### vcfMerger2
###
### MIT License
###
### Copyright (c) 2018 Translational Genomics Research Institute
###
### Permission is hereby granted, free of charge, to any person obtaining a copy
### of this software and associated documentation files (the "Software"), to deal
### in the Software witho... |
from pypy.translator.simplify import join_blocks, cleanup_graph
from pypy.translator.unsimplify import copyvar, varoftype
from pypy.translator.unsimplify import insert_empty_block, split_block
from pypy.translator.backendopt import canraise, inline, support, removenoops
from pypy.objspace.flow.model import Block, Const... |
#!/usr/bin/env python
from pathlib import Path
from collections import defaultdict
from pprint import pprint
from pprint import pformat
import random
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
from typing import Callable
import streamlit as st
import seaborn as sns... |
import math
from sympy import (
Float,
Idx,
IndexedBase,
Integer,
Matrix,
MatrixSymbol,
Range,
sin,
symbols,
Symbol,
Tuple,
Lt,
nan,
oo,
)
from sympy.core.relational import StrictLessThan
from sympy.testing.pytest import raises
from sympy.codegen.ast import (
... |
import os.path
import platform
import textwrap
from abc import ABC, abstractmethod
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
from pygments.lexer import Lexer
from pygments.lexers import get_lexer_by_name, guess_lexer_for_filename
from pygments.style import Style as PygmentsStyle
f... |
"""
Parser for PythonPoint using the xmllib.py in the standard Python
distribution. Slow, but always present. We intend to add new parsers
as Python 2.x and the XML package spread in popularity and stabilise.
The parser has a getPresentation method; it is called from
pythonpoint.py.
"""
import string, imp, sys, os,... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# from __future__ import absolute_import, division, print_function
import locale
import matplotlib as mpl
from matplotlib import docstring
import numpy as np
import random
from matplotlib.projections.polar import PolarAxes
from numpy.lib.twodim_base import histogram2d
imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Line-search methods for OptimPack.
Author: <NAME> (2020)
"""
from __future__ import print_function, division
import math
from optimpack.common import *
# A few constants for Moré & Thuente line-search method.
XTRAPL = 1.1
XTRAPU = 4.0
STPMAX = 1e20
class LineSearc... |
import sys
import re
import os
import os.path
class Result:
def __init__(self, test_name, vm_name):
self.test_name = test_name
self.vm_name = vm_name
# x
self.heap_sizes = []
# y
self.total_times = {}
self.median_total_times = {}
# e.g.
# vm_name = "marksweep"
# heap_size[0] = 30000 bytes, x... |
'''
This module is a Utility library to help you use genetic algorithms to tune up your ESN / DeepESN by finding you good hyperparameters.
It is based on DEAP (Distributed Evolutionary Algorithms in Python) using a pattern delivering basic genetic search.
This library should not be used directly, but called for using ... |
import uuid
import filecmp
import os
import tempfile
from datetime import datetime as Datetime
from nose.tools import assert_equal, assert_is_none, assert_not_equal, assert_is_instance, assert_true, assert_false, \
assert_equals, assert_is_not_none, assert_raises
from mock import patch
from synapseclient.core.uplo... |
# coding=utf-8
import hashlib
from contextlib import contextmanager
import json
import os
import urllib
import re
import socket
import itertools
import logging
from boto import ec2, iam, sns, sqs, vpc
from boto.s3.key import Key as S3Key
from boto.exception import S3ResponseError, BotoServerError
from boto.s3.connecti... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from .. import toml
import json
import tensorflow as tf
from ..utils import input_layer as input_layer_utils
from ..utils import utils
from ..net_building_blocks.cvm import ContinuousValueModel
import numpy as np
from .field_cfg import FeatureFieldCfg, Lab... |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
# Copyright (c) 2009-2012 <NAME>. See LICENSE for details.
from __future__ import absolute_import
import sys
import os
import traceback
from greenlet import greenlet, getcurrent, GreenletExit
__all__ = ['getcurrent',
'GreenletExit',
'spawn_raw',
'sleep',
'kill',
... |
"""
ECCO v4 Python: read_bin_llc
This module includes utility routines for loading binary files in the
llc 13-tile native flat binary layout. This layout is the default for
MITgcm input and output for global setups using lat-lon-cap (llc) layout.
The llc layout is used for ECCO v4.
.. _ecco_v4_py Documentation :
... |
import copy
import fnmatch
import io
import json
import os
import sys
import tempfile
import time
from contextlib import contextmanager
from functools import partial
from hashlib import sha256
from pathlib import Path
from typing import BinaryIO, Dict, Optional, Tuple, Union
import packaging.version
from tqdm.auto imp... |
from typing import Any, Dict, Generator, Iterable, List, Mapping, Optional, Union
from collections import OrderedDict
import os
import torch
from torch import nn, optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
from catalyst.callbacks.batch_overfit import BatchOver... |
import sys
import os
import random
import json
import time
import shutil
import numpy as np
import tensorflow as tf
try:
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
except:
pass
# import matplotlib as mpl
# mpl.use('TkAgg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import ... |
from collections import OrderedDict
import numpy as np
import tensorflow as tf
from tensorflow.contrib.staging import StagingArea
from baselines import logger
from baselines.her.util import (
import_function, store_args, flatten_grads, transitions_in_episode_batch)
from baselines.her.normalizer import Normalizer
fr... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import zip, range, filter # NOQA
from os.path import exists, relpath
import utool as ut
import vtool as vt
import functools
# TODO in template version
#def read_chip_fpath(ibs, cid_list, **kwargs)... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import os
from loguru import logger
import cv2
import copy
import json
import torch
import numpy as np
from pycocotools.coco import COCO
from .. import RandomShapeSingle, YOLOXResizeImage
from ..dataloading import get_yolo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Models that have physical origins.
"""
# pylint: disable=invalid-name, no-member
import warnings
import numpy as np
from astropy import constants as const
from astropy import units as u
from astropy.utils.exceptions import AstropyUserWarning
from .c... |
#!/usr/bin/python
# -*-coding: utf-8 -*-
import copy
import math
import warnings
from itertools import islice, product
from typing import Iterable, Iterator, List, Tuple, Union
import matplotlib.font_manager as fm
from matplotlib.figure import Figure
from matplotlib.legend_handler import HandlerBase
from matplotlib.p... |
import logging
import re
from django.db import IntegrityError
from django.utils import dateparse, timezone
from libcloud.common.types import LibcloudError
from libcloud.compute.drivers.ec2 import (
NAMESPACE,
REGION_DETAILS,
RESOURCE_EXTRA_ATTRIBUTES_MAP,
EC2NodeDriver,
)
from libcloud.compute.types im... |
import argparse
from typing import Dict, Iterator, Tuple, Union
from typing import *
import json
from data.embedders.fasttext_embedder import FastTextEmbedder
from data.embedders.batch_embedder import IndexBatchEmbedder, WordBatchEmbedder
from tqdm import tqdm, trange
import os
import sys
from collections import... |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
Variant of the resnet module that takes cfg as an argument.
Example usage. Strings may be specified in the config file.
model = ResNet(
"StemWithFixedBatchNorm",
"BottleneckWithFixedBatchNorm",
... |
"""
Test functions and generators in ``rank.py``.
.. [camerini1980ranking]
<NAME>., <NAME>., & <NAME>. (1980). Ranking
arborescences in O (Km log n) time. European Journal of Operational
Research, 4(4), 235-242.
"""
import math
from operator import eq
from typing import Set, Union
import networkx as nx
f... |
from dateutil.parser import parse
from django.conf import settings
from django.urls import path, re_path
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseBadRequest
from django.utils import timezone
from django.utils.text import slugify
from django.views.decor... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import shutil
import os
import json
from datetime import datetime
from commands.base import CommandBase, Command, Flag
from py_utils.emu_utils import run, error, success, warning, info, is_affirmative, check_output, most_similar
from py_utils.emu_utils import OPENPILOT_PATH, FO... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''Density expansion on plane waves'''
import time
import ctypes
import numpy
import copy
from pyscf import lib
from pyscf import gto
from pyscf.lib import logger
from pyscf.pbc import tools
from pyscf.pbc.gto import pseudo
from pyscf.pbc.df import ft_ao
from pyscf... |
# encoding=utf8
from datetime import datetime
import logging
from iso639 import languages
from rdflib import URIRef
from rdflib.namespace import SKOS
from .constants import Constants
from .element import Element
from .error import InvalidRecordError, UnknownSchemeError
from .util import is_uri
logger = logging.getLo... |
r"""
Map to the Weierstrass form of a toric elliptic curve
There are 16 reflexive polygons in 2-d. Each defines a toric Fano
variety, which (since it is 2-d) has a unique crepant resolution to a smooth
toric surface. An anticanonical hypersurface defines a genus one curve
`C` in this ambient space, with Jacobian ellip... |
"""
Copyright (C) 2018 University of Massachusetts Amherst.
This file is part of "coref_tools"
http://github.com/nmonath/coref_tools
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.... |
# -*- coding: utf-8 -*-
# pylint: disable=W0612,E1101
from collections import OrderedDict
from datetime import datetime
import numpy as np
import pytest
from pandas.compat import lrange
from pandas import DataFrame, MultiIndex, Series, date_range, notna
import pandas.core.panel as panelm
from pandas.core.panel impor... |
# coding=utf-8
# Copyright 2019 The Mesh TensorFlow Authors.
#
# 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 applicab... |
#!/usr/bin/env python3
#
# Copyright (c) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... |
import os
#os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import numpy as np
import tensorflow as tf
import common_funcs
from common_funcs import FLOAT_TYPE
import data_loader
from sklearn.cluster import KMeans
import time
from scipy.stats import norm
# Streaming Sparse Gaussian Tensor Decomposition with Fully Bayesian Tre... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import matplotlib.image as mpimage
import pickle
from moviepy.editor import VideoFileClip
from moviepy.video.io.bindings import mplfig_to_npimage
# --- CAMERA CALIBRATION ---
def camera_calibration(calibrationDirectory):
# prepare subplot fo... |
import unittest
from StringIO import StringIO
from robot.parsing.populators import FromFilePopulator, DataRow
from robot.parsing.model import TestCaseFile
from robot.utils.asserts import assert_equals, assert_true, assert_false
from robot.output import LOGGER
LOGGER.disable_automatic_console_logger()
class _MockLo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.