docs: def from_str(cls, s):
          """Construct an import object from a string."""
          ast_obj = ast.parse(s).body[0]
          if not isinstance(ast_obj, cls._expected_ast_type):
              raise AssertionError(
                  'Expected ast of type {!r} but got {!r}'.format(
                      cls._expected_ast_type,
                      ast_obj
                  )
              )
          return cls(ast_obj)