We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
parentwork: In tests, mock all MusicBrainz responses
I didn't notice this when we originally merged the parentwork plugin in #3279, but its tests rely on real communication with the MusicBrainz web service, i.e., they fail if there is no network connectivity. [This Travis job](https://travis-ci.org/beetbox/beets/jobs/558936634) is an example of a spurious failure caused by network interruptions.

We need to isolate these tests by mocking the MB queries so that no network traffic is every actually sent.

@dosoe, can you please look into this?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `beetsplug/parentwork.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # This file is part of beets.
3 # Copyright 2017, Dorian Soergel.
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be
14 # included in all copies or substantial portions of the Software.
15 
16 """Gets parent work, its disambiguation and id, composer, composer sort name
17 and work composition date
18 """
19 
20 from __future__ import division, absolute_import, print_function
21 
22 from beets import ui
23 from beets.plugins import BeetsPlugin
24 
25 import musicbrainzngs
26 
27 
28 def direct_parent_id(mb_workid, work_date=None):
29     """Given a Musicbrainz work id, find the id one of the works the work is
30     part of and the first composition date it encounters.
31     """
32     work_info = musicbrainzngs.get_work_by_id(mb_workid,
33                                               includes=["work-rels",
34                                                         "artist-rels"])
35     if 'artist-relation-list' in work_info['work'] and work_date is None:
36         for artist in work_info['work']['artist-relation-list']:
37             if artist['type'] == 'composer':
38                 if 'end' in artist.keys():
39                     work_date = artist['end']
40 
41     if 'work-relation-list' in work_info['work']:
42         for direct_parent in work_info['work']['work-relation-list']:
43             if direct_parent['type'] == 'parts' \
44                     and direct_parent.get('direction') == 'backward':
45                 direct_id = direct_parent['work']['id']
46                 return direct_id, work_date
47     return None, work_date
48 
49 
50 def work_parent_id(mb_workid):
51     """Find the parent work id and composition date of a work given its id.
52     """
53     work_date = None
54     while True:
55         new_mb_workid, work_date = direct_parent_id(mb_workid, work_date)
56         if not new_mb_workid:
57             return mb_workid, work_date
58         mb_workid = new_mb_workid
59     return mb_workid, work_date
60 
61 
62 def find_parentwork_info(mb_workid):
63     """Get the MusicBrainz information dict about a parent work, including
64     the artist relations, and the composition date for a work's parent work.
65     """
66     parent_id, work_date = work_parent_id(mb_workid)
67     work_info = musicbrainzngs.get_work_by_id(parent_id,
68                                               includes=["artist-rels"])
69     return work_info, work_date
70 
71 
72 class ParentWorkPlugin(BeetsPlugin):
73     def __init__(self):
74         super(ParentWorkPlugin, self).__init__()
75 
76         self.config.add({
77             'auto': False,
78             'force': False,
79         })
80 
81         if self.config['auto']:
82             self.import_stages = [self.imported]
83 
84     def commands(self):
85 
86         def func(lib, opts, args):
87             self.config.set_args(opts)
88             force_parent = self.config['force'].get(bool)
89             write = ui.should_write()
90 
91             for item in lib.items(ui.decargs(args)):
92                 changed = self.find_work(item, force_parent)
93                 if changed:
94                     item.store()
95                     if write:
96                         item.try_write()
97         command = ui.Subcommand(
98             'parentwork',
99             help=u'fetche parent works, composers and dates')
100 
101         command.parser.add_option(
102             u'-f', u'--force', dest='force',
103             action='store_true', default=None,
104             help=u're-fetch when parent work is already present')
105 
106         command.func = func
107         return [command]
108 
109     def imported(self, session, task):
110         """Import hook for fetching parent works automatically.
111         """
112         force_parent = self.config['force'].get(bool)
113 
114         for item in task.imported_items():
115             self.find_work(item, force_parent)
116             item.store()
117 
118     def get_info(self, item, work_info):
119         """Given the parent work info dict, fetch parent_composer,
120         parent_composer_sort, parentwork, parentwork_disambig, mb_workid and
121         composer_ids.
122         """
123 
124         parent_composer = []
125         parent_composer_sort = []
126         parentwork_info = {}
127 
128         composer_exists = False
129         if 'artist-relation-list' in work_info['work']:
130             for artist in work_info['work']['artist-relation-list']:
131                 if artist['type'] == 'composer':
132                     parent_composer.append(artist['artist']['name'])
133                     parent_composer_sort.append(artist['artist']['sort-name'])
134                     if 'end' in artist.keys():
135                         parentwork_info["parentwork_date"] = artist['end']
136 
137             parentwork_info['parent_composer'] = u', '.join(parent_composer)
138             parentwork_info['parent_composer_sort'] = u', '.join(
139                     parent_composer_sort)
140 
141         if not composer_exists:
142             self._log.debug(
143                 'no composer for {}; add one at '
144                 'https://musicbrainz.org/work/{}',
145                 item, work_info['work']['id'],
146             )
147 
148         parentwork_info['parentwork'] = work_info['work']['title']
149         parentwork_info['mb_parentworkid'] = work_info['work']['id']
150 
151         if 'disambiguation' in work_info['work']:
152             parentwork_info['parentwork_disambig'] = work_info[
153                     'work']['disambiguation']
154 
155         else:
156             parentwork_info['parentwork_disambig'] = None
157 
158         return parentwork_info
159 
160     def find_work(self, item, force):
161         """Finds the parent work of a recording and populates the tags
162         accordingly.
163 
164         The parent work is found recursively, by finding the direct parent
165         repeatedly until there are no more links in the chain. We return the
166         final, topmost work in the chain.
167 
168         Namely, the tags parentwork, parentwork_disambig, mb_parentworkid,
169         parent_composer, parent_composer_sort and work_date are populated.
170         """
171 
172         if not item.mb_workid:
173             self._log.info('No work for {}, \
174 add one at https://musicbrainz.org/recording/{}', item, item.mb_trackid)
175             return
176 
177         hasparent = hasattr(item, 'parentwork')
178         work_changed = True
179         if hasattr(item, 'parentwork_workid_current'):
180             work_changed = item.parentwork_workid_current != item.mb_workid
181         if force or not hasparent or work_changed:
182             try:
183                 work_info, work_date = find_parentwork_info(item.mb_workid)
184             except musicbrainzngs.musicbrainz.WebServiceError as e:
185                 self._log.debug("error fetching work: {}", e)
186                 return
187             parent_info = self.get_info(item, work_info)
188             parent_info['parentwork_workid_current'] = item.mb_workid
189             if 'parent_composer' in parent_info:
190                 self._log.debug("Work fetched: {} - {}",
191                                 parent_info['parentwork'],
192                                 parent_info['parent_composer'])
193             else:
194                 self._log.debug("Work fetched: {} - no parent composer",
195                                 parent_info['parentwork'])
196 
197         elif hasparent:
198             self._log.debug("{}: Work present, skipping", item)
199             return
200 
201         # apply all non-null values to the item
202         for key, value in parent_info.items():
203             if value:
204                 item[key] = value
205 
206         if work_date:
207             item['work_date'] = work_date
208         return ui.show_model_changes(
209             item, fields=['parentwork', 'parentwork_disambig',
210                           'mb_parentworkid', 'parent_composer',
211                           'parent_composer_sort', 'work_date',
212                           'parentwork_workid_current', 'parentwork_date'])
213
```
--- 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/beetsplug/parentwork.py b/beetsplug/parentwork.py
--- a/beetsplug/parentwork.py
+++ b/beetsplug/parentwork.py
@@ -96,7 +96,7 @@
                         item.try_write()
         command = ui.Subcommand(
             'parentwork',
-            help=u'fetche parent works, composers and dates')
+            help=u'fetch parent works, composers and dates')
 
         command.parser.add_option(
             u'-f', u'--force', dest='force',
@@ -129,6 +129,7 @@
         if 'artist-relation-list' in work_info['work']:
             for artist in work_info['work']['artist-relation-list']:
                 if artist['type'] == 'composer':
+                    composer_exists = True
                     parent_composer.append(artist['artist']['name'])
                     parent_composer_sort.append(artist['artist']['sort-name'])
                     if 'end' in artist.keys():

{"golden_diff": "diff --git a/beetsplug/parentwork.py b/beetsplug/parentwork.py\n--- a/beetsplug/parentwork.py\n+++ b/beetsplug/parentwork.py\n@@ -96,7 +96,7 @@\n                         item.try_write()\n         command = ui.Subcommand(\n             'parentwork',\n-            help=u'fetche parent works, composers and dates')\n+            help=u'fetch parent works, composers and dates')\n \n         command.parser.add_option(\n             u'-f', u'--force', dest='force',\n@@ -129,6 +129,7 @@\n         if 'artist-relation-list' in work_info['work']:\n             for artist in work_info['work']['artist-relation-list']:\n                 if artist['type'] == 'composer':\n+                    composer_exists = True\n                     parent_composer.append(artist['artist']['name'])\n                     parent_composer_sort.append(artist['artist']['sort-name'])\n                     if 'end' in artist.keys():\n", "issue": "parentwork: In tests, mock all MusicBrainz responses\nI didn't notice this when we originally merged the parentwork plugin in #3279, but its tests rely on real communication with the MusicBrainz web service, i.e., they fail if there is no network connectivity. [This Travis job](https://travis-ci.org/beetbox/beets/jobs/558936634) is an example of a spurious failure caused by network interruptions.\r\n\r\nWe need to isolate these tests by mocking the MB queries so that no network traffic is every actually sent.\r\n\r\n@dosoe, can you please look into this?\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This file is part of beets.\n# Copyright 2017, Dorian Soergel.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n\n\"\"\"Gets parent work, its disambiguation and id, composer, composer sort name\nand work composition date\n\"\"\"\n\nfrom __future__ import division, absolute_import, print_function\n\nfrom beets import ui\nfrom beets.plugins import BeetsPlugin\n\nimport musicbrainzngs\n\n\ndef direct_parent_id(mb_workid, work_date=None):\n    \"\"\"Given a Musicbrainz work id, find the id one of the works the work is\n    part of and the first composition date it encounters.\n    \"\"\"\n    work_info = musicbrainzngs.get_work_by_id(mb_workid,\n                                              includes=[\"work-rels\",\n                                                        \"artist-rels\"])\n    if 'artist-relation-list' in work_info['work'] and work_date is None:\n        for artist in work_info['work']['artist-relation-list']:\n            if artist['type'] == 'composer':\n                if 'end' in artist.keys():\n                    work_date = artist['end']\n\n    if 'work-relation-list' in work_info['work']:\n        for direct_parent in work_info['work']['work-relation-list']:\n            if direct_parent['type'] == 'parts' \\\n                    and direct_parent.get('direction') == 'backward':\n                direct_id = direct_parent['work']['id']\n                return direct_id, work_date\n    return None, work_date\n\n\ndef work_parent_id(mb_workid):\n    \"\"\"Find the parent work id and composition date of a work given its id.\n    \"\"\"\n    work_date = None\n    while True:\n        new_mb_workid, work_date = direct_parent_id(mb_workid, work_date)\n        if not new_mb_workid:\n            return mb_workid, work_date\n        mb_workid = new_mb_workid\n    return mb_workid, work_date\n\n\ndef find_parentwork_info(mb_workid):\n    \"\"\"Get the MusicBrainz information dict about a parent work, including\n    the artist relations, and the composition date for a work's parent work.\n    \"\"\"\n    parent_id, work_date = work_parent_id(mb_workid)\n    work_info = musicbrainzngs.get_work_by_id(parent_id,\n                                              includes=[\"artist-rels\"])\n    return work_info, work_date\n\n\nclass ParentWorkPlugin(BeetsPlugin):\n    def __init__(self):\n        super(ParentWorkPlugin, self).__init__()\n\n        self.config.add({\n            'auto': False,\n            'force': False,\n        })\n\n        if self.config['auto']:\n            self.import_stages = [self.imported]\n\n    def commands(self):\n\n        def func(lib, opts, args):\n            self.config.set_args(opts)\n            force_parent = self.config['force'].get(bool)\n            write = ui.should_write()\n\n            for item in lib.items(ui.decargs(args)):\n                changed = self.find_work(item, force_parent)\n                if changed:\n                    item.store()\n                    if write:\n                        item.try_write()\n        command = ui.Subcommand(\n            'parentwork',\n            help=u'fetche parent works, composers and dates')\n\n        command.parser.add_option(\n            u'-f', u'--force', dest='force',\n            action='store_true', default=None,\n            help=u're-fetch when parent work is already present')\n\n        command.func = func\n        return [command]\n\n    def imported(self, session, task):\n        \"\"\"Import hook for fetching parent works automatically.\n        \"\"\"\n        force_parent = self.config['force'].get(bool)\n\n        for item in task.imported_items():\n            self.find_work(item, force_parent)\n            item.store()\n\n    def get_info(self, item, work_info):\n        \"\"\"Given the parent work info dict, fetch parent_composer,\n        parent_composer_sort, parentwork, parentwork_disambig, mb_workid and\n        composer_ids.\n        \"\"\"\n\n        parent_composer = []\n        parent_composer_sort = []\n        parentwork_info = {}\n\n        composer_exists = False\n        if 'artist-relation-list' in work_info['work']:\n            for artist in work_info['work']['artist-relation-list']:\n                if artist['type'] == 'composer':\n                    parent_composer.append(artist['artist']['name'])\n                    parent_composer_sort.append(artist['artist']['sort-name'])\n                    if 'end' in artist.keys():\n                        parentwork_info[\"parentwork_date\"] = artist['end']\n\n            parentwork_info['parent_composer'] = u', '.join(parent_composer)\n            parentwork_info['parent_composer_sort'] = u', '.join(\n                    parent_composer_sort)\n\n        if not composer_exists:\n            self._log.debug(\n                'no composer for {}; add one at '\n                'https://musicbrainz.org/work/{}',\n                item, work_info['work']['id'],\n            )\n\n        parentwork_info['parentwork'] = work_info['work']['title']\n        parentwork_info['mb_parentworkid'] = work_info['work']['id']\n\n        if 'disambiguation' in work_info['work']:\n            parentwork_info['parentwork_disambig'] = work_info[\n                    'work']['disambiguation']\n\n        else:\n            parentwork_info['parentwork_disambig'] = None\n\n        return parentwork_info\n\n    def find_work(self, item, force):\n        \"\"\"Finds the parent work of a recording and populates the tags\n        accordingly.\n\n        The parent work is found recursively, by finding the direct parent\n        repeatedly until there are no more links in the chain. We return the\n        final, topmost work in the chain.\n\n        Namely, the tags parentwork, parentwork_disambig, mb_parentworkid,\n        parent_composer, parent_composer_sort and work_date are populated.\n        \"\"\"\n\n        if not item.mb_workid:\n            self._log.info('No work for {}, \\\nadd one at https://musicbrainz.org/recording/{}', item, item.mb_trackid)\n            return\n\n        hasparent = hasattr(item, 'parentwork')\n        work_changed = True\n        if hasattr(item, 'parentwork_workid_current'):\n            work_changed = item.parentwork_workid_current != item.mb_workid\n        if force or not hasparent or work_changed:\n            try:\n                work_info, work_date = find_parentwork_info(item.mb_workid)\n            except musicbrainzngs.musicbrainz.WebServiceError as e:\n                self._log.debug(\"error fetching work: {}\", e)\n                return\n            parent_info = self.get_info(item, work_info)\n            parent_info['parentwork_workid_current'] = item.mb_workid\n            if 'parent_composer' in parent_info:\n                self._log.debug(\"Work fetched: {} - {}\",\n                                parent_info['parentwork'],\n                                parent_info['parent_composer'])\n            else:\n                self._log.debug(\"Work fetched: {} - no parent composer\",\n                                parent_info['parentwork'])\n\n        elif hasparent:\n            self._log.debug(\"{}: Work present, skipping\", item)\n            return\n\n        # apply all non-null values to the item\n        for key, value in parent_info.items():\n            if value:\n                item[key] = value\n\n        if work_date:\n            item['work_date'] = work_date\n        return ui.show_model_changes(\n            item, fields=['parentwork', 'parentwork_disambig',\n                          'mb_parentworkid', 'parent_composer',\n                          'parent_composer_sort', 'work_date',\n                          'parentwork_workid_current', 'parentwork_date'])\n", "path": "beetsplug/parentwork.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# This file is part of beets.\n# Copyright 2017, Dorian Soergel.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n\n\"\"\"Gets parent work, its disambiguation and id, composer, composer sort name\nand work composition date\n\"\"\"\n\nfrom __future__ import division, absolute_import, print_function\n\nfrom beets import ui\nfrom beets.plugins import BeetsPlugin\n\nimport musicbrainzngs\n\n\ndef direct_parent_id(mb_workid, work_date=None):\n    \"\"\"Given a Musicbrainz work id, find the id one of the works the work is\n    part of and the first composition date it encounters.\n    \"\"\"\n    work_info = musicbrainzngs.get_work_by_id(mb_workid,\n                                              includes=[\"work-rels\",\n                                                        \"artist-rels\"])\n    if 'artist-relation-list' in work_info['work'] and work_date is None:\n        for artist in work_info['work']['artist-relation-list']:\n            if artist['type'] == 'composer':\n                if 'end' in artist.keys():\n                    work_date = artist['end']\n\n    if 'work-relation-list' in work_info['work']:\n        for direct_parent in work_info['work']['work-relation-list']:\n            if direct_parent['type'] == 'parts' \\\n                    and direct_parent.get('direction') == 'backward':\n                direct_id = direct_parent['work']['id']\n                return direct_id, work_date\n    return None, work_date\n\n\ndef work_parent_id(mb_workid):\n    \"\"\"Find the parent work id and composition date of a work given its id.\n    \"\"\"\n    work_date = None\n    while True:\n        new_mb_workid, work_date = direct_parent_id(mb_workid, work_date)\n        if not new_mb_workid:\n            return mb_workid, work_date\n        mb_workid = new_mb_workid\n    return mb_workid, work_date\n\n\ndef find_parentwork_info(mb_workid):\n    \"\"\"Get the MusicBrainz information dict about a parent work, including\n    the artist relations, and the composition date for a work's parent work.\n    \"\"\"\n    parent_id, work_date = work_parent_id(mb_workid)\n    work_info = musicbrainzngs.get_work_by_id(parent_id,\n                                              includes=[\"artist-rels\"])\n    return work_info, work_date\n\n\nclass ParentWorkPlugin(BeetsPlugin):\n    def __init__(self):\n        super(ParentWorkPlugin, self).__init__()\n\n        self.config.add({\n            'auto': False,\n            'force': False,\n        })\n\n        if self.config['auto']:\n            self.import_stages = [self.imported]\n\n    def commands(self):\n\n        def func(lib, opts, args):\n            self.config.set_args(opts)\n            force_parent = self.config['force'].get(bool)\n            write = ui.should_write()\n\n            for item in lib.items(ui.decargs(args)):\n                changed = self.find_work(item, force_parent)\n                if changed:\n                    item.store()\n                    if write:\n                        item.try_write()\n        command = ui.Subcommand(\n            'parentwork',\n            help=u'fetch parent works, composers and dates')\n\n        command.parser.add_option(\n            u'-f', u'--force', dest='force',\n            action='store_true', default=None,\n            help=u're-fetch when parent work is already present')\n\n        command.func = func\n        return [command]\n\n    def imported(self, session, task):\n        \"\"\"Import hook for fetching parent works automatically.\n        \"\"\"\n        force_parent = self.config['force'].get(bool)\n\n        for item in task.imported_items():\n            self.find_work(item, force_parent)\n            item.store()\n\n    def get_info(self, item, work_info):\n        \"\"\"Given the parent work info dict, fetch parent_composer,\n        parent_composer_sort, parentwork, parentwork_disambig, mb_workid and\n        composer_ids.\n        \"\"\"\n\n        parent_composer = []\n        parent_composer_sort = []\n        parentwork_info = {}\n\n        composer_exists = False\n        if 'artist-relation-list' in work_info['work']:\n            for artist in work_info['work']['artist-relation-list']:\n                if artist['type'] == 'composer':\n                    composer_exists = True\n                    parent_composer.append(artist['artist']['name'])\n                    parent_composer_sort.append(artist['artist']['sort-name'])\n                    if 'end' in artist.keys():\n                        parentwork_info[\"parentwork_date\"] = artist['end']\n\n            parentwork_info['parent_composer'] = u', '.join(parent_composer)\n            parentwork_info['parent_composer_sort'] = u', '.join(\n                    parent_composer_sort)\n\n        if not composer_exists:\n            self._log.debug(\n                'no composer for {}; add one at '\n                'https://musicbrainz.org/work/{}',\n                item, work_info['work']['id'],\n            )\n\n        parentwork_info['parentwork'] = work_info['work']['title']\n        parentwork_info['mb_parentworkid'] = work_info['work']['id']\n\n        if 'disambiguation' in work_info['work']:\n            parentwork_info['parentwork_disambig'] = work_info[\n                    'work']['disambiguation']\n\n        else:\n            parentwork_info['parentwork_disambig'] = None\n\n        return parentwork_info\n\n    def find_work(self, item, force):\n        \"\"\"Finds the parent work of a recording and populates the tags\n        accordingly.\n\n        The parent work is found recursively, by finding the direct parent\n        repeatedly until there are no more links in the chain. We return the\n        final, topmost work in the chain.\n\n        Namely, the tags parentwork, parentwork_disambig, mb_parentworkid,\n        parent_composer, parent_composer_sort and work_date are populated.\n        \"\"\"\n\n        if not item.mb_workid:\n            self._log.info('No work for {}, \\\nadd one at https://musicbrainz.org/recording/{}', item, item.mb_trackid)\n            return\n\n        hasparent = hasattr(item, 'parentwork')\n        work_changed = True\n        if hasattr(item, 'parentwork_workid_current'):\n            work_changed = item.parentwork_workid_current != item.mb_workid\n        if force or not hasparent or work_changed:\n            try:\n                work_info, work_date = find_parentwork_info(item.mb_workid)\n            except musicbrainzngs.musicbrainz.WebServiceError as e:\n                self._log.debug(\"error fetching work: {}\", e)\n                return\n            parent_info = self.get_info(item, work_info)\n            parent_info['parentwork_workid_current'] = item.mb_workid\n            if 'parent_composer' in parent_info:\n                self._log.debug(\"Work fetched: {} - {}\",\n                                parent_info['parentwork'],\n                                parent_info['parent_composer'])\n            else:\n                self._log.debug(\"Work fetched: {} - no parent composer\",\n                                parent_info['parentwork'])\n\n        elif hasparent:\n            self._log.debug(\"{}: Work present, skipping\", item)\n            return\n\n        # apply all non-null values to the item\n        for key, value in parent_info.items():\n            if value:\n                item[key] = value\n\n        if work_date:\n            item['work_date'] = work_date\n        return ui.show_model_changes(\n            item, fields=['parentwork', 'parentwork_disambig',\n                          'mb_parentworkid', 'parent_composer',\n                          'parent_composer_sort', 'work_date',\n                          'parentwork_workid_current', 'parentwork_date'])\n", "path": "beetsplug/parentwork.py"}]}