class_docstr: When expanding the columns from variables to features, this class keeps
  track of the 1:m mapping between the collapsed and expanded columns.
  
  Args:
      schema: A dictionary mapping a variable (can be any hashable object) to
          a data type. Permissible data types are stored in the class
          attribute ``PERMISSIBLE_TYPES``.
class_docstr_tok: ["When","expanding","the","columns","from","variables","to","features",",","this","class","keeps","track","of","the","1",":","m","mapping","between","the","collapsed","and","expanded","columns",".","Args",":","schema",":","A","dictionary","mapping","a","variable","(","can","be","any","hashable","object",")","to","a","data","type",".","Permissible","data","types","are","stored","in","the","class","attribute","``","PERMISSIBLE_TYPES","``","."]
docstr: Returns the indices for a variable or list of variables.
  
  Args:
      var: A variable/node.
      squeeze: No effect if either a list,set,"dict_iterable" (e.g. from
          ``graph.predecessor(var)``) is provided or var is a
          categorical value.
  
  Returns:
      A list of indices. For binary and continuous variables this will be
      a list of length one. If squeeze is True, returns the index outside
      of a list.
  
  Raises:
      ValueError: if an unsupported variable object is provided.
docstr_tok: ["Returns","the","indices","for","a","variable","or","list","of","variables",".","Args",":","var",":","A","variable\/node",".","squeeze",":","No","effect","if","either","a","list",",","set",",","''","dict_iterable","''","(","e.g",".","from","``","graph.predecessor","(","var",")","``",")","is","provided","or","var","is","a","categorical","value",".","Returns",":","A","list","of","indices",".","For","binary","and","continuous","variables","this","will","be","a","list","of","length","one",".","If","squeeze","is","True",",","returns","the","index","outside","of","a","list",".","Raises",":","ValueError",":","if","an","unsupported","variable","object","is","provided","."]
code: def get_indices(
      self,
      var: Union[Hashable, List[Hashable], Set[Hashable], Iterator],
      squeeze: bool = False,
  ) -> Union[int, List[int]]:
      """
      Returns the indices for a variable or list of variables.
  
      Args:
          var: A variable/node.
          squeeze: No effect if either a list,set,"dict_iterable" (e.g. from
              ``graph.predecessor(var)``) is provided or var is a
              categorical value.
  
      Returns:
          A list of indices. For binary and continuous variables this will be
          a list of length one. If squeeze is True, returns the index outside
          of a list.
  
      Raises:
          ValueError: if an unsupported variable object is provided.
      """
      if var in self.variable_list:
          if squeeze and var not in self.get_var_of_type("categorical"):
              return self.var_indices_dict[var][0]
          return self.var_indices_dict[var]
      if isinstance(var, (list, set)):
          return [ix for v in var for ix in self.get_indices(v)]
      if hasattr(var, "__next__"):
          # Deals with DiGraph.predecessors's "dict_keyiterator" and similar
          # Iterators
          return [ix for v in list(var) for ix in self.get_indices(v)]
      raise ValueError(
          "Provide a valid variable name, a set/list/Iterator of variable "
          "names. Other iterables are not supported."
      )
  
file_path: causalnex/causalnex/structure/categorical_variable_mapper.py
imports: import re
  from collections import OrderedDict
  from itertools import chain
  from typing import Dict, Hashable, Iterator, List, Optional, Set, Union
  from networkx.classes.reportviews import NodeView
label_desc: Use image node_id 6 for calling the VariableFeatureMapper obj's underlying member method code with example usage: obj.get_indices(var, squeeze) and returns: self, unknown, unknown, self