<commit_before>class Bird {
    fun eat(food: String, action: (String) -> Unit): String {
        action(food)
        println("szw eat $food")
        return ""
    }
}

fun Bird.sing() = println("sing")
fun Bird.sleep() : String = println("test")

//fun Bird.lunch(food: String, action: (String) -> Unit): String = this.eat(food) {
//    return@eat "done"
//}


fun main(args: Array<String>) {
    Bird().sing()
}<commit_msg>kotlin high-order funciton<commit_after>class Bird {
    fun eat(food: String, action: (String) -> Unit): String {
        action(food)
        println("szw eat $food")
        return ""
    }

    fun sleep(): String = "test"

    fun zzz() = sleep()

    fun zzzzz() = this::sleep

    fun z(action: () -> String) {
        action()
    }


}

fun Bird.sing() = println("sing")

fun Bird.lunch(food: String, action: (String) -> Unit): String = this.eat(food) {
    action(food)
}


fun main(args: Array<String>) {
    val bird = Bird()
    bird.sing()
    bird.zzz()
    bird.zzzzz()
    bird.z(bird::sleep)
}
{'fraction_non_alphanumeric': 0.1791907514450867, 'fraction_numerical': 0.0, 'mean_word_length': 2.658450704225352, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '4917202', 'n_tokens_mistral': 372, 'n_tokens_neox': 358, 'n_words': 87}