text stringlengths 8.04k 46.5k |
|---|
import os
import glob
from abc import ABC, abstractmethod
from collections import OrderedDict, deque
from typing import Union, List, Callable, Optional
import gym
import torch
from torch.utils.tensorboard import SummaryWriter
from yarll.common.misc_util import set_global_seeds, verify_env_policy
from yarll.common.ru... |
"""Predictor implementations."""
import copy
import logging
from abc import ABC, abstractmethod
from time import time
from typing import Callable, List, Tuple, Union
import numpy as np
from scipy.stats import pearsonr
try:
import sklearn.gaussian_process as skl_gp
import sklearn.linear_model as skl_lm
im... |
import networkx as nx
from scipy.stats import expon, gamma
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
import seaborn as sns
from copy import deepcopy
##### Utils
def trigger_threshold(requested, funds, supply, alpha, params):
'''
Descript... |
# -*- coding:utf-8 -*-
""""
生成整个模型回归目标的真实答案用来参与损失函数的计算来迭代模型
1. 采用facal loss,所有的anchor都参与到分类中,但是会考虑到正负样本的不均衡和难易样本的不均衡
2. 实验facal loss的效果:
"""
import numpy as np
import numpy.random as npr
import tensorflow as tf
from lib.rpn_msr.generate_anchors import generate_anchors
from lib.utils.bbox import bbox_overlaps, b... |
# coding:utf-8
import os
import tensorflow as tf
import collections
import six
import sys
from sogou_mrc.libraries import modeling
from sogou_mrc.libraries import tokenization
import logging
class BertDataHelper(object):
def __init__(self, BERT_PRETRAINED_DIR='',
BERT_MODEL='uncased_L-12_H-768_... |
import sys
import pytest
import copy
from ctypes import c_int, POINTER, byref, cast, ArgumentError
import sdl2
from sdl2 import SDL_Init, SDL_Quit, SDL_INIT_EVERYTHING, SDL_TRUE
from sdl2 import SDL_Color
from sdl2.stdinc import Uint8, Uint16, Uint32
RGBA8888 = [0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF]
RGBX8888... |
import requests
import lxml.html as html
import time
from datetime import date, datetime, timedelta
from sense_hat import SenseHat
import math
import logging
import sys
# Logging facility
formatter = logging.Formatter('%(levelname)s:%(message)s')
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(loggi... |
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import warnings
from scipy.stats import skew
from scipy import stats
from scipy.stats import norm
from scipy.special import boxcox1p
from sklearn.linear_model import Elasti... |
from app.common import get_directions
from app.common import determine_if_snake_growing
from app.common import get_location_from_direction
from app.common import check_if_location_in_between_walls
from app.common import path_from_closest_snake_head_to_location
from app.common import get_distance_between_points
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# code for python2
import serial
import time
import math
import sys
# open serial port
# you have to modify device name according to your environment, or fix device name as follows by symbolic link.
ser = serial.Serial('/dev/Kondo_USB-RS485_converter', 1500000)
# initia... |
import csv
import sys
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pandas as pd
import json
from os import listdir
from os.path import isfile, join
import re
monnomdistances={'C':0,'I':0,'D':1,'J':1,'K':2,'L':1,'M':2,'S':1,'T':2}
markersize=8
linewidth... |
from __future__ import print_function, unicode_literals
import six
import os
from collections import deque
try:
# py >= 3.3
from collections.abc import Sequence
except ImportError:
# py 2 and py3 < 3.3
from collections import Sequence
from attr import attrs, attrib
from attr.validators import provides, ... |
import sys
import os
PROJECT_HOME = os.path.abspath(
os.path.join(os.path.dirname(__file__), '../../'))
sys.path.append(PROJECT_HOME)
from flask.ext.testing import TestCase
from flask import request
from flask import url_for, Flask
from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean
from sqlalc... |
# -*- coding:utf-8 -*-
###
# File: ttf_headv2.py
# Created Date: Saturday, August 8th 2020, 4:44:07 pm
# Author: yusnows
# -----
# Last Modified:
# Modified By:
# -----
# Copyright (c) 2020 yusnows
#
# All shall be well and all shall be well and all manner of things shall be well.
# Nope...we're doomed!
# -----
# HISTO... |
from enum import IntEnum
from typing import Callable, Dict
from qrogue.game.logic.actors import Robot
from qrogue.game.logic.collectibles import GateFactory, ShopFactory, EnergyRefill, Coin, Key, instruction
from qrogue.game.world.map import CallbackPack, LevelMap, Hallway, WildRoom, SpawnRoom, ShopRoom, RiddleRoom, B... |
#!/usr/bin/env python3.8
import argparse
import time
import datetime
import os
import sys
import subprocess
import fnmatch
import shutil
import sqlite3
from douw.site import Site
from douw.version import __version__
currentTime = str(time.time())
assume_yes = False
def create_root_arg_parser():
parser = argp... |
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.utils.checkpoint
import math
from .Data import *
from .Util import *
from .Layers_ablation import *
import torch.distributed as dist
from .Evaluation import *
from . import CRF
class ModelConfig:
def __init__(self):
self.f_... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 3 13:09:15 2017
@author: fweidner
"""
import statistics
import scipy
from scipy import stats
highlighton = 'Highlight-1'
highligtoff = 'Highlight-0'
yay = 'yay'
nay = 'nay'
currentarea = ''
countsCD = {}
globalCountStats = {} #1 =highlights, 2 = correct, 3 = wrong,... |
import torch
import torch.nn as nn
from utils import metrics_utils
from utils import ParamList
import numpy as np
from torch.nn import functional as F
class YoloLoss(object):
def __init__(self, model):
__model = model.module if type(model) in (nn.parallel.DataParallel, nn.parallel.DistributedDataParallel)... |
import json
import logging
import os
import pickle
import re
from bisect import bisect
from collections import defaultdict
from functools import reduce
from itertools import groupby
from operator import itemgetter
from typing import List, Dict, Iterable
import requests
from retrying import retry
from web3.exceptions i... |
# CodeU
# Version 1.0
# Licences : MIT
# Created by vincent-coding
# Si vous décidez d'utiliser le code source, mentionnez-moi comme créateur de base !
# If you decide to use the source code, please mention me as the basic creator!
# SOURCE CODES
# !usr/bin/env python
# -*- coding: utf-8 -*-
# Import
import os
imp... |
# coding: utf-8
# Copyright 2021 Amadeus IT Group
#
# 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 appl... |
import os
from flask import render_template, flash, send_from_directory
# from flask import redirect, url_for, request
# from flask_login import current_user, login_user, logout_user, login_required
# from werkzeug.urls import url_parse
from app import app
# from app import db
# from app.models import User
# from app.... |
#=============================================================================
# 15-112 Term Project Spring 2019
# <NAME>
# ID: xiangheh
# Recitation Section: G
#=============================================================================
# This TP is largely inspired by the 2048 AI from two JavaScript sources:
# http... |
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability import distributions as tfd
from sklearn.model_selection import train_test_split
from skimage.transform import resize
from tqdm import tqdm
import h5py
import os
from matplotlib import pyplot as plt
import unitte... |
#! /usr/bin/env python3
from enum import Enum
#from numba import jit
from random import choice, randrange, shuffle
from itertools import accumulate, chain, permutations
from math import factorial
from section_type import SectionType, short_section, long_section, INTRO, VERSE, PRE, CHORUS, BRIDGE, OUTRO
f... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.14
# In conjunction with Tcl version 8.6
# Jul 03, 2018 03:20:44 PM
# Configure paths
import sys
sys.path.append('libraries/iLimb')
sys.path.append('libraries/UR10')
sys.path.append('libraries/neuromorphic')
sys.path.append('... |
from typing import Dict, Any, List
from .heroes import get_hero_from_id, get_hero_name, heroes, get_hero_id_from_name
from .teams import RADIANT, DIRE
from .stats import calculate_fantasy_points
import json
from json import JSONDecodeError
Summary = Dict[str, Any]
def get_empty_slots(value: Any=None) -> dict:
""... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import sys
import time
import re
import tensorflow as tf
import json
import sys
import pandas as pd
import datetime
if sys.version_info < (3,0):
py = 'py2'
else:
py = 'py3'
from vocab_utils import Vocab
from SentenceMatch... |
import API as api
from tkinter import *
from tkinter import ttk, font, messagebox
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
import matplotlib
matplotlib.use("TkAgg")
dataSelection = ["Confirmed", "Deaths", "Recovered", "Active",
"Daily Confir... |
import websocket
import threading
import requests
import json
import sys
import os
import gc
import time
from datetime import datetime
import time
full_restart_request = False
data_manager = None
kline_sec_duration = 300
def handle_exception(fired_exception, comment):
exc_type, exc_obj, exc_tb = sys.exc... |
#%% [markdown]
# # Matching when including the contralateral connections
#%% [markdown]
# ## Preliminaries
#%%
from pkg.utils import get_seeds
import datetime
import time
from pathlib import Path
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.optimize import linear_sum_as... |
import os
import math
import copy
import torch
from torch import nn, optim, autograd
import torch.nn.functional as F
from torchvision import datasets, transforms, utils
from torch.utils import data
from tqdm import tqdm
import argparse
def gaussian_kl(mu1, var1, mu2=None, var2=None):
if mu2 is None:
mu2 =... |
import codecs
import copy
# import simplejson as json
import os
import sys
import time
import warnings
import shutil
from collections import Counter
import numpy as np
from imapper.util.json import json
from imapper.logic.geometry import rot_y, translation
from imapper.logic.mesh_OBJ import MeshOBJ, SceneObject
from ... |
#!/usr/bin/env python3
import os
import pprint
import json
import urllib.parse
import time
import numpy as np # type:ignore
import random
import math
import os
import logging
import wave
import threading
import datetime
from typing import Any, Dict, List, Tuple, Iterable
lock = threading.Lock()
logging.basicConf... |
import json
import logging
import math
import os
import sys
import pkg_resources
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from deformetrica import default
from . import gui_api, gui_graph
logging.basicConfig(level=logging.DEBUG)
cla... |
import pygame
from copy import deepcopy
import time
#constante
WIDTH, HEIGHT = 800, 800
ROWS, COLS = 8, 8
SQUARE_SIZE = HEIGHT//ROWS
#culori
RED = (255, 0, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
INDIGO = (75, 0, 130)
GOLD = (255,215,0)
#fereastra
window = pygame.display.s... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\ui\ui_dialog.py
# Compiled at: 2020-09-02 07:16:11
# Size of source mod 2**32: 31633 bytes
from prot... |
#!/usr/bin/env python
# Copyright (c) 2009 <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,... |
# coding=utf-8
# Copyright 2022 The Google Research 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... |
import logging
import os
import re
import time
import zipfile
import paramiko
import datetime
from collections import OrderedDict
import numpy as np
import pandas as pd
from dataactcore.config import CONFIG_BROKER
from dataactcore.models.domainModels import DUNS
from dataactvalidator.scripts.loader_utils import clean... |
from numpy.core.fromnumeric import size
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import Parameter
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset, Dataset
from layers import ZINBLoss, MeanAct, DispAct
import n... |
# import
import math
import random
import numpy as np
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from transformers import *
from apex import amp
device = torch.device("cuda:0" if torch.cud... |
from __future__ import absolute_import
import pytest
import sys
from odinweb.data_structures import HttpResponse, UrlPath, PathParam, _to_swagger, Param, Response, DefaultResponse, \
MiddlewareList, DefaultResource, MultiValueDict, MultiValueDictKeyError
from odinweb.constants import Type, HTTPStatus, In
from .r... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# ... |
"""Kipf GCN model for node-label prediction."""
from typing import List, Union, Optional, Dict, Any, Type, Tuple
import numpy as np
import pandas as pd
from tensorflow.keras.callbacks import EarlyStopping, ReduceLROnPlateau # pylint: disable=import-error,no-name-in-module
from tensorflow.keras.models import Model # ... |
# 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... |
import os
import json
import glob
import re
import math
import click
import asyncio
import aiofiles
import aiohttp
import functools
import logging
import sys
import csv
from pathlib import Path
from multiprocessing import Pool
from datetime import datetime
from girder_client import GirderClient
from edp.composite.par... |
import os
import colorsys as cs
from math import *
from PIL import Image
from shutil import copyfile
from util.manip import *
def sizing_function(x):
val = 0.6
var_triplets= [
[0.8, 1.77777, 0.09],
[0.2, 0.625, 0.07,],
[0.2, 0.5622, 0.07],
[0.1, 0.5634, 0.07],
[0.4, 0.75... |
from datetime import date, datetime
import itertools as it
import csv
import os
import zipfile
from io import BytesIO
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import log... |
"""
Copyright 2021 Novartis Institutes for BioMedical Research 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... |
import os
# import cv2
import sys
import time
import datetime
import argparse
import numpy as np
import tensorflow as tf
from random import shuffle
import matplotlib.pyplot as plt
#import matplotlib.image as mpimg
import xml.etree.ElementTree as ET
from scipy.misc import imread, imsave
import vgg16_encoder, vgg16_enco... |
import pandas as pd
import os
import pickle
import numpy as np
import scipy
import scipy.sparse as sp
import scipy.io as spio
import isolearn.io as isoio
import isolearn.keras as iso
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.lines as pltl
def mask... |
import argparse
import os
import json
from os.path import exists
from time import time
import pprint
import torch
from torch.utils.data import DataLoader
from torch.nn import functional as F
import numpy as np
from tqdm import tqdm
import pprint
from apex import amp
from horovod import torch as hvd
from data import (... |
import math
import random
from HelperClasses import Counter, randchoice, randcheck, randchoice_scaled
from numpy.core.fromnumeric import sort, var
from numpy.lib.function_base import average
from numpy.ma import count
import numpy
class NodeAbstract():
"""Abstract superclass for nodes"""
def __init__(self) ->... |
#!/usr/bin/env python
# Copyright 2021 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 b... |
import tcod as libtcod
from enum import Enum
from game_states import GameStates
from math import sqrt
from menus import inventory_menu, level_up_menu, character_screen, help_screen, format_weight, confirmation_menu
from plot_gen import get_name
from rpg_mechanics import display_ability
import textwrap
class RenderOrde... |
"""Define argument parser."""
import argparse
DEFAULT_AUGMENTATION_BERT_MASK_PROB = {
'train': 0.15,
'val': 0.,
'test': 0.
}
DEFAULT_LABEL_BERT_MASK_PROB = {
'train': 1,
'val': 1,
'test': 1
}
def build_parser():
"""Build parser."""
parser = argparse.ArgumentParser()
parser.registe... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from collections import Counter
from datetime import date
import nltk
from sklearn.externals import joblib
from textblob import TextBlob
from textstat.textstat import textstat
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.... |
from generator.actions import Actions
import random
import string
class map:
def __init__(self, newName):
self.mapName = newName
self.roadList = []
def setMapName(self, newName):
self.mapName = newName
return
def getMapName(self):
return self.mapName
def addroad(self, roadName, length):
newRoad = [road... |
from collections import OrderedDict
from typing import Dict, Optional, List
from whacked4 import config, utils
from whacked4.dehacked.patch import Patch
from whacked4.dehacked.statequery.query import StateFilterQuery
from whacked4.dehacked.statequery.stateindexsort import StateIndexSort
from whacked4.dehacked.stateque... |
__author__ = '<NAME>'
__license__ = 'MIT' # copy of the license available @ https://prodicus.mit-license.org/
__version__ = '2.1.0'
__email__ = '<EMAIL>'
__github__ = "github.com/noahvendrig" # @noahvendrig
__course__ = 'Software Design and Development'
__date__ = '10/07/2021'
__description__ = 'Modern Recreation of ... |
"""Support for Hass.io."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
import os
from typing import Any, NamedTuple
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import panel_custom, persistent_notificati... |
# Copyright 2001-2014 by <NAME>. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission not... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/usr/bin/env python
import contextlib
import functools
import os
import pkgutil
import tempfile
from inspect import signature
from typing import Any, Iterable, Callable, Dict, Optional
import docker
import filelock
from sonic_py_common import device_info
from sonic_package_manager import utils
from sonic_package_m... |
#!/usr/bin/env python3
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
#
# Copyright (c) Greenplum Inc 2010. All Rights Reserved.
#
# Note: the option to recover to a new host is not very good if we have a multi-home configuration
#
# Options removed when 4.0 gpreco... |
#!/usr/bin/python3
"""Collection of helper functions"""
import os
import logging
import sys
import subprocess
import pathlib
import platform
import collections
import fnmatch
import re
# Globals
from .my_globals import NQBP_WORK_ROOT
from .my_globals import NQBP_PKG_ROOT
from .my_globals import NQBP_TEMP_EXT
from .my... |
#!/usr/bin/env python3
# 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.
"""
(NOTE: To use this class, please follow the tutorial here:
http://parl.ai/static/docs/tutorial_worlds.html#mu... |
# -*- coding: utf-8 -*-
# This code is initially based on the Kaggle kernel from <NAME>, which can be found in the following link
# https://www.kaggle.com/neviadomski/how-to-get-to-top-25-with-simple-model-sklearn/notebook
# and the Kaggle kernel from <NAME>, which can be found in the link below
# https://www.kag... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains a number of utilities for use during
setup/build/packaging that are useful to astropy as a whole.
"""
from __future__ import absolute_import, print_function
import collections
import os
import re
import subprocess
import sys
impo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from timm.models.layers import DropPath, trunc_normal_
import ipdb
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
super().__init__(... |
#!/usr/bin/env python3
#
# Copyright 2015 WebAssembly Community Group participants
#
# 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
#
# Unles... |
import errno
import operator
import os
import shutil
import site
from optparse import SUPPRESS_HELP, Values
from typing import Iterable, List, Optional
from pipenv.patched.notpip._vendor.packaging.utils import canonicalize_name
from pipenv.patched.notpip._internal.cache import WheelCache
from pipenv.patched.notpip._i... |
#!/usr/bin/env python3
import sys
sys.path.append("..")
# Ignore warnings.
import warnings
warnings.filterwarnings("ignore")
# Handle library imports.
import numpy as np
import pandas as pd
import itertools
import logging
import ast
from trickster.search import a_star_search, ida_star_search
fr... |
from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
import sys, math
from libtbx.str_utils import format_value, round_2_for_cif, round_4_for_cif
from itertools import count
import iotbx.cif.model
from libtbx.test_utils import approx_equal
from libtbx import group_args
fr... |
import hashlib
import json
import os
import posixpath
import re
import time
import unicodedata
import uuid
import zipfile
from collections import namedtuple
from django.core.files.storage import default_storage as storage
from django.db import models
from django.dispatch import receiver
from django.template.defaultfi... |
# -*- coding: utf-8 -*-
#
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# An... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.fixedTools import fixedToFloat, floatToFixed, otRound
from fontTools.misc.textTools import safeEval
import array
import io
import logging
import struct
import sys
# https://www.microsoft.com/typograp... |
#! /usr/bin/python
# TrackerFai module using multi threading
import threading
from copy import deepcopy
from vision.marker import Marker
import vision.calibration as calibration
import cv2
import numpy as np
from math import pi, cos, sin, atan2, degrees, fabs, sqrt, radians
import inspect
import time
import os
from co... |
#!/usr/bin/python
#
# Script decode/encode ZT2 file from Zoom F/W
# (c) <NAME>, 11 July 2019
#
from construct import *
#--------------------------------------------------
# Define ZT2/ZD2 file format using Construct (v2.9)
# requires:
# https://github.com/construct/construct
Header = Struct(
Const(... |
import unicodedata
from collections import OrderedDict
try:
import sentencepiece as spm
except ImportError:
spm = None
from ..config import ConfigError
from ..utils import contains_all
SPIECE_UNDERLINE = '\N{LOWER ONE EIGHTH BLOCK}'
SEG_ID_A = 0
SEG_ID_B = 1
SEG_ID_CLS = 2
SEG_ID_SEP = 3
SEG_ID_PAD = 4
specia... |
#
# This file is part of LiteX.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# Copyright (c) 2020 Dolu1990 <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
import os
from os import path
from migen import *
from litex import get_data_mod
from litex.soc.interconnect import wishbone
from litex.soc.interconnect.csr import ... |
import numpy as np
import gym
from keras.layers import Conv2D, Dense, Input, Flatten
from keras.models import Model, load_model
from keras.optimizers import RMSprop
from keras.utils.np_utils import to_categorical
import keras.backend as K
from common import LogPong
from skimage.color import rgb2gray
from skimage.transf... |
# -*- coding: UTF-8 -*-
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 20... |
"""Processing pipeline steps for a single document.
After all the files on disk, inside archives, emails and other containers are all ingested and de-duplicated
by the `snoop.data.filesystem` set of tasks, they end up here in the `launch()` Task. Inside this task we
decide what kinds of data and metadata extraction ta... |
'''
Written by <NAME>
Date: Jan 29th 2019
Generative Adversarial Imputation Networks (GAIN) Implementation on Spam Dataset
Reference: <NAME>, <NAME>, <NAME>, "GAIN: Missing Data Imputation using Generative Adversarial Nets," ICML, 2018.
Paper Link: http://medianetlab.ee.ucla.edu/papers/ICML_GAIN.pdf
Appendix Link: http... |
import os
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--output_name" , type=str, required=True, help="the output folder name for this run of experiment... e.g. exp1_ETH_CADRL or exp2_0.3_CADRL")
parser.add_argument("--experiment_num" , type=int, required=T... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from gym.spaces import Box
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
import ray
import ray.experimental.tf_utils
from ray.rllib.agents.dqn.dqn_policy_graph import (
... |
"""
The DoInterestManager keeps track of which parent/zones that we currently
have interest in. When you want to "look" into a zone you add an interest
to that zone. When you want to get rid of, or ignore, the objects in that
zone, remove interest in that zone.
p.s. A great deal of this code is just code moved from ... |
# -*- coding: utf-8 -*-
# pylint:disable=too-many-lines
"""
:mod:`orion.algo.space` -- Objects describing a problem's domain
==================================================================
.. module:: space
:platform: Unix
:synopsis: Classes for representing the search space of an
optimization problem.
... |
# Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
"""Command line entry point to the application using the application CLI.
"""
__author__ = 'plandes'
from typing import Dict, Any, List, Type, Union
from dataclasses import dataclass, field
from enum import Enum, auto
import logging
import gc
import sys
import itertools as it
import copy as cp
from io import TextIOBa... |
#!/usr/bin/env ccp4-python
"""Module to run molrep on a model"""
__author__ = "<NAME>"
__date__ = "02 May 2017"
__version__ = "1.0"
import os
import operator
import shutil
from simbad.mr.options import SGAlternatives
from simbad.util import mtz_util
from pyjob import cexec
from pyjob.script import EXE_EXT
def che... |
import os
import sys
import re
from django.utils.translation import gettext_lazy as _
from celery.schedules import crontab
from configurations import Configuration, importer, values
importer.install(check_options=True)
def rec(x: str) -> re.Pattern:
return re.compile(x, re.I | re.U)
class Base(Configuration... |
"""
Tools for working with chords.
"""
from typing import (
Any,
Callable,
Hashable,
Iterable,
List,
Optional,
Set,
Sequence,
Tuple,
)
from jchord.knowledge import (
LETTERS,
ACCIDENTALS,
CHORD_NAMES,
CHORD_ALIASES,
TRIADS_WITH_FIFTH,
DYA... |
# -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = "Copyright (C) 2014 <NAME>"
__license__ = """
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, includi... |
#! /usr/bin/env python3
"""
Author: <NAME> <<EMAIL>>
License: MIT
"""
# ./scripts/rase_predict.py ~/github/my/rase-predict/database/spneumoniae_sparc.k18/tree.nw ~/github/my/rase-predict/database/spneumoniae_sparc.k18.tsv ~/github/my/rase-predict/prediction/sp10_norwich_P33.filtered__spneumoniae_sparc.k18.bam | tL
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.