Returns the tones available on unbabel
435424
def get_tones(self):
        '''
            
        '''
        result = self.api_call('tone/')
        tones_json = json.loads(result.content)
        tones = [Tone(name=tone_json["tone"]["name"],
                      description=tone_json["tone"]["description"])
                 for tone_json in tones_json["objects"]]
        return tones
981052
def available_string(self, episode):
        """"""
        available = [ep for ep in self if ep > episode]
        string = ','.join(str(ep) for ep in available[:self.EPISODES_TO_SHOW])
        if len(available) > self.EPISODES_TO_SHOW:
            string += '...'
        return string
923812
def get_supported_unary_ops():
    '''
    
    '''
    unary_ops = {}
    unary_ops[np.exp.__name__] = 'exp'
    unary_ops[np.log.__name__] = 'log'
    unary_ops[np.sqrt.__name__] = 'sqrt'
    return unary_ops
1374756
def _parse_ipa_syllable(unparsed_syllable):
    """"""
    ipa_tone = re.search('[%(marks)s]+' % {'marks': _IPA_MARKS},
                         unparsed_syllable)
    if not ipa_tone:
        syllable, tone = unparsed_syllable, '5'
    else:
        for tone_number, tone_mark in _IPA_TONES.items():
            if ipa_tone.group() == tone_mark:
                tone = tone_number
                break
        syllable = unparsed_syllable[0:ipa_tone.start()]
    return syllable, tone
925223
def args_str(self):
        
        matched = [str(m) for m in self._used_matchers]
        unmatched = [str(m) for m in self._unused_matchers]
        return 'matched=[{}], unmatched=[{}]'.format(
            ', '.join(matched), ', '.join(unmatched))
852220
def match_sound_mode(self, sound_mode_raw):
        """"""
        try:
            sound_mode = self._sm_match_dict[sound_mode_raw.upper()]
            return sound_mode
        except KeyError:
            smr_up = sound_mode_raw.upper()
            self._sound_mode_dict[smr_up] = [smr_up]
            self._sm_match_dict = self.construct_sm_match_dict()
            _LOGGER.warning("Not able to match sound mode: '%s', "
                            "returning raw sound mode.", sound_mode_raw)
        return sound_mode_raw
1052223
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'tones') and self.tones is not None:
            _dict['tones'] = [x._to_dict() for x in self.tones]
        if hasattr(self,
                   'tone_categories') and self.tone_categories is not None:
            _dict['tone_categories'] = [
                x._to_dict() for x in self.tone_categories
            ]
        if hasattr(self, 'warning') and self.warning is not None:
            _dict['warning'] = self.warning
        return _dict
573683
function uniq (gamut) {
  var semitones = heights(gamut)
  return gamut.reduce(function (uniq, current, currentIndex) {
    if (current) {
      var index = semitones.indexOf(semitones[currentIndex])
      if (index === currentIndex) uniq.push(current)
    }
    return uniq
  }, [])
}
876843
function toNested(map) {

  var split, first, last;
  utils.walkObject(map, function (val, prop1) {

    split = prop1.split('.');

    if (!utils.validateFieldName(prop1)) {
      log.error('map field name "' + prop1 + '" is invalid');
    }

    last = split[split.length - 1];
    first = prop1.replace('.' + last, '');

    utils.walkObject(map, function (val2, prop2) {
      if (prop1 !== prop2 && first === prop2) {
        log.error('map field name "' + prop2 + '" is invalid');
      }
    });
  });

  var form = {};
  var names = [];

  utils.walkObject(map, function (val, prop) {
    names.push({ keys: prop.split('.'), value: val });
  });

  var obj;
  names.forEach(function (name) {
    obj = form;
    name.keys.forEach(function (key, index) {
      if (index === name.keys.length - 1) {
        obj[key] = name.value;
      } else {
        if (!obj[key]) {
          obj[key] = {};
        }
        obj = obj[key];
      }
    });
  });

  return form;
}
364073
function getUpperBoundMatcher(compare, query) {
		// No lower bound
		if (!query.hasOwnProperty('$lt') && !query.hasOwnProperty('$lte')) {
			return function () { return true; };
		}
		if (query.hasOwnProperty('$lt') && query.hasOwnProperty('$lte')) {
			if (compare(query.$lte, query.$lt) === 0) {
				return function (key) { return compare(key, query.$lt) < 0; };
			}
			if (compare(query.$lte, query.$lt) < 0) {
				return function (key) { return compare(key, query.$lte) <= 0; };
			} else {
				return function (key) { return compare(key, query.$lt) < 0; };
			}
		}
		if (query.hasOwnProperty('$lt')) {
			return function (key) { return compare(key, query.$lt) < 0; };
		} else {
			return function (key) { return compare(key, query.$lte) <= 0; };
		}
	}
456665
def get_speaker_muted(self):
        """"""
        if not self.camera_extended_properties:
            return None

        speaker = self.camera_extended_properties.get('speaker')
        if not speaker:
            return None

        return speaker.get('mute')
1265687
def getItalianAccentedVocal(vocal, acc_type="g"):
    
    vocals = {'a': {'g': u'\xe0', 'a': u'\xe1'},
              'e': {'g': u'\xe8', 'a': u'\xe9'},
              'i': {'g': u'\xec', 'a': u'\xed'},
              'o': {'g': u'\xf2', 'a': u'\xf3'},
              'u': {'g': u'\xf9', 'a': u'\xfa'}}
    return vocals[vocal][acc_type]
302910
def tone(self):
        
        if self.pwm_device.pin.frequency is None:
            return None
        else:
            return Tone.from_frequency(self.pwm_device.pin.frequency)
555967
def get_notes(key='C'):
    
    if _key_cache.has_key(key):
        return _key_cache[key]
    if not is_valid_key(key):
        raise NoteFormatError("unrecognized format for key '%s'" % key)
    result = []

    # Calculate notes
    altered_notes = map(operator.itemgetter(0),
            get_key_signature_accidentals(key))

    if get_key_signature(key) < 0:
        symbol = 'b'
    elif get_key_signature(key) > 0:
        symbol = '#'

    raw_tonic_index = base_scale.index(key.upper()[0])

    for note in islice(cycle(base_scale), raw_tonic_index, raw_tonic_index+7):
        if note in altered_notes:
            result.append('%s%s' % (note, symbol))
        else:
            result.append(note)
    
    # Save result to cache
    _key_cache[key] = result
    return result
399613
function getUnsynced(fs, path, callback) {
  getAttr(fs, path, constants.attributes.unsynced, callback);
}
911587
public List<String> getUnmatchedArguments() {
        return interpreter.parseResultBuilder == null ? Collections.<String>emptyList() : UnmatchedArgumentException.stripErrorMessage(interpreter.parseResultBuilder.unmatched);
    }
1100093
function getLevelsToAudit(options) {
    const auditOptions = getNpmAuditOptions(options);
    const auditLevelOption =
        auditOptions && auditOptions['--audit-level']
            ? auditOptions['--audit-level']
            : auditLevel.low;

    const filteredLevels = [];
    // prettier-ignore
    switch (auditLevelOption) {
    case auditLevel.critical:
        filteredLevels.push(auditLevel.critical);
        break;
    case auditLevel.high:
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
        break;
    case auditLevel.moderate:
        filteredLevels.push(auditLevel.moderate);
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
        break;
    default:
        filteredLevels.push(auditLevel.low);
        filteredLevels.push(auditLevel.moderate);
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
    }

    return filteredLevels;
}