parameters: (target, net)
docstring: Test if target belongs to given IPv4 network
docstring_summary: Test if target belongs to given IPv4 network
docstring_tokens: Test if target belongs to given IPv4 network
function: def in_ipv4net(target, net):
      """ Test if target belongs to given IPv4 network
      """
      try:
          nw = ipaddress.IPv4Network(net)
          ip = ipaddress.IPv4Address(target)
          if ip in nw:
              return True
          return False
      except ipaddress.AddressValueError:
          return False
      except ipaddress.NetmaskValueError:
          return False
function_tokens: def in_ipv4net ( target , net ) : try : nw = ipaddress . IPv4Network ( net ) ip = ipaddress . IPv4Address ( target ) if ip in nw : return True return False except ipaddress . AddressValueError : return False except ipaddress . NetmaskValueError : return False