code: def _prune_array(array):
      """Return an array equivalent to the input array. If the input
      array is a view of a much larger array, copy its contents to a
      newly allocated array. Otherwise, return the input unchanged.
      """
      if array.base is not None and array.size < array.base.size // 2:
          return array.copy()
      return array
  
imports: from contextlib import contextmanager
  import functools
  import operator
  import sys
  import warnings
  import numbers
  from collections import namedtuple
  import inspect
  import math
  from typing import Optional, Union, TYPE_CHECKING, TypeVar
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _prune_array(array) and returns: array, array