 		analyze_languagewise_contribution language_importance_ratio, resp, (err)->
 			console.log err if err?
 			console.log "Done..!!"
+

		avg: $avg: '$weight'
	.exec (err, resp) ->
		console.log err if err?
		console.log resp
		async.each resp,
		(authorwt, callback) ->
			new db.UserAvgWeight

			callback

extract_temporal_commit_info = (callback)->
	process.env.TZ = 'UTC'
	o = {}
	o.map = ()->
		dt = new Date 0
		dt.setMonth do this.timestamp.getMonth
		dt.setYear do this.timestamp.getFullYear
		dt.setDate 1

		ret = {}
		lang_changes = {}
		count = 0
		for change in this.changes
			if change.language? && dt?
				emit change.language , { "date" : dt.toUTCString() , "changes" : change.count}
			
	o.reduce = (lang, changes)->
		res = {}
		for change in changes
			if change.date?
				res[change.date] ?= 0
				res[change.date] += change.changes
		arr =
			for key, value of res
				date : key , changes : value
		ret = {}
		ret["lang"] = lang
		ret["temporal"] = arr
		ret
	o.out =  replace: "temporalcommits_new" 
	db.Commit.mapReduce o, (err, model, stats)->
		console.log stats
		callback err, model
