code: def _load_and_verify_metadata(self, submission_type):
      
      metadata_filename = os.path.join(self._extracted_submission_dir,
                                       'metadata.json')
      if not os.path.isfile(metadata_filename):
        logging.error('metadata.json not found')
        return None
      try:
        with open(metadata_filename, 'r') as f:
          metadata = json.load(f)
      except IOError as e:
        logging.error('Failed to load metadata: %s', e)
        return None
      for field_name in REQUIRED_METADATA_JSON_FIELDS:
        if field_name not in metadata:
          logging.error('Field %s not found in metadata', field_name)
          return None
      # Verify submission type
      if submission_type != metadata['type']:
        logging.error('Invalid submission type in metadata, expected "%s", '
                      'actual "%s"', submission_type, metadata['type'])
        return None
      # Check submission entry point
      entry_point = metadata['entry_point']
      if not os.path.isfile(os.path.join(self._extracted_submission_dir,
                                         entry_point)):
        logging.error('Entry point not found: %s', entry_point)
        return None
      if not entry_point.endswith('.sh'):
        logging.warning('Entry point is not an .sh script. '
                        'This is not necessarily a problem, but if submission '
                        'won''t run double check entry point first: %s',
                        entry_point)
      # Metadata verified
      return metadata
docs: Loads and verifies metadata.
  
      Args:
        submission_type: type of the submission
  
      Returns:
        dictionaty with metadata or None if metadata not found or invalid