parameters: ( fpc, tpc, fpr )
docstring: Returns the (estimated) tpr for the given fpr for 
      the given false positive/true positive coordinates
      from an ROC curve.
  
      `fpc` - False positive coordinates from ROC curve
      `tpc` - True positive coordinates from ROC curve
docstring_summary: Returns the (estimated) tpr for the given fpr for 
      the given false positive/true positive coordinates
      from an ROC curve.
docstring_tokens: Returns the ( estimated ) tpr for the given fpr for the given false positive / true positive coordinates from an ROC curve .
function: def _tpr_for_fpr( fpc, tpc, fpr ):
      """
      Returns the (estimated) tpr for the given fpr for 
      the given false positive/true positive coordinates
      from an ROC curve.
  
      `fpc` - False positive coordinates from ROC curve
      `tpc` - True positive coordinates from ROC curve
      """
      
      # take advantage of monotonic property of ROC curves
      # and search for fpr in O( log n ) time
      idx = bisect_left( fpc, fpr, 0, len(fpc)-1 )
      
      # if exact match, then return
      if fpc[ idx ] == fpr:
          return tpc[ idx ]
  
      else:
          # check if idx is last index of fpc
          #if idx == len( fpc ) - 1:
          #    return tpc[ idx ]
  
          # check if the neighboring fprs are identical
          #elif fpc[ idx ] == fpc[ idx + 1 ]:
              # return the average of the tprs 
          #    return ( tpc[ idx ] + tpc[ idx+1 ] ) / 2.0
          # otherwise, interpolate the tpr
          return _interpolate( ( fpc[ idx-1 ], tpc[ idx-1 ] ),
                               ( fpc[ idx ], tpc[ idx ] ),
                               fpr )
function_tokens: def _tpr_for_fpr ( fpc , tpc , fpr ) : # take advantage of monotonic property of ROC curves # and search for fpr in O( log n ) time idx = bisect_left ( fpc , fpr , 0 , len ( fpc ) - 1 ) # if exact match, then return if fpc [ idx ] == fpr : return tpc [ idx ] else : # check if idx is last index of fpc #if idx == len( fpc ) - 1: #    return tpc[ idx ] # check if the neighboring fprs are identical #elif fpc[ idx ] == fpc[ idx + 1 ]: # return the average of the tprs  #    return ( tpc[ idx ] + tpc[ idx+1 ] ) / 2.0 # otherwise, interpolate the tpr return _interpolate ( ( fpc [ idx - 1 ] , tpc [ idx - 1 ] ) , ( fpc [ idx ] , tpc [ idx ] ) , fpr )