class_docstr: Walks node and collect string comments looking for OpenMP directives.
class_docstr_tok: ["Walks","node","and","collect","string","comments","looking","for","OpenMP","directives","."]
docstr: Generic method called for visit_XXXX() with XXXX in
  GatherOMPData.statements list
docstr_tok: ["Generic","method","called","for","visit_XXXX","(",")","with","XXXX","in","GatherOMPData.statements","list"]
code: def attach_data(self, node):
      """Generic method called for visit_XXXX() with XXXX in
      GatherOMPData.statements list
  
      """
      if self.current:
          for curr in self.current:
              md = OMPDirective(curr)
              metadata.add(node, md)
          self.current = list()
      # add a Pass to hold some directives
      for field_name, field in ast.iter_fields(node):
          if field_name in GatherOMPData.statement_lists:
              if (
                  field
                  and isinstance(field[-1], ast.Expr)
                  and self.isompdirective(field[-1].value)
              ):
                  field.append(ast.Pass())
      self.generic_visit(node)
  
      # add an If to hold scoping OpenMP directives
      directives = metadata.get(node, OMPDirective)
      field_names = {n for n, _ in ast.iter_fields(node)}
      has_no_scope = field_names.isdisjoint(
          GatherOMPData.statement_lists
      )
      if directives and has_no_scope:
          # some directives create a scope, but the holding stmt may not
          # artificially create one here if needed
          sdirective = "".join(d.s for d in directives)
          scoping = ("parallel", "task", "section")
          if any(s in sdirective for s in scoping):
              metadata.clear(node, OMPDirective)
              node = ast.If(ast.Constant(1, None), [node], [])
              for directive in directives:
                  metadata.add(node, directive)
  
      return node
  
file_path: catboost/contrib/python/pythran/pythran/openmp.py
imports: from pythran.passmanager import Transformation
  import pythran.metadata
  from pythran.spec import parse_pytypes
  from pythran.types.conversion import pytype_to_ctype
  from pythran.utils import isstr
  from gast import AST
  import gast
  import re
label_desc: Use image node_id 5 for calling the GatherOMPData obj's underlying member method code with example usage: obj.attach_data(node) and returns: node