Evaluates one of several different types of methods to determine the
 value of the salt.  Methods can be one of the following types:
 * Method / Proc
 * String
 * Object that responds to :salt
191767
def salt_value(value)
        if value.is_a?(Proc)
          value.call
        elsif value.respond_to?(:salt)
          value.salt
        else
          value.to_s
        end
      end
280673
private Object getValue(Method method) throws VarExploderException
    {
        try
        {
            if (method == null)
            {
                return null;
            }
            return method.invoke(source);
        }
        catch (IllegalArgumentException e)
        {
            throw new VarExploderException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new VarExploderException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new VarExploderException(e);
        }
    }
156628
private String getMethodName(Method method) {
        StatName statNameAnnotation = method.getAnnotation(StatName.class);
        return statNameAnnotation != null ? statNameAnnotation.value() : method.getName();
    }
1106631
function(method) {
		return function(object, options) {
			//console.log("client-store schema validation", this.schema);
			var schema = this.schema;
			if (!schema)
				return deep.Arguments([object, options]);
			options = options || {};
			var id = options.id || object.id,
				query = null;
			if (id) {
				query = id.split("/");
				if (query.length > 1) {
					id = query.shift();
					query = "/" + query.join("/");
				} else
					query = null;
			}
			var finalise = function(schema) {
				if (!query) { // validate whole object
					var report = deep.validate(object, schema);
					if (!report.valid)
						return deep.errors.PreconditionFail(method + " failed", report);
				} else { // partial validation : could be unrelevant as it could depend of whole item structure
					// what TODO here...? : if nothing : it should be validated remotely
				}
				return deep.Arguments([object, options]);
			};
			if (typeof schema === 'string')
				return deep.get(schema)
					.done(finalise);
			return finalise(schema);
		};
	}
101764
def method_missing(method, *args, &block)
      attribute = Ldaptic.encode(method)
      if attribute[-1] == ?=
        attribute.chop!
        if may_must(attribute)
          return write_attribute(attribute, *args, &block)
        end
      elsif attribute[-1] == ??
        attribute.chop!
        if may_must(attribute)
          if args.empty?
            return !read_attribute(attribute).empty?
          else
            return args.flatten.any? {|arg| compare(attribute, arg)}
          end
        end
      elsif attribute =~ /\A(.*)-before-type-cast\z/ && may_must($1)
        return read_attribute($1, *args, &block)
      elsif may_must(attribute)
        return read_attribute(attribute, *args, &block).one
      end
      super(method, *args, &block)
    end
1329735
private String getMethodName(Method method) {
        StatName statName = method.getAnnotation(StatName.class);
        return statName == null ? method.getName() : statName.value();
    }
911343
def method_missing(method_symbol, *args, &block)
      key = method_symbol.to_s
      set = key.chomp!('=')
      if set
        self[key] = args.first
      elsif self.key?(key)
        self[key]
      else
        nil
      end
    end
204555
def method_missing(meth, *args, &block)
      # Check to see if it can be evaluated
      if(matches? meth)
        #Defines the method and caches it to the class
        self.class.send(:define_method, meth) do
          # Splits the method and parameter. See formatize and directionize
          @csf::config()::getStringArray(meth.to_s.to_java_name).to_a
        end
        # calls the method
        send meth, *args, &block
      else
        super
      end
    end
856888
def _hash_internal(method, salt, password):
    
    if method == 'plain':
        return password, method

    if isinstance(password, text_type):
        password = password.encode('utf-8')

    if method.startswith('pbkdf2:'):
        args = method[7:].split(':')
        if len(args) not in (1, 2):
            raise ValueError('Invalid number of arguments for PBKDF2')
        method = args.pop(0)
        iterations = args and int(args[0] or 0) or DEFAULT_PBKDF2_ITERATIONS
        is_pbkdf2 = True
        actual_method = 'pbkdf2:%s:%d' % (method, iterations)
    else:
        is_pbkdf2 = False
        actual_method = method

    hash_func = _hash_funcs.get(method)
    if hash_func is None:
        raise TypeError('invalid method %r' % method)

    if is_pbkdf2:
        if not salt:
            raise ValueError('Salt is required for PBKDF2')
        rv = pbkdf2_hex(password, salt, iterations,
                        hashfunc=hash_func)
    elif salt:
        if isinstance(salt, text_type):
            salt = salt.encode('utf-8')
        rv = hmac.HMAC(salt, password, hash_func).hexdigest()
    else:
        h = hash_func()
        h.update(password)
        rv = h.hexdigest()
    return rv, actual_method
1100067
def evaluate(context, *args, &block)
      self.result = if block
          context.define_singleton_method(:__callback__, &self)
          ret = context.send :__callback__, *args, &block
          context.class_eval { send :remove_method, :__callback__ }
          ret
        else
          context.instance_exec(*args, &self)
        end
    end
996115
def eval_master_func(opts):
    '''
    
    '''
    if '__master_func_evaluated' not in opts:
        # split module and function and try loading the module
        mod_fun = opts['master']
        mod, fun = mod_fun.split('.')
        try:
            master_mod = salt.loader.raw_mod(opts, mod, fun)
            if not master_mod:
                raise KeyError
            # we take whatever the module returns as master address
            opts['master'] = master_mod[mod_fun]()
            # Check for valid types
            if not isinstance(opts['master'], (six.string_types, list)):
                raise TypeError
            opts['__master_func_evaluated'] = True
        except KeyError:
            log.error('Failed to load module %s', mod_fun)
            sys.exit(salt.defaults.exitcodes.EX_GENERIC)
        except TypeError:
            log.error('%s returned from %s is not a string', opts['master'], mod_fun)
            sys.exit(salt.defaults.exitcodes.EX_GENERIC)
        log.info('Evaluated master from module: %s', mod_fun)
895522
def method_missing(meth, *args, &block)
      if args.size == 1 and meth =~ /^(.+)=$/
        self[$1.to_sym] = args[0]
      else
        super meth, *args, &block
      end
    end
507746
def _call_salt_command(self,
                           fun,
                           args,
                           kwargs,
                           assertion_section=None):
        '''
        
        '''
        value = False
        try:
            if args and kwargs:
                value = self.salt_lc.cmd(fun, *args, **kwargs)
            elif args and not kwargs:
                value = self.salt_lc.cmd(fun, *args)
            elif not args and kwargs:
                value = self.salt_lc.cmd(fun, **kwargs)
            else:
                value = self.salt_lc.cmd(fun)
        except salt.exceptions.SaltException:
            raise
        except Exception:
            raise
        if isinstance(value, dict) and assertion_section:
            return value.get(assertion_section, False)
        else:
            return value
119181
def method_missing(method, *args, &block)
      if method.to_s =~ UNIT_LIST_REGEX

        if $2 || $4 || $6
          conditions = []

          conditions << "unit.is_#{$2}_unit?"     if $2
          conditions << "!unit.is_prefixed_unit?" if $4
          conditions << "unit.is_#{$6}_unit?"     if $6

          units = Unit.units.values.select { |unit| instance_eval(conditions.join(" && ")) }
        else
          units = Unit.units.values
        end

        return_format = ( $8 ? $8.to_sym : nil )
        units.map(&return_format).to_a
        
      elsif unit = Unit.for(method)

        return unit
      else

        super
      end
    end
456525
def method_missing(name, *arguments)
      value = arguments[0]
      name = name.to_s
      if name[-1, 1] == '='
        key = name[/(.+)\s?=/, 1]
        @data[key.to_sym] = value unless instance_variables.include? "@#{key}".to_sym
      else
        @data[name.to_sym]
      end
    end
736052
private boolean isHandlerMethod(final Method method) {
        boolean isHandler = false;

        if (hasStartSagaAnnotation(method) || hasHandlerAnnotation(method)) {
            if (method.getReturnType().equals(Void.TYPE)) {
                Class<?>[] parameterTypes = method.getParameterTypes();
                if (parameterTypes.length == 1) {
                    isHandler = true;
                } else {
                    LOG.warn("Method {}.{} marked for saga does not have the expected single parameter.", method.getDeclaringClass(), method.getName());
                }
            } else {
                LOG.warn("Method {}.{} marked for saga event handling but does return a value.", method.getDeclaringClass(), method.getName());
            }
        }

        return isHandler;
    }
510411
def _WsdlHasMethod(self, method_name):
    
    try:
      self._method_bindings.get(method_name)
      return True
    except ValueError:
      return False