id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
171,552
def MCI_MSF_SECOND(msf): return (BYTE)(((WORD)(msf)) >> 8)
null
171,553
def MCI_MSF_FRAME(msf): return (BYTE)((msf) >> 16)
null
171,554
def MCI_TMSF_TRACK(tmsf): return (BYTE)(tmsf)
null
171,555
def MCI_TMSF_MINUTE(tmsf): return (BYTE)(((WORD)(tmsf)) >> 8)
null
171,556
def MCI_TMSF_SECOND(tmsf): return (BYTE)((tmsf) >> 16)
null
171,557
def MCI_TMSF_FRAME(tmsf): return (BYTE)((tmsf) >> 24)
null
171,558
def MCI_HMS_HOUR(hms): return (BYTE)(hms)
null
171,559
def MCI_HMS_MINUTE(hms): return (BYTE)(((WORD)(hms)) >> 8)
null
171,560
def MCI_HMS_SECOND(hms): return (BYTE)((hms) >> 16)
null
171,561
def DIBINDEX(n): return MAKELONG((n), 0x10FF)
null
171,562
AFX_IDW_CONTROLBAR_FIRST = 0xE800 def AFX_CONTROLBAR_MASK(nIDC): return 1 << (nIDC - AFX_IDW_CONTROLBAR_FIRST)
null
171,563
def PRIMARYLANGID(lgid): return (WORD)(lgid) & 1023
null
171,564
def SUBLANGID(lgid): return (WORD)(lgid) >> 10
null
171,565
def LANGIDFROMLCID(lcid): return (WORD)(lcid)
null
171,566
NLS_VALID_LOCALE_MASK = 1048575 def SORTIDFROMLCID(lcid): return (WORD)((((DWORD)(lcid)) & NLS_VALID_LOCALE_MASK) >> 16)
null
171,567
def UNREFERENCED_PARAMETER(P): return P
null
171,568
def DBG_UNREFERENCED_PARAMETER(P): return P
null
171,569
def DBG_UNREFERENCED_LOCAL_VARIABLE(V): return V
null
171,570
N_BTMASK = 15 def BTYPE(x): return (x) & N_BTMASK
null
171,571
IMAGE_SYM_DTYPE_POINTER = 1 N_TMASK = 48 N_BTSHFT = 4 def ISPTR(x): return ((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT)
null
171,572
IMAGE_SYM_DTYPE_FUNCTION = 2 N_TMASK = 48 N_BTSHFT = 4 def ISFCN(x): return ((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT)
null
171,573
IMAGE_SYM_DTYPE_ARRAY = 3 N_TMASK = 48 N_BTSHFT = 4 def ISARY(x): return ((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT)
null
171,574
IMAGE_SYM_DTYPE_POINTER = 1 N_BTMASK = 15 N_BTSHFT = 4 N_TSHIFT = 2 def INCREF(x): return ( (((x) & ~N_BTMASK) << N_TSHIFT) | (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) | ((x) & N_BTMASK) )
null
171,575
N_BTMASK = 15 N_TSHIFT = 2 def DECREF(x): return (((x) >> N_TSHIFT) & ~N_BTMASK) | ((x) & N_BTMASK)
null
171,576
IMAGE_ORDINAL_FLAG = -2147483648 def IMAGE_SNAP_BY_ORDINAL(Ordina): return (Ordinal & IMAGE_ORDINAL_FLAG) != 0
null
171,577
def IMAGE_ORDINAL(Ordina): return Ordinal & 65535
null
171,578
def PRIMARYLANGID(lgid): return (lgid) & 1023
null
171,579
def SUBLANGID(lgid): return (lgid) >> 10
null
171,580
IMAGE_ORDINAL_FLAG = -2147483648 def IMAGE_SNAP_BY_ORDINAL(Ordinal): return (Ordinal & IMAGE_ORDINAL_FLAG) != 0
null
171,581
def IMAGE_ORDINAL(Ordinal): return Ordinal & 65535
null
171,582
def PALETTEINDEX(i): return 16777216 | (i)
null
171,583
def GetRValue(rgb): return rgb & 0xFF
null
171,584
def GetGValue(rgb): return (rgb >> 8) & 0xFF
null
171,585
def GetBValue(rgb): return (rgb >> 16) & 0xFF
null
171,586
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,587
import array import struct import sys import commctrl import pywintypes import win32con import win32gui is64bit = "64 bit" in sys.version try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*...
null
171,588
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: def _make_text_buffer(text): # XXX - at this stage win32gui.UNICODE is only True in py3k, # and in py3k is makes sense to reject bytes. if not isinstance(text, str): ...
null
171,589
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,590
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def _make_empty_text_buffer(cch): return _make_text_buffer("\0" * cch) _menuiteminfo_fmt = "5i5PiP" def EmptyMENUITEMINFO(mask=None, text_buf_size=512): # text_buf_size is number of *characters* - not necess...
null
171,591
import array import struct import sys import commctrl import pywintypes import win32con import win32gui _menuinfo_fmt = "iiiiPiP" def PackMENUINFO( dwStyle=None, cyMax=None, hbrBack=None, dwContextHelpID=None, dwMenuData=None, fMask=0, ): if dwStyle is None: dwStyle = 0 else: ...
null
171,592
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,593
import array import struct import sys import commctrl import pywintypes import win32con import win32gui _menuinfo_fmt = "iiiiPiP" def EmptyMENUINFO(mask=None): if mask is None: mask = ( win32con.MIM_STYLE | win32con.MIM_MAXHEIGHT | win32con.MIM_BACKGROUND | w...
null
171,594
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param): extra = [] # objects we must keep references to mask = 0 mask, hitem = _GetMaskAndVal(hitem, 0, mask, commctrl.TVIF_HANDLE) ...
null
171,595
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def _make_empty_text_buffer(cch): return _make_text_buffer("\0" * cch) _tvitem_fmt = "iPiiPiiiiP" def EmptyTVITEM(hitem, mask=None, text_buf_size=512): extra = [] # objects we must keep references to if...
null
171,596
import array import struct import sys import commctrl import pywintypes import win32con import win32gui is64bit = "64 bit" in sys.version try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*...
null
171,597
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,598
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: def _make_text_buffer(text): else: def _make_text_buffer(text): _lvitem_fmt = "iiiiiPiiPi" def PackLVITEM( item=None, subItem=None, state=None, stateMask=None, text=N...
null
171,599
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,600
import array import struct import sys import commctrl import pywintypes import win32con import win32gui is64bit = "64 bit" in sys.version try: from collections import namedtuple def _MakeResult(names_str, values): except ImportError: # no namedtuple support - just return the values as a normal tuple. de...
null
171,601
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def _make_empty_text_buffer(cch): _lvitem_fmt = "iiiiiPiiPi" def EmptyLVITEM(item, subitem, mask=None, text_buf_size=512): extra = [] # objects we must keep references to if mask is None: mask = ( ...
null
171,602
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: def _make_text_buffer(text): # XXX - at this stage win32gui.UNICODE is only True in py3k, # and in py3k is makes sense to reject bytes. if not isinstance(text, str): ...
null
171,603
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): names = names_str.split() nt = namedtuple(names[0], names[1:]) return nt(*values) except ImportError: # ...
null
171,604
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def _make_empty_text_buffer(cch): _lvcolumn_fmt = "iiiPiiii" def EmptyLVCOLUMN(mask=None, text_buf_size=512): extra = [] # objects we must keep references to if mask is None: mask = ( co...
null
171,605
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def PackLVHITTEST(pt): format = "iiiii" buf = struct.pack(format, pt[0], pt[1], 0, 0, 0) return array.array("b", buf), None
null
171,606
import array import struct import sys import commctrl import pywintypes import win32con import win32gui try: from collections import namedtuple def _MakeResult(names_str, values): except ImportError: # no namedtuple support - just return the values as a normal tuple. def _MakeResult(names_str, values): ...
null
171,607
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: def _make_text_buffer(text): # XXX - at this stage win32gui.UNICODE is only True in py3k, # and in py3k is makes sense to reject bytes. if not isinstance(text, str): ...
null
171,608
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if sys.version_info < (3, 0): def _make_memory(ob): return str(buffer(ob)) def _make_bytes(sval): return sval else: def _make_memory(ob): return bytes(memoryview(ob)) def _make...
null
171,609
import array import struct import sys import commctrl import pywintypes import win32con import win32gui def PackDEV_BROADCAST(devicetype, rest_fmt, rest_data, extra_data=_make_bytes("")): def PackDEV_BROADCAST_VOLUME(unitmask, flags): return PackDEV_BROADCAST(win32con.DBT_DEVTYP_VOLUME, "II", (unitmask, flags))
null
171,610
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: else: if sys.version_info < (3, 0): def _make_memory(ob): return str(buffer(ob)) else: def _make_memory(ob): return bytes(memoryview(ob)) def PackDEV_BROADCAST(devicetype,...
null
171,611
import array import struct import sys import commctrl import pywintypes import win32con import win32gui if win32gui.UNICODE: else: class DEV_BROADCAST_INFO: def __init__(self, devicetype, **kw): def __str__(self): def UnpackDEV_BROADCAST(lparam): if lparam == 0: return None hdr_format = "iii"...
null
171,612
import win32api import win32con import win32evtlog import winerror The provided code snippet includes necessary dependencies for implementing the `AddSourceToRegistry` function. Write a Python function `def AddSourceToRegistry( appName, msgDLL=None, eventLogType="Application", eventLogFlags=None, c...
Add a source of messages to the event log. Allows Python program to register a custom source of messages in the registry. You must also provide the DLL name that has the message table, so the full message text appears in the event log. Note that the win32evtlog.pyd file has a number of string entries with just "%1" bui...
171,613
import win32api import win32con import win32evtlog import winerror The provided code snippet includes necessary dependencies for implementing the `ReportEvent` function. Write a Python function `def ReportEvent( appName, eventID, eventCategory=0, eventType=win32evtlog.EVENTLOG_ERROR_TYPE, strings=N...
Report an event for a previously added event source.
171,614
import win32api import win32con import win32evtlog import winerror error = win32api.error def FormatMessage(eventLogRecord, logType="Application"): """Given a tuple from ReadEventLog, and optionally where the event record came from, load the message, and process message inserts. Note that this function may...
As for FormatMessage, except returns an error message if the message can not be processed.
171,615
import win32api import win32con import win32evtlog import winerror def FeedEventLogRecords( feeder, machineName=None, logName="Application", readFlags=None ): if readFlags is None: readFlags = ( win32evtlog.EVENTLOG_BACKWARDS_READ | win32evtlog.EVENTLOG_SEQUENTIAL_READ ) h = win...
null
171,616
__version__ = "0.11" import os import pprint import shlex import stat import sys import commctrl import win32con def Parse(rc_name, h_name=None): if h_name: h_file = open(h_name, "r") else: # See if same basename as the .rc h_name = rc_name[:-2] + "h" try: h_file = op...
Converts an .rc windows resource source file into a python source file with the same basic public interface as the rest of this module. Particularly useful for py2exe or other 'freeze' type solutions, where a frozen .py file can be used inplace of a real .rc file.
171,617
import win32ras stateStrings = { win32ras.RASCS_OpenPort: "OpenPort", win32ras.RASCS_PortOpened: "PortOpened", win32ras.RASCS_ConnectDevice: "ConnectDevice", win32ras.RASCS_DeviceConnected: "DeviceConnected", win32ras.RASCS_AllDevicesConnected: "AllDevicesConnected", win32ras.RASCS_Authenticate:...
null
171,618
import win32trace def RunAsCollector(): import sys try: import win32api win32api.SetConsoleTitle("Python Trace Collector") except: pass # Oh well! win32trace.InitRead() print("Collecting Python Trace Output...") try: while 1: # a short timeout mean...
null
171,619
import win32trace def SetupForPrint(): win32trace.InitWrite() try: # Under certain servers, sys.stdout may be invalid. print("Redirecting output to win32trace remote collector") except: pass win32trace.setprint() # this works in an rexec environment.
null
171,620
import os import sys import win32api import win32con def GetRootKey(): """Retrieves the Registry root in use by Python.""" keyname = BuildDefaultPythonKey() try: k = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, keyname) k.close() return win32con.HKEY_CURRENT_USER except win32a...
A helper to set the default value for a key in the registry
171,621
import os import sys import win32api import win32con error = "Registry utility error" def GetRootKey(): """Retrieves the Registry root in use by Python.""" keyname = BuildDefaultPythonKey() try: k = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, keyname) k.close() return win32con.HK...
Register a .exe file that uses Python. Registers the .exe with the OS. This allows the specified .exe to be run from the command-line or start button without using the full path, and also to setup application specific path (ie, os.environ['PATH']). Currently the exeAppPath is not supported, so this function is general ...
171,622
import os import sys import win32api import win32con def GetRootKey(): """Retrieves the Registry root in use by Python.""" keyname = BuildDefaultPythonKey() try: k = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, keyname) k.close() return win32con.HKEY_CURRENT_USER except win32a...
Get a registered .exe
171,623
import os import sys import win32api import win32con error = "Registry utility error" def GetRootKey(): """Retrieves the Registry root in use by Python.""" keyname = BuildDefaultPythonKey() try: k = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, keyname) k.close() return win32con.HK...
Unregister a .exe file that uses Python.
171,624
import os import sys import win32api import win32con def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process to get the registry key curren...
Register a named path - ie, a named PythonPath entry.
171,625
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Unregister a named path - ie, a named PythonPath entry.
171,626
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Get a registered named path, or None if it doesnt exist.
171,627
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Register an explicit module in the registry. This forces the Python import mechanism to locate this module directly, without a sys.path search. Thus a registered module need not appear in sys.path at all. modName -- The name of the module, as used by import. modPath -- The full path and file name of the module.
171,628
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Unregister an explicit module in the registry. modName -- The name of the module, as used by import.
171,629
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Given a description, return the registered entry.
171,630
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Register a help file in the registry. Note that this used to support writing to the Windows Help key, however this is no longer done, as it seems to be incompatible. helpFile -- the base name of the help file. helpPath -- the path to the help file helpDesc -- A description for the help file. If None, the helpFile param...
171,631
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Unregister a help file in the registry. helpFile -- the base name of the help file. helpDesc -- A description for the help file. If None, the helpFile param is used.
171,632
import os import sys import win32api import win32con error = "Registry utility error" def BuildDefaultPythonKey(): """Builds a string containing the path to the current registry key. The Python registry key contains the Python version. This function uses the version of the DLL used by the current process t...
Registers the core DLL in the registry. If no params are passed, the name of the Python DLL used in the current process is used and registered.
171,633
import os import sys import win32api import win32con CLSIDPyFile = "{b51df050-06ae-11cf-ad3b-524153480001}" RegistryIDPyFile = "Python.File" RegistryIDPycFile = "Python.CompiledFile" The provided code snippet includes necessary dependencies for implementing the `RegisterFileExtensions` function. Write a Python functi...
Register the core Python file extensions. defPyIcon -- The default icon to use for .py files, in 'fname,offset' format. defPycIcon -- The default icon to use for .pyc files, in 'fname,offset' format. runCommand -- The command line to use for running .py files
171,634
import os import sys import win32api import win32con RegistryIDPyFile = "Python.File" def RegisterShellCommand(shellCommand, exeCommand, shellUserCommand=None): # Last param for "Open" - for a .py file to be executed by the command line # or shell execute (eg, just entering "foo.py"), the Command must be "Open...
null
171,635
import os import sys import win32api import win32con RegistryIDPyFile = "Python.File" def RegisterDDECommand(shellCommand, ddeApp, ddeTopic, ddeCommand): base = "%s\\Shell" % RegistryIDPyFile win32api.RegSetValue( win32con.HKEY_CLASSES_ROOT, base + "\\%s\\ddeexec" % (shellCommand), win3...
null
171,636
import datetime import logging import operator import re import struct import winreg from itertools import count import win32api class TimeZoneInfo(datetime.tzinfo): """ Main class for handling Windows time zones. Usage: TimeZoneInfo(<Time Zone Standard Name>, [<Fix Standard Time>]) If <Fix Stan...
Return the UTC time now with timezone awareness as enabled by this module >>> now = utcnow()
171,637
import datetime import logging import operator import re import struct import winreg from itertools import count import win32api class TimeZoneInfo(datetime.tzinfo): """ Main class for handling Windows time zones. Usage: TimeZoneInfo(<Time Zone Standard Name>, [<Fix Standard Time>]) If <Fix Stan...
Run a few known tests to determine the capabilities of the time zone database on this machine. Note Dynamic Time Zone support is not available on any platform at this time; this is a limitation of this library, not the platform.
171,638
import datetime import logging import operator import re import struct import winreg from itertools import count import win32api DLLCache = DLLHandleCache() The provided code snippet includes necessary dependencies for implementing the `resolveMUITimeZone` function. Write a Python function `def resolveMUITimeZone(spec...
Resolve a multilingual user interface resource for the time zone name >>> #some pre-amble for the doc-tests to be py2k and py3k aware) >>> try: unicode and None ... except NameError: unicode=str ... >>> import sys >>> result = resolveMUITimeZone('@tzres.dll,-110') >>> expectedResultType = [type(None),unicode][sys.getwi...
171,639
import struct import sys import win32wnet def Netbios(ncb): ob = ncb.Buffer is_ours = hasattr(ob, "_pack") if is_ours: ob._pack() try: return win32wnet.Netbios(ncb) finally: if is_ours: ob._unpack()
null
171,640
import struct import sys import win32wnet ADAPTER_STATUS_ITEMS = [ ("6s", "adapter_address"), (UCHAR, "rev_major"), (UCHAR, "reserved0"), (UCHAR, "adapter_type"), (UCHAR, "rev_minor"), (WORD, "duration"), (WORD, "frmr_recv"), (WORD, "frmr_xmit"), (WORD, "iframe_recv_err"), (WORD,...
null
171,641
import struct import sys import win32wnet NAME_BUFFER_ITEMS = [ (str(NCBNAMSZ) + "s", "name"), (UCHAR, "name_num"), (UCHAR, "name_flags"), ] class NCBStruct: def __init__(self, items): self._format = "".join([item[0] for item in items]) self._items = items self._buffer_ = win32wn...
null
171,642
import struct import sys import win32wnet SESSION_HEADER_ITEMS = [ (UCHAR, "sess_name"), (UCHAR, "num_sess"), (UCHAR, "rcv_dg_outstanding"), (UCHAR, "rcv_any_outstanding"), ] class NCBStruct: def __init__(self, items): self._format = "".join([item[0] for item in items]) self._items =...
null
171,643
import struct import sys import win32wnet SESSION_BUFFER_ITEMS = [ (UCHAR, "lsn"), (UCHAR, "state"), (str(NCBNAMSZ) + "s", "local_name"), (str(NCBNAMSZ) + "s", "remote_name"), (UCHAR, "rcvs_outstanding"), (UCHAR, "sends_outstanding"), ] class NCBStruct: def __init__(self, items): sel...
null
171,644
import struct import sys import win32wnet LANA_ENUM_ITEMS = [ ("B", "length"), # Number of valid entries in lana[] (str(MAX_LANA + 1) + "s", "lana"), ] class NCBStruct: def __init__(self, items): def _pack(self): def _unpack(self): def __setattr__(self, attr, val): def LANA_ENUM(): ret...
null
171,645
import struct import sys import win32wnet FIND_NAME_HEADER_ITEMS = [ (WORD, "node_count"), (UCHAR, "reserved"), (UCHAR, "unique_group"), ] class NCBStruct: def __init__(self, items): self._format = "".join([item[0] for item in items]) self._items = items self._buffer_ = win32wnet...
null
171,646
import struct import sys import win32wnet FIND_NAME_BUFFER_ITEMS = [ (UCHAR, "length"), (UCHAR, "access_control"), (UCHAR, "frame_control"), ("6s", "destination_addr"), ("6s", "source_addr"), ("18s", "routing_info"), ] class NCBStruct: def __init__(self, items): self._format = "".joi...
null
171,647
import struct import sys import win32wnet ACTION_HEADER_ITEMS = [ (ULONG, "transport_id"), (USHORT, "action_code"), (USHORT, "reserved"), ] class NCBStruct: def __init__(self, items): self._format = "".join([item[0] for item in items]) self._items = items self._buffer_ = win32wne...
null
171,648
import struct import sys import win32wnet The provided code snippet includes necessary dependencies for implementing the `byte_to_int` function. Write a Python function `def byte_to_int(b)` to solve the following problem: Given an element in a binary buffer, return its integer value Here is the function: def byte_to...
Given an element in a binary buffer, return its integer value
171,649
import importlib import os import sys import warnings import pywintypes import win32api import win32con import win32service import winerror error = RuntimeError def _GetServiceShortName(longName): # looks up a services name # from the display name # Thanks to Andy McKay for this code. access = ( ...
null
171,650
import importlib import os import sys import warnings import pywintypes import win32api import win32con import win32service import winerror def SetServiceCustomOption(serviceName, option, value): try: serviceName = serviceName._svc_name_ except AttributeError: pass key = win32api.RegCreateK...
null
171,651
import importlib import os import sys import warnings import pywintypes import win32api import win32con import win32service import winerror error = RuntimeError def GetServiceCustomOption(serviceName, option, defaultValue=None): # First param may also be a service class/instance. # This allows services to pass...
null