code: def get_offset_with_default(cursor=None, default_offset=0):
      '''
      Given an optional cursor and a default offset, returns the offset
      to use; if the cursor contains a valid offset, that will be used,
      otherwise it will be the default.
      '''
      if not is_str(cursor):
          return default_offset
  
      offset = cursor_to_offset(cursor)
      try:
          return int(offset)
      except:
          return default_offsef get_offset_with_default(cursor=None, default_offset=0):
      '''
      Given an optional cursor and a default offset, returns the offset
      to use; if the cursor contains a valid offset, that will be used,
      otherwise it will be the default.
      '''
      if not is_str(cursor):
          return default_offset
  
      offset = cursor_to_offset(cursor)
      try:
          return int(offset)
      except:
          return default_offset
docs: Given an optional cursor and a default offset, returns the offset
      to use; if the cursor contains a valid offset, that will be used,
      otherwise it will be the default.