text stringlengths 6.04k 39.5k |
|---|
# Copyright 2021 The Brax 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 applicable law or agreed to in wri... |
import math
import pprint
import re
import os
import os.path
from pathlib import Path
import json
import copy
import pyback
globvars = {'debug': {'frames': 1, 'bspec': 1, 'cspec': 1}, 'subtxt': {'style': 1, 'locat': -1}}
def mergeposition (base = [], addit = []):
if len(addit) < 3: return base
for idx in rang... |
#!/usr/bin/env python
# @ CommonUtility.py
# Common utility script
#
# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import os
import sys
import shutil
import subprocess
import string
from ctypes import ARRAY, c_char, c_uint16, c_uint32, \
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... |
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
from ansible_hint.parser import *
# some shorthand to make things more readable
DR = DeclRef
TS = DR('ts')
L = Literal
bnf_parser_decls = [
# declaration_set := declaration+
Decl('declaration_set'... |
"""
This file houses functions and classes that pertain to Roblox groups.
"""
import copy
from enum import Enum
import iso8601
import asyncio
from ro_py.wall import Wall
from ro_py.roles import Role
from ro_py.events import Event
from ro_py.users import BaseUser
from typing import Tuple, Callable
from ro_py.events... |
"""
A module for generic classification purpose.
Funtionality include:
normalize_l2norm: Normalize each row has unit l_2 norm.
normalize_mean0std1: Normalize each feature to have mean 0 and std 1.
balance_sample_size: Balance sample size of a data set among classes.
change_class_labels: Change class labels to {0... |
"""
The process handler module implements the ProcessHandler class
Created on Jan 21, 2016
@author: <NAME>
"""
import datetime
import multiprocessing
import os
from multiprocessing import Process
import time
import queue
from bson.objectid import ObjectId
from of.common.logging import write_to_log, EC_BREAKIN, SEV... |
#!/usr/bin/python
#
# File: DockSim.py
# Author: <NAME>
# Email: <EMAIL>
# Date: Dec 20, 2015
#----------------------------------------------------------------------------
from __future__ import print_function, division
from collections import namedtuple
from math import sqrt, trunc
StateVec = namedtuple('State... |
# from __future__ import print_function
import hashlib
import os
import sys
import array
from Cryptodome.PublicKey import RSA
from jwkest.aes_gcm import AES_GCM
from jwkest.aes_key_wrap import aes_wrap_key
from jwkest import b64e
from jwkest import long2intarr
from jwkest import intarr2long
from jwkest import long2he... |
from __future__ import absolute_import
#!/usr/bin/env python
import numpy as np
import numpy.random as nr
from numpy.testing import(assert_array_equal, assert_array_almost_equal,
assert_almost_equal)
from nose.tools import assert_true, assert_equal
from ..graph import (WeightedGraph, complet... |
import ast
import ntpath
from os.path import join
import os
import random
import pandas as pd
import pygame
from datetime import datetime
from time import time
from ast import literal_eval
import numpy as np
from dateutil.parser import parse
from expyriment import misc, stimuli
from expyriment.io import Keyboard
from... |
import random
from time import time
import numpy as np
import torch
import torchvision
from torch.utils.data import Dataset
from kornia import augmentation as augs, kornia, Resample
from kornia import filters
import torch.nn as nn
import torch.nn.functional as F
# Wrapper for a DLAS Dataset class that applies random ... |
import torch
from torch.jit import script, trace
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import csv
import random
import re
import os
import unicodedata
import codecs
from io import open
import itertools
import math
USE_CUDA = torch.cuda.is_available()
device = torch.device("cuda... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import time
import argparse
import zipfile
import gzip
import urllib.request
import tempfile
from tqdm import tqdm
from lxml import etree as ET
from pinyin import pinyinize
version = "1.3"
chi_lang2 = "ENG"
dictionaryname = "CC-CEDICT"
currenttime = ... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import pdb
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from .embednets import WordEmbeddingNetwork, ItemEmbeddingNetwork
import numpy as np
def get_positional_embeddings(n_position, emb_dim):
"""Create positional em... |
#!/usr/bin/env python
"""
Converts an XRC resource file (in a format wxGlade likes, i.e. all windows
inside sizers, no widget unknown to wxGlade, ...) into a WXG file.
@copyright: 2002-2007 <NAME>
@copyright: 2014-2016 <NAME>
@copyright: 2017-2020 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WAR... |
from __future__ import annotations
""" Classes and functions for pipette state tracking
"""
from dataclasses import asdict, replace
import logging
from typing import Any, Dict, Optional, Set, Tuple, Union, TYPE_CHECKING
from opentrons.types import Point
from opentrons.calibration_storage.types import PipetteOffsetByPi... |
# coding=utf-8
from __future__ import absolute_import, division, print_function
import copy
import json
import math
import six
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
def gelu(x)... |
"""
The value module.
Stores attributes for the value instance and handles value-related
methods.
"""
import logging
import threading
import warnings
from ..connection import message_data
from ..connection import seluxit_rpc
from ..errors import wappsto_errors
def isNaN(num):
"""Test if input is a float 'NaN' v... |
'''
Creates the images of the synthetic dataset described in https://doi.org/10.1109/TPAMI.2019.2936841
<NAME>
2019
'''
from os.path import exists, join, dirname, basename
import os
from glob import glob
import numpy as np
from PIL import Image, ImageDraw
import sys
import multiprocessing
import pandas as pd
import ... |
import logging
import os
import re
import signal
import subprocess
import sys
import threading
import traceback
from typing import Dict, List, Union
import boto3
from localstack_client.config import get_service_port
from moto.core import BaseModel
from moto.core.models import InstanceTrackerMeta
from localstack impor... |
from functools import partial
from itertools import count
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union, cast
import numpy as np
from tqdm import tqdm
from alibi.api.interfaces import Explainer, Explanation
from alibi.explainers.backends.cfrl_tabular import (get_conditional_vector,
... |
#!/usr/bin/env python2
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
import argparse
import logging
import os
import random
import requests
import re
import sys
import time
import urllib
# Add path for DIGITS package
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abs... |
from pmd_beamphysics import ParticleGroup
from pmd_beamphysics.units import unit, PARTICLEGROUP_UNITS
from pmd_beamphysics.statistics import norm_emit_calc
from matplotlib import pyplot as plt
import numpy.polynomial.polynomial as poly
import numpy as np
import copy
class ParticleGroupExtension(ParticleGroup):
... |
import os
import cv2
import json
import re
import datetime
import math
import asyncio
import pytesseract
import numpy as np
import urllib.request as rq
from sanic import Sanic
from sanic.response import json
from functools import wraps, partial
class Identity(object):
def __init__(self):
self.type = ""
... |
# @inproceedings{jaritz2019multi,
# title={Multi-view PointNet for 3D Scene Understanding},
# author={<NAME> <NAME> <NAME>},
# booktitle={ICCV Workshop 2019},
# year={2019}
# }
import os
import os.path as osp
import pickle
import time
import argparse
from functools import partial
import glob
import numpy as np
im... |
##########################################
# File: doosabin.py #
# Copyright <NAME> 2014. #
# Distributed under the MIT License. #
# (See accompany file LICENSE or copy at #
# http://opensource.org/licenses/MIT) #
##########################################
# Imports
import nu... |
'''
All in One Tool for:
Unpacking GT-Files
Adding them to a Workspace
Recognizing the Text from Images with different models
Aligning
'''
import re
import os
import json
import shutil
import subprocess
from zipfile import ZipFile
from collections import defaultdict
import glob
from ocrd_cis import Jav... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prettifies 'git diff' output.
prettify_diff() takes a diff string, and returns an HTML string decorating the
diff.
This code doesn't support other diff c... |
from __future__ import absolute_import
from compas_fab.backends.ros.messages.geometry_msgs import Point
from compas_fab.backends.ros.messages.geometry_msgs import Pose
from compas_fab.backends.ros.messages.geometry_msgs import PoseStamped
from compas_fab.backends.ros.messages.geometry_msgs import Quaternion
from compa... |
# -*- coding: utf-8 -*-
"""nixodmlconverter
nixodmlconverter converts odML content between odML and NIX files. The converter
a) imports content from an existing XML formatted odML file and appends it to
a new or existing NIX file. The content of an existing odML file is automatically
converted to the latest odML forma... |
import os
import sys
import time
import json
import datetime
import logging
import logging.config
import argparse
import utils
import spotify_api
def download_saved_songs(all_songs_file, results_dir, spotify_env):
'''
Checks the saved songs that we have in our library in Spotify and stores
the metadata of... |
"""
bbofuser: apps.v1api.views
FILE: patients
Created: 8/16/15 11:21 PM
"""
from django.contrib import messages
__author__ = '<NAME>:@ekivemark'
import json
import requests
from collections import OrderedDict
from oauth2_provider.decorators import protected_resource
from xml.dom import minidom
from xml.etree impo... |
# Copyright 2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... |
#! /usr/bin/env python
import math
import csv
import os
import sys
import argparse
import heapq
import collections
import sisterbayes
from sisterbayes import utility
class SisterBayesRejectorStatsVectorSizeException(Exception):
pass
class SisterBayesRejectorStatsVectorValueException(ValueError):
pass
class... |
# coding=utf-8
# Copyright 2021 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... |
# -*- coding: utf-8 -*-
"""
@file
@brief Implements function @see fn run_cmd.
.. versionadded:: 1.1
"""
from __future__ import print_function
import sys
import os
import time
import subprocess
import threading
import warnings
import shlex
if sys.version_info[0] == 2:
import Queue as queue
else:
import queue
... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... |
'''
title : app.py
description : Streamlit app that compares Messi and Ronaldo's stats and shows their positions on the pitch.
author : <NAME>
date_created : 20200521
date_modified : 20200613
version : 1.0
usage : streamlit run app.py
python_version : 3.7.6
'''
import dat... |
# -*- coding: utf-8 -*-
"""
Heuristics created by Vincent for PPMI dataset T1/T2/DTI images.
created @ 22th Mar. 2022
merged Ross's heuristics @ 30th Mar. 2022
"""
import os
import logging
lgr = logging.getLogger(__name__)
scaninfo_suffix = '.json'
# scanning protocol details
# converted
T1W_SERIES = [
'MPRAGE 2 ... |
import logging
import numpy as np
import os
from flarestack.core.energy_pdf import EnergyPDF
from flarestack.shared import min_angular_err, base_floor_quantile, \
floor_pickle, pull_pickle, weighted_quantile
from flarestack.utils.dynamic_pull_correction import \
create_quantile_floor_0d, create_quantile_floor_0... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
import cv2
import numpy as np
import dlib
from math import hypot
#import pyglet
import time
import webbrowser
from playsound import playsound
'''
# Load sounds
sound = pyglet.media.load("sound.wav", streaming=False)
left_sound = pyglet.media.load("left.wav", streaming=False)
right_sound = pyglet.media.load("right.wav"... |
from django.urls import reverse
from crits.campaigns.campaign import Campaign
from crits.campaigns.handlers import get_campaign_details
from crits.core.crits_mongoengine import EmbeddedCampaign
from crits.core.user_tools import user_sources
from crits.core.class_mapper import class_from_type, class_from_id
from pymis... |
r"""
Functions in ``polys.numberfields.subfield`` solve the "Subfield Problem" and
allied problems, for algebraic number fields.
Following Cohen (see [Cohen93]_ Section 4.5), we can define the main problem as
follows:
* **Subfield Problem:**
Given two number fields $\mathbb{Q}(\alpha)$, $\mathbb{Q}(\beta)$
via t... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
#!/usr/bin/env python
# Credit where credit is due...
__author__ = '<NAME> (@LaconicWolf)'
__date__ = '20171220xx~~~~~~##~~~'
__version__ = '0.01Xxxxx'
__description__ = """Parses the XML output from an nmap scan. The user
can specify whether the data should be printed,
displayed a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
#
# Grupo FalaBrasil (2020)
# Universidade Federal do Pará
#
# author: mar 2020
# <NAME> - https://cassota.gitlab.io/
# last edited: jul 2020
import sys
import os
from queue import Queue
from termcolor import colored
import config
from fb_t... |
"""
=======
Cliques
=======
Find and manipulate cliques of graphs.
Note that finding the largest clique of a graph has been
shown to be an NP-complete problem; the algorithms here
could take a long time to run.
http://en.wikipedia.org/wiki/Clique_problem
"""
# Copyright (C) 2004-2008 by
# <NAME> <<EMAIL>>
# ... |
# Copyright 2020 MONAI Consortium
# 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, s... |
from collections import defaultdict
import click
import os
import ms_peak_picker
import ms_deisotope
import glypy
from ms_deisotope import MSFileLoader
from ms_deisotope.data_source import RandomAccessScanSource
from ms_deisotope.output.mzml import ProcessedMzMLDeserializer
from ms_deisotope.feature_map import quick... |
from __future__ import print_function
"""
The MIT License (MIT)
Copyright (c) 2017, <NAME> <<EMAIL>>
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 limita... |
# coding: utf-8
from __future__ import print_function, unicode_literals
import argparse
import contextlib
import os
import shutil
import sys
from collections import OrderedDict
from importlib import import_module
from luamb.version import __version__
if sys.version_info[0] == 2:
from StringIO import StringIO
els... |
# -*- coding: utf-8 -*-
"""Download and process the opsd power plants for Germany.
SPDX-FileCopyrightText: 2016-2019 <NAME> <<EMAIL>>
SPDX-License-Identifier: MIT
"""
__copyright__ = "<NAME> <<EMAIL>>"
__license__ = "MIT"
# Python libraries
import os
import logging
import datetime
# Internal modules
from reegis i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processing for UNH-RVAT 3D OpenFOAM simulation.
by <NAME> (<EMAIL>)
"""
from __future__ import division, print_function
import matplotlib.pyplot as plt
import numpy as np
import os
from pxl import fdiff
import sys
import foampy
import pandas as pd
plt.style.use("five... |
"""Element symbols, names, Z values, and masses."""
# Element data (Z, symbol, name, and relative atomic mass) are from Wikipedia:
# https://en.wikipedia.org/wiki/List_of_chemical_elements
_Z_SYMBOL_NAME_MASS = (
(1, "H", "Hydrogen", 1.01),
(2, "He", "Helium", 4.00),
(3, "Li", "Lithium", 6.94),
(4, "... |
from itertools import zip_longest
from datetime import datetime, timedelta
from fcntl import flock, LOCK_EX, LOCK_NB
from collections import OrderedDict, Mapping, namedtuple
from socket import inet_pton, AF_INET6, AF_INET, error as SocketError
import os
import yaml
import re
import logging
logging.basicConfig()
logger... |
import zlib
from epigen.code_generator import code_generator_builder as bld
from epigen.symbol import EpiClass, EpiProperty, EpiEnum
from epigen.tokenizer import Tokenizer, TokenType
def _property_getter(prty: EpiProperty, **kwargs) -> str:
if prty.attr_find(TokenType.WriteOnly) is not None:
return None... |
import pytz
import hashlib
import uuid
import datetime
from furs_fiscal.base_api import FURSBaseAPI
TYPE_MOVABLE_PREMISE_A = 'A'
TYPE_MOVABLE_PREMISE_B = 'B'
TYPE_MOVABLE_PREMISE_C = 'C'
NUMBERING_STRUCTURE_CENTRAL = 'C'
NUMBERING_STRUCTURE_DEVICE = 'B'
REGISTER_BUSINESS_UNIT_PATH = 'v1/cash_registers/invoices/reg... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from itertools import chain
from torchtext import data
class RNN_VAE(nn.Module):
"""
1. Hu, Zhiting, et al. "Toward controlled generation of text." ICML. 2017.
2. Bowman, <NAME>., et a... |
#!/usr/bin/env python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import (
vtkFloatArray,
vtkIdList,
vtkPoints
)
fro... |
'''
Created on Apr 18, 2012
@author: danieles
'''
from sympy import sympify
from src.irbase import RValue, VecAccess, Pointer, AddressOf, Comment, sa
from src.isas.isabase import ISA, Loader, Storer, LoadReplacer
from src.isas.sse import mmLoaduPs, mmCvtssf32, mmShufflePs
from src.isas.sse2 import SSE2, mmLoadu... |
# Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
"""
file
~~~~~~
readfile by open/read for windows
:author: LoRexxar
:homepage: https://github.com/LoRexxar/Kunlun-M
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import re
import os
import time
impo... |
import abc
import asyncio
import collections
import contextlib
import fcntl
import functools
import inspect
import io
import mmap
import operator
import os
import pathlib
import random
import signal
import socket
import stat
import struct
import subprocess
import tempfile
import termios
import time
import types
import ... |
"""
Copyright 2020 Tianshu AI Platform. 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 applicable law or agreed... |
from functools import partial
import numpy as np
import nifty
import nifty.graph.opt.multicut as nmc
from .blockwise_mc_impl import blockwise_mc_impl
#
# cost functionality
#
def _weight_edges(costs, edge_sizes, weighting_exponent):
w = edge_sizes / float(edge_sizes.max())
if weighting_exponent != 1.:
... |
import numpy as np
def transform(dataset, rotation_center=0, slice_start=0, slice_stop=1):
# Get the current volume as a numpy array.
array = dataset.active_scalars
dark = dataset.dark
white = dataset.white
angles = dataset.tilt_angles
tilt_axis = dataset.tilt_axis
# Dark and white data... |
# coding=utf-8
# Copyright 2020 TF.Text 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 applicable law or ag... |
#!/usr/bin/env python
# encoding: utf-8
"""Azkaban CLI: a lightweight command line interface for Azkaban.
Usage:
azkaban build [-cp PROJECT] [-a ALIAS | -u URL | [-r] ZIP] [-o OPTION ...]
azkaban info [-p PROJECT] [-f | -o OPTION ... | [-i] JOB ...]
azkaban log [-a ALIAS | -u URL] EXECUTION [JOB]
azkaban run ... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchquantum as tq
import copy
from torchquantum.macro import C_DTYPE
from torchpack.utils.logging import logger
from typing import List, Dict, Iterable
from torchpack.utils.config import Config
from qiskit.providers.aer.noise... |
# This file and all related intellectual property rights are
# owned by Derivative Inc. ("Derivative"). The use and modification
# of this file is governed by, and only permitted under, the terms
# of the Derivative [End-User License Agreement]
# [https://www.derivative.ca/Agreements/UsageAgreementTouchDesigner.asp]
... |
# Copyright (c) 2020 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 21:54:18 2017
@author: lisu
"""
import os
import sys
import soundfile as sf
import numpy as np
import scipy
from scipy import signal
import argparse
from keras.models import load_model
def STFT(x, fr, fs, Hop, h):
t = np.arange(Hop, np.ce... |
# Lint as: python3
# 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 agr... |
"""
Process an input dataset into a format suitable for machine learning.
"""
import os
import gzip
import pandas as pd
import numpy as np
import csv
import numbers
import tempfile
import time
import sys
import logging
import warnings
from deepchem.utils.save import load_csv_files
from deepchem.utils.save import load_s... |
"""Test auto sharding with MLP."""
import unittest
from itertools import chain
import jax
import jax.numpy as jnp
import numpy as np
from flax import linen as nn
from flax import optim
from flax.training.train_state import TrainState
from jax.interpreters.pxla import Chunked, NoSharding, Replicated, ShardedAxis
impor... |
"""
Spatial and temporal covariance functions for GPCSD.
"""
import autograd.numpy as np
from gpcsd.priors import *
from gpcsd.forward_models import *
from gpcsd.utility_functions import expand_grid, reduce_grid
class GPCSD1DSpatialCov:
def __init__(self, x, a, b, ngl):
self.x = x
if a is None:
... |
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import os
import pickle
import struct
import sys
from functools import partial
from multiprocessing import Lock, Event as ProcessEvent
from threading import Thread, Event as TrEvent
from time import sleep, time
from typing import List, Dict, Optional
from multiprocessing import Process
import psutil
from six.moves.que... |
from collections import OrderedDict
from copy import deepcopy
import time
import pytest
import torch
from torch import nn
from torchgpipe import GPipe
from torchgpipe.gpipe import verify_module
def test_parameters():
model = nn.Sequential(nn.Linear(1, 1))
gpipe = GPipe(model, balance=[1], devices=['cpu'], c... |
'''
timelapse_generator.py - Create a .gif or sequence of .png files using a pixels.log
Author: <NAME>" Rodriguez
'''
import argparse
import re
from datetime import datetime, timedelta
from json import loads
from math import floor
from pathlib import Path
from PIL import Image
def find_config_path():
parent = Path... |
from reqlist import *
import random
from catalog.models import Course
def ceiling_thresh(progress, maximum):
"""Creates a progress object
Ensures that 0 < progress < maximum"""
effective_progress = max(0, progress)
if maximum > 0:
return Progress(min(effective_progress, maximum), maximum)
... |
## Copyright 2015-2019 <NAME>, <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 License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to i... |
#!/usr/bin/env python3
"""Read boot.bin and src.elf and produce debug.bin."""
import os
import sys
import struct
from enum import IntEnum, IntFlag
def printf(fmt, *args, **kwargs):
print(fmt % args, end='', **kwargs)
def readStruct(fmt, file, offset=None):
"""Read struct from file."""
if offset is not N... |
import uuid
from datetime import timedelta
import requests
from client import exceptions as ex
from client.sources.common import core
from client.utils import auth, format, encryption
from client.protocols.grading import grade
from client.cli.common import messages
import client
import collections
import glob
import... |
"""
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 logging
import os
import pickle
import random
import xml.etree.ElementTree as etree
from pathlib import Path
from typing import Callab... |
# Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space
# Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved.
r"""
This module provides utilities for visually inspecting star identification and ... |
import os
import pickle
import random
import sys
from pathlib import Path
from collections import deque
import gym
import gym_chrome_dino # This should be kept as it is registering the custom environments
import argparse
import torch
import pandas as pd
import wandb
from IPython.display import clear_output
from time... |
from .sol6_keys import *
from .list_utils import *
class TOSCA(TOSCA_BASE):
@staticmethod
def set_variables(cur_dict, obj, exclude="", variables=None, dict_tosca=None,
cur_provider=None):
"""
Take the input from the config file, and set the variables that are identifiers ... |
import copy
import os
import pathlib
import tempfile
import pycondor
from bilby_pipe.input import Input
from bilby_pipe.job_creation.node import Node, _log_output_error_submit_lines
from bilby_pipe.utils import check_directory_exists_and_if_not_mkdir, logger
from configargparse import DefaultConfigFileParser
from ..h... |
import tensorflow as tf
import numpy as np
############################################################################################################
# Convolution layer Methods
def __conv2d_p(name, x, w=None, num_filters=16, kernel_size=(3, 3), padding='SAME', stride=(1, 1),
initializer=tf.contrib.l... |
from __future__ import annotations
import asyncio
import logging
import typing as t
from datetime import datetime
from random import sample
import discord
from discord.ext import commands, tasks
from griffinbot.constants import Bot, Emoji, MOD_ROLES, StaffRoles
log = logging.getLogger(__name__)
def num_to_emoji(x... |
# This script is used as a bitbake task to create a new python manifest
# $ bitbake python -c create_manifest
#
# Our goal is to keep python-core as small as posible and add other python
# packages only when the user needs them, hence why we split upstream python
# into several packages.
#
# In a very simplistic way wh... |
# Copyright 2016-2020 Blue Marble Analytics 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
#!/usr/bin/env python
"""
Implementing 2D drawing primitives using
pyglet.gl
copyright 2007 by <NAME>
"""
from __future__ import division, print_function, unicode_literals
from pyglet import font
from pyglet import clock
from pyglet import window
from pyglet import image
from pyglet.gl import *
from pyglet.window imp... |
from keras.models import Sequential, Model
from keras.layers.convolutional import Conv2D, Conv3D, Conv2DTranspose
from conv3dTranspose import Conv3DTranspose
from keras.layers.normalization import BatchNormalization
from keras.layers import Activation
from keras import backend as K
from keras.layers import Input, Add, ... |
#!/usr/bin/env python
from __future__ import print_function
r"""
Runs the Sentieon Genomics Tools workflows using Google Pipelines API
"""
import yaml
import json
import argparse
import os
import sys
import copy
import time
import ssl
import warnings
import logging
import random
import google.auth
import googleapicl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.