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
    
  
  
    
  | abstract class Animal { | |
| void breath() { | |
| print('breathing'); | |
| } | |
| } | |
| mixin Swim { | |
| void swim() { | |
| print('swimming'); | |
| } | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 ast | |
| import sys | |
| #test_string = '{"Nikhil" : 1, "Akshat" : 2, "Akash" : 3}' | |
| in_str = "dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 -le -de 13 -le a=1 c=2 dict2=-ds f=3 h=i -de j=k -de" | |
| # dict1=-ds1 a=1 c=2 dict2=-ds2 f=3 h=i -de2 j=k -de2 | |
| # dict1=-ds ar=-ls 10 11 12 dict2=-ds x=1 y=2 seq=-ls 7 8 seq2=-ls 9 -le -le -de 13 -le a=1 c=2 dict3=-ds f=3 h=i -de j=k -de | |
| def parse_dict(str_in): | 
  
    
      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 one_hot(size, index): | |
| """ Creates a matrix of one hot vectors. | |
| ``` | |
| import torch | |
| import torch_extras | |
| setattr(torch, 'one_hot', torch_extras.one_hot) | |
| size = (3, 3) | |
| index = torch.LongTensor([2, 0, 1]).view(-1, 1) | |
| torch.one_hot(size, index) | |
| # [[0, 0, 1], [1, 0, 0], [0, 1, 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
    
  
  
    
  | import tensorflow as tf | |
| tf.GraphKeys.USEFUL = 'useful' | |
| saver = tf.train.import_meta_graph("./model_ex1.meta") | |
| sess = tf.Session() | |
| saver.restore(sess, "./model_ex1") | |
| var_list = tf.get_collection(tf.GraphKeys.USEFUL) | |
| v1 = var_list[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
    
  
  
    
  | import tensorflow as tf | |
| tf.GraphKeys.USEFUL = 'useful' | |
| v1 = tf.placeholder(tf.float32, name="v1") | |
| v2 = tf.placeholder(tf.float32, name="v2") | |
| v3 = tf.mul(v1, v2) | |
| vx = tf.Variable(10.0, name="vx") | |
| v4 = tf.add(v3, vx, name="v4") | 
NewerOlder