<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize_to_file(obj, file_name, append=False):
 """Pickle obj to file_name."""

  logging.info("Serializing to file %s.", file_name)
  with tf.gfile.Open(file_name, "a+" if append else "wb") as output_file:
    pickle.dump(obj, output_file)
  logging.info("Done serializing to file %s.", file_name)