def get_upstream_stops_ratio(self, target, trough_stops, ratio):
if isinstance(trough_stops, list):<EOL><INDENT>trough_stops = "<STR_LIT:U+002C>".join(trough_stops)<EOL><DEDENT>query = """<STR_LIT>""".format(target=target, trough_stops=trough_stops, ratio=ratio)<EOL>df = read_sql_query(query, self.conn)<EOL>return df<EOL>
Selects the stops for which the ratio or higher proportion of trips to the target passes trough a set of trough stops
:param target: target of trips
:param trough_stops: stops where the selected trips are passing trough
:param ratio: threshold for inclusion
:return: