Check the argument names of symbol.
    This function checks the duplication of arguments in Symbol.
    The check is done for feedforward net for now.

    Parameters
    ----------
    symbol : Symbol
        The network configuration.
333021
def _check_arguments(symbol):
    
    arg_set = set()
    arg_names = symbol.list_arguments()
    for name in arg_names:
        if name in arg_set:
            raise ValueError(('Find duplicated argument name \"%s\", ' +
                              'please make the weight name non-duplicated(using name arguments), ' +
                              'arguments are %s') % (name, str(arg_names)))
        arg_set.add(name)

    aux_set = set()
    aux_names = symbol.list_auxiliary_states()
    for name in aux_names:
        if name in aux_set:
            raise ValueError(
                ('Find duplicated auxiliary param name \"%s\", ' +
                 'please make the weight name non-duplicated(using name arguments), ' +
                 'arguments are %s, auxiliary params are %s'
                ) % (name, str(arg_names), str(aux_names)))
        aux_set.add(name)
646654
private void checkDuplicateTokens(MutableTemplateInfo templateInfo) throws TemplateException {
        List<String> allTokenNames = new ArrayList<String>();
        for (TemplateTokenInfo tokenInfo : templateInfo.tokenInfos) {
            if (allTokenNames.contains(tokenInfo.getName())) {
                throw new TemplateException("Token name '"
                        + tokenInfo.getName() + "' duplicated in template '" +
                        templateInfo.name + "'.");
            } else {
                allTokenNames.add(tokenInfo.getName());
            }
        }
    }
358274
static boolean isMatchSymbol(final Symbol symbol) {
        if (!(symbol instanceof BasisSymbol)) {
            return false;
        }
        BasisSymbol basisSymbol = (BasisSymbol) symbol;
        Set<Symbol> uniqueSymbols = new HashSet<Symbol>();
        for (Object o : basisSymbol.getSymbols()) {
            Symbol s = (Symbol) o;
            if (isGapSymbol(s)) {
                return false;
            }
            uniqueSymbols.add((Symbol) o);
        }
        return (uniqueSymbols.size() == 1);
    }
214681
def check_arguments(cls, conf):
        
        # Perform sanity checking on CIDR
        utils.ip_check(conf['fixed_cidr'], netmask_expected=True)

        # Perform sanity checking on host list
        for host in conf['fixed_hosts'].split(":"):
            utils.ip_check(host)
435411
def _lookup_in_all_namespaces(self, symbol):
        
        namespace = self.namespaces
        # Create a stack of namespaces.
        namespace_stack = []
        for current in symbol.namespace_stack:
            namespace = namespace.get(current)
            if namespace is None or not isinstance(namespace, dict):
                break
            namespace_stack.append(namespace)

        # Iterate through the stack in reverse order. Need to go from
        # innermost namespace to outermost.
        for namespace in reversed(namespace_stack):
            try:
                return self._lookup_namespace(symbol, namespace)
            except Error:
                pass
        return None
819133
def visit_Name(self, node):
        
        if node.id in self.symbols:
            symbol = path_to_node(self.symbols[node.id])
            if not getattr(symbol, 'isliteral', lambda: False)():
                parent = self.ancestors[node][-1]
                blacklist = (ast.Tuple,
                             ast.List,
                             ast.Set,
                             ast.Return)
                if isinstance(parent, blacklist):
                    raise PythranSyntaxError(
                        "Unsupported module identifier manipulation",
                        node)
            new_node = path_to_attr(self.symbols[node.id])
            new_node.ctx = node.ctx
            ast.copy_location(new_node, node)
            return new_node
        return node
575590
public boolean containsSymbolTerm(Token.Symbol symbol) {

        for(Term<FormattedNumber> term : terms) {
            if(!(term instanceof NumberTerm.SymbolTerm)) {
                continue;
            }

            final NumberTerm.SymbolTerm symbolTerm = (NumberTerm.SymbolTerm) term;
            if(symbolTerm.getToken().equals(symbol)) {
                return true;
            }
        }

        return false;

    }
271652
def nn_symbols():
    ""
    value = ctypes.c_int()
    name_value_pairs = []
    i = 0
    while True:
        name = _nn_symbol(i, ctypes.byref(value))
        if name is None:
            break
        i += 1
        name_value_pairs.append((name.decode('ascii'), value.value))
    return name_value_pairs
440864
def read_metadata(self, symbol):
        '''
        
        '''
        sym = self._get_symbol_info(symbol)
        if not sym:
            raise NoDataFoundException("Symbol does not exist.")
        x = self._symbols.find_one({SYMBOL: symbol})
        return x[USERMETA] if USERMETA in x else None
576370
def prepare_function_symbol(self, symbol_name, basic_addr=None):
        
        if basic_addr is None:
            basic_addr = self.project.loader.extern_object.get_pseudo_addr(symbol_name)
        return basic_addr, basic_addr
850033
private NameInfo getNameInfoForName(String name, SymbolType type) {
    Map<String, NameInfo> map = type == PROPERTY ? propertyNameInfo : varNameInfo;
    if (map.containsKey(name)) {
      return map.get(name);
    } else {
      NameInfo nameInfo = new NameInfo(name);
      map.put(name, nameInfo);
      symbolGraph.createNode(nameInfo);
      return nameInfo;
    }
  }
535715
def get(self, name, **kwargs):
        
        name = self._prefix + name
        if name not in self._params:
            self._params[name] = symbol.Variable(name, **kwargs)
        return self._params[name]
469655
def symbols_app(parser, _, args):  # pragma: no cover
    

    parser.add_argument('file', help='ELF file to list the symbols of')
    parser.add_argument('symbol', nargs='?', help='show only this symbol')
    parser.add_argument('--exact', '-e', action='store_const', const=True, help='filter by exact symbol name')
    args = parser.parse_args(args)

    print('%-18s %5s %-7s %-7s %-10s %5s %s' % (
        'value',
        'size',
        'type',
        'binding',
        'visibility',
        'index',
        'name',
    ))

    elf = ELF(args.file)
    for symbol in elf.symbols:
        if args.symbol:
            if args.exact:
                if symbol.name != args.symbol:
                    continue
            else:
                if args.symbol.lower() not in symbol.name.lower():
                    continue

        if symbol.shndx == symbol.SpecialSection.undef:
            shndx = 'UND'
        elif symbol.shndx == symbol.SpecialSection.abs:
            shndx = 'ABS'
        elif symbol.shndx == symbol.SpecialSection.common:
            shndx = 'COM'
        else:
            shndx = str(symbol.shndx)

        print('0x%016x %5d %-7s %-7s %-10s %5s %s' % (
            symbol.value,
            symbol.size,
            symbol.type.name,
            symbol.binding.name,
            symbol.visibility.name,
            shndx,
            symbol.name,
        ))
1131893
def _check_arg(self, arg):
        
        if isinstance(arg, list):
            return self._get_dependencies_from_args(arg)
        elif isinstance(arg, dict):
            return self._get_dependencies_from_kwargs(arg)

        if not is_dependency_name(arg):
            return set()
        return set([arg[1:]])
1132533
def unhook_symbol(self, symbol_name):
        
        sym = self.loader.find_symbol(symbol_name)
        if sym is None:
            l.warning("Could not find symbol %s", symbol_name)
            return False
        if sym.owner is self.loader._extern_object:
            l.warning("Refusing to unhook external symbol %s, replace it with another hook if you want to change it",
                      symbol_name)
            return False

        hook_addr, _ = self.simos.prepare_function_symbol(symbol_name, basic_addr=sym.rebased_addr)
        self.unhook(hook_addr)
        return True
461714
def infer_argument(self, funcnode, name, context):
        
        if name in self.duplicated_keywords:
            raise exceptions.InferenceError(
                "The arguments passed to {func!r} " " have duplicate keywords.",
                call_site=self,
                func=funcnode,
                arg=name,
                context=context,
            )

        # Look into the keywords first, maybe it's already there.
        try:
            return self.keyword_arguments[name].infer(context)
        except KeyError:
            pass

        # Too many arguments given and no variable arguments.
        if len(self.positional_arguments) > len(funcnode.args.args):
            if not funcnode.args.vararg:
                raise exceptions.InferenceError(
                    "Too many positional arguments "
                    "passed to {func!r} that does "
                    "not have *args.",
                    call_site=self,
                    func=funcnode,
                    arg=name,
                    context=context,
                )

        positional = self.positional_arguments[: len(funcnode.args.args)]
        vararg = self.positional_arguments[len(funcnode.args.args) :]
        argindex = funcnode.args.find_argname(name)[0]
        kwonlyargs = {arg.name for arg in funcnode.args.kwonlyargs}
        kwargs = {
            key: value
            for key, value in self.keyword_arguments.items()
            if key not in kwonlyargs
        }
        # If there are too few positionals compared to
        # what the function expects to receive, check to see
        # if the missing positional arguments were passed
        # as keyword arguments and if so, place them into the
        # positional args list.
        if len(positional) < len(funcnode.args.args):
            for func_arg in funcnode.args.args:
                if func_arg.name in kwargs:
                    arg = kwargs.pop(func_arg.name)
                    positional.append(arg)

        if argindex is not None:
            # 2. first argument of instance/class method
            if argindex == 0 and funcnode.type in ("method", "classmethod"):
                if context.boundnode is not None:
                    boundnode = context.boundnode
                else:
                    # XXX can do better ?
                    boundnode = funcnode.parent.frame()

                if isinstance(boundnode, nodes.ClassDef):
                    # Verify that we're accessing a method
                    # of the metaclass through a class, as in
                    # `cls.metaclass_method`. In this case, the
                    # first argument is always the class.
                    method_scope = funcnode.parent.scope()
                    if method_scope is boundnode.metaclass():
                        return iter((boundnode,))

                if funcnode.type == "method":
                    if not isinstance(boundnode, bases.Instance):
                        boundnode = bases.Instance(boundnode)
                    return iter((boundnode,))
                if funcnode.type == "classmethod":
                    return iter((boundnode,))
            # if we have a method, extract one position
            # from the index, so we'll take in account
            # the extra parameter represented by `self` or `cls`
            if funcnode.type in ("method", "classmethod"):
                argindex -= 1
            # 2. search arg index
            try:
                return self.positional_arguments[argindex].infer(context)
            except IndexError:
                pass

        if funcnode.args.kwarg == name:
            # It wants all the keywords that were passed into
            # the call site.
            if self.has_invalid_keywords():
                raise exceptions.InferenceError(
                    "Inference failed to find values for all keyword arguments "
                    "to {func!r}: {unpacked_kwargs!r} doesn't correspond to "
                    "{keyword_arguments!r}.",
                    keyword_arguments=self.keyword_arguments,
                    unpacked_kwargs=self._unpacked_kwargs,
                    call_site=self,
                    func=funcnode,
                    arg=name,
                    context=context,
                )
            kwarg = nodes.Dict(
                lineno=funcnode.args.lineno,
                col_offset=funcnode.args.col_offset,
                parent=funcnode.args,
            )
            kwarg.postinit(
                [(nodes.const_factory(key), value) for key, value in kwargs.items()]
            )
            return iter((kwarg,))
        if funcnode.args.vararg == name:
            # It wants all the args that were passed into
            # the call site.
            if self.has_invalid_arguments():
                raise exceptions.InferenceError(
                    "Inference failed to find values for all positional "
                    "arguments to {func!r}: {unpacked_args!r} doesn't "
                    "correspond to {positional_arguments!r}.",
                    positional_arguments=self.positional_arguments,
                    unpacked_args=self._unpacked_args,
                    call_site=self,
                    func=funcnode,
                    arg=name,
                    context=context,
                )
            args = nodes.Tuple(
                lineno=funcnode.args.lineno,
                col_offset=funcnode.args.col_offset,
                parent=funcnode.args,
            )
            args.postinit(vararg)
            return iter((args,))

        # Check if it's a default parameter.
        try:
            return funcnode.args.default_value(name).infer(context)
        except exceptions.NoDefault:
            pass
        raise exceptions.InferenceError(
            "No value found for argument {name} to " "{func!r}",
            call_site=self,
            func=funcnode,
            arg=name,
            context=context,
        )
865046
def is_argument(self, name):
        
        if name == self.vararg:
            return True
        if name == self.kwarg:
            return True
        return (
            self.find_argname(name, True)[1] is not None
            or self.kwonlyargs
            and _find_arg(name, self.kwonlyargs, True)[1] is not None
        )