<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bench_dot(lhs_row_dim, lhs_col_dim, rhs_col_dim, density, rhs_density, dot_func, trans_lhs, lhs_stype, rhs_stype, only_storage, distribution="uniform"):
 """ Benchmarking both storage and dot """

    lhs_nd = rand_ndarray((lhs_row_dim, lhs_col_dim), lhs_stype, density, distribution=distribution)
    if not only_storage:
        rhs_nd = rand_ndarray((lhs_col_dim, rhs_col_dim), rhs_stype,
                              density=rhs_density, distribution=distribution)
        out = dot_func(lhs_nd, rhs_nd, trans_lhs)
    mx.nd.waitall()