  The stochastic motion in a nonhomogeneous medium with traps is studied and
diffusion properties of that system are discussed. The particle is subjected to
a stochastic stimulation obeying a general L\'evy stable statistics and
experiences long rests due to traps the density of which depends on the
position. The memory is taken into account by subordination of that process to
a random time; then the subordination equation is position-dependent. The
problem is approximated by means of a decoupling of the trap geometry and
memory and exactly solved for a power-law trap density, corresponding to a
fractal medium structure, in the case of the Gaussian statistics: the density
distribution and moments are derived. Depending on geometry and memory
parameters, the system may reveal both the subdiffusion and enhanced diffusion.
A similar analysis is performed for the L\'evy flights where the finiteness of
the variance follows from a multiplicative noise, as a result of impurities and
defects at the boundary. Two diffusion regimes are found: in the bulk and near
the surface. The anomalous diffusion exponent as a function of the system
parameters is derived.
