Read a text object given an identifier and a path

        :param identifier: Identifier of the text
        :param path: Path of the text files
        :return: Text
972271
def read(self, identifier, path=None):
        
        if self.CACHE_FULL_TEI is True:
            o = self.cache.get(_cache_key(self.texts_parsed_cache_key, identifier))
            if o is not None:
                return o
            else:
                with open(path) as f:
                    o = Text(urn=identifier, resource=self.xmlparse(f))
                    self.cache.set(_cache_key(self.texts_parsed_cache_key, identifier), o)
        else:
            with open(path) as f:
                o = Text(urn=identifier, resource=self.xmlparse(f))
        return o
1274722
def read(*paths):
    ''''''
    with open(os.path.join(os.path.dirname(__file__), *paths)) as fp:
        return fp.read()
385254
def _GetFileSystemCacheIdentifier(self, path_spec):
    
    string_parts = []

    string_parts.append(getattr(path_spec.parent, 'comparable', ''))
    string_parts.append('type: {0:s}'.format(path_spec.type_indicator))

    return ''.join(string_parts)
244557
def _read_file(path):
    '''
    
    '''
    try:
        with salt.utils.files.flopen(path, 'rb') as contents:
            return [salt.utils.stringutils.to_str(line) for line in contents.readlines()]
    except (OSError, IOError):
        return ''
700124
def read_data(file_path):
    

    if not is_valid(file_path):
        write_data(file_path, {})

    db = open_file_for_reading(file_path)
    content = db.read()

    obj = decode(content)

    db.close()

    return obj
146136
def identify_with_list(identifier):
    
    @wraps(identifier)
    def decorated_func(origin, filepath, fileobj, *args, **kwargs):
        # pylint: disable=missing-docstring
        try:
            filepath = file_list(filepath)[0]
        except ValueError:
            if filepath is None:
                try:
                    files = file_list(args[0])
                except (IndexError, ValueError):
                    pass
                else:
                    if files:
                        filepath = files[0]
        except IndexError:
            pass
        return identifier(origin, filepath, fileobj, *args, **kwargs)
    return decorated_func
1107163
def generate_identifier(result):
    
    # Determine the playbook file path to use for the ID
    if result.task.playbook and result.task.playbook.path:
        playbook_file = result.task.playbook.path
    else:
        playbook_file = ''
    play_path = u'%s.%s' % (playbook_file, result.task.play.name)

    # Determine the task file path to use for the ID
    if result.task.file and result.task.file.path:
        task_file = result.task.file.path
    else:
        task_file = ''
    task_path = u'%s.%s' % (task_file, result.task.name)

    # Combine both of the above for a full path
    identifier_path = u'%s.%s' % (play_path, task_path)

    # Assign the identifier as a hash of the fully unique path.
    identifier = hashlib.sha1(encodeutils.to_utf8(identifier_path)).hexdigest()

    return identifier
548496
def mount(self, identifier):
        

        driver = self.client.info()['Driver']
        driver_mount_fn = getattr(self, "_mount_" + driver,
                                  self._unsupported_backend)
        cid = driver_mount_fn(identifier)

        # Return mount path so it can be later unmounted by path
        return self.mountpoint, cid
657767
def get_from_ident(self, ident):
        
        model_repr, job_pk = ident.split(':', 1)
        klass = import_class(model_repr)
        return klass.get(job_pk)
139824
def upath(path):
    
    if six.PY2 and not isinstance(path, six.text_type):
        return path.decode(fs_encoding)
    return path
379447
def inspect_file(path):
    
    with open(path, 'rb') as f:
        labels, count = inspect(tx.decode(line) for line in f)
    return labels, count
448337
def _read(path):
    
    input = open(path, "r", encoding="utf-8")
    try:
        return input.read()
    finally:
        input.close()
480187
def read_file(self, path):
        

        self.assert_valid_path(path)

        with open(path, 'rb') as file:
            contents = file.read().decode('UTF-8')

        return contents
566412
def read(path):
    
    data = None
    with open(path, 'r') as f:
        data = f.read()
    f.close()
    return data
394560
def readFile(self, pathToFile):
        
        fd = open(pathToFile,  "rb")
        data = fd.read()
        fd.close()
        return data
323995
def _parse_identifier(self, identifier, zone=None):
        
        rdtype, name, content = None, None, None
        if len(identifier) > 7:
            parts = identifier.split('/')
            rdtype, name, content = parts[0], parts[1], '/'.join(parts[2:])
        else:
            records = self._list_records_in_zone(zone)
            for record in records:
                if record['id'] == identifier:
                    rdtype, name, content = record['type'], record['name'] + '.', record['content']
        return rdtype, name, content
1073374
def unique_identifier(self):
        
        for t in IDENTIFIER_PRIORITY:
            found = self._tree.getroot().find('.//mods:identifier[@type="%s"]' % t, NS)
            if found is not None:
                return found.text