<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_cwl_record(d):
 """Check if an input is a CWL record, from any level of nesting. """

    if isinstance(d, dict):
        if d.get("type") == "record":
            return d
        else:
            recs = list(filter(lambda x: x is not None, [is_cwl_record(v) for v in d.values()]))
            return recs[0] if recs else None
    else:
        return None