Defines an instanceof-conditional to be applied to following service definitions.
9207
final public function instanceof(string $fqcn): InstanceofConfigurator
    {
        $this->instanceof[$fqcn] = $definition = new ChildDefinition('');

        return new InstanceofConfigurator($this, $definition, $fqcn, $this->path);
    }
396546
void addRequest(final InstanceType instanceType, final int numberOfInstances) {

		Integer numberOfRemainingInstances = this.pendingRequests.get(instanceType);
		if (numberOfRemainingInstances == null) {
			numberOfRemainingInstances = Integer.valueOf(numberOfInstances);
		} else {
			numberOfRemainingInstances = Integer.valueOf(numberOfRemainingInstances.intValue() + numberOfInstances);
		}

		this.pendingRequests.put(instanceType, numberOfRemainingInstances);
	}
101991
public static boolean instanceOf(Object a, Object b, Context cx)
    {
        // Check RHS is an object
        if (! (b instanceof Scriptable)) {
            throw typeError0("msg.instanceof.not.object");
        }

        // for primitive values on LHS, return false
        if (! (a instanceof Scriptable))
            return false;

        return ((Scriptable)b).hasInstance((Scriptable)a);
    }
38566
function isInstance(node) {
  if (node.type === 'Identifier') {
    if (currentOptions.angular) {
      if (instanceVarsRegExp.angular.test(node.name)) {
        return true;
      }
    } else {
      if (instanceVarsRegExp.noangular.test(node.name)) {
        return true;
      }
    }
  }
  if (node.type === 'CallExpression') {
    if (isConstructor(node.callee)) {
      return true;
    }
    if (node.callee.type === 'MemberExpression') {
      if (isInstance(node.callee.object)) {
        if (node.callee.property.type === 'Identifier' &&
            constants.METHODS.CHAIN.indexOf(node.callee.property.name) !== -1) {
          return true;
        }
      }
    }
  }
  return false;
}
220830
def convert_coerce_type_to_instanceof_filter(coerce_type_block):
    """"""
    coerce_type_target = get_only_element_from_collection(coerce_type_block.target_class)

    # INSTANCEOF requires the target class to be passed in as a string,
    # so we make the target class a string literal.
    new_predicate = BinaryComposition(
        u'INSTANCEOF', LocalField('@this'), Literal(coerce_type_target))

    return Filter(new_predicate)
153886
@Override
  public boolean isInstanceOf(KbCollection collection, Context context) {
    return wrapped().isInstanceOf(collection, context);
  }
1233514
public static boolean isServiceRunning(Context context, Class<? extends Service> service) {
        return isServiceRunning(context, service, Integer.MAX_VALUE);
    }
550296
public void registerService(ProvidedServiceInstance serviceInstance) {
        getServiceDirectoryClient().registerServiceInstance(serviceInstance);
        getCacheServiceInstances().put(new ServiceInstanceToken(serviceInstance.getServiceName(), serviceInstance.getProviderId()), new InstanceHealthPair(null));
    }
635181
public static StackManipulation of(TypeDescription typeDescription) {
        if (typeDescription.isPrimitive()) {
            throw new IllegalArgumentException("Cannot check an instance against a primitive type: " + typeDescription);
        }
        return new InstanceCheck(typeDescription);
    }
240504
function (newPrototype) {
        _gpfObjectForEach(this._initialDefinition, function (value, memberName) {
            if (!memberName.startsWith("$")) {
                newPrototype[memberName] = value;
            }
        }, this);
    }
657128
def instance_of(cls):
    
    def check(value):
        return (
            isinstance(value, cls),
            u"{value!r} is instance of {actual!s}, required {required!s}".format(
                value=value,
                actual=fullyQualifiedName(type(value)),
                required=fullyQualifiedName(cls),
            ),
        )
    return check
905830
@Override
    public boolean hasInstance(Scriptable value) {
        Scriptable proto = value.getPrototype();
        while (proto != null) {
            if (proto.equals(this))
                return true;
            proto = proto.getPrototype();
        }

        return false;
    }
1080948
def apply_if_callable(maybe_callable, obj, **kwargs):
    

    if callable(maybe_callable):
        return maybe_callable(obj, **kwargs)

    return maybe_callable
463965
function isInstanceOf(cls) {
        var i, l, bases = this.constructor._meta.bases;
        for (i = 0, l = bases.length; i < l; i += 1) {
            if (bases[i] === cls) {
                return true;
            }
        }
        return this instanceof cls;
    }
1101747
public static void validateProvidedServiceInstance(
            ProvidedServiceInstance serviceInstance) throws ServiceException {
        
        if (serviceInstance == null) {
            throw new ServiceException(
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(),
                    "service instance");
        }
               
        validateServiceName(serviceInstance.getServiceName());
        validateURI(serviceInstance.getUri());
        validateAddress(serviceInstance.getAddress());
        
        if (serviceInstance.getMetadata()!=null) { //allow metadata as null
            validateMetadata(serviceInstance.getMetadata());
        }
    }
580689
def InstanceOf(cls, **kwargs):
    """"""
    return Property(types=cls, load=cls.load, **kwargs)
1096542
def types_strict(instance):
    
    if instance['type'] not in enums.TYPES:
        yield JSONError("Object type '%s' is not one of those defined in the"
                        " specification." % instance['type'], instance['id'])

    if has_cyber_observable_data(instance):
        for key, obj in instance['objects'].items():
            if 'type' in obj and obj['type'] not in enums.OBSERVABLE_TYPES:
                yield JSONError("Observable object %s is type '%s' which is "
                                "not one of those defined in the "
                                "specification."
                                % (key, obj['type']), instance['id'])