code: def is_contiguous_general(func, *args, **kwargs):
      from torch._prims_common import is_contiguous_for_memory_format
  
      _, new_kwargs = normalize_function(
          func,
          args=args,
          kwargs=kwargs,
          normalize_to_only_use_kwargs=True,
      )
      inp = new_kwargs.pop("input")
  
      # If created from narrow() check for lengths
      if inp.lengths() is not None:
          return False
  
      # If jagged dim is not 1 it's not contiguous
      if inp._ragged_idx != 1:
          return False
  
      new_kwargs["memory_format"] = new_kwargs.get(
          "memory_format", torch.contiguous_format
      )
      if new_kwargs["memory_format"] == torch.preserve_format:
          return True
      return is_contiguous_for_memory_format(inp.values(), **new_kwargs)
  
imports: import functools
  import math
  import operator
  import torch
  from torch.nested._internal.sdpa import jagged_scaled_dot_product_attention
  from .nested_tensor import NestedTensor
  from typing import *
  from torch.fx.operator_schemas import normalize_function
label_desc: Use image node_id 17 for calling a global function with example usage: is_contiguous_general(func) and returns: is_contiguous_for_memory_format, False, False, True