Set target.

        :param target: new target to use.
        :param target ctx: target ctx if target is an class/instance attribute.
357990
def set_target(self, target, ctx=None):
        

        if target is not None:
            # check if target is already intercepted
            if is_intercepted(target):
                # set self interception last target reference
                self._interception = target
                # and targets, ctx
                self.target, self.ctx = get_intercepted(target)
            else:
                # if not, update target reference with new interception
                self.apply_pointcut(target, ctx=ctx)
550733
def add_for_targets(self, targets, products):
    
    # TODO: This is a temporary helper for use until the classpath has been split.
    for target in targets:
      self.add_for_target(target, products)
259191
def set_fallback(self, target):
        
        if isinstance(target, Section):
            target = ':' + target.name

        self._set('fallback-config', target)

        return self
1335964
def target_exists(self, target_id=0):
        
        try:
            target = self._target(target_id=target_id)
        except Exception as e:
            log.error("Exception checking if target exists: {} {}".format(type(e), e))
            return False
        return target is not None
471529
public void setFor(final IsWidget target) {
    if (init) {
      return;
    }
    init = true;
    //

    final InputElement input = getInputElement(target.asWidget());
    if (input != null) {
      if (!input.hasAttribute("id")) {
        input.setId(DOM.createUniqueId());
      }
      getElement().setAttribute("for", input.getId());
    }
  }
860909
public static void setFieldValue(Object target, String fieldName, Object value) {
        try {
            Field field = target.getClass().getDeclaredField(fieldName);
            field.setAccessible(true);
            field.set(target, value);
        } catch (NoSuchFieldException e) {
            throw handleException(fieldName, e);
        } catch (IllegalAccessException e) {
            throw handleException(fieldName, e);
        }
    }
1337331
public void setTarget(Map<String, Object> target) {
        removeEntriesStartingWith(TARGET);
        eventMap.putAll(target);
    }
875608
def set_launch_target(build_target)
      launch_runnable = BuildableProductRunnable.new(build_target, 0)
      launch_action.buildable_product_runnable = launch_runnable

      profile_runnable = BuildableProductRunnable.new(build_target)
      profile_action.buildable_product_runnable = profile_runnable

      macro_exp = MacroExpansion.new(build_target)
      test_action.add_macro_expansion(macro_exp)
    end
288387
def load_target(cls, scheme, path, fragment, username,
                    password, hostname, port, query,
                    load_method, **kwargs):
        
        raise NotImplementedError("load_target must be overridden")
996379
def _coerce_target(self, target):
        
        if not target or isinstance(target, six.string_types):
            return target
        if not hasattr(target, 'instance'):
            return None

        if getattr(target.instance, '_deferred', False):
            model = target.instance._meta.proxy_for_model
        else:
            model = target.instance.__class__

        return '%s.%s.%s' % (
            model._meta.app_label,
            model.__name__,
            target.field.name,
        )
1248497
def add_rule(self, rule_class, target_class=_Nothing):
        
        if isinstance(target_class, Iterable):
            for cls in target_class:
                self._rules[cls] = rule_class
        else:
            self._rules[target_class] = rule_class
8244
def set_target(self, niterations=None, eff_nsamples=None):
        
        if niterations is None and eff_nsamples is None:
            raise ValueError("Must provide a target niterations or "
                             "eff_nsamples")
        if niterations is not None and eff_nsamples is not None:
            raise ValueError("Must provide a target niterations or "
                             "eff_nsamples, not both")
        self._target_niterations = int(niterations) \
            if niterations is not None else None
        self._target_eff_nsamples = int(eff_nsamples) \
            if eff_nsamples is not None else None
47130
def _hijack_target(self):
        """"""

        if self._target.is_class_or_module():
            setattr(self._target.obj, self._method_name, self)
        elif self._attr.kind == 'property':
            proxy_property = ProxyProperty(
                double_name(self._method_name),
                self._original_method,
            )
            setattr(self._target.obj.__class__, self._method_name, proxy_property)
            self._target.obj.__dict__[double_name(self._method_name)] = self
        else:
            self._target.obj.__dict__[self._method_name] = self

        if self._method_name in ['__call__', '__enter__', '__exit__']:
            self._target.hijack_attr(self._method_name)
257372
def set(cls, **kwargs):
        
        global SCOUT_PYTHON_VALUES
        for key, value in kwargs.items():
            SCOUT_PYTHON_VALUES[key] = value
405641
public function setTarget($target): self
    {
        if (!\is_object($target)) {
            throw new \InvalidArgumentException('The $target should be an object, '.\gettype($target).' given');
        }

        $this->target = $target;

        return $this;
    }
1329320
def set_deploy_target(tgt)
      case selected = context.fetch(:selected_deploy_target, nil)
      when nil
        context.set :selected_deploy_target, tgt
      when tgt
        # OK, do nothing
      else
        raise "#{tgt} given but already selected deploy target: #{selected}"
      end
    end
625540
def create_main_target (self, name):
        
        assert isinstance(name, basestring)
        if not self.built_main_targets_:
            self.build_main_targets ()

        return self.main_targets_.get (name, None)