as_extent function

Convert an object to an extent