<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cwlout(key, valtype=None, extensions=None, fields=None, exclude=None):
 """Definition of an output variable, defining the type and associated secondary files. """

    out = {"id": key}
    if valtype:
        out["type"] = valtype
    if fields:
        out["fields"] = fields
    if extensions:
        out["secondaryFiles"] = extensions
    if exclude:
        out["exclude"] = exclude
    return out