code: def pycomplex(v_str):
      
      assert isinstance(v_str, str)
  
      if v_str[0] == '(' and v_str[-1] == ')' and len(v_str.split(',')) == 2:
          v_re, v_im = v_str[1:-1].split(',', 1)
  
          # NOTE: Failed float(str) will raise ValueError
          return complex(pyfloat(v_re), pyfloat(v_im))
      else:
          raise ValueError('{0} must be in complex number form (x, y).'
                           ''.format(v_str))
docs: Convert string repr of Fortran complex to Python complex.