I write some code of this structure bellow.

```py
if ....:
    if ....:
        ....
else:
    ....

```

A short example

```py
if name in name_dict:
    info = name_dict['name'] ## <-- may be a more complicated function
    if info == '':
        info = input("Input your info: ")
else:
    info = input("Input your info: ")

```

---

It looks non-pythonic and `yapf` always false indent the code into:

```py
if ....:
    if ....:
        ....
    else:
        ....

```

---

I try to rewrite the code into this form:

```py
if .... and ....:
    ....
else:
    ....

```

In this way, the example above can be transform into:

```py
if (name in name_dict) and name_dict['name'] != '':
    info = name_dict['name'] 
else:
    info = input("Input your info: ")

```

But in the rewritten code will execute the function `name_dict['name']` twice, thus it is not a efficient solutions. 

I wonder is there any pythonic way to rewrite this code block, without in creasing the complexity.