Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.
You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.
A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.
def no_trespassing(func): def grass(lawn): res = func(lawn) if res is None: return 'No trespassing!' return func(lawn) return grass @no_trespassing def get_of_my_lawn(on_my_lawn): if on_my_lawn is True: return 'get of my lawn'
- def no_trespassing(func):
- def grass(lawn):
- res = func(lawn)
- if res is None:
- return 'No trespassing!'
- return func(lawn)
- return grass
- @no_trespassing
- def get_of_my_lawn(on_my_lawn):
if on_my_lawn is True:return 'get of my lawn'- if on_my_lawn is True:
- return 'get of my lawn'
def random_quote() -> tuple: import requests from bs4 import BeautifulSoup url = 'https://quotes.toscrape.com/random' response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') quote = soup.find('span', attrs={'class':'text'}).text author = soup.find('small', attrs={'class':'author'}).text return response.status_code, quote, author,
import requestsfrom bs4 import BeautifulSoup- def random_quote() -> tuple:
- import requests
- from bs4 import BeautifulSoup
- url = 'https://quotes.toscrape.com/random'
- response = requests.get(url)
- soup = BeautifulSoup(response.text, 'html.parser')
- quote = soup.find('span', attrs={'class':'text'}).text
- author = soup.find('small', attrs={'class':'author'}).text
- return response.status_code, quote, author,