code: def _get_dir_size_and_count(
      source_dir: str, prefix: Optional[str] = None
  ) -> Tuple[int, int]:
      """Get size and file count of a directory.
  
      Parameters
      ----------
      source_dir: str
          Directory path
  
      Returns
      -------
      Tuple[int, int]
          Size in megabytes and file count
  
      """
      size = 0
      count = 0
      for root, _, files in os.walk(source_dir, topdown=True):
          for f in files:
              if prefix and not f.startswith(prefix):
                  continue
  
              full_path = os.path.join(root, f)
              size += os.path.getsize(full_path)
              count += 1
  
      return (size, count)
  
file_path: pytorch-lightning/src/lightning/app/source_code/tar.py
imports: import math
  import os
  import subprocess
  import tarfile
  from dataclasses import dataclass
  from typing import Optional, Tuple
  import click
label_desc: Use image node_id 1 for calling a global function with example usage: _get_dir_size_and_count(source_dir, prefix) and returns: size,  count