<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load(fin, dtype=np.float32, max_vocab=None):
 """ Load word embedding file. Args: fin (File):
 File object to read. File should be open for reading ascii. dtype (numpy.dtype):
 Element data type to use for the array. max_vocab (int):
 Number of vocabulary to read. Returns: numpy.ndarray: Word embedding representation vectors dict: Mapping from words to vector indices. """

    vocab = {}
    arr = None
    i = 0
    for line in fin:
        if max_vocab is not None and i >= max_vocab:
            break
        try:
            token, v = _parse_line(line, dtype)
        except (ValueError, IndexError):
            raise ParseError(b'Parsing error in line: ' + line)
        if token in vocab:
            parse_warn(b'Duplicated vocabulary ' + token)
            continue
        if arr is None:
            arr = np.array(v, dtype=dtype).reshape(1, -1)
        else:
            if arr.shape[1] != len(v):
                raise ParseError(b'Vector size did not match in line: ' + line)
            arr = np.append(arr, [v], axis=0)
        vocab[token] = i
        i += 1
    return arr, vocab