<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def registerResearchRegion(regionTypeName, moduleName=None):
 """ Register this region so that NuPIC can later find it. @param regionTypeName: (str) type name of the region. E.g LanguageSensor. @param moduleName: (str) location of the region class, only needed if registering a region that is outside the expected "regions/" dir. """

  global _PY_REGIONS

  if moduleName is None:
    # the region is located in the regions/ directory
    moduleName = "htmresearch.regions." + regionTypeName
  if regionTypeName not in _PY_REGIONS:
    # Add new region class to the network.
    module = __import__(moduleName, {}, {}, regionTypeName)
    unregisteredClass = getattr(module, regionTypeName)
    Network.registerRegion(unregisteredClass)
    # Add region to list of registered PyRegions
    _PY_REGIONS.append(regionTypeName)