def fit(self, X, y=None):
X = check_array(X)<EOL>if self.scale_by_median:<EOL><INDENT>self.median_ = np.median(X[np.triu_indices_from(X, k=<NUM_LIT:1>)],<EOL>overwrite_input=True)<EOL><DEDENT>elif hasattr(self, '<STR_LIT>'):<EOL><INDENT>del self.median_<EOL><DEDENT>return self<EOL>
If scale_by_median, find :attr:`median_`; otherwise, do nothing.

Parameters
----------
X : array
    The raw pairwise distances.