<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loads( source ):
 """Load json structure from meliae from source Supports only the required structures to support loading meliae memory dumps """

    source = source.strip()
    assert source.startswith( '{' )
    assert source.endswith( '}' )
    source = source[1:-1]
    result = {}
    for match in attr.finditer( source ):
        key = match.group('key')
        if match.group( 'list' ) is not None:
            value = [ 
                int(x) 
                for x in match.group( 'list' ).strip().replace(',',' ').split() 
            ]
        elif match.group( 'int' ) is not None:
            value = int( match.group( 'int' ))
        elif match.group( 'string' ) is not None:
            def deescape( match ):
                return unichr( int( match.group(0)[2:], 16 ))
            value = match.group('string').decode( 'utf-8' )
            value = escape.sub( 
                deescape,
                value,
            )
            value = simple_escape.sub(
                lambda x: x.group(1),
                value,
            )
        else:
            raise RuntimeError( "Matched something we don't know how to process:", match.groupdict() )
        result[key] = value
    return result