code: def is_file(self, path):
          
          return (samefile(path, self.device_file) or
                  samefile(path, self.loop_file) or
                  any(samefile(path, mp) for mp in self.mount_paths) or
                  sameuuid(path, self.id_uuid) or
                  sameuuid(path, self.partition_uuid))
docs: Comparison by mount and device file path.