idx
int64
0
63k
question
stringlengths
61
4.03k
target
stringlengths
6
1.23k
9,000
def set_registers ( self , cpu_id , names , values ) : if not isinstance ( cpu_id , baseinteger ) : raise TypeError ( "cpu_id can only be an instance of type baseinteger" ) 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" ) if not isinstance ( values , list ) : raise TypeError ( "values can only be an instance of type list" ) for a in values [ : 10 ] : if not isinstance ( a , basestring ) : raise TypeError ( "array can only contain objects of type basestring" ) self . _call ( "setRegisters" , in_p = [ cpu_id , names , values ] )
Sets zero or more registers atomically . This feature is not implemented in the 4 . 0 . 0 release but may show up in a dot release .
9,001
def dump_guest_stack ( self , cpu_id ) : if not isinstance ( cpu_id , baseinteger ) : raise TypeError ( "cpu_id can only be an instance of type baseinteger" ) stack = self . _call ( "dumpGuestStack" , in_p = [ cpu_id ] ) return stack
Produce a simple stack dump using the current guest state . This feature is not implemented in the 4 . 0 . 0 release but may show up in a dot release .
9,002
def reset_stats ( self , pattern ) : if not isinstance ( pattern , basestring ) : raise TypeError ( "pattern can only be an instance of type basestring" ) self . _call ( "resetStats" , in_p = [ pattern ] )
Reset VM statistics .
9,003
def dump_stats ( self , pattern ) : if not isinstance ( pattern , basestring ) : raise TypeError ( "pattern can only be an instance of type basestring" ) self . _call ( "dumpStats" , in_p = [ pattern ] )
Dumps VM statistics .
9,004
def get_stats ( self , pattern , with_descriptions ) : if not isinstance ( pattern , basestring ) : raise TypeError ( "pattern can only be an instance of type basestring" ) if not isinstance ( with_descriptions , bool ) : raise TypeError ( "with_descriptions can only be an instance of type bool" ) stats = self . _call ( "getStats" , in_p = [ pattern , with_descriptions ] ) return stats
Get the VM statistics in a XMLish format .
9,005
def on_network_adapter_change ( self , network_adapter , change_adapter ) : if not isinstance ( network_adapter , INetworkAdapter ) : raise TypeError ( "network_adapter can only be an instance of type INetworkAdapter" ) if not isinstance ( change_adapter , bool ) : raise TypeError ( "change_adapter can only be an instance of type bool" ) self . _call ( "onNetworkAdapterChange" , in_p = [ network_adapter , change_adapter ] )
Triggered when settings of a network adapter of the associated virtual machine have changed .
9,006
def on_audio_adapter_change ( self , audio_adapter ) : if not isinstance ( audio_adapter , IAudioAdapter ) : raise TypeError ( "audio_adapter can only be an instance of type IAudioAdapter" ) self . _call ( "onAudioAdapterChange" , in_p = [ audio_adapter ] )
Triggerd when settings of the audio adapter of the associated virtual machine have changed .
9,007
def on_serial_port_change ( self , serial_port ) : if not isinstance ( serial_port , ISerialPort ) : raise TypeError ( "serial_port can only be an instance of type ISerialPort" ) self . _call ( "onSerialPortChange" , in_p = [ serial_port ] )
Triggered when settings of a serial port of the associated virtual machine have changed .
9,008
def on_parallel_port_change ( self , parallel_port ) : if not isinstance ( parallel_port , IParallelPort ) : raise TypeError ( "parallel_port can only be an instance of type IParallelPort" ) self . _call ( "onParallelPortChange" , in_p = [ parallel_port ] )
Triggered when settings of a parallel port of the associated virtual machine have changed .
9,009
def on_medium_change ( self , medium_attachment , force ) : if not isinstance ( medium_attachment , IMediumAttachment ) : raise TypeError ( "medium_attachment can only be an instance of type IMediumAttachment" ) if not isinstance ( force , bool ) : raise TypeError ( "force can only be an instance of type bool" ) self . _call ( "onMediumChange" , in_p = [ medium_attachment , force ] )
Triggered when attached media of the associated virtual machine have changed .
9,010
def on_storage_device_change ( self , medium_attachment , remove , silent ) : if not isinstance ( medium_attachment , IMediumAttachment ) : raise TypeError ( "medium_attachment can only be an instance of type IMediumAttachment" ) if not isinstance ( remove , bool ) : raise TypeError ( "remove can only be an instance of type bool" ) if not isinstance ( silent , bool ) : raise TypeError ( "silent can only be an instance of type bool" ) self . _call ( "onStorageDeviceChange" , in_p = [ medium_attachment , remove , silent ] )
Triggered when attached storage devices of the associated virtual machine have changed .
9,011
def on_vm_process_priority_change ( self , priority ) : if not isinstance ( priority , VMProcPriority ) : raise TypeError ( "priority can only be an instance of type VMProcPriority" ) self . _call ( "onVMProcessPriorityChange" , in_p = [ priority ] )
Triggered when process priority of the associated virtual machine have changed .
9,012
def on_clipboard_mode_change ( self , clipboard_mode ) : if not isinstance ( clipboard_mode , ClipboardMode ) : raise TypeError ( "clipboard_mode can only be an instance of type ClipboardMode" ) self . _call ( "onClipboardModeChange" , in_p = [ clipboard_mode ] )
Notification when the shared clipboard mode changes .
9,013
def on_dn_d_mode_change ( self , dnd_mode ) : if not isinstance ( dnd_mode , DnDMode ) : raise TypeError ( "dnd_mode can only be an instance of type DnDMode" ) self . _call ( "onDnDModeChange" , in_p = [ dnd_mode ] )
Notification when the drag n drop mode changes .
9,014
def on_cpu_change ( self , cpu , add ) : if not isinstance ( cpu , baseinteger ) : raise TypeError ( "cpu can only be an instance of type baseinteger" ) if not isinstance ( add , bool ) : raise TypeError ( "add can only be an instance of type bool" ) self . _call ( "onCPUChange" , in_p = [ cpu , add ] )
Notification when a CPU changes .
9,015
def on_cpu_execution_cap_change ( self , execution_cap ) : if not isinstance ( execution_cap , baseinteger ) : raise TypeError ( "execution_cap can only be an instance of type baseinteger" ) self . _call ( "onCPUExecutionCapChange" , in_p = [ execution_cap ] )
Notification when the CPU execution cap changes .
9,016
def on_vrde_server_change ( self , restart ) : if not isinstance ( restart , bool ) : raise TypeError ( "restart can only be an instance of type bool" ) self . _call ( "onVRDEServerChange" , in_p = [ restart ] )
Triggered when settings of the VRDE server object of the associated virtual machine have changed .
9,017
def on_recording_change ( self , enable ) : if not isinstance ( enable , bool ) : raise TypeError ( "enable can only be an instance of type bool" ) self . _call ( "onRecordingChange" , in_p = [ enable ] )
Triggered when recording settings have changed .
9,018
def on_bandwidth_group_change ( self , bandwidth_group ) : if not isinstance ( bandwidth_group , IBandwidthGroup ) : raise TypeError ( "bandwidth_group can only be an instance of type IBandwidthGroup" ) self . _call ( "onBandwidthGroupChange" , in_p = [ bandwidth_group ] )
Notification when one of the bandwidth groups change .
9,019
def online_merge_medium ( self , medium_attachment , source_idx , target_idx , progress ) : if not isinstance ( medium_attachment , IMediumAttachment ) : raise TypeError ( "medium_attachment can only be an instance of type IMediumAttachment" ) if not isinstance ( source_idx , baseinteger ) : raise TypeError ( "source_idx can only be an instance of type baseinteger" ) if not isinstance ( target_idx , baseinteger ) : raise TypeError ( "target_idx can only be an instance of type baseinteger" ) if not isinstance ( progress , IProgress ) : raise TypeError ( "progress can only be an instance of type IProgress" ) self . _call ( "onlineMergeMedium" , in_p = [ medium_attachment , source_idx , target_idx , progress ] )
Triggers online merging of a hard disk . Used internally when deleting a snapshot while a VM referring to the same hard disk chain is running .
9,020
def reconfigure_medium_attachments ( self , attachments ) : if not isinstance ( attachments , list ) : raise TypeError ( "attachments can only be an instance of type list" ) for a in attachments [ : 10 ] : if not isinstance ( a , IMediumAttachment ) : raise TypeError ( "array can only contain objects of type IMediumAttachment" ) self . _call ( "reconfigureMediumAttachments" , in_p = [ attachments ] )
Reconfigure all specified medium attachments in one go making sure the current state corresponds to the specified medium .
9,021
def enable_vmm_statistics ( self , enable ) : if not isinstance ( enable , bool ) : raise TypeError ( "enable can only be an instance of type bool" ) self . _call ( "enableVMMStatistics" , in_p = [ enable ] )
Enables or disables collection of VMM RAM statistics .
9,022
def set_network_settings ( self , mtu , sock_snd , sock_rcv , tcp_wnd_snd , tcp_wnd_rcv ) : if not isinstance ( mtu , baseinteger ) : raise TypeError ( "mtu can only be an instance of type baseinteger" ) if not isinstance ( sock_snd , baseinteger ) : raise TypeError ( "sock_snd can only be an instance of type baseinteger" ) if not isinstance ( sock_rcv , baseinteger ) : raise TypeError ( "sock_rcv can only be an instance of type baseinteger" ) if not isinstance ( tcp_wnd_snd , baseinteger ) : raise TypeError ( "tcp_wnd_snd can only be an instance of type baseinteger" ) if not isinstance ( tcp_wnd_rcv , baseinteger ) : raise TypeError ( "tcp_wnd_rcv can only be an instance of type baseinteger" ) self . _call ( "setNetworkSettings" , in_p = [ mtu , sock_snd , sock_rcv , tcp_wnd_snd , tcp_wnd_rcv ] )
Sets network configuration of the NAT engine .
9,023
def add_redirect ( self , name , proto , host_ip , host_port , guest_ip , guest_port ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) if not isinstance ( proto , NATProtocol ) : raise TypeError ( "proto can only be an instance of type NATProtocol" ) if not isinstance ( host_ip , basestring ) : raise TypeError ( "host_ip can only be an instance of type basestring" ) if not isinstance ( host_port , baseinteger ) : raise TypeError ( "host_port can only be an instance of type baseinteger" ) if not isinstance ( guest_ip , basestring ) : raise TypeError ( "guest_ip can only be an instance of type basestring" ) if not isinstance ( guest_port , baseinteger ) : raise TypeError ( "guest_port can only be an instance of type baseinteger" ) self . _call ( "addRedirect" , in_p = [ name , proto , host_ip , host_port , guest_ip , guest_port ] )
Adds a new NAT port - forwarding rule .
9,024
def remove_redirect ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) self . _call ( "removeRedirect" , in_p = [ name ] )
Removes a port - forwarding rule that was previously registered .
9,025
def query_license ( self , preferred_locale , preferred_language , format_p ) : if not isinstance ( preferred_locale , basestring ) : raise TypeError ( "preferred_locale can only be an instance of type basestring" ) if not isinstance ( preferred_language , basestring ) : raise TypeError ( "preferred_language can only be an instance of type basestring" ) if not isinstance ( format_p , basestring ) : raise TypeError ( "format_p can only be an instance of type basestring" ) license_text = self . _call ( "queryLicense" , in_p = [ preferred_locale , preferred_language , format_p ] ) return license_text
Full feature version of the license attribute .
9,026
def query_object ( self , obj_uuid ) : if not isinstance ( obj_uuid , basestring ) : raise TypeError ( "obj_uuid can only be an instance of type basestring" ) return_interface = self . _call ( "queryObject" , in_p = [ obj_uuid ] ) return_interface = Interface ( return_interface ) return return_interface
Queries the IUnknown interface to an object in the extension pack main module . This allows plug - ins and others to talk directly to an extension pack .
9,027
def install ( self , replace , display_info ) : if not isinstance ( replace , bool ) : raise TypeError ( "replace can only be an instance of type bool" ) if not isinstance ( display_info , basestring ) : raise TypeError ( "display_info can only be an instance of type basestring" ) progess = self . _call ( "install" , in_p = [ replace , display_info ] ) progess = IProgress ( progess ) return progess
Install the extension pack .
9,028
def find ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) return_data = self . _call ( "find" , in_p = [ name ] ) return_data = IExtPack ( return_data ) return return_data
Returns the extension pack with the specified name if found .
9,029
def open_ext_pack_file ( self , path ) : if not isinstance ( path , basestring ) : raise TypeError ( "path can only be an instance of type basestring" ) file_p = self . _call ( "openExtPackFile" , in_p = [ path ] ) file_p = IExtPackFile ( file_p ) return file_p
Attempts to open an extension pack file in preparation for installation .
9,030
def uninstall ( self , name , forced_removal , display_info ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) if not isinstance ( forced_removal , bool ) : raise TypeError ( "forced_removal can only be an instance of type bool" ) if not isinstance ( display_info , basestring ) : raise TypeError ( "display_info can only be an instance of type basestring" ) progess = self . _call ( "uninstall" , in_p = [ name , forced_removal , display_info ] ) progess = IProgress ( progess ) return progess
Uninstalls an extension pack removing all related files .
9,031
def query_all_plug_ins_for_frontend ( self , frontend_name ) : if not isinstance ( frontend_name , basestring ) : raise TypeError ( "frontend_name can only be an instance of type basestring" ) plug_in_modules = self . _call ( "queryAllPlugInsForFrontend" , in_p = [ frontend_name ] ) return plug_in_modules
Gets the path to all the plug - in modules for a given frontend . This is a convenience method that is intended to simplify the plug - in loading process for a frontend .
9,032
def is_ext_pack_usable ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) usable = self . _call ( "isExtPackUsable" , in_p = [ name ] ) return usable
Check if the given extension pack is loaded and usable .
9,033
def create_bandwidth_group ( self , name , type_p , max_bytes_per_sec ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) if not isinstance ( type_p , BandwidthGroupType ) : raise TypeError ( "type_p can only be an instance of type BandwidthGroupType" ) if not isinstance ( max_bytes_per_sec , baseinteger ) : raise TypeError ( "max_bytes_per_sec can only be an instance of type baseinteger" ) self . _call ( "createBandwidthGroup" , in_p = [ name , type_p , max_bytes_per_sec ] )
Creates a new bandwidth group .
9,034
def delete_bandwidth_group ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) self . _call ( "deleteBandwidthGroup" , in_p = [ name ] )
Deletes a new bandwidth group .
9,035
def get_bandwidth_group ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) bandwidth_group = self . _call ( "getBandwidthGroup" , in_p = [ name ] ) bandwidth_group = IBandwidthGroup ( bandwidth_group ) return bandwidth_group
Get a bandwidth group by name .
9,036
def get_all_bandwidth_groups ( self ) : bandwidth_groups = self . _call ( "getAllBandwidthGroups" ) bandwidth_groups = [ IBandwidthGroup ( a ) for a in bandwidth_groups ] return bandwidth_groups
Get all managed bandwidth groups .
9,037
def unregister_listener ( self , listener ) : if not isinstance ( listener , IEventListener ) : raise TypeError ( "listener can only be an instance of type IEventListener" ) self . _call ( "unregisterListener" , in_p = [ listener ] )
Unregister an event listener . If listener is passive and some waitable events are still in queue they are marked as processed automatically .
9,038
def fire_event ( self , event , timeout ) : if not isinstance ( event , IEvent ) : raise TypeError ( "event can only be an instance of type IEvent" ) if not isinstance ( timeout , baseinteger ) : raise TypeError ( "timeout can only be an instance of type baseinteger" ) result = self . _call ( "fireEvent" , in_p = [ event , timeout ] ) return result
Fire an event for this source .
9,039
def wait_processed ( self , timeout ) : if not isinstance ( timeout , baseinteger ) : raise TypeError ( "timeout can only be an instance of type baseinteger" ) result = self . _call ( "waitProcessed" , in_p = [ timeout ] ) return result
Wait until time outs or this event is processed . Event must be waitable for this operation to have described semantics for non - waitable returns true immediately .
9,040
def add_veto ( self , reason ) : if not isinstance ( reason , basestring ) : raise TypeError ( "reason can only be an instance of type basestring" ) self . _call ( "addVeto" , in_p = [ reason ] )
Adds a veto on this event .
9,041
def add_approval ( self , reason ) : if not isinstance ( reason , basestring ) : raise TypeError ( "reason can only be an instance of type basestring" ) self . _call ( "addApproval" , in_p = [ reason ] )
Adds an approval on this event .
9,042
def export_launch_vm ( self , description , progress , virtual_box ) : if not isinstance ( description , IVirtualSystemDescription ) : raise TypeError ( "description can only be an instance of type IVirtualSystemDescription" ) if not isinstance ( progress , IProgress ) : raise TypeError ( "progress can only be an instance of type IProgress" ) if not isinstance ( virtual_box , IVirtualBox ) : raise TypeError ( "virtual_box can only be an instance of type IVirtualBox" ) self . _call ( "exportLaunchVM" , in_p = [ description , progress , virtual_box ] )
Exports and optionally launch a VM described in description parameter
9,043
def list_instances ( self , machine_state ) : if not isinstance ( machine_state , CloudMachineState ) : raise TypeError ( "machine_state can only be an instance of type CloudMachineState" ) ( return_ids , return_names ) = self . _call ( "listInstances" , in_p = [ machine_state ] ) return ( return_ids , return_names )
Returns the list of the instances in the Cloud .
9,044
def list_images ( self , image_state ) : if not isinstance ( image_state , CloudImageState ) : raise TypeError ( "image_state can only be an instance of type CloudImageState" ) ( return_ids , return_names ) = self . _call ( "listImages" , in_p = [ image_state ] ) return ( return_ids , return_names )
Returns the list of the images in the Cloud .
9,045
def get_property_description ( self , name ) : if not isinstance ( name , basestring ) : raise TypeError ( "name can only be an instance of type basestring" ) description = self . _call ( "getPropertyDescription" , in_p = [ name ] ) return description
Property name .
9,046
def create_profile ( self , profile_name , names , values ) : if not isinstance ( profile_name , basestring ) : raise TypeError ( "profile_name can only be an instance of type basestring" ) 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" ) if not isinstance ( values , list ) : raise TypeError ( "values can only be an instance of type list" ) for a in values [ : 10 ] : if not isinstance ( a , basestring ) : raise TypeError ( "array can only contain objects of type basestring" ) self . _call ( "createProfile" , in_p = [ profile_name , names , values ] )
Creates a new profile .
9,047
def register_on_guest_mouse ( self , callback ) : event_type = library . VBoxEventType . on_guest_mouse return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on guest mouse events .
9,048
def put_keys ( self , press_keys = None , hold_keys = None , press_delay = 50 ) : if press_keys is None : press_keys = [ ] if hold_keys is None : hold_keys = [ ] release_codes = set ( ) put_codes = set ( ) try : for k in hold_keys : put , release = self . SCANCODES [ k ] put = set ( put ) - put_codes self . put_scancodes ( list ( put ) ) put_codes . update ( put ) release_codes . update ( release ) for k in press_keys : put , release = self . SCANCODES [ k ] _put = set ( put ) - put_codes if not _put : continue release = set ( release ) - release_codes if not release : continue self . put_scancodes ( list ( put ) + list ( release ) ) time . sleep ( press_delay / 1000.0 ) finally : for code in release_codes : self . put_scancode ( code )
Put scancodes that represent keys defined in the sequences provided .
9,049
def register_on_guest_keyboard ( self , callback ) : return self . event_source . register_callback ( callback , library . VBoxEventType . on_guest_keyboard )
Set the callback function to consume on guest keyboard events
9,050
def execute ( self , command , arguments = None , stdin = "" , environment = None , flags = None , priority = library . ProcessPriority . default , affinity = None , timeout_ms = 0 ) : if arguments is None : arguments = [ ] if environment is None : environment = [ ] if flags is None : flags = [ library . ProcessCreateFlag . wait_for_std_err , library . ProcessCreateFlag . wait_for_std_out , library . ProcessCreateFlag . ignore_orphaned_processes ] if affinity is None : affinity = [ ] def read_out ( process , flags , stdout , stderr ) : if library . ProcessCreateFlag . wait_for_std_err in flags : process . wait_for ( int ( library . ProcessWaitResult . std_err ) ) e = utils . to_bytes ( process . read ( 2 , 65000 , 0 ) ) stderr . append ( e ) if library . ProcessCreateFlag . wait_for_std_out in flags : process . wait_for ( int ( library . ProcessWaitResult . std_out ) ) o = utils . to_bytes ( process . read ( 1 , 65000 , 0 ) ) stdout . append ( o ) process = self . process_create_ex ( command , [ command ] + arguments , environment , flags , timeout_ms , priority , affinity ) process . wait_for ( int ( library . ProcessWaitResult . start ) , 0 ) if stdin : process . wait_for ( int ( library . ProcessWaitResult . std_in ) , 0 ) index = 0 flag_none = [ library . ProcessInputFlag . none ] flag_eof = [ library . ProcessInputFlag . end_of_file ] while index < len ( stdin ) : array = map ( lambda a : str ( ord ( a ) ) , stdin [ index : ] ) wrote = process . write_array ( 0 , flag_none , array , 0 ) if wrote == 0 : raise Exception ( "Failed to write ANY bytes to %s" % process ) index += wrote process . write_array ( 0 , flag_eof , [ ] , 0 ) stdout = [ ] stderr = [ ] while process . status == library . ProcessStatus . started : read_out ( process , flags , stdout , stderr ) time . sleep ( 0.2 ) read_out ( process , flags , stdout , stderr ) return process , b"" . join ( stdout ) , b"" . join ( stderr )
Execute a command in the Guest
9,051
def path_exists ( self , path , follow_symlinks = True ) : "test if path exists" return ( self . file_exists ( path , follow_symlinks ) or self . symlink_exists ( path , follow_symlinks ) or self . directory_exists ( path , follow_symlinks ) )
test if path exists
9,052
def read ( self , ova_path ) : "Read and interpret ova file into this Appliance object." p = super ( IAppliance , self ) . read ( ova_path ) p . wait_for_completion ( ) self . interpret ( ) warnings = self . get_warnings ( ) if warnings : warning = Warning ( "\n" . join ( warnings ) ) warning . warnings = warnings raise warning
Read and interpret ova file into this Appliance object .
9,053
def find_description ( self , name ) : "Find a description for the given appliance name." for desc in self . virtual_system_descriptions : values = desc . get_values_by_type ( DescType . name , DescValueType . original ) if name in values : break else : raise Exception ( "Failed to find description for %s" % name ) return desc
Find a description for the given appliance name .
9,054
def get_vbox_version ( config_kmk ) : "Return the vbox config major, minor, build" with open ( config_kmk , 'rb' ) as f : config = f . read ( ) major = b"6" minor = b"0" build = b"4" return b"." . join ( [ major , minor , build ] )
Return the vbox config major minor build
9,055
def register_on_machine_state_changed ( self , callback ) : event_type = library . VBoxEventType . on_machine_state_changed return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on machine state changed events .
9,056
def register_on_machine_data_changed ( self , callback ) : event_type = library . VBoxEventType . on_machine_data_changed return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on machine data changed events .
9,057
def register_on_machine_registered ( self , callback ) : event_type = library . VBoxEventType . on_machine_registered return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on machine registered events .
9,058
def register_on_snapshot_deleted ( self , callback ) : event_type = library . VBoxEventType . on_snapshot_deleted return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on snapshot deleted events .
9,059
def register_on_snapshot_taken ( self , callback ) : event_type = library . VBoxEventType . on_snapshot_taken return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on snapshot taken events .
9,060
def register_on_snapshot_changed ( self , callback ) : event_type = library . VBoxEventType . on_snapshot_changed return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on snapshot changed events which occur when snapshot properties have been changed .
9,061
def register_on_guest_property_changed ( self , callback ) : event_type = library . VBoxEventType . on_guest_property_changed return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on guest property changed events .
9,062
def register_on_session_state_changed ( self , callback ) : event_type = library . VBoxEventType . on_session_state_changed return self . event_source . register_callback ( callback , event_type )
Set the callback function to consume on session state changed events .
9,063
def type_to_interface ( event_type ) : global _lookup if not isinstance ( event_type , library . VBoxEventType ) : raise TypeError ( "event_type was not of VBoxEventType" ) if not _lookup : for attr in dir ( library ) : event_interface = getattr ( library , attr ) if not inspect . isclass ( event_interface ) : continue if not issubclass ( event_interface , library . Interface ) : continue et = getattr ( event_interface , 'id' , None ) if et is None : continue if not isinstance ( et , library . VBoxEventType ) : continue _lookup [ int ( et ) ] = event_interface return _lookup [ int ( event_type ) ]
Return the event interface object that corresponds to the event type enumeration
9,064
def register_callback ( callback , event_source , event_type ) : global _callbacks event_interface = type_to_interface ( event_type ) listener = event_source . create_listener ( ) event_source . register_listener ( listener , [ event_type ] , False ) quit = threading . Event ( ) t = threading . Thread ( target = _event_monitor , args = ( callback , event_source , listener , event_interface , quit ) ) t . daemon = True t . start ( ) while t . is_alive ( ) is False : continue _callbacks [ t . ident ] = ( t , quit ) return t . ident
register a callback function against an event_source for a given event_type .
9,065
def unregister_callback ( callback_id ) : global _callbacks obj = _callbacks . pop ( callback_id , None ) threads = [ ] if obj is not None : t , quit = obj quit . set ( ) threads . append ( t ) for t in threads : t . join ( )
unregister a callback registration
9,066
def remove ( self , delete = True ) : if self . state >= library . MachineState . running : session = virtualbox . Session ( ) self . lock_machine ( session , library . LockType . shared ) try : progress = session . console . power_down ( ) progress . wait_for_completion ( - 1 ) except Exception : print ( "Error powering off machine" , file = sys . stderr ) session . unlock_machine ( ) time . sleep ( 0.5 ) settings_dir = os . path . dirname ( self . settings_file_path ) if delete : option = library . CleanupMode . detach_all_return_hard_disks_only else : option = library . CleanupMode . detach_all_return_none media = self . unregister ( option ) if delete : progress = self . delete_config ( media ) progress . wait_for_completion ( - 1 ) media = [ ] if delete and os . path . exists ( settings_dir ) : shutil . rmtree ( settings_dir ) return media
Unregister and optionally delete associated config
9,067
def clone ( self , snapshot_name_or_id = None , mode = library . CloneMode . machine_state , options = None , name = None , uuid = None , groups = None , basefolder = '' , register = True ) : if options is None : options = [ library . CloneOptions . link ] if groups is None : groups = [ ] vbox = virtualbox . VirtualBox ( ) if snapshot_name_or_id is not None : if isinstance ( snapshot_name_or_id , basestring ) : snapshot = self . find_snapshot ( snapshot_name_or_id ) else : snapshot = snapshot_name_or_id vm = snapshot . machine else : if library . CloneOptions . link in options : vm = self . current_snapshot . machine else : vm = self if name is None : name = "%s Clone" % vm . name create_flags = '' if uuid is not None : create_flags = "UUID=%s" % uuid primary_group = '' if groups : primary_group = groups [ 0 ] test_name = name settings_file = '' for i in range ( 1 , 1000 ) : settings_file = vbox . compose_machine_filename ( test_name , primary_group , create_flags , basefolder ) if not os . path . exists ( os . path . dirname ( settings_file ) ) : break test_name = "%s (%s)" % ( name , i ) name = test_name vm_clone = vbox . create_machine ( settings_file , name , groups , '' , create_flags ) progress = vm . clone_to ( vm_clone , mode , options ) progress . wait_for_completion ( - 1 ) if register : vbox . register_machine ( vm_clone ) return vm_clone
Clone this Machine
9,068
def create_session ( self , lock_type = library . LockType . shared , session = None ) : if session is None : session = library . ISession ( ) error = None for _ in range ( 10 ) : try : self . lock_machine ( session , lock_type ) except Exception as exc : error = exc time . sleep ( 1 ) continue else : break else : if error is not None : raise Exception ( "Failed to create clone - %s" % error ) return session
Lock this machine
9,069
def set_final_value ( self , description_type , value ) : types , _ , _ , vbox_values , extra_config = self . get_description ( ) for offset , t in enumerate ( types ) : if t == description_type : break else : raise Exception ( "Failed to find type for %s" % description_type ) enabled = [ True ] * len ( types ) vbox_values = list ( vbox_values ) extra_config = list ( extra_config ) if isinstance ( value , basestring ) : final_value = value elif isinstance ( value , Enum ) : final_value = str ( value . _value ) elif isinstance ( value , int ) : final_value = str ( value ) else : raise ValueError ( "Incorrect value type." ) vbox_values [ offset ] = final_value self . set_final_values ( enabled , vbox_values , extra_config )
Set the value for the given description type .
9,070
def chain_return_value ( future , loop , return_value ) : chained = asyncio . Future ( loop = loop ) def copy ( _future ) : if _future . exception ( ) is not None : chained . set_exception ( _future . exception ( ) ) else : chained . set_result ( return_value ) future . _future . add_done_callback ( functools . partial ( loop . add_callback , copy ) ) return chained
Compatible way to return a value in all Pythons .
9,071
def pymongo_class_wrapper ( f , pymongo_class ) : @ functools . wraps ( f ) @ coroutine def _wrapper ( self , * args , ** kwargs ) : result = yield f ( self , * args , ** kwargs ) if result . __class__ == pymongo_class : raise gen . Return ( self . wrap ( result ) ) else : raise gen . Return ( result ) return _wrapper
Executes the coroutine f and wraps its result in a Motor class .
9,072
def aggregate ( self , pipeline , ** kwargs ) : cursor_class = create_class_with_framework ( AgnosticLatentCommandCursor , self . _framework , self . __module__ ) return cursor_class ( self , self . _async_aggregate , pipeline , ** unwrap_kwargs_session ( kwargs ) )
Execute an aggregation pipeline on this collection .
9,073
def _get_more ( self ) : if not self . alive : raise pymongo . errors . InvalidOperation ( "Can't call get_more() on a MotorCursor that has been" " exhausted or killed." ) self . started = True return self . _refresh ( )
Initial query or getMore . Returns a Future .
9,074
def to_list ( self , length ) : if length is not None : if not isinstance ( length , int ) : raise TypeError ( 'length must be an int, not %r' % length ) elif length < 0 : raise ValueError ( 'length must be non-negative' ) if self . _query_flags ( ) & _QUERY_OPTIONS [ 'tailable_cursor' ] : raise pymongo . errors . InvalidOperation ( "Can't call to_list on tailable cursor" ) future = self . _framework . get_future ( self . get_io_loop ( ) ) if not self . alive : future . set_result ( [ ] ) else : the_list = [ ] self . _framework . add_future ( self . get_io_loop ( ) , self . _get_more ( ) , self . _to_list , length , the_list , future ) return future
Get a list of documents .
9,075
def close ( self ) : if self . delegate : return self . _close ( ) future = self . _framework . get_future ( self . get_io_loop ( ) ) future . set_result ( None ) return future
Close this change stream .
9,076
def asynchronize ( framework , sync_method , doc = None , wrap_class = None , unwrap_class = None ) : @ functools . wraps ( sync_method ) def method ( self , * args , ** kwargs ) : if unwrap_class is not None : unwrapped_args = [ obj . delegate if obj . __class__ . __name__ . endswith ( ( unwrap_class , 'MotorClientSession' ) ) else obj for obj in args ] unwrapped_kwargs = { key : ( obj . delegate if obj . __class__ . __name__ . endswith ( ( unwrap_class , 'MotorClientSession' ) ) else obj ) for key , obj in kwargs . items ( ) } else : unwrapped_args = [ obj . delegate if obj . __class__ . __name__ . endswith ( 'MotorClientSession' ) else obj for obj in args ] unwrapped_kwargs = { key : ( obj . delegate if obj . __class__ . __name__ . endswith ( 'MotorClientSession' ) else obj ) for key , obj in kwargs . items ( ) } loop = self . get_io_loop ( ) return framework . run_on_executor ( loop , sync_method , self . delegate , * unwrapped_args , ** unwrapped_kwargs ) if wrap_class is not None : method = framework . pymongo_class_wrapper ( method , wrap_class ) method . is_wrap_method = True method . is_async_method = True name = sync_method . __name__ method . pymongo_method_name = name if doc is not None : method . __doc__ = doc return method
Decorate sync_method so it returns a Future .
9,077
def wrap_synchro ( fn ) : @ functools . wraps ( fn ) def _wrap_synchro ( * args , ** kwargs ) : motor_obj = fn ( * args , ** kwargs ) if isinstance ( motor_obj , motor . MotorCollection ) : client = MongoClient ( delegate = motor_obj . database . client ) database = Database ( client , motor_obj . database . name ) return Collection ( database , motor_obj . name , delegate = motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorClientSession ) : return ClientSession ( delegate = motor_obj ) if isinstance ( motor_obj , _MotorTransactionContext ) : return _SynchroTransactionContext ( motor_obj ) if isinstance ( motor_obj , motor . MotorDatabase ) : client = MongoClient ( delegate = motor_obj . client ) return Database ( client , motor_obj . name , delegate = motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorChangeStream ) : return ChangeStream ( motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorLatentCommandCursor ) : return CommandCursor ( motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorCommandCursor ) : return CommandCursor ( motor_obj ) if isinstance ( motor_obj , _MotorRawBatchCommandCursor ) : return CommandCursor ( motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorCursor ) : return Cursor ( motor_obj ) if isinstance ( motor_obj , _MotorRawBatchCursor ) : return Cursor ( motor_obj ) if isinstance ( motor_obj , motor . MotorGridIn ) : return GridIn ( None , delegate = motor_obj ) if isinstance ( motor_obj , motor . MotorGridOut ) : return GridOut ( None , delegate = motor_obj ) if isinstance ( motor_obj , motor . motor_tornado . MotorGridOutCursor ) : return GridOutCursor ( motor_obj ) else : return motor_obj return _wrap_synchro
If decorated Synchro function returns a Motor object wrap in a Synchro object .
9,078
def unwrap_synchro ( fn ) : @ functools . wraps ( fn ) def _unwrap_synchro ( * args , ** kwargs ) : def _unwrap_obj ( obj ) : if isinstance ( obj , Synchro ) : return obj . delegate else : return obj args = [ _unwrap_obj ( arg ) for arg in args ] kwargs = dict ( [ ( key , _unwrap_obj ( value ) ) for key , value in kwargs . items ( ) ] ) return fn ( * args , ** kwargs ) return _unwrap_synchro
Unwrap Synchro objects passed to a method and pass Motor objects instead .
9,079
def open ( self ) : return self . _framework . chain_return_value ( self . _ensure_file ( ) , self . get_io_loop ( ) , self )
Retrieve this file s attributes from the server .
9,080
def find ( self , * args , ** kwargs ) : cursor = self . delegate . find ( * args , ** kwargs ) grid_out_cursor = create_class_with_framework ( AgnosticGridOutCursor , self . _framework , self . __module__ ) return grid_out_cursor ( cursor , self . collection )
Find and return the files collection documents that match filter .
9,081
def get_motor_attr ( motor_class , name , * defargs ) : attr = safe_getattr ( motor_class , name ) full_name = '%s.%s.%s' % ( motor_class . __module__ , motor_class . __name__ , name ) full_name_legacy = 'motor.%s.%s.%s' % ( motor_class . __module__ , motor_class . __name__ , name ) has_coroutine_annotation = getattr ( attr , 'coroutine_annotation' , False ) is_async_method = getattr ( attr , 'is_async_method' , False ) is_cursor_method = getattr ( attr , 'is_motorcursor_chaining_method' , False ) if is_async_method or is_cursor_method : pymongo_method = getattr ( motor_class . __delegate_class__ , attr . pymongo_method_name ) else : pymongo_method = None is_pymongo_doc = pymongo_method and attr . __doc__ == pymongo_method . __doc__ motor_info [ full_name ] = motor_info [ full_name_legacy ] = { 'is_async_method' : is_async_method or has_coroutine_annotation , 'is_pymongo_docstring' : is_pymongo_doc , 'pymongo_method' : pymongo_method , } return attr
If any Motor attributes can t be accessed grab the equivalent PyMongo attribute . While we re at it store some info about each attribute in the global motor_info dict .
9,082
def get_attached_instruments ( self , expected : Dict [ Mount , str ] ) -> Dict [ Mount , Dict [ str , Optional [ str ] ] ] : to_return : Dict [ Mount , Dict [ str , Optional [ str ] ] ] = { } for mount in Mount : found_model = self . _smoothie_driver . read_pipette_model ( mount . name . lower ( ) ) found_id = self . _smoothie_driver . read_pipette_id ( mount . name . lower ( ) ) expected_instr = expected . get ( mount , None ) if expected_instr and ( not found_model or not found_model . startswith ( expected_instr ) ) : raise RuntimeError ( 'mount {}: instrument {} was requested but {} is present' . format ( mount . name , expected_instr , found_model ) ) to_return [ mount ] = { 'model' : found_model , 'id' : found_id } return to_return
Find the instruments attached to our mounts .
9,083
def probe ( self , axis : str , distance : float ) -> Dict [ str , float ] : return self . _smoothie_driver . probe_axis ( axis , distance )
Run a probe and return the new position dict
9,084
async def delay ( self , duration_s : int ) : self . pause ( ) await asyncio . sleep ( duration_s ) self . resume ( )
Pause and sleep
9,085
def init_pipette ( ) : global session pipette_info = set_current_mount ( session . adapter , session ) pipette = pipette_info [ 'pipette' ] res = { } if pipette : session . current_model = pipette_info [ 'model' ] if not feature_flags . use_protocol_api_v2 ( ) : mount = pipette . mount session . current_mount = mount else : mount = pipette . get ( 'mount' ) session . current_mount = mount_by_name [ mount ] session . pipettes [ mount ] = pipette res = { 'mount' : mount , 'model' : pipette_info [ 'model' ] } log . info ( "Pipette info {}" . format ( session . pipettes ) ) return res
Finds pipettes attached to the robot currently and chooses the correct one to add to the session .
9,086
def set_current_mount ( hardware , session ) : pipette = None right_channel = None left_channel = None right_pipette , left_pipette = get_pipettes ( hardware ) if right_pipette : if not feature_flags . use_protocol_api_v2 ( ) : right_channel = right_pipette . channels else : right_channel = right_pipette . get ( 'channels' ) right_pipette [ 'mount' ] = 'right' if left_pipette : if not feature_flags . use_protocol_api_v2 ( ) : left_channel = left_pipette . channels else : left_channel = left_pipette . get ( 'channels' ) left_pipette [ 'mount' ] = 'left' if right_channel == 1 : pipette = right_pipette elif left_channel == 1 : pipette = left_pipette elif right_pipette : pipette = right_pipette session . cp = CriticalPoint . FRONT_NOZZLE elif left_pipette : pipette = left_pipette session . cp = CriticalPoint . FRONT_NOZZLE model , id = _get_model_name ( pipette , hardware ) session . pipette_id = id return { 'pipette' : pipette , 'model' : model }
Choose the pipette in which to execute commands . If there is no pipette or it is uncommissioned the pipette is not mounted .
9,087
async def attach_tip ( data ) : global session tip_length = data . get ( 'tipLength' ) if not tip_length : message = 'Error: "tipLength" must be specified in request' status = 400 else : if not feature_flags . use_protocol_api_v2 ( ) : pipette = session . pipettes [ session . current_mount ] if pipette . tip_attached : log . warning ( 'attach tip called while tip already attached' ) pipette . _remove_tip ( pipette . _tip_length ) pipette . _add_tip ( tip_length ) else : session . adapter . add_tip ( session . current_mount , tip_length ) if session . cp : session . cp = CriticalPoint . FRONT_NOZZLE session . tip_length = tip_length message = "Tip length set: {}" . format ( tip_length ) status = 200 return web . json_response ( { 'message' : message } , status = status )
Attach a tip to the current pipette
9,088
async def detach_tip ( data ) : global session if not feature_flags . use_protocol_api_v2 ( ) : pipette = session . pipettes [ session . current_mount ] if not pipette . tip_attached : log . warning ( 'detach tip called with no tip' ) pipette . _remove_tip ( session . tip_length ) else : session . adapter . remove_tip ( session . current_mount ) if session . cp : session . cp = CriticalPoint . NOZZLE session . tip_length = None return web . json_response ( { 'message' : "Tip removed" } , status = 200 )
Detach the tip from the current pipette
9,089
async def run_jog ( data ) : axis = data . get ( 'axis' ) direction = data . get ( 'direction' ) step = data . get ( 'step' ) if axis not in ( 'x' , 'y' , 'z' ) : message = '"axis" must be "x", "y", or "z"' status = 400 elif direction not in ( - 1 , 1 ) : message = '"direction" must be -1 or 1' status = 400 elif step is None : message = '"step" must be specified' status = 400 else : position = jog ( axis , direction , step , session . adapter , session . current_mount , session . cp ) message = 'Jogged to {}' . format ( position ) status = 200 return web . json_response ( { 'message' : message } , status = status )
Allow the user to jog the selected pipette around the deck map
9,090
async def move ( data ) : global session point_name = data . get ( 'point' ) point = safe_points ( ) . get ( point_name ) if point and len ( point ) == 3 : if not feature_flags . use_protocol_api_v2 ( ) : pipette = session . pipettes [ session . current_mount ] channels = pipette . channels if not channels == 1 : x = point [ 0 ] y = point [ 1 ] + pipette_config . Y_OFFSET_MULTI * 2 z = point [ 2 ] point = ( x , y , z ) pipette . move_to ( ( session . adapter . deck , point ) , strategy = 'arc' ) else : if not point_name == 'attachTip' : intermediate_pos = position ( session . current_mount , session . adapter , session . cp ) session . adapter . move_to ( session . current_mount , Point ( x = intermediate_pos [ 0 ] , y = intermediate_pos [ 1 ] , z = session . tip_length ) , critical_point = session . cp ) session . adapter . move_to ( session . current_mount , Point ( x = point [ 0 ] , y = point [ 1 ] , z = session . tip_length ) , critical_point = session . cp ) session . adapter . move_to ( session . current_mount , Point ( x = point [ 0 ] , y = point [ 1 ] , z = point [ 2 ] ) , critical_point = session . cp ) else : if session . cp : session . cp = CriticalPoint . NOZZLE session . adapter . move_to ( session . current_mount , Point ( x = point [ 0 ] , y = point [ 1 ] , z = point [ 2 ] ) , critical_point = session . cp ) message = 'Moved to {}' . format ( point ) status = 200 else : message = '"point" must be one of "1", "2", "3", "safeZ", "attachTip"' status = 400 return web . json_response ( { 'message' : message } , status = status )
Allow the user to move the selected pipette to a specific point
9,091
async def save_xy ( data ) : global session valid_points = list ( session . points . keys ( ) ) point = data . get ( 'point' ) if point not in valid_points : message = 'point must be one of {}' . format ( valid_points ) status = 400 elif not session . current_mount : message = "Mount must be set before calibrating" status = 400 else : if not feature_flags . use_protocol_api_v2 ( ) : mount = 'Z' if session . current_mount == 'left' else 'A' x , y , _ = position ( mount , session . adapter ) if session . pipettes [ session . current_mount ] . channels != 1 : y = y - pipette_config . Y_OFFSET_MULTI if session . current_mount == 'left' : dx , dy , _ = session . adapter . config . mount_offset x = x + dx y = y + dy else : x , y , _ = position ( session . current_mount , session . adapter , session . cp ) session . points [ point ] = ( x , y ) message = "Saved point {} value: {}" . format ( point , session . points [ point ] ) status = 200 return web . json_response ( { 'message' : message } , status = status )
Save the current XY values for the calibration data
9,092
async def save_z ( data ) : if not session . tip_length : message = "Tip length must be set before calibrating" status = 400 else : if not feature_flags . use_protocol_api_v2 ( ) : mount = 'Z' if session . current_mount == 'left' else 'A' actual_z = position ( mount , session . adapter ) [ - 1 ] length_offset = pipette_config . load ( session . current_model , session . pipette_id ) . model_offset [ - 1 ] session . z_value = actual_z - session . tip_length + length_offset else : session . z_value = position ( session . current_mount , session . adapter , session . cp ) [ - 1 ] message = "Saved z: {}" . format ( session . z_value ) status = 200 return web . json_response ( { 'message' : message } , status = status )
Save the current Z height value for the calibration data
9,093
async def release ( data ) : global session if not feature_flags . use_protocol_api_v2 ( ) : session . adapter . remove_instrument ( 'left' ) session . adapter . remove_instrument ( 'right' ) else : session . adapter . cache_instruments ( ) session = None return web . json_response ( { "message" : "calibration session released" } )
Release a session
9,094
async def dispatch ( request ) : if session : message = '' data = await request . json ( ) try : log . info ( "Dispatching {}" . format ( data ) ) _id = data . get ( 'token' ) if not _id : message = '"token" field required for calibration requests' raise AssertionError command = data . get ( 'command' ) if not command : message = '"command" field required for calibration requests' raise AssertionError if _id == session . id : res = await router [ command ] ( data ) else : res = web . json_response ( { 'message' : 'Invalid token: {}' . format ( _id ) } , status = 403 ) except AssertionError : res = web . json_response ( { 'message' : message } , status = 400 ) except Exception as e : res = web . json_response ( { 'message' : 'Exception {} raised by dispatch of {}: {}' . format ( type ( e ) , data , e ) } , status = 500 ) else : res = web . json_response ( { 'message' : 'Session must be started before issuing commands' } , status = 418 ) return res
Routes commands to subhandlers based on the command field in the body .
9,095
def _serial_poller ( self ) : while True : _next = dict ( self . _poller . poll ( POLLING_FREQUENCY_MS ) ) if self . _halt_read_file . fileno ( ) in _next : log . debug ( "Poller [{}]: halt" . format ( hash ( self ) ) ) self . _halt_read_file . read ( ) break elif self . _connection . fileno ( ) in _next : log . debug ( "Poller [{}]: interrupt" . format ( hash ( self ) ) ) res = self . _connection . read_until ( SERIAL_ACK ) self . _interrupt_callback ( res ) elif self . _send_read_file . fileno ( ) in _next : self . _send_read_file . read ( 1 ) command , callback = self . _command_queue . get ( ) log . debug ( "Poller [{}]: send {}" . format ( hash ( self ) , command ) ) res = self . _send_command ( command ) callback ( res ) else : log . debug ( "Poller [{}]: updating temp" . format ( hash ( self ) ) ) res = self . _send_command ( GCODES [ 'GET_PLATE_TEMP' ] ) self . _status_callback ( res ) log . info ( "Exiting TC poller loop [{}]" . format ( hash ( self ) ) )
Priority - sorted list of checks
9,096
def disconnect ( self ) : if self . _poll_stop_event : self . _poll_stop_event . set ( ) if self . _driver : if self . status != 'idle' : self . deactivate ( ) self . _driver . disconnect ( )
Disconnect from the serial port
9,097
def temp_connect ( self , hardware : hc . API ) : old_hw = self . _hw_manager . hardware try : self . _hw_manager . set_hw ( hardware ) yield self finally : self . _hw_manager . set_hw ( old_hw )
Connect temporarily to the specified hardware controller .
9,098
def connect ( self , hardware : hc . API ) : self . _hw_manager . set_hw ( hardware ) self . _hw_manager . hardware . cache_instruments ( )
Connect to a running hardware API .
9,099
def load_labware ( self , labware_obj : Labware , location : types . DeckLocation ) -> Labware : self . _deck_layout [ location ] = labware_obj return labware_obj
Specify the presence of a piece of labware on the OT2 deck .