def addDevice(self, device_id, device_name):
    if not self._device_id_re.match(device_id):
      ErrorExit('invalid device id: %s' % device_id)

    add_page = self._fetchPage(_DEVICES_ADD_URL)
    if not add_page:
      ErrorExit('unable to retrieve add device page')

    add_form = add_page.find(id="add")
    fields = {k : v for k,v in ExtractFormFields(add_form)}
    if (not 'deviceNameList[0]' in fields or
        not 'deviceNumberList[0]' == fields):
      ErrorExit('unexpected form fields: %s' % fields.keys())
    fields['deviceNameList[0]'] = device_name
    fields['deviceNumberList[0]'] = device_id

    url = '%s%s' % (self._baseUrl(add_page.url), add_form['action'])
    self._fetchPage(url, urllib.urlencode(fields))
    print '%s: device added\n  %s  %s' % (self.username, device_id, device_name)
dataset/ETHPy150Open viewfinderco/viewfinder/clients/ios/scripts/app-tool.py/DevCenterClient.addDevice/operator `in` -> `==`