def get_masked_string(s, p):
 return fromstring(s, dtype=uint8)[p].tostring()

def get_masked_string ( s , p ) : return fromstring ( s , dtype = uint8 ) [ p ] . tostring ( )
extracts valid positions in string s using index array p .