sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b96d7eca93a3717a830d9571c16bc9e15fb15c1297364d4efcdcf2486f248342 | Python | 30,128 | 763 | import warnings
from collections import OrderedDict
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from mmcv.cnn import build_norm_layer, constant_init, trunc_normal_init
from mmcv.cnn.bricks.transformer import FFN, build_dropout
from mm... |
30d0f937fbd14506ed877016e70ed491c538ea6242a7280615ac6bd5fbb3b7cf | Python | 30,144 | 706 | import itertools
import sys
from collections import defaultdict
import numpy as np
from genomad import sequence, utils
from genomad._paths import GenomadOutputs
def get_fdr_array(probability_array):
n_errors = 0
fdr_array = []
for n, p in enumerate(probability_array, start=1):
p_error = 1 - p
... |
5f0cc0293c82370b7e137c409680b38380539c9db0531a7dbf87f61bface3000 | Python | 30,163 | 797 | import abc
from dataclasses import dataclass
from io import BytesIO
import networkx as nx
import os
import pandas as pd
import pathlib
from datetime import timedelta
from typing import Any, Dict, List, Optional, Set, Tuple
import yaml
import warnings
import zipfile
import bibtexparser as bp
from . import _checksum_va... |
ecb67384e28e4339df7899f0008a2465a4ede654d61bb7354f3d98a1a845b691 | Python | 30,163 | 632 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 13:34:00 2021
@author: fhu14
This is the module that deals with integration with DFTBrepulsive. The methods
and variables contained within this class are intended to interact with the
driver methods taken from DFTBrepulsive.
USAGE OF DFTBRepulsieModel (external schem... |
131848424303fb19d804d863daa0f20016ce824a6028133ab873ababf9612ea7 | Python | 30,210 | 821 | # logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)-5.5s]\t%(message)s", handlers=[ logging.StreamHandler() ] )
def write_tree(phy, out, evc, attributes, sep="|", do_print=True, cut_gene_names=120):
logging.info("Print tree")
phy_alter = phy.copy(method="newick-extended")
for i i... |
1c36758314ab2540eafee0dd70bf8c8dbc5eceec7921c28a0b639ba5d5566728 | Python | 30,340 | 801 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import warnings
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Optional,
Sequence,
Tuple,
Union,
cast,
)
im... |
8d3af8096a2b1a0a94b88ab31e00e1149d523a218ef9e285fd1668ed798e49e1 | Python | 30,471 | 672 | import pathlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import backend
#plot history
def plot_history(history):
hist = pd.DataFrame(histor... |
5fc7ff8d41bc980552b00279d668d4d8135ca9d144ff17dd7cae8840e0dd56da | Python | 30,488 | 769 | import warnings
import sys
from collections import Counter
from dataclasses import dataclass, field
from pathlib import Path
from typing import List
import numpy as np
import xgboost as xgb
from genomad import database, sequence, utils
from genomad._paths import GenomadData, GenomadOutputs
# Ignore numpy's overflow w... |
5ef6757400dead72afcc020194b0d84dc5663679709d6ab77514628e743d089d | Python | 30,507 | 717 | ############################################
# imports
############################################
import os
import shutil
import unittest
import pandas as pd
import yaml
from oligo_designer_toolsuite.database import OligoDatabase, ReferenceDatabase
from oligo_designer_toolsuite.sequence_generator import OligoSeque... |
1a2cca8c1b1e366d768deebdb687a51719cc7785e87233db2c2a03ee97f570e9 | Python | 30,537 | 844 | """Classes for splitting and serving data to models.
The data generator classes contained in this module inherit from the
:class:`torch.utils.data.Dataset` class. The user-facing class is the
:class:`DataGenerator`, which can manage one or more datasets. Each dataset is composed
of trials, which are split into trainin... |
e35da9949613076cd5ff9e48e9006084afeae8fdc95dfa015c1510d1a9b4e0af | Python | 30,629 | 800 | # coding: utf-8
from typing import Any, Dict, Optional
import numpy as np
import pandas as pd
import pytest
import lightgbm as lgb
from .utils import assert_datasets_equal, np_assert_array_equal
pa = pytest.importorskip("pyarrow")
# ---------------------------------------------------------------------------------... |
ec24421df2d737b10a081e97f07c2766417cb6cffba72aa9d069596ea4798aed | Python | 30,657 | 718 | # Imports #
import kivy
import zipimport
import sys
import os
import configparser
import time
import numpy as np
import random
import csv
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.image import Image
from kivy.uix.label import Label
from kivy.uix.floatla... |
4cda12e791d4cc2775f1053eafee2815651ad71a5b1b0caabbdc7e758df2c2ff | Python | 30,669 | 706 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import numpy.random as npr
import copy
from functools import partial
from contextlib import contextmanager
from lib.model_zoo.common.get_model import get_model, register
from lib.log_service import print_log
version = '0'
symbol = 's... |
2246288d13db2e3f5ba421afbaac43046f5e7ec8d8f8123521845914d348f3bd | Python | 30,679 | 844 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import random
import mmcv
import numpy as np
import torch
from mmcv.utils import build_from_cfg
from mmpose.core.camera import CAMERAS
from mmpose.core.post_processing import (affine_transform, fliplr_regression,
get_... |
324360802dc3b7e51b3ac705ce3eedca2872369b376d65a2eb47ef7f705f2834 | Python | 30,704 | 806 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""Mixture of Gaussians (MoG) dataclass and operations.
This module provides a lightweight container for MoG parameters with methods
for evaluation (log_... |
f832e91aacc4a79caf81f6679ca0a36de35f0e0e9f48de43d43fed5fac1f32bc | Python | 30,720 | 704 | ############################################
# imports
############################################
from oligo_designer_toolsuite._exceptions import ConfigurationError
from oligo_designer_toolsuite.database import OligoDatabase
from oligo_designer_toolsuite.oligo_property_calculator import BaseProperty
from oligo_desi... |
c596667a801d06be638b3259e2a314d7db8aa0e0ea997ad8471b7ba1dea0c210 | Python | 30,743 | 725 | import warnings
import numpy as np
import torch
import torch.nn as nn
from exsclaim.figures.separator.process import preprocess
from .network import resnet152
def bboxes_iou(bboxes_a, bboxes_b, xyxy=True):
"""Calculate the Intersection of Unions (IoUs) between bounding boxes.
IoU is calculated as a ratio o... |
07a08ff4809397055b3e2dc51179c6146d2ca1f5cddfec2af70fc0a662b5e836 | Python | 30,932 | 632 | import torch
import torch.nn as nn
import numpy as np
from .network import resnet152
import cv2
import warnings
def bboxes_iou(bboxes_a, bboxes_b, xyxy=True):
"""Calculate the Intersection of Unions (IoUs) between bounding boxes.
IoU is calculated as a ratio of area of the intersection
and area of the unio... |
0a3cc90ff4f7e018040683c95034cb58e34f0a4a7d466a993b5066d0a3e59034 | Python | 31,116 | 801 | # -*- coding: utf-8 -*-
"""
Optical Character Recognition
=============================
Extract text from images using Tesseract.
git
author: Damian Wilary
email: dmw51@cam.ac.uk
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import u... |
1702ba06230fc0dd9d644be808032c61f290829c2dc8a9176c96a0a4fb248085 | Python | 31,290 | 740 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale
from mmcv.ops import DeformConv2d
from mmcv.runner import force_fp32
from mmdet.core import (MlvlPointGenerator, bbox_overlaps, build_assigner,
... |
c04f962724b4585bd8bdb6b43b94371c6f0910ffffb88a3c7d8d78d0fd1e3cc0 | Python | 31,369 | 1,186 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
b67bc3bf480ca06d942f89eea0d99a827095b90b8335af39d127ac7f39d0d40c | Python | 31,376 | 540 | import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import numpy as np
import pandas as pd
import geopandas as gpd
import seaborn as sns
import os
import pathlib
import calendar
from A_config import a10_config
from D_modelling import d090_model_wrapper, d140_modelStats
from D_modellin... |
e21e7918131cbb42174dd964a30bca8b7da328b0ccd6bb001acf7f144076f63b | Python | 31,389 | 806 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import numpy as np
import torch
from mmcv.parallel import collate, scatter
from mmpose.core.bbox import bbox_xywh2cs, bbox_xywh2xyxy, bbox_xyxy2xywh
from mmpose.datasets.pipelines import Compose
def extract_pose_sequence(pose_results, frame_idx, causal... |
3a378459859e5606fde9634654c4174297c8dec2805b4c37d3f7688b61224723 | Python | 31,432 | 1,018 | import os
import pickle
import copy
import json
from collections import defaultdict
import numpy as np
import random
import torch
from tqdm import tqdm
import hashlib
import imp
import torch as pt
from .geom_utils.geom_utils import *
from torch.nn.utils.rnn import pad_sequence
import re
import networkx as nx
import ran... |
802b8cba5b000ce8af0b5aaea1229146afb956eba95112a58fa30bf9286ec03a | Python | 31,439 | 931 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from __future__ import annotations
import math
from abc import ABC, abstractmethod
from functools import lru_cache
from typing import Optional, Tuple, Uni... |
4c5206421fd08826774981cd94057d410ebf97160de18351a1479f728ecf8509 | Python | 31,606 | 679 | import string
import os
from p4.var import var
from p4.p4exceptions import P4Error
"""This class is used by Tree.draw(), and Tree.eps().
This week, there is no 'user-interface' for it, other than those
methods."""
class TreePicture(object):
def __init__(self, theTree=None):
gm = ['TreePicture.__init__()... |
1ea93e72c3a787fc02fb1fa0f68c7bce8f1af2a38a4ccdac75dc4226af8835c6 | Python | 31,731 | 815 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from abc import ABC, abstractmethod
from typing import Optional, Protocol, Tuple, TypeVar, Union
import torch
from torch import Tensor, nn
ConditionalEs... |
b6ca1ce3a2473ed5e56762ffab4465d14559fafc7c917d26138ae631e417cd30 | Python | 31,839 | 650 | from exsclaim.utilities.logging import Printer
import os
import csv
import json
from os.path import join
import time
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
import textwrap
import pathlib
import logging
from .utilities import boxes, paths
from .figure import Figur... |
5de343ff7b5386cb3c77d9b71deaa226a29cd51314b455f1537c5cca90db582f | Python | 31,876 | 858 | import io
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
from sklearn.utils import assert_all_finite
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.validation import check_array, check_consistent_length, column_or_1d
from doubleml.utils._estimation import _assure_2d... |
d5dbe15275e5d3bf3cc70df774277824523cd3df47eef38a2d80745edc4592f1 | Python | 31,942 | 1,067 | import sys
import numpy as np
#import preprocess_blockSVD as pre_svd
import multiprocessing
import time
import matplotlib.pyplot as plt
#import greedyPCA_SV as gpca
#import greedyPCA as gpca
from math import ceil
from functools import partial
from itertools import product
# compute single mean_th factor for all tiles... |
05a89573242b54d867d8c5c85e4078b9c4e42feb96413f2c3df0535fd9599a58 | Python | 31,969 | 767 | from p4.alignment import Alignment
import sys
import time
import os
import p4.pf as pf
import p4.func
from p4.var import var
from p4.p4exceptions import P4Error
class Data:
"""All the alignments that you want to work with, in one place.
Initialize this with one of
- nothing (or None),
- a list o... |
1bb31ea1d1b63f66fbefa6f5d31168e26bc43cca396808b540b8ec1437ad82bd | Python | 31,970 | 979 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""Various PyTorch utility functions."""
import os
import warnings
from typing import (
Any,
Callable,
Dict,
Generator,
List,
Opt... |
33f229205a86ec772ef9b6820a0c05953fb5ecd058c50a298eb374ea1ca94ff5 | Python | 32,009 | 304 | import argparse
import importlib
import h5py
import numpy as np
import os
# import plotly.graph_objects as go
import torch
from datetime import datetime
# from plotly.offline import plot
from tqdm import tqdm
# from utils import MetricTracker
import PIL.Image as Image
# from utils.clean_noise import CleanNoise
# from... |
aa7d54bac5ad2eed19a5cab714f0929b1616048be5b029550108f18abce96527 | Python | 32,048 | 746 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import warnings
from typing import Any, Callable, Dict, Literal, Optional, Union
import torch
from torch import Tensor, eye, ones
from torch.distribution... |
147a168f906b205a6a463f92cc889aef6ea16a8012adef5e7fbdd0da8e679d80 | Python | 32,360 | 960 | """Read `.ecomp` archives into Biopython alignments."""
from __future__ import annotations
import base64
import gzip
import io
import json
import lzma
import math
import struct
import zlib
from dataclasses import dataclass
from hashlib import sha256
from pathlib import Path
from typing import Iterable, Optional, Sequ... |
bb490e2443ff22c82a92d77e418a484297f646eaa5fbb8a59106b5e26f350485 | Python | 32,441 | 662 | import numpy as np
import os
import tensorflow as tf
tf.config.set_visible_devices([], device_type='GPU')
os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false'
from functools import partial
import tensorflow as tf
import numpy as np
import data_sequence
from pprint import pprint
import utils
import jax
import jax.tree... |
2a6a8b26c2eab0948b6bfd4c35c8167d0df1b68f48e571578efeeb892b73776a | Python | 32,500 | 921 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import warnings
from typing import Tuple
import matplotlib.pyplot as plt
import numpy as np
import pytest
import torch
from sklearn.model_selection impor... |
f4299166aef82f26b6c85ed14f7e79fde200c64525bfc87ae0f013f4a6d0cfc1 | Python | 32,532 | 833 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 7 20:07:49 2021
@author: fhu14
"""
import numpy as np
import scipy.linalg
from .atomentry import AtomEntry
from .repulsion import Repulsion
from .matelem import Overlap, CoreH
from .sccparam import Gamma, Doublju
from .cdiis import CDIIS
from .fermilevel import determi... |
28f886e58383dd9b87fd88918efff8c0f3c7a61d5117c899aa17bb1ec29e4ee7 | Python | 32,610 | 885 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from __future__ import annotations
import pickle
import pytest
import torch
from torch import eye, nn, ones, zeros
from torch.distributions import Indep... |
276c01538f1ea0a8c59e50a42523bd1f992b38fdf84f0ae444efdefdf27f4fb0 | Python | 32,727 | 772 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import warnings
from abc import ABC, abstractmethod
from dataclasses import asdict
from typing import (
Any,
Callable,
ClassVar,
Dict,
... |
68a905fcd362311b46f6b8607c0cada9e1eada5c620a410ac9fd25c2e59bdf88 | Python | 32,752 | 844 | import bibtexparser as bp
from bibtexparser.bwriter import BibTexWriter
import networkx as nx
import os
import pathlib
import pkg_resources
import re
import shutil
import tempfile
from collections import UserDict
from dataclasses import dataclass, field
from typing import Dict, Iterator, List, Optional, Set, Union
fro... |
42602232290e8f556edd222586c683774da07b9a3932b5f6992d61989d784090 | Python | 32,770 | 1,026 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
from unittest.mock import MagicMock
import pytest
from mmcv import Config
from numpy.testing import assert_almost_equal
from mmpose.datasets import DATASETS
from tests.utils.data_utils import convert_db_to_output
def test_top_down_COCO_dataset():
datas... |
c711fec146db0633778e90f02cf2b68903a015a5c0b5575f5a7fa7e0dbd9bde3 | Python | 32,782 | 710 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 12 15:16:24 2021
@author: fhu14
"""
"""
Dataset generation workflow for standardized experiments for DFTBML Organics Writeup
(Going to adhere to better coding style here compared to before)
The purpose of this module is to generate a standardized training, validation, ... |
0fc6253ad99cb3cbff8eac6e07705d3e173774cbc948c87f92425dee126f6f77 | Python | 32,815 | 799 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""Mixture Density Estimator for simulation-based inference.
This module provides:
- MultivariateGaussianMDN: Neural network that outputs MoG parameters
... |
b27e6faf4efd7af939d55274f92b0815827eb9dffaf801381bc65bcc8f8d4abf | Python | 33,043 | 913 | """Classes for splitting and serving data to models.
The data generator classes contained in this module inherit from the
:class:`torch.utils.data.Dataset` class. The user-facing class is the
:class:`DataGenerator`, which can manage one or more datasets. Each dataset is composed
of trials, which are split into trainin... |
9cc5c86bfac29a5d0ef8fb262e27ddfe175806b83f98ebe3d19d8ddb9ba982e6 | Python | 33,049 | 795 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""Sequential Monte Carlo Approximate Bayesian Computation."""
import math
from typing import Any, Callable, Dict, Optional, Tuple, Union
import numpy a... |
6c5d2b6192e1cf05bdb20e5789087e01357ce9b72fdddddc1044dce757cc92cf | Python | 33,130 | 747 | from contextlib import contextmanager
from contextvars import ContextVar
import torch
from torch import Tensor
NBMAT_SUFFIXES = ("", "_lr", "_coulomb", "_dftd3")
_SIGNED_INTEGER_DTYPES = {torch.int8, torch.int16, torch.int32, torch.int64}
_symbolic_trace = ContextVar("aimnet_symbolic_trace", default=False)
@context... |
0bc31a533d82142c87b197692e7cc850287522be27c51ac722fb47ee6920a568 | Python | 33,135 | 850 | # coding: utf-8
"""Plotting library."""
import math
from copy import deepcopy
from io import BytesIO
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
import numpy as np
from .basic import Booster, _data_from_narwhals, _is_zero, _log_warning, _MissingType, _pandas_df_to_numpy
from .compat imp... |
f3ae5f3d276a6f2101575e4b3ff07fd25ba4dc3555b6c3d31c8a43de7d35e26c | Python | 33,155 | 767 | # Copyright (c) OpenMMLab. All rights reserved.
"""
CommandLine:
pytest tests/test_utils/test_anchor.py
xdoctest tests/test_utils/test_anchor.py zero
"""
import pytest
import torch
def test_standard_points_generator():
from mmdet.core.anchor import build_prior_generator
# teat init
anchor_generat... |
bed1c7670a0cc6674e5734c0eb57edb1d8a6cd68a50500cb74fbceadc7dd042f | Python | 33,384 | 1,016 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from __future__ import annotations
import math
import pickle
import warnings
from typing import Callable
import pytest
import torch
from torch import Te... |
3d1ba2f8cb0db9c63036f67e25d65c17f261c710a50c9110545849220a36ce22 | Python | 33,408 | 835 | # pytorch_diffusion + derived encoder decoder
import math
import torch
import torch.nn as nn
import numpy as np
from einops import rearrange
# from .diffusion_utils import instantiate_from_config
from .attention import LinearAttention
def get_timestep_embedding(timesteps, embedding_dim):
"""
This matches the... |
5d21d5b7374c37edae781e7a43885385e81fc2826cccbb20f5ccf4f7993db71a | Python | 33,529 | 718 | ############################################
# imports
############################################
import gzip
import itertools
import os
import re
import shutil
from ftplib import FTP, error_perm
from pathlib import Path
from typing import IO, get_args
import pandas as pd
from Bio import SeqIO
from oligo_designer_... |
96a3a4394594f112e53d61f7ff2143d8c7f890950dbfaa6574f810eb02abb9df | Python | 33,557 | 827 | import shutil
import sys
from collections import OrderedDict, defaultdict
from dataclasses import dataclass, field
from pathlib import Path
from typing import Iterator, List, Optional
import numpy as np
import pycrfsuite
from genomad import aragorn, database, mmseqs2, sequence, taxonomy, utils
from genomad._paths imp... |
a31f430e82f2e350e3a12197bab1ac7bb53ef2e3fd4d41311c95b41806241c32 | Python | 33,717 | 547 | import sys
import os
import subprocess
import filter_remapped_reads
import util
#
# filter_remapped_reads.py
# INPUT FILES:
# to_remap_bam - input BAM file containing original set of reads
# that need to be remapped after having their alleles flipped
#
# remap_bam - input BAM file containing rem... |
19c4f2a4d92928ab9b166bef8a915e390a8a17fbdfbf3fc152a5407cf26c6b7a | Python | 33,820 | 939 | import vtk
import LinearSubdivisionFilter as lsf
import numpy as np
import math
import os
import sys
import itk
import pandas as pd
from multiprocessing import Pool, cpu_count
from vtk.util.numpy_support import vtk_to_numpy
from vtk.util.numpy_support import numpy_to_vtk
import torch
import monai
from monai.transform... |
9c1a6d8fa4cf09f16ef75d0c17643cc840769342c14778176035eab06f37c9f8 | Python | 33,877 | 921 | ############################################
# imports
############################################
import os
import shutil
import unittest
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Callable, cast
from unittest.mock import patch
from Bio import SeqIO
from oligo_designer_too... |
4bb4f72347c68b343663c7e845bd4ad290a012dc7c0c97eee5ed4d8637443640 | Python | 33,884 | 955 | # -*- coding: utf-8 -*-
"""This module defines functions for calculating physical properties from normal
modes."""
import time
import numpy as np
from prody import LOGGER
from prody.atomic import Atomic
from prody.ensemble import Ensemble, Conformation
from prody.trajectory import TrajBase
from prody.utilities impor... |
a519fec1e0f7e469c3a45bcafef71603ff0bfe0ddf43b24f8d87d7eedae871c3 | Python | 33,996 | 801 | # Copyright (c) OpenMMLab. All rights reserved.
from __future__ import division
import copy
import warnings
import torch
import torch.nn as nn
from mmcv import ConfigDict
from mmcv.ops import DeformConv2d, batched_nms
from mmcv.runner import BaseModule, ModuleList
from mmdet.core import (RegionAssigner, build_assigne... |
ccc5813cffc0a2068db6d42b316d936561c7481826f4353be51e1810fe7d4c49 | Python | 34,045 | 756 | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmcv.runner import force_fp32
from mmdet.core import multi_apply, multiclass_nms
from mmdet.core.bbox.iou_calculators import bbox_overlaps
from mmdet.models import HEADS
from mmdet.models.dense_heads import ATSSHead
EPS = 1e-12
try:
... |
54f3fafc16f3689dd590c9da8ec51bbbb8f8eff9ad9af55fe4afeee7b0d74e34 | Python | 34,065 | 900 | """
Parse annotation, sequence, variant, and interval files used across the toolsuite.
GFF/GTF annotations, FASTA sequences, VCF variants, and BED intervals are the main
file types for region extraction, probe design, and coordinate conversion.
See :class:`GffParser`, :class:`FastaParser`, :class:`VCFParser`, and :cla... |
0671d934c8ca2881f1c6b4a2f09aec4d5679a8e24ca44fe423472501d61c7625 | Python | 34,179 | 759 | """All module needed to implementaton of preprocessing image"""
from typing import Tuple
import numpy as np
import random
# import typing
from copy import deepcopy
from skimage.measure import label
from skimage.morphology import opening, binary_erosion, binary_dilation, ball, cube
from itertools import permutations, pr... |
55d71a726909b6302ee21c44694a2d237c04dc3419a63212064638eccea0b164 | Python | 34,270 | 806 | import glob
import json
import logging
import os
import pathlib
import time
import warnings
import cv2
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.models.detection
import torchvision.transforms as T
import yaml
from PIL import Image
from scipy.special import softmax
from skimage ... |
c4556196bb4a7f48e9497db2559c1c9a02089aa98446083b982d7ff9e7f87a79 | Python | 34,418 | 786 | import csv
import json
import logging
import os
import pathlib
import textwrap
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from exsclaim.utilities.logging import Printer
from .figure import FigureSeparator
from .tool import CaptionDistributor, JournalScraper
from .u... |
9743300815d518fbe1b3ffc98e7c77638ac94ec8e4ddca34a8d5d0469ff36801 | Python | 34,502 | 791 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 23 12:29:15 2022
@author: baris
"""
import pickle
import numpy as np
import seaborn as sns
import pandas as pd
import grid_model
from figure_functions import _make_cmap, _precession_spikes, _adjust_box_widths
import matplotlib.pyplot as plt
import m... |
fd89a33e15b3370654787658eaeebd641501a8b287d43007ccacb631378ce08f | Python | 34,536 | 768 | import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import model
import dataloader
from math import log10
import time
import datetime
from tensorboardX import SummaryWriter
import numpy as np
import os
import ET_model
#
def get_... |
540bb130ffa22eff11d02095f1297537f69f13180ed04d574345a00c4918c36c | Python | 34,710 | 990 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import random
from dataclasses import asdict
from typing import List, Literal
import numpy as np
import pytest
import torch
from scipy.stats import gauss... |
db2198664042bbd5669341f2c6c828b456dda1fd40ccd8afbc80ee766e46c474 | Python | 34,768 | 652 | import argparse
import distutils.util
import pickle
import sys
import time
import numpy as np
import os
import pandas as pd
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
import tensorflow as tf
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = Tr... |
300ae6d5a4c2673350ab41d8f4b74bb0d31489db7706a5bf58b3fdb4eac3da38 | Python | 34,786 | 925 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
1681fde27c8ccffcd1662e479af41ad5166bf2910d2f97440a4444b9e8d94e27 | Python | 34,814 | 776 | import utils
import sqldbutils as dutil
import json
from os.path import join
import ontotextapi as oi
import random
import study_analyzer as sa
from ann_post_rules import AnnRuleExecutor
# import trans_anns.sentence_pattern as tssp
# import trans_anns.text_generaliser as tstg
import re
from analysis.semquery import Sem... |
9271281b43b42e66144f5717f02ce865c7969914bc7448992218f7a1f06b182f | Python | 34,816 | 735 | import numpy as np
import pandas as pd
import math
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import ranksums, zscore
from random import sample
import itertools
from tqdm import tqdm as _tqdm
import multiprocessing as _mp
import functools as _ft
def correct_frames_lim(frames, f):
outpu... |
ff8d35f1a5292048e3e376760e60d54df34e43547ae9e60bf19c31e587ccaa5f | Python | 34,936 | 764 | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops import DeformConv2d
from mmdet.core import (build_assigner, build_sampler, images_to_levels,
multi_apply, unmap)
from mmdet.core.anchor.point_gener... |
120a55375ba80786d44b6d679ce03e61a7ec1593a318cbadadc693cc3be4c8ef | Python | 35,033 | 776 | # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# 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 res... |
04724966d6eb8768767f6f7604449dcf4906b1f9f0e3661ea9dbc709bec5c266 | Python | 35,067 | 885 | import time
import os
import sys
import random
import string
import math
from p4.tree import Tree
from p4.p4exceptions import P4Error
try:
from tkinter import *
except ImportError:
print("TV and BTV need tkinter, and it does not seem to be installed.")
raise
def randomColour():
# Colours are #xxyyzz, ... |
3b7be12f6bddbc6d22e1c164cbbcfdaa5eb6bea1c593a1fc165724bf711d1073 | Python | 35,168 | 753 | import os
import cv2
import json
from numpy.lib import utils
from torch._C import device
import yaml
import glob
import torch
import shutil
import pathlib
import time
import requests
import warnings
import logging
import numpy as np
import torch.nn.functional as F
from skimage import io
from scipy.special import soft... |
a620e5bf55bad58c06e81ad72fd9221b19d08c52d3dd416800051cc451faed21 | Python | 35,280 | 745 | # Imports
from kivy.uix.screenmanager import Screen
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.checkbox import CheckBox
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.boxlayout import BoxLayout
from ki... |
960aeecbc64f0d8f50ec8726093683929bd19ae2060e03c68996b287d2491944 | Python | 35,296 | 666 | #!/usr/bin/python
import os
import numpy as np
import pandas as pd
import argparse
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.preprocessing import MinMaxScaler
import optuna
from optuna.samplers import TPESampler
import joblib
import random
import wandb
import global_variables
random.seed(4... |
1a22c2aac3357306daf7fe25977cb8ace75443da039e0e426cb66164224beee5 | Python | 35,453 | 804 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 23 12:29:15 2022
@author: baris
"""
import pickle
import numpy as np
import seaborn as sns
import pandas as pd
from phase_to_rate import grid_model
from phase_to_rate.figure_functions import (_make_cmap, _precession_spikes,
... |
406a5db4304bf2d1cc721a0e04a782e64083c038fa2cb4ac8f20231a786602d1 | Python | 35,470 | 1,015 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 11 15:04:13 2020
@author: mfromano
"""
import os
import pandas as pd
import numpy as np
import logging
from typing import Dict, List
import datetime
fi = os.path.join(os.path.abspath("./logs"),
"metadata_loc... |
4324b6baffe5922b48ff32ee18c70b5316b1a4be8b90d6a61a7db9b7ae6443a1 | Python | 35,566 | 995 | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import build_norm_layer, trunc_normal_init
from mmcv.cnn.bricks.transformer import build_dropout
try:
from torch.cuda.amp import autocast
WITH_AUTOCAST = True
except Imp... |
4bc0a2065a3ac2597b05706a1afb92048f2a319513dd435cd03bd0ba7688456a | Python | 35,674 | 919 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import os
import warnings
from collections import defaultdict
import mmcv
import numpy as np
import torch
from mmcv.parallel import collate, scatter
from mmcv.runner import load_checkpoint
from mmcv.utils.misc import deprecated_api_warning
from PIL import Ima... |
bea09fb2a6d57b0fff0f70413b8ed705c64ce3163f85823d65cbfc6b42456a16 | Python | 35,843 | 984 | # ------------------------------------------------------------------------------
# Adapted from https://github.com/HRNet/Lite-HRNet
# Original licence: Apache License 2.0.
# ------------------------------------------------------------------------------
import mmcv
import torch
import torch.nn as nn
import torch.nn.fun... |
b5820cb4c5a5b1e90a1420c00ac90dbbc683e6e6f2ad45e3dc7068b06b396024 | Python | 35,946 | 844 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from copy import deepcopy
from math import floor
from typing import Any, Callable, Literal, Optional, Tuple, Union
import torch
import torch.nn.functiona... |
0142b342ca314320d18819920d1849de43be6953e7e2df29c0f68b7eac1b9c1b | Python | 36,108 | 991 | #!/usr/bin/env python
from os import makedirs
from os.path import abspath, dirname, isdir, join, exists, splitext
from collections import defaultdict
from subprocess import call
import argparse
import shutil as _shutil
import weakref as _weakref
import warnings as _warnings
import pandas as pd
import numpy as np
impor... |
f24f9585117db0ff628c1eacbca224b027e90b76dceb54cccb108b1d27f48a0d | Python | 36,205 | 1,060 | #!/usr/bin/env python3
"""Reproducible ClipKIT correctness and performance benchmark runner.
Each measured sample runs in a fresh Python process. Warm-up samples are
discarded, and the retained samples must produce byte-for-byte identical
results. Passing ``--compare-root`` additionally verifies a candidate source
t... |
34d7f26987b7799892439ad808a785b2a938bed6620f11069a4be2b7022da497 | Python | 36,238 | 850 | """weights2c.py
This file is part of keras2c
Copyright 2020 Rory Conlin
Licensed under MIT License
https://github.com/f0uriest/keras2c
Gets weights and other parameters from each layer and writes to C file
"""
# imports
import numpy as np
from keras2c.io_parsing import layer_type, get_layer_io_names, get_model_io_nam... |
3609f80d3f1b0ad24e9db90e55c7b84e518713df477047e8f46d5f8c053b3eeb | Python | 36,456 | 895 | # coding: utf-8
"""Library with training routines of LightGBM."""
import copy
import json
from collections import OrderedDict, defaultdict
from operator import attrgetter
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
import numpy as np
from . import callback
... |
1ae4059fc98d9d1908396d4bb8870291c02b393d48108188fc3e81b229977406 | Python | 36,463 | 911 | ############################################
# imports
############################################
import os
import shutil
from pathlib import Path
import pandas as pd
import yaml
from Bio.SeqUtils import MeltingTemp as mt
from oligo_designer_toolsuite._exceptions import (
FeatureNotImplementedError,
FileFo... |
5bc6f2a46e419d230f99750ba4a808947e2521368e615a67c3bf1a48dd1e0f8a | Python | 36,537 | 894 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import cv2
import mmcv
import numpy as np
from ..builder import PIPELINES
from .compose import Compose
_MAX_LEVEL = 10
def level_to_value(level, max_value):
"""Map from level to values based on max_value."""
return (level / _MAX_LEVEL) * max_value... |
9ac0b651ac13a712feb13dd2ee356ded165448079cb0ba0f3570bf091e146c77 | Python | 36,597 | 728 | from jax.config import config
import os
config.update('jax_enable_x64', True)
os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false'
import sys
import jax
import jax.numpy as jnp
import numpy as np
from functools import partial
import plot
from einshape import jax_einshape as einshape
import math
from collections import... |
f96125f8a52052e154f51df3b53f3987a28da911bd2300e2239c1aa44deff499 | Python | 36,738 | 843 | import math
import os
import warnings
from dataclasses import dataclass
from typing import Optional, Tuple
import torch
from torch import Tensor, device, dtype, nn
import torch.utils.checkpoint
from torch import nn
from torch.nn import CrossEntropyLoss
import torch.nn.functional as F
from transformers.activations imp... |
1be1bbc08dc5680b3c8014e0cac109f82caf459894ce7ff4ec875aa5d7a690f6 | Python | 36,818 | 1,144 | import os
import pickle
import copy
import json
from collections import defaultdict
import numpy as np
import random
import torch
import networkx as nx
import imp
from tqdm import tqdm
import hashlib
import torch as pt
from .geom_utils.geom_utils import *
from torch.nn.utils.rnn import pad_sequence
import re
import ran... |
10a5fa50672ca1fdda20ee680bfc16854cd89fa5ea28007bb50ac94c7ec3c888 | Python | 36,847 | 1,071 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""
Tests for Variational Inference (VI) using VIPosterior.
This module tests both:
- Single-x VI mode: train() - trains q(θ) for a specific observation ... |
df0ad7ec8f249a77f14d5fbabde760722dcb94a1db1e738ef7a1fceccf3f1d6a | Python | 37,009 | 730 | import entity_centric_es as ees
import sys
import urllib3
from datetime import date, datetime
import datetime
import utils
from os.path import isfile, join
from os import listdir
import os
import sqldbutils
import xml.etree.ElementTree as ET
from subprocess import Popen, STDOUT
from entity_centric_es import EntityCentr... |
3bc554dbada0ee8c8f99f1c191cc35fba6afa36ab586bce450f535fd1516896e | Python | 37,152 | 976 | import copy
import warnings
from collections.abc import Iterable
from typing import Optional
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from sklearn.base import clone
from doubleml.data import DoubleMLData
from doubleml.double_ml import DoubleML
from doubleml.double_ml_framework impor... |
160dca1edb464f9d1669edf9edbbba1c72044a088e3bb67c3b73a2a782bf6588 | Python | 37,205 | 866 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import mmcv
import numpy as np
import torch
from torch.nn.modules.utils import _pair
from .builder import PRIOR_GENERATORS
@PRIOR_GENERATORS.register_module()
class AnchorGenerator:
"""Standard anchor generator for 2D anchor-based detectors.
A... |
f904fbb4bed845a11a96bfe231fc5d642f5fe6a5f72a372c80585f78386622f2 | Python | 37,334 | 868 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import torch
import torch.nn as nn
from mmcv.ops import DeformConv2d, MaskedConv2d
from mmcv.runner import BaseModule, force_fp32
from mmdet.core import (anchor_inside_flags, build_assigner, build_bbox_coder,
build_prior_generator... |
89e7fa2d5936abeb3a21e98672b8fdb93c4219f1b5d77fdc190f6610c91a686d | Python | 37,401 | 995 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import os.path as osp
import mmcv
import numpy as np
import pytest
import torch
from mmcv.utils import build_from_cfg
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from mmdet.datasets.builder import PIPELINES
from .utils import create_random_... |
f158b0cb38846014bdfebfbc443e5f3dae2abb10a9e78c09c5b6a5e99cf9faca | Python | 37,730 | 574 | import os
import sys
import pandas as pd
# import geopandas as gpd
import numpy as np
import datetime
from sklearn.preprocessing import StandardScaler
import sklearn.metrics as metrics
from sklearn.model_selection import LeaveOneGroupOut #, LeavePGroupsOut, GroupShuffleSplit
#import joblib
# from sklearn.model_select... |
02cde3c541026ca1da0174edb38bec901e0500675a20ad692ad6b1251c66f10d | Python | 37,755 | 1,161 | #nengo
import nengo
import nengo.spa as spa
from nengo_extras.vision import Gabor, Mask
#other
import numpy as np
import numpy.matlib as matlib
import scipy
import scipy.special
import scipy.sparse
import inspect, os, sys, time, csv, random
import png ##pypng
import itertools
import base64
import PIL.Image
import so... |
e301715ba43755f5680af35ee1b0a0bde4a8e7d7359224a8fdb7846be2be1260 | Python | 37,757 | 966 | # Copyright (c) OpenMMLab. All rights reserved.
import os
import tempfile
import mmcv
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import load_checkpoint
from mmpose.core import imshow_keypoints, imshow_multiview_keypoints_3d
from mmpose.core.camera import Sim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.