def METHOD_NAME(
    self, start_line: int, end_line: int, code_block: dict[str, Any], prefix: str = ""
) -> str | None:
    for block_task in code_block[ResourceType.BLOCK]:
        if block_task[START_LINE] <= start_line <= end_line <= block_task[END_LINE]:
            prefix += f"{ResourceType.BLOCK}."  # with each nested level an extra block prefix is added
            if ResourceType.BLOCK in block_task:
                resource_name = self.METHOD_NAME(
                    start_line=start_line,
                    end_line=end_line,
                    code_block=block_task,
                    prefix=prefix,
                )
                if resource_name is not None:
                    return resource_name
            return generate_task_name(task=block_task, prefix=prefix)
    return None