> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/localvariable/localvariable.get_parent.md).

# LocalVariable.get\_parent()

`get_parent() →` [`Callable`](/glider-ide/api/callable.md)

The function returns the [Function](/glider-ide/api/function.md) or [Modifier](/glider-ide/api/modifier.md) object of the function/modifier where the local variable is declared.

**Query Example**

```python
from glider import *
def query():
  funcs = Functions().exec(500)

  for func in funcs:
    local_vars = func.local_variables().list()
    for local_var in local_vars:
      print(local_var.name)
      print(local_var.memory_type)
      return [local_var.get_parent()]

  return []
```

**Output**

```solidity
"root":{3 items
"contract":string"0xd705c24267ed3c55458160104994c55c6492dfcf"
"contract_name":string"SafeMath"
"sol_function":solidity
function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }
},
"root":{1 item
"print_output":[2 items
0:string"c"
1:string"default"
]
}
```
