Convert a tuple representing a context into a dict of (key, value) pairs

def ContextTupleToDict(context):
    """Convert a tuple representing a context into a dict of (key, value) pairs
    """
    d = {}
    if not context:
      return d
    for k, v in zip(ExceptionWithContext.CONTEXT_PARTS, context):
      if v != '' and v != None:  # Don't ignore int(0), a valid row_num
        d[k] = v
    return d