code: def _split_fingerprints(
      fps: List, size1: int, size2: int
  ) -> Tuple[List[int], List[int]]:
      """This is called by FingerprintSplitter to divide a list of fingerprints into
      two groups.
      """
      assert len(fps) == size1 + size2
      from rdkit import DataStructs
  
      # Begin by assigning the first molecule to the first group.
  
      fp_in_group = [[fps[0]], []]
      indices_in_group: Tuple[List[int], List[int]] = ([0], [])
      remaining_fp = fps[1:]
      remaining_indices = list(range(1, len(fps)))
      max_similarity_to_group = [
          DataStructs.BulkTanimotoSimilarity(fps[0], remaining_fp),
          [0] * len(remaining_fp),
      ]
      # Return identity if no tuple to split to
      if size2 == 0:
          return ((list(range(len(fps)))), [])
  
      while len(remaining_fp) > 0:
          # Decide which group to assign a molecule to.
  
          group = (
              0
              if len(fp_in_group[0]) / size1
              <= len(fp_in_group[1]) / size2
              else 1
          )
  
          # Identify the unassigned molecule that is least similar to everything in
          # the other group.
  
          i = np.argmin(max_similarity_to_group[1 - group])
  
          # Add it to the group.
  
          fp = remaining_fp[i]
          fp_in_group[group].append(fp)
          indices_in_group[group].append(remaining_indices[i])
  
          # Update the data on unassigned molecules.
  
          similarity = DataStructs.BulkTanimotoSimilarity(
              fp, remaining_fp
          )
          max_similarity_to_group[group] = np.delete(
              np.maximum(similarity, max_similarity_to_group[group]), i
          )
          max_similarity_to_group[1 - group] = np.delete(
              max_similarity_to_group[1 - group], i
          )
          del remaining_fp[i]
          del remaining_indices[i]
      return indices_in_group
  
imports: import inspect
  import itertools
  import logging
  import os
  import random
  import tempfile
  from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple, Union
  import deepchem
  import numpy
  import pandas
  from deepchem.data import Dataset, DiskDataset
  from deepchem.utils import get_print_threshold
label_desc: Use image node_id 3 for calling a global function with example usage: _split_fingerprints(fps, size1, size2) and returns: indices_in_group, list,  list