code: def time_derivative(expr, frame, order=1):
      """
      Calculate the time derivative of a vector/scalar field function
      or dyadic expression in given frame.
  
      References
      ==========
  
      https://en.wikipedia.org/wiki/Rotating_reference_frame#Time_derivatives_in_the_two_frames
  
      Parameters
      ==========
  
      expr : Vector/Dyadic/sympifyable
          The expression whose time derivative is to be calculated
  
      frame : ReferenceFrame
          The reference frame to calculate the time derivative in
  
      order : integer
          The order of the derivative to be calculated
  
      Examples
      ========
  
      >>> from sympy.physics.vector import ReferenceFrame, dynamicsymbols
      >>> from sympy.physics.vector import init_vprinting
      >>> init_vprinting(pretty_print=False)
      >>> from sympy import Symbol
      >>> q1 = Symbol('q1')
      >>> u1 = dynamicsymbols('u1')
      >>> N = ReferenceFrame('N')
      >>> A = N.orientnew('A', 'Axis', [q1, N.x])
      >>> v = u1 * N.x
      >>> A.set_ang_vel(N, 10*A.x)
      >>> from sympy.physics.vector import time_derivative
      >>> time_derivative(v, N)
      u1'*N.x
      >>> time_derivative(u1*A[0], N)
      N_x*u1'
      >>> B = N.orientnew('B', 'Axis', [u1, N.z])
      >>> from sympy.physics.vector import outer
      >>> d = outer(N.x, N.x)
      >>> time_derivative(d, B)
      - u1'*(N.y|N.x) - u1'*(N.x|N.y)
  
      """
  
      t = dynamicsymbols._t
      _check_frame(frame)
  
      if order == 0:
          return expr
      if order % 1 != 0 or order < 0:
          raise ValueError("Unsupported value of order entered")
  
      if isinstance(expr, Vector):
          outlist = []
          for i, v in enumerate(expr.args):
              if v[1] == frame:
                  outlist += [
                      (
                          express(v[0], frame, variables=True).diff(t),
                          frame,
                      )
                  ]
              else:
                  outlist += (
                      time_derivative(Vector([v]), v[1])
                      + (v[1].ang_vel_in(frame) ^ Vector([v]))
                  ).args
          outvec = Vector(outlist)
          return time_derivative(outvec, frame, order - 1)
  
      if isinstance(expr, Dyadic):
          ol = Dyadic(0)
          for i, v in enumerate(expr.args):
              ol += v[0].diff(t) * (v[1] | v[2])
              ol += v[0] * (time_derivative(v[1], frame) | v[2])
              ol += v[0] * (v[1] | time_derivative(v[2], frame))
          return time_derivative(ol, frame, order - 1)
  
      else:
          return diff(express(expr, frame, variables=True), t, order)
  
file_path: sympy/sympy/physics/vector/functions.py
imports: from functools import reduce
  from sympy import sympify, diff, sin, cos, Matrix, symbols, Function, S, Symbol
  from sympy.integrals.integrals import integrate
  from sympy.simplify.trigsimp import trigsimp
  from .vector import Vector, _check_vector
  from .frame import CoordinateSym, _check_frame
  from .dyadic import Dyadic
  from .printing import vprint, vsprint, vpprint, vlatex, init_vprinting
  from sympy.utilities.iterables import iterable
  from sympy.utilities.misc import translate
label_desc: Use image node_id 4 for calling a global function with example usage: time_derivative(expr, frame, order) and returns: expr, time_derivative, time_derivative, diff