<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _process_environments(self):
 """ There's only about 30 environments in which the phenotypes are recorded. There are no externally accessible identifiers for environments, so we make anonymous nodes for now. Some of the environments are comprised of >1 of the other environments; we do some simple parsing to match the strings of the environmental labels to the other atomic components. :return: """

        if self.test_mode:
            graph = self.testgraph
        else:
            graph = self.graph
        raw = '/'.join((self.rawdir, 'environment'))
        LOG.info("building labels for environment")
        env_parts = {}
        label_map = {}
        env = Environment(graph)
        with open(raw, 'r') as f:
            filereader = csv.reader(f, delimiter='\t', quotechar='\"')
            f.readline()  # read the header row; skip
            for line in filereader:
                (environment_id, uniquename, description) = line
                # 22      heat sensitive | tetracycline conditional

                environment_num = environment_id
                environment_internal_id = self._makeInternalIdentifier(
                    'environment', environment_num)
                if environment_num not in self.idhash['environment']:
                    self.idhash['environment'][environment_num] = \
                        environment_internal_id

                environment_id = self.idhash['environment'][environment_num]
                environment_label = uniquename
                if environment_label == 'unspecified':
                    environment_label += ' environment'
                env.addEnvironment(environment_id, environment_label)
                self.label_hash[environment_id] = environment_label

                # split up the environment into parts
                # if there's parts, then add them to the hash;
                # we'll match the components in a second pass
                components = re.split(r'\|', uniquename)
                if len(components) > 1:
                    env_parts[environment_id] = components
                else:
                    label_map[environment_label] = environment_id

            # ### end loop through file

        # build the environmental components
        for eid in env_parts:
            eid = eid.strip()
            for e in env_parts[eid]:
                # search for the environmental component by label
                env_id = label_map.get(e.strip())
                env.addComponentToEnvironment(eid, env_id)

        return