<commit_before>import requests
import json
import pandas as pd
import numpy as np
from itertools import chain
from shapely.geometry import LineString


def query_route_valhalla(
    key,
    start,
    end,
    costing,
    language="en_US",
    out_format="json",
    direction_params=None,
    costing_params=None):
    """<commit_msg>Add DataFrame examples to helpers<commit_after>import requests
import json
import pandas as pd
import numpy as np
from itertools import chain
from shapely.geometry import LineString


"""
If you wish to retrieve route data directly into a DataFrame

def route_valhalla(df, start):
    return query_route_valhalla(api_key, start, (df['lon'], df['lat']), 'bicycle')

df['valhalla_route'] = df.apply(
    route_valhalla, args=((-0.12203999999842599, 51.500829999995766),), axis=1)

If the function returns multiple columns, do:
df['col1'], df['col2'] = zip(*
    df.apply(...))

"""

def query_route_valhalla(
    key,
    start,
    end,
    costing,
    language="en_US",
    out_format="json",
    direction_params=None,
    costing_params=None):
    """
{'fraction_non_alphanumeric': 0.10999083409715857, 'fraction_numerical': 0.034830430797433545, 'mean_word_length': 4.22488038277512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3332225', 'n_tokens_mistral': 386, 'n_tokens_neox': 361, 'n_words': 101}