def inner(data: List[str]) -> ReturnType[List[str]]: fields_ = [y - 1 for y in fields] # 'cut' fields are indexed from 1 result = [] for item in data: item = item.split(sep) result.append(sep.join([item[x] for x in fields_])) return ReturnEntry(result=result)
def inner() -> ReturnType[List[List[dict]]]: twitter = OAuth1Session(client_key, client_secret=client_secret, resource_owner_key=resource_owner_key, resource_owner_secret=resource_owner_secret) url = 'https://api.twitter.com/1.1/search/tweets.json' result = twitter.get(url, params={ 'q': query, 'result_type': result_type, 'count': count }) return ReturnEntry(result=json.loads(result.text)['statuses'])
def inner() -> ReturnType[str]: with urllib.request.urlopen(url) as response: data = response.read().decode(encoding) return ReturnEntry(result=data)
def inner(data1: List[int], data2: List[int]) -> ReturnType[List[int]]: return ReturnEntry(result=data1 + data2)
def inner(data: List[int]) -> ReturnType[List[int]]: if reverse: res = [data[x] for x in range(len(data) - 1, -1, -1)] else: res = data return ReturnEntry(result=res)
def inner() -> ReturnType[List[str]]: return ReturnEntry(result=['a', 'b', 'c'])
def inner() -> ReturnType[List[int]]: return ReturnEntry(result=[1, 2, 3])
def inner(data: List[Any]) -> ReturnType[Any]: return ReturnEntry(result=sep.join(data))
def inner(data: str) -> ReturnType[List[str]]: return ReturnEntry(result=data.split(sep))
def inner(data: List[Any]) -> ReturnType[List[Any]]: result = sorted(data, key=key, reverse=reverse) return ReturnEntry(result=result)
def inner(data: List[Any]) -> ReturnType[List[Tuple[Any, int]]]: grouped = itertools.groupby(sorted(data)) result = map(lambda x: (x[0], len(list(x[1]))), grouped) return ReturnEntry(result=list(result))
def inner(data: List[List[Any]]) -> ReturnType[List[Any]]: result = [] for item in data: result.extend(item) return ReturnEntry(result=result)
def inner(data: List[Any]) -> ReturnType[List[Any]]: return ReturnEntry(result=list(map(func, data)))
def inner(data: List[Any]) -> ReturnType[List[Any]]: data = data[-n:] return ReturnEntry(result=data)
def inner(data: List[str]) -> ReturnType[List[str]]: data = list(filter(lambda x: pattern in x, data)) return ReturnEntry(result=data)
def inner() -> ReturnType[List[str]]: data = None with open(filename) as f: data = f.readlines() return ReturnEntry(result=data)