def retrieveBoilerplateFile(self, name, group=None, status=None, error=True):
    # Looks in three locations, in order:
    # the folder the spec source is in, the group's boilerplate folder, and the generic boilerplate folder.
    # In each location, it first looks for the file specialized on status, and then for the generic file.
    # Filenames must be of the format NAME.include or NAME-STATUS.include
    if group is None and self.md.group is not None:
        group = self.md.group.lower()
    if status is None:
        status = self.md.status

    localFolder = os.path.dirname(os.path.abspath(self.inputSource))
    includeFolder = os.path.join(config.scriptPath, "include")
    statusFile = "{0}-{1}.include".format(name, status)
    genericFile = "{0}.include".format(name)
    filenames = []
    filenames.append(os.path.join(localFolder, statusFile))
    filenames.append(os.path.join(localFolder, genericFile))
    if group:
        filenames.append(os.path.join(includeFolder, group, statusFile))
        filenames.append(os.path.join(includeFolder, group, genericFile))
    filenames.append(os.path.join(includeFolder, statusFile))
    filenames.append(os.path.join(includeFolder, genericFile))

    for filename in filenames:
        if os.path.isfile(filename):
            try:
                with io.open(filename, 'r', encoding="utf-8") as fh:
                    return fh.read()
            except __HOLE__:
                if error:
                    die("The include file for {0} disappeared underneath me.", name)
                return ""
            break
    else:
        if error:
            die("Couldn't find an appropriate include file for the {0} inclusion, given group='{1}' and status='{2}'.", name, group, status)
        return ""
dataset/ETHPy150Open tabatkins/bikeshed/bikeshed/config.py/retrieveBoilerplateFile