def within_geobox(tweet, sw_lon, sw_lat, ne_lon, ne_lat):
    """
    True if tweet is geotagged and is sent within the box specified by GeoJSON points (longitude, latitude)
    (sw_lon, sw_lat)  <-  the southwest corner
    (ne_lon, ne_lat)  <-  the northeast corner

    Example:
    ========
    within_geobox(tweet, -75.280303,39.8670041,-74.9557629,40.1379919)
    # true for tweets tweeted within a box surrounding Philadelphia
    """
    if 'coordinates' not in tweet or tweet['coordinates'
        ] is None or 'coordinates' not in tweet['coordinates']:
        return False
    coords = tweet['coordinates']['coordinates']
    return coords[0] > float(sw_lon) and coords[0] < float(ne_lon) and coords[1
        ] > float(sw_lat) and coords[1] < float(ne_lat)
