<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loc(lexer: Lexer, start_token: Token) -> Optional[Location]: """Return a location object. Used to identify the place in the source that created a given parsed object. """

    if not lexer.no_location:
        end_token = lexer.last_token
        source = lexer.source
        return Location(
            start_token.start, end_token.end, start_token, end_token, source
        )
    return None