gurudesh/pytracebugs huggingface dataset:
# Buggy code
def __init__(self, path):
    super(BadMetricError, self).__init__(
        "'{}' does not exist, not a metric or is malformed".format(
            os.path.relpath(path)
        )
    )


# Traceback (ValueError)
ERROR: failed to pull data from the cloud - path is on mount 'F:', start on mount 'C:'
Traceback (most recent call last):
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\command\data_sync.py", line 46, in
do_run recursive=self.args.recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\pull.py", line 24, in pull
recursive=recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\fetch.py", line 27, in fetch
used, jobs, remote=remote, show_checksums=show_checksums
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\data_cloud.py", line 144, in pull
show_checksums=show_checksums,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 493, in pull
download=True,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 459, in _process
download=download,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 358, in status
local_exists = self.cache_exists(md5s)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in cache_exists
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in <lambda>
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 518, in changed_cache_file
actual = self.get_checksum(cache_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 275, in get_checksum
checksum = self.get_file_checksum(path_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 208, in get_file_checksum
return file_md5(path_info.path)[0]
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\utils\__init__.py", line 48, in file_md5                      logger.info(msg.format(os.path.relpath(fname)))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\ntpath.py", line 584, in relpath
path_drive, start_drive))                                                                                                                        ValueError: path is on mount 'F:', start on mount 'C:'

# Fixed code
def __init__(self, path):
    super(BadMetricError, self).__init__(
        "'{}' does not exist, not a metric or is malformed".format(relpath(path))
    )
# Buggy code
def relpath(self, other):
    return self.__class__(os.path.relpath(fspath_py35(self), fspath_py35(other)))


# Traceback (ValueError)
ERROR: failed to pull data from the cloud - path is on mount 'F:', start on mount 'C:'
Traceback (most recent call last):
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\command\data_sync.py", line 46, in
do_run recursive=self.args.recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\pull.py", line 24, in pull
recursive=recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\fetch.py", line 27, in fetch
used, jobs, remote=remote, show_checksums=show_checksums
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\data_cloud.py", line 144, in pull
show_checksums=show_checksums,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 493, in pull
download=True,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 459, in _process
download=download,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 358, in status
local_exists = self.cache_exists(md5s)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in cache_exists
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in <lambda>
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 518, in changed_cache_file
actual = self.get_checksum(cache_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 275, in get_checksum
checksum = self.get_file_checksum(path_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 208, in get_file_checksum
return file_md5(path_info.path)[0]
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\utils\__init__.py", line 48, in file_md5                      logger.info(msg.format(os.path.relpath(fname)))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\ntpath.py", line 584, in relpath
path_drive, start_drive))                                                                                                                        ValueError: path is on mount 'F:', start on mount 'C:'

# Fixed code
def relpath(self, other):
    return self.__class__(relpath(self, other))
# Buggy code
def relpath(self):
    return os.path.relpath(self.path)


# Traceback (ValueError)
ERROR: failed to pull data from the cloud - path is on mount 'F:', start on mount 'C:'
Traceback (most recent call last):
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\command\data_sync.py", line 46, in
do_run recursive=self.args.recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\pull.py", line 24, in pull
recursive=recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\fetch.py", line 27, in fetch
used, jobs, remote=remote, show_checksums=show_checksums
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\data_cloud.py", line 144, in pull
show_checksums=show_checksums,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 493, in pull
download=True,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 459, in _process
download=download,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 358, in status
local_exists = self.cache_exists(md5s)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in cache_exists
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in <lambda>
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 518, in changed_cache_file
actual = self.get_checksum(cache_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 275, in get_checksum
checksum = self.get_file_checksum(path_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 208, in get_file_checksum
return file_md5(path_info.path)[0]
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\utils\__init__.py", line 48, in file_md5                      logger.info(msg.format(os.path.relpath(fname)))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\ntpath.py", line 584, in relpath
path_drive, start_drive))                                                                                                                        ValueError: path is on mount 'F:', start on mount 'C:'

# Fixed code
def relpath(self):
    return relpath(self.path)
# Buggy code
def __init__(self, args):
    super(CmdCacheDir, self).__init__(args)
    self.config = CacheConfig(self.config)


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def __init__(self, args):
    super(CmdCacheDir, self).__init__(args)
    self.cache_config = CacheConfig(self.config)
# Buggy code
def run(self):
    self.config.set_dir(self.args.value, level=self.args.level)
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    self.cache_config.set_dir(self.args.value, level=self.args.level)
    return 0
# Buggy code
def __init__(self, args):
    super(CmdRemoteConfig, self).__init__(args)
    self.config = RemoteConfig(self.config)


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def __init__(self, args):
    super(CmdRemoteConfig, self).__init__(args)
    self.remote_config = RemoteConfig(self.config)
# Buggy code
def run(self):
    self.config.add(
        self.args.name,
        self.args.url,
        force=self.args.force,
        default=self.args.default,
        level=self.args.level,
    )
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    self.remote_config.add(
        self.args.name,
        self.args.url,
        force=self.args.force,
        default=self.args.default,
        level=self.args.level,
    )
    return 0
# Buggy code
def run(self):
    self.config.remove(self.args.name, level=self.args.level)
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    self.remote_config.remove(self.args.name, level=self.args.level)
    return 0
# Buggy code
def run(self):
    self.config.modify(
        self.args.name,
        self.args.option,
        self.args.value,
        level=self.args.level,
    )
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    self.remote_config.modify(
        self.args.name,
        self.args.option,
        self.args.value,
        level=self.args.level,
    )
    return 0
# Buggy code
def run(self):
    self.config.set_default(
        self.args.name, unset=self.args.unset, level=self.args.level
    )
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    self.remote_config.set_default(
        self.args.name, unset=self.args.unset, level=self.args.level
    )
    return 0
# Buggy code
def run(self):
    for name, url in self.config.list(level=self.args.level).items():
        logger.info("{}\t{}".format(name, url))
    return 0


# Traceback (dvc.config.ConfigError)
Traceback (most recent call last):
File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
load_entry_point('dvc', 'console_scripts', 'dvc')()
File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
Analytics().send_cmd(cmd, args, ret)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
if not Analytics._is_enabled(cmd):
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
enabled = Analytics._is_enabled_config(config)
File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
core = config.config.get(Config.SECTION_CORE, {})
File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
"option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist

# Fixed code
def run(self):
    for name, url in self.remote_config.list(level=self.args.level).items():
        logger.info("{}\t{}".format(name, url))
    return 0
# Buggy code
def walk(self, top, topdown=True, ignore_file_handler=None):
    """Directory tree generator.

    See `os.walk` for the docs. Differences:
    - no support for symlinks
    - it could raise exceptions, there is no onerror argument
    """

    def onerror(e):
        raise e

    for root, dirs, files in dvc_walk(
        top,
        topdown=topdown,
        onerror=onerror,
        ignore_file_handler=ignore_file_handler,
    ):
        yield os.path.normpath(root), dirs, files


# Traceback (dvc.stage.StageFileDoesNotExistError)
dvc metrics show -a -v
ERROR: failed to show metrics - 'data/data-2010-2016.h5.dvc' does not exist.
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/command/metrics.py", line 47, in run
recursive=self.args.recursive,
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/repo/metrics/__init__.py", line 18, in show
return show(self.repo, *args, **kwargs)
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 262, in show
entries = _collect_metrics(self, path, recursive, typ, xpath, branch)
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 168, in _collect_metrics
outs = [out for stage in self.stages() for out in stage.outs]
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/repo/__init__.py", line 398, in stages
stage = Stage.load(self, path)
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/stage.py", line 564, in load
Stage._check_file_exists(repo, fname)
File "/Users/frag/miniconda3/envs/generic-dev/lib/python3.6/site-packages/dvc/stage.py", line 541, in _check_file_exists
raise StageFileDoesNotExistError(fname)
dvc.stage.StageFileDoesNotExistError: 'data/data-2010-2016.h5.dvc' does not exist.
------------------------------------------------------------

Having any troubles?. Hit us up at https://dvc.org/support, we are always happy to help!
DEBUG: Analytics is enabled.
DEBUG: Trying to spawn '['/Users/frag/miniconda3/envs/generic-dev/bin/python', '-m', 'dvc', 'daemon', '-q', 'analytics', '/var/folders/q3/7kp92vs15tjc1gc7413rw5mm0000gn/T/tmp730_03qg']'
DEBUG: Spawned '['/Users/frag/miniconda3/envs/generic-dev/bin/python', '-m', 'dvc', 'daemon', '-q', 'analytics', '/var/folders/q3/7kp92vs15tjc1gc7413rw5mm0000gn/T/tmp730_03qg']'

# Fixed code
def walk(self, top, topdown=True, ignore_file_handler=None):
    """Directory tree generator.

    See `os.walk` for the docs. Differences:
    - no support for symlinks
    - it could raise exceptions, there is no onerror argument
    """

    def onerror(e):
        raise e

    for root, dirs, files in dvc_walk(
        os.path.abspath(top),
        topdown=topdown,
        onerror=onerror,
        ignore_file_handler=ignore_file_handler,
    ):
        yield os.path.normpath(root), dirs, files
# Buggy code
def __init__(self, root_dir=None):
    from dvc.config import Config
    from dvc.state import State
    from dvc.lock import Lock
    from dvc.scm import SCM
    from dvc.cache import Cache
    from dvc.data_cloud import DataCloud
    from dvc.updater import Updater
    from dvc.repo.metrics import Metrics
    from dvc.repo.tree import WorkingTree

    root_dir = self.find_root(root_dir)

    self.root_dir = os.path.abspath(os.path.realpath(root_dir))
    self.dvc_dir = os.path.join(self.root_dir, self.DVC_DIR)

    self.config = Config(self.dvc_dir)

    self.tree = WorkingTree()

    self.scm = SCM(self.root_dir, repo=self)
    self.lock = Lock(self.dvc_dir)
    # NOTE: storing state and link_state in the repository itself to avoid
    # any possible state corruption in 'shared cache dir' scenario.
    self.state = State(self, self.config.config)

    core = self.config.config[Config.SECTION_CORE]

    logger.set_level(core.get(Config.SECTION_CORE_LOGLEVEL))

    self.cache = Cache(self)
    self.cloud = DataCloud(self, config=self.config.config)
    self.updater = Updater(self.dvc_dir)

    self.metrics = Metrics(self)

    self._ignore()

    self.updater.check()


# Traceback (ImportError)
python -c "import dvc.scm"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "dvc/scm/__init__.py", line 6, in <module>
from dvc.scm.git import Git
File "dvc/scm/git/__init__.py", line 15, in <module>
from dvc.scm.git.tree import GitTree
File "dvc/scm/git/tree.py", line 6, in <module>
from dvc.repo.tree import BaseTree
File "dvc/repo/__init__.py", line 10, in <module>
class Repo(object):
File "dvc/repo/__init__.py", line 15, in Repo
from dvc.repo.add import add
File "dvc/repo/add.py", line 3, in <module>
from dvc.scm import scm_context
ImportError: cannot import name scm_context

# Fixed code
def __init__(self, root_dir=None):
    from dvc.config import Config
    from dvc.state import State
    from dvc.lock import Lock
    from dvc.scm import SCM
    from dvc.cache import Cache
    from dvc.data_cloud import DataCloud
    from dvc.updater import Updater
    from dvc.repo.metrics import Metrics
    from dvc.scm.tree import WorkingTree

    root_dir = self.find_root(root_dir)

    self.root_dir = os.path.abspath(os.path.realpath(root_dir))
    self.dvc_dir = os.path.join(self.root_dir, self.DVC_DIR)

    self.config = Config(self.dvc_dir)

    self.tree = WorkingTree()

    self.scm = SCM(self.root_dir, repo=self)
    self.lock = Lock(self.dvc_dir)
    # NOTE: storing state and link_state in the repository itself to avoid
    # any possible state corruption in 'shared cache dir' scenario.
    self.state = State(self, self.config.config)

    core = self.config.config[Config.SECTION_CORE]

    logger.set_level(core.get(Config.SECTION_CORE_LOGLEVEL))

    self.cache = Cache(self)
    self.cloud = DataCloud(self, config=self.config.config)
    self.updater = Updater(self.dvc_dir)

    self.metrics = Metrics(self)

    self._ignore()

    self.updater.check()
# Buggy code
def load(project, fname):
    if not os.path.exists(fname):
        Stage._check_dvc_file(fname)
        raise StageFileDoesNotExistError(fname)

    Stage._check_dvc_filename(fname)

    if not Stage.is_stage_file(fname):
        Stage._check_dvc_file(fname)
        raise StageFileIsNotDvcFileError(fname)

    with open(fname, "r") as fd:
        return Stage.loadd(project, yaml.safe_load(fd), fname)


# Traceback (StageFileFormatError)
Error: Traceback (most recent call last):
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/command/run.py", line 18, in run
no_exec=self.args.no_exec)
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/project.py", line 319, in run
self._check_output_duplication(stage.outs)
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/project.py", line 155, in _check_out
put_duplication
for stage in self.stages():
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/project.py", line 1106, in stages
stage = Stage.load(self, path)
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/stage.py", line 366, in load
return Stage.loadd(project, yaml.safe_load(fd), fname)
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/stage.py", line 243, in loadd
Stage.validate(d, fname=os.path.relpath(path))
File "/home/efiop/.virtualenvs/dvc/lib/python2.7/site-packages/dvc/stage.py", line 239, in validate
raise StageFileFormatError(fname, exc)
StageFileFormatError: Stage file 'Dvcfile' format error: None should be instance of 'dict'

Error: Failed to run command: Stage file 'Dvcfile' format error: None should be instance of 'dict'

Having any troubles? Hit us up at dvc.org/support, we are always happy to help!

# Fixed code
def load(project, fname):
    if not os.path.exists(fname):
        Stage._check_dvc_file(fname)
        raise StageFileDoesNotExistError(fname)

    Stage._check_dvc_filename(fname)

    if not Stage.is_stage_file(fname):
        Stage._check_dvc_file(fname)
        raise StageFileIsNotDvcFileError(fname)

    with open(fname, "r") as fd:
        return Stage.loadd(project, yaml.safe_load(fd) or dict(), fname)
# Buggy code
def hadoop_fs(self, cmd, user=None):
    cmd = "hadoop fs -" + cmd
    if user:
        cmd = "HADOOP_USER_NAME={} ".format(user) + cmd

    # NOTE: close_fds doesn't work with redirected stdin/stdout/stderr.
    # See https://github.com/iterative/dvc/issues/1197.
    close_fds = os.name != "nt"

    p = Popen(
        cmd,
        shell=True,
        close_fds=close_fds,
        executable=os.getenv("SHELL"),
        env=fix_env(os.environ),
        stdin=PIPE,
        stdout=PIPE,
        stderr=PIPE,
    )
    out, err = p.communicate()
    if p.returncode != 0:
        raise DvcException("HDFS command failed: {}: {}".format(cmd, err))
    return out.decode("utf-8")


# Traceback (StageCmdFailedError)
$ dvc run -v -d data/Posts.xml.tgz -o data/Posts.xml tar zxf data/Posts.xml.tgz -C data/
Debug: updater is not old enough to check for updates
Debug: PRAGMA user_version;
Debug: fetched: [(2,)]
Debug: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
Debug: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
Debug: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
Debug: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
Debug: PRAGMA user_version = 2;
Running command:
tar zxf data/Posts.xml.tgz -C data/
/c: /c: Is a directory
Debug: SELECT count from state_info WHERE rowid=1
Debug: fetched: [(1,)]
Debug: UPDATE state_info SET count = 1 WHERE rowid = 1
Error: Traceback (most recent call last):
File "dvc\command\run.py", line 18, in run
File "dvc\project.py", line 265, in run
File "dvc\stage.py", line 435, in run
StageCmdFailedError: Stage 'Posts.xml.dvc' cmd tar zxf data/Posts.xml.tgz -C data/ failed

Error: Failed to run command: Stage 'Posts.xml.dvc' cmd tar zxf data/Posts.xml.tgz -C data/ failed

# Fixed code
def hadoop_fs(self, cmd, user=None):
    cmd = "hadoop fs -" + cmd
    if user:
        cmd = "HADOOP_USER_NAME={} ".format(user) + cmd

    # NOTE: close_fds doesn't work with redirected stdin/stdout/stderr.
    # See https://github.com/iterative/dvc/issues/1197.
    close_fds = os.name != "nt"

    executable = os.getenv("SHELL") if os.name != "nt" else None
    p = Popen(
        cmd,
        shell=True,
        close_fds=close_fds,
        executable=executable,
        env=fix_env(os.environ),
        stdin=PIPE,
        stdout=PIPE,
        stderr=PIPE,
    )
    out, err = p.communicate()
    if p.returncode != 0:
        raise DvcException("HDFS command failed: {}: {}".format(cmd, err))
    return out.decode("utf-8")
# Buggy code
def target_metric_from_git_history(self, hash, symlink_content, target, settings):
    cache_rel_to_data = os.path.relpath(
        settings.config.cache_dir, settings.config.data_dir
    )
    common_prefix = os.path.commonprefix([symlink_content, cache_rel_to_data])
    cache_file_name = symlink_content[len(common_prefix) :]
    if cache_file_name[0] == os.path.sep:
        cache_file_name = cache_file_name[1:]

    file_name = os.path.join(settings.config.cache_dir, cache_file_name)
    full_file_name = os.path.join(self.git_dir_abs, file_name)

    if os.path.exists(full_file_name):
        lines = open(full_file_name).readlines(2)
        if len(lines) != 1:
            msg = "[dvc-git] Target file {} with hash {} has wrong format: {} lines were obtained, 1 expected."
            Logger.warn(msg.format(target, hash, len(lines)))
        else:
            return float(lines[0])

    return None


# Traceback (ValueError)
(dvc) ➜  myrepo git:(master) dvc show workflow data/evaluation.txtException caught in CmdShowWorkflow
Traceback (most recent call last):
File "/home/efiop/virtenvs/dvc/lib/python2.7/site-packages/dvc/main.py", line 18, in main
ret = instance.run()
File "/home/efiop/virtenvs/dvc/lib/python2.7/site-packages/dvc/command/show_workflow.py", line 17, in run
wf = self.git.get_all_commits(target, self.settings)
File "/home/efiop/virtenvs/dvc/lib/python2.7/site-packages/dvc/git_wrapper.py", line 258, in get_all_commits
branch_tips=branches_multimap.get(hash))
File "/home/efiop/virtenvs/dvc/lib/python2.7/site-packages/dvc/git_wrapper.py", line 272, in is_target
metric = self.target_metric_from_git_history(hash, symlink_content, target, settings)
File "/home/efiop/virtenvs/dvc/lib/python2.7/site-packages/dvc/git_wrapper.py", line 318, in target_metric_from_git_history
return float(lines[0])
ValueError: could not convert string to float: AUC: 0.596182

# Fixed code
def target_metric_from_git_history(self, hash, symlink_content, target, settings):
    cache_rel_to_data = os.path.relpath(
        settings.config.cache_dir, settings.config.data_dir
    )
    common_prefix = os.path.commonprefix([symlink_content, cache_rel_to_data])
    cache_file_name = symlink_content[len(common_prefix) :]
    if cache_file_name[0] == os.path.sep:
        cache_file_name = cache_file_name[1:]

    file_name = os.path.join(settings.config.cache_dir, cache_file_name)
    full_file_name = os.path.join(self.git_dir_abs, file_name)

    if not os.path.exists(full_file_name):
        return None

    lines = open(full_file_name).readlines(2)
    if len(lines) != 1:
        msg = "[dvc-git] Target file {} with hash {} has wrong format: {} lines were obtained, 1 expected."
        Logger.warn(msg.format(target, hash, len(lines)))
        return None

    # Extract float from string. I.e. from 'AUC: 0.596182'
    num = re.findall("\d+\.\d+", lines[0])
    if len(num) != 1:
        msg = "[dvc-git] Unable to parse metrics from '{}' file {}"
        Logger.warn(msg.format(lines[0], target))
        return None

    return float(num[0])
# Buggy code
def run(self):
    with DvcLock(self.is_locker, self.git):
        data_items_from_args, not_data_items_from_args = self.argv_files_by_type(
            self.parsed_args.command
        )
        return self.run_and_commit_if_needed(
            self.parsed_args.command,
            data_items_from_args,
            not_data_items_from_args,
            self.parsed_args.stdout,
            self.parsed_args.stderr,
            self.parsed_args.shell,
        )
    pass


# Traceback (dvc.command.data_sync.DataSyncError)
$ dvc sync
Traceback (most recent call last):
File "/Users/dmitry/src/dvc/dvc.py", line 4, in <module>
main()
File "/Users/dmitry/src/dvc/dvc/main.py", line 11, in main
sys.exit(instance.run())
File "/Users/dmitry/src/dvc/dvc/command/data_sync.py", line 26, in run
raise DataSyncError('Sync target is not specified')
dvc.command.data_sync.DataSyncError: Data sync error: Sync target is not specified

# Fixed code
def run(self):
    with DvcLock(self.is_locker, self.git):
        cmd = [self.parsed_args.command] + self.parsed_args.args
        data_items_from_args, not_data_items_from_args = self.argv_files_by_type(cmd)
        return self.run_and_commit_if_needed(
            cmd,
            data_items_from_args,
            not_data_items_from_args,
            self.parsed_args.stdout,
            self.parsed_args.stderr,
            self.parsed_args.shell,
        )
    pass
# Buggy code
def cleanup(self):
    """Delete expired meta-data."""
    self.collection.delete_many(
        {"date_done": {"$lt": self.app.now() - self.expires_delta}},
    )
    self.group_collection.delete_many(
        {"date_done": {"$lt": self.app.now() - self.expires_delta}},
    )


# Traceback (KeyError)
Task celery.backend_cleanup[75aa0973-534f-4812-a992-1ead4086f58c] raised unexpected: TypeError('unsupported type for timedelta seconds component: NoneType')
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'expires_delta'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 412, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 704, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/celery/app/builtins.py", line 25, in backend_cleanup
app.backend.cleanup()
File "/usr/local/lib/python3.9/site-packages/celery/backends/mongodb.py", line 258, in cleanup
{'date_done': {'$lt': self.app.now() - self.expires_delta}},
File "/usr/local/lib/python3.9/site-packages/kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/usr/local/lib/python3.9/site-packages/celery/backends/mongodb.py", line 312, in expires_delta
return timedelta(seconds=self.expires)
TypeError: unsupported type for timedelta seconds component: NoneType

# Fixed code
def cleanup(self):
    """Delete expired meta-data."""
    if not self.expires:
        return

    self.collection.delete_many(
        {"date_done": {"$lt": self.app.now() - self.expires_delta}},
    )
    self.group_collection.delete_many(
        {"date_done": {"$lt": self.app.now() - self.expires_delta}},
    )
# Buggy code
def from_dict(cls, d, app=None):
    return _upgrade(
        d,
        group(d["kwargs"]["tasks"], app=app, **d["options"]),
    )


# Traceback (KeyError)
[2020-09-08 12:44:05,453: DEBUG/MainProcess] Task accepted: app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] pid:453431
[2020-09-08 12:44:05,457: ERROR/ForkPoolWorker-8] Task app.replace_with[dcea02fd-23a3-404a-9fdd-b213eb51c0d1] raised unexpected: AttributeError("'dict' object has no attribute '_app'")
Traceback (most recent call last):
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py", line 41, in __get__
return obj.__dict__[self.__name__]
KeyError: 'app'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py", line 409, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/trace.py", line 701, in __protected_call__
return self.run(*args, **kwargs)
File "/home/maybe/tmp/capp/app.py", line 13, in replace_with
raise self.replace(sig)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/app/task.py", line 894, in replace
sig.freeze(self.request.id)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1302, in freeze
self.tasks = group(self.tasks, app=self.app)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/kombu/utils/objects.py", line 43, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1456, in app
return self._get_app(self.body)
File "/home/maybe/tmp/capp/venv/lib64/python3.8/site-packages/celery/canvas.py", line 1466, in _get_app
app = tasks[0]._app
AttributeError: 'dict' object has no attribute '_app'

# Fixed code
def from_dict(cls, d, app=None):
    # We need to mutate the `kwargs` element in place to avoid confusing
    # `freeze()` implementations which end up here and expect to be able to
    # access elements from that dictionary later and refer to objects
    # canonicalized here
    orig_tasks = d["kwargs"]["tasks"]
    d["kwargs"]["tasks"] = rebuilt_tasks = type(orig_tasks)(
        (maybe_signature(task, app=app) for task in orig_tasks)
    )
    return _upgrade(
        d,
        group(rebuilt_tasks, app=app, **d["options"]),
    )
# Buggy code
def convert(self, value, param, ctx):
    return set(text.str_to_list(value))


# Traceback (ValueError)
Traceback (most recent call last):
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/bin/celery", line 8, in <module>
sys.exit(main())
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/celery/__main__.py", line 15, in main
sys.exit(_main())
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/celery/bin/celery.py", line 150, in main
return celery(auto_envvar_prefix="CELERY")
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/celery/bin/control.py", line 125, in inspect
replies = ctx.obj.app.control.inspect(timeout=timeout,
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/celery/app/control.py", line 97, in _request
return self._prepare(self.app.control.broadcast(
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/celery/app/control.py", line 477, in broadcast
return self.mailbox(conn)._broadcast(
File "/Users/aszubarev/Library/Caches/pypoetry/virtualenvs/service-notification-py-xHAuYcng-py3.8/lib/python3.8/site-packages/kombu/pidbox.py", line 319, in _broadcast
raise ValueError(
ValueError: destination must be a list/tuple not <class 'set'>
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

# Fixed code
def convert(self, value, param, ctx):
    return text.str_to_list(value)
# Buggy code
def prepare_models(self, engine):
    if not self.prepared:
        ResultModelBase.metadata.create_all(engine)
        self.prepared = True


# Traceback (Exception)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/redacted.py", line 168, in _redacted
result = async_result.get()
File "/usr/local/lib/python3.7/site-packages/celery/result.py", line 226, in get
self.maybe_throw(callback=callback)
File "/usr/local/lib/python3.7/site-packages/celery/result.py", line 342, in maybe_throw
self.throw(value, self._to_remote_traceback(tb))
File "/usr/local/lib/python3.7/site-packages/celery/result.py", line 335, in throw
self.on_ready.throw(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/vine/promises.py", line 244, in throw
reraise(type(exc), exc, tb)
File "/usr/local/lib/python3.7/site-packages/vine/five.py", line 195, in reraise
raise value
Exception: <class 'sqlalchemy.exc.IntegrityError'>(('(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "pg_type_typname_nsp_index"\nDETAIL:  Key (typname, typnamespace)=(taskset_id_sequence, 2200) already exists.\n',))

# Fixed code
def prepare_models(self, engine):
    if not self.prepared:
        # SQLAlchemy will check if the items exist before trying to
        # create them, which is a race condition. If it raises an error
        # in one iteration, the next may pass all the existence checks
        # and the call will succeed.
        retries = 0
        while True:
            try:
                ResultModelBase.metadata.create_all(engine)
            except DatabaseError:
                if retries < PREPARE_MODELS_MAX_RETRIES:
                    sleep_amount_ms = get_exponential_backoff_interval(
                        10, retries, 1000, True
                    )
                    time.sleep(sleep_amount_ms / 1000)
                    retries += 1
                else:
                    raise
            else:
                break
        self.prepared = True
# Buggy code
def set(self, key, value, state):
    """Insert a doc with value into task attribute and _key as key."""
    try:
        logging.debug(
            'INSERT {{ task: {task}, _key: "{key}" }} INTO {collection}'.format(
                collection=self.collection, key=key, task=value
            )
        )
        self.db.AQLQuery(
            'INSERT {{ task: {task}, _key: "{key}" }} INTO {collection}'.format(
                collection=self.collection, key=key, task=value
            )
        )
    except AQLQueryError as aql_err:
        logging.error(aql_err)
    except Exception as err:
        logging.error(err)


# Traceback (TypeError)
celery_default_1      | [2020-06-04 19:51:47,723: ERROR/MainProcess] Pool callback raised exception: TypeError('set() takes 3 positional arguments but 4 were given',)
celery_default_1      | Traceback (most recent call last):
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/billiard/pool.py", line 1796, in safe_apply_callback
celery_default_1      |     fun(*args, **kwargs)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/worker/request.py", line 528, in on_failure
celery_default_1      |     store_result=self.store_errors,
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 169, in mark_as_failure
celery_default_1      |     traceback=traceback, request=request)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 443, in store_result
celery_default_1      |     request=request, **kwargs)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 858, in _store_result
celery_default_1      |     self.set(self.get_key_for_task(task_id), self.encode(meta), state)
celery_default_1      | TypeError: set() takes 3 positional arguments but 4 were given

# Fixed code
def set(self, key, value):
    """Insert a doc with value into task attribute and _key as key."""
    try:
        logging.debug(
            'INSERT {{ task: {task}, _key: "{key}" }} INTO {collection}'.format(
                collection=self.collection, key=key, task=value
            )
        )
        self.db.AQLQuery(
            'INSERT {{ task: {task}, _key: "{key}" }} INTO {collection}'.format(
                collection=self.collection, key=key, task=value
            )
        )
    except AQLQueryError as aql_err:
        logging.error(aql_err)
    except Exception as err:
        logging.error(err)
# Buggy code
def set(self, key, value, state):
    """Store a value for a given key.

    Args:
          key: The key at which to store the value.
          value: The value to store.

    """
    key = bytes_to_str(key)
    LOGGER.debug("Creating Azure Block Blob at %s/%s", self._container_name, key)

    return self._client.create_blob_from_text(self._container_name, key, value)


# Traceback (TypeError)
celery_default_1      | [2020-06-04 19:51:47,723: ERROR/MainProcess] Pool callback raised exception: TypeError('set() takes 3 positional arguments but 4 were given',)
celery_default_1      | Traceback (most recent call last):
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/billiard/pool.py", line 1796, in safe_apply_callback
celery_default_1      |     fun(*args, **kwargs)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/worker/request.py", line 528, in on_failure
celery_default_1      |     store_result=self.store_errors,
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 169, in mark_as_failure
celery_default_1      |     traceback=traceback, request=request)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 443, in store_result
celery_default_1      |     request=request, **kwargs)
celery_default_1      |   File "/usr/share/dashboard/venv/lib/python3.6/site-packages/celery/backends/base.py", line 858, in _store_result
celery_default_1      |     self.set(self.get_key_for_task(task_id), self.encode(meta), state)
celery_default_1      | TypeError: set() takes 3 positional arguments but 4 were given

# Fixed code
def set(self, key, value):
    """Store a value for a given key.

    Args:
          key: The key at which to store the value.
          value: The value to store.

    """
    key = bytes_to_str(key)
    LOGGER.debug("Creating Azure Block Blob at %s/%s", self._container_name, key)

    return self._client.create_blob_from_text(self._container_name, key, value)