'Metadata inheritance can be done purely through XBlocks, but in the import phase
a root block with an InheritanceKeyValueStore is assumed to be at the top of the hierarchy.
This should change in the future, but as XBlocks don\'t have this KVS, we have to patch it
here manually.'

@staticmethod
def patch_descriptor_kvs(library_descriptor):

    init_dict = {key: getattr(library_descriptor, key) for key in library_descriptor.fields.keys()}
    lazy.invalidate(library_descriptor, '_unwrapped_field_data')
    library_descriptor._field_data = inheriting_field_data(InheritanceKeyValueStore(init_dict))
