def FilterSet(df, annotSet="", annotSetArr=[], annotSetCompare="=", limit=0, negate=False):
  """Provide the ability to filter a Dataframe of AQAnnotations based on the value in the annotSet field.

  Args:
    df: Dataframe of AQAnnotations that will be filtered by the specified annotation set.
    annotSet: String to filter against the annotSet field in the dataset of AQAnnotations.
    annotSetArr: Array of Strings to filter against the annotSet field in the dataframe of AQAnnotations. An OR will be applied to the Strings.  Only used if annotSet was not specified.
    annotSetCompare: Comparison operator to use for the annotSet field in the dataframe of AQAnnotations.  Default is '='.  Possible values are '=' and '!='.
    limit: Number of AQAnnotations to return.
    negate: Whether to negate the entire query.  Default is false.

  Returns:
      Dataframe of AQAnnotations

  """
  query = ""

  if annotSet != "":

    query += ("annotSet " + annotSetCompare + " \"" + annotSet + "\"")

  elif len(annotSetArr) > 0:

      if annotSetCompare == "=":

        query += ("annotSet in " + "('" + "','".join(map(str,annotSetArr)) + "')")

      else:

        query += ("annotSet not in " + "('" + "','".join(map(str,annotSetArr)) + "')")

  if negate:

    query = "!(" + query + ")"

  results = df.filter(query)

  if limit > 0:

    results = results.limit(limit)

  return results