parameters: (self, idx)
return_statement: return self._builder.select(is_negative, wrapped_index, idx)
docstring: Fix negative indices by adding the size to them.  Positive
          indices are left untouched.
docstring_summary: Fix negative indices by adding the size to them.  Positive
          indices are left untouched.
docstring_tokens: Fix negative indices by adding the size to them . Positive indices are left untouched .
function: def fix_index(self, idx):
          """
          Fix negative indices by adding the size to them.  Positive
          indices are left untouched.
          """
          is_negative = self._builder.icmp_signed('<', idx,
                                                  ir.Constant(idx.type, 0))
          wrapped_index = self._builder.add(idx, self.size)
          return self._builder.select(is_negative, wrapped_index, idx)
function_tokens: def fix_index ( self , idx ) : is_negative = self . _builder . icmp_signed ( '<' , idx , ir . Constant ( idx . type , 0 ) ) wrapped_index = self . _builder . add ( idx , self . size ) return self . _builder . select ( is_negative , wrapped_index , idx )