class_docstr: Custom handler to filter out logging from code outside of
  Megatron Core, and dump to stdout.
class_docstr_tok: ["Custom","handler","to","filter","out","logging","from","code","outside","of","Megatron","Core",",","and","dump","to","stdout","."]
code: def filter(self, record: LogRecord) -> bool:
      # Prevent log entries that come from the blacklisted modules
      # through (e.g., PyTorch Distributed).
      for blacklisted_module in BLACKLISTED_MODULES:
          if record.name.startswith(blacklisted_module):
              return False
      return True
  
imports: import sys
  from logging import LogRecord, StreamHandler
label_desc: Use image node_id 2 for calling the CustomHandler obj's underlying member method code with example usage: obj.filter(record) and returns: True, False