text:
Drive API . comments

Instance Methods

  close()

Close httplib2 connections.

  delete(fileId, commentId)

Deletes a comment.

  get(fileId, commentId, includeDeleted=None)

Gets a comment by ID.

  insert(fileId, body=None)

Creates a new comment on the given file.

  list(fileId, includeDeleted=None, maxResults=None, pageToken=None, updatedMin=None)

Lists a file's comments.

  list_next()

Retrieves the next page of results.

  patch(fileId, commentId, body=None)

Updates an existing comment.

  update(fileId, commentId, body=None)

Updates an existing comment.

Method Details

    close()

Close httplib2 connections.

    delete(fileId, commentId)

Deletes a comment.

Args:
  fileId: string, The ID of the file. (required)
  commentId: string, The ID of the comment. (required)

    get(fileId, commentId, includeDeleted=None)

Gets a comment by ID.

Args:
  fileId: string, The ID of the file. (required)
  commentId: string, The ID of the comment. (required)
  includeDeleted: boolean, If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.

Returns:
  An object of the form:

    { # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

    insert(fileId, body=None)

Creates a new comment on the given file.

Args:
  fileId: string, The ID of the file. (required)
  body: object, The request body.
    The object takes the form of:

{ # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

Returns:
  An object of the form:

    { # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

    list(fileId, includeDeleted=None, maxResults=None, pageToken=None, updatedMin=None)

Lists a file's comments.

Args:
  fileId: string, The ID of the file. (required)
  includeDeleted: boolean, If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.
  maxResults: integer, The maximum number of discussions to include in the response, used for paging.
  pageToken: string, The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
  updatedMin: string, Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.

Returns:
  An object of the form:

    { # A list of comments on a file in Google Drive.
  "items": [ # The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
    { # A comment on a file in Google Drive.
      "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
      "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "commentId": "A String", # The ID of the comment.
      "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
      "context": { # The context of the file which is being commented on.
        "type": "A String", # The MIME type of the context snippet.
        "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
      },
      "createdDate": "A String", # The date when this comment was first created.
      "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
      "fileId": "A String", # The file which this comment is addressing.
      "fileTitle": "A String", # The title of the file which this comment is addressing.
      "htmlContent": "A String", # HTML formatted content for this comment.
      "kind": "drive#comment", # This is always drive#comment.
      "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
      "replies": [ # Replies to this post.
        { # A comment on a file in Google Drive.
          "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
            "displayName": "A String", # A plain text displayable name for this user.
            "emailAddress": "A String", # The email address of the user.
            "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
            "kind": "drive#user", # This is always drive#user.
            "permissionId": "A String", # The user's ID as visible in the permissions collection.
            "picture": { # The user's profile picture.
              "url": "A String", # A URL that points to a profile picture of this user.
            },
          },
          "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
          "createdDate": "A String", # The date when this reply was first created.
          "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
          "htmlContent": "A String", # HTML formatted content for this reply.
          "kind": "drive#commentReply", # This is always drive#commentReply.
          "modifiedDate": "A String", # The date when this reply was last modified.
          "replyId": "A String", # The ID of the reply.
          "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
              # - "resolve" - To resolve a comment.
              # - "reopen" - To reopen (un-resolve) a comment.
        },
      ],
      "selfLink": "A String", # A link back to this comment.
      "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
          # - "open" - The comment is still open.
          # - "resolved" - The comment has been resolved by one of its replies.
    },
  ],
  "kind": "drive#commentList", # This is always drive#commentList.
  "nextLink": "A String", # A link to the next page of comments.
  "nextPageToken": "A String", # The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
  "selfLink": "A String", # A link back to this list.
}

    list_next()

Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.

    patch(fileId, commentId, body=None)

Updates an existing comment.

Args:
  fileId: string, The ID of the file. (required)
  commentId: string, The ID of the comment. (required)
  body: object, The request body.
    The object takes the form of:

{ # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

Returns:
  An object of the form:

    { # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

    update(fileId, commentId, body=None)

Updates an existing comment.

Args:
  fileId: string, The ID of the file. (required)
  commentId: string, The ID of the comment. (required)
  body: object, The request body.
    The object takes the form of:

{ # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}

Returns:
  An object of the form:

    { # A comment on a file in Google Drive.
  "anchor": "A String", # A region of the document represented as a JSON string. For details on defining anchor properties, refer to  Add comments and replies.
  "author": { # Information about a Drive user. # The author of the comment. The author's email address and permission ID will not be populated.
    "displayName": "A String", # A plain text displayable name for this user.
    "emailAddress": "A String", # The email address of the user.
    "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
    "kind": "drive#user", # This is always drive#user.
    "permissionId": "A String", # The user's ID as visible in the permissions collection.
    "picture": { # The user's profile picture.
      "url": "A String", # A URL that points to a profile picture of this user.
    },
  },
  "commentId": "A String", # The ID of the comment.
  "content": "A String", # The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content.
  "context": { # The context of the file which is being commented on.
    "type": "A String", # The MIME type of the context snippet.
    "value": "A String", # Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about.
  },
  "createdDate": "A String", # The date when this comment was first created.
  "deleted": True or False, # Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed.
  "fileId": "A String", # The file which this comment is addressing.
  "fileTitle": "A String", # The title of the file which this comment is addressing.
  "htmlContent": "A String", # HTML formatted content for this comment.
  "kind": "drive#comment", # This is always drive#comment.
  "modifiedDate": "A String", # The date when this comment or any of its replies were last modified.
  "replies": [ # Replies to this post.
    { # A comment on a file in Google Drive.
      "author": { # Information about a Drive user. # The author of the reply. The author's email address and permission ID will not be populated.
        "displayName": "A String", # A plain text displayable name for this user.
        "emailAddress": "A String", # The email address of the user.
        "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
        "kind": "drive#user", # This is always drive#user.
        "permissionId": "A String", # The user's ID as visible in the permissions collection.
        "picture": { # The user's profile picture.
          "url": "A String", # A URL that points to a profile picture of this user.
        },
      },
      "content": "A String", # The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen).
      "createdDate": "A String", # The date when this reply was first created.
      "deleted": True or False, # Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed.
      "htmlContent": "A String", # HTML formatted content for this reply.
      "kind": "drive#commentReply", # This is always drive#commentReply.
      "modifiedDate": "A String", # The date when this reply was last modified.
      "replyId": "A String", # The ID of the reply.
      "verb": "A String", # The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are:
          # - "resolve" - To resolve a comment.
          # - "reopen" - To reopen (un-resolve) a comment.
    },
  ],
  "selfLink": "A String", # A link back to this comment.
  "status": "A String", # The status of this comment. Status can be changed by posting a reply to a comment with the desired status.
      # - "open" - The comment is still open.
      # - "resolved" - The comment has been resolved by one of its replies.
}


text:
"""Utilities for collecting TFLite metrics."""

import collections
import enum
import functools
from typing import Text

from tensorflow.lite.python.metrics import converter_error_data_pb2
from tensorflow.lite.python.metrics import metrics

class Component(enum.Enum):
  """Enum class defining name of the converter components."""
  # Validate the given input and prepare and optimize TensorFlow Model.
  PREPARE_TF_MODEL = "PREPARE_TF_MODEL"

  # Convert to TFLite model format.
  CONVERT_TF_TO_TFLITE_MODEL = "CONVERT_TF_TO_TFLITE_MODEL"

  # RUN quantization and sparsification.
  OPTIMIZE_TFLITE_MODEL = "OPTIMIZE_TFLITE_MODEL"

SubComponentItem = collections.namedtuple("SubComponentItem",
                                          ["name", "component"])

class SubComponent(enum.Enum):
  """Enum class defining name of the converter subcomponents.

  This enum only defines the subcomponents in Python, there might be more
  subcomponents defined in C++.
  """

  def __str__(self):
    return self.value.name

  @property
  def name(self):
    return self.value.name

  @property
  def component(self):
    return self.value.component

  # The subcomponent name is unspecified.
  UNSPECIFIED = SubComponentItem("UNSPECIFIED", None)

  # Valid the given input and parameters.
  VALIDATE_INPUTS = SubComponentItem("VALIDATE_INPUTS",
                                     Component.PREPARE_TF_MODEL)

  # Load GraphDef from SavedModel.
  LOAD_SAVED_MODEL = SubComponentItem("LOAD_SAVED_MODEL",
                                      Component.PREPARE_TF_MODEL)

  # Convert a SavedModel to frozen graph.
  FREEZE_SAVED_MODEL = SubComponentItem("FREEZE_SAVED_MODEL",
                                        Component.PREPARE_TF_MODEL)

  # Save a Keras model to SavedModel.
  CONVERT_KERAS_TO_SAVED_MODEL = SubComponentItem(
      "CONVERT_KERAS_TO_SAVED_MODEL", Component.PREPARE_TF_MODEL)

  # Save Concrete functions to SavedModel.
  CONVERT_CONCRETE_FUNCTIONS_TO_SAVED_MODEL = SubComponentItem(
      "CONVERT_CONCRETE_FUNCTIONS_TO_SAVED_MODEL", Component.PREPARE_TF_MODEL)

  # Convert a Keras model to a frozen graph.
  FREEZE_KERAS_MODEL = SubComponentItem("FREEZE_KERAS_MODEL",
                                        Component.PREPARE_TF_MODEL)

  # Replace all the variables with constants in a ConcreteFunction.
  FREEZE_CONCRETE_FUNCTION = SubComponentItem("FREEZE_CONCRETE_FUNCTION",
                                              Component.PREPARE_TF_MODEL)

  # Run grappler optimization.
  OPTIMIZE_TF_MODEL = SubComponentItem("OPTIMIZE_TF_MODEL",
                                       Component.PREPARE_TF_MODEL)

  # Convert using the old TOCO converter.
  CONVERT_GRAPHDEF_USING_DEPRECATED_CONVERTER = SubComponentItem(
      "CONVERT_GRAPHDEF_USING_DEPRECATED_CONVERTER",
      Component.CONVERT_TF_TO_TFLITE_MODEL)

  # Convert a GraphDef to TFLite model.
  CONVERT_GRAPHDEF = SubComponentItem("CONVERT_GRAPHDEF",
                                      Component.CONVERT_TF_TO_TFLITE_MODEL)

  # Convert a SavedModel to TFLite model.
  CONVERT_SAVED_MODEL = SubComponentItem("CONVERT_SAVED_MODEL",
                                         Component.CONVERT_TF_TO_TFLITE_MODEL)

  # Convert a Jax HLO to TFLite model.
  CONVERT_JAX_HLO = SubComponentItem("CONVERT_JAX_HLO",
                                     Component.CONVERT_TF_TO_TFLITE_MODEL)

  # Do quantization by the deprecated quantizer.
  QUANTIZE_USING_DEPRECATED_QUANTIZER = SubComponentItem(
      "QUANTIZE_USING_DEPRECATED_QUANTIZER", Component.OPTIMIZE_TFLITE_MODEL)

  # Do calibration.
  CALIBRATE = SubComponentItem("CALIBRATE", Component.OPTIMIZE_TFLITE_MODEL)

  # Do quantization by MLIR.
  QUANTIZE = SubComponentItem("QUANTIZE", Component.OPTIMIZE_TFLITE_MODEL)

  # Do sparsification by MLIR.
  SPARSIFY = SubComponentItem("SPARSIFY", Component.OPTIMIZE_TFLITE_MODEL)

class ConverterError(Exception):
  """Raised when an error occurs during model conversion."""

  def __init__(self, message):
    super(ConverterError, self).__init__(message)
    self.errors = []
    self._parse_error_message(message)

  def append_error(self,
                   error_data: converter_error_data_pb2.ConverterErrorData):
    self.errors.append(error_data)

  def _parse_error_message(self, message):
    """If the message matches a pattern, assigns the associated error code.

    It is difficult to assign an error code to some errrors in MLIR side, Ex:
    errors thrown by other components than TFLite or not using mlir::emitError.
    This function try to detect them by the error message and assign the
    corresponding error code.

    Args:
      message: The error message of this exception.
    """
    error_code_mapping = {
        "Failed to functionalize Control Flow V1 ops. Consider using Control "
        "Flow V2 ops instead. See https://www.tensorflow.org/api_docs/python/"
        "tf/compat/v1/enable_control_flow_v2.":
            converter_error_data_pb2.ConverterErrorData
            .ERROR_UNSUPPORTED_CONTROL_FLOW_V1,
    }
    for pattern, error_code in error_code_mapping.items():
      if pattern in message:
        error_data = converter_error_data_pb2.ConverterErrorData()
        error_data.error_message = message
        error_data.error_code = error_code
        self.append_error(error_data)
        return

def convert_phase(component, subcomponent=SubComponent.UNSPECIFIED):
  """The decorator to identify converter component and subcomponent.

  Args:
    component: Converter component name.
    subcomponent: Converter subcomponent name.

  Returns:
    Forward the result from the wrapped function.

  Raises:
    ValueError: if component and subcomponent name is not valid.
  """
  if component not in Component:
    raise ValueError("Given component name not found")
  if subcomponent not in SubComponent:
    raise ValueError("Given subcomponent name not found")
  if (subcomponent != SubComponent.UNSPECIFIED and
      subcomponent.component != component):
    raise ValueError("component and subcomponent name don't match")

  def report_error(error_data: converter_error_data_pb2.ConverterErrorData):
    # Always overwrites the component information, but only overwrites the
    # subcomponent if it is not available.
    error_data.component = component.value
    if not error_data.subcomponent:
      error_data.subcomponent = subcomponent.name
    tflite_metrics = metrics.TFLiteConverterMetrics()
    tflite_metrics.set_converter_error(error_data)

  def report_error_message(error_message: Text):
    error_data = converter_error_data_pb2.ConverterErrorData()
    error_data.error_message = error_message
    report_error(error_data)

  def actual_decorator(func):

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
      try:
        return func(*args, **kwargs)
      except ConverterError as converter_error:
        if converter_error.errors:
          for error_data in converter_error.errors:
            report_error(error_data)
        else:
          report_error_message(str(converter_error))
        raise converter_error from None  # Re-throws the exception.
      except Exception as error:
        report_error_message(str(error))
        raise error from None  # Re-throws the exception.

    return wrapper

  return actual_decorator

redpajama_set_name: RedPajamaGithub


text:
'use strict';

const passport = require('passport');
const Strategy = require('passport-twitter');

// Database access and config variables
const db     = require('../db');
const config = require('../config');

if ( ! config.auth.social.twitter ) {
	throw new Error(
		'AUTH: There is no API config for TWITTER. ' +
		'Visit file assets/js/config.js for that matter.'
	);
}

// Register a new strategy
passport.use(

	// Name
	'twitter',

	// Parameters
	new Strategy({
		consumerKey    : config.auth.social.twitter.key,
		consumerSecret : config.auth.social.twitter.secret,
		callbackURL    : `${config.server.protocol}://${config.server.domain}/auth/social/twitter/callback`,
	},

	// User data
	(token, refresh, profile, cb) => {

		db.models.User.findOne(
			{ 'auth.kind': 'twitter', 'auth.id': profile.id },
			(err, user) => {

				if (err) {
					console.error('DB error at find user (twitter).');
					return cb(new Error('DB error at find user (twitter).'));
				}

				if (user) {
					return cb(null, user);
				}

				user = new db.models.User({

					auth: {
						kind: 'twitter',
						id  : profile.id,
						token,
					},

				});

				user.save(err => cb(err, err ? null : user));

			}
		);

	})

);


text:
package org.sakaiproject.nakamura.solr.handlers;

import java.util.Iterator;
import java.util.NoSuchElementException;

public abstract class IterableWrapper<T> implements Iterable<T> {

  private Object[] array;

  public IterableWrapper(Object[] v) {
    if (v != null) {
      array = new Object[v.length];
      System.arraycopy(v, 0, array, 0, v.length);
    }
  }

  public Iterator<T> iterator() {
    return new Iterator<T>() {
      int p = 0;

      public boolean hasNext() {
        return array != null && p < array.length;
      }

      public T next() {
        try {
          return getValue(array[p++]);
        } catch (ArrayIndexOutOfBoundsException e) {
          throw new NoSuchElementException();
        }
      }

      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
  }

  protected abstract T getValue(Object object);
}


text:
class LinkedService < ApplicationRecord
  belongs_to :app
  belongs_to :service

  enum status: { installing: 0, installed: 1 }
end


text:
package spacesettlers.clients;

import java.awt.Point;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import spacesettlers.actions.AbstractAction;
import spacesettlers.actions.DoNothingAction;
import spacesettlers.actions.MoveAction;
import spacesettlers.actions.PurchaseCosts;
import spacesettlers.actions.PurchaseTypes;
import spacesettlers.actions.RawAction;
import spacesettlers.game.AbstractGameAgent;
import spacesettlers.graphics.LineGraphics;
import spacesettlers.graphics.SpacewarGraphics;
import spacesettlers.graphics.StarGraphics;
import spacesettlers.objects.AbstractActionableObject;
import spacesettlers.objects.AbstractObject;
import spacesettlers.objects.Ship;
import spacesettlers.objects.powerups.SpaceSettlersPowerupEnum;
import spacesettlers.objects.resources.ResourcePile;
import spacesettlers.simulator.Toroidal2DPhysics;
import spacesettlers.utilities.Position;
import spacesettlers.utilities.Vector2D;
/**
 * The human client (parses key strokes to fly a single ship)
 * @author amy
 *
 */
public class HumanTeamClient extends TeamClient {
	public enum HumanKeyPressed {
		UP, DOWN, RIGHT, LEFT, FIRE, NONE;
	}

	/**
	 * The last key pressed by the human (to be used in getting the action)
	 */
	HumanKeyPressed lastKeyPressed;

	private static double HUMAN_ACCEL = 5.0;
	private static double HUMAN_TURN_ACCEL = 0.5;

	/**
	 * The keyboard listener for the human client
	 */
	HumanClientKeyListener humanKeyListener;

	/**
	 * The mouse listener for the human client
	 */
	HumanMouseListener humanMouseListener;

	/**
	 * Last place the human clicked
	 */
	Position lastMouseClick;

	/**
	 * The action to move to the last click
	 */
	AbstractAction mouseClickMove;

	/**
	 * Minimum distance clicks need to be apart before it will move the ship again
	 */
	public double CLICK_DISTANCE = 5;

	/**
	 * graphics to add in each step (if graphics are on, otherwise it is ignored)
	 */
	private ArrayList<SpacewarGraphics> graphicsToAdd;

	@Override
	public void initialize(Toroidal2DPhysics space) {
		humanKeyListener = new HumanClientKeyListener();
		humanMouseListener = new HumanMouseListener();
		lastMouseClick = null;
		mouseClickMove = null;
		graphicsToAdd = new ArrayList<SpacewarGraphics>();
	}

	@Override
	public void shutDown(Toroidal2DPhysics space) {
		// TODO Auto-generated method stub

	}

	/**
	 * Look at the last key pressed by the human and do its movement
	 */
	@Override
	public Map<UUID, AbstractAction> getMovementStart(Toroidal2DPhysics space,
			Set<AbstractActionableObject> actionableObjects) {
		HashMap<UUID, AbstractAction> actions = new HashMap<UUID, AbstractAction>();
		for (AbstractObject actionable : actionableObjects) {
			if (actionable instanceof Ship) {
				// get the current position
				Ship ship = (Ship) actionable;
				Position myPosition = ship.getPosition();
				Vector2D currentVelocity = myPosition.getTranslationalVelocity();
				RawAction action = null;
				double angularVel = myPosition.getAngularVelocity();

				// if the key was up or down, accelerate along the current line
				if (lastKeyPressed == HumanKeyPressed.UP) {
					Vector2D newVel = new Vector2D(HUMAN_ACCEL * Math.cos(myPosition.getOrientation()),
							HUMAN_ACCEL * Math.sin(myPosition.getOrientation()));
					newVel.add(currentVelocity);
					action = new RawAction(newVel, 0);
				} else if (lastKeyPressed == HumanKeyPressed.DOWN) {
					Vector2D newVel = new Vector2D(-HUMAN_ACCEL * Math.cos(myPosition.getOrientation()),
							-HUMAN_ACCEL * Math.sin(myPosition.getOrientation()));
					newVel.add(currentVelocity);
					action = new RawAction(newVel, 0);
				}

				// if the key was right or left, turn
				if (lastKeyPressed == HumanKeyPressed.RIGHT) {
					action = new RawAction(0, HUMAN_TURN_ACCEL);
				} else if (lastKeyPressed == HumanKeyPressed.LEFT) {
					action = new RawAction(0, -HUMAN_TURN_ACCEL);
				}

				// was the mouse clicked?
				if (lastMouseClick != null) {
					if (mouseClickMove == null || mouseClickMove.isMovementFinished(space) || space.findShortestDistance(lastMouseClick, myPosition) > CLICK_DISTANCE) {
						mouseClickMove = new MoveAction(space, myPosition, lastMouseClick);

						graphicsToAdd.add(new StarGraphics(3, super.teamColor, lastMouseClick));
						LineGraphics line = new LineGraphics(myPosition, lastMouseClick,
								space.findShortestDistanceVector(myPosition, lastMouseClick));
						line.setLineColor(super.teamColor);
						graphicsToAdd.add(line);

					}
					actions.put(actionable.getId(), mouseClickMove);
				} else {
					actions.put(actionable.getId(), action);
				}

			} else {
				// can't really control anything but the ship
				actions.put(actionable.getId(), new DoNothingAction());
			}
		}
		return actions;
	}

	@Override
	public void getMovementEnd(Toroidal2DPhysics space, Set<AbstractActionableObject> actionableObjects) {
		// reset so the human has to press again to move again (otherwise
		// it does strange things like fly when you don't tell it anything on
		// acceleration!)
		lastKeyPressed = HumanKeyPressed.NONE;
		for (AbstractObject actionable : actionableObjects) {
			if (actionable instanceof Ship) {
				Ship ship = (Ship) actionable;
				if (!ship.isAlive()) {
					lastMouseClick = null;
					mouseClickMove = null;
				}
			}
		}
	}

	@Override
	public Set<SpacewarGraphics> getGraphics() {
		HashSet<SpacewarGraphics> graphics = new HashSet<SpacewarGraphics>();
		graphics.addAll(graphicsToAdd);
		graphicsToAdd.clear();
		return graphics;
	}

	@Override
	/**
	 * Human purchases (right now it never purchases, this will be added to the UI later)
	 */
	public Map<UUID, PurchaseTypes> getTeamPurchases(Toroidal2DPhysics space,
			Set<AbstractActionableObject> actionableObjects,
			ResourcePile resourcesAvailable,
			PurchaseCosts purchaseCosts) {
		// TODO Auto-generated method stub
		return new HashMap<UUID,PurchaseTypes>();
	}

	@Override
	public Map<UUID, SpaceSettlersPowerupEnum> getPowerups(Toroidal2DPhysics space,
			Set<AbstractActionableObject> actionableObjects) {
		HashMap<UUID, SpaceSettlersPowerupEnum> powerUps = new HashMap<UUID, SpaceSettlersPowerupEnum>();

		if (lastKeyPressed == HumanKeyPressed.FIRE) {
			for (AbstractActionableObject actionableObject : actionableObjects){
				SpaceSettlersPowerupEnum powerup = SpaceSettlersPowerupEnum.FIRE_MISSILE;
				powerUps.put(actionableObject.getId(), powerup);
			}
		}

		return powerUps;

	}

	@Override
	public KeyAdapter getKeyAdapter() {
		return humanKeyListener;
	}

	/**
	 * The key listener for the human client (internal class)
	 *
	 * using any arrow keys (numeric or not):
	 * 		up means accelerate forward
	 * 		down means decelerate
	 * 		right means turn right
	 * 		left means turn left
	 *
	 * space means fire
	 *
	 * @author amy
	 *
	 */
	class HumanClientKeyListener extends KeyAdapter {
		@Override
		public void keyPressed(KeyEvent e) {
			int key = e.getKeyCode();
			//System.out.println("human pressed " + key);

			if (key == KeyEvent.VK_UP || key == KeyEvent.VK_KP_UP) {
				// UP means accelerate forward
				lastKeyPressed = HumanKeyPressed.UP;
				//System.out.println("human pressed UP ");
			} else if (key == KeyEvent.VK_DOWN || key == KeyEvent.VK_KP_DOWN) {
				// DOWN means decelerate
				lastKeyPressed = HumanKeyPressed.DOWN;
			} else if (key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_KP_RIGHT) {
				// turn RIGHT
				lastKeyPressed = HumanKeyPressed.RIGHT;
			} else if (key == KeyEvent.VK_LEFT || key == KeyEvent.VK_KP_LEFT) {
				// turn LEFT
				lastKeyPressed = HumanKeyPressed.LEFT;
			} else if (key == KeyEvent.VK_SPACE) {
				// fire
				lastKeyPressed = HumanKeyPressed.FIRE;
			}

			if (lastKeyPressed != null) {
				lastMouseClick = null;
			}
		}
	}

	@Override
	public MouseAdapter getMouseAdapter(AffineTransform mouseTransform) {
		this.mouseTransform = mouseTransform;

		return humanMouseListener;
	}

	/**
	 * Human mouse interface.  To move, click somewhere on the screen and the ship does a MoveAction to that point.
	 * Don't forget space is toroidal!
	 *
	 * @author amy
	 *
	 */
	class HumanMouseListener extends MouseAdapter {
		@Override
		public void mouseReleased(MouseEvent e) {
			Point point = e.getPoint();

			Point2D newPoint = new Point2D.Double(0, 0);
			mouseTransform.transform(point, newPoint);

			// only listen to the right button
			if (e.getButton() == MouseEvent.BUTTON3 || e.isAltDown()) {
				//System.out.println("User right clicked at " + point.x + ", " + point.y);
				lastMouseClick = new Position(newPoint.getX(), newPoint.getY());
			}
		}
	}

	@Override
	public Map<UUID, AbstractGameAgent> getGameSearch(Toroidal2DPhysics space,
			Set<AbstractActionableObject> actionableObjects) {
		// TODO Auto-generated method stub
		return null;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources name="en" flag="gb" title="English">
	<string_add name="_bx_orgs_option_per_page_browse"><![CDATA[Number of items per page]]></string_add>
	<string_add name="_bx_orgs_option_searchable_fields"><![CDATA[Searchable fields]]></string_add>
	<string_add name="_bx_orgs_page_title_browse_by_acl"><![CDATA[{0} Organizations]]></string_add>
</resources>


text:
<?php

class Bets extends MY_Controller {
    const ROBOT_USER_ID = 13;

    public function __construct()
    {
        parent::__construct();
        $this->load->model('bet_model');
        $this->load->model('log_model');
    }

    public function index()
    {
        Save_log('bets', 'index');
        if (!user_can('view_bets')) {
            show_404();
        }

        $data = array();
        $data['title'] = $this->lang->line('bets');

        // Récupération des éventuels filtres
        $filters['filters_bets'] = array(
            'championship' => '',
            'fixture' => '',
        );
        if (isset($this->session->filters_bets)) {
            $filters['filters_bets'] = $this->session->filters_bets;
        }
        $post = $this->input->post();
        if (!empty($post)) {
            if ($post['submit'] == $this->lang->line('del_filter')) {
                $filters['filters_bets']['championship'] = '';
                $filters['filters_bets']['fixture'] = '';
            } else {
                $filters['filters_bets']['championship'] = ($post['championship'] == 0) ? '' : $post['championship'];
                $filters['filters_bets']['fixture'] = ($post['fixture'] == 0) ? '' : $post['fixture'];
            }
            $this->session->set_userdata($filters);
        }

        if ($filters['filters_bets']['championship'] !== '' || $filters['filters_bets']['fixture'] !== '') {
            $data['collapse_filters'] = 'in';
        } else {
            $data['collapse_filters'] = '';
        }
        $data['filters_bets'] = $filters['filters_bets'];

        $select = 'fixture_id,
                   fixture.name AS fixture_name,
                   championship.championship_id,
                   championship.name AS championship_name,
                   fixture.status';
        $where = array('championship.status' => 'open');
        if (isset($filters['filters_bets']['championship']) && $filters['filters_bets']['championship']!='') {
            $where = array_merge($where, array('championship.championship_id' => $filters['filters_bets']['championship']));
        }
        if (isset($filters['filters_bets']['fixture']) && $filters['filters_bets']['fixture']!='') {
            $where = array_merge($where, array('fixture.fixture_id' => $filters['filters_bets']['fixture']));
        }
        // $order = 'championship_name ASC, cast(fixture_name AS UNSIGNED) ASC';
        $order = 'championship_name ASC, fixture_id';
        $data['fixtures'] = $this->db->select($select)
                                     ->from($this->config->item('fixture', 'table'))
                                     ->where($where)
                                     ->join('championship', 'championship.championship_id = fixture.championship_id', 'left')
                                     ->order_by($order)
                                     ->get()
                                     ->result();
        // Récupération des championnats pour les filtres
        $championship = '';
        $data['championships'] = array();
        foreach ($data['fixtures'] as $key => $fixture_infos) {
            $fixture_infos->dates = Fixture_dates($fixture_infos->fixture_id);
            if ($fixture_infos->championship_name !== $championship) {
                $data['championships'][$fixture_infos->championship_id] = $fixture_infos->championship_name;
                $championship = $fixture_infos->championship_name;
            }
        }

        // Récupération du message d'information pour les pronostics
        $language = $this->session->user->language;
        if (empty($language)) {
            $language = 'french';
        }
        $this->load->model('message_model');
        $data['bet_message'] = $this->message_model->get_message('bet-message');
        if ($data['bet_message'] !== '') {
            $data['bet_message'] = $data['bet_message'][0]->{$language.'_content'};
        }
        $data['bet_message'] = html_entity_decode($data['bet_message']);

        $this->load->view('templates/header', $data);
        $this->load->view('templates/nav');
        $this->load->view('bets/index', $data);
        $this->load->view('templates/footer');
    }

    public function edit($fixture_id = 0)
    {
        Save_log('bets', 'edit', 'Affichage édition journée : '.$fixture_id);
        if (!user_can('edit_bet')) {
            show_404();
        }

        if ($fixture_id === 0) {
            show_404();
        }

        $data = array();
        $data['title'] = $this->lang->line('add_edit_bet');

        // Récupération des utilisateurs pour voir leurs paris
        $this->load->model('user_model');
        $where = array(
            'user_id !=' => $this->session->user->user_id,
            'user.active' => 1,
        );
        $nb = null;
        $debut = null;
        $order = 'user_id ASC';
        $data['users'] = $this->user_model->read('user_id, user_name, rand_userid', $where, $nb, $debut, $order);

        foreach ($data['users'] as $users_item) {
            $users_item->user_name = ($users_item->user_name === '') ? $this->lang->line('anonymous').' - '.$users_item->rand_userid : $users_item->user_name;
        }

        // Récupération des éventuels paris d'autres joueurs
        $filters['bets_of_players'] = array();
        $post = $this->input->post();
        if (!empty($post)) {
            if (isset($post['submit-filter']) && $post['submit-filter'] == $this->lang->line('del_filter')) {
                $filters['bets_of_players'] = array();
            } else {
                if (isset($post['users'])) {
                    $filters['bets_of_players'] = $post['users'];
                } else {
                    if (isset($this->session->bets_of_players)) {
                        $filters['bets_of_players'] = $this->session->bets_of_players;
                    } else {
                        $filters['bets_of_players'] = array();
                    }
                }
            }
            $this->session->set_userdata($filters);
        } else if (isset($this->session->bets_of_players)) {
            $filters['bets_of_players'] = $this->session->bets_of_players;
        }

        if (!empty($filters['bets_of_players'])) {
            $data['collapse_filters'] = 'in';
        } else {
            $data['collapse_filters'] = '';
        }
        $data['bets_of_players'] = $filters['bets_of_players'];

        $data['fixture_id'] = $fixture_id;

        // Liste des matchs de la journée
        $select = 'championship.name AS championship_name,
                   fixture.name AS fixture_name,
                   fixture.status AS fixture_status,
                   t1.team_id AS t1_id,
                   t2.team_id AS t2_id,
                   t1.name AS team1,
                   t2.name AS team2,
                   t1.short_name AS short_team1,
                   t2.short_name AS short_team2,
                   DATE_FORMAT(match.date, "%d/%m/%Y à %Hh%i") AS formated_date,
                   match.date,
                   match.match_id,
                   match.team1_score,
                   match.team2_score,
                   IF (championship.name NOT LIKE "%Ligue 1%", "no-logo", "") as no_logo,
                   championship.sport';
        $where = array(
            'fixture.fixture_id' => $fixture_id,
        );
        $nb = null;
        $debut = null;
        $order = 'date ASC, match.match_id';
        $data['fixture_matches'] = $this->db->select($select)
                                            ->from($this->config->item('fixture', 'table'))
                                            ->join('match', 'fixture.fixture_id = match.fixture_id', 'left')
                                            ->join('championship', 'fixture.championship_id = championship.championship_id', 'left')
                                            ->join('team t1', 'match.team1_id = t1.team_id', 'inner')
                                            ->join('team t2', 'match.team2_id = t2.team_id', 'inner')
                                            ->where($where)
                                            ->limit($nb, $debut)
                                            ->order_by($order)
                                            ->get()
                                            ->result();

        if (!empty($data['fixture_matches'])) {
            $data['championship_name'] = $data['fixture_matches'][0]->championship_name;
            $championship_sport = $data['fixture_matches'][0]->sport;
            $data['championship_sport'] = $championship_sport;
            $data['fixture_name'] = $data['fixture_matches'][0]->fixture_name;
            $data['fixture_status'] = $data['fixture_matches'][0]->fixture_status;

            // Liste des équipes
            $data['teams'] = array();
            foreach ($data['fixture_matches'] as $key => $fixture_match) {
                $data['teams'][$fixture_match->t1_id] = $fixture_match->team1;
                $data['teams'][$fixture_match->t2_id] = $fixture_match->team2;
            }
            asort($data['teams']);

            // Liste des matchs
            $data['matches'] = array();
            foreach ($data['fixture_matches'] as $key => $fixture_match) {
                $data['matches'][$fixture_match->match_id] = $fixture_match->date;
            }

            // Liste des paris de l'utilisateur pour la journée
            $select = 'user_id,
                       bet.match_id,
                       bet.team1_score,
                       bet.team2_score,
                       bet.score';
            $where = array(
                'bet.user_id' => $this->session->user->user_id,
                'match.fixture_id' => $fixture_id,
            );
            $order = 'match.date ASC, match.match_id';
            $data['my_fixture_bets'] = $this->db->select($select)
                                             ->from($this->config->item('bet', 'table'))
                                             ->join('match', 'bet.match_id = match.match_id', 'left')
                                             ->join('fixture', 'match.fixture_id = fixture.fixture_id', 'left')
                                             ->where($where);
            $data['my_fixture_bets'] = $data['my_fixture_bets']->order_by($order)
                                                         ->get()
                                                         ->result();

            // Liste des paris des autres joueurs pour la journée
            if (!empty($filters['bets_of_players'])) {
                $select = 'bet.user_id,
                           user_name,
                           rand_userid,
                           bet.match_id,
                           bet.team1_score,
                           bet.team2_score,
                           bet.score,
                           bet.result';
                $order = 'user_id, match.date ASC, match.match_id';
                $data['fixture_bets_players'] = $this->db->select($select)
                                                         ->from($this->config->item('bet', 'table'))
                                                         ->join('match', 'bet.match_id = match.match_id', 'left')
                                                         ->join('fixture', 'match.fixture_id = fixture.fixture_id', 'left')
                                                         ->join('user', 'bet.user_id = user.user_id', 'left')
                                                         ->where_in('bet.user_id', $filters['bets_of_players'])
                                                         ->order_by($order)
                                                         ->get()
                                                         ->result();
                $fixture_bets_players = array();
                $different_players = array();
                $player_id = 0;
                foreach ($data['fixture_bets_players'] as $key => $fixture_bet_players) {
                    if ($fixture_bet_players->user_id != $player_id) {
                        $player_id = $fixture_bet_players->user_id;
                        $different_players[$player_id] = ($fixture_bet_players->user_name === '') ? $this->lang->line('anonymous').' - '.$fixture_bet_players->rand_userid : $fixture_bet_players->user_name;
                    }
                    $fixture_bets_players[$fixture_bet_players->user_id][$fixture_bet_players->match_id] = $fixture_bet_players;
                }
                $data['fixture_bets_players'] = $fixture_bets_players;
            }
            $my_fixture_bets = array();
            foreach ($data['my_fixture_bets'] as $key => $fixture_bet) {
                $my_fixture_bets[$fixture_bet->match_id] = $fixture_bet;
            }
            $data['my_fixture_bets'] = $my_fixture_bets;
            $data['different_players'] = empty($different_players) ? array() : $different_players;
        } else {
            $data['info'] = $this->lang->line('no_match_for_fixture');
        }

        // Récupération du message d'information pour les pronostics des autres joueurs
        $language = $this->session->user->language;
        if (empty($language)) {
            $language = 'french';
        }
        $this->load->model('message_model');
        $data['bet_of_message'] = $this->message_model->get_message('bet-of-message');
        if ($data['bet_of_message'] !== '') {
            $data['bet_of_message'] = $data['bet_of_message'][0]->{$language.'_content'};
        }
        $data['bet_of_message'] = html_entity_decode($data['bet_of_message']);

        if (empty($post)) {
            $this->load->view('templates/header', $data);
            $this->load->view('templates/nav');
            $this->load->view('bets/edit', $data);
            $this->load->view('templates/footer');
        } else if (isset($post['submit-bets'])) {
            // Cas du clic sur "Retour"
            if ($post['submit-bets'] == $this->lang->line('back')) {
                redirect(site_url('bets'), 'location');
                exit;
            }
            // Update des paris de l'utilisateur pour la journée
            $bets = array();
            $element = 0;
            foreach ($post as $key => $post_element) {
                if ($key == 'submit-bets') {
                    continue;
                }
                if ($element === 0) {
                    // Id du match modifié
                    $match_id = explode('_', $key)[1];
                    // Score de la première équipe
                    if ($championship_sport === 'football') {
                        $team1_score = ($post_element == '') ? null : $post_element;
                    } else if ($championship_sport === 'rugby') {
                        $team1_score = $post_element[0];
                        $team2_score = $post_element[2];
                        $resultat = null;
                        if (is_null($team1_score) || is_null($team2_score)) {
                            $element = 0;
                            continue;
                        } else if ($team1_score > $team2_score) {
                            $resultat = '1';
                        } else if ($team1_score < $team2_score) {
                            $resultat = '2';
                        } else {
                            if (!is_null($team1_score) && !is_null($team1_score)) {
                                $resultat = 'N';
                            }
                        }
                        // On vérifie que le score a été entré pour les 2 équipes et que la date du match n'est pas passée
                        if (!is_null($resultat) &&
                            date('Y-m-d H:i:s') < $data['matches'][$match_id]) {
                            // Suppression des paris déjà entrés pour la journée
                            $query = 'DELETE bet ';
                            $query.= 'FROM `'.$this->config->item('bet', 'table').'` ';
                            $query.= 'WHERE user_id = '.$this->session->user->user_id.' ';
                            $query.= 'AND bet.match_id = '.$match_id;
                            $this->db->query($query);

                            $bets[] = array(
                                'user_id' => $this->session->user->user_id,
                                'match_id' => $match_id,
                                'result' => $resultat,
                                'team1_score' => $team1_score,
                                'team2_score' => $team2_score,
                                'date' => date('Y-m-d H:i:s'),
                            );
                            $element = 0;
                            continue;
                        }
                    }
                    ++$element;
                } else {
                    // Score de la deuxième équipe
                    $team2_score = ($post_element == '') ? null : $post_element;
                    $resultat = null;
                    if (is_null($team1_score) || is_null($team2_score)) {
                        $element = 0;
                        continue;
                    } else if ($team1_score > $team2_score) {
                        $resultat = '1';
                    } else if ($team1_score < $team2_score) {
                        $resultat = '2';
                    } else {
                        if (!is_null($team1_score) && !is_null($team1_score)) {
                            $resultat = 'N';
                        }
                    }
                    // On vérifie que le score a été entré pour les 2 équipes et que la date du match n'est pas passée
                    if (!is_null($resultat) &&
                        date('Y-m-d H:i:s') < $data['matches'][$match_id]) {
                        // Suppression des paris déjà entrés pour la journée
                        $query = 'DELETE bet ';
                        $query.= 'FROM `'.$this->config->item('bet', 'table').'` ';
                        $query.= 'WHERE user_id = '.$this->session->user->user_id.' ';
                        $query.= 'AND bet.match_id = '.$match_id;
                        $this->db->query($query);

                        $bets[] = array(
                            'user_id' => $this->session->user->user_id,
                            'match_id' => $match_id,
                            'result' => $resultat,
                            'team1_score' => $team1_score,
                            'team2_score' => $team2_score,
                            'date' => date('Y-m-d H:i:s'),
                        );
                    }
                    $element = 0;
                }
            }
            if (!empty($bets)) {
                $this->db->insert_batch('bet', $bets);
            }

            Save_log('bets', 'edit', 'Ajout / édition de pronos pour la journée : '.$fixture_id);
            $this->session->set_flashdata('success', $this->lang->line('bets_successful_edition'));
            redirect(site_url('bets'), 'location');
            exit;
        } else {
            $this->load->view('templates/header', $data);
            $this->load->view('templates/nav');
            $this->load->view('bets/edit', $data);
            $this->load->view('templates/footer');
        }
    }

    private function _update_robot_bets($match_id = null)
    {
        // Initialisation des variables
        $match_id = $match_id ?: 0;
        $team1_total_score = 0;
        $team2_total_score = 0;
        $players_number = 0;
        $team1_average_score = 0;
        $team2_average_score = 0;
        $average_result = '';

        if ($match_id === 0) {
            return false;
        }

        // Récupération des paris des joueurs pour le match
        $select = '*';
        $where = array('match_id' => $match_id);
        $other_bets = $this->bet_model->read($select, $where);

        $players_number = count($other_bets);

        // Calcul de la moyenne
        foreach ($other_bets as $other_bet) {
            $team1_total_score+= $other_bet->team1_score;
            $team2_total_score+= $other_bet->team2_score;
        }
        $team1_average_score = round($team1_total_score / $players_number);
        $team2_average_score = round($team2_total_score / $players_number);

        // Calcul du résultat selon les scores de chaque équipe
        if ($team1_average_score > $team2_average_score) {
            $average_result = '1';
        } else if ($team1_average_score < $team2_average_score) {
            $average_result = '2';
        } else {
            $average_result = 'N';
        }

        // Suppression du prono existant s'il existe
        $existing_robot_bet = array(
            'user_id' => $this::ROBOT_USER_ID,
            'match_id' => $match_id,
        );
        $this->bet_model->delete($existing_robot_bet);

        // Ajout du prono du robot
        $robot_bet = array(
            'user_id' => $this::ROBOT_USER_ID,
            'match_id' => $match_id,
            'result' => $average_result,
            'team1_score' => $team1_average_score,
            'team2_score' => $team2_average_score,
            'date' => date('Y-m-d H:i:s'),
        );
        $this->bet_model->create($robot_bet);
        return true;
    }
}


text: foo


text:
namespace BitFunnel
{
    static const Term::StreamId c_streamId = 0;

    class SyntheticIndex
    {
    public:
        SyntheticIndex(unsigned maxDocId, ShardId shardCount)
        {
            m_maxDocId = maxDocId;
            m_fileSystem = Factories::CreateFileSystem();
            m_index = Factories::CreatePrimeFactorsIndex(*m_fileSystem,
                                                         m_maxDocId,
                                                         c_streamId,
                                                         shardCount);
        }

        IIngestor & GetIngestor() const
        {
            return m_index->GetIngestor();
        }

        void VerifyQuery(unsigned query)
        {
            auto actualMatches = Match(query);
            auto expectedMatches = Expected(query);

            ASSERT_EQ(actualMatches.size(), expectedMatches.size());
            if (GetIngestor().GetShardCount() == 1)
            {
                // Only doing this for ShardCount == 1 because docIds no longer line up
                // with docIndices if documents can get inserted into any shard.
                for (unsigned i = 0; i < actualMatches.size(); ++i)
                {
                    EXPECT_EQ(actualMatches[i], expectedMatches[i]);
                }
            }
        }

    private:

        bool ExpectedMatch(DocId id, unsigned query)
        {
            if (query == 0)
            {
                // Query 0 has no terms so it matches all documents.
                return true;
            }
            else if (id == 0)
            {
                // Document 0 has no terms so it never matches
                // a non-zero query.
                return false;
            }
            else
            {
                // Document and query each have at least one term.
                // Check for matches.
                for (size_t i = 0; query != 0; query >>= 1, ++i)
                {
                    if ((query & 1) != 0)
                    {
                        if (id % Primes::c_primesBelow10000[i] != 0)
                        {
                            return false;
                        }
                    }
                }
                return true;
            }
        }

        std::vector<DocId> Expected(unsigned query)
        {
            std::vector<DocId> results;
            for (DocId i = 0; i <= m_maxDocId; ++i)
            {
                if (ExpectedMatch(i, query))
                {
                    results.push_back(i);
                }
            }
            return results;
        }

        // Start with an accumulator that matches all documents. Then
        // intersect rows as appropriate. This implies that the "0" query
        // matches all rows. Note that this only handles up to 64 bits, so
        // queries larger than 64 are bogus.
        std::vector<DocId> Match(unsigned queryInput)
        {
            std::vector<DocId> results;
            for (ShardId shardId = 0; shardId < GetIngestor().GetShardCount(); ++shardId)
            {
                IShard & shard = m_index->GetIngestor().GetShard(shardId);
                auto sliceBuffers = shard.GetSliceBuffers();
                if (sliceBuffers.size() > 0)
                {
                    // Load accumulator with 0xFFFFFFFFFFFFFFFF which matches
                    // all documents. Then intersect with rows of the query.
                    uint64_t accumulator = std::numeric_limits<uint64_t>::max();
                    unsigned query = queryInput;

                    for (size_t i = 0; query != 0; query >>= 1, ++i)
                    {
                        if (query & 0x1)
                        {
                            char const* text = Primes::c_primesBelow10000Text[i].c_str();

                            Term term(Term::ComputeRawHash(text), c_streamId, 0);
                            RowIdSequence rows(term, m_index->GetTermTable(shardId));
                            for (auto row : rows)
                            {
                                //IShard & shard = m_index->GetIngestor().GetShard(shardId);
                                auto rowOffset = shard.GetRowOffset(row);
                                //auto sliceBuffers = shard.GetSliceBuffers();
                                auto base = static_cast<char*>(sliceBuffers[0]);
                                auto ptr = base + rowOffset;
                                accumulator &= *reinterpret_cast<uint64_t*>(ptr);
                            }
                        }
                    }

                    for (unsigned i = 0; accumulator != 0; ++i, accumulator >>= 1)
                    {
                        if (accumulator & 1)
                        {
                            results.push_back(i);
                        }
                    }
                }
            }
            return results;
        }

        DocId m_maxDocId;
        std::unique_ptr<IFileSystem> m_fileSystem;
        std::unique_ptr<ISimpleIndex> m_index;
    };

    // Generate fake documents where each document contains term i which
    // is a prime number iff the docId is divisible by the prime number.
    // Then verify using a fake matcher that talks to the row table to get
    // the appropriate address for the row.
    TEST(Ingestor, Basic)
    {
        const int c_maxDocId = 63;
        const ShardId c_numShards = 1;
        SyntheticIndex index(c_maxDocId, c_numShards);

        for (unsigned i = 0; i < c_maxDocId + 1; i++)
        {
            index.VerifyQuery(i);
        }
    }

    std::unordered_map<size_t, size_t>
    CreateDocCountHistogram(DocumentFrequencyTable const & table,
                            unsigned docCount)
    {
        std::unordered_map<size_t, size_t> histogram;
        for (size_t i = 0; i < table.size(); ++i)
        {
            auto entry = table[i];
            ++histogram[static_cast<size_t>(std::round(entry.GetFrequency() * docCount))];
        }
        return histogram;
    }

    // Test DocumentFrequencyTable with 3 documents (0, 1, 2). This uses a
    // PrimeFactorIndex, which means that a document contains the term if the
    // term divides the document. This means that the only term we expect is
    // term "2" in docId 2.
    //
    // table.size() == 1u because there's only one term, "2", in any document.
    //
    // docFreqHistogram[1] == 1u because there's exactly 1 term that appears in
    // 1 document.
    TEST(Ingestor, DocFrequency2)
    {
        const int c_maxDocId = 2;
        const ShardId c_numShards = 1;
        SyntheticIndex index(c_maxDocId, c_numShards);
        std::stringstream stream;
        index.GetIngestor().GetShard(0).TemporaryWriteDocumentFrequencyTable(stream, nullptr);

        std::cout << stream.str() << std::endl;

        DocumentFrequencyTable table(stream);

        EXPECT_EQ(table.size(), 1u);
        std::unordered_map<size_t, size_t> docFreqHistogram = CreateDocCountHistogram(table, c_maxDocId);
        EXPECT_EQ(docFreqHistogram[1], 1u);
    }

    // Test DocumentFrequencyTable with 64 documents (0, 1, 2, ..., 63). This
    // uses a PrimeFactorIndex, which means that a document contains the term
    // iff the term divides the document.
    //
    // table.size() == 18u because there are 18 primes <= 63.
    //
    // docFreqHistogram[31] == 1u because there's exactly 1 term that appears in
    // 31 documents: the term "2" appears in documents 2, 4, 6, 8, ..., 62.
    //
    // docFreqHistogram[1] == 7u because there are 7 terms that appear in
    // exactly 1 document: 37, 41, 43, 47, 53, 59, 61, i.e., all primes between
    // 32 and 63 (inclusive).
    TEST(Ingestor, DocFrequency63)
    {
        const int c_maxDocId = 63;
        const ShardId c_numShards = 1;
        SyntheticIndex index(c_maxDocId, c_numShards);
        std::stringstream stream;
        index.GetIngestor().GetShard(0).TemporaryWriteDocumentFrequencyTable(stream, nullptr);

        std::cout << stream.str() << std::endl;

        DocumentFrequencyTable table(stream);

        EXPECT_EQ(table.size(), 18u);
        std::unordered_map<size_t, size_t> docFreqHistogram = CreateDocCountHistogram(table, c_maxDocId);

        EXPECT_EQ(docFreqHistogram[21], 1u);
        EXPECT_EQ(docFreqHistogram[31], 1u);
    }

    TEST(Ingestor, BasicMultiShard)
    {
        const int c_maxDocId = 63;
        // Note: we'll need to allocate more memory if we want to add more
        // shards.
        for (ShardId shard = 1; shard < 4; ++shard)
        {
            SyntheticIndex index(c_maxDocId, shard);

            // We don't look at docId 0 because it matches everything, which
            // will cause it to match all documents in all shards. It's possible
            // that we should fix that by changing how PrimeFactorsDocument
            // works.
            for (unsigned i = 1; i < c_maxDocId + 1; i++)
            {
                std::cout << i << std::endl;
                index.VerifyQuery(i);
            }
        }
    }

}