def is_valid_dot_atom(value):
 return (isinstance(value, six.string_types) and (not (value[0] == '.')) and (not (value[(-1)] == '.')) and set(value).issubset(valid_dot_atom_characters))

def is_valid_dot_atom ( value ) : return ( isinstance ( value , six . string_types ) and ( not ( value [ 0 ] == '.' ) ) and ( not ( value [ ( - 1 ) ] == '.' ) ) and set ( value ) . issubset ( valid_dot_atom_characters ) )
validate an input string as an rfc 2822 dot-atom-text value .