<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_checksum(sentence):
 """Calculate a NMEA 0183 checksum for the given sentence. NMEA checksums are a simple XOR of all the characters in the sentence between the leading "$" symbol, and the "*" checksum separator. Args: sentence (str):
 NMEA 0183 formatted sentence """

    if sentence.startswith('$'):
        sentence = sentence[1:]
    sentence = sentence.split('*')[0]
    return reduce(xor, map(ord, sentence))