docstr: Detect if pip is being imported in a build script. Ref #2355.
docstr_tok: ["Detect","if","pip","is","being","imported","in","a","build","script",".","Ref","#","2355","."]
code: def pip_imported_during_build(cls):
      """
      Detect if pip is being imported in a build script. Ref #2355.
      """
      import traceback
  
      return any(
          cls.frame_file_is_setup(frame)
          for frame, line in traceback.walk_stack(None)
      )
  
imports: import sys
  import os
label_desc: Use image node_id 5 for calling the DistutilsMetaFinder obj's underlying member method code with example usage: obj.pip_imported_during_build(cls) and returns: any