(cls, query_results, sample_rate)
return cls.SampleQueryResultsMax(
        query_results, query_results['totalRows'] * sample_rate)
Down samples a query results keep only the sample_rate fraction.

    Returns the data in the same format.  See query method for the expected
    format.  Exactly sample_rate * number of results will be returned.  We use
    a consistent seed so calling this method multiple times with the same args
    will give the same result.

    Args:
      query_results: The query result that you want to downsample.
      sample_rate: float, The fraction of data to keep.  Should be between 0
          and 1 inclusive.

    Raises:
      SamplingError: If sample rate is greater than 1 or less than 0

    Returns:
      The downsampled results.
Down samples a query results keep only the sample_rate fraction.
Down samples a query results keep only the sample_rate fraction .
def SampleQueryResultsFraction(cls, query_results, sample_rate):
    """Down samples a query results keep only the sample_rate fraction.

    Returns the data in the same format.  See query method for the expected
    format.  Exactly sample_rate * number of results will be returned.  We use
    a consistent seed so calling this method multiple times with the same args
    will give the same result.

    Args:
      query_results: The query result that you want to downsample.
      sample_rate: float, The fraction of data to keep.  Should be between 0
          and 1 inclusive.

    Raises:
      SamplingError: If sample rate is greater than 1 or less than 0

    Returns:
      The downsampled results.
    """
    if sample_rate < 0 or sample_rate > 1:
      raise SamplingError(
          'The sample_rate must be between 0 and 1 inclusive.  Instead it was '
          '%s.' % sample_rate)

    if sample_rate == 1:
      return query_results

    return cls.SampleQueryResultsMax(
        query_results, query_results['totalRows'] * sample_rate)
def SampleQueryResultsFraction ( cls , query_results , sample_rate ) : if sample_rate < 0 or sample_rate > 1 : raise SamplingError ( 'The sample_rate must be between 0 and 1 inclusive.  Instead it was ' '%s.' % sample_rate ) if sample_rate == 1 : return query_results return cls . SampleQueryResultsMax ( query_results , query_results [ 'totalRows' ] * sample_rate )