code: def _check_timelike(name, timelike, can_grad):
      assert isinstance(
          timelike, torch.Tensor
      ), "{} must be a torch.Tensor".format(name)
      _assert_floating(name, timelike)
      assert (
          timelike.ndimension() == 1
      ), "{} must be one dimensional".format(name)
      if not can_grad:
          assert (
              not timelike.requires_grad
          ), "{} cannot require gradient".format(name)
      diff = timelike[1:] > timelike[:-1]
      assert (
          diff.all() or (~diff).all()
      ), "{} must be strictly increasing or decreasing".format(name)
  
imports: from enum import Enum
  import math
  import numpy
  import torch
  import warnings
  from .event_handling import combine_event_functions
label_desc: Use image node_id 18 for calling a global function with example usage: _check_timelike(name, timelike, can_grad) without return types