<commit_before>// Application
// =============================================================================

// Define module and dependencies

var weatherWidget = angular.module( 'weatherWidget', [] ) ;

// Define service to fetch weather data from external API

weatherWidget.factory( 'weatherService', function( $http, $q ) {

	return {
		getWeather: function( location ) {

			var deferred = $q.defer() ;

			$http.get( 'http://api.worldweatheronline.com/free/v1/weather.ashx?query=' + location + '&num_of_results=1&format=json&key=0c88abb019f82e1564f2248f0c4eee0a41fdae1a' )
			.success( function( data ) {
				deferred.resolve( {
					temperature: data.data.current_condition[ 0 ].temp_C,
					summary: data.data.current_condition[ 0 ].weatherDesc[ 0 ].value,
					icon: data.data.current_condition[ 0 ].weatherIconUrl[ 0 ].value
				} ) ;
			} )
			.error( function( error ) {
				deferred.reject( error ) ;
			} ) ;

			return deferred.promise ;
		}
	} ;

} ) ;

// Define controller to fetch weather data for required locations

weatherWidget.controller( 'weatherController', function( $scope, weatherService ) {
<commit_msg>Dropped unnecessary dependency on $scope<commit_after>// Application
// =============================================================================

// Define module and dependencies

var weatherWidget = angular.module( 'weatherWidget', [] ) ;

// Define service to fetch weather data from external API

weatherWidget.factory( 'weatherService', function( $http, $q ) {

	return {
		getWeather: function( location ) {

			var deferred = $q.defer() ;

			$http.get( 'http://api.worldweatheronline.com/free/v1/weather.ashx?query=' + location + '&num_of_results=1&format=json&key=0c88abb019f82e1564f2248f0c4eee0a41fdae1a' )
			.success( function( data ) {
				deferred.resolve( {
					temperature: data.data.current_condition[ 0 ].temp_C,
					summary: data.data.current_condition[ 0 ].weatherDesc[ 0 ].value,
					icon: data.data.current_condition[ 0 ].weatherIconUrl[ 0 ].value
				} ) ;
			} )
			.error( function( error ) {
				deferred.reject( error ) ;
			} ) ;

			return deferred.promise ;
		}
	} ;

} ) ;

// Define controller to fetch weather data for required locations

weatherWidget.controller( 'weatherController', function( weatherService ) {

{'fraction_non_alphanumeric': 0.18970780636720452, 'fraction_numerical': 0.02529437418229394, 'mean_word_length': 4.097777777777778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246979', 'n_tokens_mistral': 835, 'n_tokens_neox': 692, 'n_words': 155}