<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _infer_sig_len(file_name, fmt, n_sig, dir_name, pb_dir=None):
 """ Infer the length of a signal from a dat file. Parameters file_name : str Name of the dat file fmt : str WFDB fmt of the dat file n_sig : int Number of signals contained in the dat file Notes ----- sig_len * n_sig * bytes_per_sample == file_size """

    if pb_dir is None:
        file_size = os.path.getsize(os.path.join(dir_name, file_name))
    else:
        file_size = download._remote_file_size(file_name=file_name,
                                               pb_dir=pb_dir)

    sig_len = int(file_size / (BYTES_PER_SAMPLE[fmt] * n_sig))

    return sig_len