<commit_before>(function(){
  var place_image = function(_place) {
    return (_place.origin == "yumit") ? '/images/yumit-icon.png' : _place.icon ;
  };
  Yumit.model.Yum = {

    //return places nearby
    // getPlacesNearby: function(/*Object*/ _args) {
    //   var params={ query:'' };
    //   if (_args.query) {
    //     params.query = _args.query;
    //   }
    //   Yumit.model.request({
    //     method:'GET',
    //     action:'http://dev.yumit.com/api/v0/places/nearby', //'?latlon=-33.441355,-70.650566',
    //     //parameters: params,
    //     //parameters: 'latlon=-33.441779525,-70.6503987',
    //     parameters: 'latlon=-33.441779525,-70.6503987&query='+(params.query || ''),
    //     error: function(e,xhr) {
    //       Yumit.ui.alert('Arguments', _args.error);
    //     },
    //     success: function(json,xhr) {
    //       var results = [];
    //       for (var i=0,l=json.length;i<l;i++) {
    //         results.push(json[i]);
    //       }
    //       if (_args.success) { _args.success(results); }
    //     }
    //   });
    // },

    //return yums from your friends
    getYumsFriends: function(/*Object*/ _args) {
      Yumit.model.request({
        method:'GET',
        action:Yumit.api_path+'/api/v0/yums/friends.json',
        token: Titanium.App.Properties.getString("token"),
        parameters: '',
        error: function(e,xhr) {
		  if (_args.onfinish) { _args.onfinish(); }
          Yumit.ui.alert('Arguments', _args.error);
        },
        success: function(json,xhr) {
          var results = [];
          for (var i=0,l=json.length;i<l;i++) {
            results.push(json[i].yum);
          }
		  if (_args.onfinish) { _args.onfinish(); }
          if (_args.success) { _args.success(results); }
        }
      });
    },

    //return yums nearby your current location
    getYumsNearby: function(/*Object*/ _args) {
      var params={};
      params.location = _args.location;
      //params.location = Yumit.fakeLocation;
      Yumit.model.request({
        method:'GET',
        action:Yumit.api_path+'/api/v0/yums/nearby.json',
        parameters: 'latlon='+params.location,
        error: function(e,xhr) {
		  if (_args.onfinish) { _args.onfinish(); }
          Yumit.ui.alert('Arguments', _args.error);
        },
        success: function(json,xhr) {
          var results = [];
          for (var i=0,l=json.length;i<l;i++) {
            results.push(json[i].yum);
          }
		  if (_args.onfinish) { _args.onfinish(); }
          if (_args.success) { _args.success(results); }
        }
        });
    },
    //create a place row from the given data from yumit
    createYumRow: function(_yum) {
      var row = Ti.UI.createTableViewRow({
        backgroundSelectedColor: Yumit.constants.grayColor,
        height:'auto',
        yum_id: _yum.id,
        yum_text: _yum.text,
        yum_dish_name: _yum.dish_name,
        yum_place_name: _yum.place_name
      }),
      spacing = 6,
      imgDimensions = 45,
      nameHeight = 18,
      metaHeight = 14;
      var icon = new ImageView({
       id:'defaultImageView',
       image: _yum.user_photo_url
      });
      row.add(icon);

      var user_and_place = new Label({
        id:'labelBold',
        text: _yum.user_login + " @ " + _yum.place_name
      });
      row.add(user_and_place);

      var dish_name = new Label({
        id:'labelBold',<commit_msg>fixed default avataar for user issue<commit_after>(function(){
  var place_image = function(_place) {
    return (_place.origin == "yumit") ? '/images/yumit-icon.png' : _place.icon ;
  };
  Yumit.model.Yum = {

    //return places nearby
    // getPlacesNearby: function(/*Object*/ _args) {
    //   var params={ query:'' };
    //   if (_args.query) {
    //     params.query = _args.query;
    //   }
    //   Yumit.model.request({
    //     method:'GET',
    //     action:'http://dev.yumit.com/api/v0/places/nearby', //'?latlon=-33.441355,-70.650566',
    //     //parameters: params,
    //     //parameters: 'latlon=-33.441779525,-70.6503987',
    //     parameters: 'latlon=-33.441779525,-70.6503987&query='+(params.query || ''),
    //     error: function(e,xhr) {
    //       Yumit.ui.alert('Arguments', _args.error);
    //     },
    //     success: function(json,xhr) {
    //       var results = [];
    //       for (var i=0,l=json.length;i<l;i++) {
    //         results.push(json[i]);
    //       }
    //       if (_args.success) { _args.success(results); }
    //     }
    //   });
    // },

    //return yums from your friends
    getYumsFriends: function(/*Object*/ _args) {
      Yumit.model.request({
        method:'GET',
        action:Yumit.api_path+'/api/v0/yums/friends.json',
        token: Titanium.App.Properties.getString("token"),
        parameters: '',
        error: function(e,xhr) {
		  if (_args.onfinish) { _args.onfinish(); }
          Yumit.ui.alert('Arguments', _args.error);
        },
        success: function(json,xhr) {
          var results = [];
          for (var i=0,l=json.length;i<l;i++) {
            results.push(json[i].yum);
          }
		  if (_args.onfinish) { _args.onfinish(); }
          if (_args.success) { _args.success(results); }
        }
      });
    },

    //return yums nearby your current location
    getYumsNearby: function(/*Object*/ _args) {
      var params={};
      params.location = _args.location;
      //params.location = Yumit.fakeLocation;
      Yumit.model.request({
        method:'GET',
        action:Yumit.api_path+'/api/v0/yums/nearby.json',
        parameters: 'latlon='+params.location,
        error: function(e,xhr) {
		  if (_args.onfinish) { _args.onfinish(); }
          Yumit.ui.alert('Arguments', _args.error);
        },
        success: function(json,xhr) {
          var results = [];
          for (var i=0,l=json.length;i<l;i++) {
            results.push(json[i].yum);
          }
		  if (_args.onfinish) { _args.onfinish(); }
          if (_args.success) { _args.success(results); }
        }
        });
    },
    //create a place row from the given data from yumit
    createYumRow: function(_yum) {
      var row = Ti.UI.createTableViewRow({
        backgroundSelectedColor: Yumit.constants.grayColor,
        height:'auto',
        yum_id: _yum.id,
        yum_text: _yum.text,
        yum_dish_name: _yum.dish_name,
        yum_place_name: _yum.place_name
      }),
      spacing = 6,
      imgDimensions = 45,
      nameHeight = 18,
      metaHeight = 14,
      imagePath = _yum.user_photo_url || 'images/user-avatar-thumb.png';
      var icon = new ImageView({
       id:'defaultImageView',
       image: imagePath
      });
      row.add(icon);

      var user_and_place = new Label({
        id:'labelBold',
        text: _yum.user_login + " @ " + _yum.place_name
      });
      row.add(user_and_place);

      var dish_name = new Label({
        id:'labelBold',
{'fraction_non_alphanumeric': 0.16632801161103047, 'fraction_numerical': 0.020029027576197386, 'mean_word_length': 1.9613235926085089, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3488357', 'n_tokens_mistral': 2470, 'n_tokens_neox': 2351, 'n_words': 367}