code string | signature string | docstring string | loss_without_docstring float64 | loss_with_docstring float64 | factor float64 |
|---|---|---|---|---|---|
if node1 == node2:
return 0
elif set(node1.interfaces) & set(node2.interfaces):
# they share a common interface
return 1
else:
# Not implemented yet, graphsearch to find min hops between two nodes
return 0 | def hops(node1, node2) | returns # of hops it takes to get from node1 to node2, 1 means they're on the same link | 6.061398 | 5.549049 | 1.092331 |
if node is None:
return sorted([eigenvalue(nodes, n) for n in nodes])[0] # return lowest eigenvalue
else:
return len([1 for n in nodes if hops(node, n)]) | def eigenvalue(nodes, node=None) | calculate the eigenvalue (number of connections) for a given node in an array of nodes connected by an array of links
if no node is given, return the minimum eigenvalue in the whole network | 4.736307 | 4.600691 | 1.029477 |
event_type = library.VBoxEventType.on_network_adapter_changed
return self.event_source.register_callback(callback, event_type) | def register_on_network_adapter_changed(self, callback) | Set the callback function to consume on network adapter changed
events.
Callback receives a INetworkAdapterChangedEvent object.
Returns the callback_id | 7.330082 | 9.706429 | 0.755178 |
event_type = library.VBoxEventType.on_serial_port_changed
return self.event_source.register_callback(callback, event_type) | def register_on_serial_port_changed(self, callback) | Set the callback function to consume on serial port changed events.
Callback receives a ISerialPortChangedEvent object.
Returns the callback_id | 8.567154 | 11.628489 | 0.736738 |
event_type = library.VBoxEventType.on_parallel_port_changed
return self.event_source.register_callback(callback, event_type) | def register_on_parallel_port_changed(self, callback) | Set the callback function to consume on serial port changed events.
Callback receives a IParallelPortChangedEvent object.
Returns the callback_id | 8.223919 | 11.871711 | 0.692732 |
event_type = library.VBoxEventType.on_medium_changed
return self.event_source.register_callback(callback, event_type) | def register_on_medium_changed(self, callback) | Set the callback function to consume on medium changed events.
Callback receives a IMediumChangedEvent object.
Returns the callback_id | 9.428765 | 12.975051 | 0.726684 |
event_type = library.VBoxEventType.on_clipboard_mode_changed
return self.event_source.register_callback(callback, event_type) | def register_on_clipboard_mode_changed(self, callback) | Set the callback function to consume on clipboard mode changed
events.
Callback receives a IClipboardModeChangedEvent object.
Returns the callback_id | 8.431066 | 11.148845 | 0.756228 |
event_type = library.VBoxEventType.on_drag_and_drop_mode_changed
return self.event_source.register_callback(callback, event_type) | def register_on_drag_and_drop_mode_changed(self, callback) | Set the callback function to consume on drag and drop mode changed
events.
Callback receives a IDragAndDropModeChangedEvent object.
Returns the callback_id | 7.173517 | 8.978881 | 0.798932 |
event_type = library.VBoxEventType.on_vrde_server_changed
return self.event_source.register_callback(callback, event_type) | def register_on_vrde_server_changed(self, callback) | Set the callback function to consume on VirtualBox Remote Desktop
Extension (VRDE) changed events.
Callback receives a IVRDEServerChangedEvent object.
Returns the callback_id | 6.927639 | 7.85472 | 0.881972 |
event_type = library.VBoxEventType.on_shared_folder_changed
return self.event_source.register_callback(callback, event_type) | def register_on_shared_folder_changed(self, callback) | Set the callback function to consume on shared folder changed events.
Callback receives a ISharedFolderChangedEvent object.
Returns the callback_id | 8.363444 | 11.087924 | 0.754284 |
event_type = library.VBoxEventType.on_additions_state_change
return self.event_source.register_callback(callback, event_type) | def register_on_additions_state_changed(self, callback) | Set the callback function to consume on additions state changed
events.
Callback receives a IAdditionsStateChangedEvent object.
Note: Interested callees should query IGuest attributes to find out
what has changed.
Returns the callback_id | 8.804809 | 8.88605 | 0.990857 |
event_type = library.VBoxEventType.on_state_changed
return self.event_source.register_callback(callback, event_type) | def register_on_state_changed(self, callback) | Set the callback function to consume on state changed events
which are generated when the state of the machine changes.
Callback receives a IStateChangeEvent object.
Returns the callback_id | 8.937414 | 11.988133 | 0.745522 |
event_type = library.VBoxEventType.on_event_source_changed
return self.event_source.register_callback(callback, event_type) | def register_on_event_source_changed(self, callback) | Set the callback function to consume on event source changed
events. This occurs when a listener is added or removed.
Callback receives a IEventStateChangedEvent object.
Returns the callback_id | 6.845124 | 9.143563 | 0.748628 |
event_type = library.VBoxEventType.on_can_show_window
return self.event_source.register_callback(callback, event_type) | def register_on_can_show_window(self, callback) | Set the callback function to consume on can show window events.
This occurs when the console window is to be activated and brought to
the foreground of the desktop of the host PC. If this behaviour is
not desired a call to event.add_veto will stop this from happening.
Callback receives... | 8.117567 | 9.315596 | 0.871395 |
event_type = library.VBoxEventType.on_show_window
return self.event_source.register_callback(callback, event_type) | def register_on_show_window(self, callback) | Set the callback function to consume on show window events.
This occurs when the console window is to be activated and brought to
the foreground of the desktop of the host PC.
Callback receives a IShowWindowEvent object.
Returns the callback_id | 8.734947 | 11.119366 | 0.785562 |
try:
import vboxapi
except ImportError:
system = platform.system()
py_mm_ver = sys.version_info[:2]
py_major = sys.version_info[0]
packages = ['vboxapi']
if system == 'Windows':
packages.extend(['win32com', 'win32', 'win32api', 'pywintypes', 'win... | def import_vboxapi() | This import is designed to help when loading vboxapi inside of
alternative Python environments (virtualenvs etc).
:rtype: vboxapi module | 2.593046 | 2.606753 | 0.994742 |
"Set the manager object in the global _managers dict."
pid = current_process().ident
if _managers is None:
raise RuntimeError("Can not set the manager following a system exit.")
if pid not in _managers:
_managers[pid] = value
else:
raise Except... | def manager(self, value) | Set the manager object in the global _managers dict. | 6.20734 | 4.524255 | 1.372014 |
# The inconsistent vboxapi implementation makes this annoying...
if hasattr(self.manager, 'mgr'):
manager = getattr(self.manager, 'mgr')
else:
manager = self.manager
return Session(interface=manager.getSessionObject(None)) | def get_session(self) | Return a Session interface
:rtype: library.ISession | 11.825097 | 11.893695 | 0.994232 |
name = interface_class.__name__
i = self.manager.queryInterface(interface_object._i, name)
return interface_class(interface=i) | def cast_object(self, interface_object, interface_class) | Cast the obj to the interface class
:rtype: interface_class(interface_object) | 7.945649 | 9.234849 | 0.860398 |
vbox = VirtualBox()
machine = vbox.find_machine(self.machine_name)
wait_time = 0
while True:
session = Session()
try:
machine.lock_machine(session, LockType.write)
except Exception as exc:
if timeout_ms != -1 an... | def _lock(self, timeout_ms=-1) | Exclusive lock over root machine | 3.516227 | 3.292557 | 1.067932 |
vbox = VirtualBox()
machines = []
for machine in vbox.machines:
if machine.name == self.machine_name:
continue
if machine.name.startswith(self.machine_name):
machines.append(machine)
return machines | def _clones(self) | Yield all machines under this pool | 3.981249 | 2.74767 | 1.448955 |
with self._lock() as root_session:
for clone in self._clones:
# Search for a free clone
session = Session()
try:
clone.lock_machine(session, LockType.write)
except Exception:
continue
... | def acquire(self, username, password, frontend='headless') | Acquire a Machine resource. | 4.287893 | 4.210984 | 1.018264 |
if session.state != SessionState.locked:
return
with self._lock():
return self._power_down(session) | def release(self, session) | Release a machine session resource. | 12.679459 | 11.174678 | 1.13466 |
if not isinstance(is_ipv6, bool):
raise TypeError("is_ipv6 can only be an instance of type bool")
if not isinstance(rule_name, basestring):
raise TypeError("rule_name can only be an instance of type basestring")
if not isinstance(proto, NATProtocol):
... | def add_port_forward_rule(self, is_ipv6, rule_name, proto, host_ip, host_port, guest_ip, guest_port) | Protocol handled with the rule.
in is_ipv6 of type bool
in rule_name of type str
in proto of type :class:`NATProtocol`
Protocol handled with the rule.
in host_ip of type str
IP of the host interface to which the rule should apply.
An empty ip addre... | 1.604358 | 1.574318 | 1.019081 |
if not isinstance(trunk_type, basestring):
raise TypeError("trunk_type can only be an instance of type basestring")
self._call("start",
in_p=[trunk_type]) | def start(self, trunk_type) | Type of internal network trunk.
in trunk_type of type str
Type of internal network trunk. | 5.992808 | 6.776798 | 0.884313 |
if not isinstance(option, DhcpOpt):
raise TypeError("option can only be an instance of type DhcpOpt")
self._call("removeGlobalOption",
in_p=[option]) | def remove_global_option(self, option) | removes the specified option
in option of type :class:`DhcpOpt`
raises :class:`OleErrorInvalidarg`
invalid option id supplied | 10.061239 | 6.850777 | 1.468627 |
if not isinstance(vmname, basestring):
raise TypeError("vmname can only be an instance of type basestring")
if not isinstance(slot, baseinteger):
raise TypeError("slot can only be an instance of type baseinteger")
if not isinstance(option, DhcpOpt):
r... | def remove_vm_slot_option(self, vmname, slot, option) | removes the specified option
in vmname of type str
in slot of type int
in option of type :class:`DhcpOpt`
raises :class:`OleErrorInvalidarg`
invalid VM, slot, or option id supplied | 3.218904 | 2.64386 | 1.217501 |
if not isinstance(vmname, basestring):
raise TypeError("vmname can only be an instance of type basestring")
if not isinstance(slot, baseinteger):
raise TypeError("slot can only be an instance of type baseinteger")
self._call("removeVmSlotOptions",
... | def remove_vm_slot_options(self, vmname, slot) | removes all option for the specified adapter
in vmname of type str
in slot of type int
raises :class:`OleErrorInvalidarg`
invalid VM or slot supplied | 3.836323 | 3.969129 | 0.96654 |
if not isinstance(ip_address, basestring):
raise TypeError("ip_address can only be an instance of type basestring")
if not isinstance(network_mask, basestring):
raise TypeError("network_mask can only be an instance of type basestring")
if not isinstance(from_ip_a... | def set_configuration(self, ip_address, network_mask, from_ip_address, to_ip_address) | configures the server
in ip_address of type str
server IP address
in network_mask of type str
server network mask
in from_ip_address of type str
server From IP address for address range
in to_ip_address of type str
server To IP address ... | 1.710342 | 1.759402 | 0.972115 |
if not isinstance(network_name, basestring):
raise TypeError("network_name can only be an instance of type basestring")
if not isinstance(trunk_name, basestring):
raise TypeError("trunk_name can only be an instance of type basestring")
if not isinstance(trunk_typ... | def start(self, network_name, trunk_name, trunk_type) | Starts DHCP server process.
in network_name of type str
Name of internal network DHCP server should attach to.
in trunk_name of type str
Name of internal network trunk.
in trunk_type of type str
Type of internal network trunk.
raises :class:`OleErr... | 2.096093 | 2.104419 | 0.996044 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(group, basestring):
raise TypeError("group can only be an instance of type basestring")
if not isinstance(create_flags, basestring):
... | def compose_machine_filename(self, name, group, create_flags, base_folder) | Returns a recommended full path of the settings file name for a new virtual
machine.
This API serves two purposes:
It gets called by :py:func:`create_machine` if @c null or
empty string (which is recommended) is specified for the
@a settingsFile argume... | 2.093343 | 1.969413 | 1.062928 |
if not isinstance(settings_file, basestring):
raise TypeError("settings_file can only be an instance of type basestring")
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(groups, list):
... | def create_machine(self, settings_file, name, groups, os_type_id, flags) | Creates a new virtual machine by creating a machine settings file at
the given location.
VirtualBox machine settings files use a custom XML dialect. Starting
with VirtualBox 4.0, a ".vbox" extension is recommended, but not enforced,
and machine files can be created at arbitrary ... | 2.193522 | 2.103503 | 1.042795 |
if not isinstance(settings_file, basestring):
raise TypeError("settings_file can only be an instance of type basestring")
machine = self._call("openMachine",
in_p=[settings_file])
machine = IMachine(machine)
return machine | def open_machine(self, settings_file) | Opens a virtual machine from the existing settings file.
The opened machine remains unregistered until you call
:py:func:`register_machine` .
The specified settings file name must be fully qualified.
The file must exist and be a valid machine XML settings file
whose cont... | 6.126642 | 5.285412 | 1.159161 |
if not isinstance(machine, IMachine):
raise TypeError("machine can only be an instance of type IMachine")
self._call("registerMachine",
in_p=[machine]) | def register_machine(self, machine) | Registers the machine previously created using
:py:func:`create_machine` or opened using
:py:func:`open_machine` within this VirtualBox installation. After
successful method invocation, the
:py:class:`IMachineRegisteredEvent` event is fired.
This method impli... | 9.796043 | 9.269984 | 1.056749 |
if not isinstance(name_or_id, basestring):
raise TypeError("name_or_id can only be an instance of type basestring")
machine = self._call("findMachine",
in_p=[name_or_id])
machine = IMachine(machine)
return machine | def find_machine(self, name_or_id) | Attempts to find a virtual machine given its name or UUID.
Inaccessible machines cannot be found by name, only by UUID, because their name
cannot safely be determined.
in name_or_id of type str
What to search for. This can either be the UUID or the name of a virtual machine... | 4.807971 | 4.124903 | 1.165596 |
if not isinstance(groups, list):
raise TypeError("groups can only be an instance of type list")
for a in groups[:10]:
if not isinstance(a, basestring):
raise TypeError(
"array can only contain objects of type basestring")
m... | def get_machines_by_groups(self, groups) | Gets all machine references which are in one of the specified groups.
in groups of type str
What groups to match. The usual group list rules apply, i.e.
passing an empty list will match VMs in the toplevel group, likewise
the empty string.
return machines of type :c... | 6.156246 | 5.348104 | 1.151108 |
if not isinstance(machines, list):
raise TypeError("machines can only be an instance of type list")
for a in machines[:10]:
if not isinstance(a, IMachine):
raise TypeError(
"array can only contain objects of type IMachine")
... | def get_machine_states(self, machines) | Gets the state of several machines in a single operation.
in machines of type :class:`IMachine`
Array with the machine references.
return states of type :class:`MachineState`
Machine states, corresponding to the machines. | 5.5372 | 4.709219 | 1.175821 |
if not isinstance(format_p, basestring):
raise TypeError("format_p can only be an instance of type basestring")
if not isinstance(location, basestring):
raise TypeError("location can only be an instance of type basestring")
if not isinstance(access_mode, AccessMo... | def create_medium(self, format_p, location, access_mode, a_device_type_type) | Creates a new base medium object that will use the given storage
format and location for medium data.
The actual storage unit is not created by this method. In order to
do it, and before you are able to attach the created medium to
virtual machines, you must call one of the foll... | 2.032093 | 1.937166 | 1.049003 |
if not isinstance(id_p, basestring):
raise TypeError("id_p can only be an instance of type basestring")
type_p = self._call("getGuestOSType",
in_p=[id_p])
type_p = IGuestOSType(type_p)
return type_p | def get_guest_os_type(self, id_p) | Returns an object describing the specified guest OS type.
The requested guest OS type is specified using a string which is a
mnemonic identifier of the guest operating system, such as
"win31" or "ubuntu". The guest OS type ID of a
particular virtual machine can be read or set us... | 4.340912 | 3.694067 | 1.175104 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(host_path, basestring):
raise TypeError("host_path can only be an instance of type basestring")
if not isinstance(writable, bool):
... | def create_shared_folder(self, name, host_path, writable, automount, auto_mount_point) | Creates a new global shared folder by associating the given logical
name with the given host path, adds it to the collection of shared
folders and starts sharing it. Refer to the description of
:py:class:`ISharedFolder` to read more about logical names.
In the current implement... | 1.709096 | 1.737826 | 0.983468 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
self._call("removeSharedFolder",
in_p=[name]) | def remove_shared_folder(self, name) | Removes the global shared folder with the given name previously
created by :py:func:`create_shared_folder` from the collection of
shared folders and stops sharing it.
In the current implementation, this operation is not
implemented.
in name of type str
Logi... | 7.612639 | 8.494034 | 0.896234 |
if not isinstance(password, basestring):
raise TypeError("password can only be an instance of type basestring")
self._call("setSettingsSecret",
in_p=[password]) | def set_settings_secret(self, password) | Unlocks the secret data by passing the unlock password to the
server. The server will cache the password for that machine.
in password of type str
The cipher key.
raises :class:`VBoxErrorInvalidVmState`
Virtual machine is not mutable. | 7.651217 | 8.956564 | 0.854258 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
server = self._call("createDHCPServer",
in_p=[name])
server = IDHCPServer(server)
return server | def create_dhcp_server(self, name) | Creates a DHCP server settings to be used for the given internal network name
in name of type str
server name
return server of type :class:`IDHCPServer`
DHCP server settings
raises :class:`OleErrorInvalidarg`
Host network interface @a name already exists. | 6.364336 | 5.117573 | 1.243624 |
if not isinstance(server, IDHCPServer):
raise TypeError("server can only be an instance of type IDHCPServer")
self._call("removeDHCPServer",
in_p=[server]) | def remove_dhcp_server(self, server) | Removes the DHCP server settings
in server of type :class:`IDHCPServer`
DHCP server settings to be removed
raises :class:`OleErrorInvalidarg`
Host network interface @a name already exists. | 7.574882 | 6.321548 | 1.198264 |
if not isinstance(firmware_type, FirmwareType):
raise TypeError("firmware_type can only be an instance of type FirmwareType")
if not isinstance(version, basestring):
raise TypeError("version can only be an instance of type basestring")
(result, url, file_p) = sel... | def check_firmware_present(self, firmware_type, version) | Check if this VirtualBox installation has a firmware
of the given type available, either system-wide or per-user.
Optionally, this may return a hint where this firmware can be
downloaded from.
in firmware_type of type :class:`FirmwareType`
Type of firmware to check.
... | 3.811932 | 2.8552 | 1.335084 |
if not isinstance(dir_p, basestring):
raise TypeError("dir_p can only be an instance of type basestring")
progress = self._call("cd",
in_p=[dir_p])
progress = IProgress(progress)
return progress | def cd(self, dir_p) | Change the current directory level.
in dir_p of type str
The name of the directory to go in.
return progress of type :class:`IProgress`
Progress object to track the operation completion. | 6.581968 | 5.153526 | 1.277178 |
(names, types, sizes, modes) = self._call("entryList")
return (names, types, sizes, modes) | def entry_list(self) | Returns a list of files/directories after a call to :py:func:`update` . The user is responsible for keeping this internal
list up do date.
out names of type str
The list of names for the entries.
out types of type int
The list of types for the entries. :py:class:`FsObjT... | 9.362773 | 6.354563 | 1.473394 |
if not isinstance(names, list):
raise TypeError("names can only be an instance of type list")
for a in names[:10]:
if not isinstance(a, basestring):
raise TypeError(
"array can only contain objects of type basestring")
exis... | def exists(self, names) | Checks if the given file list exists in the current directory
level.
in names of type str
The names to check.
return exists of type str
The names which exist. | 6.488503 | 6.283706 | 1.032592 |
if not isinstance(names, list):
raise TypeError("names can only be an instance of type list")
for a in names[:10]:
if not isinstance(a, basestring):
raise TypeError(
"array can only contain objects of type basestring")
prog... | def remove(self, names) | Deletes the given files in the current directory level.
in names of type str
The names to remove.
return progress of type :class:`IProgress`
Progress object to track the operation completion. | 7.437038 | 6.033504 | 1.232623 |
if not isinstance(what, baseinteger):
raise TypeError("what can only be an instance of type baseinteger")
result = self._call("queryInfo",
in_p=[what])
return result | def query_info(self, what) | Way to extend the interface.
in what of type int
return result of type str | 9.876154 | 9.542433 | 1.034972 |
if not isinstance(file_p, basestring):
raise TypeError("file_p can only be an instance of type basestring")
progress = self._call("read",
in_p=[file_p])
progress = IProgress(progress)
return progress | def read(self, file_p) | Reads an OVF file into the appliance object.
This method succeeds if the OVF is syntactically valid and, by itself, without errors. The
mere fact that this method returns successfully does not mean that VirtualBox supports all
features requested by the appliance; this can only be examin... | 6.791464 | 5.449547 | 1.246244 |
if not isinstance(options, list):
raise TypeError("options can only be an instance of type list")
for a in options[:10]:
if not isinstance(a, ImportOptions):
raise TypeError(
"array can only contain objects of type ImportOptions")
... | def import_machines(self, options) | Imports the appliance into VirtualBox by creating instances of :py:class:`IMachine`
and other interfaces that match the information contained in the appliance as
closely as possible, as represented by the import instructions in the
:py:func:`virtual_system_descriptions` array.
... | 7.333192 | 5.828254 | 1.258214 |
if not isinstance(uri, basestring):
raise TypeError("uri can only be an instance of type basestring")
explorer = self._call("createVFSExplorer",
in_p=[uri])
explorer = IVFSExplorer(explorer)
return explorer | def create_vfs_explorer(self, uri) | Returns a :py:class:`IVFSExplorer` object for the given URI.
in uri of type str
The URI describing the file system to use.
return explorer of type :class:`IVFSExplorer` | 7.122389 | 6.133662 | 1.161197 |
if not isinstance(format_p, basestring):
raise TypeError("format_p can only be an instance of type basestring")
if not isinstance(options, list):
raise TypeError("options can only be an instance of type list")
for a in options[:10]:
if not isinstance(... | def write(self, format_p, options, path) | Writes the contents of the appliance exports into a new OVF file.
Calling this method is the final step of exporting an appliance from VirtualBox;
see :py:class:`IAppliance` for an overview.
Since exporting the appliance will most probably involve copying and converting
... | 3.491244 | 2.971508 | 1.174906 |
if not isinstance(password_id, basestring):
raise TypeError("password_id can only be an instance of type basestring")
identifiers = self._call("getMediumIdsForPasswordId",
in_p=[password_id])
return identifiers | def get_medium_ids_for_password_id(self, password_id) | Returns a list of medium identifiers which use the given password identifier.
in password_id of type str
The password identifier to get the medium identifiers for.
return identifiers of type str
The list of medium identifiers returned on success. | 6.151263 | 5.910283 | 1.040773 |
if not isinstance(identifiers, list):
raise TypeError("identifiers can only be an instance of type list")
for a in identifiers[:10]:
if not isinstance(a, basestring):
raise TypeError(
"array can only contain objects of type basestr... | def add_passwords(self, identifiers, passwords) | Adds a list of passwords required to import or export encrypted virtual
machines.
in identifiers of type str
List of identifiers.
in passwords of type str
List of matching passwords. | 3.003297 | 3.056806 | 0.982495 |
if not isinstance(type_p, VirtualSystemDescriptionType):
raise TypeError("type_p can only be an instance of type VirtualSystemDescriptionType")
(types, refs, ovf_values, v_box_values, extra_config_values) = self._call("getDescriptionByType",
in_p=[type_p])
... | def get_description_by_type(self, type_p) | This is the same as :py:func:`get_description` except that you can specify which types
should be returned.
in type_p of type :class:`VirtualSystemDescriptionType`
out types of type :class:`VirtualSystemDescriptionType`
out refs of type str
out ovf_values of type str
... | 5.822289 | 2.676913 | 2.175001 |
if not isinstance(type_p, VirtualSystemDescriptionType):
raise TypeError("type_p can only be an instance of type VirtualSystemDescriptionType")
self._call("removeDescriptionByType",
in_p=[type_p]) | def remove_description_by_type(self, type_p) | Delete all records which are equal to the passed type from the list
in type_p of type :class:`VirtualSystemDescriptionType` | 7.343553 | 4.773644 | 1.538354 |
if not isinstance(type_p, VirtualSystemDescriptionType):
raise TypeError("type_p can only be an instance of type VirtualSystemDescriptionType")
if not isinstance(which, VirtualSystemDescriptionValueType):
raise TypeError("which can only be an instance of type VirtualSyst... | def get_values_by_type(self, type_p, which) | This is the same as :py:func:`get_description_by_type` except that you can specify which
value types should be returned. See :py:class:`VirtualSystemDescriptionValueType` for possible
values.
in type_p of type :class:`VirtualSystemDescriptionType`
in which of type :class:`VirtualSyst... | 4.064756 | 2.958294 | 1.37402 |
if not isinstance(enabled, list):
raise TypeError("enabled can only be an instance of type list")
for a in enabled[:10]:
if not isinstance(a, bool):
raise TypeError(
"array can only contain objects of type bool")
if not isi... | def set_final_values(self, enabled, v_box_values, extra_config_values) | This method allows the appliance's user to change the configuration for the virtual
system descriptions. For each array item returned from :py:func:`get_description` ,
you must pass in one boolean value and one configuration value.
Each item in the boolean array determines whether the p... | 2.041366 | 1.994958 | 1.023263 |
if not isinstance(type_p, VirtualSystemDescriptionType):
raise TypeError("type_p can only be an instance of type VirtualSystemDescriptionType")
if not isinstance(v_box_value, basestring):
raise TypeError("v_box_value can only be an instance of type basestring")
i... | def add_description(self, type_p, v_box_value, extra_config_value) | This method adds an additional description entry to the stack of already
available descriptions for this virtual system. This is handy for writing
values which aren't directly supported by VirtualBox. One example would
be the License type of :py:class:`VirtualSystemDescriptionType` .
in... | 2.404198 | 2.000826 | 1.201603 |
if not isinstance(state, MachineState):
raise TypeError("state can only be an instance of type MachineState")
self._call("updateState",
in_p=[state]) | def update_state(self, state) | Updates the VM state.
This operation will also update the settings file with the correct
information about the saved state file and delete this file from disk
when appropriate.
in state of type :class:`MachineState` | 9.968945 | 9.523013 | 1.046827 |
if not isinstance(progress, IProgress):
raise TypeError("progress can only be an instance of type IProgress")
self._call("beginPowerUp",
in_p=[progress]) | def begin_power_up(self, progress) | Tells VBoxSVC that :py:func:`IConsole.power_up` is under ways and
gives it the progress object that should be part of any pending
:py:func:`IMachine.launch_vm_process` operations. The progress
object may be called back to reflect an early cancelation, so some care
have to be taken with... | 9.454923 | 7.853899 | 1.203851 |
if not isinstance(result, baseinteger):
raise TypeError("result can only be an instance of type baseinteger")
self._call("endPowerUp",
in_p=[result]) | def end_power_up(self, result) | Tells VBoxSVC that :py:func:`IConsole.power_up` has completed.
This method may query status information from the progress object it
received in :py:func:`IInternalMachineControl.begin_power_up` and copy
it over to any in-progress :py:func:`IMachine.launch_vm_process`
call in order to ... | 11.367406 | 11.79369 | 0.963855 |
if not isinstance(result, baseinteger):
raise TypeError("result can only be an instance of type baseinteger")
if not isinstance(err_msg, basestring):
raise TypeError("err_msg can only be an instance of type basestring")
self._call("endPoweringDown",
... | def end_powering_down(self, result, err_msg) | Called by the VM process to inform the server that powering
down previously requested by #beginPoweringDown is either
successfully finished or there was a failure.
in result of type int
@c S_OK to indicate success.
in err_msg of type str
@c human readable error ... | 3.888888 | 3.536678 | 1.099588 |
if not isinstance(device, IUSBDevice):
raise TypeError("device can only be an instance of type IUSBDevice")
(matched, masked_interfaces) = self._call("runUSBDeviceFilters",
in_p=[device])
return (matched, masked_interfaces) | def run_usb_device_filters(self, device) | Asks the server to run USB devices filters of the associated
machine against the given USB device and tell if there is
a match.
Intended to be used only for remote USB devices. Local
ones don't require to call this method (this is done
implicitly by the Host and USBProxy... | 8.833687 | 5.036847 | 1.753813 |
if not isinstance(id_p, basestring):
raise TypeError("id_p can only be an instance of type basestring")
if not isinstance(capture_filename, basestring):
raise TypeError("capture_filename can only be an instance of type basestring")
self._call("captureUSBDevice",
... | def capture_usb_device(self, id_p, capture_filename) | Requests a capture of the given host USB device.
When the request is completed, the VM process will
get a :py:func:`IInternalSessionControl.on_usb_device_attach`
notification.
in id_p of type str
in capture_filename of type str | 2.820565 | 3.073665 | 0.917655 |
if not isinstance(id_p, basestring):
raise TypeError("id_p can only be an instance of type basestring")
if not isinstance(done, bool):
raise TypeError("done can only be an instance of type bool")
self._call("detachUSBDevice",
in_p=[id_p, done... | def detach_usb_device(self, id_p, done) | Notification that a VM is going to detach (@a done = @c false) or has
already detached (@a done = @c true) the given USB device.
When the @a done = @c true request is completed, the VM process will
get a :py:func:`IInternalSessionControl.on_usb_device_detach`
notification.
... | 3.332773 | 3.62327 | 0.919825 |
if not isinstance(done, bool):
raise TypeError("done can only be an instance of type bool")
self._call("detachAllUSBDevices",
in_p=[done]) | def detach_all_usb_devices(self, done) | Notification that a VM that is being powered down. The done
parameter indicates whether which stage of the power down
we're at. When @a done = @c false the VM is announcing its
intentions, while when @a done = @c true the VM is reporting
what it has done.
In the @a done ... | 9.198982 | 10.300716 | 0.893043 |
if not isinstance(session, ISession):
raise TypeError("session can only be an instance of type ISession")
progress = self._call("onSessionEnd",
in_p=[session])
progress = IProgress(progress)
return progress | def on_session_end(self, session) | Triggered by the given session object when the session is about
to close normally.
in session of type :class:`ISession`
Session that is being closed
return progress of type :class:`IProgress`
Used to wait until the corresponding machine is actually
dissociat... | 11.049209 | 7.016542 | 1.574737 |
(names, values, timestamps, flags) = self._call("pullGuestProperties")
return (names, values, timestamps, flags) | def pull_guest_properties(self) | Get the list of the guest properties matching a set of patterns along
with their values, timestamps and flags and give responsibility for
managing properties to the console.
out names of type str
The names of the properties returned.
out values of type str
The v... | 9.465043 | 6.143144 | 1.540749 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(value, basestring):
raise TypeError("value can only be an instance of type basestring")
if not isinstance(timestamp, baseinteger):
... | def push_guest_property(self, name, value, timestamp, flags) | Update a single guest property in IMachine.
in name of type str
The name of the property to be updated.
in value of type str
The value of the property.
in timestamp of type int
The timestamp of the property.
in flags of type str
The fla... | 2.372392 | 2.380141 | 0.996744 |
if not isinstance(attachment, IMediumAttachment):
raise TypeError("attachment can only be an instance of type IMediumAttachment")
new_attachment = self._call("ejectMedium",
in_p=[attachment])
new_attachment = IMediumAttachment(new_attachment)
ret... | def eject_medium(self, attachment) | Tells VBoxSVC that the guest has ejected the medium associated with
the medium attachment.
in attachment of type :class:`IMediumAttachment`
The medium attachment where the eject happened.
return new_attachment of type :class:`IMediumAttachment`
A new reference to the me... | 5.813968 | 4.59031 | 1.266574 |
if not isinstance(auth_params, list):
raise TypeError("auth_params can only be an instance of type list")
for a in auth_params[:10]:
if not isinstance(a, basestring):
raise TypeError(
"array can only contain objects of type basestr... | def authenticate_external(self, auth_params) | Verify credentials using the external auth library.
in auth_params of type str
The auth parameters, credentials, etc.
out result of type str
The authentification result. | 5.615688 | 5.538577 | 1.013923 |
if not isinstance(feature, RecordingFeature):
raise TypeError("feature can only be an instance of type RecordingFeature")
enabled = self._call("isFeatureEnabled",
in_p=[feature])
return enabled | def is_feature_enabled(self, feature) | Returns whether a particular recording feature is enabled for this
screen or not.
in feature of type :class:`RecordingFeature`
Feature to check for.
return enabled of type bool
@c true if the feature is enabled, @c false if not. | 8.426233 | 6.812151 | 1.236942 |
if not isinstance(screen_id, baseinteger):
raise TypeError("screen_id can only be an instance of type baseinteger")
record_screen_settings = self._call("getScreenSettings",
in_p=[screen_id])
record_screen_settings = IRecordingScreenSettings(record_screen... | def get_screen_settings(self, screen_id) | Returns the recording settings for a particular screen.
in screen_id of type int
Screen ID to retrieve recording screen settings for.
return record_screen_settings of type :class:`IRecordingScreenSettings`
Recording screen settings for the requested screen. | 5.447924 | 4.410658 | 1.235173 |
if not isinstance(number, baseinteger):
raise TypeError("number can only be an instance of type baseinteger")
self._call("fromLong",
in_p=[number]) | def from_long(self, number) | Make PCI address from long.
in number of type int | 10.758861 | 11.630381 | 0.925065 |
if not isinstance(session, ISession):
raise TypeError("session can only be an instance of type ISession")
if not isinstance(lock_type, LockType):
raise TypeError("lock_type can only be an instance of type LockType")
self._call("lockMachine",
... | def lock_machine(self, session, lock_type) | Locks the machine for the given session to enable the caller
to make changes to the machine or start the VM or control
VM execution.
There are two ways to lock a machine for such uses:
If you want to make changes to the machine settings,
you must obtain... | 3.922322 | 3.514938 | 1.115901 |
if not isinstance(position, baseinteger):
raise TypeError("position can only be an instance of type baseinteger")
if not isinstance(device, DeviceType):
raise TypeError("device can only be an instance of type DeviceType")
self._call("setBootOrder",
... | def set_boot_order(self, position, device) | Puts the given device to the specified position in
the boot order.
To indicate that no device is associated with the given position,
:py:attr:`DeviceType.null` should be used.
@todo setHardDiskBootOrder(), setNetworkBootOrder()
in position of type int
... | 4.433622 | 3.997785 | 1.10902 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def attach_device(self, name, controller_port, device, type_p, medium) | Attaches a device and optionally mounts a medium to the given storage
controller (:py:class:`IStorageController` , identified by @a name),
at the indicated port and device.
This method is intended for managing storage devices in general while a
machine is powered off. It can be ... | 2.075891 | 1.929496 | 1.075872 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def attach_device_without_medium(self, name, controller_port, device, type_p) | Attaches a device and optionally mounts a medium to the given storage
controller (:py:class:`IStorageController` , identified by @a name),
at the indicated port and device.
This method is intended for managing storage devices in general while a
machine is powered off. It can be ... | 2.172971 | 2.13184 | 1.019294 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def passthrough_device(self, name, controller_port, device, passthrough) | Sets the passthrough mode of an existing DVD device. Changing the
setting while the VM is running is forbidden. The setting is only used
if at VM start the device is configured as a host DVD drive, in all
other cases it is ignored. The device must already exist; see
:py:func:`IMachine.at... | 2.218379 | 2.168484 | 1.023009 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def temporary_eject_device(self, name, controller_port, device, temporary_eject) | Sets the behavior for guest-triggered medium eject. In some situations
it is desirable that such ejects update the VM configuration, and in
others the eject should keep the VM configuration. The device must
already exist; see :py:func:`IMachine.attach_device` for how to
attach a new dev... | 2.131331 | 2.077634 | 1.025845 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def non_rotational_device(self, name, controller_port, device, non_rotational) | Sets a flag in the device information which indicates that the medium
is not based on rotational technology, i.e. that the access times are
more or less independent of the position on the medium. This may or may
not be supported by a particular drive, and is silently ignored in the
latte... | 2.164638 | 2.061446 | 1.050058 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def set_auto_discard_for_device(self, name, controller_port, device, discard) | Sets a flag in the device information which indicates that the medium
supports discarding unused blocks (called trimming for SATA or unmap
for SCSI devices) .This may or may not be supported by a particular drive,
and is silently ignored in the latter case. At the moment only hard disks
... | 2.215613 | 2.142959 | 1.033903 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def set_hot_pluggable_for_device(self, name, controller_port, device, hot_pluggable) | Sets a flag in the device information which indicates that the attached
device is hot pluggable or not. This may or may not be supported by a
particular controller and/or drive, and is silently ignored in the
latter case. Changing the setting while the VM is running is forbidden.
The dev... | 2.08128 | 2.032727 | 1.023885 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def set_bandwidth_group_for_device(self, name, controller_port, device, bandwidth_group) | Sets the bandwidth group of an existing storage device.
The device must already exist; see :py:func:`IMachine.attach_device`
for how to attach a new device.
The @a controllerPort and @a device parameters specify the device slot and
have have the same meaning as with :py:func:`I... | 2.30399 | 2.021034 | 1.140006 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def set_no_bandwidth_group_for_device(self, name, controller_port, device) | Sets no bandwidth group for an existing storage device.
The device must already exist; see :py:func:`IMachine.attach_device`
for how to attach a new device.
The @a controllerPort and @a device parameters specify the device slot and
have have the same meaning as with :py:func:`IMachine.a... | 2.614321 | 2.466873 | 1.059771 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def unmount_medium(self, name, controller_port, device, force) | Unmounts any currently mounted medium (:py:class:`IMedium` ,
identified by the given UUID @a id) to the given storage controller
(:py:class:`IStorageController` , identified by @a name),
at the indicated port and device. The device must already exist;
This method is intended onl... | 2.272314 | 2.26947 | 1.001253 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def mount_medium(self, name, controller_port, device, medium, force) | Mounts a medium (:py:class:`IMedium` , identified
by the given UUID @a id) to the given storage controller
(:py:class:`IStorageController` , identified by @a name),
at the indicated port and device. The device must already exist;
see :py:func:`IMachine.attach_device` for how to attach a... | 2.178006 | 2.020237 | 1.078094 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def get_medium(self, name, controller_port, device) | Returns the virtual medium attached to a device slot of the specified
bus.
Note that if the medium was indirectly attached by
:py:func:`mount_medium` to the given device slot then this
method will return not the same object as passed to the
:py:func:`mount_medium` call... | 2.791752 | 2.472465 | 1.129137 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
medium_attachments = self._call("getMediumAttachmentsOfController",
in_p=[name])
medium_attachments = [IMediumAttachment(a) for a in medium_attachment... | def get_medium_attachments_of_controller(self, name) | Returns an array of medium attachments which are attached to the
the controller with the given name.
in name of type str
return medium_attachments of type :class:`IMediumAttachment`
raises :class:`VBoxErrorObjectNotFound`
A storage controller with given name doesn't exist. | 4.799009 | 4.788575 | 1.002179 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(controller_port, baseinteger):
raise TypeError("controller_port can only be an instance of type baseinteger")
if not isinstance(device, basei... | def get_medium_attachment(self, name, controller_port, device) | Returns a medium attachment which corresponds to the controller with
the given name, on the given port and device slot.
in name of type str
in controller_port of type int
in device of type int
return attachment of type :class:`IMediumAttachment`
raises :class:`VBoxEr... | 2.793998 | 2.668049 | 1.047207 |
if not isinstance(host_address, baseinteger):
raise TypeError("host_address can only be an instance of type baseinteger")
if not isinstance(desired_guest_address, baseinteger):
raise TypeError("desired_guest_address can only be an instance of type baseinteger")
i... | def attach_host_pci_device(self, host_address, desired_guest_address, try_to_unbind) | Attaches host PCI device with the given (host) PCI address to the
PCI bus of the virtual machine. Please note, that this operation
is two phase, as real attachment will happen when VM will start,
and most information will be delivered as IHostPCIDevicePlugEvent
on IVirtualBox event sourc... | 2.324213 | 2.323382 | 1.000358 |
if not isinstance(host_address, baseinteger):
raise TypeError("host_address can only be an instance of type baseinteger")
self._call("detachHostPCIDevice",
in_p=[host_address]) | def detach_host_pci_device(self, host_address) | Detach host PCI device from the virtual machine.
Also HostPCIDevicePlugEvent on IVirtualBox event source
will be delivered. As currently we don't support hot device
unplug, IHostPCIDevicePlugEvent event is delivered immediately.
:py:class:`IHostPCIDevicePlugEvent`
in h... | 6.9659 | 8.449782 | 0.824388 |
if not isinstance(slot, baseinteger):
raise TypeError("slot can only be an instance of type baseinteger")
adapter = self._call("getNetworkAdapter",
in_p=[slot])
adapter = INetworkAdapter(adapter)
return adapter | def get_network_adapter(self, slot) | Returns the network adapter associated with the given slot.
Slots are numbered sequentially, starting with zero. The total
number of adapters per machine is defined by the
:py:func:`ISystemProperties.get_max_network_adapters` property,
so the maximum slot number is one less than that pr... | 6.979013 | 7.013103 | 0.995139 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
if not isinstance(connection_type, StorageBus):
raise TypeError("connection_type can only be an instance of type StorageBus")
controller = self._call("addStora... | def add_storage_controller(self, name, connection_type) | Adds a new storage controller (SCSI, SAS or SATA controller) to the
machine and returns it as an instance of
:py:class:`IStorageController` .
@a name identifies the controller for subsequent calls such as
:py:func:`get_storage_controller_by_name` ,
:py:func:`get_storage_... | 4.013206 | 3.075011 | 1.305103 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
storage_controller = self._call("getStorageControllerByName",
in_p=[name])
storage_controller = IStorageController(storage_controller)
return ... | def get_storage_controller_by_name(self, name) | Returns a storage controller with the given name.
in name of type str
return storage_controller of type :class:`IStorageController`
raises :class:`VBoxErrorObjectNotFound`
A storage controller with given name doesn't exist. | 4.711782 | 4.562956 | 1.032616 |
if not isinstance(connection_type, StorageBus):
raise TypeError("connection_type can only be an instance of type StorageBus")
if not isinstance(instance, baseinteger):
raise TypeError("instance can only be an instance of type baseinteger")
storage_controller = se... | def get_storage_controller_by_instance(self, connection_type, instance) | Returns a storage controller of a specific storage bus
with the given instance number.
in connection_type of type :class:`StorageBus`
in instance of type int
return storage_controller of type :class:`IStorageController`
raises :class:`VBoxErrorObjectNotFound`
A st... | 3.771269 | 2.871394 | 1.313393 |
if not isinstance(name, basestring):
raise TypeError("name can only be an instance of type basestring")
self._call("removeStorageController",
in_p=[name]) | def remove_storage_controller(self, name) | Removes a storage controller from the machine with all devices attached to it.
in name of type str
raises :class:`VBoxErrorObjectNotFound`
A storage controller with given name doesn't exist.
raises :class:`VBoxErrorNotSupported`
Medium format does not support s... | 7.319664 | 7.815573 | 0.936549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.