def crop(self, extent, copy=False):
try:<EOL><INDENT>if extent[<NUM_LIT:0>] is None:<EOL><INDENT>extent = (self.start.z, extent[<NUM_LIT:1>])<EOL><DEDENT>if extent[<NUM_LIT:1>] is None:<EOL><INDENT>extent = (extent[<NUM_LIT:0>], self.stop.z)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>m = "<STR_LIT>"<EOL>m += "<STR_LIT>"<EOL>raise StriplogError(m)<EOL><DEDENT>first_ix = self.read_at(extent[<NUM_LIT:0>], index=True)<EOL>last_ix = self.read_at(extent[<NUM_LIT:1>], index=True)<EOL>first = self[first_ix].split_at(extent[<NUM_LIT:0>])[<NUM_LIT:1>]<EOL>last = self[last_ix].split_at(extent[<NUM_LIT:1>])[<NUM_LIT:0>]<EOL>new_list = self.__list[first_ix:last_ix+<NUM_LIT:1>].copy()<EOL>new_list[<NUM_LIT:0>] = first<EOL>new_list[-<NUM_LIT:1>] = last<EOL>if copy:<EOL><INDENT>return Striplog(new_list)<EOL><DEDENT>else:<EOL><INDENT>self.__list = new_list<EOL>return<EOL><DEDENT>
Crop to a new depth range.

Args:
    extent (tuple): The new start and stop depth. Must be 'inside'
        existing striplog.
    copy (bool): Whether to operate in place or make a copy.

Returns:
    Operates in place by deault; if copy is True, returns a striplog.