gurudesh/pytracebugs huggingface dataset:
# Buggy code
def __init__(self, **params: Any) -> None:
    self.params = params
    self.config: Optional[DictConfig] = None
    self.config_loader: Optional[ConfigLoader] = None
    self.task_function: Optional[TaskFunction] = None
    self.sweep_configs: Optional[TaskFunction] = None


# Traceback (TypeError)
Traceback (most recent call last):
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/hydra/_internal/utils.py", line 196, in run_and_report
return func()
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/hydra/_internal/utils.py", line 356, in <lambda>
overrides=args.overrides,
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 137, in multirun
return sweeper.sweep(arguments=task_overrides)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/hydra/_internal/core_plugins/basic_sweeper.py", line 154, in sweep
results = self.launcher.launch(batch, initial_job_idx=initial_job_idx)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/hydra_plugins/hydra_submitit_launcher/submitit_launcher.py", line 122, in launch
executor.update_parameters(**params)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/submitit/core/core.py", line 638, in update_parameters
self._internal_update_parameters(**kwargs)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/submitit/auto/auto.py", line 197, in _internal_update_parameters
self._executor._internal_update_parameters(**parameters)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/submitit/slurm/slurm.py", line 307, in _internal_update_parameters
_make_sbatch_string(command="nothing to do", folder=self.folder, **kwargs)
File "/home/gridsan/JU17693/.conda/envs/raiden-release/lib/python3.7/site-packages/submitit/slurm/slurm.py", line 490, in _make_sbatch_string
lines += ["", "# setup"] + setup
TypeError: can only concatenate list (not "ListConfig") to list

# Fixed code
def __init__(self, **params: Any) -> None:
    self.params = {}
    for k, v in params.items():
        if OmegaConf.is_config(v):
            v = OmegaConf.to_container(v, resolve=True)
        self.params[k] = v

    self.config: Optional[DictConfig] = None
    self.config_loader: Optional[ConfigLoader] = None
    self.task_function: Optional[TaskFunction] = None
    self.sweep_configs: Optional[TaskFunction] = None
# Buggy code
def launch(
    self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int
) -> Sequence[JobReturn]:
    setup_globals()
    assert self.config is not None
    assert self.task_function is not None
    assert self.config_loader is not None

    configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    sweep_dir = self.config.hydra.sweep.dir
    Path(str(sweep_dir)).mkdir(parents=True, exist_ok=True)
    log.info(f"Launching {len(job_overrides)} jobs locally")
    runs: List[JobReturn] = []
    for idx, overrides in enumerate(job_overrides):
        idx = initial_job_idx + idx
        lst = " ".join(filter_overrides(overrides))
        log.info(f"\t#{idx} : {lst}")
        sweep_config = self.config_loader.load_sweep_config(
            self.config, list(overrides)
        )
        with open_dict(sweep_config):
            sweep_config.hydra.job.id = idx
            sweep_config.hydra.job.num = idx
        HydraConfig.instance().set_config(sweep_config)
        ret = run_job(
            config=sweep_config,
            task_function=self.task_function,
            job_dir_key="hydra.sweep.dir",
            job_subdir_key="hydra.sweep.subdir",
        )
        runs.append(ret)
        configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    return runs


# Traceback (omegaconf.errors.ConfigKeyError)
Traceback (most recent call last):
File "/home/omry/dev/hydra/examples/configure_hydra/job_name/with_config_file_override.py", line 10, in experiment
print(HydraConfig.get().job_logging.handlers.file.filename)
omegaconf.errors.ConfigKeyError: str interpolation key 'hydra.job.name' not found
full_key: hydra.job_logging.handlers.file.filename
reference_type=Any
object_type=dict

# Fixed code
def launch(
    self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int
) -> Sequence[JobReturn]:
    setup_globals()
    assert self.config is not None
    assert self.task_function is not None
    assert self.config_loader is not None

    configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    sweep_dir = self.config.hydra.sweep.dir
    Path(str(sweep_dir)).mkdir(parents=True, exist_ok=True)
    log.info(f"Launching {len(job_overrides)} jobs locally")
    runs: List[JobReturn] = []
    for idx, overrides in enumerate(job_overrides):
        idx = initial_job_idx + idx
        lst = " ".join(filter_overrides(overrides))
        log.info(f"\t#{idx} : {lst}")
        sweep_config = self.config_loader.load_sweep_config(
            self.config, list(overrides)
        )
        with open_dict(sweep_config):
            sweep_config.hydra.job.id = idx
            sweep_config.hydra.job.num = idx
        ret = run_job(
            config=sweep_config,
            task_function=self.task_function,
            job_dir_key="hydra.sweep.dir",
            job_subdir_key="hydra.sweep.subdir",
        )
        runs.append(ret)
        configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    return runs
# Buggy code
def run(
    self,
    config_name: Optional[str],
    task_function: TaskFunction,
    overrides: List[str],
    with_log_configuration: bool = True,
) -> JobReturn:
    cfg = self.compose_config(
        config_name=config_name,
        overrides=overrides,
        with_log_configuration=with_log_configuration,
        run_mode=RunMode.RUN,
    )
    HydraConfig.instance().set_config(cfg)

    return run_job(
        config=cfg,
        task_function=task_function,
        job_dir_key="hydra.run.dir",
        job_subdir_key=None,
        configure_logging=with_log_configuration,
    )


# Traceback (omegaconf.errors.ConfigKeyError)
Traceback (most recent call last):
File "/home/omry/dev/hydra/examples/configure_hydra/job_name/with_config_file_override.py", line 10, in experiment
print(HydraConfig.get().job_logging.handlers.file.filename)
omegaconf.errors.ConfigKeyError: str interpolation key 'hydra.job.name' not found
full_key: hydra.job_logging.handlers.file.filename
reference_type=Any
object_type=dict

# Fixed code
def run(
    self,
    config_name: Optional[str],
    task_function: TaskFunction,
    overrides: List[str],
    with_log_configuration: bool = True,
) -> JobReturn:
    cfg = self.compose_config(
        config_name=config_name,
        overrides=overrides,
        with_log_configuration=with_log_configuration,
        run_mode=RunMode.RUN,
    )

    return run_job(
        config=cfg,
        task_function=task_function,
        job_dir_key="hydra.run.dir",
        job_subdir_key=None,
        configure_logging=with_log_configuration,
    )
# Buggy code
def multirun(
    self,
    config_name: Optional[str],
    task_function: TaskFunction,
    overrides: List[str],
    with_log_configuration: bool = True,
) -> Any:
    # Initial config is loaded without strict (individual job configs may have strict).
    cfg = self.compose_config(
        config_name=config_name,
        overrides=overrides,
        strict=False,
        with_log_configuration=with_log_configuration,
        run_mode=RunMode.MULTIRUN,
    )
    HydraConfig.instance().set_config(cfg)

    sweeper = Plugins.instance().instantiate_sweeper(
        config=cfg, config_loader=self.config_loader, task_function=task_function
    )
    task_overrides = OmegaConf.to_container(cfg.hydra.overrides.task, resolve=False)
    assert isinstance(task_overrides, list)
    return sweeper.sweep(arguments=task_overrides)


# Traceback (omegaconf.errors.ConfigKeyError)
Traceback (most recent call last):
File "/home/omry/dev/hydra/examples/configure_hydra/job_name/with_config_file_override.py", line 10, in experiment
print(HydraConfig.get().job_logging.handlers.file.filename)
omegaconf.errors.ConfigKeyError: str interpolation key 'hydra.job.name' not found
full_key: hydra.job_logging.handlers.file.filename
reference_type=Any
object_type=dict

# Fixed code
def multirun(
    self,
    config_name: Optional[str],
    task_function: TaskFunction,
    overrides: List[str],
    with_log_configuration: bool = True,
) -> Any:
    # Initial config is loaded without strict (individual job configs may have strict).
    cfg = self.compose_config(
        config_name=config_name,
        overrides=overrides,
        strict=False,
        with_log_configuration=with_log_configuration,
        run_mode=RunMode.MULTIRUN,
    )

    sweeper = Plugins.instance().instantiate_sweeper(
        config=cfg, config_loader=self.config_loader, task_function=task_function
    )
    task_overrides = OmegaConf.to_container(cfg.hydra.overrides.task, resolve=False)
    assert isinstance(task_overrides, list)
    return sweeper.sweep(arguments=task_overrides)
# Buggy code
def __init__(self, delegeate: IConfigRepository):
    self.delegate = delegeate
    self.cache: Dict[str, Optional[ConfigResult]] = {}


# Traceback (ValueError)
$ python test.py --config-name=test1
Traceback (most recent call last):
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/utils.py", line 212, in run_and_report
return func()
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/utils.py", line 365, in <lambda>
lambda: hydra.run(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 101, in run
cfg = self.compose_config(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 542, in compose_config
cfg = self.config_loader.load_configuration(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 150, in load_configuration
return self._load_configuration_impl(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 191, in _load_configuration_impl
cfg, composition_trace = self._compose_config_from_defaults_list(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 424, in _compose_config_from_defaults_list
merged = OmegaConf.merge(cfg, loaded.config)
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 355, in merge
target.merge_with(*others[1:])
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/omegaconf/basecontainer.py", line 427, in merge_with
self._format_and_raise(key=None, value=None, cause=e)
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/omegaconf/base.py", line 107, in _format_and_raise
format_and_raise(
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/omegaconf/_utils.py", line 678, in format_and_raise
_raise(ex, cause)
File "/private/home/shubhamgoel/.conda/envs/py3d-implicit/lib/python3.8/site-packages/omegaconf/_utils.py", line 588, in _raise
raise ex  # set end OC_CAUSE=1 for full backtrace
ValueError: HydraConfig was not set
full_key: job.config_name
reference_type=Optional[Dict[Union[str, Enum], Any]]
object_type=dict
full_key:
reference_type=Optional[Dict[Union[str, Enum], Any]]
object_type=dict

# Fixed code
def __init__(self, delegate: IConfigRepository):
    self.delegate = delegate
    self.cache: Dict[str, Optional[ConfigResult]] = {}
# Buggy code
def my_app(cfg: DictConfig) -> None:
    connection = instantiate(cfg.db)
    connection.connect()


# Traceback (RecursionError)
RecursionError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/omegaconf/dictconfig.py in __getattr__(self, key)
294
--> 295             return self._get_impl(key=key, default_value=DEFAULT_VALUE_MARKER)
296         except Exception as e:

1438 frames
RecursionError: maximum recursion depth exceeded

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
KeyError: '_content'

# Fixed code
def my_app(cfg: Config) -> None:
    connection = instantiate(cfg.db)
    connection.connect()
# Buggy code
def my_app(cfg: DictConfig):
    log.info(f"Process ID {os.getpid()} executing task {cfg.task} ...")

    time.sleep(1)


# Traceback (RuntimeError)
$ HYDRA_FULL_ERROR=1 python foo.py
Traceback (most recent call last):
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/hydra/_internal/utils.py", line 198, in run_and_report
return func()
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/hydra/_internal/utils.py", line 336, in <lambda>
overrides=args.overrides,
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 109, in run
job_subdir_key=None,
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/hydra/core/utils.py", line 123, in run_job
ret.return_value = task_function(task_cfg)
File "foo.py", line 7, in main
submitit.JobEnvironment()
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/submitit/core/job_environment.py", line 37, in __new__
return plugins.get_job_environment()
File "/private/home/calebh/miniconda3/envs/bench-detectron2/lib/python3.7/site-packages/submitit/core/plugins.py", line 82, in get_job_environment
f"Could not figure out which environment the job is runnning in. Known environments: {', '.join(envs.keys())}."
RuntimeError: Could not figure out which environment the job is runnning in. Known environments: slurm, local, debug.

# Fixed code
def my_app(cfg: DictConfig):
    env = submitit.JobEnvironment()
    log.info(f"Process ID {os.getpid()} executing task {cfg.task}, with {env}")
    time.sleep(1)
# Buggy code
def lint(session):
    install_dev_deps(session)
    install_hydra(session, ["pip", "install", "-e"])

    apps = _get_standalone_apps_dir()
    session.log("Installing standalone apps")
    for subdir in apps:
        session.chdir(str(subdir))
        session.run(*_black_cmd(), silent=SILENT)
        session.run(*_isort_cmd(), silent=SILENT)
        session.chdir(BASE)

    session.run(*_black_cmd(), silent=SILENT)
    session.run(*_isort_cmd() + ["--skip=plugins", "--skip=.nox"], silent=SILENT)

    session.run("mypy", ".", "--strict", silent=SILENT)
    session.run("flake8", "--config", ".flake8")
    session.run("yamllint", ".")
    # Mypy for examples
    for pyfile in find_files(path="examples", ext=".py"):
        session.run("mypy", pyfile, "--strict", silent=SILENT)


# Traceback (TypeError)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __new__() got multiple values for argument 'cls'

# Fixed code
def lint(session):
    install_dev_deps(session)
    install_hydra(session, ["pip", "install", "-e"])

    apps = _get_standalone_apps_dir()
    session.log("Installing standalone apps")
    for subdir in apps:
        session.chdir(str(subdir))
        session.run(*_black_cmd(), silent=SILENT)
        session.run(*_isort_cmd(), silent=SILENT)
        session.chdir(BASE)

    session.run(*_black_cmd(), silent=SILENT)
    skiplist = apps + ["plugins", ".nox"]
    isort = _isort_cmd() + [f"--skip={skip}" for skip in skiplist]

    session.run(*isort, silent=SILENT)

    session.run("mypy", ".", "--strict", silent=SILENT)
    session.run("flake8", "--config", ".flake8")
    session.run("yamllint", ".")
    # Mypy for examples
    for pyfile in find_files(path="examples", ext=".py"):
        session.run("mypy", pyfile, "--strict", silent=SILENT)
# Buggy code
def experiment(_cfg: DictConfig) -> None:
    hc = HydraConfig.instance()
    assert hc.hydra is not None
    print(hc.hydra.job.name)


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def experiment(_cfg: DictConfig) -> None:
    print(HydraConfig.get().job.name)
# Buggy code
def _get_kwargs(config: Union[ObjectConf, DictConfig], **kwargs: Any) -> Any:
    # copy config to avoid mutating it when merging with kwargs
    config_copy = copy.deepcopy(config)

    # Manually set parent as deepcopy does not currently handles it (https://github.com/omry/omegaconf/issues/130)
    # noinspection PyProtectedMember
    config_copy._set_parent(config._get_parent())  # type: ignore
    config = config_copy

    params = config.params if "params" in config else OmegaConf.create()
    assert isinstance(params, DictConfig), (
        f"Input config params are expected to be a mapping, found {type(config.params).__name__}"
    )
    primitives = {}
    rest = {}
    for k, v in kwargs.items():
        if _utils.is_primitive_type(v) or isinstance(v, (dict, list)):
            primitives[k] = v
        else:
            rest[k] = v
    final_kwargs = {}
    params.merge_with(OmegaConf.create(primitives))
    for k, v in params.items():
        final_kwargs[k] = v

    for k, v in rest.items():
        final_kwargs[k] = v
    return final_kwargs


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def _get_kwargs(config: Union[ObjectConf, DictConfig], **kwargs: Any) -> Any:
    # copy config to avoid mutating it when merging with kwargs
    config_copy = copy.deepcopy(config)

    # Manually set parent as deepcopy does not currently handles it (https://github.com/omry/omegaconf/issues/130)
    # noinspection PyProtectedMember
    config_copy._set_parent(config._get_parent())  # type: ignore
    config = config_copy

    params = config.params if "params" in config else OmegaConf.create()
    assert isinstance(params, DictConfig), (
        f"Input config params are expected to be a mapping, found {type(config.params).__name__}"
    )
    primitives = {}
    rest = {}
    for k, v in kwargs.items():
        if _utils.is_primitive_type(v) or isinstance(v, (dict, list)):
            primitives[k] = v
        else:
            rest[k] = v
    final_kwargs = {}
    with read_write(params):
        params.merge_with(OmegaConf.create(primitives))

    for k, v in params.items():
        final_kwargs[k] = v

    for k, v in rest.items():
        final_kwargs[k] = v
    return final_kwargs
# Buggy code
def __init__(self) -> None:
    self.hydra = None


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def __init__(self) -> None:
    self.cfg: Optional[HydraConf] = None
# Buggy code
def set_config(self, cfg: DictConfig) -> None:
    assert cfg is not None
    self.hydra = copy.deepcopy(cfg.hydra)
    OmegaConf.set_readonly(self.hydra, True)  # type: ignore


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def set_config(self, cfg: DictConfig) -> None:
    assert cfg is not None
    OmegaConf.set_readonly(cfg.hydra, True)
    assert OmegaConf.get_type(cfg, "hydra") == HydraConf
    self.cfg = cfg  # type: ignore
# Buggy code
def get_original_cwd() -> str:
    """
    :return: the original working directory the Hydra application was launched from
    """
    hc = HydraConfig.instance()
    if hc.hydra is None:
        raise ValueError(
            "get_original_cwd() must only be used after HydraConfig is initialized"
        )
    ret = hc.hydra.runtime.cwd
    assert ret is not None and isinstance(ret, str)
    return ret


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def get_original_cwd() -> str:
    """
    :return: the original working directory the Hydra application was launched from
    """
    if not HydraConfig.initialized():
        raise ValueError(
            "get_original_cwd() must only be used after HydraConfig is initialized"
        )
    ret = HydraConfig.get().runtime.cwd
    assert ret is not None and isinstance(ret, str)
    return ret
# Buggy code
def to_absolute_path(path: str) -> str:
    """
    converts the specified path to be absolute path.
    if the input path is relative, it's interpreted as relative to the original working directory
    if it's absolute, it's returned as is
    :param path: path to convert
    :return:
    """
    p = Path(path)
    if HydraConfig.instance().hydra is None:
        base = Path(os.getcwd())
    else:
        base = Path(get_original_cwd())
    if p.is_absolute():
        ret = p
    else:
        ret = base / p
    return str(ret)


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-3c0b668b9ce4> in <module>
----> 1 hydra.utils.to_absolute_path('something')

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in to_absolute_path(path)
77         ret = path
78     else:
---> 79         ret = Path(get_original_cwd()) / path
80     return str(ret)

/opt/conda/lib/python3.7/site-packages/hydra/utils.py in get_original_cwd()
62
63 def get_original_cwd():
---> 64     return HydraConfig().hydra.runtime.cwd
65
66

AttributeError: 'NoneType' object has no attribute 'runtime'

# Fixed code
def to_absolute_path(path: str) -> str:
    """
    converts the specified path to be absolute path.
    if the input path is relative, it's interpreted as relative to the original working directory
    if it's absolute, it's returned as is
    :param path: path to convert
    :return:
    """
    p = Path(path)
    if not HydraConfig.initialized():
        base = Path(os.getcwd())
    else:
        base = Path(get_original_cwd())
    if p.is_absolute():
        ret = p
    else:
        ret = base / p
    return str(ret)
# Buggy code
def multirun(self, config_file, task_function, overrides):
    # Initial config is loaded without strict (individual job configs may have strict).
    cfg = self.compose_config(
        config_file=config_file,
        overrides=overrides,
        strict=False,
        with_log_configuration=True,
    )
    HydraConfig().set_config(cfg)
    sweeper = Plugins.instantiate_sweeper(
        config=cfg,
        config_loader=self.config_loader,
        task_function=task_function,
    )
    task_overrides = cfg.hydra.overrides.task
    return sweeper.sweep(arguments=task_overrides)


# Traceback (TypeError)
Traceback (most recent call last):
File "main.py", line 576, in <module>
main()
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
strict=strict,
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/utils.py", line 183, in run_hydra
hydra.show_cfg(overrides=args.overrides, cfg_type=args.cfg)
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 116, in show_cfg
cfg = self.compose_config(overrides, with_log_configuration=True)
TypeError: compose_config() missing 1 required positional argument: 'overrides'

# Fixed code
def multirun(self, config_file, task_function, overrides):
    # Initial config is loaded without strict (individual job configs may have strict).
    cfg = self.compose_config(
        config_file=config_file,
        overrides=overrides,
        strict=False,
        with_log_configuration=True,
    )
    HydraConfig().set_config(cfg)
    sweeper = Plugins.instantiate_sweeper(
        config=cfg, config_loader=self.config_loader, task_function=task_function
    )
    task_overrides = cfg.hydra.overrides.task
    return sweeper.sweep(arguments=task_overrides)
# Buggy code
def show_cfg(self, overrides, cfg_type):
    assert cfg_type in ["job", "hydra", "all"]
    cfg = self.compose_config(overrides, with_log_configuration=True)
    if cfg_type == "job":
        del cfg["hydra"]
    elif cfg_type == "hydra":
        cfg = self.get_sanitized_hydra_cfg(cfg)
    print(cfg.pretty())


# Traceback (TypeError)
Traceback (most recent call last):
File "main.py", line 576, in <module>
main()
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
strict=strict,
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/utils.py", line 183, in run_hydra
hydra.show_cfg(overrides=args.overrides, cfg_type=args.cfg)
File "/private/home/yannd/.conda/envs/assl/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 116, in show_cfg
cfg = self.compose_config(overrides, with_log_configuration=True)
TypeError: compose_config() missing 1 required positional argument: 'overrides'

# Fixed code
def show_cfg(self, config_file, overrides, cfg_type):
    assert cfg_type in ["job", "hydra", "all"]
    cfg = self.compose_config(
        config_file=config_file, overrides=overrides, with_log_configuration=True
    )
    if cfg_type == "job":
        del cfg["hydra"]
    elif cfg_type == "hydra":
        cfg = self.get_sanitized_hydra_cfg(cfg)
    print(cfg.pretty())
# Buggy code
def get_filename(config_name):
    filename, ext = os.path.splitext(config_name)
    if ext == "":
        ext = ".yaml"
    return "{}{}".format(filename, ext)


# Traceback (hydra.errors.MissingConfigException)
Traceback (most recent call last):
File "app.py", line 9, in <module>
app()
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
strict=strict,
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/utils.py", line 56, in run_hydra
hydra.run(overrides=args.overrides)
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 103, in run
cfg = self._load_config(overrides)
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 345, in _load_config
cfg = self.config_loader.load_configuration(overrides)
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 56, in load_configuration
cfg = self._merge_defaults(hydra_cfg, defaults, split_at)
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 395, in _merge_defaults
cfg = merge_defaults(cfg, user_list)
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 374, in merge_defaults
required=not is_optional,
File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 301, in _merge_config
raise MissingConfigException(msg, new_cfg, options)
hydra.errors.MissingConfigException: Could not load lr/0.1, available options:
lr:
0.01
0.1

# Fixed code
def get_filename(config_name):
    filename, ext = os.path.splitext(config_name)
    if ext not in (".yaml", ".yml"):
        config_name = "{}{}".format(config_name, ".yaml")
    return config_name
# Buggy code
def _apply_free_defaults(self, defaults, overrides):
    consumed = []
    for override in overrides:
        key, value = override.split("=")
        if self.exists_in_search_path(key):
            # Do not add sweep configs into defaults, those will be added to the defaults
            # during sweep when after list is broken into items
            if "," not in value:
                defaults.append({key: value})
                consumed.append(override)

    return consumed


# Traceback (KeyError)
(tutorial_env) dasneha@devfair0254:~/tutorials/hydra$ python my_app.py -m exp=1,2
Traceback (most recent call last):
File "my_app.py", line 7, in <module>
my_app()
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/main.py", line 25, in decorated_main
strict,
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/utils.py", line 52, in run_hydra
hydra.multirun(overrides=args.overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 113, in multirun
cfg = self._load_config(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 259, in _load_config
cfg = self.config_loader.load_configuration(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 66, in load_configuration
cfg.merge_with_dotlist(remaining_overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 240, in merge_with_dotlist
self.update(key, value)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 260, in update
root[last] = value
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 28, in __setitem__
raise KeyError("Accessing unknown key in a struct : {}".format(self.get_full_key(key)))
KeyError: 'Accessing unknown key in a struct : exp'

# Fixed code
def _apply_free_defaults(self, defaults, overrides):
    consumed = []
    for override in overrides:
        key, value = override.split("=")
        if self.exists_in_search_path(key):
            # Do not add multirun configs into defaults, those will be added to the defaults
            # during the runs after list is broken into items
            if "," not in value:
                defaults.append({key: value})
            overrides.remove(override)
            consumed.append(override)

    return consumed
# Buggy code
def sweep(self, arguments):
    self.arguments = arguments
    returns = []
    while not self.is_done():
        batch = self.get_job_batch()
        results = self.launcher.launch(batch)
        returns.append(results)
        self.update_results(results)
    return returns


# Traceback (KeyError)
(tutorial_env) dasneha@devfair0254:~/tutorials/hydra$ python my_app.py -m exp=1,2
Traceback (most recent call last):
File "my_app.py", line 7, in <module>
my_app()
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/main.py", line 25, in decorated_main
strict,
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/utils.py", line 52, in run_hydra
hydra.multirun(overrides=args.overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 113, in multirun
cfg = self._load_config(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 259, in _load_config
cfg = self.config_loader.load_configuration(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 66, in load_configuration
cfg.merge_with_dotlist(remaining_overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 240, in merge_with_dotlist
self.update(key, value)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 260, in update
root[last] = value
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 28, in __setitem__
raise KeyError("Accessing unknown key in a struct : {}".format(self.get_full_key(key)))
KeyError: 'Accessing unknown key in a struct : exp'

# Fixed code
def sweep(self, arguments):
    self.arguments = arguments
    returns = []
    while not self.is_done():
        batch = self.get_job_batch()
        results = self.launcher.launch(batch)
        # TODO: use extend
        returns.append(results)
        self.update_results(results)
    return returns
# Buggy code
def coerce_to_strict(self, const):
    """
    This is used to ultimately *encode* into strict JSON, see `encode`

    """
    # before python 2.7, 'true', 'false', 'null', were include here.
    if const in ("Infinity", "-Infinity", "NaN"):
        return None
    else:
        return const


# Traceback (TypeError)
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/plotly/plotly/plotly.py", line 241, in plot
res = _send_to_plotly(figure, **plot_options)
File "/Library/Python/2.7/site-packages/plotly/plotly/plotly.py", line 1374, in _send_to_plotly
cls=utils.PlotlyJSONEncoder)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 250, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "/Library/Python/2.7/site-packages/plotly/utils.py", line 145, in encode
encoded_o = super(PlotlyJSONEncoder, self).encode(o)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
return _iterencode(o, 0)
File "/Library/Python/2.7/site-packages/plotly/utils.py", line 211, in default
return json.JSONEncoder.default(self, obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Decimal('-94.6285553000') is not JSON serializable

# Fixed code
def coerce_to_strict(self, const):
    """
    This is used to ultimately *encode* into strict JSON, see `encode`

    """
    # before python 2.7, 'true', 'false', 'null', were include here.
    if const in ("Infinity", "-Infinity", "NaN"):
        return None
    # Decimal Fails on Serialization, convert it to float
    elif isinstance(const, decimal.Decimal):
        return float(const)
    else:
        return const
# Buggy code
async def signal_handler(sig):
    print(f"Received shut down signal {sig}")
    if not self._stopping:
        self._stopping = True
        await self.session.shutdown()
        get_event_loop().stop()


# Traceback (tribler_gui.event_request_manager.CoreConnectTimeoutError)
Traceback (most recent call last):
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 138, in <lambda>
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 80, in on_error
tribler_gui.event_request_manager.CoreConnectTimeoutError: Could not connect with the Tribler Core within 60 seconds
[PID:5376] 2020-08-25 15:41:08,656 - ERROR <session:366> Session.unhandled_error_observer(): Unhandled exception occurred! [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e
--LONG TEXT--
Traceback (most recent call last):
File "src\run_tribler.py", line 81, in start_tribler
File "src\tribler-core\tribler_core\session.py", line 397, in start
File "src\tribler-core\tribler_core\restapi\rest_manager.py", line 77, in start
File "lib\site-packages\aiohttp\web_runner.py", line 100, in start
File "lib\asyncio\base_events.py", line 1463, in create_server
OSError: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e

--CONTEXT--
{'message': 'Task exception was never retrieved', 'exception': OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e"), 'future': <Task finished name='Task-1' coro=<start_tribler_core.<locals>.start_tribler() done, defined at src\run_tribler.py:50> exception=OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e")>}

# Fixed code
async def signal_handler(sig):
    print(f"Received shut down signal {sig}")  # noqa: T001
    if not self._stopping:
        self._stopping = True
        await self.session.shutdown()
        get_event_loop().stop()
# Buggy code
def on_core_read_ready(self):
    raw_output = bytes(self.core_process.readAll())
    decoded_output = raw_output.decode(errors="replace")
    if b"Traceback" in raw_output:
        self.core_traceback = decoded_output
        self.core_traceback_timestamp = int(round(time.time() * 1000))
    print(decoded_output.strip())


# Traceback (tribler_gui.event_request_manager.CoreConnectTimeoutError)
Traceback (most recent call last):
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 138, in <lambda>
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 80, in on_error
tribler_gui.event_request_manager.CoreConnectTimeoutError: Could not connect with the Tribler Core within 60 seconds
[PID:5376] 2020-08-25 15:41:08,656 - ERROR <session:366> Session.unhandled_error_observer(): Unhandled exception occurred! [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e
--LONG TEXT--
Traceback (most recent call last):
File "src\run_tribler.py", line 81, in start_tribler
File "src\tribler-core\tribler_core\session.py", line 397, in start
File "src\tribler-core\tribler_core\restapi\rest_manager.py", line 77, in start
File "lib\site-packages\aiohttp\web_runner.py", line 100, in start
File "lib\asyncio\base_events.py", line 1463, in create_server
OSError: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e

--CONTEXT--
{'message': 'Task exception was never retrieved', 'exception': OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e"), 'future': <Task finished name='Task-1' coro=<start_tribler_core.<locals>.start_tribler() done, defined at src\run_tribler.py:50> exception=OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e")>}

# Fixed code
def on_core_read_ready(self):
    raw_output = bytes(self.core_process.readAll())
    decoded_output = raw_output.decode(errors="replace")
    if b"Traceback" in raw_output:
        self.core_traceback = decoded_output
        self.core_traceback_timestamp = int(round(time.time() * 1000))
    print(decoded_output.strip())  # noqa: T001
# Buggy code
def is_tribler_process(name):
    """
    Checks if the given name is of a Tribler processs. It checks a few potential keywords that
    could be present in a Tribler process name across different platforms.
    :param name: Process name
    :return: True if pid is a Tribler process else False
    """
    name = name.lower()
    process_keywords = [
        "usr/bin/python",
        "run_tribler.py",
        "tribler.exe",
        "tribler.sh",
        "Contents/MacOS/tribler",
        "usr/bin/tribler",
    ]
    for keyword in process_keywords:
        if keyword.lower() in name:
            return True
    return False


# Traceback (tribler_gui.event_request_manager.CoreConnectTimeoutError)
Traceback (most recent call last):
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 138, in <lambda>
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 80, in on_error
tribler_gui.event_request_manager.CoreConnectTimeoutError: Could not connect with the Tribler Core within 60 seconds
[PID:5376] 2020-08-25 15:41:08,656 - ERROR <session:366> Session.unhandled_error_observer(): Unhandled exception occurred! [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e
--LONG TEXT--
Traceback (most recent call last):
File "src\run_tribler.py", line 81, in start_tribler
File "src\tribler-core\tribler_core\session.py", line 397, in start
File "src\tribler-core\tribler_core\restapi\rest_manager.py", line 77, in start
File "lib\site-packages\aiohttp\web_runner.py", line 100, in start
File "lib\asyncio\base_events.py", line 1463, in create_server
OSError: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e

--CONTEXT--
{'message': 'Task exception was never retrieved', 'exception': OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e"), 'future': <Task finished name='Task-1' coro=<start_tribler_core.<locals>.start_tribler() done, defined at src\run_tribler.py:50> exception=OSError(10048, "error while attempting to bind on address ('127.0.0.1', 8085): une seule utilisation de chaque adresse de socket (protocole/adresse r�seau/port) est habituellement autoris�e")>}

# Fixed code
def is_tribler_process(name):
    """
    Checks if the given name is of a Tribler processs. It checks a few potential keywords that
    could be present in a Tribler process name across different platforms.
    :param name: Process name
    :return: True if pid is a Tribler process else False
    """
    name = name.lower()
    keywords = ["tribler", "python"]

    return any(keyword in name for keyword in keywords)
# Buggy code
def clicked_menu_button_debug(self, index):
    if not self.debug_window:
        self.debug_window = DebugWindow(self.tribler_settings, self.tribler_version)
    self.debug_window.show()


# Traceback (TypeError)
tribler_gui.utilities.CreationTraceback:
File "/home/<user>/tudelft/release/tribler/src/run_tribler.py", line 175, in <module>
window = TriblerWindow()
File "/home/<user>/tudelft/release/tribler/src/tribler-gui/tribler_gui/tribler_window.py", line 158, in __init__
connect(self.debug_pane_shortcut.activated, self.clicked_menu_button_debug)


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/<user>/tudelft/release/tribler/src/tribler-gui/tribler_gui/utilities.py", line 391, in trackback_wrapper
raise exc from CreationTraceback(traceback_str)
File "/home/<user>/tudelft/release/tribler/src/tribler-gui/tribler_gui/utilities.py", line 388, in trackback_wrapper
callback(*args, **kwargs)
TypeError: clicked_menu_button_debug() missing 1 required positional argument: 'index'

# Fixed code
def clicked_menu_button_debug(self, index=False):
    if not self.debug_window:
        self.debug_window = DebugWindow(self.tribler_settings, self.tribler_version)
    self.debug_window.show()
# Buggy code
def selection_can_be_added_to_channel(self):
    for row in self.table_view.selectionModel().selectedRows():
        data_item = row.model().data_items[row.row()]
        if "type" in data_item and data_item["type"] in (
            REGULAR_TORRENT,
            CHANNEL_TORRENT,
            COLLECTION_NODE,
        ):
            return True
    return False


# Traceback (KeyError)
Traceback (most recent call last):,
File "src\run_tribler.py", line 179, in <module>,
File "src\tribler-gui\tribler_gui\utilities.py", line 382, in trackback_wrapper,
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 116, in on_read_data,
File "src\tribler-gui\tribler_gui\event_request_manager.py", line 77, in tribler_started_event,
File "src\tribler-gui\tribler_gui\utilities.py", line 382, in trackback_wrapper,
File "src\tribler-gui\tribler_gui\tribler_window.py", line 488, in on_tribler_started,
File "src\tribler-gui\tribler_gui\widgets\channelcontentswidget.py", line 124, in initialize_content_page,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 297, in __init__,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 93, in __init__,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 195, in __init__,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 53, in __init__,
tribler_gui.utilities.CreationTraceback,
The above exception was the direct cause of the following exception:,
Traceback (most recent call last):,
File "src\tribler-gui\tribler_gui\utilities.py", line 385, in trackback_wrapper,
File "src\tribler-gui\tribler_gui\utilities.py", line 382, in trackback_wrapper,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 54, in <lambda>,
File "src\tribler-gui\tribler_gui\widgets\triblertablecontrollers.py", line 135, in check_torrent_health,
KeyError: 'infohash'

# Fixed code
def selection_can_be_added_to_channel(self):
    for row in self.table_view.selectionModel().selectedRows():
        data_item = row.model().data_items[row.row()]
        if dict_item_is_any_of(
            data_item, "type", [REGULAR_TORRENT, CHANNEL_TORRENT, COLLECTION_NODE]
        ):
            return True
    return False