Skip to content

Instantly share code, notes, and snippets.

View leangaurav's full-sized avatar

leangaurav leangaurav

View GitHub Profile
@leangaurav
leangaurav / atom_remote_ftp_config.json
Last active June 13, 2022 23:47
Atom editor remote development config for remote-ftp plugin
{
"protocol": "sftp",
"host": "",
"port": 22,
"user": "",
"pass": "",
"promptForPass": false,
"remote": "/",
"privatekey": "",
"local": "",
@leangaurav
leangaurav / Code Coverage Gist
Last active June 11, 2021 03:53
Code Coverage Gist
Code Coverage

Test Code

from wings import *
w = Wings()
c = ChickenWings()
c.__class__, w.__class__ = w.__class__, c.__class__

w.fly()
c.fly()

Test Code

from wings import *
w = Wings()
c = ChickenWings()
c.__class__, w.__class__ = w.__class__, c.__class__

print(w.__dict__)
print(c.__dict__)
print(c.price)

TestCode

w = Wings()
c = ChickenWings()
c.__class__, w.__class__ = w.__class__, c.__class__
print(w.__class__, type(w))
print(c.__class__, type(c))

Output

TestCode

w = Wings()
c = ChickenWings()
print(w.__class__, type(w))
print(c.__class__, type(c))

Output

wings.py

class Wings:
  def __str__(self):
    return "Wings"
    
  def fly(self):
    print("Flying /\\o/\\ ")

class ChickenWings:

matrix.py

def is_skew_ymmetric(mat):
    # Write Code
    pass

Test Code

import matrix

matrix.py

def is_symmetric(mat):
    if len(mat) != 0 and (len(mat) != len(mat[0])):# check if square matrix
        return False
    
    for i in range(len(mat)):
        for j in range( len(mat[0]) ):
            if mat[i][j] != mat[j][i]:
 return False

matrix.py

def neg(mat, inplace = False):
    if inplace:
        for i in range(len(mat)):
            for j in range(len(mat[0])):
                mat[i][j] = -mat[i][j]
        return None
    else:
 res = []