Skip to content

Instantly share code, notes, and snippets.

View Tusenka's full-sized avatar

Irina Tusenka

View GitHub Profile
https://www.hackerrank.com/profile/Tusenka
@Tusenka
Tusenka / 2d_matrix_transformation.py
Created October 21, 2024 07:40
Python 2d matrix transformation
#!/bin/python3
import math
import os
import random
import re
import sys
import copy
import pprint
What is wrong with the code. Why it writes 5<4?
```
#!/bin/python3
import math
import os
import random
import re
import sys
@Tusenka
Tusenka / grid_search.py
Last active November 16, 2024 17:26
My version of grid search
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'gridSearch' function below.
def _iter_swap(m,i,j):
for [x, y] in [(i,j), (len(m)-i-1, j), (i, len(m)-j-1), (len(m)-i-1, len(m)-j-1)]:
yield m[x][y]
def _get_max(m, i, j):
return max(_iter_swap(m, i, j))
def _iter_corner(m):
@Tusenka
Tusenka / gist:6f77566a42bf76c041c41544da1c01f6
Created April 30, 2025 03:23
Fixture indirrect params
https://gist.github.com/zobayer1/31f07011f1eaca7e0e5714bf647c2886
Using pytest.mark.parametrize with other fixtures
Introduction
When you want to run tests against multiple test parameters, but you have to use other pytest.fixture objects, you can use pytest.mark.parametrize with indirect parameter to target a fixture for extracting request.param from parametrize list.
Example
# -*- coding: utf-8 -*-
import os
https://docs.google.com/document/d/12LW5t_teZ4U__7VUuwrkIhwF-62pCHPW_nCZLQkCGXA/edit?tab=t.0