code: def get_uri(source):
      
  
      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.URI_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)
docs: Check a media source as a valid file or uri and return the proper uri