(frame_name, is_frame_like, example=None)
return type(example)
Handles type check for input example for DataFrame/Series/Index initialization.
       Returns the base type of streaming objects if type checks pass.
Handles type check for input example for DataFrame/Series/Index initialization.
       Returns the base type of streaming objects if type checks pass.
Handles type check for input example for DataFrame / Series / Index initialization . Returns the base type of streaming objects if type checks pass .
def get_base_frame_type(frame_name, is_frame_like, example=None):
    """Handles type check for input example for DataFrame/Series/Index initialization.
       Returns the base type of streaming objects if type checks pass."""
    if example is None:
        raise TypeError("Missing required argument:'example'")
    if is_frame_like is is_dataframe_like and not is_frame_like(example):
        import pandas as pd
        example = pd.DataFrame(example)

    elif not is_frame_like(example):
        msg = "Streaming {0} expects an example of {0} like objects. Got: {1}."\
                                             .format(frame_name, example)
        raise TypeError(msg)
    return type(example)
def get_base_frame_type ( frame_name , is_frame_like , example = None ) : if example is None : raise TypeError ( "Missing required argument:'example'" ) if is_frame_like is is_dataframe_like and not is_frame_like ( example ) : import pandas as pd example = pd . DataFrame ( example ) elif not is_frame_like ( example ) : msg = "Streaming {0} expects an example of {0} like objects. Got: {1}." . format ( frame_name , example ) raise TypeError ( msg ) return type ( example )