text: """
  Palindrome Permutation: Given a string, write a function to check if it is
  a permutation of a palindrome. A palindrome is a word or phrase that is
  the same forwards and backwards. A permutation is a rearrangement of
  letters. The palindrome does not need to be limited to just dictionary
  words.
  
  Input: Tact Coa
  Output: True (permutations: "taco cat", "atco cta", etc.)
  """
  import unittest
  
  
  def pal_perm(phrase):
      '''function checks if a string is a permutation of a palindrome or not'''
      table = [0 for _ in range(ord('z') - ord('a') + 1)]
      countodd = 0
      for c in phrase:
          x = char_number(c)
          if x != -1:
              table[x] += 1
              if table[x] % 2:
                  countodd += 1
              else:
                  countodd -= 1
  
      return countodd <= 1
  
  
  def char_number(c):
      a = ord('a')
      z = ord('z')
      A = ord('A')
      Z = ord('Z')
      val = ord(c)
  
      if a <= val <= z:
          return val - a
      elif A <= val <= Z:
          return val - A
      return -1
  
  
  class Test(unittest.TestCase):
      '''Test Cases'''
      data = [
          ('Tact Coa', True),
          ('jhsabckuj ahjsbckj', True),
          ('Able was I ere I saw Elba', True),
          ('So patient a nurse to nurse a patient so', False),
          ('Random Words', False),
          ('Not a Palindrome', False),
          ('no x in nixon', True),
          ('azAZ', True)]
  
      def test_pal_perm(self):
          for [test_string, expected] in self.data:
              actual = pal_perm(test_string)
              self.assertEqual(actual, expected)
  
  
  if __name__ == "__main__":
      unittest.main()
  
  
  
  
  