code: def element_order(element, modulus, phi_m, phi_m_decomposition):
          
          if element == 1:
              return 1  # by definition
  
          if pow(element, phi_m, modulus) != 1:
              return None  # not an element of the group
  
          order = phi_m
          for factor, power in list(phi_m_decomposition.items()):
              for p in range(1, power + 1):
                  next_order = order // factor
                  if pow(element, next_order, modulus) == 1:
                      order = next_order
                  else:
                      break
          return order
docs: Returns order of the element in Zmod(modulus)
          :param element:
          :param modulus:
          :param phi_m: phi(modulus)
          :param phi_m_decomposition: factorization of phi(modulus)
          :return: