code: def get_vector_length(v: TensorLike) -> int:
      """Return the run-time length of a symbolic vector, when possible.
  
      Parameters
      ----------
      v
          A rank-1 `TensorType` variable.
  
      Raises
      ------
      TypeError
          `v` hasn't the proper type.
      ValueError
          No special case applies, the length is not known.
          In general this is not possible, but for a number of special cases
          the length can be determined at compile / graph-construction time.
          This function implements these special cases.
  
      """
      v = as_tensor_variable(v)
  
      if v.type.ndim != 1:
          raise TypeError(f"Argument must be a vector; got {v.type}")
  
      static_shape: Optional[int] = v.type.shape[0]
      if static_shape is not None:
          return static_shape
  
      return _get_vector_length(getattr(v.owner, "op", v), v)
  
imports: from collections.abc import Sequence
  from functools import singledispatch
  from typing import TYPE_CHECKING, Any, Callable, NoReturn, Optional, Union
  from pytensor.graph.basic import Constant, Variable
  from pytensor.graph.op import Op
  import pytensor.tensor.exceptions
  from pytensor.gradient import grad, hessian, jacobian
  from pytensor.tensor import sharedvar
  from pytensor.tensor import blas, blas_c, blas_scipy, xlogx
  import pytensor.tensor.rewriting
  from pytensor.tensor import linalg
  from pytensor.tensor import special
  from pytensor.tensor import nlinalg
  from pytensor.tensor import slinalg
  from pytensor.tensor.basic import *
  from pytensor.tensor.blas import batched_dot, batched_tensordot
  from pytensor.tensor.extra_ops import *
  from pytensor.tensor.shape import reshape, shape, shape_padaxis, shape_padleft, shape_padright, specify_broadcastable, specify_shape
  from pytensor.tensor.io import *
  from pytensor.tensor.math import *
  from pytensor.tensor.sort import argsort, argtopk, sort, topk, topk_and_argtopk
  from pytensor.tensor.subtensor import *
  from pytensor.tensor.type import *
  from pytensor.tensor.type_other import *
  from pytensor.tensor.variable import TensorConstant, TensorVariable
  from pytensor.tensor.functional import vectorize
  from numpy import e, euler_gamma, inf, infty, nan, newaxis, pi
label_desc: Use image node_id 3 for calling a global function with example usage: get_vector_length(v) and returns: _get_vector_length, static_shape