input: Write a function to create a `ListNode` class in Python, which will be used to create linked list nodes. Each node should have a data field and a next field that points to the next node in the list. If the given input is empty, the function should return None.
  
  class ListNode:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  assert ListNode(5).data == 5
  assert ListNode(5).next == None
  assert ListNode(10).data == 10
  assert ListNode(10).next == None
  assert ListNode(None) == None
output: class ListNode:
      def __init__(self, data):
          if data is None:
              return None
          self.data = data
          self.next = None