<commit_before>commonfields:
  id: IsIPInRanges
  version: -1
name: IsIPInRanges
script: |
  var private_subnets = [
    '172.16.0.0/12',
    '10.0.0.0/8',
    '198.18.0.0/15',
    '192.168.0.0/16',
    '192.168.127.12/10',
    '192.0.0.0/24'
  ];

  var ip = args.ip;
  var ipranges = argToList(args.ipRanges);

  if (!ipranges || ipranges.length === 0) {
      ipranges = private_subnets;
  }

  var isInRange = ipranges.some(function(iprange) {
      return isIPInSubnet(ip, iprange);
  });

  var ipObj = {};
  ipObj.Address = ip;
  ipObj.InRange = isInRange ? 'yes' : 'no';

  var ec = {"IP(val.Address == obj.Address)" : ipObj};

  return {Type: entryTypes.note, Contents: isInRange ? 'yes' : 'no', ContentsFormat: formats.json, HumanReadable: isInRange ? 'yes' : 'no', EntryContext: ec};
type: javascript
tags:
- ip
- Condition
comment: Returns yes if ip is in one of the ranges provided, returns no otherwise.
system: true
args:
- name: ip
  required: true
  default: true
  description: IP to check in ranges
- name: ipRanges
  description: list of IP ranges to check the ip in (if list is not provided, will
    use default list (e.g  172.16.17.32/16)
outputs:
- contextPath: "yes"
  description: if given value is an IP range
- contextPath: "no"
  description: if given value is not a IP range
- contextPath: IP.Address
  description: The IP Address
- contextPath: IP.InRange
  description: Is the IP is in the input ranges? (could be 'yes' or 'no)
scripttarget: 0
releaseNotes: "-"
<commit_msg>CR fixes<commit_after>commonfields:
  id: IsIPInRanges
  version: -1
name: IsIPInRanges
script: |
  var private_subnets = [
    '172.16.0.0/12',
    '10.0.0.0/8',
    '198.18.0.0/15',
    '192.168.0.0/16',
    '192.168.127.12/10',
    '192.0.0.0/24'
  ];

  var ip = args.ip;
  var ipranges = argToList(args.ipRanges);

  if (!ipranges || ipranges.length === 0) {
      ipranges = private_subnets;
  }

  var isInRange = ipranges.some(function(iprange) {
      return isIPInSubnet(ip, iprange);
  });

  var ipObj = {};
  ipObj.Address = ip;
  ipObj.InRange = isInRange ? 'yes' : 'no';

  var ec = {'IP(val.Address == obj.Address)' : ipObj};

  return {
    Type: entryTypes.note,
    Contents: isInRange ? 'yes' : 'no',
    ContentsFormat: formats.json,
    HumanReadable: isInRange ? 'yes' : 'no',
    EntryContext: ec
  };
type: javascript
tags:
- ip
- Condition
comment: Returns yes if ip is in one of the ranges provided, returns no otherwise.
system: true
args:
- name: ip
  required: true
  default: true
  description: IP to check in ranges
- name: ipRanges
  description: list of IP ranges to check the ip in (if list is not provided, will
    use default list (e.g  172.16.17.32/16)
outputs:
- contextPath: "yes"
  description: if given value is an IP range
- contextPath: "no"
  description: if given value is not a IP range
- contextPath: IP.Address
  description: The IP Address
- contextPath: IP.InRange
  description: Is the IP is in the input ranges? (could be 'yes' or 'no)
scripttarget: 0
releaseNotes: "-"

{'fraction_non_alphanumeric': 0.13196964698119432, 'fraction_numerical': 0.04552952820851204, 'mean_word_length': 3.1994459833795013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3373482', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1091, 'n_words': 335}