<commit_before>package anabalica.github.io.meowletters.customviews;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TableLayout;

/**
 * Custom square TableLayout, i.e. the height is set equal to the width
 * of the layout.
 *
 * @author <NAME>
 */
public class SquareTableLayout extends TableLayout {

    public SquareTableLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        final int width = getMeasuredWidth();
        setMeasuredDimension(width, width);
    }
}
<commit_msg>extract rowsCount custom attr inside SquareTableLayout constructor<commit_after>package anabalica.github.io.meowletters.customviews;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.TableLayout;

import anabalica.github.io.meowletters.R;

/**
 * Custom square TableLayout, i.e. the height is set equal to the width
 * of the layout.
 *
 * @author <NAME>
 */
public class SquareTableLayout extends TableLayout {
    private int rowsCount;

    public SquareTableLayout(Context context, AttributeSet attrs) {
        super(context, attrs);

        TypedArray attributes = context.getTheme().obtainStyledAttributes(
                attrs, R.styleable.SquareTableLayout, 0, 0);

        try {
            rowsCount = attributes.getInteger(R.styleable.SquareTableLayout_rowsCount, 0);
        } finally {
            attributes.recycle();
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        final int width = getMeasuredWidth();
        setMeasuredDimension(width, width);
    }

    public int getRowsCount() {
        return rowsCount;
    }
}

{'fraction_non_alphanumeric': 0.08682328907048008, 'fraction_numerical': 0.0015321756894790602, 'mean_word_length': 3.503448275862069, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2374583', 'n_tokens_mistral': 547, 'n_tokens_neox': 534, 'n_words': 135}