def _file_exists(self):
        """
        Check that the file exists. Also try to check the absolute path. If the
        file is found within the absolute path, then update the file path
        """
        file_found = True
        if not os.path.exists(self.file):
            if os.path.exists(os.path.join(Constants.ALTER_DIR, self.file)):
                self.file = os.path.join(Constants.ALTER_DIR, self.file)
            else:
                file_found = False

        # populate ref if file found
        if file_found:
            try:
                my_file = open(self.file)
                head = list(islice(my_file, 3))
            except __HOLE__, ex:
                if 'my_file' in locals():
                    my_file.close()
                sys.stderr.write("Error reading file '%s'\n\t=>%s\n" % (self.file, ex.message))

            if not MetaDataUtil.parse_direction(head) == 'up':
                sys.stderr.write("File can only be an up-alter: '%s'" % self.file)

            meta_data = MetaDataUtil.parse_meta(head)
            if 'ref' in meta_data:
                self.ref = meta_data['ref']

        return file_found
dataset/ETHPy150Open appnexus/schema-tool/schematool/command/resolve.py/ResolveCommand._file_exists