Builds and returns a :class:`MdfRobot` for analyzing the results in the MDF files.
164506
def get_mdf_robot(self):
        """"""
        from abilab.robots import MdfRobot
        robot = MdfRobot()
        for task in self[2:]:
            mdf_path = task.outdir.has_abiext(robot.EXT)
            if mdf_path:
                robot.add_file(str(task), mdf_path)
        return robot
33314
def build(self, builder):
        """"""
        params = dict(
            Namespace=self.namespace,
            Name=self.name,
            Value=self.value,
            TransactionType=self.transaction_type,
        )

        builder.start("mdsol:Attribute", params)
        builder.end("mdsol:Attribute")
674595
def make_module_to_builder_dict(datasets=None):
  """"""
  # pylint: disable=g-long-lambda
  # dict to hold tfds->image->mnist->[builders]
  module_to_builder = collections.defaultdict(
      lambda: collections.defaultdict(
          lambda: collections.defaultdict(list)))
  # pylint: enable=g-long-lambda

  if datasets:
    builders = [tfds.builder(name) for name in datasets]
  else:
    builders = [
        tfds.builder(name)
        for name in tfds.list_builders()
        if name not in BUILDER_BLACKLIST
    ] + [tfds.builder("image_label_folder", dataset_name="image_label_folder")]

  for builder in builders:
    mod_name = builder.__class__.__module__
    modules = mod_name.split(".")
    if "testing" in modules:
      continue

    current_mod_ctr = module_to_builder
    for mod in modules:
      current_mod_ctr = current_mod_ctr[mod]
    current_mod_ctr.append(builder)

  module_to_builder = module_to_builder["tensorflow_datasets"]
  return module_to_builder
76323
def build(self):
        
        self.children = BasicFactory.build(self.root, self)
        collated = BasicFactory.collate(self.children)
        self.children = collated[0]
        self.attributes = collated[2]
        self.imports = collated[1]
        self.elements = collated[3]
        self.types = collated[4]
        self.groups = collated[5]
        self.agrps = collated[6]
660626
def load_model(f, format=None, load_external_data=True):  # type: (Union[IO[bytes], Text], Optional[Any], bool) -> ModelProto
    '''
    
    '''
    s = _load_bytes(f)
    model = load_model_from_string(s, format=format)

    if load_external_data:
        model_filepath = _get_file_path(f)
        if model_filepath:
            base_dir = os.path.dirname(model_filepath)
            load_external_data_for_model(model, base_dir)

    return model
563746
def create(blocks, mode='basic', inplanes=64, cardinality=4, image_features=64, divisor=4, num_classes=1000):
    
    block_dict = {
        # 'basic': BasicBlock,
        'bottleneck': ResNeXtBottleneck
    }

    def instantiate(**_):
        return ResNeXt(block_dict[mode], blocks, inplanes=inplanes, image_features=image_features, cardinality=cardinality, divisor=divisor, num_classes=num_classes)

    return ModelFactory.generic(instantiate)
140431
def _modeldesc_from_dict(self, d):
        """"""
        lhs_termlist = [Term([LookupFactor(d['lhs_termlist'][0])])]
        rhs_termlist = []
        for name in d['rhs_termlist']:
            if name == '':
                rhs_termlist.append(Term([]))
            else:
                rhs_termlist.append(Term([LookupFactor(name)]))

        md = ModelDesc(lhs_termlist, rhs_termlist)
        return md
1260200
def build_model(self):
        ''''''
        if self.model_config['model-type']:
            self.model = self.build_fred()
        elif self.model_config['model-type']:
            self.model = self.buidl_hred()
        else:
            raise Error("Unrecognized model type '{}'".format(self.model_config['model-type']))
946514
def mdadm():
    '''
    
    '''
    devices = set()
    try:
        with salt.utils.files.fopen('/proc/mdstat', 'r') as mdstat:
            for line in mdstat:
                line = salt.utils.stringutils.to_unicode(line)
                if line.startswith('Personalities : '):
                    continue
                if line.startswith('unused devices:'):
                    continue
                if ' : ' in line:
                    devices.add(line.split(' : ')[0])
    except IOError:
        return {}

    devices = sorted(devices)
    if devices:
        log.trace('mdadm devices detected: %s', ', '.join(devices))

    return {'mdadm': devices}
937673
def open_file(path, grib_errors='warn', **kwargs):
    """"""
    if 'mode' in kwargs:
        warnings.warn("the `mode` keyword argument is ignored and deprecated", FutureWarning)
        kwargs.pop('mode')
    stream = messages.FileStream(path, message_class=cfmessage.CfMessage, errors=grib_errors)
    return Dataset(*build_dataset_components(stream, **kwargs))
1252535
def buildschema(_cls=None, **kwargs):
    
    if _cls is None:
        return lambda _cls: buildschema(_cls=_cls, **kwargs)

    result = build(_cls, **kwargs)

    return result
374481
def from_data(cls, blob):
        """"""
        version, data = decompress_datablob(DATA_BLOB_MAGIC_RETRY, blob)

        if version == 1:
            for clazz in cls._all_subclasses():
                if clazz.__name__ == data["_class_name"]:
                    return clazz._from_data_v1(data)

        raise Exception("Invalid data blob data or version")
700877
def model_builds(self):
        
        if self._model_builds is None:
            self._model_builds = ModelBuildList(self._version, assistant_sid=self._solution['sid'], )
        return self._model_builds
1185386
def _embedding_nonmetric_mds(matrix, dimensions=3, initial_coords=None):
    
    mds = sklearn.manifold.MDS(n_components=dimensions,
                               dissimilarity='precomputed',
                               metric=False)
    if initial_coords is not None:
        mds.fit(matrix, init=initial_coords)
    else:
        mds.fit(matrix)
    return mds.embedding_
30307
def _get_md_files(self):
        """"""
        all_f = _all_files_matching_ext(os.getcwd(), "md")
        exclusions = [
            "*.egg/*",
            "*.eggs/*",
            "*build/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
1218776
def decoded_output_boxes(self):
        
        ret = self._cascade_boxes[-1]
        ret = tf.expand_dims(ret, 1)     # class-agnostic
        return tf.tile(ret, [1, self.num_classes, 1])
476621
def _get_classes_to_inspect(self):
        
        return tuple(filter(lambda c:
                      SerializableMixIn._get_version(c, require=False) or
                      (SerializableMixIn._get_serialize_fields(c) or
                       SerializableMixIn._get_interpolation_map(c)),
                      self.__class__.__mro__))