def strip_spaces_and_quotes(value):
 value = (value.strip() if value else '')
 if (value and (len(value) > 1) and (value[0] == value[(-1)] == '"')):
  value = value[1:(-1)]
 if (not value):
  value = ''
 return value

def strip_spaces_and_quotes ( value ) : value = ( value . strip ( ) if value else '' ) if ( value and ( len ( value ) > 1 ) and ( value [ 0 ] == value [ ( - 1 ) ] == '"' ) ) : value = value [ 1 : ( - 1 ) ] if ( not value ) : value = '' return value
remove invalid whitespace and/or single pair of dquotes and return none for empty strings .