Detects if there is any xor operation in the function.

        :return: Tags
331572
def has_xor(self):
        

        def _has_xor(expr):
            return isinstance(expr, pyvex.IRExpr.Binop) and expr.op.startswith("Iop_Xor")

        found_xor = False

        for block in self._function.blocks:
            if block.size == 0:
                continue
            for stmt in block.vex.statements:
                if isinstance(stmt, pyvex.IRStmt.Put):
                    found_xor = found_xor or _has_xor(stmt.data)
                elif isinstance(stmt, pyvex.IRStmt.WrTmp):
                    found_xor = found_xor or _has_xor(stmt.data)
            if found_xor:
                break

        if found_xor:
            return { CodeTags.HAS_XOR }
        return None
521387
def xorsum(t):
    
    _b = t[0]
    for i in t[1:]:
        _b = _b ^ i
        _b &= 0xff
    return _b
1118160
def check(f):
    
    if hasattr(f, 'wrapped_fn'):
        return f
    else:
        @wraps(f)
        def decorated(*args, **kwargs):
            return check_conditions(f, args, kwargs)
        decorated.wrapped_fn = f
        return decorated
572770
def is_start_of_function(text):
    """"""
    if isinstance(text, str) or isinstance(text, unicode):
        function_prefix = ['def', 'async def']
        text = text.lstrip()

        for prefix in function_prefix:
            if text.startswith(prefix):
                return True

    return False
1367307
function isTagExpr (node) {
  return typeof(node) === 'object' && node.type === 'assign' && !node.local
    && node.varname === 'tags'
    && node.value.length > 2
    && node.value[0].type === 'lookup' && node.value[0].varname === 'tags'
    && node.value[1] === ' '
}
188990
function verify(node) {
            if (node.operator !== "=" || node.right.type !== "BinaryExpression") {
                return;
            }

            const left = node.left;
            const expr = node.right;
            const operator = expr.operator;

            if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) {
                if (same(left, expr.left)) {
                    context.report({
                        node,
                        messageId: "replaced",
                        fix(fixer) {
                            if (canBeFixed(left)) {
                                const equalsToken = getOperatorToken(node);
                                const operatorToken = getOperatorToken(expr);
                                const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]);
                                const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]);

                                return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`);
                            }
                            return null;
                        }
                    });
                } else if (same(left, expr.right) && isCommutativeOperatorWithShorthand(operator)) {

                    /*
                     * This case can't be fixed safely.
                     * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would
                     * change the execution order of the valueOf() functions.
                     */
                    context.report({
                        node,
                        messageId: "replaced"
                    });
                }
            }
        }
470046
def tagfunc(nargs=None, ndefs=None, nouts=None):
    
    def wrapper(f):
        return wraps(f)(FunctionWithTag(f, nargs=nargs, nouts=nouts, ndefs=ndefs))

    return wrapper
864196
def find(self, func):
        
        self.ftmp = None

        def test(value, index, list):
            if func(value, index, list) is True:
                self.ftmp = value
                return True
        self._clean.any(test)
        return self._wrap(self.ftmp)
48972
def check_no_blank_before(self, function, docstring):  # def
        
        if docstring:
            before, _, after = function.source.partition(docstring)
            blanks_before = list(map(is_blank, before.split('\n')[:-1]))
            blanks_after = list(map(is_blank, after.split('\n')[1:]))
            blanks_before_count = sum(takewhile(bool, reversed(blanks_before)))
            blanks_after_count = sum(takewhile(bool, blanks_after))
            if blanks_before_count != 0:
                yield violations.D201(blanks_before_count)
            if not all(blanks_after) and blanks_after_count != 0:
                yield violations.D202(blanks_after_count)
232330
def _classify_no_operation(self, regs_init, regs_fini, mem_fini, written_regs, read_regs):
        
        # TODO: Flags should be taken into account

        matches = []

        # Check that registers didn't change their value.
        regs_changed = any(regs_init[r] != regs_fini[r] for r in regs_init)

        # Check that flags didn't change their value.
        flags_changed = False

        # Check that memory didn't change.
        mem_changed = mem_fini.get_write_count() != 0

        if not regs_changed and not flags_changed and not mem_changed:
            matches.append({
                "op": "nop",
            })

        return matches
635960
def _xor_block(a, b):
    
    return ''.join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b)])
1370061
def check(source)
    if source.match(/notice:\s+(.+?):\s+(.+)\s*/)
      source_element   = $1
      source_operation = ''
      source_message   = $2
                    
      source_elements  = source_element.split('/')
      source_operation = source_elements.pop.strip unless source_elements.last.match(/[\[\]]/)
                    
      if source_operation
        source_element = source_elements.join('/').strip
        
        logger.debug("#{source_element} includes: #{element} -- " + ( source_element.include?(element) ? 'true' : 'false' ))
        logger.debug("#{source_operation} is: #{operation} -- " + ( source_operation == operation ? 'true' : 'false' ))
        logger.debug("#{source_message} includes: #{message} -- " + ( source_message.include?(message) ? 'true' : 'false' ))
        
        if source_element.include?(element) && source_operation == operation && source_message.include?(message)
            logger.debug("MATCH! -> #{element} - #{operation} - #{message}") 
            return true
        end
      end
    end
    logger.debug("nothing -> #{element} - #{operation} - #{message}") 
    return false
  end
214446
def is_defined_in_xxx(xxx, cls):
        
        if not cls.parent:
            return False

        if not isinstance(cls.parent, namespace.namespace_t):
            return False

        if xxx != cls.parent.name:
            return False

        xxx_ns = cls.parent
        if not xxx_ns.parent:
            return False

        if not isinstance(xxx_ns.parent, namespace.namespace_t):
            return False

        if xxx_ns.parent.name != '::':
            return False

        global_ns = xxx_ns.parent
        return None is global_ns.parent
688801
def lambdef_check(self, original, loc, tokens):
        """"""
        return self.check_strict("Python-style lambda", original, loc, tokens)
40910
def _validate_xor_args(self, p):
        
        if len(p[1]) != 2:
            raise ValueError('Invalid syntax: XOR only accepts 2 arguments, got {0}: {1}'.format(len(p[1]), p))
6958
def xor(s, pad):
    ''''''
    from itertools import cycle
    s = bytearray(force_bytes(s, encoding='latin-1'))
    pad = bytearray(force_bytes(pad, encoding='latin-1'))
    return binary_type(bytearray(x ^ y for x, y in zip(s, cycle(pad))))
922335
def logical_xor(f1, f2):  # function factory
    '''
    '''
    def f_xor(arr):
        return np.logical_xor(f1(arr), f2(arr))
    f_xor.__name__ = f1.__name__ + "_xor_" + f2.__name__
    return f_xor