code: def valid_timeseries(df: pd.DataFrame) -> pd.DataFrame:
      """Checks if the DataFrame meets the necessary criteria to be profiled: be a Pandas DataFrame,
      have values (must be numeric), have a DateTimeIndex, have a recognizable frequency/period.
  
      Args:
          df: Pandas DataFrame.
  
      Returns:
          pandas.DataFrame: A copy of the input containing only numeric series and a sorted index.
      """
      # check if valid time series
      if not isinstance(df, pd.DataFrame):
          raise ValueError("Expecting 'df' to be a pandas.DataFrame")
      if not all([isinstance(c, str) for c in df.columns]):
          raise ValueError("All column names must be 'str'")
      df = df.select_dtypes("number").sort_index().copy()
      if df.shape[1] == 0 or len(df) == 0:
          raise ValueError("DataFrame cannot be empty")
      if not isinstance(df.index, pd.DatetimeIndex):
          raise ValueError(
              "Expecting DataFrame index to be a pandas.DateTimeIndex"
          )
      if not df.index.inferred_freq:
          raise ValueError("Could not infer the DataFrame's frequency")
      return df
  
imports: from typing import Any, Optional, Union, Dict, List, Callable, Tuple, KeysView, ValuesView, ItemsView
  from dataclasses import dataclass, make_dataclass, field, asdict, is_dataclass
  from functools import update_wrapper
  from inspect import signature, Signature
  from datetime import datetime
  import warnings
  from typing_inspect import is_union_type, get_args
  import pandas
  from tslumen.scheduling import Scheduler
  from tslumen.misc import repr_html
label_desc: Use image node_id 1 for calling a global function with example usage: valid_timeseries(df) and returns: df