original_docstring: 
          R - curvature * width (dimensionless curvature)
          W - window size (in elements) that will be cut
          T - threshold for cut
      
docstring: curvature * width (dimensionless curvature)
  W - window size (in elements) that will be cut
  T - threshold for cut
docstring_tokens: curvature * width ( dimensionless curvature ) W - window size ( in elements ) that will be cut T - threshold for cut
code: def find_cutoffs_R(R, W = 5, T = 1):
      '''
          R - curvature * width (dimensionless curvature)
          W - window size (in elements) that will be cut
          T - threshold for cut
      '''
      indexes = np.where(np.abs(R) > T)[0][-1:]
  
      if len(indexes) == 0:
          return -1, -1
  
      ind1, ind2 = indexes[0] - W, indexes[0] + W
      
      for i in indexes:
          if i > ind1:
              ind1 = i - W
          
      return max(ind1, 0), min(ind2, len(R) -1)
code_tokens: def find_cutoffs_R ( R , W = 5 , T = 1 ) : indexes = np . where ( np . abs ( R ) > T ) [ 0 ] [ - 1 : ] if len ( indexes ) == 0 : return - 1 , - 1 ind1 , ind2 = indexes [ 0 ] - W , indexes [ 0 ] + W for i in indexes : if i > ind1 : ind1 = i - W return max ( ind1 , 0 ) , min ( ind2 , len ( R ) - 1 )
short_docstring: R - curvature * width (dimensionless curvature)
  W - window size (in elements) that will be cut
  T - threshold for cut
short_docstring_tokens: R - curvature * width ( dimensionless curvature ) W - window size ( in elements ) that will be cut T - threshold for cut
comment: '''
          R - curvature * width (dimensionless curvature)
          W - window size (in elements) that will be cut
          T - threshold for cut
      '''