original_docstring:  Parse a 'throttle' statement and return a RateLimit 
docstring: Parse a 'throttle' statement and return a RateLimit
docstring_tokens: Parse a ' throttle ' statement and return a RateLimit
code: def _parse_throttle(self, tablename: str, throttle: Any) -> RateLimit:
          """ Parse a 'throttle' statement and return a RateLimit """
          amount: List[float] = []
          desc = self.describe(tablename)
          if desc.throughput is None:
              throughputs = (0, 0)
          else:
              throughputs = (desc.throughput.read, desc.throughput.write)
          for value, throughput in zip(throttle[1:], throughputs):
              if value == "*":
                  amount.append(0)
              elif value[-1] == "%":
                  amount.append(throughput * float(value[:-1]) / 100.0)
              else:
                  amount.append(float(value))
          cap = Capacity(*amount)  # pylint: disable=E1120
          return RateLimit(total=cap, callback=self._on_throttle)
code_tokens: def _parse_throttle ( self , tablename : str , throttle : Any ) -> RateLimit : amount : List [ float ] = [ ] desc = self . describe ( tablename ) if desc . throughput is None : throughputs = ( 0 , 0 ) else : throughputs = ( desc . throughput . read , desc . throughput . write ) for value , throughput in zip ( throttle [ 1 : ] , throughputs ) : if value == "*" : amount . append ( 0 ) elif value [ - 1 ] == "%" : amount . append ( throughput * float ( value [ : - 1 ] ) / 100.0 ) else : amount . append ( float ( value ) ) cap = Capacity ( * amount ) return RateLimit ( total = cap , callback = self . _on_throttle )
short_docstring: Parse a 'throttle' statement and return a RateLimit
short_docstring_tokens: Parse a ' throttle ' statement and return a RateLimit
comment: """ Parse a 'throttle' statement and return a RateLimit """$SEP$# pylint: disable=E1120