<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def show_gene_expression(self, gene, avg=True, axes=None, **kwargs):
 """Display a gene's expressions. Displays a scatter plot using the SAM projection or another input projection with a particular gene's expressions overlaid. Parameters gene - string a case-sensitive string indicating the gene expression pattern to display. avg - bool, optional, default True If True, the plots use the k-nearest-neighbor-averaged expression values to smooth out noisy expression patterns and improves visualization. axes - matplotlib axis, optional, default None Plot output to the specified, existing axes. If None, create new figure window. **kwargs - all keyword arguments in 'SAM.scatter' are eligible. """


        all_gene_names = np.array(list(self.adata.var_names))
        cell_names = np.array(list(self.adata.obs_names))
        all_cell_names = np.array(list(self.adata_raw.obs_names))

        idx = np.where(all_gene_names == gene)[0]
        name = gene
        if(idx.size == 0):
            print(
                "Gene note found in the filtered dataset. Note that genes "
                "are case sensitive.")
            return

        if(avg):
            a = self.adata.layers['X_knn_avg'][:, idx].toarray().flatten()

            if a.sum() == 0:
                a = np.log2(self.adata_raw.X[np.in1d(
                    all_cell_names, cell_names), :][:,
                                                idx].toarray().flatten() + 1)
        else:
            a = np.log2(self.adata_raw.X[np.in1d(
                all_cell_names, cell_names), :][:,
                                                idx].toarray().flatten() + 1)

        if axes is None:
            plt.figure()
            axes = plt.gca()

        self.scatter(c=a, axes=axes, **kwargs)
        axes.set_title(name)