<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_expanded(request, key):
 """ Examines request object to return boolean of whether passed field is expanded. """

    expand = request.query_params.get("expand", "")
    expand_fields = []

    for e in expand.split(","):
        expand_fields.extend([e for e in e.split(".")])

    return "~all" in expand_fields or key in expand_fields