code: def assertions_if_not_none(self, x, match_all_keys):
      if x is not None:
          if self.is_dict:
              assert isinstance(x, dict)
              if match_all_keys:
                  assert sorted(list(x.keys())) == sorted(
                      list(self.losses.keys())
                  )
              else:
                  assert all(k in self.losses.keys() for k in x.keys())
          else:
              assert c_f.is_list_or_tuple(x)
              assert len(x) == len(self.losses)
  
imports: import torch
  from ..utils import common_functions
label_desc: Use image node_id 4 for calling the MultipleLosses obj's underlying member method code with example usage: obj.assertions_if_not_none(x, match_all_keys) without return types