This file contains hidden or 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
import time | |
from concurrent.futures import ProcessPoolExecutor | |
from concurrent.futures import ThreadPoolExecutor | |
def process_nodes1(node): | |
time.sleep(10) | |
return f'Primeira... {node["name"]}' | |
This file contains hidden or 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
import string | |
def reverse(sentence): | |
punctuation = set(string.punctuation) | |
words = [] | |
for word in sentence.split(): | |
words.append(word.rstrip(string.punctuation)[::-1]) | |
if word[-1] in punctuation: | |
words[-1] = words[-1]+word[-1] | |
return ' '.join(words) |
This file contains hidden or 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
def rev(value): | |
x = value.split(' ') | |
rev = [] | |
phrase = '' | |
for y in x: | |
#print(y) | |
size = len(y) | |
#print(size) |
This file contains hidden or 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
marcelo@MININT-8OQK3F7:/mnt/c/Users/mabarbo/Documents/repositories/infrastructure_utilities_se-ecommerce-playground$ python3 multitask.py | |
[SERIAL]... | |
Number: 100109100129100151, Prime: True, Time: 16.975686400000995 | |
Number: 102598800232111471, Prime: True, Time: 14.709741100001338 | |
Number: 113127131137139149, Prime: True, Time: 14.730483299999833 | |
Number: 115578717622022981, Prime: True, Time: 15.281539700001304 | |
Number: 198366630044195153, Prime: False, Time: 0.0361391000005824 | |
[SERIAL] Total Time: 61.73540530000173 | |
[THREADING]... |
This file contains hidden or 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
""" | |
Mock HTTP Server to use in tests | |
""" | |
import http.server | |
import threading | |
class HandleHTTPServer(http.server.HTTPServer): | |
""" | |
Main HTTPServer Class |
This file contains hidden or 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
""" | |
Mock HTTP Server to use in tests | |
""" | |
import http.server | |
import threading | |
class HandleHTTPServer(http.server.HTTPServer): | |
""" | |
Main HTTPServer Class |
This file contains hidden or 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
import threading | |
import http.server | |
class StoppableHTTPServer(http.server.HTTPServer): | |
def run(self): | |
try: | |
self.serve_forever() | |
except KeyboardInterrupt: | |
pass |
This file contains hidden or 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
import asyncio | |
from botbuilder.core import TurnContext, ConversationState, UserState, MemoryStorage | |
from botbuilder.schema import ActivityTypes | |
from adapter import ConsoleAdapter | |
adapter = ConsoleAdapter() | |
memory = MemoryStorage() | |
conversation_state = ConversationState(memory) |
This file contains hidden or 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
$ ansible-playbook -i "localhost," playbooks/setup.yml --extra-vars='{"hooks": ["/home/firemanxbr/GitHub/contra-env-setup/a.yml","/home/firemanxbr/GitHub/contra-env-setup/b.yml" | |
]}' -vvv | |
ansible-playbook 2.5.2 | |
config file = /etc/ansible/ansible.cfg | |
configured module search path = [u'/home/firemanxbr/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] | |
ansible python module location = /usr/lib/python2.7/site-packages/ansible | |
executable location = /usr/bin/ansible-playbook | |
python version = 2.7.15 (default, May 2 2018, 14:12:52) [GCC 8.0.1 20180324 (Red Hat 8.0.1-0.20)]Using /etc/ansible/ansible.cfg as config file | |
Parsed localhost, inventory source with host_list plugin |
This file contains hidden or 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
[firemanxbr@firemanxbr pipeline]$ git branch -a | |
master | |
* stage | |
remotes/origin/HEAD -> origin/master | |
remotes/origin/cbeer-CVP-11-results-to-datahub | |
remotes/origin/cbeer-dev-quotas | |
remotes/origin/cvp-63-jp | |
remotes/origin/cvp-63-nm | |
remotes/origin/master | |
remotes/origin/product_name_test |