<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _binaryconfig(path, conf, dtype=None, shape=None, credentials=None):
 """ Collects parameters to use for binary series loading. """

    import json
    from thunder.readers import get_file_reader, FileNotFoundError

    reader = get_file_reader(path)(credentials=credentials)
    try:
        buf = reader.read(path, filename=conf)
        params = json.loads(str(buf.decode('utf-8')))
    except FileNotFoundError:
        params = {}

    if dtype:
        params['dtype'] = dtype

    if shape:
        params['shape'] = shape

    if 'dtype' not in params.keys():
        raise ValueError('dtype not specified either in conf.json or as argument')

    if 'shape' not in params.keys():
        raise ValueError('shape not specified either in conf.json or as argument')

    return params['shape'], params['dtype']