def _generate_model_binaries(self):

        # if a list of binary names is passed, only the associated pcaps
        # are merged and copied to their corresponding capture dir
        if len(self.binaries) == 0:
            self.binaries = os.listdir(self.binaries_dir)
        #initialize dic with all binaries analyzed
        pcaps = {b: [] for b in self.binaries}
        # find all pcaps associated to the same binary
        if not self.analyses_ival:
            for path, dirs, files in os.walk(os.path.abspath(self.analyses_dir)):
                for file in files:
                    if file.endswith("pcap"):
                        binary_link = os.path.join(path, 'binary')
                        binary_name = os.path.realpath(binary_link).split('/')[-1]
                        if binary_name in self.binaries:
                            pcap_path = os.path.join(path, file)
                            pcaps[binary_name] += [pcap_path]
        # find all pcaps associated to the same binary within
        # a range of executions
        else:
            print "finding pcaps in {}".format(self.analyses_ival)
            for d in self.analyses_ival:
                path = os.path.join(self.analyses_dir, str(d))
                files = os.listdir(os.path.abspath(path))
                for f in files:
                    if f.endswith("pcap"):
                        binary_link = os.path.join(path, 'binary')
                        binary_name = os.path.realpath(binary_link).split('/')[-1]
                        if binary_name in self.binaries:
                            pcap_path = os.path.join(path, f)
                            pcaps[binary_name] += [pcap_path]

        # generate model from each binary pcaps
        for bin_name, pcap_list in pcaps.items():
            self._merge_pcaps(bin_name, pcap_list)
            self._extract_derrick(bin_name)
            self._generate_prisma_input(bin_name)
            self._generate_clusters(bin_name)
            self._build_model_files(bin_name)
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/model.py/ModelGenerator._generate_model_binaries/original