In my case, this error shows when you accidentally (e.g. made a typo) use brackets instead of parentheses to call your function, e.g.:
def my_func(arg1):
pass
my_func[arg1] # oops
Solution: simply call the function with parentheses instead:
def my_func(arg1):
pass
my_func(arg1) # fixed
So similarly, in your case, you should simply change the brackets into parentheses to call your function:
Broken:
get_the_valid_locations[-2] # X
Fixed:
get_the_valid_locations(-2) # O
Just make sure your function is actually expecting an integer. It's unclear what type `board` is, so I highly recommend that you start using [type hints][1] in your function signatures.
[1]: https://docs.python.org/3/library/typing.html
In my case, this error shows when you accidentally (e.g. made a typo) use brackets instead of parentheses to call your function, e.g.:
def my_func(arg1):
pass
my_func[arg1] # oops
Solution: simply call the function with parentheses instead:
def my_func(arg1):
pass
my_func(arg1) # fixed