code: def _encode_idxs(self, idxs: list):
      if not isinstance(idxs, list):
          raise Exception(
              f"Passed indexes is not an iterable. Check the type! Index: {idxs}"
          )
  
      X = torch.zeros((len(idxs), self.input_length))
      Y = torch.zeros((len(idxs),))
      for col in self.data_frame:
          if self.encoders.get(col, None):
              kwargs = {}
              if (
                  "dependency_data"
                  in inspect.signature(
                      self.encoders[col].encode
                  ).parameters
              ):
                  kwargs["dependency_data"] = {
                      dep: [self.data_frame.iloc[idxs][dep]]
                      for dep in self.encoders[col].dependencies
                  }
              if hasattr(self.encoders[col], "data_window"):
                  cols = [self.target] + [
                      f"{self.target}_timestep_{i}"
                      for i in range(1, self.encoders[col].data_window)
                  ]
                  data = self.data_frame[cols].iloc[idxs].values
              else:
                  cols = [col]
                  data = (
                      self.data_frame[cols].iloc[idxs].values.flatten()
                  )
  
              encoded_tensor = self.encoders[col].encode(data, **kwargs)
              if (
                  torch.isnan(encoded_tensor).any()
                  or torch.isinf(encoded_tensor).any()
              ):
                  raise Exception(
                      f"Encoded tensor: {encoded_tensor} contains nan or inf values, this tensor is \
                                        the encoding of column {col} using {self.encoders[col].__class__}"
                  )
              if col != self.target:
                  a, b = self.encoder_spans[col]
                  X[:, a:b] = torch.squeeze(
                      encoded_tensor,
                      dim=list(range(2, len(encoded_tensor.shape))),
                  )
  
              # target post-processing
              else:
                  Y = encoded_tensor
  
                  if len(encoded_tensor.shape) > 2:
                      Y = encoded_tensor.squeeze()
  
                  if len(encoded_tensor.shape) < 2:
                      Y = encoded_tensor.unsqueeze(1)
  
                  # else:
                  #     Y = encoded_tensor.ravel()
  
      return X, Y
  
imports: import inspect
  from typing import List, Tuple, Dict
  import torch
  import numpy
  import pandas
  from torch.utils.data import Dataset
  from lightwood.encoder.base import BaseEncoder
label_desc: Use image node_id 4 for calling the EncodedDs obj's underlying member method code with example usage: obj._encode_idxs(idxs) and returns: X,  Y