parameters: (ip)
return_statement: return True
docstring: Return False if ip is blocked.
docstring_summary: Return False if ip is blocked.
docstring_tokens: Return False if ip is blocked .
function: def ip_in_allowed_ip_range(ip):
      """ Return False if ip is blocked. """
      if not ip:
          return False
      ip = IPAddress(ip)
      for banned_ip_range in settings.BANNED_IP_RANGES:
          if IPAddress(ip) in IPNetwork(banned_ip_range):
              return False
      return True
function_tokens: def ip_in_allowed_ip_range ( ip ) : if not ip : return False ip = IPAddress ( ip ) for banned_ip_range in settings . BANNED_IP_RANGES : if IPAddress ( ip ) in IPNetwork ( banned_ip_range ) : return False return True