code: def place_oceans_at_map_borders(world):
      
  
      ocean_border = int(min(30, max(world.width / 5, world.height / 5)))
  
      def place_ocean(x, y, i):
          world.layers['elevation'].data[y, x] = \
              (world.layers['elevation'].data[y, x] * i) / ocean_border
  
      for x in range(world.width):
          for i in range(ocean_border):
              place_ocean(x, i, i)
              place_ocean(x, world.height - i - 1, i)
  
      for y in range(world.height):
          for i in range(ocean_border):
              place_ocean(i, y, i)
              place_ocean(world.width - i - 1, y, i)
docs: Lower the elevation near the border of the map