prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Centering on mobile
  `the-bureau` page contains media blocks whose content (image & body) becomes centered at mobile sizes via a `media__centered` class. The `office` index page, however, introduces a new pattern of media blocks whose image centers on mobile while the body remains left-aligned. 
  
  It seems like it would be more useful to add a general-purpose `.centered-on-mobile` class (or two classes, one for inline & the other for block elements) that could be applied to the appropriate parts of the media object rather than handle this behavior through .`media` modifiers. 
  
  Thoughts? Preferences?
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `_lib/wordpress_office_processor.py`
  Content:
  ```
  1 import sys
  2 import json
  3 import os.path
  4 import requests
  5 
  6 def posts_at_url(url):
  7     
  8     current_page = 1
  9     max_page = sys.maxint
  10 
  11     while current_page <= max_page:
  12 
  13         url = os.path.expandvars(url)
  14         resp = requests.get(url, params={'page':current_page, 'count': '-1'})
  15         results = json.loads(resp.content) 
  16         current_page += 1
  17         max_page = results['pages']
  18         for p in results['posts']:
  19             yield p
  20      
  21 def documents(name, url, **kwargs):
  22     
  23     for post in posts_at_url(url):
  24         yield process_office(post)
  25 
  26 
  27 def process_office(item):
  28     
  29     item['_id'] = item['slug']
  30     custom_fields = item['custom_fields']
  31     
  32     # get intro text & subscribe form data from custom fields
  33     for attr in ['intro_text', 'intro_subscribe_form', 'related_contact']:
  34         if attr in custom_fields:
  35             item[attr] = custom_fields[attr][0]
  36     
  37     # build top story dict
  38     top_story = {}
  39     for attr in ['top_story_head', 'top_story_desc']:
  40         if attr in custom_fields:
  41             top_story[attr] = custom_fields[attr][0]
  42     
  43     # convert top story links into a proper list
  44     top_story_links = []
  45     for x in xrange(0,5):
  46       key = 'top_story_links_%s' % x
  47       if key in custom_fields:
  48           top_story_links.append(custom_fields[key])
  49           
  50     if top_story_links:     
  51         top_story['top_story_links'] = top_story_links
  52         
  53     if top_story:
  54         item['top_story'] = top_story
  55     
  56     # create list of office resource dicts
  57     item['resources'] = []
  58     for x in xrange(1,4):
  59         resource = {}
  60         fields = ['head', 'desc', 'icon', 'link_0']
  61         for field in fields:
  62             field_name = 'resource%s_%s' % (str(x), field)
  63             if field_name in custom_fields and custom_fields[field_name][0] != '':
  64                 if field == 'link_0':
  65                     resource['link'] = custom_fields[field_name]
  66                 else:
  67                     resource[field] = custom_fields[field_name][0]
  68                             
  69         if resource:
  70             item['resources'].append(resource)
  71 
  72     return item
  73 
  74
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/_lib/wordpress_office_processor.py b/_lib/wordpress_office_processor.py
  --- a/_lib/wordpress_office_processor.py
  +++ b/_lib/wordpress_office_processor.py
  @@ -55,17 +55,17 @@
       
       # create list of office resource dicts
       item['resources'] = []
  -    for x in xrange(1,4):
  +    for x in xrange(0,4):
           resource = {}
  -        fields = ['head', 'desc', 'icon', 'link_0']
  +        fields = ['head', 'desc', 'icon', 'link']
           for field in fields:
  -            field_name = 'resource%s_%s' % (str(x), field)
  +            field_name = 'resource_%s_%s' % (str(x), field)
               if field_name in custom_fields and custom_fields[field_name][0] != '':
  -                if field == 'link_0':
  -                    resource['link'] = custom_fields[field_name]
  +                if field == 'link':
  +                    resource[field] = custom_fields[field_name]
                   else:
                       resource[field] = custom_fields[field_name][0]
  -                            
  +                    
           if resource:
               item['resources'].append(resource)
  
verification_info: {"golden_diff": "diff --git a/_lib/wordpress_office_processor.py b/_lib/wordpress_office_processor.py\n--- a/_lib/wordpress_office_processor.py\n+++ b/_lib/wordpress_office_processor.py\n@@ -55,17 +55,17 @@\n     \n     # create list of office resource dicts\n     item['resources'] = []\n-    for x in xrange(1,4):\n+    for x in xrange(0,4):\n         resource = {}\n-        fields = ['head', 'desc', 'icon', 'link_0']\n+        fields = ['head', 'desc', 'icon', 'link']\n         for field in fields:\n-            field_name = 'resource%s_%s' % (str(x), field)\n+            field_name = 'resource_%s_%s' % (str(x), field)\n             if field_name in custom_fields and custom_fields[field_name][0] != '':\n-                if field == 'link_0':\n-                    resource['link'] = custom_fields[field_name]\n+                if field == 'link':\n+                    resource[field] = custom_fields[field_name]\n                 else:\n                     resource[field] = custom_fields[field_name][0]\n-                            \n+                    \n         if resource:\n             item['resources'].append(resource)\n", "issue": "Centering on mobile\n`the-bureau` page contains media blocks whose content (image & body) becomes centered at mobile sizes via a `media__centered` class. The `office` index page, however, introduces a new pattern of media blocks whose image centers on mobile while the body remains left-aligned. \n\nIt seems like it would be more useful to add a general-purpose `.centered-on-mobile` class (or two classes, one for inline & the other for block elements) that could be applied to the appropriate parts of the media object rather than handle this behavior through .`media` modifiers. \n\nThoughts? Preferences?\n\n", "before_files": [{"content": "import sys\nimport json\nimport os.path\nimport requests\n\ndef posts_at_url(url):\n    \n    current_page = 1\n    max_page = sys.maxint\n\n    while current_page <= max_page:\n\n        url = os.path.expandvars(url)\n        resp = requests.get(url, params={'page':current_page, 'count': '-1'})\n        results = json.loads(resp.content) \n        current_page += 1\n        max_page = results['pages']\n        for p in results['posts']:\n            yield p\n     \ndef documents(name, url, **kwargs):\n    \n    for post in posts_at_url(url):\n        yield process_office(post)\n\n\ndef process_office(item):\n    \n    item['_id'] = item['slug']\n    custom_fields = item['custom_fields']\n    \n    # get intro text & subscribe form data from custom fields\n    for attr in ['intro_text', 'intro_subscribe_form', 'related_contact']:\n        if attr in custom_fields:\n            item[attr] = custom_fields[attr][0]\n    \n    # build top story dict\n    top_story = {}\n    for attr in ['top_story_head', 'top_story_desc']:\n        if attr in custom_fields:\n            top_story[attr] = custom_fields[attr][0]\n    \n    # convert top story links into a proper list\n    top_story_links = []\n    for x in xrange(0,5):\n      key = 'top_story_links_%s' % x\n      if key in custom_fields:\n          top_story_links.append(custom_fields[key])\n          \n    if top_story_links:     \n        top_story['top_story_links'] = top_story_links\n        \n    if top_story:\n        item['top_story'] = top_story\n    \n    # create list of office resource dicts\n    item['resources'] = []\n    for x in xrange(1,4):\n        resource = {}\n        fields = ['head', 'desc', 'icon', 'link_0']\n        for field in fields:\n            field_name = 'resource%s_%s' % (str(x), field)\n            if field_name in custom_fields and custom_fields[field_name][0] != '':\n                if field == 'link_0':\n                    resource['link'] = custom_fields[field_name]\n                else:\n                    resource[field] = custom_fields[field_name][0]\n                            \n        if resource:\n            item['resources'].append(resource)\n\n    return item\n\n", "path": "_lib/wordpress_office_processor.py"}], "after_files": [{"content": "import sys\nimport json\nimport os.path\nimport requests\n\ndef posts_at_url(url):\n    \n    current_page = 1\n    max_page = sys.maxint\n\n    while current_page <= max_page:\n\n        url = os.path.expandvars(url)\n        resp = requests.get(url, params={'page':current_page, 'count': '-1'})\n        results = json.loads(resp.content) \n        current_page += 1\n        max_page = results['pages']\n        for p in results['posts']:\n            yield p\n     \ndef documents(name, url, **kwargs):\n    \n    for post in posts_at_url(url):\n        yield process_office(post)\n\n\ndef process_office(item):\n    \n    item['_id'] = item['slug']\n    custom_fields = item['custom_fields']\n    \n    # get intro text & subscribe form data from custom fields\n    for attr in ['intro_text', 'intro_subscribe_form', 'related_contact']:\n        if attr in custom_fields:\n            item[attr] = custom_fields[attr][0]\n    \n    # build top story dict\n    top_story = {}\n    for attr in ['top_story_head', 'top_story_desc']:\n        if attr in custom_fields:\n            top_story[attr] = custom_fields[attr][0]\n    \n    # convert top story links into a proper list\n    top_story_links = []\n    for x in xrange(0,5):\n      key = 'top_story_links_%s' % x\n      if key in custom_fields:\n          top_story_links.append(custom_fields[key])\n          \n    if top_story_links:     \n        top_story['top_story_links'] = top_story_links\n        \n    if top_story:\n        item['top_story'] = top_story\n    \n    # create list of office resource dicts\n    item['resources'] = []\n    for x in xrange(0,4):\n        resource = {}\n        fields = ['head', 'desc', 'icon', 'link']\n        for field in fields:\n            field_name = 'resource_%s_%s' % (str(x), field)\n            if field_name in custom_fields and custom_fields[field_name][0] != '':\n                if field == 'link':\n                    resource[field] = custom_fields[field_name]\n                else:\n                    resource[field] = custom_fields[field_name][0]\n                    \n        if resource:\n            item['resources'].append(resource)\n\n    return item\n\n", "path": "_lib/wordpress_office_processor.py"}]}