When used with override = true(ish), will try to locate the binding site
 for the variable and return it.

 If override is set to 'sub', will stop before digging into the parent
 subprocess.
485202
def locate_set_var(var, override)

      hk = h.variables && h.variables.has_key?(var)

      if ( ! override) || var.match(/^\//)
        false
      elsif override == 'sub' && DefineExpression.is_definition?(tree) && ! hk
        false
      elsif hk
        [ self, var ]
      elsif par = parent
        par.locate_set_var(var, override)
      else
        false
      end
    end
983271
def _may_override(self, implem, other):
        """"""
        if isinstance(other, ImplementationProperty):
            # Overriding another custom implementation for the same transition
            # and field
            return (other.transition == implem.transition and other.field_name == self.state_field)

        elif isinstance(other, TransitionWrapper):
            # Overriding the definition that led to adding the current
            # ImplementationProperty.
            return (
                other.trname == implem.transition.name
                and (not other.field or other.field == self.state_field)
                and other.func == implem.implementation)

        return False
509641
def override(name = nil, &block)
      if override = self.class.overrides(name)
        instance_eval(&override)
      else
        raise ArgumentError.new("no override by the name of #{name} has been configured")
      end
      self
    end
1352431
def _issubclass_2(subclass, superclass, bound_Generic, bound_typevars,
            bound_typevars_readonly, follow_fwd_refs, _recursion_check):
    
    if is_Tuple(superclass):
        return _issubclass_Tuple(subclass, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if is_Union(superclass):
        return _issubclass_Union(subclass, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if is_Union(subclass):
        return all(_issubclass(t, superclass, bound_Generic, bound_typevars,
                bound_typevars_readonly, follow_fwd_refs, _recursion_check) \
                for t in get_Union_params(subclass))
    if is_Generic(superclass):
        cls = superclass.__origin__ if not superclass.__origin__ is None else superclass
        # We would rather use issubclass(superclass.__origin__, Mapping), but that's somehow erroneous
        if pytypes.covariant_Mapping and (_has_base(cls, Mapping) or
                    # Python 3.7 maps everything to collections.abc:
                    (cls in _extra_dict and issubclass(cls, collections.abc.Mapping))):
            return _issubclass_Mapping_covariant(subclass, superclass,
                    bound_Generic, bound_typevars,
                    bound_typevars_readonly, follow_fwd_refs,
                    _recursion_check)
        else:
            return _issubclass_Generic(subclass, superclass, bound_Generic, bound_typevars,
                    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
    if subclass in _extra_dict:
        subclass = _extra_dict[subclass]
    try:
        return issubclass(subclass, superclass)
    except TypeError:
        if not is_Type(subclass):
            # For Python 3.7, types from typing are not types.
            # So issubclass emits TypeError: issubclass() arg 1 must be a class
            raise TypeError("Invalid type declaration: %s, %s" %
                        (type_str(subclass), type_str(superclass)))
        return False
685736
public void override(String key, String value) {
        if(value==null || value.length()==0) {
            remove(key);
            return;
        }

        int idx = key.indexOf('+');
        if(idx>0) {
            String realKey = key.substring(0,idx);
            String v = get(realKey);
            if(v==null) v=value;
            else {
                // we might be handling environment variables for a agent that can have different path separator
                // than the master, so the following is an attempt to get it right.
                // it's still more error prone that I'd like.
                char ch = platform==null ? File.pathSeparatorChar : platform.pathSeparator;
                v=value+ch+v;
            }
            put(realKey,v);
            return;
        }

        put(key,value);
    }
897631
public void enableOverride(int overrideId, int pathId, String clientUUID) throws Exception {
        // get profileId from pathId
        int profileId = PathOverrideService.getInstance().getPath(pathId).getProfileId();
        int newPriority = 0;

        // we want to limit -1, -2 to only be added once since they are the Custom responses/requests
        if (overrideId == Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM) {
            if (this.getEnabledEndpoint(pathId, overrideId, null, clientUUID) != null) {
                return;
            }
        }

        // need to first determine the highest enabled order value for this path
        HashMap<String, Object> priorities = sqlService.getFirstResult(
            "SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                " WHERE " + Constants.REQUEST_RESPONSE_PATH_ID + "=" + pathId +
                " AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID +
                "' ORDER BY + " + Constants.ENABLED_OVERRIDES_PRIORITY + " DESC"
        );
        if (priorities != null) {
            newPriority = Integer.valueOf(priorities.get(Constants.ENABLED_OVERRIDES_PRIORITY.toUpperCase()).toString()) + 1;
        }

        PreparedStatement statement = null;
        try (Connection sqlConnection = sqlService.getConnection()) {

            PreparedStatement query = null;
            ResultSet results = null;
            SQLService sqlService = SQLService.getInstance();
            com.groupon.odo.proxylib.models.Method method = null;
            query = sqlConnection.prepareStatement(
                "SELECT * FROM " + Constants.DB_TABLE_OVERRIDE +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            query.setString(1, String.valueOf(overrideId));
            results = query.executeQuery();
            JSONSerializer serializer = new JSONSerializer();
            if (results.next()) {
                String className = results.getString(Constants.OVERRIDE_CLASS_NAME);
                String methodName = results.getString(Constants.OVERRIDE_METHOD_NAME);
                method = PluginManager.getInstance().getMethod(className, methodName);
            }

            statement = sqlConnection.prepareStatement(
                "INSERT INTO " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                    "(" + Constants.GENERIC_PROFILE_ID + "," + Constants.GENERIC_CLIENT_UUID + "," +
                    Constants.REQUEST_RESPONSE_PATH_ID + "," + Constants.ENABLED_OVERRIDES_OVERRIDE_ID + "," +
                    Constants.ENABLED_OVERRIDES_PRIORITY + "," + Constants.ENABLED_OVERRIDES_ARGUMENTS +  "," +
                    Constants.ENABLED_OVERRIDES_RESPONSE_CODE + ")" +
                    " VALUES (?, ?, ?, ?, ?, ?, ?);"
            );
            statement.setInt(1, profileId);
            statement.setString(2, clientUUID);
            statement.setInt(3, pathId);
            statement.setInt(4, overrideId);
            statement.setInt(5, newPriority);
            if (method == null) {
                statement.setString(6, "");
            } else {
                ArrayList<String> argDefaults = new ArrayList<String>();
                for (int i = 0; i < method.getMethodArguments().length; i++) {
                    if (i < method.getMethodDefaultArguments().length && method.getMethodDefaultArguments()[i] != null) {
                        argDefaults.add(String.valueOf(method.getMethodDefaultArguments()[i]));
                    } else {
                        argDefaults.add("");
                    }
                }
                statement.setString(6, serializer.serialize(argDefaults));
            }
            statement.setString(7,"200");
            statement.executeUpdate();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
324308
def is_subdomain(self, other):
        
        compared = other.value if hasattr(other, 'value') else other
        try:
            return self.value.is_subdomain(compared)
        except AttributeError:
            return False
901114
def overlay=(value)
      reload(false) if self.overlay != value
      self.overlay = value && value.dup.freeze
    end
90585
public static Variable lookup(String varName, BindingSet bindingSet) {
        if (bindingSet == null) {
            return null;
        }
        Binding binding = bindingSet.lookup(varName);
        return (binding != null) ? binding.getVariable() : null;
    }
743488
private void checkForOverride(Properties properties, String name, String attr, String value) {
		String propertyValue = properties.getProperty(attr);
		if (propertyValue != null && !propertyValue.equals(value)) {
			LOG.warn(name + ":an attempt to override final parameter: " + attr
					+ ";  Ignoring.");
		}
	}
1029285
def set_overrides(args, _conf=None):
    
    # Get the subcommand name to avoid overwritting values from other
    # subcommands that are not going to be used
    subcommand = args.func.__name__
    command_section = 'ceph-deploy-%s' % subcommand
    conf = _conf or load()

    for section_name in conf.sections():
        if section_name in ['ceph-deploy-global', command_section]:
            override_subcommand(
                section_name,
                conf.items(section_name),
                args
            )
    return args
576850
public void add(Binding binding, boolean override) {
		final Set<Binding> moduleBindings = this.module.get().getBindings();
		final Binding otherBinding = findBinding(moduleBindings, binding);
		if (!override) {
			if (otherBinding != null) {
				throw new IllegalArgumentException(MessageFormat.format(
						"Forbidden override of {0} by {1}.", //$NON-NLS-1$
						otherBinding, binding));
			}
		} else if (otherBinding != null) {
			this.removableBindings.add(otherBinding);
		}
		if (!this.bindings.add(binding)) {
			throw new IllegalArgumentException(
					MessageFormat.format("Duplicate binding for {0} in {1}", binding.getKey(), this.name)); //$NON-NLS-1$
		}
	}
1037476
def extract_literal_bool(templatevar):
    
    # FilterExpression contains another 'var' that either contains a Variable or SafeData object.
    if hasattr(templatevar, 'var'):
        templatevar = templatevar.var
        if isinstance(templatevar, SafeData):
            # Literal in FilterExpression, can return.
            return is_true(templatevar)
        else:
            # Variable in FilterExpression, not going to work here.
            return None

    return is_true(templatevar)
496604
def after_or_asgn
      variable = variable_stack.pop.first
      value    = value_stack.pop.first

      if variable and value
        conditional_assignment(variable, value, false)
      end
    end
214385
def bound_variable(self):
        
        class BoundVariable:
            def __init__(self, variable):
                self.__variable = variable
                self.changed_event = Event.Event()
                self.needs_rebind_event = Event.Event()
                def property_changed(key):
                    if key == "value":
                        self.changed_event.fire()
                self.__variable_property_changed_listener = variable.property_changed_event.listen(property_changed)
            @property
            def value(self):
                return self.__variable.value
            def close(self):
                self.__variable_property_changed_listener.close()
                self.__variable_property_changed_listener = None

        return BoundVariable(self)
732013
static boolean hasSystemPropertyVariable(String variable) {
        final String path = System.getProperty(variable);
        if (path != null) {
            return true;
        }
        return false;
    }
300584
def binding_of(self, typevar):
        """"""
        if typevar in self._ns:
            return self._ns[typevar]
        if self._instance_ns and typevar in self._instance_ns:
            return self._instance_ns[typevar]
        return None