code: def _value_needs_quotes(val):
          
          if not val:
              return None
          val = "".join(str(node) for node in val.filter_text(recursive=False))
          if not any(char.isspace() for char in val):
              return None
          if "'" in val and '"' not in val:
              return '"'
          if '"' in val and "'" not in val:
              return "'"
          return "\"'"
docs: Return valid quotes for the given value, or None if unneeded.