Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __getattr__(self, name):
ops = qsharp.get_available_operations_by_namespace()
if name in ops[self._qs_name]:
op_cls = new_class(name, (QSharpCallable, ))
# Copy over metadata from the operation's header.
metadata = qsharp.client.get_operation_metadata(f"{self._qs_name}.{name}")
op_cls.__doc__ = metadata.get('documentation', '')
op_cls.__file__ = metadata.get('source', None)
return op_cls(f"{self._qs_name}.{name}", "workspace")
raise AttributeError(f"Q# namespace {self._qs_name} does not contain a callable {name}.")