midi-transpose ::= "transpose" 1*WSP ["-"] 1*DIGIT
358430
Rule MidiTranspose() {
		return Sequence(String("transpose"),
				OneOrMore(WSP()),
				Optional('-'),
				OneOrMore(DIGIT()))
			.label(MidiTranspose);
	}
1054072
def main(input_filename, songname, format, counter):
    

    # open the file & convert to wav
    song_data = AudioSegment.from_file(input_filename, format=format)
    song_data = song_data.set_channels(1)  # convert to mono
    wav_tmp = song_data.export(format="wav")  # write to a tmp file buffer
    wav_tmp.seek(0)
    rate, wav_data = wavfile.read(wav_tmp)

    # extract peaks and compute constellation hashes & offsets
    peaks = resound.get_peaks(np.array(wav_data))
    fingerprints = list(resound.hashes(peaks))  # hash, offset pairs

    if not fingerprints:
        raise RuntimeError("No fingerprints detected in source file - check your parameters passed to Resound.")

    # Combine duplicate keys
    for fp, abs_offset in fingerprints:
        counter[fp].append((abs_offset, songname))

    print "    Identified {} keypoints in '{}'.".format(len(counter), songname)

    return counter
594952
private static String xSystemToUnicode(String s) {
    String result = "";
    int length = s.length();

    for (int i = 0; i < length; i++){
      char c1 = s.charAt(i);
      char c2 = (i + 1 < length) ? s.charAt(i + 1) : ' ';

      if (c2 == 'x') {

        switch (c1) {
          case 'c': result += 'ĉ'; ++i; break;
          case 'g': result += 'ĝ'; ++i; break;
          case 'h': result += 'ĥ'; ++i; break;
          case 'j': result += 'ĵ'; ++i; break;
          case 's': result += 'ŝ'; ++i; break;
          case 'u': result += 'ŭ'; ++i; break;

          default: result += c1; break;
        }
      } else {
        result += c1;
      }
    }
    return result;
  }
1014211
def _pad_input(incoming):
    
    incoming_expanded = incoming.replace('{', '{{').replace('}', '}}')
    for key in _BASE_CODES:
        before, after = '{{%s}}' % key, '{%s}' % key
        if before in incoming_expanded:
            incoming_expanded = incoming_expanded.replace(before, after)
    return incoming_expanded
966394
def as_cpf(numero):
    
    _num = digitos(numero)
    if is_cpf(_num):
        return '{}.{}.{}-{}'.format(_num[:3], _num[3:6], _num[6:9], _num[9:])
    return numero
416107
function convertShortcut(shortcut) {
          var i, value, replace = {};

          if (Env.mac) {
            replace = {
              alt: '&#x2325;',
              ctrl: '&#x2318;',
              shift: '&#x21E7;',
              meta: '&#x2318;'
            };
          } else {
            replace = {
              meta: 'Ctrl'
            };
          }

          shortcut = shortcut.split('+');

          for (i = 0; i < shortcut.length; i++) {
            value = replace[shortcut[i].toLowerCase()];

            if (value) {
              shortcut[i] = value;
            }
          }

          return shortcut.join('+');
        }
1348736
@Override
    public void transpose() {
        double temp;
        temp = m01; m01 = m10; m10 = temp;
        temp = m02; m02 = m20; m20 = temp;
        temp = m03; m03 = m30; m30 = temp;
        temp = m12; m12 = m21; m21 = temp;
        temp = m13; m13 = m31; m31 = temp;
        temp = m23; m23 = m32; m32 = temp;
    }
293431
function() {
    var octave = this.octave();
    var name = this.name();
    name = octave < 3 ? name.toUpperCase() : name.toLowerCase();
    var padchar = octave < 3 ? ',' : '\'';
    var padcount = octave < 2 ? 2 - octave : octave - 3;

    return pad(name + this.accidental(), padchar, padcount);
  }
649884
def _reverse(components, trans):
    

    action, parameter = _get_action(trans)
    comps = list(components)
    string = utils.join(comps)

    if action == _Action.ADD_CHAR and string[-1].lower() == parameter.lower():
        if comps[2]:
            i = 2
        elif comps[1]:
            i = 1
        else:
            i = 0
        comps[i] = comps[i][:-1]
    elif action == _Action.ADD_ACCENT:
        comps = accent.add_accent(comps, Accent.NONE)
    elif action == _Action.ADD_MARK:
        if parameter == Mark.BAR:
            comps[0] = comps[0][:-1] + \
                mark.add_mark_char(comps[0][-1:], Mark.NONE)
        else:
            if mark.is_valid_mark(comps, trans):
                comps[1] = "".join([mark.add_mark_char(c, Mark.NONE)
                                    for c in comps[1]])
    return comps
286508
def transpose(self, trans, scale="C"):
        
        if not isinstance(trans, int):
            raise TypeError("Expected integers, not {}".format(type(trans)))
        self._root = transpose_note(self._root, trans, scale)
        if self._on:
            self._on = transpose_note(self._on, trans, scale)
        self._reconfigure_chord()
983644
def controller_event(self, channel, contr_nr, contr_val):
        """"""
        return self.midi_event(CONTROLLER, channel, contr_nr, contr_val)
1046904
function rpad(str, len, padstr) {
	var str = ""+str;
	if(str.length >= len) return str;
	return str + Array(len + 1 - str.length).join(padstr);
}
838301
def str2rsi(key):
    
    rlzi, sid, imt = key.split('/')
    return int(rlzi[4:]), int(sid[4:]), imt
1096899
function MIDIParserError(actual, expected, byte) {
    Error.call(this);
    Error.captureStackTrace(this, this.constructor);

    this.name = this.constructor.name;
    this.actual = actual;
    this.expected = expected;

    actual = format(actual);
    expected = format(expected);

    this.message = 'Invalid MIDI file: expected ' +
        expected + ' but found ' + actual;

    if (byte !== undefined) {
        this.byte = byte;
        this.message += ' (at byte ' + byte + ')';
    }
}
336649
def split_digit(str)
      i = str.index(/.分|.割/)
      if i.nil?
        [str]
      elsif i.zero?
        [nil, str]
      else
        [str[0..i - 1], str[i..-1]]
      end
    end
821281
def set_note(self, name='C', octave=4, dynamics={}):
        
        dash_index = name.split('-')
        if len(dash_index) == 1:
            if notes.is_valid_note(name):
                self.name = name
                self.octave = octave
                self.dynamics = dynamics
                return self
            else:
                raise NoteFormatError("The string '%s' is not a valid "
                        "representation of a note in mingus" % name)
        elif len(dash_index) == 2:
            if notes.is_valid_note(dash_index[0]):
                self.name = dash_index[0]
                self.octave = int(dash_index[1])
                self.dynamics = dynamics
                return self
            else:
                raise NoteFormatError("The string '%s' is not a valid "
                        "representation of a note in mingus" % name)
        return False
552664
public static void transpose( DMatrix4x4 m ) {
        double tmp;
        tmp = m.a12; m.a12 = m.a21; m.a21 = tmp;
        tmp = m.a13; m.a13 = m.a31; m.a31 = tmp;
        tmp = m.a14; m.a14 = m.a41; m.a41 = tmp;
        tmp = m.a23; m.a23 = m.a32; m.a32 = tmp;
        tmp = m.a24; m.a24 = m.a42; m.a42 = tmp;
        tmp = m.a34; m.a34 = m.a43; m.a43 = tmp;
    }