docstr: Creates a codeblock.
docstr_tok: ["Creates","a","codeblock","."]
code: def _code_block(self, lines):
      """Creates a codeblock."""
      # Remove right trailing whitespace so we can detect the comments.
      lines = [x.rstrip() for x in lines]
      highlight = lambda x: x.endswith("#!")
      code = map(
          lambda x: x[:-2].rstrip() if highlight(x) else x, lines
      )
      highlights = [
          i + 1 for i in range(len(lines)) if highlight(lines[i])
      ]
      highlights = ",".join(str(i) for i in highlights)
  
      directive = [".. code-block:: python"]
      if highlights:
          directive += [f"  :emphasize-lines: {highlights}"]
  
      # Indent code and add empty line so the code is picked up by the directive.
      return directive + [""] + list(map(lambda x: "  " + x, code))
  
file_path: flax/docs/_ext/codediff.py
imports: from typing import List, Tuple
  import sphinx
  from docutils import nodes
  from docutils.parsers.rst import directives
  from docutils.statemachine import ViewList
  from sphinx.util.docutils import SphinxDirective
label_desc: Use image node_id 2 for calling the CodeDiffParser obj's underlying member method code with example usage: obj._code_block(lines) and returns: unknown