<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _substitute_default(s, new_value):
 """Replaces the default value in a parameter docstring by a new value. The docstring must conform to the numpydoc style and have the form "something (keyname=<value-to-replace>)" If no matching pattern is found or ``new_value`` is None, return the input untouched. Examples -------- 'int (default=256)' 'nonlin (default = Hardtanh(min_val=1, max_val=2))' """

    if new_value is None:
        return s

    # BB: ideally, I would like to replace the 'default*' group
    # directly but I haven't found a way to do this
    i, j = _get_span(s, pattern=P_DEFAULTS)
    if (i, j) == (-1, -1):
        return s
    return '{}{}{}'.format(s[:i], new_value, s[j:])