code: def TSKVolumeGetBytesPerSector(tsk_volume):
    
    # Note that because pytsk3.Volume_Info does not explicitly defines info
    # we need to check if the attribute exists and has a value other
    # than None. Default to 512 otherwise.
    if hasattr(tsk_volume, 'info') and tsk_volume.info is not None:
      block_size = getattr(tsk_volume.info, 'block_size', 512)
    else:
      block_size = 512
  
    return block_size
docs: Retrieves the number of bytes per sector from a TSK volume object.
  
    Args:
      tsk_volume (pytsk3.Volume_Info): TSK volume information.
  
    Returns:
      int: number of bytes per sector or 512 by default.