def METHOD_NAME(value, block_id):
    if not value:
        return None
    value = value.strip()
    if not (value.startswith('${') and value.endswith('}')):
        raise ValueError(
            '{} is not a mako substitution in {}'.format(value, block_id))
    return value[2:-1].strip()