code: def from_dict(cls, obj, **kwargs):
          
          _origin = _pop_origin(kwargs)
  
          if isinstance(obj, string):
              obj = {'source': obj}
  
          cls._check_keys(obj)
          if _origin:
              if 'source' not in obj:
                  raise context.TypeError("parameter 'source' is required but "
                                          "wasn't provided")
              obj = dict(obj)
              obj['source'] = cls._normpath(obj['source'], _origin)
          return cls(**obj)
docs: Create an instance from a dict.
  
          Keys in the dict should match parameter names