code: def apply_link_ref(offset: int, length: int, value: bytes, bytecode: bytes) -> bytes:
      
      try:
          validate_empty_bytes(offset, length, bytecode)
      except ValidationError:
          raise BytecodeLinkingError("Link references cannot be applied to bytecode")
  
      new_bytes = (
          # Ignore linting error b/c conflict b/w black & flake8
          bytecode[:offset]
          + value
          + bytecode[offset + length :]  # noqa: E201, E203
      )
      return new_bytes
docs: Returns the new bytecode with `value` put into the location indicated by `offset` and `length`.