<commit_before>var CC2540SensorTag = require('./cc2540');
var CC2650SensorTag = require('./cc2650');

var SensorTag = function() {
};

SensorTag.discoverAll = function(onDiscover) {
  CC2540SensorTag.discoverAll(onDiscover);
  CC2650SensorTag.discoverAll(onDiscover);
};

SensorTag.stopDiscoverAll = function(onDiscover) {
  CC2540SensorTag.stopDiscoverAll(onDiscover);
  CC2650SensorTag.stopDiscoverAll(onDiscover);
};

SensorTag.discover = function(callback) {
  var onDiscover = function(sensorTag) {
    SensorTag.stopDiscoverAll(onDiscover);

    callback(sensorTag);
  };

  SensorTag.discoverAll(onDiscover);
};

SensorTag.discoverByUuid = function(uuid, callback) {
  var onDiscoverByUuid = function(sensorTag) {
    if (sensorTag.uuid === uuid) {
      SensorTag.stopDiscoverAll(onDiscoverByUuid);

      callback(sensorTag);
    }
  };

  SensorTag.discoverAll(onDiscoverByUuid);
};

SensorTag.CC2540 = CC2540SensorTag;
SensorTag.CC2650 = CC2650SensorTag;

module.exports = SensorTag;
<commit_msg>- new discover by address API<commit_after>var CC2540SensorTag = require('./cc2540');
var CC2650SensorTag = require('./cc2650');

var SensorTag = function() {
};

SensorTag.discoverAll = function(onDiscover) {
  CC2540SensorTag.discoverAll(onDiscover);
  CC2650SensorTag.discoverAll(onDiscover);
};

SensorTag.stopDiscoverAll = function(onDiscover) {
  CC2540SensorTag.stopDiscoverAll(onDiscover);
  CC2650SensorTag.stopDiscoverAll(onDiscover);
};

SensorTag.discover = function(callback) {
  var onDiscover = function(sensorTag) {
    SensorTag.stopDiscoverAll(onDiscover);

    callback(sensorTag);
  };

  SensorTag.discoverAll(onDiscover);
};

SensorTag.discoverByAddress = function(address, callback) {
  address = address.toLowerCase();

  var onDiscoverByAddress = function(sensorTag) {
    if (sensorTag._peripheral.address === address) {
      SensorTag.stopDiscoverAll(onDiscoverByAddress);

      callback(sensorTag);
    }
  };

  SensorTag.discoverAll(onDiscoverByAddress);
};

SensorTag.discoverByUuid = function(uuid, callback) {
  var onDiscoverByUuid = function(sensorTag) {
    if (sensorTag.uuid === uuid) {
      SensorTag.stopDiscoverAll(onDiscoverByUuid);

      callback(sensorTag);
    }
  };

  SensorTag.discoverAll(onDiscoverByUuid);
};

SensorTag.CC2540 = CC2540SensorTag;
SensorTag.CC2650 = CC2650SensorTag;

module.exports = SensorTag;

{'fraction_non_alphanumeric': 0.11883691529709228, 'fraction_numerical': 0.040455120101137804, 'mean_word_length': 5.398921832884097, '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': '1727061', 'n_tokens_mistral': 875, 'n_tokens_neox': 846, 'n_words': 105}