parameters: (self)
return_statement: return False
docstring: Return True if the road is inside a city.
docstring_summary: Return True if the road is inside a city.
docstring_tokens: Return True if the road is inside a city .
function: def is_inside_a_city(self):
          """Return True if the road is inside a city."""
          # The best found criteria to determine if a road is inside a city or not
          # is the fact that this road or its connecting roads are tagged as residential.
          # cf. https://help.openstreetmap.org/questions/56876/how-to-determine-if-a-road-is-outside-or-inside-place
          if 'residential' in self.type.lower():
              return True
  
          connectedJunctions = []
          if self.startJunction is not None:
              connectedJunctions.append(self.startJunction)
          if self.endJunction is not None:
              connectedJunctions.append(self.endJunction)
          for crossroad in connectedJunctions:
              for connectedRoad in crossroad.roads:
                  if self != connectedRoad and 'residential' in connectedRoad.type.lower():
                      return True
  
          return False
function_tokens: def is_inside_a_city ( self ) : # The best found criteria to determine if a road is inside a city or not # is the fact that this road or its connecting roads are tagged as residential. # cf. https://help.openstreetmap.org/questions/56876/how-to-determine-if-a-road-is-outside-or-inside-place if 'residential' in self . type . lower ( ) : return True connectedJunctions = [ ] if self . startJunction is not None : connectedJunctions . append ( self . startJunction ) if self . endJunction is not None : connectedJunctions . append ( self . endJunction ) for crossroad in connectedJunctions : for connectedRoad in crossroad . roads : if self != connectedRoad and 'residential' in connectedRoad . type . lower ( ) : return True return False