docstr: Return new list with first element equal to elem removed. O(k) where k is the position
  of the element that is removed.
  
  Raises ValueError if no matching element is found.
  
  >>> plist([1, 2, 1]).remove(1)
  plist([2, 1])
docstr_tok: ["Return","new","list","with","first","element","equal","to","elem","removed",".","O","(","k",")","where","k","is","the","position","of","the","element","that","is","removed",".","Raises","ValueError","if","no","matching","element","is","found",".",">",">",">","plist","(","[","1",",","2",",","1","]",")",".remove","(","1",")","plist","(","[","2",",","1","]",")"]
code: def remove(self, elem):
      """
      Return new list with first element equal to elem removed. O(k) where k is the position
      of the element that is removed.
  
      Raises ValueError if no matching element is found.
  
      >>> plist([1, 2, 1]).remove(1)
      plist([2, 1])
      """
  
      builder = _PListBuilder()
      head = self
      while head:
          if head.first == elem:
              return builder.append_plist(head.rest)
  
          builder.append_elem(head.first)
          head = head.rest
  
      raise ValueError("{0} not found in PList".format(elem))
  
imports: from ._compat import Sequence, Hashable
  from numbers import Integral
  from functools import reduce
label_desc: Use image node_id 14 for calling the _PListBase obj's underlying member method code with example usage: obj.remove(elem) and returns: builder