def constructor_copy(obj, cls, **kw):

    names = get_cls_kwargs(cls)
    kw.update((k, obj.__dict__[k]) for k in names if k in obj.__dict__)
    return cls(**kw)
Instantiate cls using the __dict__ of obj as constructor arguments.
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/util/langhelpers.py/constructor_copy