<s> from toolz . curried import * <EOL> a , b , c , d , e , f , g = '<STR_LIT>' <EOL> edges = [ ( a , b ) , ( b , a ) , ( a , c ) , ( a , d ) , ( d , a ) , ( d , e ) , ( e , f ) , ( d , f ) , <EOL> ( f , d ) , ( d , g ) , ( e , g ) ] <EOL> out_degrees = countby ( first , edges ) <EOL> in_degrees = countby ( second , edges ) <EOL> out_neighbors = valmap ( comp ( tuple , map ( second ) ) , <EOL> groupby ( first , edges ) ) <EOL> in_neighbors = valmap ( comp ( tuple , map ( first ) ) , <EOL> groupby ( second , edges ) ) </s>
