code: def check_fam_for_samples(required_samples, source, gold):
      
      # Checking the source panel
      source_samples = set()
      with open(source, 'r') as input_file:
          for line in input_file:
              sample = tuple(line.rstrip("\r\n").split(" ")[:2])
              if sample in required_samples:
                  source_samples.add(sample)
  
      # Checking the gold standard
      gold_samples = set()
      with open(gold, 'r') as input_file:
          for line in input_file:
              sample = tuple(line.rstrip("\r\n").split(" ")[:2])
              if sample in required_samples:
                  gold_samples.add(sample)
  
      # Checking if we got everything
      logger.info("  - Found {} samples in source panel".format(
          len(source_samples),
      ))
      logger.info("  - Found {} samples in gold standard".format(
          len(gold_samples),
      ))
  
      if len(required_samples - (source_samples | gold_samples)) != 0:
          return False
      else:
          return True
docs: Check fam files for required_samples.