<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def validate_name(err, value, source):
    'Tests a manifest name value for trademarks.'

    ff_pattern = re.compile('(mozilla|firefox)', re.I)

    err.metadata['name'] = value

    if ff_pattern.search(value):
        err.warning(
            ('metadata_helpers', '_test_name', 'trademark'),
            'Add-on has potentially illegal name.',
            'Add-on names cannot contain the Mozilla or Firefox '
            'trademarks. These names should not be contained in add-on '
            'names if at all possible.',
            source)