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 numpy as np | |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| from sklearn.neighbors import NearestNeighbors | |
| random_seed = 123 | |
| random = np.random.RandomState(random_seed) | |
| """ | |
| * Randomly place agents in a two dimensional world. Place the agents at uniformly random x locations in the range $[-M,M]$ and similary for random y locations. | 
  
    
      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 numpy as np | |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| from sklearn.neighbors import NearestNeighbors | |
| random_seed = 123 | |
| random = np.random.RandomState(random_seed) | |
| """ | |
| * Randomly place agents in a two dimensional world. Place the agents at uniformly random x locations in the range $[-M,M]$ and similary for random y locations. | 
  
    
      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 numpy as np | |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| random_seed = 1234 | |
| random = np.random.RandomState(random_seed) | |
| def create_two_graph(): | |
| # Lapacian and degree matrix are size of num_agent x num_agent | 
  
    
      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
    
  
  
    
  | """@Author:Aadesh Neupane | |
| about.me/neupaneaadesh | |
| aadeshnpnp.com.np | |
| """ | |
| import sys | |
| def merge_sort(a): | |
| length_a = len(a) | |
| if length_a <= 1: return a | |
| m = length_a//2 | |
| a_left = a[0:m] | 
  
    
      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 python | |
| """@Author:Aadesh Neupane | |
| about.me/neupaneaadesh | |
| aadeshnpnp.com.np | |
| """ | |
| import sys | |
| """Program to sort numbers Using Bubble Sort""" | |
| def bubbleSort(seq): | |
| n=len(seq) | |
| #i=0;j=0 | 
  
    
      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 python | |
| """This program demonstrated the Factory Method Pattern | |
| @author :Aadesh Neupane | |
| """ | |
| class Pizza(object): | |
| """This is the abstract class for Pizza""" | |
| def getPrice(self): | |
| raise NotImplementedError("Should Have implemented Thisn") | |
| class HamPizza(Pizza): | 
  
    
      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 python | |
| """@author : Aadesh Neupane | |
| @Description : demonstrates Abstract Factory Method """ | |
| ROBUST = 0 | |
| class Shape(): #This class is the main factory class | |
| total=0 | |
| def __init__(self): #Constructor | |
| self.total=self.total+1 | |
| def draw(self): #Abstract Function | |
| raise NotImplementedError('Should Have implemented This') |