def create_person(self, data, organization):
        name = data['name']
        # make sure we actually have been given a name
        if name:
            try:
                first_name, last_name = name.split(' ', 1)
            except:
                first_name, last_name = name, ''
                
            person_kwargs = {
                'first_name': first_name,
                'last_name': last_name,
                'slug': slugify('-'.join([first_name, last_name]))
            }

            i = 0
            found = True
            while found:
                i += 1
                try:
                    person = Person.objects.get(slug=person_kwargs['slug'])
                    person_kwargs['slug'] = slugify('-'.join([first_name, last_name, str(i)]))
                except __HOLE__:
                    person = Person(**person_kwargs)
                    person.save()
                    person.organizations.add(organization)
                    found = False
            
            return person
        return None
dataset/ETHPy150Open mozilla/source/source/people/views.py/PersonUpdate.create_person