def _get_origin(event):
if event.preferred_origin() is not None:<EOL><INDENT>origin = event.preferred_origin()<EOL><DEDENT>elif len(event.origins) > <NUM_LIT:0>:<EOL><INDENT>origin = event.origins[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>raise IndexError('<STR_LIT>')<EOL><DEDENT>return origin<EOL>
Get the origin of an event.

:type event: :class:`obspy.core.event.Event`
:param event: Event to get the origin of.
:return: :class:`obspy.core.event.Origin`