code: def __init__(
      self,
      client: Client,
      run: "Run",
      mode="logged",
      per_page: Optional[int] = 50,
  ):
      output_query = gql(
          """
              query RunOutputArtifacts(
                  $entity: String!, $project: String!, $runName: String!, $cursor: String, $perPage: Int,
              ) {
                  project(name: $project, entityName: $entity) {
                      run(name: $runName) {
                          outputArtifacts(after: $cursor, first: $perPage) {
                              totalCount
                              edges {
                                  node {
                                      ...ArtifactFragment
                                  }
                                  cursor
                              }
                              pageInfo {
                                  endCursor
                                  hasNextPage
                              }
                          }
                      }
                  }
              }
              """
          + wandb.Artifact._get_gql_artifact_fragment()
      )
  
      input_query = gql(
          """
              query RunInputArtifacts(
                  $entity: String!, $project: String!, $runName: String!, $cursor: String, $perPage: Int,
              ) {
                  project(name: $project, entityName: $entity) {
                      run(name: $runName) {
                          inputArtifacts(after: $cursor, first: $perPage) {
                              totalCount
                              edges {
                                  node {
                                      ...ArtifactFragment
                                  }
                                  cursor
                              }
                              pageInfo {
                                  endCursor
                                  hasNextPage
                              }
                          }
                      }
                  }
              }
              """
          + wandb.Artifact._get_gql_artifact_fragment()
      )
  
      self.run = run
      if mode == "logged":
          self.run_key = "outputArtifacts"
          self.QUERY = output_query
      elif mode == "used":
          self.run_key = "inputArtifacts"
          self.QUERY = input_query
      else:
          raise ValueError("mode must be logged or used")
  
      variable_values = {
          "entity": run.entity,
          "project": run.project,
          "runName": run.id,
      }
  
      super().__init__(client, variable_values, per_page)
  
imports: import json
  from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence
  from wandb_gql import Client, gql
  import wandb
  from wandb.apis import public
  from wandb.apis.normalize import normalize_exceptions
  from wandb.apis.paginator import Paginator
label_desc: Use image node_id 1 to create a new RunArtifacts object from inherited base classes: Paginator with example: obj = RunArtifacts(client, run, mode, per_page)