old_contents: import requests
  
  import config
  
  def section_create(section):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections'
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    params = {
      'name': section,
      'type': 'show',
      'agent': 'com.plexapp.agents.thetvdb',
      'scanner': 'Plex Series Scanner',
      'language': 'en',
      'importFromiTunes': '',
      'enableAutoPhotoTags': '',
      # Specifies an arbitrary default location
      'location': ('/non-existant-path/' + section)
    }
    response = requests.post(address, headers=headers, params=params)
  
  def section_get_key(section):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections/'
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    xml = requests.get(config.PLEX_SERVER_ADDRESS + '/library/sections', headers=headers)
    tree = ElementTree.fromstring(xml.content)
    sectionkey = tree.find("./Directory[@title='" + section + "']").attrib["key"]
    return sectionkey
  
  def section_set_locations(section, paths):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections/' + section_get_key(section)
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    params = {
      'agent': 'com.plexapp.agents.thetvdb',
      'location': paths
    }
    response = requests.put(address, headers=headers, params=params)
  
new_contents: from xml.etree import ElementTree
  
  import requests
  
  import config
  
  def section_create(section):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections'
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    params = {
      'name': section,
      'type': 'show',
      'agent': 'com.plexapp.agents.thetvdb',
      'scanner': 'Plex Series Scanner',
      'language': 'en',
      'importFromiTunes': '',
      'enableAutoPhotoTags': '',
      # Specifies an arbitrary default location
      'location': ('/non-existant-path/' + section)
    }
    response = requests.post(address, headers=headers, params=params)
  
  def section_get_key(section):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections/'
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    xml = requests.get(config.PLEX_SERVER_ADDRESS + '/library/sections', headers=headers)
    tree = ElementTree.fromstring(xml.content)
    sectionkey = tree.find("./Directory[@title='" + section + "']").attrib["key"]
    return sectionkey
  
  def section_set_locations(section, paths):
    address = config.PLEX_SERVER_ADDRESS + '/library/sections/' + section_get_key(section)
    headers = {
      'X-Plex-Token': config.PLEX_TOKEN,
    }
    params = {
      'agent': 'com.plexapp.agents.thetvdb',
      'location': paths
    }
    response = requests.put(address, headers=headers, params=params)
  
subject: fix missing import