Local maximal function and weights in a general setting