(string)
Creates a CFString from a Python string.

  Inspired by Michael Lynn's power management wrapper:
  https://github.com/pudquick/pypmset/blob/master/pypmset.py

  Args:
    string: str, a regular Python string
  Returns:
    CFStringRef for CreatePowerAssertion()
  Raises:
    MissingImportsError: if CFStringCreateWithCString is missing
Creates a CFString from a Python string.
Creates a CFString from a Python string .
def StrToCFString(string):
  """Creates a CFString from a Python string.

  Inspired by Michael Lynn's power management wrapper:
  https://github.com/pudquick/pypmset/blob/master/pypmset.py

  Args:
    string: str, a regular Python string
  Returns:
    CFStringRef for CreatePowerAssertion()
  Raises:
    MissingImportsError: if CFStringCreateWithCString is missing
  """
  if CFStringCreateWithCString and kCFStringEncodingASCII:
    return objc.pyobjc_id(CFStringCreateWithCString(
        None, string, kCFStringEncodingASCII).nsstring())
  else:
    raise MissingImportsError(
        'CFStringCreateWithCString or kCFStringEncodingASCII '
        'not imported successfully.')
def StrToCFString ( string ) : if CFStringCreateWithCString and kCFStringEncodingASCII : return objc . pyobjc_id ( CFStringCreateWithCString ( None , string , kCFStringEncodingASCII ) . nsstring ( ) ) else : raise MissingImportsError ( 'CFStringCreateWithCString or kCFStringEncodingASCII ' 'not imported successfully.' )