<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def qstd(x,quant=0.05,top=False,bottom=False):
 """returns std, ignoring outer 'quant' pctiles """

    s = np.sort(x)
    n = np.size(x)
    lo = s[int(n*quant)]
    hi = s[int(n*(1-quant))]
    if top:
        w = np.where(x>=lo)
    elif bottom:
        w = np.where(x<=hi)
    else:
        w = np.where((x>=lo)&(x<=hi))
    return np.std(x[w])