def _check_fscale(fscale):
    'Check for valid fscale.'
    if ((not isinstance(fscale, str)) or (fscale not in ('log', 'linear'))):
        raise ValueError(('fscale must be "log" or "linear", got %s' % (fscale,)))
Check for valid fscale.
def _check_fscale(fscale):
    
    if ((not isinstance(fscale, str)) or (fscale not in ('log', 'linear'))):
        raise ValueError(('fscale must be "log" or "linear", got %s' % (fscale,)))