code: def max_trials(elements):
      """Max number of trials in a buffer"""
      if not elements:
          return 0
      return max(e["trials"] for e in elements)
  
imports: import argparse
  import contextlib
  import multiprocessing
  import subprocess
  import sys
  import time
  from collections import defaultdict, namedtuple
  import bson
  import numpy
  from ptera import probing
  from orion.client import build_experiment
  from orion.client.runner import Runner
  from orion.core.io.database.pickleddb import PickledDB
  from orion.testing import OrionState
label_desc: Use image node_id 4 for calling a global function with example usage: max_trials(elements) and returns: max, int