Extracts snapshot return header.
10194
def _parse_snapshot_share(response, name):
    '''
    
    '''
    snapshot = response.headers.get('x-ms-snapshot')

    return _parse_share(response, name, snapshot)
1096335
def _get_snapshot(self):
        """"""
        if self._snapshot is None:
            self._snapshot = self._get_session().snapshot(
                read_timestamp=self._read_timestamp,
                exact_staleness=self._exact_staleness,
                multi_use=True,
            )
            self._snapshot.begin()
        return self._snapshot
497268
def snapshot_registry(self):
        '''
        
        '''
        unserializer = banana.Unserializer(externalizer=self)
        serializer = banana.Serializer(externalizer=self)
        return unserializer.convert(serializer.convert(self.registry))
1369918
def get_header(self, key):
        
        key = canonicalize_header(key)
        if key in self.header:
            return self.header[key]
        return ''
889966
def extract_header_value(response, key)
        response.headers[key].class == Array ? response.headers[key].first.to_i : response.headers[key].to_i 
      end
1132417
def _get_header(self):
        """"""
        out = self._get_row(self.labels)
        out += "\n"
        out += self._get_row(["---"] * len(self.labels))  # line below headers
        return out
750643
def find_snapshot(name)
      find_helper = lambda do |name, root|
        return nil if root.nil?
        return root if root.name == name || root.uuid == name

        root.children.each do |child|
          result = find_helper.call(name, child)
          return result unless result.nil?
        end

        nil
      end

      find_helper.call(name, root_snapshot)
    end
945082
def extract_bad_snapshot(e):
        """"""
        msg = e.response['Error']['Message']
        error = e.response['Error']['Code']
        e_snap_id = None
        if error == 'InvalidSnapshot.NotFound':
            e_snap_id = msg[msg.find("'") + 1:msg.rfind("'")]
            log.warning("Snapshot not found %s" % e_snap_id)
        elif error == 'InvalidSnapshotID.Malformed':
            e_snap_id = msg[msg.find('"') + 1:msg.rfind('"')]
            log.warning("Snapshot id malformed %s" % e_snap_id)
        return e_snap_id
484127
function extractHeaders(options) {
    let headers = {};
    if (options && options.headers) {
        headers = options.headers;
        delete options.headers;
    }
    return headers;
}
1295801
def header(self):
    """"""
    return struct.pack(
        self.HEADER_STRUCT_FORMAT, self._command, self.arg0, self.arg1,
        len(self.data), self.data_crc32, self.magic)
701596
def fast_sync_inspect_snapshot( snapshot_path ):
    
    with open(snapshot_path, 'r') as f:
        info = fast_sync_inspect( f )
        if 'error' in info:
            log.error("Failed to inspect snapshot {}: {}".format(snapshot_path, info['error']))
            return {'error': 'Failed to inspect snapshot'}

        # get the hash of the file 
        hash_hex = get_file_hash(f, hashlib.sha256, fd_len=info['payload_size'])
        info['hash'] = hash_hex

    return info
1083065
def parse_blob_snapshot_parameter(url):
    # type: (str) -> str
    
    if blob_is_snapshot(url):
        tmp = url.split('?snapshot=')
        if len(tmp) == 2:
            return tmp[0], tmp[1]
    return None
858152
def _read_page_header(file_obj):
    """"""
    tin = TFileTransport(file_obj)
    pin = TCompactProtocolFactory().get_protocol(tin)
    page_header = parquet_thrift.PageHeader()
    page_header.read(pin)
    return page_header
1006213
def root_snapshot
      return nil if current_snapshot.nil?

      current = current_snapshot
      current = current.parent while current.parent != nil
      current
    end
116099
def _get_header(self):
        """"""
        fh = self._src
        obj = _make_object("Header")

        # first part of the header
        obj.Signature = sign = "".join(chr(unpack_ui8(fh)) for _ in range(3))
        obj.Version = self._version = unpack_ui8(fh)
        obj.FileLength = file_length = unpack_ui32(fh)

        # deal with compressed content
        if sign[0] == 'C':
            uncompressed = zlib.decompress(fh.read())
            if len(uncompressed) + 8 != file_length:
                raise ValueError("Problems dealing with compressed content")
            fh = self._src = io.BytesIO(uncompressed)

        # second part of the header
        obj.FrameSize = self._get_struct_rect()
        obj.FrameRate = unpack_ui16(fh)
        obj.FrameCount = unpack_ui16(fh)
        return obj
238330
def read_header(stream):
    """"""
    type_id = stream.read(4)
    if type_id != b"DIRC":
        raise AssertionError("Invalid index file header: %r" % type_id)
    version, num_entries = unpack(">LL", stream.read(4 * 2))

    # TODO: handle version 3: extended data, see read-cache.c
    assert version in (1, 2)
    return version, num_entries
566400
def _parseHeader (self, line, lineno, log):
    """"""
    if line.startswith('#') and line.find(':') > 0:
      tokens = [ t.strip().lower() for t in line[1:].split(":", 1) ]
      name   = tokens[0]
      pos    = SeqPos(line, lineno)

      if name in self.header:
        msg = 'Ignoring duplicate header parameter: %s'
        log.warning(msg % name, pos)
      else:
        for expected in ['seqid', 'version']:
          if name == expected:
            value = util.toNumber(tokens[1], None)
            if value is None:
              msg = 'Parameter "%s" value "%s" is not a number.'
              log.error(msg % (name, tokens[1]), poss)
            else:
              self.header[name] = value