parameters: (cls, incoming_content, decode_base64_before_saving)
return_statement: return {
              'data': data,
              'len': l
          }
docstring: Decodes base-64 content in several different container formats
          and returns a dict containing the following:
          {
              'data' : StringIO.StringIO, # contains the actual content
              'len': int # the length of the content, in bytes
          }
docstring_summary: Decodes base-64 content in several different container formats
          and returns a dict containing the following:
          {
              'data' : StringIO.StringIO, # contains the actual content
              'len': int # the length of the content, in bytes
          }
docstring_tokens: Decodes base - 64 content in several different container formats and returns a dict containing the following : { data : StringIO . StringIO # contains the actual content len : int # the length of the content in bytes }
function: def get_stringio_from_user_content(cls, incoming_content, decode_base64_before_saving):
          """ Decodes base-64 content in several different container formats
          and returns a dict containing the following:
          {
              'data' : StringIO.StringIO, # contains the actual content
              'len': int # the length of the content, in bytes
          }
          """
          if decode_base64_before_saving:
              if hasattr(incoming_content, 'file'):
                  # decode from multipart data
                  data = StringIO.StringIO()
                  base64.decode(incoming_content.file, data)
                  data.seek(0, os.SEEK_END)
                  l = data.tell()
                  data.seek(0)
              elif isinstance(incoming_content, str) or isinstance(incoming_content, unicode):
                  # decode from string
                  data = StringIO.StringIO()
                  base64.decode(StringIO.StringIO(incoming_content), data)
                  data.seek(0, os.SEEK_END)
                  l = data.tell()
                  data.seek(0)
              else:
                  raise Exception('The new content is a %s, but you have requested that it be decoded from base-64. Only strings can be base-64 decoded.' % (type(incoming_content)))
          else:
              if hasattr(incoming_content, 'file'):
                  # data is multipart data
                  data = incoming_content.file
                  data.seek(0, os.SEEK_END)
                  l = data.tell()
                  data.seek(0)
              elif isinstance(incoming_content, str) or isinstance(incoming_content, unicode):
                  # data is direct string or unicode
                  data = incoming_content
                  l = len(data)
              elif isinstance(incoming_content, dict):
                  # data is a dict, JSON-encode it
                  data = json.dumps(incoming_content,
                      default=SimplejsonModelRegistry.default,
                      indent=False)
                  l = len(data)
                      
          return {
              'data': data,
              'len': l
          }
function_tokens: def get_stringio_from_user_content ( cls , incoming_content , decode_base64_before_saving ) : if decode_base64_before_saving : if hasattr ( incoming_content , 'file' ) : # decode from multipart data data = StringIO . StringIO ( ) base64 . decode ( incoming_content . file , data ) data . seek ( 0 , os . SEEK_END ) l = data . tell ( ) data . seek ( 0 ) elif isinstance ( incoming_content , str ) or isinstance ( incoming_content , unicode ) : # decode from string data = StringIO . StringIO ( ) base64 . decode ( StringIO . StringIO ( incoming_content ) , data ) data . seek ( 0 , os . SEEK_END ) l = data . tell ( ) data . seek ( 0 ) else : raise Exception ( 'The new content is a %s, but you have requested that it be decoded from base-64. Only strings can be base-64 decoded.' % ( type ( incoming_content ) ) ) else : if hasattr ( incoming_content , 'file' ) : # data is multipart data data = incoming_content . file data . seek ( 0 , os . SEEK_END ) l = data . tell ( ) data . seek ( 0 ) elif isinstance ( incoming_content , str ) or isinstance ( incoming_content , unicode ) : # data is direct string or unicode data = incoming_content l = len ( data ) elif isinstance ( incoming_content , dict ) : # data is a dict, JSON-encode it data = json . dumps ( incoming_content , default = SimplejsonModelRegistry . default , indent = False ) l = len ( data ) return { 'data' : data , 'len' : l }