MCPcopy Create free account
hub / github.com/NCAR/wrf-python / arg_location

Function arg_location

src/wrf/util.py:3000–3030  ·  view source on GitHub ↗

Return the function arguments as a single list along with the index within that list for a specified argument name. This function parses the args, kargs and signature looking for the location of *argname*, and returns a list containing all arguments, along with the argument location

(func, argname, args, kwargs)

Source from the content-addressed store, hash-verified

2998
2999
3000def arg_location(func, argname, args, kwargs):
3001 """Return the function arguments as a single list along with the
3002 index within that list for a specified argument name.
3003
3004 This function parses the args, kargs and signature looking for the
3005 location of *argname*, and returns a list containing all arguments, along
3006 with the argument location in that list.
3007
3008 Args:
3009
3010 func (function): The function to examine (usually the function
3011 that is wrapped).
3012
3013 argname (:obj:`str`): The argument name to locate.
3014
3015 args (:obj:`tuple`): The positional arguments.
3016
3017 kwargs (:obj:`dict`): The keyword arguments.
3018
3019 Returns:
3020
3021 :obj:`tuple`: A tuple containing the list of all argument values along
3022 with the index for location of *argname*.
3023
3024 """
3025 if version_info > (3,):
3026 _arg_location = _arg_location3
3027 else:
3028 _arg_location = _arg_location2
3029
3030 return _arg_location(func, argname, args, kwargs)
3031
3032
3033def psafilepath():

Callers 4

func_wrapperFunction · 0.85
_set_cross_metaFunction · 0.85
_set_line_metaFunction · 0.85
from_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected