Finds the scoped instance for an instance (i.e. the agent that manages this instance).
@param instance an instance (not null)
@return a non-null instance, the scoped instance
507131
public static Instance findScopedInstance( Instance instance ) {

		Instance scopedInstance = instance;
		while( scopedInstance.getParent() != null
				&& ! isTarget( scopedInstance ))
			scopedInstance = scopedInstance.getParent();

		return scopedInstance;
	}
40992
public static <T> T getPropertyValue(final Object instance, final String fieldName) {
		try {
			return (T) PropertyUtils.getProperty(instance, fieldName);
		} catch (final Exception e) {
			throw new RuntimeException(e);
		}
	}
291045
def get_container_for(self, instance):
        
        if IReferenceAnalysis.providedBy(instance):
            return api.get_uid(instance.getSample())
        return instance.getRequestUID()
176839
public <T> List<String> getCountersFor(T instance) {
        if (instance == null) {
            throw new IllegalArgumentException("Instance cannot be null");
        }

        DocumentInfo documentInfo = getDocumentInfo(instance);

        ArrayNode countersArray = (ArrayNode) documentInfo.getMetadata().get(Constants.Documents.Metadata.COUNTERS);
        if (countersArray == null) {
            return null;
        }

        return IntStream.range(0, countersArray.size())
                .mapToObj(i -> countersArray.get(i).asText())
                .collect(Collectors.toList());
    }
1175641
public Resource getResource(final Instance _instance)
        throws EFapsException
    {
        Resource ret = null;
        try {
            Store.LOG.debug("Getting resource for: {} with properties: {}", this.resource, this.resourceProperties);
            ret = (Resource) Class.forName(this.resource).newInstance();
            ret.initialize(_instance, this);
        } catch (final InstantiationException e) {
            throw new EFapsException(Store.class, "getResource.InstantiationException", e, this.resource);
        } catch (final IllegalAccessException e) {
            throw new EFapsException(Store.class, "getResource.IllegalAccessException", e, this.resource);
        } catch (final ClassNotFoundException e) {
            throw new EFapsException(Store.class, "getResource.ClassNotFoundException", e, this.resource);
        }
        return ret;
    }
629317
public static ResourceScanner getInstance() {
		if(INSTANCE == null) {
			synchronized(ResourceScanner.class) {
				if(INSTANCE == null) {
					INSTANCE = new ResourceScanner();
				}
			}
		}
		
		return INSTANCE;
	}
927204
public static Class<?> getUserClass(Object instance) {
		Assert.notNull(instance, "Instance must not be null");
		return getUserClass(instance.getClass());
	}
597943
public static Instance findRootInstance( Instance instance ) {

		Instance rootInstance = instance;
		while( rootInstance.getParent() != null )
			rootInstance = rootInstance.getParent();

		return rootInstance;
	}
253657
public static Driver getInstance(String instanceName) {
        if (instanceName == null) {
            instanceName = DEFAULT_INSTANCE_NAME;
        }
        if (instances.getInstances().isEmpty()) {
            throw new ConfigurationException("Driver has not been configured and driver.properties file was not found");
        }
        Driver instance = instances.getInstances().get(instanceName);
        if (instance == null) {
            throw new ConfigurationException("No configuration properties found for factory : " + instanceName);
        }
        return instance;
    }
513061
public static <T> Provider<T> ofInstance(final T instance) {
		return new Provider<T>() {
			@Override
			public T get() {
				return instance;
			}
		};
	}
1225654
@Override
	public Object getInstance() {
		final String sourceMethod = "getInstance"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AggregatorExtension.class.getName(), sourceMethod);
			log.exiting(AggregatorExtension.class.getName(), sourceMethod, instance);
		}
		return instance;
	}
1359002
@SuppressWarnings("unchecked")
    public void injectNonContextualInstance(final Object instance) {
        if (instance != null) {
            CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
            InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>) manager
                    .createInjectionTarget(getAnnotatedType(instance));
            injectionTarget.inject(instance, creationalContext);
        }
    }
1212673
def getInstance(cls, *args):
        '''
        
        '''
        if not cls.__singleton:
            cls.__singleton = Config(*args)
        return cls.__singleton
713922
public GetInstanceResponse getInstance(GetInstanceRequest request) {
        checkNotNull(request, "request should not be null.");
        checkNotNull(request.getInstanceId(), "request instanceId should not be null.");
        InternalRequest internalRequest = this.createRequest(
                request, HttpMethodName.GET, INSTANCE_PREFIX, request.getInstanceId());
        return this.invokeHttpClient(internalRequest, GetInstanceResponse.class);
    }
1320834
public Object getValue(Object instance) {
        try {
            return getMethod.invoke(instance);
        } catch (Exception e) {
            throw new PropertyNotFoundException(klass, getType(), fieldName);
        }

    }
274529
public static InstanceFields declaredFieldsOf(Object instance) {
        List<InstanceField> instanceFields = new ArrayList<InstanceField>();
        instanceFields.addAll(instanceFieldsIn(instance, instance.getClass().getDeclaredFields()));
        return new InstanceFields(instance, instanceFields);
    }
669558
public Instance getInstance() {
    System.out.println("\nGet Instance");
    // [START bigtable_get_instance]
    Instance instance = null;
    try {
      instance = adminClient.getInstance(instanceId);
      System.out.println("Instance ID: " + instance.getId());
      System.out.println("Display Name: " + instance.getDisplayName());
      System.out.print("Labels: ");
      Map<String, String> labels = instance.getLabels();
      for (String key : labels.keySet()) {
        System.out.printf("%s - %s", key, labels.get(key));
      }
      System.out.println("\nState: " + instance.getState());
      System.out.println("Type: " + instance.getType());
    } catch (NotFoundException e) {
      System.err.println("Failed to get non-existent instance: " + e.getMessage());
    }
    // [END bigtable_get_instance]
    return instance;
  }