code: def from_dict(cls, d):
          
          def _lnk(o):
              return None if o is None else Lnk.charspan(o['from'], o['to'])
          def _ep(ep):
              return ElementaryPredication(
                  nodeid=None,
                  pred=Pred.surface_or_abstract(ep['predicate']),
                  label=ep['label'],
                  args=ep.get('arguments', {}),
                  lnk=_lnk(ep.get('lnk')),
                  surface=ep.get('surface'),
                  base=ep.get('base')
              )
          eps = [_ep(rel) for rel in d.get('relations', [])]
          hcons = [(c['high'], c['relation'], c['low'])
                   for c in d.get('constraints', []) if 'high' in c]
          icons = [(c['high'], c['relation'], c['low'])
                   for c in d.get('constraints', []) if 'left' in c]
          variables = {var: list(data.get('properties', {}).items())
                       for var, data in d.get('variables', {}).items()}
          return cls(
              top=d.get('top'),
              index=d.get('index'),
              xarg=d.get('xarg'),
              rels=eps,
              hcons=hcons,
              icons=icons,
              lnk=_lnk(d.get('lnk')),
              surface=d.get('surface'),
              identifier=d.get('identifier'),
              vars=variables
          )
docs: Decode a dictionary, as from :meth:`to_dict`, into an Mrs object.