def METHOD_NAME(name, netlist, constraints):
    example = MY_DIR / name
    if example.exists() and example.is_dir():
        shutil.rmtree(example)
    example.mkdir(parents=True)
    with open(example / f'{name}.sp', 'w') as fp:
        fp.write(netlist)
    if isinstance(constraints, dict):
        for k, v in constraints.items():
            with open(example / f'{k}.const.json', 'w') as fp:
                fp.write(json.dumps(v, indent=2))
    else:
        with open(example / f'{name}.const.json', 'w') as fp:
            fp.write(json.dumps(constraints, indent=2))
    return example