def METHOD_NAME(self, submission_path):
    assignment_name = False
    ext = os.path.splitext(submission_path)[1].lower()
    if ext == ".ipynb":
        nb = nbf.read(submission_path, as_version=nbf.NO_CONVERT)
        assignment_name = self.get_notebook_assignment_name(nb)
    elif ext == ".rmd":
        assignment_name = None
        with open(submission_path) as f:
            rmd = f.read()
        config = re.match(RMD_YAML_REGEX, rmd)
        if config:
            config = config.group(1)
            assignment_name = yaml.full_load(config).get("assignment_name", None)
    if assignment_name is not False:
        self.validate_assignment_name(assignment_name)