code: def _create_credentials(self, n):
          
          if not n:
              return n
          elif isinstance(n, SecurityCreds):
              return n
          elif isinstance(n, dict):
              return SecurityCreds(**n)
          else:
              raise TypeError("%s is not a valid security configuration"
                              % repr(n))
docs: Create security credentials, if necessary.