Checks the return statement is valid.
425011
function (node) {
        if (funcInfo.shouldCheck) {
          funcInfo.hasReturn = true

          if (!node.argument) {
            context.report({
              node: node,
              message: 'Expected a return value'
            })
          }
        }
      }
1309020
def valid():
    '''
    
    '''
    m_data = __salt__['config.merge']('mine_functions', {})
    # If we don't have any mine functions configured, then we should just bail out
    if not m_data:
        return

    data = {}
    for func in m_data:
        if m_data[func] and isinstance(m_data[func], dict):
            mine_func = m_data[func].pop('mine_function', func)
            if not _mine_function_available(mine_func):
                continue
            data[func] = {mine_func: m_data[func]}
        elif m_data[func] and isinstance(m_data[func], list):
            mine_func = func
            if isinstance(m_data[func][0], dict) and 'mine_function' in m_data[func][0]:
                mine_func = m_data[func][0]['mine_function']
                m_data[func].pop(0)

            if not _mine_function_available(mine_func):
                continue
            data[func] = {mine_func: m_data[func]}
        else:
            if not _mine_function_available(func):
                continue
            data[func] = m_data[func]

    return data
192858
def __assert_false(returned):
        '''
        
        '''
        result = "Pass"
        if isinstance(returned, str):
            try:
                returned = bool(returned)
            except ValueError:
                raise
        try:
            assert (returned is False), "{0} not False".format(returned)
        except AssertionError as err:
            result = "Fail: " + six.text_type(err)
        return result
1313425
public static boolean validate(Statement stmt) {
    try {
      Connection conn = stmt.getConnection();
      if (conn == null)
        return false;

      if (!conn.isClosed() && conn.isValid(10))
        return true;

      stmt.close();
      conn.close();
    } catch (SQLException e) {
      // this may well fail. that doesn't matter. we're just making an
      // attempt to clean up, and if we can't, that's just too bad.
    }
    return false;
  }
274740
def return_or_raise(cls, response, expected_status_code):
        """"""
        try:
            if response.status_code in expected_status_code:
                return response
        except TypeError:
            if response.status_code == expected_status_code:
                return response

        raise cls(response)
713719
def _ValidateValue(value, type_check):
  """"""
  if inspect.isclass(type_check):
    return isinstance(value, type_check)
  if isinstance(type_check, tuple):
    return _ValidateTuple(value, type_check)
  elif callable(type_check):
    return type_check(value)
  else:
    raise TypeError("Invalid type check '%s'" % repr(type_check))
680299
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, str)
693423
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return osp.isdir(to_text_string(qstr))
119450
public function hasReturnTypes()
    {
        if (\count($this->returnTypes)) {
            return true;
        }

        if (\count($this->returnClassTypes)) {
            return true;
        }

        return false;
    }
249485
private void checkReturnValue(Decl.FunctionOrMethod d, Environment last) {
		if (d.match(Modifier.Native.class) == null && last != FlowTypeUtils.BOTTOM && d.getReturns().size() != 0) {
			// In this case, code reaches the end of the function or method and,
			// furthermore, that this requires a return value. To get here means
			// that there was no explicit return statement given on at least one
			// execution path.
			syntaxError(d, MISSING_RETURN_STATEMENT);
		}
	}
120928
private boolean isValidReturnValueType(ExpressionTree tree, VisitorState state) {
    Type returnType = null;
    if (tree instanceof MethodInvocationTree) {
      returnType = getReturnType(((JCMethodInvocation) tree).getMethodSelect());
    } else if (tree instanceof MemberReferenceTree) {
      // Get the return type of the target referenced interface
      returnType =
          state.getTypes().findDescriptorType(((JCMemberReference) tree).type).getReturnType();
    }
    if (returnType != null) {
      return capturedTypeAllowed(returnType, state);
    }
    return true;
  }
387364
private static function is_valid() {
	if (self::is_active() == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('inactive session');
	}
	
	if (self::validate() == false) {
		return false;
	}
	if (self::challenge() == false) {
		return false;
	}
	
	if (is_callable(self::$validation_callback)) {
		if (call_user_func(self::$validation_callback) == false) {
			return false;
		}
	}
	
	return true;
}
113645
def _ensure_value_is_valid(self, value):
        """"""
        if not isinstance(value, self.__class__.value_type):
            raise TypeError('{0} is not valid collection value, instance '
                            'of {1} required'.format(
                                value, self.__class__.value_type))
        return value
863679
public void isInvalid() {
        ValidationResult validateResult = validate();
        if (validateResult.isValid()) {
            throwAssertionError(shouldBeInvalid(actual.getSystemId()));
        }
    }
1338064
def valid_return_codes(self, *codes):
        
        previous_codes = self._valid_return_codes
        self._valid_return_codes = codes

        yield

        self._valid_return_codes = previous_codes
837168
def is_valid(self):
        
        return (
            self.requirement is not None and self.requirement.optional
        ) or bool(self._future_value)
198262
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return osp.isfile(to_text_string(qstr))