Returns true if the version of the IP represented by the object has the bug of the
 given name
429415
def has_bug?(name, _options = {})
      unless self.respond_to?(:version) && version
        puts 'To test for the presence of a bug the object must implement an attribute'
        puts "called 'version' which returns the IP version represented by the the object."
        fail 'Version undefined!'
      end
      name = name.to_s.downcase.to_sym
      if bugs[name]
        bugs[name].present_on_version?(version)
      else
        false
      end
    end
744240
def version(family='ipv4'):
    '''
    
    '''
    cmd = '{0} --version' . format(_iptables_cmd(family))
    out = __salt__['cmd.run'](cmd).split()
    return out[1]
877573
def matches_ip(self, ip):
        """"""

        # Check the cache if caching is enabled
        if self.cache is not None:
            matches_ip = self.cache.get(ip)
            if matches_ip is not None:
                return matches_ip

        # Query MongoDB to see if the IP is blacklisted
        matches_ip = IPNetwork.matches_ip(
            ip, read_preference=self.read_preference)

        # Cache the result if caching is enabled
        if self.cache is not None:
            self.cache[ip] = matches_ip

        return matches_ip
977812
def print_name_version(self):
        
        if self.use_sys:
            self.print_generic(u"%s v%s" % (self.NAME, aeneas_version))
        return self.exit(self.HELP_EXIT_CODE)
842730
public function getIpVersion($ip)
    {
        if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            return self::IPv6;
        }

        else if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return self::IPv4;
        }
        // invalid ip
        return false;
    }
806758
def is_modified_field(self, name):
        
        name = self.get_real_name(name)

        if name in self.__modified_data__ or name in self.__deleted_fields__:
            return True

        try:
            return self.get_field_value(name).is_modified()
        except Exception:
            return False
345640
public BugProperty lookupProperty(String name) {
        BugProperty prop = propertyListHead;

        while (prop != null) {
            if (prop.getName().equals(name)) {
                break;
            }
            prop = prop.getNext();
        }

        return prop;
    }
1257032
def vserver_exists(v_name, v_ip=None, v_port=None, v_type=None, **connection_args):
    '''
    
    '''
    vserver = _vserver_get(v_name, **connection_args)
    if vserver is None:
        return False
    if v_ip is not None and vserver.get_ipv46() != v_ip:
        return False
    if v_port is not None and vserver.get_port() != v_port:
        return False
    if v_type is not None and vserver.get_servicetype().upper() != v_type.upper():
        return False
    return True
699636
public synchronized static boolean isBlacklisted(String ip) {
    if (blacklistCache == null || blacklistCache.isEmpty()) {
      blacklistCache = new HashSet<>();

      for (IBlackListProvider provider : BLACKLIST_PROVIDERS) {
        try {
          blacklistCache.addAll(provider.getIPs());
        } catch (IOException e) {
          LOGGER.warn("Error fetching blacklist records", e);
        }
      }

    }
    
    return blacklistCache.contains(ip);
  }
85554
boolean isMe()
	{
		DevLockManager	dlm = DevLockManager.getInstance();
		//	Check main class name
		if (!dlm.getMainClass().equals(classname))
		{
			System.out.println(dlm.getMainClass() + "!=" + classname);
			return false;
		}
		//	Check UUID long values (msl and lsl)
		if (uuid.compareTo(dlm.getUUID())!=0)
		{
			System.out.println("UUID different");
			return false;
		}

		//	Check IP address
		return hostname.equals(dlm.getHost());
	}
477001
public static boolean isDotQuadIP ( String hostname ) {
        if ( Character.isDigit(hostname.charAt(0)) ) {
            int i, len, dots;
            char[] data;

            i = dots = 0; /* quick IP address validation */
            len = hostname.length();
            data = hostname.toCharArray();
            while ( i < len && Character.isDigit(data[ i++ ]) ) {
                if ( i == len && dots == 3 ) {
                    // probably an IP address
                    return true;
                }
                if ( i < len && data[ i ] == '.' ) {
                    dots++;
                    i++;
                }
            }
        }

        return false;
    }
823020
private static boolean isIPAdressValid(final String ip){

        // InetAddress.getByName() validates 'null' as a valid IP (localhost).
        // we do not want that
        if (hasValue(ip)) {
            return IP_ADDR_PATTERN.matcher(ip).matches();
        }
        return false;
    }
267069
private boolean isCorrectVersion(ApplicationInfo app) {
    for (String key : keysToConsiderInThePlistToHaveEquality) {
      Object value = app.getProperty(key);
      Object exp = ipa.getMetadata().opt(key);
      if (value instanceof String) {
        if (!value.equals(exp)) {
          log.fine("for key " + key + ",device has" + value + ",but needed " + exp
                   + ".the app will need to be reinstalled.");
          return false;
        }
      }
    }
    return true;
  }
977501
public boolean isUpdateForVersionCode() {
		Set<Integer> uniques = new HashSet<Integer>();
		for (VersionHistoryItem item : versionHistoryItems) {
			uniques.add(item.getVersionCode());
		}
		return uniques.size() > 1;
	}
1724
def _valid_ip(ip_address):
    '''
    
    '''

    try:
        address = ipaddress.IPv4Address(ip_address)
    except ipaddress.AddressValueError:
        return False

    if address.is_unspecified or \
        address.is_loopback or \
        address.is_link_local or \
        address.is_multicast or \
        address.is_reserved:
        return False

    return True
389702
@Override
    public final boolean propertyExists(String name) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "propertyExists", name);

        boolean result = false;

        /* Got to check Maelstrom's transportVersion first as performance for it */
        /* is critical. */
        if (name.equals(MfpConstants.PRP_TRANSVER) && isTransportVersionSet()) {
            result = true;
        }

        /* Next try the user property map as the most likely */
        else if ((mayHaveJmsUserProperties()) && (getJmsUserPropertyMap().containsKey(name))) {
            result = true;
        }

        /* If name starts with JMS it may be a smoke-and-mirrors property */
        else if (name.startsWith(JMS_PREFIX)) {

            /* If it is a JMSX property.... */
            if (name.charAt(JMS_LENGTH) == JMSX_EXTRA_PREFIX) {
                int count = name.length() - JMSX_LENGTH;

                if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXDeliveryCount, JMSX_LENGTH, count)) {
                    if (isSent())
                        result = true;
                }
                else if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXAppID, JMSX_LENGTH, count)) {
                    if (getHdr2().getChoiceField(JsHdr2Access.XAPPID) != JsHdr2Access.IS_XAPPID_EMPTY)
                        result = true;
                }
                else if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXUserID, JMSX_LENGTH, count)) {
                    if (getUserid() != null)
                        result = true;
                }
                /* The other supported JMSX properties just live in the system map */
                else if (mayHaveMappedJmsSystemProperties()) {
                    result = getJmsSystemPropertyMap().containsKey(name);
                }

            }
            /* All the remaining header properties start with JMS_IBM_ */
            else if (name.startsWith(JMS_IBM_EXTRA_PREFIX, JMS_LENGTH)) {
                int count;

                /* First check for the Report ones */
                if (name.regionMatches(JMS_IBM_LENGTH, REPORT, 0, REPORT_LENGTH)) {

                    count = name.length() - REPORT_OFFSET;

                    if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Expiration, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTEXPIRY) != JsHdr2Access.IS_REPORTEXPIRY_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_COA, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTCOA) != JsHdr2Access.IS_REPORTCOA_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_COD, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTCOD) != JsHdr2Access.IS_REPORTCOD_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Exception, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTEXCEPTION) != JsApiAccess.IS_REPORTEXCEPTION_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_PAN, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPAN) != JsApiAccess.IS_REPORTPAN_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_NAN, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTNAN) != JsApiAccess.IS_REPORTNAN_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Pass_Msg_ID, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPASSMSGID) != JsApiAccess.IS_REPORTPASSMSGID_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Pass_Correl_ID, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPASSCORRELID) != JsApiAccess.IS_REPORTPASSCORRELID_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Discard_Msg, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTDISCARDMSG) != JsApiAccess.IS_REPORTDISCARDMSG_UNSET)
                            result = true;
                    }

                }
                else {
                    /* Then try the other smoke-and-mirrors ones */
                    count = name.length() - JMS_IBM_LENGTH;

                    if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionReason, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionTimestamp, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionMessage, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionProblemDestination, JMS_IBM_LENGTH, count)) {
                        if (getExceptionProblemDestination() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionProblemSubscription, JMS_IBM_LENGTH, count)) {
                        if (getExceptionProblemSubscription() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_Feedback, JMS_IBM_LENGTH, count)) {
                        if ((getApi().getChoiceField(JsApiAccess.REPORTFEEDBACK) != JsApiAccess.IS_REPORTFEEDBACK_UNSET) ||
                            (getApi().getChoiceField(JsApiAccess.REPORTFEEDBACKINT) != JsApiAccess.IS_REPORTFEEDBACKINT_UNSET))
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_System_MessageID, JMS_IBM_LENGTH, count)) {
                        if (getSystemMessageId() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ArmCorrelator, JMS_IBM_LENGTH, count)) {
                        if (getARMCorrelator() != null)
                            result = true;
                    }

                    /* The other supported JMS_IBM_ properties just live in one (or both) of the maps */
                    else {
                        if (mayHaveMappedJmsSystemProperties()) {
                            result = getJmsSystemPropertyMap().containsKey(name);
                        }
                        if (result == false) {
                            result = getMQMDSetPropertiesMap().containsKey(name);
                        }
                    }
                } // end of else of if Report
            } // end of if JMS_IBM_

            // JMS_TOG_ARM_Correlator
            else if (name.equals(SIProperties.JMS_TOG_ARM_Correlator)) {
                if (getARMCorrelator() != null)
                    result = true;
            }

        } // end of if JMS

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "propertyExists", Boolean.valueOf(result));
        return result;

    }
959410
def _name_exists(self, name):
        
        for i in range(self.count()):
            if self.tabText(i) == name:
                return True
        return False