def get_mdict_item_or_list(mdict, key):
 if hasattr(mdict, 'getlist'):
  v = mdict.getlist(key)
  if (len(v) == 1):
   value = v[0]
   if (value == ''):
    value = None
   return value
  elif (len(v) == 0):
   return None
  else:
   return tuple(v)
 return None

def get_mdict_item_or_list ( mdict , key ) : if hasattr ( mdict , 'getlist' ) : v = mdict . getlist ( key ) if ( len ( v ) == 1 ) : value = v [ 0 ] if ( value == '' ) : value = None return value elif ( len ( v ) == 0 ) : return None else : return tuple ( v ) return None
return the value for the given key of the multidict .