code: def from_cif_string(cif_string, transformations=None, primitive=True,
                          occupancy_tolerance=1.):
          
          parser = CifParser.from_string(cif_string, occupancy_tolerance)
          raw_string = re.sub(r"'", "\"", cif_string)
          cif_dict = parser.as_dict()
          cif_keys = list(cif_dict.keys())
          s = parser.get_structures(primitive)[0]
          partial_cif = cif_dict[cif_keys[0]]
          if "_database_code_ICSD" in partial_cif:
              source = partial_cif["_database_code_ICSD"] + "-ICSD"
          else:
              source = "uploaded cif"
          source_info = {"source": source,
                         "datetime": str(datetime.datetime.now()),
                         "original_file": raw_string,
                         "cif_data": cif_dict[cif_keys[0]]}
          return TransformedStructure(s, transformations, history=[source_info])
docs: Generates TransformedStructure from a cif string.
  
          Args:
              cif_string (str): Input cif string. Should contain only one
                  structure. For cifs containing multiple structures, please use
                  CifTransmuter.
              transformations ([Transformations]): Sequence of transformations
                  to be applied to the input structure.
              primitive (bool): Option to set if the primitive cell should be
                  extracted. Defaults to True. However, there are certain
                  instances where you might want to use a non-primitive cell,
                  e.g., if you are trying to generate all possible orderings of
                  partial removals or order a disordered structure.
              occupancy_tolerance (float): If total occupancy of a site is
                  between 1 and occupancy_tolerance, the occupancies will be
                  scaled down to 1.
  
          Returns:
              TransformedStructure