Turn the tree into a list of hashes.

        Returns:
            list:
768528
def ToHashArray(self):
        
        hashes = set()
        MerkleTree.__DepthFirstSearch(self.Root, hashes)
        return list(hashes)
1141493
def get_node_list(self):
        
        node_objs = list()

        for obj_dict_list in self.obj_dict['nodes'].values():
            node_objs.extend([
                Node(obj_dict=obj_d)
                for obj_d
                in obj_dict_list])

        return node_objs
1116586
def to_hash
      hash = {
        :slug         => slug, 
        :permalink    => permalink, 
        :name         => name, 
        :children     => children,
        :siblings     => siblings,
        :parent       => parent, 
        :ancestors    => ancestors,
        :navigation   => Bonsai::Navigation.tree,
        :updated_at   => mtime,
        :created_at   => ctime
      }.merge(formatted_content).merge(disk_assets).merge(Bonsai.site)
      
      hash.stringify_keys
    end
664583
def to_hash
      result = {}

      @values.keys.each do |field_name|
        value = __send__(field_name)
        hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value
        result.merge!(field_name => hashed_value)
      end

      result
    end
1164209
def to_hash
            index_hash = Hash.new
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash['org_id'] = org_id
            index_hash["account_id"] = account_id
            index_hash['name'] = name
            index_hash['cpu'] = cpu
            index_hash['ram'] = ram
            index_hash['disk'] = disk
            index_hash['regions'] = regions
            index_hash['price'] = price
            index_hash['properties'] = properties
            index_hash['category'] = category
            index_hash['status'] = status
            index_hash['created_at'] = created_at
            index_hash['updated_at'] = updated_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
634372
def to_hash()
      ret_hash = {}
      self.class.json_attributes.each do |attrib|
        ret_hash[attrib] = self.send(attrib.to_s.underscore)
      end
      return ret_hash
    end
26737
def bin_tree_to_list(root):
    
    if not root:
        return root
    root = bin_tree_to_list_util(root)
    while root.left:
        root = root.left
    return root
876235
def flatten_tree_to_ident_hashes(item_or_tree,
                                 lucent_id=TRANSLUCENT_BINDER_ID):
    """"""
    if 'contents' in item_or_tree:
        tree = item_or_tree
        if tree['id'] != lucent_id:
            yield tree['id']
        for i in tree['contents']:
            # yield from flatten_tree_to_ident_hashs(i, lucent_id)
            for x in flatten_tree_to_ident_hashes(i, lucent_id):
                yield x
    else:
        item = item_or_tree
        yield item['id']
422381
def headers_as_list(self):
        
        headers = self.headers
        headers_list = ['{}: {}'.format(key, value) for key, value in iteritems(headers)]
        return headers_list
811020
def get_hash(node,fields = None,exclude = ['pk','_id'],target = 'pk'):
    

    hasher = Hasher()

    def add_to_hash(value):

        if isinstance(value,dict):
            if target in value:
                add_to_hash(value[target])
            else:
                attribute_list = []
                for key,v in sorted(value.items(),key = lambda x: x[0]):

                    if (fields is not None and key not in fields) \
                        or (exclude is not None and key in exclude):
                        continue
                    add_to_hash(key)
                    add_to_hash(v)
        elif isinstance(value,(tuple,list)) and value and isinstance(value[0],(dict,node_class)):
            for i,v in enumerate(value):
                hasher.add(i)
                add_to_hash(v)
        else:
            hasher.add(value)

    add_to_hash(node)

    return hasher.digest.hexdigest()
1288566
def tree_of(values)
        result = {}
        current = result
        values.each do |k, v|
          keys = k.to_s.split('.')
          last_key = keys.pop
          keys.each do |ks|
            current = if current.key?(ks)
                        current[ks]
                      else
                        current[ks] = {}
                        current[ks]
                      end
          end
          current[last_key] = v
          current = result
        end
        result
      end
20046
def ComputeRoot(hashes):
        
        if not len(hashes):
            raise Exception('Hashes must have length')
        if len(hashes) == 1:
            return hashes[0]

        tree = MerkleTree(hashes)
        return tree.Root.Hash
979079
def to_hash
      {
        'url'              => url,
        'scheme'           => scheme,
        'host'             => host,
        'root_url'         => root_url,
        'title'            => title,
        'best_title'       => best_title,
        'author'           => author,
        'best_author'      => best_author,
        'description'      => description,
        'best_description' => best_description,
        'links'            => links.to_hash,
        'images'           => images.to_a,
        'charset'          => charset,
        'feed'             => feed,
        'content_type'     => content_type,
        'meta_tags'        => meta_tags,
        'favicon'          => images.favicon,
        'response'         => { 'status'  => response.status,
                                'headers' => response.headers }
      }
    end
84016
def get_all_chains(self):
        
        return [self.get_chain(i) for i in range(len(self.leaves))]
410143
def to_hash
            index_hash = {}
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash["account_id"] = account_id
            index_hash['name'] = name
            index_hash['allowed'] = allowed
            index_hash['allocated_to'] = allocated_to
            index_hash['quota_type'] = quota_type
            index_hash['status'] = status
            index_hash['inputs'] = inputs
            index_hash['created_at'] = created_at
            index_hash['updated_at'] = updated_at
            index_hash
        end
1065737
def read_hashes(self):
        
        var_len = self.read_var_int()
        items = []
        for _ in range(0, var_len):
            ba = bytearray(self.read_bytes(32))
            ba.reverse()
            items.append(ba.hex())
        return items
64951
def _convert_hashes(values):
    
    hashes = {}
    if not values:
        return hashes
    for value in values:
        try:
            name, value = value.split(":", 1)
        except ValueError:
            name = "sha256"
        if name not in hashes:
            hashes[name] = []
        hashes[name].append(value)
    return hashes