<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _inject_args(sig, types):
 """ A function to inject arguments manually into a method signature before it's been parsed. If using keyword arguments use 'kw=type' instead in the types array. sig the string signature types a list of types to be inserted Returns the altered signature. """

    if '(' in sig:
        parts = sig.split('(')
        sig = '%s(%s%s%s' % (
            parts[0], ', '.join(types),
            (', ' if parts[1].index(')') > 0 else ''), parts[1])
    else:
        sig = '%s(%s)' % (sig, ', '.join(types))
    return sig