<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def json_description_metadata(description):
 """Return metatata from JSON formated image description as dict. Raise ValuError if description is of unknown format. {'shape': [256, 256, 3], 'axes': 'YXS'} {'shape': (256, 256, 3)} """

    if description[:6] == 'shape=':
        # old-style 'shaped' description; not JSON
        shape = tuple(int(i) for i in description[7:-1].split(','))
        return dict(shape=shape)
    if description[:1] == '{' and description[-1:] == '}':
        # JSON description
        return json.loads(description)
    raise ValueError('invalid JSON image description', description)