MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / safe_get_index

Function safe_get_index

sat/sgm/modules/autoencoding/magvit2_pytorch.py:50–53  ·  view source on GitHub ↗
(it, ind, default=None)

Source from the content-addressed store, hash-verified

48
49
50def safe_get_index(it, ind, default=None):
51 if ind < len(it):
52 return it[ind]
53 return default
54
55
56def pair(t):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected