original_docstring: 
          Determine the smallest supercell that is able to enumerate
          the provided structure with the given order parameter
          
docstring: Determine the smallest supercell that is able to enumerate
  the provided structure with the given order parameter
docstring_tokens: Determine the smallest supercell that is able to enumerate the provided structure with the given order parameter
code: def determine_min_cell(disordered_structure):
          """
          Determine the smallest supercell that is able to enumerate
          the provided structure with the given order parameter
          """
  
          def lcm(n1, n2):
              """
              Find least common multiple of two numbers
              """
              return n1 * n2 / gcd(n1, n2)
  
          # assumes all order parameters for a given species are the same
          mag_species_order_parameter = {}
          mag_species_occurrences = {}
          for idx, site in enumerate(disordered_structure):
              if not site.is_ordered:
                  op = max(site.species.values())
                  # this very hacky bit of code only works because we know
                  # that on disordered sites in this class, all species are the same
                  # but have different spins, and this is comma-delimited
                  sp = str(list(site.species.keys())[0]).split(",")[0]
                  if sp in mag_species_order_parameter:
                      mag_species_occurrences[sp] += 1
                  else:
                      mag_species_order_parameter[sp] = op
                      mag_species_occurrences[sp] = 1
  
          smallest_n = []
  
          for sp, order_parameter in mag_species_order_parameter.items():
              denom = Fraction(order_parameter).limit_denominator(100).denominator
              num_atom_per_specie = mag_species_occurrences[sp]
              n_gcd = gcd(denom, num_atom_per_specie)
              smallest_n.append(lcm(int(n_gcd), denom) / n_gcd)
  
          return max(smallest_n)
code_tokens: def determine_min_cell ( disordered_structure ) : def lcm ( n1 , n2 ) : """
              Find least common multiple of two numbers
              """ return n1 * n2 / gcd ( n1 , n2 ) mag_species_order_parameter = { } mag_species_occurrences = { } for idx , site in enumerate ( disordered_structure ) : if not site . is_ordered : op = max ( site . species . values ( ) ) sp = str ( list ( site . species . keys ( ) ) [ 0 ] ) . split ( "," ) [ 0 ] if sp in mag_species_order_parameter : mag_species_occurrences [ sp ] += 1 else : mag_species_order_parameter [ sp ] = op mag_species_occurrences [ sp ] = 1 smallest_n = [ ] for sp , order_parameter in mag_species_order_parameter . items ( ) : denom = Fraction ( order_parameter ) . limit_denominator ( 100 ) . denominator num_atom_per_specie = mag_species_occurrences [ sp ] n_gcd = gcd ( denom , num_atom_per_specie ) smallest_n . append ( lcm ( int ( n_gcd ) , denom ) / n_gcd ) return max ( smallest_n )
short_docstring: Determine the smallest supercell that is able to enumerate
  the provided structure with the given order parameter
short_docstring_tokens: Determine the smallest supercell that is able to enumerate the provided structure with the given order parameter
comment: """
          Determine the smallest supercell that is able to enumerate
          the provided structure with the given order parameter
          """$SEP$"""
              Find least common multiple of two numbers
              """$SEP$# assumes all order parameters for a given species are the same$SEP$# this very hacky bit of code only works because we know$SEP$# that on disordered sites in this class, all species are the same$SEP$# but have different spins, and this is comma-delimited