def METHOD_NAME(sgf_string):
    """parse a sgf from a string and return a dict:
    bplayer,wplayer,time,byo,result,handi,komi,size,rule,date,place"""
    # First remove all espaces and new lines from the sgf
    sgf_string = sgf_string.replace(chr(160), '').replace(
        chr(10), '').replace(chr(13), '')
    prop = {
        'DT': 'date',
        'RE': 'result',
        'PB': 'bplayer',
        'PW': 'wplayer',
        'KM': 'komi',
        'HA': 'handicap',
        'SZ': 'board_size',
        'TM': 'time',
        'OT': 'byo',
        'PC': 'place',
        'RU': 'rules',
    }
    # default values:
    out = {
        'date': None,
        'komi': 0,
        'time': 0,
        'handicap': 0,
        'board_size': 19,
    }
    for key in prop:
        p = sgf_string.find(key + '[')  # find the key and get the index
        if p != -1:
            q = sgf_string.find(']', p)  # find the end of the tag
            out[prop[key]] = sgf_string[p + 3:q]
    # Format date, komi and time in proper type
    if out['date'] is not None:
        out['date'] = datetime.datetime.strptime(out['date'], '%Y-%m-%d')
    out['komi'] = float(out['komi'])
    out['time'] = int(out['time'])
    out['board_size'] = int(out['board_size'])
    out['handicap'] = int(out['handicap'])
    # Set handicap to 1 if handicap is 0 and komi is 0.5: https://github.com/climu/openstudyroom/issues/364
    if out['handicap'] == 0 and out['komi'] == 0.5:
        out['handicap'] = 1
    # counting the number of moves. Note that there could be a +-1 diff, but we don't really care
    out['number_moves'] = 2 * sgf_string.count(';B[')
    # We create a unique string based on exact time (ms) 5 first black moves where played.
    # check code is: yyymmddwplayerbplayernsome black moves
    code = ''
    if out['date'] is not None:
        code += datetime.datetime.strftime(out['date'], '%Y%m%d')
    code += out['wplayer'] + out['bplayer']
    for n in range(1, 7):
        p = findnth(sgf_string, 'B[', 8 * n)
        if p != -1:
            q = sgf_string.find(']', p)
            code += sgf_string[p + 2:q]
    out['check_code'] = code
    return out