code: def validation_split(self):
      """Defines the attributes `x_train`, `y_train`, `x_val` and `y_val`.
      The validation sets are determined by the attribute val_split,
      which is a number in (0, 1) which determines the proportion of
      the input data to be allocated for cross-validation."""
  
      # data input is list but multi_input is not set to True
      if isinstance(self.x, list) and self.multi_input is False:
          raise TypeError("For multi-input x, set multi_input to True")
  
      # If split is done in `Scan()` do nothing
      if self.custom_val_split:
          self.x_train = self.x
          self.y_train = self.y
  
          return self
  
      # Otherwise start by shuffling
      import wrangle
  
      self.x, self.y = wrangle.array_random_shuffle(
          x=self.x, y=self.y, multi_input=self.multi_input
      )
  
      # deduce the midway point for input data
      limit = int(len(self.y) * (1 - self.val_split))
  
      # handle the case where x is multi-input
      if self.multi_input:
          self.x_train = []
          self.x_val = []
  
          for ar in self.x:
              self.x_train.append(ar[:limit])
              self.x_val.append(ar[limit:])
  
      # handle the case where x is not multi-input
      else:
          self.x_train = self.x[:limit]
          self.x_val = self.x[limit:]
  
      # handle y data same for both cases
      self.y_train = self.y[:limit]
      self.y_val = self.y[limit:]
  
      return self
  
label_desc: Use image node_id 1 for calling a global function with example usage: validation_split() and returns: self, self