Is device registered?

@param ipcam the IP camera device
@return True if device is registsred, false otherwise
437320
public static boolean isRegistered(IpCamDevice ipcam) {

		if (ipcam == null) {
			throw new IllegalArgumentException("IP camera device cannot be null");
		}

		Iterator<IpCamDevice> di = DEVICES.iterator();
		while (di.hasNext()) {
			if (di.next().getName().equals(ipcam.getName())) {
				return true;
			}
		}

		return false;
	}
997843
def is_ipv4(ip: str) -> bool:
    
    try:
        socket.inet_aton(ip)
    except socket.error:
        return False
    return True
101994
def deleteDevices(self, interface_id, addresses):
        """"""
        LOG.debug("RPCFunctions.deleteDevices: interface_id = %s, addresses = %s" % (
            interface_id, str(addresses)))
        # TODO: remove known device objects as well
        remote = interface_id.split('-')[-1]
        self._devices_raw[remote] = [device for device in self._devices_raw[
            remote] if not device['ADDRESS'] in addresses]
        self.saveDevices(remote)
        if self.systemcallback:
            self.systemcallback('deleteDevice', interface_id, addresses)
        return True
141948
public static boolean isObjectRegistered(String id, Object obj) {
    return DefaultMonitorRegistry.getInstance().isRegistered(newObjectMonitor(id, obj));
  }
10394
public static boolean isSelfSigned(X509Certificate cert,
        String sigProvider) {
        if (isSelfIssued(cert)) {
            try {
                if (sigProvider == null) {
                    cert.verify(cert.getPublicKey());
                } else {
                    cert.verify(cert.getPublicKey(), sigProvider);
                }
                return true;
            } catch (Exception e) {
                // In case of exception, return false
            }
        }
        return false;
    }
1229724
def is_device_virtual(self):
        
        for ip in self.obj_dict:
            drvr_obj = self.obj_dict.get(ip).get('drvr_obj')
            ret = drvr_obj.is_device_virtual()
            # No way to pin a device as of now, so return the first
            # TODO(padkrish)
            return ret
1146969
@Override
	public List<WebcamDevice> getDevices() {
		synchronized (this) {
			List<String> stdout = CommanderUtil.execute(this.command);
			if (stdout.isEmpty() || stdout.get(0).toLowerCase().contains(MSG_COMMAND_NOT_FOUND)) {
				throw new UnsupportedOperationException(MSG_RASPI_NOT_INSTALLED);
			}

			stdout = CommanderUtil.execute(COMMAND_VCGENCMD);
			if (stdout.size() != 1) {
				return Collections.emptyList();
			}
			String cameraCheckOutput = stdout.get(0).trim();
			int supported = Integer.parseInt(
					cameraCheckOutput.substring(cameraCheckOutput.indexOf("=") + 1, cameraCheckOutput.indexOf(" ")));
			if (supported == 0) {
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(MSG_HARDWARE_NOT_FOUND);
				}
				return Collections.emptyList();
			}
			int detected = Integer.parseInt(cameraCheckOutput.substring(cameraCheckOutput.lastIndexOf("=") + 1));
			List<WebcamDevice> devices = new ArrayList<>(detected);
			for (int i = 0; i < detected; i++) {
				WebcamDevice device = createIPCDevice(i, new LinkedHashMap<String, String>(arguments));
				devices.add(device);
			}
			deviceCalled = true;
			return devices;
		}
	}
1008243
function(recievedPeerId) {
        if (!isDeviceRegister) {
          if (registerDeviceTimeoutId) {
            clearTimeout(registerDeviceTimeoutId);
          }

          isDeviceRegister = true;
          peerId = recievedPeerId;
        }

        /**
         * If serverRegisteration == true we have to register
         * on server then make async status ready
         */
        if (serverRegisteration) {
          if (isServerRegister && peerId === oldPeerId) {
            fireEvent("asyncReady");
            isServerRegister = true;
            pushSendDataQueueHandler();

            socketState = socketStateType.OPEN;
            fireEvent("stateChange", {
              socketState: socketState,
              timeUntilReconnect: 0,
              deviceRegister: isDeviceRegister,
              serverRegister: isServerRegister,
              peerId: peerId
            });
          } else {
            socketState = socketStateType.OPEN;
            fireEvent("stateChange", {
              socketState: socketState,
              timeUntilReconnect: 0,
              deviceRegister: isDeviceRegister,
              serverRegister: isServerRegister,
              peerId: peerId
            });

            registerServer();
          }
        } else {
          fireEvent("asyncReady");
          isServerRegister = "Not Needed";
          pushSendDataQueueHandler();

          if (asyncLogging) {
            if (workerId > 0) {
              Utility.asyncStepLogger(workerId + "\t Async is Ready");
            } else {
              Utility.asyncStepLogger("Async is Ready");
            }
          }

          socketState = socketStateType.OPEN;
          fireEvent("stateChange", {
            socketState: socketState,
            timeUntilReconnect: 0,
            deviceRegister: isDeviceRegister,
            serverRegister: isServerRegister,
            peerId: peerId
          });
        }
      }
202576
def has_member(self, device_object):
        
        if device_object.tag == "computer":
            container_search = "computers/computer"
        elif device_object.tag == "mobile_device":
            container_search = "mobile_devices/mobile_device"
        else:
            raise ValueError

        return len([device for device in self.findall(container_search) if
                    device.findtext("id") == device_object.id]) is not 0
724512
static <K, V> boolean isRegistered(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
      Set<ObjectName> registeredObjectNames;
      MBeanServer mBeanServer = cache.getMBeanServer();

      if (mBeanServer != null) {
         ObjectName objectName = calculateObjectName(cache, objectNameType);
         registeredObjectNames = SecurityActions.queryNames(objectName, null, mBeanServer);

         return !registeredObjectNames.isEmpty();
      } else {
         return false;
      }
   }
347222
function isRecognisedBluetoothDevice(name) {
    if (!name) return false;
    var devs = recognisedBluetoothDevices();
    for (var i=0;i<devs.length;i++)
      if (name.substr(0, devs[i].length) == devs[i])
        return true;
    return false;
  }
1347473
private static boolean isIPv4MappedAddress(final byte[] addr) {
    if (addr.length < INADDR16SZ) {
      return false;
    }
    return addr[0] == 0x00 && addr[1] == 0x00 && addr[2] == 0x00 && addr[3] == 0x00
        && addr[4] == 0x00 && addr[5] == 0x00 && addr[6] == 0x00 && addr[7] == 0x00
        && addr[8] == 0x00 && addr[9] == 0x00 && addr[10] == (byte) 0xff && addr[11] == (byte) 0xff;
  }
391716
def _is_ipv4(self, ip):
        
        try:
            p = IPy.IP(ip)
        except ValueError:
            return False

        if p.version() == 4:
            return True
        return False
1023047
public boolean isIPAddressInRange(IPAddress address) {
		if (ipSubnetMask == null) {
			return this.ipAddress.equals(address);
		}
		
		int result1 = address.getIPAddress() & ipSubnetMask.getIPAddress();
		int result2 = ipAddress.getIPAddress() & ipSubnetMask.getIPAddress();
		
		return result1 == result2;
	}
254089
public boolean isAllowed(final DeviceState state) {
        boolean isAllowed = true;
        if (deniedStates.contains(state)) {
            isAllowed = false;
        }
        return isAllowed;
    }
288916
public boolean isRegistry(BareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        Objects.requireNonNull(jid, "JID argument must not be null");
        // At some point 'usedRegistries' will also contain the registry returned by findRegistry(), but since this is
        // not the case from the beginning, we perform findRegistry().equals(jid) too.
        Jid registry = findRegistry();
        if (jid.equals(registry)) {
            return true;
        }
        if (usedRegistries.contains(jid)) {
            return true;
        }
        return false;
    }
1204174
@Override
    public void webcamFound(WebcamDiscoveryEvent event) {
        Webcam webcam = event.getWebcam();
        LOG.debug("Discovered webcam : {}", webcam.getDevice().getName());

        webcams.put(webcam.getDevice().getName(), webcam);
    }