def _check_fscale(fscale):
 if ((not isinstance(fscale, string_types)) or (fscale not in ('log', 'linear'))):
  raise ValueError(('fscale must be "log" or "linear", got %s' % (fscale,)))

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