code: def main(content: str, file: str) -> int:
      lines = content.splitlines()
      tree = ast.parse(content)
      names = list(_find_names(tree))
      ret = 0
      for node in tree.body:
          if is_misnamed_test_func(node, names, lines[node.lineno - 1]):
              print(
                  f"{file}:{node.lineno}:{node.col_offset} "
                  f"found test function '{node.name}' which does not start with"
                  " 'test'"
              )
              ret = 1
          elif is_misnamed_test_class(
              node, names, lines[node.lineno - 1]
          ):
              print(
                  f"{file}:{node.lineno}:{node.col_offset} "
                  f"found test class '{node.name}' which does not start with"
                  " 'Test'"
              )
              ret = 1
          if (
              isinstance(node, ast.ClassDef)
              and names.count(node.name) == 0
              and PRAGMA not in lines[node.lineno - 1]
          ):
              for _node in node.body:
                  if is_misnamed_test_func(
                      _node, names, lines[_node.lineno - 1]
                  ):
                      # It could be that this function is used somewhere by the
                      # parent class. For example, there might be a base class
                      # with
                      #
                      # class Foo:
                      #     def foo(self):
                      #          assert 1+1==2
                      #     def test_foo(self):
                      #         self.foo()
                      #
                      # and then some subclass overwrites `foo`. So, we check
                      # that `self.foo` doesn't appear in any of the test
                      # classes. Note some false negatives might get through,
                      # but that's OK. This is good enough that has helped
                      # identify several examples of tests not being run.
                      should_continue = False
                      for _file in itertools.chain(
                          Path("scipy").rglob("**/tests/**/test*.py"),
                          ["scipy/_lib/_testutils.py"],
                      ):
                          with open(os.path.join(_file)) as fd:
                              _content = fd.read()
                          if f"self.{_node.name}" in _content:
                              should_continue = True
                              break
                      if should_continue:
                          continue
  
                      print(
                          f"{file}:{_node.lineno}:{_node.col_offset} "
                          f"found test function '{_node.name}' which does not "
                          "start with 'test'"
                      )
                      ret = 1
      return ret
  
file_path: scipy/tools/check_test_name.py
imports: from __future__ import annotations
  import ast
  import os
  from pathlib import Path
  import sys
  from collections.abc import Iterator, Sequence
  import itertools
label_desc: Use image node_id 5 for calling a global function with example usage: main(content, file) and returns: ret