add yapf style and apply yapf to format all Python files

This recreates pull request #2192
This commit is contained in:
Erwin Coumans
2019-04-27 07:31:15 -07:00
parent c591735042
commit ef9570c315
347 changed files with 70304 additions and 22752 deletions

View File

@@ -4,15 +4,19 @@ RAD_TO_DEG = 57.2957795
DEG_TO_RAD = 1.0 / RAD_TO_DEG
INVALID_IDX = -1
def lerp(x, y, t):
return (1 - t) * x + t * y
return (1 - t) * x + t * y
def log_lerp(x, y, t):
return np.exp(lerp(np.log(x), np.log(y), t))
return np.exp(lerp(np.log(x), np.log(y), t))
def flatten(arr_list):
return np.concatenate([np.reshape(a, [-1]) for a in arr_list], axis=0)
return np.concatenate([np.reshape(a, [-1]) for a in arr_list], axis=0)
def flip_coin(p):
rand_num = np.random.binomial(1, p, 1)
return rand_num[0] == 1
rand_num = np.random.binomial(1, p, 1)
return rand_num[0] == 1