code: def _flatten_binary_scores(scores, labels, ignore_index=None):
      """Flattens predictions in the batch (binary case)
      Remove labels equal to 'ignore'
      """
      scores = scores.view(-1)
      labels = labels.view(-1)
      if ignore_index is None:
          return scores, labels
      valid = labels != ignore_index
      vscores = scores[valid]
      vlabels = labels[valid]
      return vscores, vlabels
  
imports: from __future__ import print_function, division
  from typing import Optional, Union
  import torch
  import torch.nn.functional
  from torch.autograd import Variable
  from torch.nn.modules.loss import _Loss
label_desc: Use image node_id 4 for calling a global function with example usage: _flatten_binary_scores(scores, labels, ignore_index) and returns: vscores,  vlabels, scores,  labels