code: def _build_shards(num_shards, array):
      """Placeholder docstring"""
      if num_shards < 1:
          raise ValueError("num_shards must be >= 1")
      shard_size = int(array.shape[0] / num_shards)
      if shard_size == 0:
          raise ValueError("Array length is less than num shards")
      shards = [
          array[i * shard_size : i * shard_size + shard_size]
          for i in range(num_shards - 1)
      ]
      shards.append(array[(num_shards - 1) * shard_size :])
      return shards
  
imports: from __future__ import absolute_import
  import json
  import logging
  import tempfile
  from typing import Union, Optional, Dict
  from six.moves.urllib.parse import urlparse
  from sagemaker import image_uris, s3_utils
  from sagemaker.amazon import validation
  from sagemaker.amazon.hyperparameter import Hyperparameter
  from sagemaker.amazon.common import write_numpy_to_dense_tensor
  from sagemaker.deprecations import renamed_warning
  from sagemaker.estimator import EstimatorBase, _TrainingJob
  from sagemaker.inputs import FileSystemInput, TrainingInput
  from sagemaker.utils import sagemaker_timestamp, check_and_get_run_experiment_config
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.pipeline_context import runnable_by_pipeline
  from sagemaker.workflow import is_pipeline_variable
label_desc: Use image node_id 1 for calling a global function with example usage: _build_shards(num_shards, array) and returns: shards