<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_args(args, extra=False):
 """ Encode a list of arguments """

    if not args:
        return ''

    methodargs = ', '.join([encode(a) for a in args])
    if extra:
        methodargs += ', '

    return methodargs