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
### BEGIN INIT INFO | |
# Provides: Xvfb | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: | |
# X-Start-Before: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Loads X Virtual Frame Buffer | |
### END INIT INFO |
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 find_neighbors(n, v, visited=set()): | |
""" | |
Finds a node's neighbors to n degrees of seperation. | |
Param n: degrees of seperation. n > 1 | |
v: node id | |
Return: a list of neighbors to the nth degree with no duplicates or 'NoneType' | |
""" | |
neighbors = set(v.neighbors) |
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
# http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-returning-nodes-below-a-certain-depth | |
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
from neo4jrestclient import client | |
from neo4jrestclient.request import Request | |
from neo4jrestclient.request import NotFoundError |