This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import chain | |
def string_n_string(s, n): | |
for _ in range(n): | |
even = (char for i, char in enumerate(s) if i % 2 == 0) | |
odd = (char for i, char in enumerate(s) if i % 2 != 0) | |
s = ''.join(chain(even , odd)) | |
return s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
from itertools import cycle | |
import pytest | |
REPLACEMENTS = ["CCTTGG", "CTATGG", "CCACGG"] | |
def replace_gen_sub_seq(seq, replacements): | |
seq = list(seq) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = """{u'search_metadata': {u'count': 100, u'completed_in': 0.23599999999999999, u'max_id_str': u'407528290757668864', u'since_id_str': u'0', u'next_r | |
esults': u'?max_id=407528086326870015&q=%23PlateiaLuanSantana&count=100&include_entities=1', u'refresh_url': u'?since_id=407528290757668864&q=%2 | |
3PlateiaLuanSantana&include_entities=1', u'since_id': 0, u'query': u'%23PlateiaLuanSantana', u'max_id': 407528290757668864}, u'statuses': [{u'co | |
ntributors': None, u'truncated': False, u'text': u'#PlateiaLuanSantana NUNCA FUI POR FAVOR ME SORTEIA @CFLuanSantana u', u'in_reply_to_status_id | |
': None, u'id': 407528290757668864, u'favorite_count': 0, u'source': u'<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for i | |
Phone</a>', u'retweeted': False, u'coordinates': None, u'entities': {u'symbols': [], u'user_mentions': [{u'id': 177021046, u'indices': [51, 65], | |
u'id_str': u'177021046', u'screen_name': u'CFLuanSantana', u'name': u'Central de f\xe3s LS.'}], u'hashtags': [{u'indices': [0, 19], u'text': u' | |
Pla |