def create_machine(self, name=None, package=None, dataset=None,<EOL>metadata=None, tags=None, boot_script=None, credentials=False,<EOL>image=None, networks=None):
params = {}<EOL>if name:<EOL><INDENT>assert re.match(r'<STR_LIT>',<EOL>name), "<STR_LIT>"<EOL>params['<STR_LIT:name>'] = name<EOL><DEDENT>if package:<EOL><INDENT>if isinstance(package, dict):<EOL><INDENT>package = package['<STR_LIT:name>']<EOL><DEDENT>params['<STR_LIT>'] = package<EOL><DEDENT>if image:<EOL><INDENT>if isinstance(image, dict):<EOL><INDENT>image = image['<STR_LIT:id>']<EOL><DEDENT>params['<STR_LIT:image>'] = image<EOL><DEDENT>if dataset and not image:<EOL><INDENT>if isinstance(dataset, dict):<EOL><INDENT>dataset = dataset.get('<STR_LIT:id>', dataset['<STR_LIT>'])<EOL><DEDENT>params['<STR_LIT>'] = dataset<EOL><DEDENT>if metadata:<EOL><INDENT>for k, v in metadata.items():<EOL><INDENT>params['<STR_LIT>' + str(k)] = v<EOL><DEDENT><DEDENT>if tags:<EOL><INDENT>for k, v in tags.items():<EOL><INDENT>params['<STR_LIT>' + str(k)] = v<EOL><DEDENT><DEDENT>if boot_script:<EOL><INDENT>with open(boot_script) as f:<EOL><INDENT>params['<STR_LIT>'] = f.read()<EOL><DEDENT><DEDENT>if networks:<EOL><INDENT>if isinstance(networks, list):<EOL><INDENT>params['<STR_LIT>'] = networks<EOL><DEDENT>elif isinstance(networks, basestring):<EOL><INDENT>params['<STR_LIT>'] = [networks]<EOL><DEDENT><DEDENT>j, r = self.request('<STR_LIT:POST>', '<STR_LIT>', data=params)<EOL>if r.status_code >= <NUM_LIT>:<EOL><INDENT>print(j, file=sys.stderr)<EOL>r.raise_for_status()<EOL><DEDENT>return Machine(datacenter=self, data=j)<EOL>
::

    POST /:login/machines

Provision a machine in the current 
:py:class:`smartdc.datacenter.DataCenter`, returning an instantiated 
:py:class:`smartdc.machine.Machine` object. All of the parameter 
values are optional, as they are assigned default values by the 
datacenter's API itself.

:param name: a human-readable label for the machine
:type name: :py:class:`basestring`

:param package: cluster of resource values identified by name
:type package: :py:class:`basestring` or :py:class:`dict`

:param image: an identifier for the base operating system image
    (formerly a ``dataset``)
:type image: :py:class:`basestring` or :py:class:`dict`

:param dataset: base operating system image identified by a globally 
    unique ID or URN (deprecated)
:type dataset: :py:class:`basestring` or :py:class:`dict`

:param metadata: keys & values with arbitrary supplementary 
    details for the machine, accessible from the machine itself
:type metadata: :py:class:`dict`

:param tags: keys & values with arbitrary supplementary 
    identifying information for filtering when querying for machines
:type tags: :py:class:`dict`

:param networks: list of networks where this machine will belong to
:type networks: :py:class:`list`

:param boot_script: path to a file to upload for execution on boot
:type boot_script: :py:class:`basestring` as file path

:rtype: :py:class:`smartdc.machine.Machine`

If `package`, `image`, or `dataset` are passed a :py:class:`dict` containing a 
`name` key (in the case of `package`) or an `id` key (in the case of
`image` or `dataset`), it passes the corresponding value. The server API 
appears to resolve incomplete or ambiguous dataset URNs with the 
highest version number.