code: def check_nearby_ship(board, shipyard, enemy):
      size = board.configuration.size
      shipyard_pos = shipyard.position
      player_id = shipyard.player_id
  
      for offset in [[0, 1], [0, -1], [1, 0], [-1, 0]]:
          new_pos = (
              (shipyard_pos[0] + offset[0]) % size,
              (shipyard_pos[1] + offset[1]) % size,
          )
          new_cell = board.cells[new_pos]
          if (
              enemy
              and new_cell.ship_id
              and new_cell.ship.player_id != player_id
          ):
              return True
          if (
              not enemy
              and new_cell.ship_id
              and new_cell.ship.player_id == player_id
          ):
              return True
  
      return False
  
imports: import base64
  import pickle
  import random
  import numpy
  from zerosum_env.envs.halite.helpers import *
  from zerosum_env import make, evaluate
  from collections import deque
  import parl
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.distribution import Categorical
label_desc: Use image node_id 13 for calling a global function with example usage: check_nearby_ship(board, shipyard, enemy) and returns: False, True, True