python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
###############################################################################
# Code from
# https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py
# Modified the original code so that it also loads images from the current
# directory as well as the subdirectories
################################... | vid2vid-master | data/image_folder.py |
import os
import glob
from skimage import io
import numpy as np
import dlib
import sys
if len(sys.argv) < 2 or (sys.argv[1] != 'train' and sys.argv[1] != 'test'):
raise ValueError('usage: python data/face_landmark_detection.py [train|test]')
phase = sys.argv[1]
dataset_path = 'datasets/face/'
faces_folder_path = ... | vid2vid-master | data/face_landmark_detection.py |
import os.path
import torchvision.transforms as transforms
import torch
from PIL import Image
import numpy as np
from data.base_dataset import BaseDataset, get_img_params, get_transform, get_video_params, concat_frame
from data.image_folder import make_grouped_dataset, check_path_valid
from data.keypoint2img import re... | vid2vid-master | data/pose_dataset.py |
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
import os.path
import random
import torch
from data.base_dataset import BaseDataset, get_img_params, get_transform, get_video_params
from data.im... | vid2vid-master | data/temporal_dataset.py |
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
import os.path
import torch
from data.base_dataset import BaseDataset, get_img_params, get_transform, concat_frame
from data.image_folder import ... | vid2vid-master | data/test_dataset.py |
import torch.utils.data
from data.base_data_loader import BaseDataLoader
def CreateDataset(opt):
dataset = None
if opt.dataset_mode == 'temporal':
from data.temporal_dataset import TemporalDataset
dataset = TemporalDataset()
elif opt.dataset_mode == 'face':
from data.face_datase... | vid2vid-master | data/custom_dataset_data_loader.py |
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from fed_learn.numproto import proto_to_ndarray, ndarray_to_proto
from fed_learn.server.model_aggregator import Aggregator
from fed_learn.model_meta import FLContext
class CustomModelAggregator(Aggregator):
def process(self, accumulator: [FLContext], fl_... | clara-train-examples-master | Tensorflow-Deprecated/FL/adminMMAR/custom/BYO_aggregator.py |
# SPDX-License-Identifier: Apache-2.0
import logging
from fed_learn.client.fed_privacy import PrivacyProtocol
import numpy as np
class MyPrivacyProtocol(PrivacyProtocol):
def __init__(self, percentile=10, gamma=0.01):
self.logger = logging.getLogger('---- my Pricavy protocol')
PrivacyProtocol._... | clara-train-examples-master | Tensorflow-Deprecated/FL/adminMMAR/custom/BYO_Privacy.py |
# SPDX-License-Identifier: Apache-2.0
from queue import PriorityQueue
from random import randint, uniform
from automl.components.controllers.controller import Controller
from automl.defs import Context, Recommendation, Outcome, SearchResult
from automl.components.handlers.handler import Handler
from automl.defs imp... | clara-train-examples-master | Tensorflow-Deprecated/AutoML/BYOC/myAutoMLController.py |
# SPDX-License-Identifier: Apache-2.0
import tensorflow as tf
from ai4med.components.losses.loss import Loss
class MyClonedDiceLoss(Loss):
def __init__(self,data_format='channels_first',skip_background=False,squared_pred=False,
jaccard=False,smooth=1e-5,top_smooth=0.0,is_onehot_targets=False
... | clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/myLoss.py |
# SPDX-License-Identifier: Apache-2.0
import numpy as np
# note the ai4med here
# from ai4med.common.medical_image import MedicalImage
# from ai4med.common.transform_ctx import TransformContext
from ai4med.components.transforms.multi_field_transformer import MultiFieldTransformer
# from ai4med.components.transforms... | clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/myTransformation.py |
clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/__init__.py | |
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import logging
from ai4med.common.constants import ImageProperty
from ai4med.common.medical_image import MedicalImage
from ai4med.common.shape_format import ShapeFormat
from ai4med.common.transform_ctx import TransformContext
from ai4med.utils.dtype_utils impo... | clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/myNpLoader.py |
# SPDX-License-Identifier: Apache-2.0
import tensorflow as tf
from ai4med.components.models.model import Model
import tensorflow.contrib.slim as slim
class CustomNetwork(Model):
def __init__(self, num_classes,factor=32,
training=False,data_format='channels_first',
final_activat... | clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/myNetworkArch.py |
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from ai4med.components.metric import Metric
from ai4med.libs.metrics.metric_list import MetricList
class SampleMetricAverage(MetricList):
"""
Generic class for tracking averages of metrics. Expects that the elements in self._list
are scalar values... | clara-train-examples-master | Tensorflow-Deprecated/GettingStarted/BYOC/myMetric.py |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_2D/custom/deepgrow/handler.py |
import argparse
import json
import logging
import os
import sys
from monai.apps.deepgrow.dataset import create_dataset
from monai.data import partition_dataset
def prepare_datalist(args):
dimensions = args.dimensions
dataset_json = os.path.join(args.output, 'dataset.json')
logging.info('Processing datas... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_2D/custom/deepgrow/prepare_dataset.py |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_2D/custom/deepgrow/interaction.py |
# Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_2D/custom/deepgrow/__init__.py |
# SPDX-License-Identifier: Apache-2.0
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/OHIF-Orthanc/config/jupyter_notebook_config.py |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_3D/custom/deepgrow/handler.py |
import argparse
import json
import logging
import os
import sys
from monai.apps.deepgrow.dataset import create_dataset
from monai.data import partition_dataset
def prepare_datalist(args):
dimensions = args.dimensions
dataset_json = os.path.join(args.output, 'dataset.json')
logging.info('Processing datas... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_3D/custom/deepgrow/prepare_dataset.py |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_3D/custom/deepgrow/interaction.py |
# Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | clara-train-examples-master | PyTorch/NoteBooks/AIAA/deepgrow_3D/custom/deepgrow/__init__.py |
import json
import xml.etree.ElementTree as ET
import copy
import numpy as np
from skimage.measure import points_in_poly
np.random.seed(0)
class Polygon(object):
"""
Polygon represented as [N, 2] array of vertices
"""
def __init__(self, name, vertices):
"""
Initialize the polygon.
... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/annotation.py |
import torch
from torchvision import models
class TorchModelFullyConv(torch.nn.Module):
"""Customize TorchVision models to replace fully connected layer by convolutional layer."""
def __init__(self, model_name: str = "resnet18", n_classes: int = 1, pretrained: bool = False):
super().__init__()
... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/models.py |
import os
import sys
from argparse import ArgumentParser
import logging
import json
import time
import numpy as np
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from annotation import Annotation
ROOT_DATA_PATH="/claraDevDay/Data/DP_CAMELYON16/"
ANO_PATH = ROOT_DATA_PATH+"/jsons/"
TRAIN_NORMAL_LOC_PA... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/create_list.py |
import argparse
import logging
import numpy as np
from monai.data.image_reader import WSIReader
from skimage.color import rgb2hsv
from skimage.filters import threshold_otsu
def create_masks(args):
logging.basicConfig(level=logging.INFO)
reader = WSIReader(reader_lib="cuCIM")
img_obj = reader.read(args.w... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/tissue_mask.py |
import math
import os
import numpy as np
from monai.data import Dataset, SmartCacheDataset
from skimage.transform import resize
from image_reader import WSIReader
class PatchWSIDataset(Dataset):
"""
Load whole slide images and associated class labels and create patches
"""
def __init__(self, data, ... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/datasets.py |
import logging
import os
from typing import TYPE_CHECKING, Optional
import numpy as np
import matplotlib.pyplot as plt
from skimage import filters
from monai.utils import exact_version, optional_import
Events, _ = optional_import("ignite.engine", "0.4.2", exact_version, "Events")
if TYPE_CHECKING:
from ignite.eng... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/handlers.py |
import argparse
import json
import os
import random
TRAIN_NORMAL_FILE = "normal_train.txt"
TRAIN_TUMOR_FILE = "tumor_train.txt"
VALID_NORMAL_FILE = "normal_valid.txt"
VALID_TUMOR_FILE = "tumor_valid.txt"
WSI_IMAGE_FOLDER = "WSI/"
def read_file(file_path):
coords = []
infile = open(file_path)
for i, line ... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/generate_json.py |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 20 14:09:32 2016
@author: Babak Ehteshami Bejnordi
Modified by Ziyue Xu and Behrooz Hashemian
Evaluation code for the Camelyon16 challenge on cancer metastases detecion
"""
import openslide
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage as ... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/froc.py |
from typing import List, Optional, Sequence, Tuple, Type, Union
import numpy as np
from monai.data.image_reader import ImageReader
from monai.data.utils import is_supported_format
from monai.utils import ensure_tuple, optional_import
cuimage, has_cci = optional_import("cuimage")
openslide, has_osl = optional_import("... | clara-train-examples-master | PyTorch/NoteBooks/DomainExamples/DigitalPathology/MMAR_DP/custom/image_reader.py |
# SPDX-License-Identifier: Apache-2.0
import json
import logging
import os
import torch
import torch.distributed as dist
from monai.data import (
CacheDataset,
DataLoader,
load_decathlon_datalist,
partition_dataset,
)
from monai.engines import SupervisedEvaluator, SupervisedTrainer
from monai.handlers... | clara-train-examples-master | PyTorch/NoteBooks/FL/adminMMAR_BYOT_monai/custom/train_configer.py |
# SPDX-License-Identifier: Apache-2.0
import logging
import torch.distributed as dist
from nvflare.apis.event_type import EventType
from nvflare.apis.fl_constant import FLConstants, ShareableKey
from nvflare.apis.fl_context import FLContext
from nvflare.apis.shareable import Shareable
from nvflare.apis.trainer import... | clara-train-examples-master | PyTorch/NoteBooks/FL/adminMMAR_BYOT_monai/custom/monai_trainer.py |
# SPDX-License-Identifier: Apache-2.0
import logging
import math
from typing import Dict
import numpy as np
import torch
from nvflare.apis.fl_constant import FLConstants, ShareableKey, ShareableValue
from nvflare.apis.fl_context import FLContext
from nvflare.apis.shareable import Shareable
from ignite.engine import E... | clara-train-examples-master | PyTorch/NoteBooks/FL/adminMMAR_BYOT_monai/custom/utils.py |
from typing import Tuple
from nvflare.apis.aggregator import Aggregator
from nvflare.apis.fl_constant import ShareableKey, ShareableValue
from nvflare.apis.fl_context import FLContext
from nvflare.apis.shareable import Shareable
"""
This example shows a aggregator that just does simple averaging of submitted
weight di... | clara-train-examples-master | PyTorch/NoteBooks/FL/adminMMAR_privacy/custom/BYO_Aggregator.py |
# SPDX-License-Identifier: Apache-2.0
from queue import PriorityQueue
from random import randint, uniform
from automl.components.controllers.controller import Controller
from automl.defs import Context, Recommendation, Outcome, SearchResult
from automl.components.handlers.handler import Handler
from automl.defs imp... | clara-train-examples-master | PyTorch/NoteBooks/AutoML/BYOC/myAutoMLController.py |
# SPDX-License-Identifier: Apache-2.0
c.NotebookApp.terminado_settings = {"shell_command": ["/bin/bash"]}
| clara-train-examples-master | PyTorch/NoteBooks/scripts/jupyter_notebook_config.py |
# Coded copied and simplified as an example from https://docs.monai.io/en/latest/_modules/monai/losses/dice.html#DiceLoss
import warnings
from typing import Callable, Optional, Union
import torch
from torch.nn.modules.loss import _Loss
from monai.networks import one_hot
from monai.utils import LossReduction, Weight
... | clara-train-examples-master | PyTorch/NoteBooks/GettingStarted/custom/myLoss.py |
# SPDX-License-Identifier: Apache-2.0
from monai.transforms import Transform,MapTransform,Randomizable
from monai.config import KeysCollection
from typing import Optional, Any, Mapping, Hashable
import numpy as np
import monai
class RandAdditiveNoise(Randomizable, Transform):
def __init__(self, prob: float = 0.5... | clara-train-examples-master | PyTorch/NoteBooks/GettingStarted/custom/myTransformation.py |
clara-train-examples-master | PyTorch/NoteBooks/GettingStarted/custom/__init__.py | |
# copied from https://docs.monai.io/en/latest/_modules/monai/networks/nets/basic_unet.html#BasicUNet
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | clara-train-examples-master | PyTorch/NoteBooks/GettingStarted/custom/myNetworkArch.py |
import argparse
from pathlib import Path
import logging
import os
import glob
import fileIO
import numpy as np
from time import sleep
import json
#from src import create_csv_db
LOGGING_LEVEL = logging.INFO
# LOGGING_LEVEL=logging.DEBUG
# logging.basicConfig(level=LOGGING_LEVEL)
logging.basicConfig(level=LOGGING_LEVEL,... | clara-train-examples-master | PyTorch/NoteBooks/Data/TCIA/convert2nii.py |
from os import path
import nibabel as nib
import numpy as np
###################################################################################
# nifti files
###################################################################################
def openNifti(fname,type=None):
'''
:param fname: file path to open... | clara-train-examples-master | PyTorch/NoteBooks/Data/TCIA/fileIO.py |
DICOM_TAGS_TO_KEEP = ['ReferencedSeriesSequence0_SeriesInstanceUID','AccessionNumber', 'AcquisitionDate',
'AcquisitionDateTime', 'AcquisitionNumber', 'AcquisitionTime',
'AttenuationCorrectionMethod', 'BodyPartExamined',
'ContentDate', 'ContentTime', 'Con... | clara-train-examples-master | PyTorch/NoteBooks/Data/TCIA/src/dicom_keys.py |
"""List of function to pre-filter dicom slices or series
"""
import re
from src.dicom_keys import DICOM_TAGS_TO_KEEP
ImageType = "ImageType"
CorrectedImage = "CorrectedImage"
Modality = "Modality"
SeriesDescription = "SeriesDescription"
assert ImageType in DICOM_TAGS_TO_KEEP
assert CorrectedImage in DICOM_TAGS_TO_KE... | clara-train-examples-master | PyTorch/NoteBooks/Data/TCIA/src/filters.py |
# Import libraries
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
# Global parameters
colors = ['b','r','g','m','y','c']
styles = ['o','s','v','^','D',">"]
def plot_single_perf(bm, df, xaxis, unique_labels):
fig = fig = plt.figure(1,figsize=(5, 5))
fig.suptitle(bm)
ax = fig.gca... | cuCollections-dev | benchmarks/analysis/notebooks/Utils.py |
#!/usr/bin/python
###############################################################################
#
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... | ansible-collection-dpu-ops-main | plugins/action/raw_reboot.py |
#!/usr/bin/python
###############################################################################
#
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... | ansible-collection-dpu-ops-main | plugins/action/raw_upgrade.py |
# SPDX-FileCopyrightText: Copyright (c) 2022 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... | ansible-collection-dpu-ops-main | plugins/filter/rshim_filter.py |
#!/usr/bin/python
###############################################################################
#
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... | ansible-collection-dpu-ops-main | plugins/modules/bf2_facts.py |
#!/usr/bin/python
###############################################################################
#
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... | ansible-collection-dpu-ops-main | plugins/modules/bf2_facts_test.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | setup.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | benchmarks/make_training_seqlen_plots.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | benchmarks/torch_train.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | benchmarks/paddle_train.py |
LDDL-main | lddl/__init__.py | |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/types.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/random.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/utils.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/dask/readers.py |
LDDL-main | lddl/dask/__init__.py | |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/dask/load_balance.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/dask/bart/pretrain.py |
LDDL-main | lddl/dask/bart/__init__.py | |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/dask/bert/binning.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/dask/bert/pretrain.py |
LDDL-main | lddl/dask/bert/__init__.py | |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/paddle/log.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/paddle/datasets.py |
from .bert import get_bert_pretrain_data_loader
| LDDL-main | lddl/paddle/__init__.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/paddle/utils.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/paddle/dataloader.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/paddle/bert.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch/log.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch/datasets.py |
from .bert import get_bert_pretrain_data_loader
| LDDL-main | lddl/torch/__init__.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch/utils.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch/dataloader.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch/bert.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/download/books.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/download/common_crawl.py |
LDDL-main | lddl/download/__init__.py | |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/download/openwebtext.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/download/utils.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/download/wikipedia.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch_mp/log.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch_mp/datasets.py |
from .bert import get_bert_pretrain_data_loader
| LDDL-main | lddl/torch_mp/__init__.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch_mp/utils.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch_mp/dataloader.py |
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 1993-2022 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... | LDDL-main | lddl/torch_mp/bert.py |
#!/usr/bin/env python
"""
A script to lint and test ProxyFS jason RPC client library code.
"""
from __future__ import print_function, unicode_literals
from threading import Timer
import os
import argparse
import functools
import logging
import platform
import contextlib
import subprocess
import shutil
import sys
imp... | proxyfs-jrpc-client-master | regression_test.py |
import sys, struct
headersize = 16
sizeof_u32 = 4
ucode = open(sys.argv[1]).read()[headersize:]
assert struct.calcsize("I") == sizeof_u32
fmt = "I" * (len(ucode) / sizeof_u32)
ints = struct.unpack(fmt, ucode)
print len(ucode), "bytes"
print "sig =", hex(sum(ints) & 0xffffffff)
| nvgpu-master | scripts/nvgpu_ucode/ucodesignature.py |
#! /usr/bin/env python
"""
Snapshot a project into another project and perform the necessary repo actions
to provide a commit message that can be used to trace back to the exact point
in the source repository.
"""
#todo:
# Support svn
# Allow renaming of the source dir in the destination path
# Check if a new snap... | kokkos-master | config/snapshot.py |
import ipyleaflet as ipl
class BaseMap:
def __init__(self):
self._m = ipl.Map(layers=[], crs=ipl.projections.Simple)
| energy-sdk-l2rpn-master | nvgridui/nvapp/mapcomponent.py |
energy-sdk-l2rpn-master | nvgridui/nvapp/__init__.py | |
import os, sys
import importlib
# RELOAD_PATHS = ["/home/pavel/work/repos/L2RPN/individual/pavel/topo-sim/"]
def should_reload(m, RELOAD_PATHS):
if m is None:
return False
try:
for rp in RELOAD_PATHS:
if "__file__" in dir(m) and rp in m.__file__:
return True
e... | energy-sdk-l2rpn-master | nvgridui/nvapp/common.py |
import json
import ipyvuetify as v
from .appLoader import AppLoader
from .common import load_template
# update the CSS a bit
# cdnstr = """
# <script>
# var html2canvas=require(["/nvgrid/assets/html2canvas.js"], function (h2c){
# html2canvas = h2c;
# });
# h2c=require(["https://github.com/niklasvh/html2canvas/re... | energy-sdk-l2rpn-master | nvgridui/nvapp/app.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.