sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
88d97eee8bed59bd2c6d70c54474d355e25d2ed227382b468f2a3686848a7053 | Python | 22,301 | 682 | # coding=utf-8
# Copyright 2026 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... |
ba7f56588e23478d4ee27d4bedcec5bfb1915a3ed3d676444e7d3b629b5a56fb | Python | 22,302 | 529 | """The boundary editor's midsagittal-plane resolution.
The editor loads its annotation with ``pir=False`` and keeps the file's own
affine (``viewer.py``'s ``self.affine``), so - unlike most consumers in this
repo - the affine it holds genuinely describes the array it holds. That is what
makes a per-hemisphere spl... |
61dd0ef52fd2dab876e71b2e4a6c73a854a78eeb3f10d0348fdae8fc9ab07803 | Python | 22,305 | 664 | # coding=utf-8
# Copyright 2026 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... |
fe61925e73d56f8992334680fa9625a84718bd49c5df3849459f720d90510bc0 | Python | 22,317 | 700 | #!/usr/bin/env python
# coding: utf-8
# ### LASSO parameter range experiments, single gene
#
# `scikit-learn` has two different implementations of logistic regression: [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) (using the `liblinear` coordinate... |
1f044d50f2e7503aa24cdc99f7489eb873945c2937fb2a5d6c96a2a1c17835c5 | Python | 22,331 | 622 | """
This module provides the methods used in our paper to conduct Connectome Spatial
Smoothing (CSS).
The module contains the folowing functionalities:
- Code to map high-resolution and atlas-resolution connetomes
- Code to perform CSS
Python implementation of connectome-based smoothing
Author: Sina Mansour L... |
0ecdeb49053b1db740cb0c2610170f9d5a0b0754e9ff680be886da59ca5ef22d | Python | 22,343 | 735 | import contextlib
import errno
import getpass
import hashlib
import io
import logging
import os
import posixpath
import shutil
import stat
import sys
import sysconfig
import urllib.parse
from io import StringIO
from itertools import filterfalse, tee, zip_longest
from types import TracebackType
from typing import (
... |
8963d1d710b690b2361bdf0ae6c91b77e23c2c531dbb1bfee62070acf1ce1336 | Python | 22,364 | 606 | """
Tools and utilities to work with multivariate time series.
"""
import pandas as pd
import numpy as np
import itertools
import glob
import copy
import os
# Bokeh library stuff
# Select palettes from https://docs.bokeh.org/en/latest/docs/reference/palettes.html#bokeh-palette
# Names of colors: https://cjdoris.githu... |
c99d0145b9e2940a7b35403a794ec3abbb0ed89850e5ebdef9ba0ac3cf14dd15 | Python | 22,368 | 569 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
1fe19bd03563058e857d6bf1d3be0096911582f00bacb559557b0bac510018e2 | Python | 22,388 | 626 | import re
import numpy as np
import pandas as pd
import networkx as nx
import datetime as dt
from abc import ABC
from pathlib import Path
from fafbseg import flywire
from .core import DataSet
from .ds_utils import (
_is_int,
_find_column,
_add_types,
_get_cave_client,
_morphology_to_connectivity_t... |
b35777bfd1c310b680a718fa8bc0f5d2da1894f2ad55134c4eaaf499817d8f46 | Python | 22,394 | 554 | import json
import time
import argparse
import multiprocessing
from collections import OrderedDict
import lxml.etree as ET
import math
import numpy as np
import carla
from agents.navigation.global_route_planner import GlobalRoutePlanner
from agents.navigation.global_route_planner_dao import GlobalRoutePlannerDAO
from... |
03fb9c549a4e6e1eef8fafa62138752d45464f96beef09ed71a44cf60757c333 | Python | 22,406 | 395 | # -*- coding: utf-8 -*-
################################################################################
## *
## * Function: annotate every site of a genome by exclusive categories of interest]
## * Author: Siyuan Feng
## * Mail: siyuanfeng.bioinfo@gmail.com
## * Version: 11.19.2024
## *
#####################... |
238babc0947f96d1922f2462881b773584113bbff00028241e0c5a9367fe26db | Python | 22,409 | 592 | import argparse
import cv2
import time
import numpy as np
try:
import control.gxipy as gx
except:
print('gxipy import error')
from control._def import *
def get_sn_by_model(model_name):
try:
device_manager = gx.DeviceManager()
device_num, device_info_list = device_manager.update_device_lis... |
949977c098ff03909c9780c77fcba9a7856cd1a8c0edcef61c6515b9db4634b6 | Python | 22,411 | 535 | import warnings
from itertools import chain
from typing import Any, Dict, List, Tuple
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchmetrics
from torch.utils.data import DataLoader
from torchmetrics.image.inception import InceptionScore
from .utils import FrechetInceptionDistance
_EVAL... |
3a69c940c91ff82dfcfe2c7ebeba8c6d9defbf6f5c04187ec6ae1ec782a03c34 | Python | 22,412 | 575 | """ResNet backbone in TensorFlow.
Matches PyTorch implementation exactly.
Copyright (c) 2024 University of Michigan. All rights reserved.
Licensed under the MIT License. See LICENSE for license information.
"""
import tensorflow as tf
from tensorflow import keras
import numpy as np
from typing import List, Optional,... |
8df94c1bcb6fcfab66584eba3cbd8bed0d7905bd76d65faac6f8ad88a8c24d09 | Python | 22,420 | 713 | # coding=utf-8
# Copyright 2026 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... |
f28fe51009a9d51e3d656f015af1ebbd996adecdbd37ca8d883b03171bbfaff6 | Python | 22,454 | 644 | ##
# \file stack_registration_base.py
# \brief Abstract class containing the shared attributes and functions for
# registrations of stack of slices.
#
# Class has been mainly developed for the CIS30FU project.
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date Nov 2016
#
# Impor... |
bb972f0a6403b892aa0143ab28fbae9cfbad7457b6c875b01490b79a2e76de7d | Python | 22,455 | 520 | """
toposampling - Topology-assisted sampling and analysis of activity data
Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen
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... |
f1d9447d7ae7d85e6b0f7e9a8b9ee6b74a6a8cf093de7949d13c806ab1729e67 | Python | 22,460 | 373 | # 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
#
# ht... |
2683c1c0e1c45627a64a32a7efc600c1ca63c74c7b6a30c40b7ca3a8d2a0db8d | Python | 22,490 | 565 | """
Point coordinate file I/O.
Reads and writes (z, y, x) point arrays in the legacy TXT format
and the napari/cellpose CSV format.
This module exposes two entry points:
* :func:`load_points_file` / :func:`save_points_file` - the original,
lenient loader/saver that also accepts the cellpose-style
``z,c... |
f86a10b8f2abc20aa6946faab70a8107caef55f8856ee467d55134c960722cf0 | Python | 22,500 | 567 |
import time
import math
import warnings
from pathlib import Path
from typing import Union, List, Optional
import re
import typer
import pandas as pd
import torch.optim as optim
import torch.multiprocessing
from utils.config_parser import ConfigParser
from utils.plotter import plot_losses, save_losses
from utils.prepro... |
752ea6faf9403a655cb0c5fd7e6e9410b49fc5e73ea3a215e533c77df06a4997 | Python | 22,511 | 603 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
514219258c9c48ebfe9b7b806ea7d8bd2ac1bc1cef5042340cba796988c8d415 | Python | 22,522 | 544 | from typing import Union
import numpy as np
from numpy.typing import NDArray
from pyntbci.utilities import encoding_matrix
def generate_impulse_response(
fs: int,
components: list[tuple[float, float, float]] = None,
dtype: Union[str, np.dtype] = "float32",
) -> NDArray:
"""Generate a temporal respon... |
960f13abf96de79913ce833e50436218bd4d5ce78d1ea6d66a6960f13e64dea9 | Python | 22,542 | 599 | from __future__ import annotations
from copy import deepcopy
from shapely.geometry import CAP_STYLE
from wsilearn.utils.cool_utils import *
from wsilearn.utils.df_utils import print_df
from wsilearn.utils.path_utils import *
import functools
from wsilearn.wsi.contour_utils import dist_to_px
print = functools.partial... |
70f7bc6fa805586bc06ff4dc571ccd075888329a7cd9cbd2f44bafe047c4c928 | Python | 22,543 | 453 | """
Tests for testing bio-material tracking by GraphMCF
"""
__author__ = 'Antonio Martinez-Sanchez'
import time
import sys
from pyseg.scripts import mcf_graph
from pyseg.factory import Grid3D
from pyseg.factory import unpickle_obj
from pyseg.globals import *
import pyseg.disperse_io as disperse_io
from matplot... |
8de7697e80936241ba70beccdd94986bb0b5d8fd80e780e189e513056606c403 | Python | 22,549 | 527 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
from typing import Any, Callable, Dict, Optional, Text, Union, Iterable
import tensorflow.experimental.numpy as tnp
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras i... |
644c174fe2f05942f7d7f8d38552120c3e2e9d523d890bfd2d459a8d08959988 | Python | 22,552 | 512 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import rospy
import tf
import time
import os
from collections import namedtuple
from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, SingleJointPositionAction, \
SingleJointPositionGoal, Pr2GripperCommandAc... |
ca70d9b9cabb12f3c0b9b635e96243c292b0d19ecbea2d382fada4c6bf2e1987 | Python | 22,572 | 422 | """
CSV FILE EXPORT FUNCTIONS
This file allows exporting data to .csv files.
"""
import time as timelib
import numpy as np
import csv
from datetime import datetime
from pathlib import Path
def init_to_csv(self, export_filename):
if not self.EVAL_EXPORT:
# creating file
current_time = datetime.n... |
6acc0eddbe95af06c807d6906f17eb9e22178ec74019cdda7811ff72eed90f4e | Python | 22,575 | 459 | """This file is to interact with GhostInMesh
neural_model_output: to generate neural model output
train_neuron_muscle_map: to train CNN which transfer from motor neuron voltage to muscle signal
"""
import os
import pickle
import torch
import torch.nn as nn
from matplotlib import pyplot as plt
import numpy as np
from sh... |
a0ef2eb44aa80359494e3a96c57b62bc14ff8715be2ba49ee33ba8a53ed40dd4 | Python | 22,581 | 549 | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... |
d096fb8e1085ad894e89981cab55efe1d8ca27c1b8c03ab5befc8001638ff9ea | Python | 22,584 | 422 | """
CSV FILE EXPORT FUNCTIONS
This file allows exporting data to .csv files.
"""
import time as timelib
import numpy as np
import csv
from datetime import datetime
from pathlib import Path
def init_to_csv(self, export_filename):
if not self.EVAL_EXPORT:
# creating file
current_time = datetime.n... |
829481a468dd3634cddd1bec0caa481de1f8374d3eb8b075f7a852e831988d94 | Python | 22,588 | 529 | import unittest
import torch
import networkx as nx
from torch_geometric.data import Data
from parameterized import parameterized
from HyDGL.node import Node
from HyDGL.edge import Edge
from HyDGL.graph import Graph
from tests.utils import Utils
class TestGraph(unittest.TestCase):
@parameterized.expand([
... |
52eff9fc3f1920a64d9eb35482a61a7ff4fbbcf7d42b31cadd3fea37f7e57fe5 | Python | 22,612 | 532 | # -*- coding: utf-8 -*-
#
# Test metadata implementation.
import tempfile
import pytest
import numpy as np
import matplotlib.pyplot as plt
import math
import h5py
import tempfile
import os
import dask.distributed as dd
# Local imports
from syncopy import freqanalysis
from syncopy.datatype.methods.copy import copy
fr... |
262b954e467b02d307b15d77b031797e9301c2de2d3a9d2de8e55cb098103a9a | Python | 22,616 | 544 | import logging
import warnings
from itertools import chain
from typing import Any, Dict, List, Tuple
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchmetrics
from torch.utils.data import DataLoader
from torchmetrics.image.inception import InceptionScore
from .utils import FrechetInception... |
400dddd9e91516bfd511c301241900b2b5ffb35eebe86bf281fef422a1132bb2 | Python | 22,623 | 592 |
# -*- coding: utf-8 -*-
"""
Created on Mar 13 2023
@author: Jonas A. Thiele
"""
### Apply models build in the HCP sample (806 subjects of HCP) with network-specific links to
### predict intelligence scores in the replication samples (PIOP1 and PIOP2 combined)
import pandas as pd
import numpy as np
im... |
f7269aaf919b1e8f2eb56b96841ace00e79d866894fe626bc789d5b85dabbe25 | Python | 22,627 | 502 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
98acbbd8f1bbe66678772fd6df834a0b348725767540280c443cce05a7c44fad | Python | 22,628 | 444 | import numpy as np
import time
from ElectricGrid import PreDefElecGrid
from TransferFunction import TransferFunction
import pyshtools as shp_harm
import matplotlib.pyplot as plt
import seaborn as sns
import ray
class SparsePlaceSpherical(PreDefElecGrid, TransferFunction):
def __init__(self, cond_vec, r... |
83df8435a00b4be07c768918a42bb35056a55a5a20ed3f922183232d9496aed3 | Python | 22,633 | 691 | # SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2021 Taneli Hukkinen
# Licensed to PSF under a Contributor Agreement.
from __future__ import annotations
from collections.abc import Iterable
import string
from types import MappingProxyType
from typing import Any, BinaryIO, NamedTuple
from ._re import (
R... |
7847ae90a9021a7a3ef23be494d1c792cd3bc40cfdc567bbe6e2389b0917c414 | Python | 22,635 | 739 | """
Custom types used throughout quacc.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from pydantic_settings import BaseSettings
class DefaultSetting(BaseSettings):
"""
Type hint for when a default setting will be applied
"""
if TYPE_CHECKING:
from collections.abc import... |
932d5cbba21f70a205cedba0a9abae88a487b1ad7789fd5aabf1cf74517fd8a8 | Python | 22,643 | 471 | # 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
#
# ht... |
8372d3437511fc270f57796a4a1bbae907944c865eeb28a3fdd8490ec20f8bca | Python | 22,645 | 673 | #!/usr/bin/env python3
import argparse
import logging
import os
import shutil
import sys
import tempfile
import textwrap
from pathlib import Path
import checkv
import genomad
import pandas as pd
import pybedtools
import pysam
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from vipe... |
a1cd7829b863ae0ee46d3e28ac90d7b272c4760bbcd92ced3d01b8e56c972d92 | Python | 22,653 | 778 | #!/usr/bin/env python
# Copyright 2018, Google Inc.
# All rights reserved.
#
# 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 o... |
dd56ac9ba6ba06db028d8e89de231db1f8e11fbd4e7e3bd6e6911c42635211b4 | Python | 22,660 | 412 | import pandas as pd
import numpy as np
import scipy as scp
from ckg.analytics_core.viz import color_list
import plotly.graph_objs as go
import plotly.subplots as tools
from ckg.analytics_core.viz import Dendrogram
from ckg.analytics_core.analytics import wgcnaAnalysis
def get_module_color_annotation(map_list, col_ann... |
ba8bb294ebe93abc2347cc6a055e1c695e838cdd6cdd6ec3547d49f223270bcd | Python | 22,667 | 704 | # -*- coding: utf-8 -*-
#
# Test preprocessing
#
# 3rd party imports
import psutil
import pytest
import inspect
import numpy as np
import matplotlib.pyplot as ppl
# Local imports
import dask.distributed as dd
from syncopy import preprocessing as ppfunc
from syncopy import AnalogData, freqanalysis
import syncopy.prep... |
9bda6b5ba1cc678c73dd0a5dd1b32ca6a89ecbb6fae1b38a7d4af4bca51999bc | Python | 22,676 | 643 | import json
import os
from urllib.parse import urlparse
import anndata
import pandas as pd
from flask import Blueprint, Response, request, stream_with_context
import cirrocumulus.data_processing as data_processing
from .anndata_util import adata_to_df
from .auth_exception import AuthException
from .blueprint_util im... |
fc6c6de711fa3b0212f7154d4af73e1ace107f521f2d27e9e06de3702e6ec6bf | Python | 22,683 | 419 | import ray
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
from matplotlib import cm
import os
import time
from scipy.signal import find_peaks
from sklearn.linear_model import LinearRegression as lin_fit
import plo... |
99ccf79a7cb305e453ac91b227d88ffd19c937d5e6e35e3a3d2de95458c881d0 | Python | 22,687 | 420 | import sys
import matplotlib.pyplot as plt
import numpy as np
sys.path.append('/Users/anaconda/Desktop/Code/EC')
import experiments_code_s2p as ec
import pandas as pd
import seaborn as sns
from sklearn.linear_model import LinearRegression
from scipy.stats import pearsonr, ttest_ind, mannwhitneyu, kstest
from cmath im... |
fae51d43cf24ef8071f2a1abbfdb2f7ed43819bb82befe248482a8c77aa60809 | Python | 22,693 | 519 | '''
Original Author: Nate Zuniga
Modified by: Yi Jie (Josh) Tseng on 10/01/2023
Software requirement: Python
Python module requirement: scipy, sklearn, numpy, pandas and matplotlib
Purpose:
To perform normalization based on the Aguilan et al. 2020. It includes the following steps:
1. Clean and filter data.... |
612fb46d2e877ffb189e80522600538211649657de34c7ef134ddc7957739aff | Python | 22,709 | 511 | import math
from datetime import datetime
from pathlib import Path
import dgl
import numpy as np
import pandas as pd
from torch import from_numpy
from base import BaseDataset
from preprocess import TCGA_Project
from utils.api import get_filters_result_from_project
from utils.logger import get_logger
from utils.util i... |
aa36f563ccd73ab4af71f4d6cc1f3337ae04572e13663e408d7e6d4eb786b373 | Python | 22,714 | 617 | #!/usr/bin/env python3
"""Check that all HED schemas in a hed-schemas repository can be loaded.
Attempts to load all non-deprecated schemas in all 4 formats
(XML, MediaWiki, JSON, TSV) from both standard_schema and library_schemas
directories within a hed-schemas repository checkout.
Can be used as:
1. A console ... |
4395f91cffa54bfb5c7e770987bc015ec36d448931db7e27d9068ab002c2d617 | Python | 22,745 | 623 | ################################################################################
# Copyright (c) 2021-2024, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by D. Jones <djones@llnl.gov> and UCSD collaborators in listed in CONTRIB.md
#
# All rights reserved.... |
1522f52ff5a8124229d0750edf21e1b4e02131e133588cfc663ca1284a976108 | Python | 22,755 | 1,168 | from __future__ import annotations
from math import ceil
from pathlib import Path
from typing import Sequence
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.lines import Line2D
from ..category import (
CATEGORY_COLUMN,
)
from ..display_order import (
ordered_combinati... |
ddb6e8d4144e690d7d040fb8a9680eaadf61e626bafd462de77291728e618bd6 | Python | 22,765 | 691 | import numpy as np
import random
import networkx as nx
from time import time
import pandas as pd
import itertools
from .graph_creation import *
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from itertools import repeat
from functools import partial
from tqdm.auto import tqdm, trange
### sample... |
2792a5a7dd16ce30d6b53cfff0308d8ed5a0acb7fe61c97d4dfa64b311db8131 | Python | 22,773 | 587 |
from dreamcoder.type import *
from dreamcoder.task import Task
from dreamcoder.utilities import eprint, hashable
from random import randint, random, seed
from itertools import product
# Excluded routines either impossible or astronomically improbable
# I'm cutting these off at ~20 nats in learned grammars.
EXCLUDES... |
9490bb91db761cb62f28c89cbd4889cf0e665b7e434e8d476ededd530734db29 | Python | 22,782 | 549 | import os
import re
from typing import List
from typing import Tuple
import pandas
import numpy as np
import merlin
from merlin.core import dataset
def _parse_list(inputString: str, dtype=float):
if ',' in inputString:
return np.fromstring(inputString.strip('[] '), dtype=dtype, sep=',')
else:
... |
79aedbe9249d70d352b49d4a448b62f6a873f4f6a2b34a39ac7207f51418ac05 | Python | 22,787 | 568 | import numpy as np
import csv
from cv2 import imread
import os
from rocf_scoring.helpers.helpers import is_number, File
from rocf_scoring.features.augmenter import simulate_augment, augment
from rocf_scoring.data_preprocessing.preprocess import preprocess
from rocf_scoring.helpers.helpers import create_directory
from... |
cc05fa01784534cc39187dba17f04388607807d5479c676bde6fa0f4612f33d8 | Python | 22,792 | 665 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#from ast import Del
from symtable import Symbol
from scipy.io import loadmat
import numpy as np
import os
import sys
sys.path.append(os.path.abspath('../'))
try:
import analysis.connectivityMatrices as matrices
except ModuleNotFoundError:
import KuramotoNetworksPackage... |
31ea751e7ca97ce9f3e511b460a5356f099aefbaf7ad0ecebe5f54012a895527 | Python | 22,807 | 600 | """
Clases for reducing the size of a SkelGraph but keeping its topology
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 16.09.14
"""
__author__ = 'martinez'
from .core import *
try:
import disperse_io
except:
import pyseg.disperse_io
try:
import pickle as pickle
except... |
29439cfa1379d5e9bd8ebab12b0511dc99e481213ec523aa32288971268be81f | Python | 22,811 | 705 | """Handles all VCS (version control) support"""
import logging
import os
import shutil
import sys
import urllib.parse
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
Iterator,
List,
Mapping,
Optional,
Tuple,
Type,
Union,
)
from pip._internal.cli.spinners import Spi... |
0b6e070ba42171ac8c16bc0f11c9b66bd1f203de2227cf2a3f115ba79d93d832 | Python | 22,818 | 608 | # coding=utf-8
# Copyright 2026 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... |
3f4bf12367dc9ddca6d545354b7ed703343342793263b62a00a9b19b6e3f82e8 | Python | 22,820 | 662 | """Light wrapper around the Win32 Console API - this module should only be imported on Windows
The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
"""
import ctypes
import sys
from typing import Any
windll: Any = None
if sys.platform == "win32":
windl... |
b022ca4620d145ce52ca8945a4ff3c8394c10cb1b74480272fa6d0158f7214ae | Python | 22,821 | 599 | # Copyright 2022 the Regents of the University of California, Nerfstudio Team and contributors. 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.... |
0a84d969eacd30f0d9d33c5ae6da5f6c97ac8b8d22492d8579f7fd27bbc61c84 | Python | 22,823 | 446 |
import vtk
import math
import time
import numpy as np
from unittest import TestCase
from ..surface import ListShellNhood, ListSphereNhood
from ..model import ModelCSRV
from ..utils import disperse_io, iso_surface, poly_decimate
from matplotlib import pyplot as plt, rcParams
# Global variables
RAD_RG = np.arange(2, 80... |
9cded214c66cbb01bd7bb92aba128f678759fce3ccb7bc03600f4022de0a6af8 | Python | 22,823 | 276 | # Dominance analysis, following math here: https://github.com/dominance-analysis/dominance-analysis
# C. Cocuzza, 2021
# Multiple regression model to test how each network influences the explained variance (accuracy) of the act-flow prediction.
# So, the IVs (x regressors) here are 12 network AF-predicted betas (pre-... |
9538050427d1893610ee1392763750e21ebf04b3f62be530b616df474245f0cf | Python | 22,832 | 492 |
"""
Devashish Tripathi, 12/10/2022
Performing Hyperparameter optimization
"""
def hp_optimization(input_data, output_data,output_class,objective_fun,utag="",Standardize = True,window = None,algorithm="Bayesian",config_file = None,cross_validation = False,model_file = "ANN_architecture_HP.keras",NCombination = 10000... |
4e7b97918db7203a0842129487f6402fc7a38b67a449fbed938dee77a18b3042 | Python | 22,844 | 438 | import warnings
import numpy as np
import pickle as pkl
import sys
sys.path.append("twoq_value_2alpha/useful_functions/")
sys.path.append("lib_py/twoq_value_2alpha/useful_functions/")
sys.path.append("lib_c/")
sys.path.append("lib_py/lib_c/")
import useful_functions as useful_functions
from scipy.stats import pearsonr
... |
bc7de69e6fc976d41120122c0745902d7e1f44892dfa4e45dd31e7f9b6388aad | Python | 22,852 | 461 | ######## Name
######## BiochemSimulMuleRapid
######## Requires
######## {Modules}
import numpy as np
import numba
class BiochemSimulMuleRapid:
"""Class 'BiochemSimul' Illustration!
It is an essential part of the 'BiochemAnalysis' class!
########
Attributes
########
Met... |
bd3889a68c08233937546e6c89a377a8e74419e4a7a9c5ba1e2f17d51f5e758c | Python | 22,852 | 494 | import torch
from torch import nn
from collections.abc import Sequence
from torch_scatter import scatter_add, scatter_mean
from torchdrug import core, layers
from torchdrug.core import Registry as R
from torch.nn import functional as F
from torch_scatter import scatter_add
from torchdrug import layers
@R.r... |
d7e45c3483b300d1bcb08778f9f6280b29f92ea6a1867b47bf93c98414f28f21 | Python | 22,853 | 617 | # -*- coding: utf-8 -*-
#
# Test proper functionality of Syncopy's `ContinuousData` class + subclasses
#
# Builtin/3rd party package imports
import os
import pytest
import numpy as np
import dask.distributed as dd
import matplotlib.pyplot as ppl
import scipy.stats as st
# Local imports
import syncopy as spy
from sync... |
1ed6d6d729c043d76e76cb13be4cd0e47982ac98c820d8d3a2aafeb12a6af894 | Python | 22,856 | 490 | #!/usr/bin/env python3
"""
Copyright (C) 2018-2020 Intel 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 applic... |
461f862d50c37b68593ac964fbd0b97301fbb3801bac7d72ab33717059b7c32d | Python | 22,863 | 583 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
15663c47086645071cb7355a00a00e32e20cd52e2d9132b5a1a5243877c99141 | Python | 22,864 | 438 | import sys
sys.path.append('/Users/anaconda/Desktop/Code/EC')
import experiments_code_s2p as ec
from scipy.stats import pearsonr, mannwhitneyu, ttest_ind, kstest
from matplotlib import pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
from pathlib import Path
from distutils.log import error
fr... |
baa6208f99bf9362ad67bd25fce7c0a510f647970091bd52c1c618907116da46 | Python | 22,866 | 492 |
"""
Devashish Tripathi, 12/10/2022
Performing Hyperparameter optimization
"""
def hp_optimization(input_data, output_data,output_class,objective_fun,utag="",Standardize = True,window = None,algorithm="Bayesian",config_file = None,cross_validation = False,model_file = "ANN_architecture_HP.keras",NCombination = 10000... |
2b3e465206e6f1fb0579f7a8d95ecaaa9dbfe42bd56dc776ab6fa626d0eb2b62 | Python | 22,872 | 484 | from __future__ import print_function
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
import argparse
import datetime
import math
import platform
import sys
import time
import numpy as np
import torch
cwd = os.getcwd()
pwd = os.path.abspath(os.path.join(os.getcwd(), "..")... |
319b29b4e8864e95f490c7c71c8a5aa65e0b20e94d88b42a776f3ca0885dabbe | Python | 22,877 | 637 | from __future__ import annotations
from importlib.util import find_spec
from pathlib import Path
from shutil import copy
import pytest
from ase import units
from ase.calculators.lj import LennardJones
from ase.io import read
from ase.optimize import FIRE
from pymatgen.io.qchem.inputs import QCInput
from quacc import... |
7a1347e10ba0aa3d143f24bb1da6b4eebc95be0bdc3341eed6a88dc77871edf1 | Python | 22,892 | 642 | # coding=utf-8
# Copyright 2026 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... |
1add07e21e0cbaf545d3ff173d5ebcc7c381c2c04399df6f91a0bc1ea6f7fe6a | Python | 22,907 | 356 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
99f85effd858004c8081a44791a6bfc2cc9fe56d49bd5262021219cf451cb752 | Python | 22,913 | 644 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
e49a2a3e08ced146a50973aa1153d312504324eb7dfa0cd93dae81e648b873f4 | Python | 22,927 | 668 | import importlib
from unittest.mock import patch
import numpy as np
import pytest
from SurvivalEVAL import concordance, concordance_cr, concordance_cr_per_event
from SurvivalEVAL.evaluations.discrimination._concordance_utils import (
_ConcordanceCounts,
_finalize_counts,
)
def _direct_counts(risks, times, e... |
c63563f8c6b7b27855fb8e12840f70aaac046c7d87c03ce2102c7bdba66ff599 | Python | 22,934 | 586 | #!/usr/bin/env python
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Welcome to CARLA scenario_runner
This is the main script to be executed when running a scenario.
It loads the scenario configura... |
ce60f25b629c75d7e6ccd9fa0c2dba794ad4685ebacce9b8f855bfb3d4e8d077 | Python | 22,940 | 641 | # -*- coding: utf-8 -*-
#
# computeFunctions and -Routines for parallel calculation
# of single trial measures needed for the averaged
# measures like cross spectral densities
#
# Builtin/3rd party package imports
import numpy as np
import h5py
from scipy.signal import fftconvolve, detrend
from inspect import signatur... |
86ce946fc51fd1eac937a083e48d2e201a8b58dd3d65cfa48558cc8857fc3ae5 | Python | 22,942 | 791 | import os
import sys
import glob
import numpy as np
from pathlib import Path
from configparser import ConfigParser
import json
import csv
def conf_attribute_reader(string_value):
"""
:brief: standardized way for reading config entries
that are strings, in priority order
None -> bool -> dict/list (via j... |
156463e08467f1139a89b733594462e1c3b19a1201eea8dd62f0180b6f020827 | Python | 22,943 | 755 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 26 13:05:23 2021
@author: joaquin
"""
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import scipy.io
import pandas as pd
import os
import h5py
import mat73
from scipy import signal
from statsmodels.tsa.stattools import gr... |
ea0abf6190a8fc0d5ecc51e9918bfab95758361bb908218e67b976b17d17f018 | Python | 22,964 | 508 | #!/usr/bin/env python3
"""Unit tests for the schema-manifest scripts in ``scripts/``.
Covers ``generate_schema_versions.py`` and ``update_latest_json.py``. Uses only the standard
library (``unittest``) and temporary directories - no network, no real schemas, no git repo
required (the scripts fall back gracefully when ... |
83e9f0acc378fd1c268845cd0f98d54b0f3fec51bac8c0dcaa0b2a45a7a677c5 | Python | 22,965 | 546 | #!/usr/bin/env python
'''
BGTCS MFM
Usage:
mfm [options] [<key>=<value>]...
Options:
-l --list List all options
-h --help Show this screen
'''
import pdb
import numpy as np
import pickle
import sys
import os
from docopt import docopt
from tabulate import tabulate
from utils import progbar
from swift imp... |
d6213076f6b3f4dac33bfa72143bbd41344b918689f3dd9c0ed723aced1c8cfb | Python | 22,968 | 559 | """
Classes for modelling the structures connected to membranes
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 12.06.15
"""
__author__ = 'martinez'
import numpy as np
import vtk
import math
import pyseg as ps
import graph_tool.all as gt
import copy
import operator
from sklearn.clu... |
c629cfe7b5714cd421a39457ab83c3e061d2e62909ee1f90542c6b41d283e476 | Python | 22,986 | 577 | """B6 DAPI average (Stæger et al. 2020) - native variant.
The 469 MB GIN download is not exercised here; these cover the deterministic
parts - the Allen-id -> parcellation_index remap, the registry/config wiring,
and the partial-coverage banner.
"""
import numpy as np
import pytest
import nibabel as nib
... |
321971202cb8c351b1a40b27db0f4709ed6a653c9d12c4c640dc849730322c6c | Python | 23,000 | 386 | # set QT_API environment variable
import os
import sys
os.environ["QT_API"] = "pyqt5"
import qtpy
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
# app specific libraries
import control.widgets as widgets
import control.camera as camera
import control.core as core
impor... |
be76605d342041f5c8eec47621bb2d507b9940d391d6757686220cbbe0841c3a | Python | 23,001 | 507 | import numpy as np
from BehavPLS_opt import BehavPLS
from compute_opt import *
import os
import sys
import pickle as pk
from scipy.io import loadmat
import glob
from itertools import combinations
def set_default_parameter():
##Number of participants
nb= 100
# Number of permutations for significance testin... |
3cbecb204f6e60136b2b6a5b46f1372e07f6be9862990328ed63f62e47d8863c | Python | 23,006 | 632 | import numpy as np
import pytest
from scipy.integrate import quad
from scipy.interpolate import PchipInterpolator
from SurvivalEVAL import (
CompetingRisksEvaluator,
concordance_cr,
concordance_cr_per_event,
cr_d_calibration,
)
@pytest.fixture
def predictions():
terminal = np.array([[0.75, 0.25],... |
2ad72397020fc687003c9ab513769359779e1696777168c9193cddf5a166fbcd | Python | 23,008 | 580 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
f9bda4a4a28d888dd89e7122bb49c3cfaf1fb19fab3e931167aaeed0d11770a2 | Python | 23,008 | 652 | """
Final submission from Camformers.
Usage:
python3 camformers_submission.py
"""
__date__ = "26/07/2022"
### imports ###
import warnings
import math
import os
import sys
import time
from optparse import OptionParser
import collections
from collections import OrderedDict
from itertools import repeat
import json
im... |
14d758985e5e64b5bda8200d4641dfe0fae50fe6f10151d6691cfce5ee5ebd63 | Python | 23,032 | 545 | import os
import logging
import json
import pickle
import matplotlib.pylab as plt
import numpy as np
import torch
from scipy.signal import stft, istft
from sklearn.linear_model import LinearRegression
from abc import abstractmethod
from typing import List, Tuple
from cellmincer.util import OptopatchBaseWorkspace, O... |
ef6148a49f490a03d70ca0808d7ef9e45727b7fd4d4714052ec1c24fcf569eb0 | Python | 23,043 | 489 | import os
import torch
import torch.distributed as dist
# from torch._six import inf
import argparse
from config import get_config
import torch.nn.functional as F
from time import time
def parse_option():
parser = argparse.ArgumentParser('BAE-ViT training and evaluation script', add_help=False)
parser.add_argu... |
560e17b90595b47dfb77365bc7a4ee24519c6bd2a5bcb90bcf7ec8d32dc012ba | Python | 23,071 | 466 | import schnetpack as spk
import torch.nn as nn
import torch
import numpy as np
def force_weigth(target_energies, energy_cutoff=0.02):
# Get the differences
delta_e = (target_energies[:, :, None] - target_energies[:, None, :]) ** 2
# Mask the same states
delta_e[:, torch.eye(target_energies.shape[1]) ... |
e56681d4587ad4ae8b46fd48797d27093a2656c180e9a334d20fad616025cc66 | Python | 23,076 | 557 | r"""Test OpenBabel executables from Python
Note: Python bindings not used
On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake
-R pytest -VV
You could also "chdir" into bu... |
d60d9d82d94bb5e64edb81f79811e0733607e29deec904af8e7b444523449dc1 | Python | 23,080 | 501 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import time
import numpy as np
import warnings
from scipy.stats import zscore
import logging
import sys
from .cluster import kmeans, scaled_kmeans, compute_cc_tdelay
from .sort import traveling_salesman, comput... |
a392e8f4f623c3915442e1b87bdde95502ef83bb736ac3bf573f2815fc80b846 | Python | 23,085 | 422 | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
from torch.utils.data import Dataset
import numpy as np
import pandas as pd
import torch.nn.functional as F
import random
from torch.utils.data import DataLoader
from scipy.stats import pearsonr, spearmanr
from pathlib import Path
from torch.utils.data import... |
deb1bc0dc70d686236d83819840df653ac476373389ceaf6e695543a22ad5522 | Python | 23,087 | 641 | import pandas as pd
import numpy as np
import os, sys, json
import yaml, h5py
import nibabel as nib
from copy import deepcopy
from scipy import stats
from tqdm.auto import tqdm
from os import listdir, makedirs
from os.path import join, exists
from os.path import splitext, dirname
__all__ = ['get_subj_dims', 'load_v... |
a622c2bc7cab50e498758485de050ba0c1113c08f99df9cad46a1623dbe55da8 | Python | 23,103 | 682 | #!/usr/bin/env python
"""
Makes layers in a given region starting from one or between two specified
boundaries. Then it analyzes ovelap of given segments with the layers and
determines the position of gegment centers in repect to the layers.
Important notes:
- In order to make setting up multiple scripts easier... |
0aa7bada93936503cadf8bb05c997d6db8c79adb7b263935036b2b103d3188ba | Python | 23,118 | 566 | '''
First two functions are pymol's plugin setup
'''
import logging
def __init_plugin__(app=None):
'''
Add an entry to the PyMOL "Plugin" menu
'''
from pymol.plugins import addmenuitemqt
addmenuitemqt('KinaseDocker\u00b2', run_plugin_gui)
# global reference to avoid garbage collection of the dial... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.