original_docstring: Calls a stored procedure with the given arguments
  
          The arguments will be set during this session, meaning
          they will be called like  _<procname>__arg<nr> where
          <nr> is an enumeration (+1) of the arguments.
  
          Coding Example:
            1) Defining the Stored Routine in MySQL:
            CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT)
            BEGIN
              SET pProd := pFac1 * pFac2;
            END
  
            2) Executing in Python:
            args = (5, 5, 0)  # 0 is to hold pprod
            cursor.callproc('multiply', args)
            print(cursor.fetchone())
  
          For OUT and INOUT parameters the user should provide the
          type of the parameter as well. The argument should be a
          tuple with first item as the value of the parameter to pass
          and second argument the type of the argument.
  
          In the above example, one can call callproc method like:
            args = (5, 5, (0, 'INT'))
            cursor.callproc('multiply', args)
  
          The type of the argument given in the tuple will be used by
          the MySQL CAST function to convert the values in the corresponding
          MySQL type (See CAST in MySQL Reference for more information)
  
          Does not return a value, but a result set will be
          available when the CALL-statement execute successfully.
          Raises exceptions when something is wrong.
          
docstring: Calls a stored procedure with the given arguments
  The arguments will be set during this session, meaning
  they will be called like  ___arg where
   is an enumeration (+1) of the arguments.
  
  
  
  2) Executing in Python:
  args = (5, 5, 0)  # 0 is to hold pprod
  cursor.callproc('multiply', args)
  print(cursor.fetchone())
  
  For OUT and INOUT parameters the user should provide the
  type of the parameter as well. The argument should be a
  tuple with first item as the value of the parameter to pass
  and second argument the type of the argument.
  
  In the above example, one can call callproc method like:
  args = (5, 5, (0, 'INT'))
  cursor.callproc('multiply', args)
  
  The type of the argument given in the tuple will be used by
  the MySQL CAST function to convert the values in the corresponding
  MySQL type (See CAST in MySQL Reference for more information)
  
  Does not return a value, but a result set will be
  available when the CALL-statement execute successfully.
  Raises exceptions when something is wrong.
docstring_tokens: Calls a stored procedure with the given arguments The arguments will be set during this session meaning they will be called like ___arg where is an enumeration ( + 1 ) of the arguments . 2 ) Executing in Python : args = ( 5 5 0 ) # 0 is to hold pprod cursor . callproc ( ' multiply ' args ) print ( cursor . fetchone () ) For OUT and INOUT parameters the user should provide the type of the parameter as well . The argument should be a tuple with first item as the value of the parameter to pass and second argument the type of the argument . In the above example one can call callproc method like : args = ( 5 5 ( 0 ' INT ' )) cursor . callproc ( ' multiply ' args ) The type of the argument given in the tuple will be used by the MySQL CAST function to convert the values in the corresponding MySQL type ( See CAST in MySQL Reference for more information ) Does not return a value but a result set will be available when the CALL - statement execute successfully . Raises exceptions when something is wrong .
code: def callproc(self, procname, args=()):
          """Calls a stored procedure with the given arguments
  
          The arguments will be set during this session, meaning
          they will be called like  _<procname>__arg<nr> where
          <nr> is an enumeration (+1) of the arguments.
  
          Coding Example:
            1) Defining the Stored Routine in MySQL:
            CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT)
            BEGIN
              SET pProd := pFac1 * pFac2;
            END
  
            2) Executing in Python:
            args = (5, 5, 0)  # 0 is to hold pprod
            cursor.callproc('multiply', args)
            print(cursor.fetchone())
  
          For OUT and INOUT parameters the user should provide the
          type of the parameter as well. The argument should be a
          tuple with first item as the value of the parameter to pass
          and second argument the type of the argument.
  
          In the above example, one can call callproc method like:
            args = (5, 5, (0, 'INT'))
            cursor.callproc('multiply', args)
  
          The type of the argument given in the tuple will be used by
          the MySQL CAST function to convert the values in the corresponding
          MySQL type (See CAST in MySQL Reference for more information)
  
          Does not return a value, but a result set will be
          available when the CALL-statement execute successfully.
          Raises exceptions when something is wrong.
          """
          if not procname or not isinstance(procname, str):
              raise ValueError("procname must be a string")
  
          if not isinstance(args, (tuple, list)):
              raise ValueError("args must be a sequence")
  
          argfmt = "@_{name}_arg{index}"
          self._stored_results = []
  
          results = []
          try:
              argnames = []
              argtypes = []
              if args:
                  for idx, arg in enumerate(args):
                      argname = argfmt.format(name=procname, index=idx + 1)
                      argnames.append(argname)
                      if isinstance(arg, tuple):
                          argtypes.append(" CAST({0} AS {1})".format(argname,
                                                                     arg[1]))
                          self.execute("SET {0}=%s".format(argname), (arg[0],))
                      else:
                          argtypes.append(argname)
                          self.execute("SET {0}=%s".format(argname), (arg,))
  
              call = "CALL {0}({1})".format(procname, ','.join(argnames))
  
              # pylint: disable=W0212
              # We disable consuming results temporary to make sure we
              # getting all results
              can_consume_results = self._connection._consume_results
              for result in self._connection.cmd_query_iter(call):
                  self._connection._consume_results = False
                  if self._raw:
                      tmp = MySQLCursorBufferedRaw(self._connection._get_self())
                  else:
                      tmp = MySQLCursorBuffered(self._connection._get_self())
                  tmp._executed = "(a result of {0})".format(call)
                  tmp._handle_result(result)
                  if tmp._warnings is not None:
                      self._warnings = tmp._warnings
                  if 'columns' in result:
                      results.append(tmp)
              self._connection._consume_results = can_consume_results
              #pylint: enable=W0212
  
              if argnames:
                  select = "SELECT {0}".format(','.join(argtypes))
                  self.execute(select)
                  self._stored_results = results
                  return self.fetchone()
              else:
                  self._stored_results = results
                  return ()
  
          except errors.Error:
              raise
          except Exception as err:
              raise errors.InterfaceError(
                  "Failed calling stored routine; {0}".format(err))
code_tokens: def callproc ( self , procname , args = ( ) ) : if not procname or not isinstance ( procname , str ) : raise ValueError ( "procname must be a string" ) if not isinstance ( args , ( tuple , list ) ) : raise ValueError ( "args must be a sequence" ) argfmt = "@_{name}_arg{index}" self . _stored_results = [ ] results = [ ] try : argnames = [ ] argtypes = [ ] if args : for idx , arg in enumerate ( args ) : argname = argfmt . format ( name = procname , index = idx + 1 ) argnames . append ( argname ) if isinstance ( arg , tuple ) : argtypes . append ( " CAST({0} AS {1})" . format ( argname , arg [ 1 ] ) ) self . execute ( "SET {0}=%s" . format ( argname ) , ( arg [ 0 ] , ) ) else : argtypes . append ( argname ) self . execute ( "SET {0}=%s" . format ( argname ) , ( arg , ) ) call = "CALL {0}({1})" . format ( procname , ',' . join ( argnames ) ) can_consume_results = self . _connection . _consume_results for result in self . _connection . cmd_query_iter ( call ) : self . _connection . _consume_results = False if self . _raw : tmp = MySQLCursorBufferedRaw ( self . _connection . _get_self ( ) ) else : tmp = MySQLCursorBuffered ( self . _connection . _get_self ( ) ) tmp . _executed = "(a result of {0})" . format ( call ) tmp . _handle_result ( result ) if tmp . _warnings is not None : self . _warnings = tmp . _warnings if 'columns' in result : results . append ( tmp ) self . _connection . _consume_results = can_consume_results if argnames : select = "SELECT {0}" . format ( ',' . join ( argtypes ) ) self . execute ( select ) self . _stored_results = results return self . fetchone ( ) else : self . _stored_results = results return ( ) except errors . Error : raise except Exception as err : raise errors . InterfaceError ( "Failed calling stored routine; {0}" . format ( err ) )
short_docstring: Calls a stored procedure with the given arguments
  The arguments will be set during this session, meaning
  they will be called like  _<procname>__arg<nr> where
  <nr> is an enumeration (+1) of the arguments.
short_docstring_tokens: Calls a stored procedure with the given arguments The arguments will be set during this session meaning they will be called like _<procname > __arg<nr > where <nr > is an enumeration ( + 1 ) of the arguments .
comment: """Calls a stored procedure with the given arguments
  
          The arguments will be set during this session, meaning
          they will be called like  _<procname>__arg<nr> where
          <nr> is an enumeration (+1) of the arguments.
  
          Coding Example:
            1) Defining the Stored Routine in MySQL:
            CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT)
            BEGIN
              SET pProd := pFac1 * pFac2;
            END
  
            2) Executing in Python:
            args = (5, 5, 0)  # 0 is to hold pprod
            cursor.callproc('multiply', args)
            print(cursor.fetchone())
  
          For OUT and INOUT parameters the user should provide the
          type of the parameter as well. The argument should be a
          tuple with first item as the value of the parameter to pass
          and second argument the type of the argument.
  
          In the above example, one can call callproc method like:
            args = (5, 5, (0, 'INT'))
            cursor.callproc('multiply', args)
  
          The type of the argument given in the tuple will be used by
          the MySQL CAST function to convert the values in the corresponding
          MySQL type (See CAST in MySQL Reference for more information)
  
          Does not return a value, but a result set will be
          available when the CALL-statement execute successfully.
          Raises exceptions when something is wrong.
          """$SEP$# pylint: disable=W0212$SEP$# We disable consuming results temporary to make sure we$SEP$# getting all results$SEP$#pylint: enable=W0212