text stringlengths 8.04k 46.5k |
|---|
""" """
from shakedown import *
from utils import *
from dcos.errors import DCOSException
from distutils.version import LooseVersion
import uuid
import random
import pytest
marathon_1_3 = pytest.mark.skipif('marthon_version_less_than("1.3")')
marathon_1_4 = pytest.mark.skipif('marthon_version_less_than("1.4")')
mara... |
# =========================================================
# =========================================================
import os
import numpy as np
import logging
import gc
import h5py
from skimage import transform
import config.system_paths as sys_config
import utils
import pydicom as dicom
import subprocess
from ski... |
import array
import asyncio
import contextlib
import datetime
import functools
import random
import sys
from typing import Union
import netifaces
import pytest
import uvloop as uvloop
import conftest
import test_data
from aiolo import MultiCast, AioServer, Address, Message, PROTO_UDP, PROTO_UNIX, TimeTag, FRAC_PER_S... |
import torch
import numpy as np
from typing import *
from abc import ABCMeta
from torch import Tensor
from torch.nn import Module
from torch.nn import ModuleDict
from cftool.misc import update_dict
from cftool.misc import shallow_copy_dict
from cftool.misc import register_core
from cftool.misc import context_error_ha... |
# 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... |
# <NAME> - 170401058
from math import sqrt
# Veriler
veriler = list()
f = open("veriler.txt", "r")
text = f.readlines()
f.close()
for i in text:
veriler.append(int(i))
def fonksiyon(a, katsayilar):
y = 0
for i in range(len(katsayilar)):
y += katsayilar[i] * (a) ** i
return... |
from collections import defaultdict, deque
from typing import (
TYPE_CHECKING,
DefaultDict,
Dict,
Generic,
List,
Optional,
Set,
Tuple,
TypeVar,
)
from comb_spec_searcher.comb_spec_searcher import CombinatorialSpecificationSearcher
from comb_spec_searcher.exception import NoMoreClass... |
import sys
import os
import code
import keyword
import itertools
import unicodedata
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtWidgets import (
QListView, QSizePolicy, QAction,
QMenu, QSplitter, QToolButton,
QFileDialog, QMessageBox
)
from PyQt5.QtGui import (
QTextCursor, QFont, QColor, QPalett... |
###############################################################################
# Phase Retrieval Algorithms : HIO, RAAR, GPS, gRAAR, dRAAR, dpGPS
#
# Author: <NAME>
#
# Contact: <EMAIL>
###############################################################################
__all__ = ['PhaseRetrieval']
import math
import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mie solution
Calculates the electric field component (Ex) for a plane wave that
is scattered by a dielectric sphere.
Some of this code is a partial translation of the Matlab code from
<NAME>
http://www.mathworks.de/matlabcen... |
# Copyright (c) 2018, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
import logging
logger = logging.getLogger()
class Error(Exception):
"""Base class for exceptions ... |
import torch
import logging
import os
import numpy as np
import fnmatch
from PIL import Image
from libs.utils import batch_project
from scipy.io import loadmat, savemat
from torch.utils.data import Dataset
import imgaug.augmenters as iaa
import imgaug as ia
from imgaug.augmentables import Keypoint, KeypointsOnImage
imp... |
import tensorflow as tf
import numpy as np
import numpy.linalg as nl
import utils.general
import skimage.feature
import json
import os
PAF_type = 0
allPAFConnection = [[np.array([[1, 8], [8, 9], [9, 10], [1, 11], [11, 12], [12, 13], [1, 2], [2, 3], [3, 4], [2, 16], [1, 5], [5, 6], [6, 7], [5, 17], [1, 0], [0, 14], [0,... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder
import lightgbm as lgb
from catboost import CatBoostClassifier
from sklearn.model_selection import train_test_split
#导入数据集
def read_data(base_info_path,
... |
import os
import glob
import tensorflow as tf
from timeit import default_timer
from itertools import product
from graph_nets.graphs import GraphsTuple
from graph_nets.utils_np import graphs_tuple_to_networkxs, networkxs_to_graphs_tuple, get_graph
import numpy as np
import networkx as nx
from networkx.drawing import dr... |
# --------------------------------------------------------
# Deep Iterative Matching Network
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by <NAME>, <NAME>
# --------------------------------------------------------
from __future__ import print_function, division
import sys
import os
cur_... |
import os
import weakref
import uuid
import AppKit
import vanilla
import ezui
from lib.tools import fontInstaller
from lib.settings import applicationTestInstallRootPath
from mojo.UI import getDefault, setDefault
from mojo.events import (
publishEvent,
addObserver,
removeObserver
)
from mojo.subscriber impo... |
'''
Будем называть два многоугольника подобными, если существует взаимно
однозначное отображение сторон этих двух фигур такое, что соответствующие
стороны пропорциональны с коэффициентом пропорциональности k, а углы,
образованные двумя соответствующими сторонами, равны.
Найти два подобных N-угольника, где N – максималь... |
"""
* Project [darzyx]
* Sketch_001: "Circuitboard Disk"
* by <NAME>
*
* A cyberpunk-inspired circuit board disk.
* Created using Python Mode for Processing.
*
"""
import math
# ************************************
# Global Variables:
# ************************************
axPxl = 329
ayPxl = 315
bxPxl = 420... |
import math
import interpolators
import scipy.interpolate
import numpy as np
import pandas as pd
from ..core.status import Status
from empirical_turbulence import AugmentedTurbulenceCorrection
class Relaxation(object):
def __init__(self, correction):
self.correction = correction
def relax(self, wi... |
import ctypes
################################################################################
GLFWerrorfun = ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_char_p)
GLFWwindowposfun = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int, ctypes.c_int)
GLFWwindowsizefun = ctypes.CFUNCTYPE(... |
import requests
import json
import re
import time
import os
import platform
import sys
import datetime
import threading
import bv_dec_or_enc as bv #bv 为 Bilibili的视频BV号(这里值BV和AV互转的模块)
#关闭requests模块的InsecureRequestWarning警告提示
#from:https://www.cnblogs.com/milian0711/p/6836384.html
#此处 VS Code 报错为正常现象
from requests.packa... |
#!/usr/bin/env python3
"""Larynx web server"""
import argparse
import asyncio
import contextlib
import functools
import io
import json
import logging
import platform
import signal
import time
import typing
from collections import defaultdict
from pathlib import Path
from urllib.parse import parse_qs
from uuid import uu... |
"""Initial
Revision ID: 554527aefe1d
Revises: None
Create Date: 2014-12-15 16:55:56.475297
"""
# revision identifiers, used by Alembic.
revision = '5<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op... |
# Copyright (C) 2019 Wildfire Games.
# This file is part of 0 A.D.
#
# 0 A.D. 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 2 of the License, or
# (at your option) any later version.
#
# 0 A.D... |
import os
import gc
import sys
import time
import shutil
import json
import argparse
import numpy as np
from PIL import Image
from tqdm import tqdm
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import figure
from skimage import io
import cv2
import torch
import torch.nn as nn
import torch.nn.fun... |
# Copyright 2016-19 <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 in writing, so... |
from collections import OrderedDict
import copy
from itertools import zip_longest
import json
import logging
import os
import random
import time
import zlib
from BaseClasses import World, CollectionState, Item, Region, Location, Shop
from Items import ItemFactory
from KeyDoorShuffle import validate_key_placement
from ... |
############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# Modifications copyright (c) 2018-2019 <NAME> #
# ... |
from abc import ABCMeta, abstractmethod
import gym
from gym.spaces import Box
import logging
import numpy as np
import tree
from typing import Dict, List, Optional
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.policy.view_requirement import ViewR... |
from collections import OrderedDict
import pydoc
import warnings
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
Index,
Series,
TimedeltaIndex,
date_range,
period_range,
timedelta_range,
)
from pandas.core.arrays impo... |
from __future__ import print_function, absolute_import
import sys
import string
from collections import defaultdict
from nlp_util import render_tree
from nlp_util import head_finder
from nlp_util import coreference
from nlp_util import coreference_reading
# TODO:
# Add ordering information for the context printing
# A... |
#
# Copyright (c) 2012-2020 MIRACL UK Ltd.
#
# This file is part of MIRACL Core
# (see https://github.com/miracl/core).
#
# 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.apac... |
from __future__ import print_function
import argparse
from utils.utils import *
import torch.nn as nn
import torch.distributions as td
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.transforms as transforms
from data_loader.get_loader import get_loader
import numpy as np
import o... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#
# Copyright 2015 Quantopian, 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 wr... |
"""
This file reads in a pygsti dataset file and converts it to a valid
OpenQL sequence. FIXME: copy/paste error
"""
import os
import numpy as np
from pycqed.measurement.randomized_benchmarking import randomized_benchmarking as rb
from pycqed.measurement.openql_experiments import openql_helpers as oqh
from pycqed.meas... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import os
import pickle
import re
import sys
import copy
import json
import yaml
import redis
import bisect
import shutil
import difflib
import hashlib
import warnings
import... |
#
# Copyright (c) 2011-2014 The developers of Aqualid project - http://aqualid.googlecode.com
#
# 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 limitati... |
import numpy as np
import time
ELAPSED_TIME_OPT = True
def hw_RSEPD(input_image = None, Ts = 20):
start_time = time.time()
if (type(input_image) is not "numpy.ndarray"):
if ((len(input_image.shape) is not 2)):
raise ValueError("'input_image' MUST be 2D image np array")
rowsize, colsi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import struct
from .resources import *
# ISO language and country codes to Macintosh Region codes (from Script.h)
# <key> == CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(NULL,
# ... |
from . import biolab_utilities
from .pyeeg import pyeeg
import pandas as pd
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy import stats, signal
from scipy import interpolate
import xml.etree.ElementTree as ET
import time
def calculate_feature(record: pd.DataFrame, name, **kwargs):
... |
# Copyright 2019 The Texar 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 ... |
#! /usr/bin/env python
# (c) 2016-Jun-08 <EMAIL>
# Modified by ntejos to make it a more flexible script
import sys
import os
import copy
from pyraf import iraf
from pyraf.iraf import gemini, gemtools, gmos, onedspec
import fileSelect as fs
from utils import ask_user
def create_database():
# check whether
p... |
"""Online Non-Negative Matrix Factorization.
Implementation of the efficient incremental algorithm of <NAME>, <NAME> et al.
`[PDF] <https://arxiv.org/abs/1604.02634>`_.
This NMF implementation updates in a streaming fashion and works best with sparse corpora.
- W is a word-topic matrix
- h is a topic-document matrix
... |
r"""
Sage's IPython Modifications
This module contains all of Sage's customizations to the IPython
interpreter. These changes consist of the following major components:
- :class:`SageTerminalApp`
- :class:`SageInteractiveShell`
- :class:`SageTerminalInteractiveShell`
- :func:`interface_shell_embed`
SageTerm... |
#!/usr/bin/env python
"""
Module that performs extraction. For usage, refer to documentation for the class
'Extractor'. This module can also be executed directly,
e.g. 'extractor.py <input> <output>'.
"""
import argparse
import hashlib
import multiprocessing
import os
import shutil
import tempfile
import traceback
i... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import ba... |
# Copyright (c) 2012-2020 Jicamarca Radio Observatory
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
"""Definition of diferent Data objects for different types of data
Here you will find the diferent data objects for the different types
of data, this data objects must be use... |
"""
Convert your Python functions into CLI commands
"""
import re
import sys
from argparse import Action, ArgumentParser
from enum import Enum, EnumMeta
from functools import partial
from importlib import import_module
from inspect import Parameter, signature
from itertools import product
from os import path
from pkgut... |
"""
TCP/IP Protocol Stack
WARNING: before parsing the application layer over a TCP stream, you must
first combine all the TCP frames into a stream. See utils.tcpip for some solutions.
"""
from construct import *
from construct.lib import *
#===========================================================================... |
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Tuple, Union, TYPE_CHECKING
import sympy as sp
import numpy as np
from pyomo.environ import (
ConcreteModel, RangeSet, Param, Var, Constraint, ConstraintList,
)
from sympy import Matrix as Mat
from . import utils, variable_list, visual
from ... |
import re
import os
import time
import logging
from tqdm import tqdm
import pandas as pd
import numpy as np
from glob import glob
import torch
from transformers import BertTokenizer
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import TensorDataset, DataLoader
from ignite.engine import Engi... |
import logging
import os
from galaxy.util import asbool
from galaxy.util.bunch import Bunch
from galaxy.util.dictifiable import Dictifiable
from tool_shed.util import common_util
log = logging.getLogger(__name__)
class ToolShedRepository(object):
dict_collection_visible_keys = ['id', 'tool_shed', 'name', 'owner... |
from __future__ import print_function, division, absolute_import
import os, sys, subprocess
import itertools
import numpy as np
from numba import unittest_support as unittest
from numba.compiler import compile_isolated
from numba import types, typeinfer, typing, jit, errors
from numba.typeconv import Conversion
fro... |
from django import http
from django.contrib import admin, auth, contenttypes, messages
from django.core.exceptions import PermissionDenied
from django.forms.fields import ChoiceField
from django.forms.widgets import HiddenInput
from django.shortcuts import get_object_or_404, redirect
from django.template.loader import ... |
# Copyright 2022 <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 in writing, so... |
#
#abstractions for handling signals and sample rate conversion
import math
import itertools
def fracApprox(r,dmax=20):
lb = (int(r),1)
ub = (lb[0]+1,1)
nd = lb[1]+ub[1]
while nd <= dmax:
nb = (lb[0]+ub[0],nd)
v = nb[0]/nb[1]
if r < v:
ub = nb
... |
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved.
import os
import torch
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from .networks import NetworksFactory
from .base_model import BaseRunnerModel
from .flowcomposition import FlowComposition, FlowC... |
# -*- coding: utf-8 -*-
"""Dpkg build files generator."""
import logging
import os
import shutil
import stat
import time
class DPKGBuildConfiguration(object):
"""Dpkg build configuration.
Attributes:
has_bin_directory (bool): True if the Python module creates
a /usr/bin directory.
has_egg_info_d... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2020 by <NAME> <<EMAIL>>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Utility functions."""
from __future__ impo... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/9/12
# @Author : MashiroF
# @File : TaskCenter.py
# @Software: PyCharm
'''
cron: 25 5,12 * * * TaskCenter.py
new Env('欢太任务中心');
'''
import os
import re
import sys
import time
import random
import logging
# 日志模块
logger = logg... |
"""
FastSLAM 1.0 for use with ROS 2
Copyright 2020 <NAME>
Author: <NAME>
Starter code: Atsushi Sakai
"""
#!/usr/bin/env python3
import os
import sys
import message_filters
import rclpy
import numpy as np
import matplotlib.pyplot as plt
import time
from copy import deepcopy
from helpers.listener import BaseListen... |
import random
import mmcv
import numpy as np
import torch
import torch.nn as nn
from mmcv.runner.checkpoint import _load_checkpoint_with_prefix
from mmgen.core.runners.fp16_utils import auto_fp16
from mmgen.models.architectures import PixelNorm
from mmgen.models.architectures.common import get_module_device
from mmge... |
import os
import sys
import itertools
import math
import logging
import json
import re
import random
from collections import OrderedDict
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.lines as lines
from matplotlib.patches import Polygon
from... |
""" Add, edit, or delete entries in the backend databases.
This module provides the primary functionality for adding, editing, or
deleting entries in the backend databases. The initial argument parsing methods
determine which database and mode to use while all other information is
request from the user using interacti... |
# -*- coding: utf-8 -*-
"""
@author: Turnphy
"""
from tkinter import filedialog
from tkinter import *
from PIL import ImageTk
import numpy as np
from matplotlib import pyplot as plt
from tkinter import *
from TransferMatrixEngine import (coh_tmm, position_resolved, find_in_structure_with_inf)
from numpy im... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... |
# Imports
###############################################################################
import os
import argparse
import progressbar
import Bio.PDB as bpp
import textwrap as tw
# License
###############################################################################
'''
ProtCHOIR: A tool for generation of homo olig... |
import sys
sys.path.append('./')
from bayes_opt import BayesianOptimization, helpers
from bayes_opt.target_space import TargetSpace
import numpy as np
from sklearn.gaussian_process.kernels import Matern, WhiteKernel, ConstantKernel
import pandas as pd
from scipy.optimize import NonlinearConstraint
from scipy.optimize i... |
import logging
import pathlib
from typing import Any, Dict, List, Optional, Union
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
log = logging.getLogger(__name__)
def data_MC(
histogram_dict_list: List[Dict[str, Any]],
total_model_unc: np.ndarray,
bin_edges: np.ndarray,
... |
import torch
import numpy as np
import torch.nn as nn
from pruner.filter_pruner import FilterPruner
from model.resnet_cifar10 import BasicBlock, DownsampleA
from torchvision.models.resnet import Bottleneck
def get_num_gen(gen):
return sum(1 for x in gen)
def is_leaf(model):
return get_num_gen(model.children(... |
import quopri
from base64 import b64encode
from email.utils import collapse_rfc2231_value
from textwrap import dedent
from django.core.mail import SafeMIMEText
from django.test import SimpleTestCase
from anymail.inbound import AnymailInboundMessage
from .utils import SAMPLE_IMAGE_FILENAME, sample_email_path, sample_... |
"""Unification CNN."""
import argparse
import uuid
import json
import pickle
import sys
import numpy as np
import chainer as C
import chainer.links as L
import chainer.functions as F
import chainer.training as T
# Disable scientific printing
np.set_printoptions(threshold=10000, suppress=True, precision=5, linewidth=18... |
# -*- coding: utf-8 -*-
from scipy.integrate import solve_ivp
import matplotlib
"""in case it's not working uncomment this: matplotlib.use('TkAgg') """
import matplotlib.pyplot as plt
import numpy as np
from numpy.linalg import inv
from matplotlib import colors as mcolors
import paras_dorsoventral as dors
import ... |
from apmserver import ServerBaseTest, ServerSetUpBaseTest, ElasticTest
import base64
import json
import os
import random
import requests
import shutil
import ssl
import string
import subprocess
from nose.tools import raises
from requests.exceptions import SSLError, ChunkedEncodingError
from apmserver import TimeoutEr... |
import itertools
import pickle
from weakref import ref
import warnings
from unittest.mock import patch, Mock
from datetime import datetime
import numpy as np
from numpy.testing import (assert_array_equal, assert_approx_equal,
assert_array_almost_equal)
import pytest
import matplotlib.cbook... |
import matplotlib.pyplot as plt
import numpy as np
from numpy import ones, zeros, linspace, diag, eye, abs, mean, log, sqrt, tile, meshgrid, r_, diagflat, reshape, sign, \
where, array, repeat, newaxis
import numpy as np
from numpy import sum as npsum, max as npmax, min as npmin
from numpy.core.umath import minimum... |
__author__ = ("<NAME> <mrost AT inet.tu-berlin.de>, "
"<NAME> <aelvers AT inet.tu-berlin.de>")
__all__ = [
"render_latex",
"render_format",
"render_pdf",
"render_html",
"render_template",
"compute_tutorial_sizes",
"get_room_dictionary",
"plot_happy_and_fair",
]
import dat... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc.
# 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.apach... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
## adapted from https://github.com/rail-berkeley/softlearning/blob/master/softlearning/algorithms/sac.py
import os
import math
import pickle
from collections import OrderedDict
from collections import defaultdict
from numbers import Number
from itertools import count
import gtimer as gt
import pdb
import random
import... |
import matplotlib.pyplot as plt
import torch; print(torch.__version__)
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import Parameter
import torchvision
import pandas as pd
from torchvision import datasets
from torchvision import transforms
from torchvision.... |
"""
Copyright (c) 2020, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and... |
#organize by who wrote these
from jinja2 import StrictUndefined
from flask import Flask, render_template, redirect, session, flash, request, send_from_directory, jsonify
from flask_debugtoolbar import DebugToolbarExtension
from model import connect_to_db, db, User, SpeciesIndividual, Drug, Condition, SpeciesGroup, F... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
ISO request entity classes.
"""
from everest.entities.base import Entity
from everest.entities.utils import slug_from_integer
from everest.entities.utils imp... |
"""
Functions to make all of the figures for Solar Forecast Arbiter reports using
Bokeh.
This code is currently unreachable from the rest of the Solar Forecast Arbiter
Core library. It may be used in place of the plotly_figures to generate bokeh
plots for the `plots` attribute of the RawReport object. See
:py:mod:`sol... |
"""
The purpose of this parser is to provide a SQL-ish language for querying nested data
structures.
You could type, for example:
..
SELECT foo, bar FROM my_obj START AT TOP GO DOWN UNTIL HAS KEY baz AS baz_label...
"""
import uuid
import sys
import importlib
import itertools
import ply.yacc as yacc
from pyDat... |
import torch
torch.autograd.set_detect_anomaly(True)
import torch.nn as nn
import torch.nn.functional as F
import os
import numpy as np
import itertools
import random
from tqdm import tqdm
to8b = lambda x : (255*np.clip(x,0,1)).astype(np.uint8)
class Implicit4D():
def __init__(self, cfg, proj_pts_to_ref):
... |
# flake8: noqa: F841
import tempfile
from pathlib import Path
from typing import List
from pandas._typing import Scalar, ArrayLike
import pandas as pd
import numpy as np
from pandas.core.window import ExponentialMovingWindow
def test_types_init() -> None:
pd.Series(1)
pd.Series((1, 2, 3))
pd.Series(np... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
from mysql import *
from display_object import *
from dataType import DataType
class DefaultDao():
def __init__(self):
self.db = mysql()
self.db.connect()
def __del__(self):
self.db.close()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, trace... |
import pickle
from lasagne.layers import ConcatLayer
from lasagne.layers import DenseLayer
from lasagne.layers import InputLayer
from lasagne.layers import Layer
from lasagne.nonlinearities import identity
from lasagne.nonlinearities import softmax
from lasagne.objectives import categorical_crossentropy
from lasagne.u... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 17 13:37:34 2017
@author: <NAME> -- diego_guarin at meei.harvard.edu
"""
import numpy as np
from scipy.interpolate import UnivariateSpline
"""
here is where all the facial measures are compute. It is mostly rotation of points
with respect to the line that connect the ce... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import queue
import threading
import pygame
import argparse
from game.characters import CharacterFactory
from game.levels import LevelMap
from game.display import DisplayManager
from game.util import Pathfinder, InterruptHandler
from game.load_tilema... |
################################################### END ########################################################
################################################### SET PATH ########################################################
# Filter results of WGS
import glob
import os
from Bio import SeqIO
from Bio.Seq import S... |
"""Turn ibis things into substrait things.
The primary API exposed here is the :func:`translate` function.
"""
from __future__ import annotations
import collections
import collections.abc
import datetime
import functools
import itertools
import operator
import uuid
from typing import Any, Mapping, MutableMapping, Se... |
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login, logout
from django.core.urlresolvers import reverse
from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.db.models import Avg, Min... |
"""
Appraise evaluation framework
See LICENSE for usage details
"""
# pylint: disable=C0103,C0330,no-member
from collections import defaultdict
from json import loads
from zipfile import is_zipfile
from zipfile import ZipFile
from django.db import models
from django.contrib.auth.models import User
from d... |
import random
import torch.nn.functional as F
from transformers import (ConstantLRSchedule, WarmupLinearSchedule, WarmupConstantSchedule)
from torch.cuda.amp import GradScaler, autocast
from modeling.modeling_grn import *
from utils.optimization_utils import OPTIMIZER_CLASSES
from utils.parser_utils import *
from util... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.