input:                         
  def detect_infinite_loop(code: str) -> bool:
      """ Analyze the given Python function to determine if it contains a potential infinite loop.
      >>> detect_infinite_loop('def expand_list(list):\n    for item in list:\n        list *= 2')
      True
      >>> detect_infinite_loop('def multiply_list(list):\n    for item in list:\n        item *= 2')
      False
      """
output:     import ast
  
      class InfiniteLoopDetector(ast.NodeVisitor):
          def __init__(self):
              self.has_infinite_loop = False
  
          def visit_While(self, node):
              if isinstance(node.test, ast.Constant) and node.test.value:
                  self.has_infinite_loop = True
              self.generic_visit(node)
  
          def visit_For(self, node):
              if isinstance(node.iter, ast.Call) and isinstance(node.iter.func, ast.Name) and node.iter.func.id == 'range':
                  pass
              else:
                  self.has_infinite_loop = True
              self.generic_visit(node)
  
      try:
          tree = ast.parse(code)
          detector = InfiniteLoopDetector()
          detector.visit(tree)
          return detector.has_infinite_loop
      except SyntaxError:
          return False