Python function to find the country of origin of a Tweet

This is a rudimentary function to trace the origin from the tweet’s JSON structure. I am using a dictionary of states and abbreviations.

  def checklocation(self,data):
       location = data.get('user').get('location')
       place = data.get('place')
       if place:
           country = data.get('place').get('country')
           full_name = data.get('place').get('full_name')
           for c in self.states.itervalues():
                   p = re.compile(c.lower(), re.IGNORECASE)
                   if country:
                       m = p.match(country.lower())
                       if m:
                   if full_name:
                       m = p.match(full_name.lower())
                       if m:
                   if location:
                       m = p.match(location.lower())
                       if m: