text stringlengths 6.04k 39.5k |
|---|
from __future__ import print_function
from __future__ import division
import tensorflow as tf
from utils import adict
def conv2d(input_, output_dim, k_h, k_w, name="conv2d"):
with tf.variable_scope(name):
w = tf.get_variable('w', [k_h, k_w, input_.get_shape()[-1], output_dim])
b = tf.get_variable... |
######################################################################################################
# importar bibliotecas
######################################################################################################
import streamlit as st
from streamlit import caching
impo... |
from PyQt4 import QtCore, QtGui
from Device import Device
from acq4.util.Mutex import Mutex
import acq4.pyqtgraph as pg
import collections
import numpy as np
class OptomechDevice(object):
"""
OptomechDevice is an extenstion to the Device class which manages coordinate system mapping between
rigid... |
# -*- coding: utf-8 -*-
import unittest
from infi.clickhouse_orm.database import Database
from infi.clickhouse_orm.models import Model
from infi.clickhouse_orm.fields import *
from infi.clickhouse_orm.engines import *
import logging
logging.getLogger("requests").setLevel(logging.WARNING)
class TestCaseWithData(unit... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
try:
from inplace_abn import InPlaceABN
except ImportError:
InPlaceABN = None
class Conv2dReLU(nn.Sequential):
def __init__(
self,
in_channels,
out_channels,
kernel_size,
... |
#!/usr/bin/env python
#
# Debugify summary for the original debug info testing.
#
from __future__ import print_function
import argparse
import os
import sys
from json import loads
from collections import defaultdict
from collections import OrderedDict
class DILocBug:
def __init__(self, action, bb_name, fn_name, ins... |
from __future__ import absolute_import, division, print_function
import pygame
import random
from pygame.locals import *
from itertools import cycle
# Config ----------------------------------------------------------------------------------------------------------- #
WIDTH = 800
HEIGHT = 600
grid_size = 32
SCORE_MAX ... |
from pydantic import ValidationError
import pytest
import requests
import ray
from ray.dashboard.modules.serve.schema import (
RayActorOptionsSchema,
DeploymentSchema,
DeploymentStatusSchema,
ServeApplicationSchema,
ServeApplicationStatusSchema,
deployment_to_schema,
schema_to_deployment,
... |
import dash
import dash_html_components as html
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import pandas as pd
from dash.dependencies import Input, Output, State
import os
import datetime as dt
import plotly.express as px
from meal_planner import meal_planner_layout
from reci... |
import FWCore.ParameterSet.Config as cms
from HLTriggerOffline.Higgs.hltHiggsPostProcessor_cfi import *
# Build the standard strings to the DQM
def make_efficiency_string(objtype,plot_type,triggerpath):
# --- IMPORTANT: Add here a elif if you are introduce a new collection
# (see EVTColContaine... |
import argparse
import sys
import zipfile
from collections import Counter
from os import makedirs
from os.path import isdir, isfile, join
from typing import Callable
import numpy as np
import pandas as pd
sys.path.append("..")
from analysis_of_word_embeddings.analysis_utils import preprocess_name # noqa: E402
from ... |
"""
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: <NAME> <<EMAIL>>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
from abc import ABC, abstractmethod
from collections import namedtuple... |
from collections import namedtuple
from itertools import chain, tee
import logging
from neurolang.logic import Union
from operator import contains, eq
from typing import Iterable, List, Tuple, Type
from ...exceptions import NeuroLangException, NoValidChaseClassForStratumException
from ...expressions import Constant, F... |
# Copyright 2021 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 requi... |
#!/usr/bin/env python2
# Copyright 2017 The NXT 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 la... |
"""Test idlelib.configdialog.
Half the class creates dialog, half works with user customizations.
Coverage: 63%.
"""
from idlelib import configdialog
from test.support import requires
requires('gui')
import unittest
from unittest import mock
from idlelib.idle_test.mock_idle import Func
from tkinter import Tk, IntVar, ... |
#!/usr/bin/env python
import argparse
import os,sys
import time
import subprocess
from subprocess import Popen, PIPE
import multiprocessing
##########################
# FUNCTION
def select_on_chrom(in_vcf, accepted_chrom, excluded_chrom, selected_vcf):
#~ FH_in = open(in_vcf, encoding='utf8', 'rt')
# pou... |
# -*- coding: utf-8 -*-
#!/usr/bin/python3.9
################################################################################
## Elliptic Curve for learning/hacking - Vintage 2021 Python 3.9 ##
################################################################################
# Licenced under... |
from io import open
import itertools
import os
import re
import numpy as np
debug_mode = False
here = os.path.dirname(os.path.realpath(__file__))
def print_debug_output(results, dt):
print("\n\n\nDETERMINISTIC TERMS: " + dt)
alpha = results["est"]["alpha"]
print("alpha:")
print(str(type(alpha)) + s... |
import numpy as np
def dx_manifold(manifold, idx):
"Backwards difference of manifold co-ordinate idx along the x-axis"
dx = np.empty(manifold.shape[:-1] + (1,), dtype=manifold.dtype)
dx[1:,:, :, 0] = manifold[1:, :, :, idx] - manifold[:-1,:, :, idx]
dx[0, :, :, 0] = 0.
return(dx)
def dy_manifold(m... |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PRO... |
#!/usr/bin/env python3
#
# Author: <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... |
from utils import *
from torchvision.transforms import *
from torch.utils.data.sampler import Sampler
from torch.utils.data import Dataset, DataLoader
from torch import nn
from torchvision import models as cnn_models
from torch.nn import functional as F
from torchvision.models._utils import IntermediateLayerGetter
f... |
import pygame
import random
from .. import context
from .. import animobs
from .. import maps
from .. import waypoints
import math
from .. import container
from . import plasma
from . import anchors
from . import mutator
from . import decor
from . import gapfiller
from . import converter
from . import prep
from . impo... |
#!/usr/bin/python
import os, sys
from . utils import err, dbg, enable_debug
from . exceptions import SymbioticException
def get_versions():
""" Return a tuple (VERSION, versions, llvm_versions) """
# the numbers must be separated by '-, otherwise it will
# break the tool-module in benchexec
VERSION=... |
import numpy as np
import pandas as pd
import csv
import time
import matplotlib.pyplot as plt
import tensorflow as tf
import os
# from tensorflow.compat.v1.keras.layers import CuDNNLSTM
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
physical_devices = tf.config.list_physical_devices('GPU')
try:
tf.config.experimental.... |
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the AiiDA-FLEUR package. #
... |
import discord
from discord.ext import commands, tasks
import asyncio
import datetime
import json
import logging
import sys
import traceback
import aiohttp
import dateutil.parser
import feedparser
import isodate
import clients
from utilities import checks
sys.path.insert(0, "..")
from units.time import duration_to... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, <NAME> <<EMAIL>>
# Copyright: (c) 2012, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION ... |
"""Decode and create messages from product id 8, 16, 17 (NOTAM) frames.
The following messages are created from here:
* NOTAM_TFR
* NOTAM
* FIS_B_UNAVAILABLE
The NOTAM type will have a subtype of 'D', 'FDC', 'TMOA', or 'TRA'.
"""
import sys, os, json, time, re, pprint
import fisb.level2.level2Config as cfg
import ... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import posixpath
import uuid
import sys
import tempfile
import threading
import time
from datetime import datetime
from py_utils im... |
# -*- coding:utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.metrics import classification_report, \
confusion_matrix
def plot_confusion_matrix(cm, class_names, name):
"""
Returns a matplotlib figure containing the plotted confusion matrix.
Args:
cm... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 28 17:00:53 2020
@author: wwr
"""
import copy
import os
import re
import nltk
import openpyxl
from Phrase_parse import PhraseParse
from Relation_extraciton_dp import RelationExtraciton
from T_pre_processor import TPreProcessor
from dictionary import Dictionary
from get_f... |
'''
Name: extract.py
Desc: Extract losses.
Usage:
python encode_inputs.py /path/to/cfgdir/ --gpu gpu_id
'''
from __future__ import absolute_import, division, print_function
import argparse
import os
import numpy as np
import pdb
import pickle
from runstats import Statistics
import tensorflow as tf
import t... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
base64... |
import numpy as np
import tensorflow as tf
from numpy.testing import assert_array_almost_equal as array_eq
from sklearn.utils.testing import assert_raises
import pytest
import multiview_gpu.mvsc as mvsc
from multiview_gpu.util import load_data_tf, load_data_tf_internal, normalize_labels
def test_laplacian_ng(sess):
... |
"""Tests for lr_scheduler.py"""
from unittest.mock import Mock
import numpy as np
import pytest
from sklearn.base import clone
from torch.optim import SGD
from torch.optim.lr_scheduler import CosineAnnealingLR
from torch.optim.lr_scheduler import ExponentialLR
from torch.optim.lr_scheduler import LambdaLR
from torch.... |
# Copyright 2018 Canonical 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 in writin... |
import math
import sys
PROCESSES=12
MAXWEEK=18
MAXDATA = 1
#COLUMN = 3 # 5% sampling of cases
COLUMN = 1 # Cases
TYPE = 1
if len(sys.argv) > 1:
country = sys.argv[1]
MAXDATA = int(sys.argv[2])
if MAXDATA < 0:
MAXDATA = -MAXDATA
directory = "Fits/Replica-{:03d}/"
TYPE = -1
else:
directory = "Run-{:... |
# Copyright (c) 2019 Graphcore Ltd. 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 l... |
from copy import deepcopy
from pentagon import migration
from pentagon.migration import *
import yaml
ig_message = """
# This file has been updated to contain a new set of InstanceGroups with one per Subnet
# The min/max size should be the original size divided by the number of subnets
# In order to put the new Inst... |
import cv2
import sys
import os
sys.path.append('..')
import numpy as np
from maskrcnn_benchmark.structures.bounding_box import BoxList
from preprocess.colors import get_colors
from maskrcnn_benchmark.structures.image_list import ImageList
from maskrcnn_benchmark.structures.segmentation_mask import SegmentationMask, Po... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 31 10:06:46 2017
@author: paul
"""
import sys
import math
from math import exp, sqrt, asin, log
import random as rand
import numpy as np
from utils import Hist
from master_node import MasterNode
sys.path.append("../model/")
import simulatorTLKT as ... |
import open3d as o3d
import argparse
import os
import sys
import logging
import numpy
import numpy as np
import torch
import torch.utils.data
import torchvision
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
from tqdm import tqdm
import transforms3d.euler as t3d
import transforms3d
impor... |
import time
import os
from collections import OrderedDict
import sys
import torch
import csv
import yaml
import re
import socket
import copy
from kge.job import Trace
from kge import Config
## EXPORTED METHODS #####################################################################
def add_dump_parsers(subparsers):
... |
## @package param_init
#
# Initialise some inputted variables
from pyquil.quil import Program
from pyquil.api import get_qc
import pyquil.paulis as pl
from pyquil.gates import H, CPHASE, PHASE, RESET, MEASURE
import numpy as np
import random as rand
from numpy import pi,log2
def HadamardToAll(prog, qubits... |
###############################################################################
#
# 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 fi... |
#!/usr/bin/env python3
from distutils.version import LooseVersion
import argparse
import base64
import collections
import copy
import itertools
import json
import jsonschema
import pathlib
import shutil
import sys
import tempfile
import re
import zipfile
def main():
parser = argparse.ArgumentParser(
desc... |
import abc
import time
import pickle
import logging
from enum import Enum
from pathlib import Path
from queue import PriorityQueue
from collections import OrderedDict, defaultdict
from typing import Callable, Dict, Iterable, Iterator, List, Sequence, Set, Tuple, Union
import numpy as np
from tqdm import tqdm
from scip... |
# vim:ts=4:sw=4:sts=4:et
# -*- coding: utf-8 -*-
"""Interface to the Nexus online graph repository.
The classes in this file facilitate access to the Nexus online graph
repository at U{http://nexus.igraph.org}.
The main entry point of this package is the C{Nexus} variable, which is
an instance of L{NexusConnection}. ... |
import os
import sys
import time
import torch
import logging
import argparse
import copy
from tqdm import tqdm
from torch import Tensor
from omegaconf import open_dict
from typing import Dict, Optional
from fairseq import utils
from fairseq.checkpoint_utils import load_model_ensemble_and_task
logging.bas... |
# Copyright 2017 The Bazel 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 applicable la... |
import itertools
import json
import os
from lib.anacreonlib import anacreon
from lib.anacreonlib.anacreon import Anacreon
class SkipWorldException(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
def counter(func):
def wrapper(*args, **kwargs):
# se... |
'''
implement the feature extractions for light CNN
@author: <NAME>
@date: 2017.07.04
'''
from __future__ import print_function
import argparse
import os
import shutil
import time
from PIL import Image, ImageOps
import glob
import torch
import torch.nn as nn
import torch.nn.parallel
impor... |
from os import path
import math
import pandas as pd
import MDAnalysis
from enmspring import ic_table
from enmspring import pairtype
from enmspring.miscell import check_dir_exist_and_make
from enmspring.k_b0_util import get_df_by_filter_st, get_df_by_filter_bp, get_central_bps_df, get_df_by_filter_PP, get_df_by_filter_R... |
"""
Collection of TensorFlow hooks.
"""
import time
from datetime import datetime
import pynvml as nvml
import tensorflow as tf
from tensorflow.core.framework.summary_pb2 import Summary
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import summary_io, training_util, sessi... |
from copy import copy
import adjustText as aT
import geopandas as gpd
import geoplot as gplt
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as stats
import seaborn as sns
import statsmodels.api as sm
from matplotlib import cm
from matplotlib... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Ableton AG, Berlin. All rights reserved.
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
"""A small wrapper script to call CodeNarc and interpret its output."""
import argparse
import logging
import os
import platfor... |
import pickle
import re
from hashlib import md5
from jasmin.protocols.cli.managers import PersistableManager, Session
from jasmin.protocols.cli.protocol import str2num
from jasmin.routing.jasminApi import User, MtMessagingCredential, SmppsCredential, jasminApiCredentialError
MtMessagingCredentialKeyMap = {'class': 'Mt... |
#!/usr/bin/env python
import argparse
import collections
import copy
import json
import os
from pathlib import Path
import pickle
import shelve
import cv2
import gym
import gym.wrappers
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import ray
from ray.rllib.env import MultiAgentEnv
from ray... |
# -*- coding: utf-8 -*-
import contextlib
import wave
import subprocess
from scipy import *
import sys
import webrtcvad
from pydub import AudioSegment
import numpy as np
import collections
import os
import matplotlib.pyplot as plt
import glob
maleFemaleFreq = [120, 232]
TS=3 #time for simple method
humanVoiceMinMAx ... |
# Copyright 2020 MIT Probabilistic Computing Project.
# See LICENSE.txt
"""Convert SPPL to Python 3."""
import ast
import inspect
import copy
import io
import os
import re
from types import SimpleNamespace
from collections import namedtuple
from collections import OrderedDict
from contextlib import contextmanager
f... |
import ast
from .util import to_taichi_type
class TaichiSyntaxError(Exception):
def __init__(self, *args):
super().__init__(*args)
class ScopeGuard:
def __init__(self, t, stmt_block=None):
self.t = t
self.stmt_block = stmt_block
def __enter__(self):
self.t.local_scopes.append([])
def __e... |
# coding: utf-8
# In[2]:
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.backend as K
import numpy as np
# In[3]:
# In[4]:
"""
arg:
pred.shape: (batch_size,feature_size_h,feature_size_w,3*(5+num_class))
anchors.shape: (3,2)
return:
proc... |
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from myexp import ex
def get_utt_list(_dir_dataset):
l_utt = []
for root, dirs, files in os.walk(_dir_dataset):
for f in files:
if os.path.splitext(f)[1] == ".npy":
l_utt.append(f.s... |
# coding: utf-8
u"""Меахнизмы фильтрации справочников/реестров на базе ObjectPack."""
from __future__ import absolute_import
from functools import reduce
from operator import and_
from operator import or_
import abc
import json
import itertools
from six.moves import map
import six
from django.db import models
from m... |
"""
Algorithms for computing the skeleton of a binary image
"""
import numpy as np
from scipy import ndimage
from ._skeletonize_cy import _skeletonize_loop, _table_lookup_index
# --------- Skeletonization by morphological thinning ---------
def skeletonize(image):
"""Return the skeleton of a binary image.
... |
import logging
import keyword
import re
import operator
import lldb
log = logging.getLogger('expressions')
__all__ = ['init_formatters', 'analyze', 'PyEvalContext', 'Value', 'find_var_in_frame',
'preprocess_simple_expr', 'preprocess_python_expr', 'escape_variable_name']
debugger_obj = None
analyzed = {} #... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Build script for local and azure pipeline builds."""
import datetime
import os, sys
import time
import timeit
import subprocess
import shutil
import argparse
import warnings
import tempfile
import fnmatch
from pathlib import Path
from tempfil... |
import torch
from torch import nn
import numpy as np
import torchvision.transforms as transforms
from PIL import Image
from moco.moco import loader as moco_loader
import torchvision.transforms.functional as F
import math
def gen_mask(batch, image_size, num_blocks, kernel, ratio=1.25, proportion=(.5, .8), redundancy=2.... |
import base64
import datetime
import logging
import time
import ee
from flask import abort, Response
import openet.ssebop as ssebop
logging.getLogger('googleapiclient').setLevel(logging.ERROR)
# DAYMET v2 Median Tcorr Export Input File
MODEL_NAME = 'SSEBOP'
COLLECTIONS = ['LANDSAT/LC08/C01/T1_TOA', 'LANDSAT/LE07/C... |
import argparse
import time
import math
import os, sys
import torch
torch.set_printoptions(threshold=100000)
import numpy as np
from gpu import add_gpu_params, parse_gpu, distributed_opt, distributed_gather, distributed_sync, cleanup
from exp_utils import create_exp_dir
from data_utils import FT_Data... |
# Copyright (c) 2017 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... |
import os
import random
import pkgutil
import io
import contextlib
import itertools
with contextlib.redirect_stdout(None):
import pygame
from pygame import *
__author__ = "<NAME>"
ACTION_FORWARD = 0
ACTION_UP = 1
ACTION_DOWN = 2
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
BACKGROUND_COL = WHITE
WIDTH, HEIGHT... |
"""
IMTOOLS module contains routines that are usually used to manipulate images.
Author: <NAME> (ISP-SU 2015)
"""
import numpy as np
#import ipdb as db
import matplotlib.pyplot as plt
from scipy.interpolate import interp2d
import time
def histo_opt(img, cutoff = 1.e-3, top_only = False, bottom_only = False, get_idx = ... |
"""Implementation of the Protocol layer
ocean optics spectrometers use two different communication protocols:
- one is called 'OBP protocol' # OceanBinaryProtocol
- the other one 'OOI protocol' # ??? OceanOpticsInterface ??? maybe
"""
import functools
import hashlib
import struct
import time
import warnings
import ... |
import numpy as np
import sys
'''
x['pi_SS'] = {'state':'pi'
'corr':cosh, 'n_state':3,
't_range':np.arange(10,21,1), 'T':T
'snk':'S', 'src':'S'
'factorized_fit (z_snk_n z_src_n) or not (A_n)'
}
'''
class CorrFunction:
def En(self, x, p, n):
... |
"""
navigating.py constants and basic functions for navigation
"""
from __future__ import absolute_import, division, print_function
import sys
import math
# Import ioflo libs
from .sixing import *
from .odicting import odict
from ..base import excepting
from .consoling import getConsole
console = getConsole()
TWO... |
# Copyright 2013 Amazon.com, Inc. or its 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# !pip install 'tensorflow==1.5.0'
# !pip install 'edward==1.3.5'
# # Configure env...
# In[2]:
# %matplotlib inline
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import edward as ed
# import matplotli... |
# Copyright (C) 2015-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import numpy
import dolfin
from dolfin import Constant
from ocellaris.utils import (
ocellaris_error,
timeit,
linear_solver_from_input,
create_vector_functions,
shift_fields,
velocity_change,
)
from ocellaris.solver_parts im... |
import math
import time
import pandas as pd
import multiprocessing
import numpy as np
import py_entitymatching.catalog.catalog_manager as cm
from py_entitymatching.dask.dask_overlap_blocker import DaskOverlapBlocker
from py_stringmatching.tokenizer.whitespace_tokenizer import WhitespaceTokenizer
from py_stringmatchi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 pyReScene
#
# 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 ri... |
import ast, sys, io, pstats, cProfile, time, random, os
from .canonicalize import getAllImports, getAllImportStatements, runGiveIds, anonymizeNames, getCanonicalForm, propogateMetadata, propogateNameMetadata
from .path_construction import diffAsts, generateNextStates
from .individualize import mapEdit
from .generate_me... |
import os
import logging
import argparse
import numpy as np
from tqdm import tqdm
import torch
from torch.serialization import default_restore_location
from seq2seq import models, utils
from seq2seq.data.dictionary import Dictionary
from seq2seq.data.dataset import Seq2SeqDataset, BatchSampler
from seq2seq.beam impor... |
"""
Functions used for generating custom fonts from SVG files.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import errno
import glob
import logging
import os
import time
import tempfile
import subprocess
import warnings
try:
import cPickle as pickle
except ImportEr... |
"""
This code is used to fit KRR. Note that KRR for large
datasets can require a lot of memory. For FMNIST models
we used 64GB and for synthetic datasets (with n = 10^5),
we used 128GB of RAM. This code is written for Python 2.7.13.
Inputs:
experiment_name: The name of the experiment (used for record keeping).
para... |
#!/usr/bin/env python
# <NAME> (<EMAIL>)
# Wed Jun 30 17:02:45 EDT 2021
if __name__ == '__main__':
from misc.timer import Timer
tt = Timer(f'start {__file__}')
import sys, os.path, os, glob, datetime
import xarray as xr, numpy as np, pandas as pd, matplotlib.pyplot as plt
#more imports
from scipy.optimize impor... |
from . import ValueMapping, ProtocolError
from .messages import Message, CommonMessageHeader, MessageType
class PortID:
def __init__(self, id_input):
id_type = type(id_input)
id_value = None
if id_type == bytes:
id_value = int.from_bytes(id_input, byteorder="big", signed=False... |
# Copyright 2021 The Flax 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 abc
import copy
from numbers import Integral
from collections import defaultdict
import astropy.units as u
import gwcs
import gwcs.coordinate_frames as cf
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.modeling import models
from astropy.modeling.models import tabular_model
from astrop... |
# Copyright 2020 The TensorFlow Probability 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 o... |
import ast
import copy
import datetime
import json
import logging
import os
import shutil
import traceback
import warnings
from io import StringIO
import numpy as np
from astropy.io import fits
from django.conf import settings
from interface.models import StarsFilter
from lcc.cli.input_parse import parse_query_ranges... |
##############################################################################
#
# Copyright (c) Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE... |
# /*
# * Copyright 2018 IBM Corporation
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicab... |
#!/usr/bin/python2.5
# Copyright (C) 2011 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 la... |
import c3linearize as _c3linearize
import collections as _collections
import jinja2 as _jinja2
import json as _json
import pathlib as _pathlib
import pkg_resources as _pkg_resources
import ruamel.yaml as _yaml
from ruamel.yaml import YAML as _YAML
import runpy as _runpy
import subprocess as _subprocess
import sys as _s... |
# Auto generated from config_schema.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-01-25T15:34:58
# Schema: config_schema
#
# id: https://linkml.io/sparqlfun/config_schema
# description: Schema for configuration
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
im... |
import re
from datetime import datetime
from uuid import UUID
from enum import Enum, auto
from graphql.language.source import Source
from graphql.language.parser import parse
from graphql.language.ast import (
ObjectTypeDefinition,
NamedType,
NonNullType,
ListType,
InputObjectTypeDefinition,
E... |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.