code: def ifind_first_object(self, ObjectClass, **kwargs):
          
          from pynamodb.attributes import UnicodeAttribute
  
          if self.user_manager.USER_IFIND_MODE == 'nocase_collation':
              return self.find_first_object(ObjectClass, **kwargs)
  
          # The below is horrendously slow on a large user database, but DynamoDB
          # has no support for case insensitive search, so we have to scan.
          # We try and be a little smart and use any non-unicode filters in the scan, thought.
  
          tfilters = {k: v.lower() for k, v in kwargs.items() if type(getattr(ObjectClass, k)) == UnicodeAttribute}
  
          ntfilter = None
          for k in [k for k in kwargs if k not in tfilters]:
              cond = getattr(ObjectClass, k) == kwargs[k]
              ntfilter = cond if ntfilter is None else ntfilter & cond
  
          for o in ObjectClass.scan(ntfilter):
              for k in tfilters:
                  if getattr(o, k, None).lower() != kwargs[k]:
                      break
              else:
                  # all match
                  return o
  
          return None
docs: Retrieve the first object of type ``ObjectClass``,
          matching the specified filters in ``**kwargs`` -- case insensitive.
  
          | If USER_IFIND_MODE is 'nocase_collation' this method maps to find_first_object().
          | If USER_IFIND_MODE is 'ifind' this method performs a case insensitive find.