code: def get_uri(source):
      """
      Check a media source as a valid file or uri and return the proper uri
      """
  
      import gi
  
      gi.require_version("Gst", "1.0")
      from gi.repository import Gst
  
      src_info = source_info(source)
  
      if src_info["is_file"]:  # Is this a file?
          return get_uri(src_info["uri"])
  
      elif Gst.Uri.is_valid(
          source
      ):  # Is this a valid URI source for Gstreamer
          uri_protocol = Gst.uri_get_protocol(source)
          if Gst.Uri.protocol_is_supported(
              Gst.URIType.SRC, uri_protocol
          ):
              return source
          else:
              raise IOError("Invalid URI source for Gstreamer")
      else:
          raise IOError(
              "Failed getting uri for path %s: no such file" % source
          )
  
file_path: TimeSide/timeside/plugins/decoder/utils.py
imports: from __future__ import division
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_uri(source) and returns: get_uri, source