We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`loglevel` does not affect CLI output


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `datumaro/cli/__main__.py`
Content:
```
1 # Copyright (C) 2019-2022 Intel Corporation
2 #
3 # SPDX-License-Identifier: MIT
4 
5 import argparse
6 import logging as log
7 import os.path as osp
8 import sys
9 import warnings
10 
11 from ..util.telemetry_utils import (
12     close_telemetry_session,
13     init_telemetry_session,
14     send_command_exception_info,
15     send_command_failure_info,
16     send_command_success_info,
17 )
18 from ..version import VERSION
19 from . import commands, contexts
20 from .util import add_subparser
21 from .util.errors import CliException
22 
23 _log_levels = {
24     "debug": log.DEBUG,
25     "info": log.INFO,
26     "warning": log.WARNING,
27     "error": log.ERROR,
28     "critical": log.CRITICAL,
29 }
30 
31 
32 def loglevel(name):
33     return _log_levels[name]
34 
35 
36 class _LogManager:
37     @classmethod
38     def init_logger(cls, args=None):
39         # Define minimalistic parser only to obtain loglevel
40         parser = argparse.ArgumentParser(add_help=False)
41         cls._define_loglevel_option(parser)
42         args, _ = parser.parse_known_args(args)
43 
44         log.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=args.loglevel)
45 
46         # Suppress own deprecation warnings
47         warnings.filterwarnings("ignore", category=DeprecationWarning, module=r"datumaro\..*")
48 
49     @staticmethod
50     def _define_loglevel_option(parser):
51         parser.add_argument(
52             "--loglevel",
53             type=loglevel,
54             default="info",
55             help="Logging level (options: %s; default: %s)"
56             % (", ".join(_log_levels.keys()), "%(default)s"),
57         )
58         return parser
59 
60 
61 def _make_subcommands_help(commands, help_line_start=0):
62     desc = ""
63     for command_name, _, command_help in commands:
64         desc += ("  %-" + str(max(0, help_line_start - 2 - 1)) + "s%s\n") % (
65             command_name,
66             command_help,
67         )
68     return desc
69 
70 
71 def _get_known_contexts():
72     return [
73         ("model", contexts.model, "Actions with models"),
74         ("project", contexts.project, "Actions with projects"),
75         ("source", contexts.source, "Actions with data sources"),
76         ("util", contexts.util, "Auxillary tools and utilities"),
77     ]
78 
79 
80 def _get_known_commands():
81     return [
82         ("Project modification:", None, ""),
83         ("add", commands.add, "Add dataset"),
84         ("create", commands.create, "Create empty project"),
85         ("import", commands.import_, "Import dataset"),
86         ("remove", commands.remove, "Remove dataset"),
87         ("", None, ""),
88         ("Project versioning:", None, ""),
89         ("checkout", commands.checkout, "Switch to another branch or revision"),
90         ("commit", commands.commit, "Commit changes in tracked files"),
91         ("log", commands.log, "List history"),
92         ("status", commands.status, "Display current status"),
93         ("", None, ""),
94         ("Dataset operations:", None, ""),
95         ("convert", commands.convert, "Convert dataset between formats"),
96         (
97             "describe-downloads",
98             commands.describe_downloads,
99             "Print information about downloadable datasets",
100         ),
101         ("detect-format", commands.detect_format, "Detect the format of a dataset"),
102         ("diff", commands.diff, "Compare datasets"),
103         ("download", commands.download, "Download a publicly available dataset"),
104         ("explain", commands.explain, "Run Explainable AI algorithm for model"),
105         ("export", commands.export, "Export dataset in some format"),
106         ("filter", commands.filter, "Filter dataset items"),
107         ("generate", commands.generate, "Generate synthetic dataset"),
108         ("info", commands.info, "Print dataset info"),
109         ("merge", commands.merge, "Merge datasets"),
110         ("patch", commands.patch, "Update dataset from another one"),
111         ("stats", commands.stats, "Compute dataset statistics"),
112         ("transform", commands.transform, "Modify dataset items"),
113         ("validate", commands.validate, "Validate dataset"),
114     ]
115 
116 
117 def _get_sensitive_args():
118     known_contexts = _get_known_contexts()
119     known_commands = _get_known_commands()
120 
121     res = {}
122     for _, command, _ in known_contexts + known_commands:
123         if command is not None:
124             res.update(command.get_sensitive_args())
125 
126     return res
127 
128 
129 def make_parser():
130     parser = argparse.ArgumentParser(
131         description="Dataset Framework", formatter_class=argparse.RawDescriptionHelpFormatter
132     )
133     if parser.prog == osp.basename(__file__):  # python -m datumaro ...
134         parser.prog = "datumaro"
135 
136     parser.add_argument("--version", action="version", version=VERSION)
137     _LogManager._define_loglevel_option(parser)
138 
139     known_contexts = _get_known_contexts()
140     known_commands = _get_known_commands()
141 
142     # Argparse doesn't support subparser groups:
143     # https://stackoverflow.com/questions/32017020/grouping-argparse-subparser-arguments
144     help_line_start = max((len(e[0]) for e in known_contexts + known_commands), default=0)
145     help_line_start = max((2 + help_line_start) // 4 + 1, 6) * 4  # align to tabs
146     subcommands_desc = ""
147     if known_contexts:
148         subcommands_desc += "Contexts:\n"
149         subcommands_desc += _make_subcommands_help(known_contexts, help_line_start)
150     if known_commands:
151         if subcommands_desc:
152             subcommands_desc += "\n"
153         subcommands_desc += "Commands:\n"
154         subcommands_desc += _make_subcommands_help(known_commands, help_line_start)
155     if subcommands_desc:
156         subcommands_desc += (
157             "\nRun '%s COMMAND --help' for more information on a command." % parser.prog
158         )
159 
160     subcommands = parser.add_subparsers(
161         title=subcommands_desc, description="", help=argparse.SUPPRESS
162     )
163     for command_name, command, _ in known_contexts + known_commands:
164         if command is not None:
165             add_subparser(subcommands, command_name, command.build_parser)
166 
167     return parser
168 
169 
170 def main(args=None):
171     _LogManager.init_logger(args)
172 
173     parser = make_parser()
174     args = parser.parse_args(args)
175 
176     if "command" not in args:
177         parser.print_help()
178         return 1
179 
180     sensitive_args = _get_sensitive_args()
181     telemetry = init_telemetry_session(app_name="Datumaro", app_version=VERSION)
182 
183     try:
184         retcode = args.command(args)
185         if retcode is None:
186             retcode = 0
187     except CliException as e:
188         log.error(e)
189         send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])
190         return 1
191     except Exception as e:
192         log.error(e)
193         send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])
194         raise
195     else:
196         if retcode:
197             send_command_failure_info(telemetry, args, sensitive_args=sensitive_args[args.command])
198         else:
199             send_command_success_info(telemetry, args, sensitive_args=sensitive_args[args.command])
200         return retcode
201     finally:
202         close_telemetry_session(telemetry)
203 
204 
205 if __name__ == "__main__":
206     sys.exit(main())
207
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/datumaro/cli/__main__.py b/datumaro/cli/__main__.py
--- a/datumaro/cli/__main__.py
+++ b/datumaro/cli/__main__.py
@@ -40,8 +40,17 @@
         parser = argparse.ArgumentParser(add_help=False)
         cls._define_loglevel_option(parser)
         args, _ = parser.parse_known_args(args)
-
-        log.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=args.loglevel)
+        log_format = "%(asctime)s %(levelname)s: %(message)s"
+
+        # Try setting up logging with basicConfig.
+        # This does nothing, if other parts of the software
+        # already configured handlers, i.e. during imports and when
+        # main is called programmatically.
+        log.basicConfig(format=log_format, level=args.loglevel)
+        # Force-overwrite the log level and formatter
+        log.root.setLevel(args.loglevel)
+        for h in log.root.handlers:
+            h.setFormatter(log.Formatter(log_format))
 
         # Suppress own deprecation warnings
         warnings.filterwarnings("ignore", category=DeprecationWarning, module=r"datumaro\..*")

{"golden_diff": "diff --git a/datumaro/cli/__main__.py b/datumaro/cli/__main__.py\n--- a/datumaro/cli/__main__.py\n+++ b/datumaro/cli/__main__.py\n@@ -40,8 +40,17 @@\n         parser = argparse.ArgumentParser(add_help=False)\n         cls._define_loglevel_option(parser)\n         args, _ = parser.parse_known_args(args)\n-\n-        log.basicConfig(format=\"%(asctime)s %(levelname)s: %(message)s\", level=args.loglevel)\n+        log_format = \"%(asctime)s %(levelname)s: %(message)s\"\n+\n+        # Try setting up logging with basicConfig.\n+        # This does nothing, if other parts of the software\n+        # already configured handlers, i.e. during imports and when\n+        # main is called programmatically.\n+        log.basicConfig(format=log_format, level=args.loglevel)\n+        # Force-overwrite the log level and formatter\n+        log.root.setLevel(args.loglevel)\n+        for h in log.root.handlers:\n+            h.setFormatter(log.Formatter(log_format))\n \n         # Suppress own deprecation warnings\n         warnings.filterwarnings(\"ignore\", category=DeprecationWarning, module=r\"datumaro\\..*\")\n", "issue": "`loglevel` does not affect CLI output\n\n", "before_files": [{"content": "# Copyright (C) 2019-2022 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport argparse\nimport logging as log\nimport os.path as osp\nimport sys\nimport warnings\n\nfrom ..util.telemetry_utils import (\n    close_telemetry_session,\n    init_telemetry_session,\n    send_command_exception_info,\n    send_command_failure_info,\n    send_command_success_info,\n)\nfrom ..version import VERSION\nfrom . import commands, contexts\nfrom .util import add_subparser\nfrom .util.errors import CliException\n\n_log_levels = {\n    \"debug\": log.DEBUG,\n    \"info\": log.INFO,\n    \"warning\": log.WARNING,\n    \"error\": log.ERROR,\n    \"critical\": log.CRITICAL,\n}\n\n\ndef loglevel(name):\n    return _log_levels[name]\n\n\nclass _LogManager:\n    @classmethod\n    def init_logger(cls, args=None):\n        # Define minimalistic parser only to obtain loglevel\n        parser = argparse.ArgumentParser(add_help=False)\n        cls._define_loglevel_option(parser)\n        args, _ = parser.parse_known_args(args)\n\n        log.basicConfig(format=\"%(asctime)s %(levelname)s: %(message)s\", level=args.loglevel)\n\n        # Suppress own deprecation warnings\n        warnings.filterwarnings(\"ignore\", category=DeprecationWarning, module=r\"datumaro\\..*\")\n\n    @staticmethod\n    def _define_loglevel_option(parser):\n        parser.add_argument(\n            \"--loglevel\",\n            type=loglevel,\n            default=\"info\",\n            help=\"Logging level (options: %s; default: %s)\"\n            % (\", \".join(_log_levels.keys()), \"%(default)s\"),\n        )\n        return parser\n\n\ndef _make_subcommands_help(commands, help_line_start=0):\n    desc = \"\"\n    for command_name, _, command_help in commands:\n        desc += (\"  %-\" + str(max(0, help_line_start - 2 - 1)) + \"s%s\\n\") % (\n            command_name,\n            command_help,\n        )\n    return desc\n\n\ndef _get_known_contexts():\n    return [\n        (\"model\", contexts.model, \"Actions with models\"),\n        (\"project\", contexts.project, \"Actions with projects\"),\n        (\"source\", contexts.source, \"Actions with data sources\"),\n        (\"util\", contexts.util, \"Auxillary tools and utilities\"),\n    ]\n\n\ndef _get_known_commands():\n    return [\n        (\"Project modification:\", None, \"\"),\n        (\"add\", commands.add, \"Add dataset\"),\n        (\"create\", commands.create, \"Create empty project\"),\n        (\"import\", commands.import_, \"Import dataset\"),\n        (\"remove\", commands.remove, \"Remove dataset\"),\n        (\"\", None, \"\"),\n        (\"Project versioning:\", None, \"\"),\n        (\"checkout\", commands.checkout, \"Switch to another branch or revision\"),\n        (\"commit\", commands.commit, \"Commit changes in tracked files\"),\n        (\"log\", commands.log, \"List history\"),\n        (\"status\", commands.status, \"Display current status\"),\n        (\"\", None, \"\"),\n        (\"Dataset operations:\", None, \"\"),\n        (\"convert\", commands.convert, \"Convert dataset between formats\"),\n        (\n            \"describe-downloads\",\n            commands.describe_downloads,\n            \"Print information about downloadable datasets\",\n        ),\n        (\"detect-format\", commands.detect_format, \"Detect the format of a dataset\"),\n        (\"diff\", commands.diff, \"Compare datasets\"),\n        (\"download\", commands.download, \"Download a publicly available dataset\"),\n        (\"explain\", commands.explain, \"Run Explainable AI algorithm for model\"),\n        (\"export\", commands.export, \"Export dataset in some format\"),\n        (\"filter\", commands.filter, \"Filter dataset items\"),\n        (\"generate\", commands.generate, \"Generate synthetic dataset\"),\n        (\"info\", commands.info, \"Print dataset info\"),\n        (\"merge\", commands.merge, \"Merge datasets\"),\n        (\"patch\", commands.patch, \"Update dataset from another one\"),\n        (\"stats\", commands.stats, \"Compute dataset statistics\"),\n        (\"transform\", commands.transform, \"Modify dataset items\"),\n        (\"validate\", commands.validate, \"Validate dataset\"),\n    ]\n\n\ndef _get_sensitive_args():\n    known_contexts = _get_known_contexts()\n    known_commands = _get_known_commands()\n\n    res = {}\n    for _, command, _ in known_contexts + known_commands:\n        if command is not None:\n            res.update(command.get_sensitive_args())\n\n    return res\n\n\ndef make_parser():\n    parser = argparse.ArgumentParser(\n        description=\"Dataset Framework\", formatter_class=argparse.RawDescriptionHelpFormatter\n    )\n    if parser.prog == osp.basename(__file__):  # python -m datumaro ...\n        parser.prog = \"datumaro\"\n\n    parser.add_argument(\"--version\", action=\"version\", version=VERSION)\n    _LogManager._define_loglevel_option(parser)\n\n    known_contexts = _get_known_contexts()\n    known_commands = _get_known_commands()\n\n    # Argparse doesn't support subparser groups:\n    # https://stackoverflow.com/questions/32017020/grouping-argparse-subparser-arguments\n    help_line_start = max((len(e[0]) for e in known_contexts + known_commands), default=0)\n    help_line_start = max((2 + help_line_start) // 4 + 1, 6) * 4  # align to tabs\n    subcommands_desc = \"\"\n    if known_contexts:\n        subcommands_desc += \"Contexts:\\n\"\n        subcommands_desc += _make_subcommands_help(known_contexts, help_line_start)\n    if known_commands:\n        if subcommands_desc:\n            subcommands_desc += \"\\n\"\n        subcommands_desc += \"Commands:\\n\"\n        subcommands_desc += _make_subcommands_help(known_commands, help_line_start)\n    if subcommands_desc:\n        subcommands_desc += (\n            \"\\nRun '%s COMMAND --help' for more information on a command.\" % parser.prog\n        )\n\n    subcommands = parser.add_subparsers(\n        title=subcommands_desc, description=\"\", help=argparse.SUPPRESS\n    )\n    for command_name, command, _ in known_contexts + known_commands:\n        if command is not None:\n            add_subparser(subcommands, command_name, command.build_parser)\n\n    return parser\n\n\ndef main(args=None):\n    _LogManager.init_logger(args)\n\n    parser = make_parser()\n    args = parser.parse_args(args)\n\n    if \"command\" not in args:\n        parser.print_help()\n        return 1\n\n    sensitive_args = _get_sensitive_args()\n    telemetry = init_telemetry_session(app_name=\"Datumaro\", app_version=VERSION)\n\n    try:\n        retcode = args.command(args)\n        if retcode is None:\n            retcode = 0\n    except CliException as e:\n        log.error(e)\n        send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        return 1\n    except Exception as e:\n        log.error(e)\n        send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        raise\n    else:\n        if retcode:\n            send_command_failure_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        else:\n            send_command_success_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        return retcode\n    finally:\n        close_telemetry_session(telemetry)\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n", "path": "datumaro/cli/__main__.py"}], "after_files": [{"content": "# Copyright (C) 2019-2022 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport argparse\nimport logging as log\nimport os.path as osp\nimport sys\nimport warnings\n\nfrom ..util.telemetry_utils import (\n    close_telemetry_session,\n    init_telemetry_session,\n    send_command_exception_info,\n    send_command_failure_info,\n    send_command_success_info,\n)\nfrom ..version import VERSION\nfrom . import commands, contexts\nfrom .util import add_subparser\nfrom .util.errors import CliException\n\n_log_levels = {\n    \"debug\": log.DEBUG,\n    \"info\": log.INFO,\n    \"warning\": log.WARNING,\n    \"error\": log.ERROR,\n    \"critical\": log.CRITICAL,\n}\n\n\ndef loglevel(name):\n    return _log_levels[name]\n\n\nclass _LogManager:\n    @classmethod\n    def init_logger(cls, args=None):\n        # Define minimalistic parser only to obtain loglevel\n        parser = argparse.ArgumentParser(add_help=False)\n        cls._define_loglevel_option(parser)\n        args, _ = parser.parse_known_args(args)\n        log_format = \"%(asctime)s %(levelname)s: %(message)s\"\n\n        # Try setting up logging with basicConfig.\n        # This does nothing, if other parts of the software\n        # already configured handlers, i.e. during imports and when\n        # main is called programmatically.\n        log.basicConfig(format=log_format, level=args.loglevel)\n        # Force-overwrite the log level and formatter\n        log.root.setLevel(args.loglevel)\n        for h in log.root.handlers:\n            h.setFormatter(log.Formatter(log_format))\n\n        # Suppress own deprecation warnings\n        warnings.filterwarnings(\"ignore\", category=DeprecationWarning, module=r\"datumaro\\..*\")\n\n    @staticmethod\n    def _define_loglevel_option(parser):\n        parser.add_argument(\n            \"--loglevel\",\n            type=loglevel,\n            default=\"info\",\n            help=\"Logging level (options: %s; default: %s)\"\n            % (\", \".join(_log_levels.keys()), \"%(default)s\"),\n        )\n        return parser\n\n\ndef _make_subcommands_help(commands, help_line_start=0):\n    desc = \"\"\n    for command_name, _, command_help in commands:\n        desc += (\"  %-\" + str(max(0, help_line_start - 2 - 1)) + \"s%s\\n\") % (\n            command_name,\n            command_help,\n        )\n    return desc\n\n\ndef _get_known_contexts():\n    return [\n        (\"model\", contexts.model, \"Actions with models\"),\n        (\"project\", contexts.project, \"Actions with projects\"),\n        (\"source\", contexts.source, \"Actions with data sources\"),\n        (\"util\", contexts.util, \"Auxillary tools and utilities\"),\n    ]\n\n\ndef _get_known_commands():\n    return [\n        (\"Project modification:\", None, \"\"),\n        (\"add\", commands.add, \"Add dataset\"),\n        (\"create\", commands.create, \"Create empty project\"),\n        (\"import\", commands.import_, \"Import dataset\"),\n        (\"remove\", commands.remove, \"Remove dataset\"),\n        (\"\", None, \"\"),\n        (\"Project versioning:\", None, \"\"),\n        (\"checkout\", commands.checkout, \"Switch to another branch or revision\"),\n        (\"commit\", commands.commit, \"Commit changes in tracked files\"),\n        (\"log\", commands.log, \"List history\"),\n        (\"status\", commands.status, \"Display current status\"),\n        (\"\", None, \"\"),\n        (\"Dataset operations:\", None, \"\"),\n        (\"convert\", commands.convert, \"Convert dataset between formats\"),\n        (\n            \"describe-downloads\",\n            commands.describe_downloads,\n            \"Print information about downloadable datasets\",\n        ),\n        (\"detect-format\", commands.detect_format, \"Detect the format of a dataset\"),\n        (\"diff\", commands.diff, \"Compare datasets\"),\n        (\"download\", commands.download, \"Download a publicly available dataset\"),\n        (\"explain\", commands.explain, \"Run Explainable AI algorithm for model\"),\n        (\"export\", commands.export, \"Export dataset in some format\"),\n        (\"filter\", commands.filter, \"Filter dataset items\"),\n        (\"generate\", commands.generate, \"Generate synthetic dataset\"),\n        (\"info\", commands.info, \"Print dataset info\"),\n        (\"merge\", commands.merge, \"Merge datasets\"),\n        (\"patch\", commands.patch, \"Update dataset from another one\"),\n        (\"stats\", commands.stats, \"Compute dataset statistics\"),\n        (\"transform\", commands.transform, \"Modify dataset items\"),\n        (\"validate\", commands.validate, \"Validate dataset\"),\n    ]\n\n\ndef _get_sensitive_args():\n    known_contexts = _get_known_contexts()\n    known_commands = _get_known_commands()\n\n    res = {}\n    for _, command, _ in known_contexts + known_commands:\n        if command is not None:\n            res.update(command.get_sensitive_args())\n\n    return res\n\n\ndef make_parser():\n    parser = argparse.ArgumentParser(\n        description=\"Dataset Framework\", formatter_class=argparse.RawDescriptionHelpFormatter\n    )\n    if parser.prog == osp.basename(__file__):  # python -m datumaro ...\n        parser.prog = \"datumaro\"\n\n    parser.add_argument(\"--version\", action=\"version\", version=VERSION)\n    _LogManager._define_loglevel_option(parser)\n\n    known_contexts = _get_known_contexts()\n    known_commands = _get_known_commands()\n\n    # Argparse doesn't support subparser groups:\n    # https://stackoverflow.com/questions/32017020/grouping-argparse-subparser-arguments\n    help_line_start = max((len(e[0]) for e in known_contexts + known_commands), default=0)\n    help_line_start = max((2 + help_line_start) // 4 + 1, 6) * 4  # align to tabs\n    subcommands_desc = \"\"\n    if known_contexts:\n        subcommands_desc += \"Contexts:\\n\"\n        subcommands_desc += _make_subcommands_help(known_contexts, help_line_start)\n    if known_commands:\n        if subcommands_desc:\n            subcommands_desc += \"\\n\"\n        subcommands_desc += \"Commands:\\n\"\n        subcommands_desc += _make_subcommands_help(known_commands, help_line_start)\n    if subcommands_desc:\n        subcommands_desc += (\n            \"\\nRun '%s COMMAND --help' for more information on a command.\" % parser.prog\n        )\n\n    subcommands = parser.add_subparsers(\n        title=subcommands_desc, description=\"\", help=argparse.SUPPRESS\n    )\n    for command_name, command, _ in known_contexts + known_commands:\n        if command is not None:\n            add_subparser(subcommands, command_name, command.build_parser)\n\n    return parser\n\n\ndef main(args=None):\n    _LogManager.init_logger(args)\n\n    parser = make_parser()\n    args = parser.parse_args(args)\n\n    if \"command\" not in args:\n        parser.print_help()\n        return 1\n\n    sensitive_args = _get_sensitive_args()\n    telemetry = init_telemetry_session(app_name=\"Datumaro\", app_version=VERSION)\n\n    try:\n        retcode = args.command(args)\n        if retcode is None:\n            retcode = 0\n    except CliException as e:\n        log.error(e)\n        send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        return 1\n    except Exception as e:\n        log.error(e)\n        send_command_exception_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        raise\n    else:\n        if retcode:\n            send_command_failure_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        else:\n            send_command_success_info(telemetry, args, sensitive_args=sensitive_args[args.command])\n        return retcode\n    finally:\n        close_telemetry_session(telemetry)\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n", "path": "datumaro/cli/__main__.py"}]}