<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def record(self, pipeline_name, from_study):
 """ Returns the provenance record for a given pipeline Parameters pipeline_name : str The name of the pipeline that generated the record from_study : str The name of the study that the pipeline was generated from Returns ------- record : arcana.provenance.Record The provenance record generated by the specified pipeline """

        try:
            return self._records[(pipeline_name, from_study)]
        except KeyError:
            found = []
            for sname, pnames in groupby(sorted(self._records,
                                                key=itemgetter(1)),
                                         key=itemgetter(1)):
                found.append(
                    "'{}' for '{}'".format("', '".join(p for p, _ in pnames),
                                           sname))
            raise ArcanaNameError(
                (pipeline_name, from_study),
                ("{} doesn't have a provenance record for pipeline '{}' "
                 "for '{}' study (found {})".format(
                     self, pipeline_name, from_study,
                     '; '.join(found))))