Can somenone translate this from Ruby to Python. Its a basic map function
This function is from the mongodb site: 
http://www.mongodb.org/display/DOCS/MongoDB+Data+Modeling+and+Rails

    def self.threaded_with_field(story, field_name='votes')
        comments = find(:all, :conditions => {:story_id => story.id}, :order => "path asc,  #{field_name} desc")
        results, map = [], {}
        comments.each do |comment|
          if comment.parent_id.blank?
            results << comment
          else
            comment.path =~ /:([\d|\w]+)$/
            if parent = $1
              map[parent] ||= []
              map[parent] << comment
            end
          end
        end
        assemble(results, map)
      end
Can somenone translate this from Ruby to Python. Its a basic map function
===

This function is from the mongodb site: 
http://www.mongodb.org/display/DOCS/MongoDB+Data+Modeling+and+Rails

    def self.threaded_with_field(story, field_name='votes')
        comments = find(:all, :conditions => {:story_id => story.id}, :order => "path asc,  #{field_name} desc")
        results, map = [], {}
        comments.each do |comment|
          if comment.parent_id.blank?
            results << comment
          else
            comment.path =~ /:([\d|\w]+)$/
            if parent = $1
              map[parent] ||= []
              map[parent] << comment
            end
          end
        end
        assemble(results, map)
      end