def METHOD_NAME(
    self, path_from_pytorch, unique_identifier, offset=2, short_snippet=False
):
    r"""
    This function reads in the code from the docs given a unique identifier.
    Most code snippets have a 2 space indentation, for other indentation levels,
    change the offset `arg`. the `short_snippet` arg can be set to allow for testing
    of smaller snippets, the check that this arg controls is used to make sure that
    we are not accidentally only importing a blank line or something.
    """
    def get_correct_path(path_from_pytorch):
        r"""
        Current working directory when CI is running test seems to vary, this function
        looks for docs relative to this test file.
        """
        core_dir = Path(__file__).parent
        assert core_dir.match("test/quantization/core/"), (
            "test_docs.py is in an unexpected location. If you've been "
            "moving files around, ensure that the test and build files have "
            "been updated to have the correct relative path between "
            "test_docs.py and the docs."
        )
        pytorch_root = core_dir.parent.parent.parent
        return pytorch_root / path_from_pytorch
    path_to_file = get_correct_path(path_from_pytorch)
    if path_to_file:
        file = open(path_to_file)
        content = file.readlines()
        # it will register as having a newline at the end in python
        if "\n" not in unique_identifier:
            unique_identifier += "\n"
        assert unique_identifier in content, f"could not find {unique_identifier} in {path_to_file}"
        # get index of first line of code
        line_num_start = content.index(unique_identifier) + 1
        # next find where the code chunk ends.
        # this regex will match lines that don't start
        # with a \n or "  " with number of spaces=offset
        r = r = re.compile("^[^\n," + " " * offset + "]")
        # this will return the line of first line that matches regex
        line_after_code = next(filter(r.match, content[line_num_start:]))
        last_line_num = content.index(line_after_code)
        # remove the first `offset` chars of each line and gather it all together
        code = "".join(
            [x[offset:] for x in content[line_num_start + 1 : last_line_num]]
        )
        # want to make sure we are actually getting some code,
        assert last_line_num - line_num_start > 3 or short_snippet, (
            f"The code in {path_to_file} identified by {unique_identifier} seems suspiciously short:"
            f"\n\n###code-start####\n{code}###code-end####"
        )
        return code
    return None