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
| #!/usr/bin/env python2 | |
| """ | |
| Replace line breaks, from one format to another | |
| @Author : Debapriya Das | |
| @Python : 2.7 | |
| """ | |
| from __future__ import print_function |
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
| #syntax | |
| git checkout -b name_of_local_branch | |
| #example | |
| git checkout -b experimental |
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
| from hashlib import md5 | |
| from base64 import b64decode | |
| from base64 import b64encode | |
| from Crypto import Random | |
| from Crypto.Cipher import AES | |
| # Padding for the input string --not | |
| # related to encryption itself. | |
| BLOCK_SIZE = 16 # Bytes |
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
| Question1Max. Marks 100.00 | |
| The Ultimate FIFA Dream Team Selection Challenge | |
| [Problem Statement] | |
| For the new season of English Premier League, the football club owners are re-strategizing their teams to ensure that they win this season. They need crunch data to build their dream team and guarantee a win. You are required to help the coaches who are not very tech savvy make a quick and effective decision by retrieving the data that they require. | |
| In order to help them, you are required to implement a backend system for FIFA. This system must implement the following: | |
| Microservices architecture that extracts the provided data |
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 requests | |
| def get_city(ipaddr): | |
| url = "https://www.ipinfo.io/" + str(ipaddr) | |
| response = requests.get(url=url).json() | |
| return response['city'] | |
| lines = open('log.txt').readlines() | |
| cities = {} |
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
| 968c1d4e3784a9c5e7180cf7959edb708d8222192c633d0c707b117fa8fd962e77b4003f87b8459d9583cd4dd8deaf357cbb13b583e913a2eb8eca3a486399e0 |
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
| Have a python3 setup ready! | |
| Install docx from pip | |
| ~/Desktop/awesome-performance-test-framework master ✗ 6h8m ✖ ⚑ ◒ | |
| ▶ pip install --pre python-docx | |
| Collecting python-docx | |
| Downloading https://files.pythonhosted.org/packages/e4/83/c66a1934ed5ed8ab1dbb9931f1779079f8bca0f6bbc5793c06c4b5e7d671/python-docx-0.8.10.tar.gz (5.5MB) | |
| |████████████████████████████████| 5.5MB 9.2MB/s | |
| Requirement already satisfied: lxml>=2.3.2 in ./venv/lib/python3.7/site-packages (from python-docx) (4.4.2) |
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 timeit(method): | |
| def timed(*args, **kw): | |
| ts = time.time() | |
| result = method(*args, **kw) | |
| te = time.time() | |
| if 'log_time' in kw: | |
| name = kw.get('log_name', method.__name__.upper()) | |
| kw['log_time'][name] = int((te - ts) * 1000) | |
| else: | |
| print '%r %2.2f ms' % \ |