<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _copy_to_configdir(items, out_dir, args):
 """Copy configuration files like PED inputs to working config directory. """

    out = []
    for item in items:
        ped_file = tz.get_in(["metadata", "ped"], item)
        if ped_file and os.path.exists(ped_file):
            ped_config_file = os.path.join(out_dir, "config", os.path.basename(ped_file))
            if not os.path.exists(ped_config_file):
                shutil.copy(ped_file, ped_config_file)
            item["metadata"]["ped"] = ped_config_file
        out.append(item)
    if hasattr(args, "systemconfig") and args.systemconfig:
        shutil.copy(args.systemconfig, os.path.join(out_dir, "config", os.path.basename(args.systemconfig)))
    return out