Computes the list of strings corresponding to the given specifications

    :param specifications: A string, a class or a list of specifications
    :return: A list of strings
    :raise ValueError: Invalid specification found
176681
def _get_specifications(specifications):
    
    if not specifications or specifications is object:
        raise ValueError("No specifications given")
    elif inspect.isclass(specifications):
        if Provides.USE_MODULE_QUALNAME:
            if sys.version_info < (3, 3, 0):
                raise ValueError(
                    "Qualified name capability requires Python 3.3+"
                )

            # Get the name of the class
            if not specifications.__module__:
                return [specifications.__qualname__]

            return [
                "{0}.{1}".format(
                    specifications.__module__, specifications.__qualname__
                )
            ]
        else:
            # Legacy behavior
            return [specifications.__name__]
    elif is_string(specifications):
        # Specification name
        specifications = specifications.strip()
        if not specifications:
            raise ValueError("Empty specification given")
        return [specifications]
    elif isinstance(specifications, (list, tuple)):
        # List given: normalize its content
        results = []
        for specification in specifications:
            results.extend(_get_specifications(specification))
        return results
    else:
        raise ValueError(
            "Unhandled specifications type : {0}".format(
                type(specifications).__name__
            )
        )
767113
def validate_field_list(fields, allow_fmt_specs=False, name_filter=None):
    
    formats = [i[4:] for i in globals() if i.startswith("fmt_")]

    try:
        fields = [i.strip() for i in fields.replace(',', ' ').split()]
    except AttributeError:
        # Not a string, expecting an iterable
        pass

    if name_filter:
        fields = [name_filter(name) for name in fields]

    for name in fields:
        if allow_fmt_specs and '.' in name:
            fullname = name
            name, fmtspecs = name.split('.', 1)
            for fmtspec in fmtspecs.split('.'):
                if fmtspec not in formats and fmtspec != "raw":
                    raise error.UserError("Unknown format specification %r in %r" % (fmtspec, fullname))

        if name not in engine.FieldDefinition.FIELDS and not engine.TorrentProxy.add_manifold_attribute(name):
            raise error.UserError("Unknown field name %r" % (name,))

    return fields
1234951
def _get_value_specs(cls, cls_in, attribute_name):
        

        if cls_in in {dict, list}:
            return ValueSpecs(None, ValueTypes(None, None))
        else:
            return cls._fetch_attribute_specs_from_doc(cls_in, attribute_name)
833547
def specs_to_string(specs):
    # type: (List[Union[STRING_TYPE, Specifier]]) -> AnyStr
    

    if specs:
        if isinstance(specs, six.string_types):
            return specs
        try:
            extras = ",".join(["".join(spec) for spec in specs])
        except TypeError:
            extras = ",".join(["".join(spec._spec) for spec in specs])  # type: ignore
        return extras
    return ""
26019
def _extract_constants(self, specification):
        
        constants = {}

        for attribute in specification.attributes:

            if attribute.allowed_choices and len(attribute.allowed_choices) > 0:

                name = attribute.local_name.upper()

                for choice in attribute.allowed_choices:
                    constants["CONST_%s_%s" % (name, choice.upper())] = choice

        return constants
395607
def parse_requirements_list(requirements_list):
    
    req_list = []

    for requirement in requirements_list:
        requirement_no_comments = requirement.split('#')[0].strip()

        # if matching requirement line (Thing==1.2.3), update dict, continue
        req_match = re.match(
            r'\s*(?P<package>[^\s\[\]]+)(?P<extras>\[\S+\])?==(?P<version>\S+)',
            requirement_no_comments
        )
        if req_match:
            req_list.append({
                'package': req_match.group('package'),
                'version': req_match.group('version'),
            })

    return req_list
1236705
def __isListOfTexts(self, docs):
        
        return isinstance(docs, list) and \
               all(isinstance(d, (basestring, Text)) for d in docs)
678471
def get_specification(self):
        
        resp = self._call('getApplicationSpec', proto.Empty())
        return ApplicationSpec.from_protobuf(resp)
27357
def get_spec_list(image_specs, container_args):
    

    spec_list = [spec.strip() for spec in image_specs.split('|')]
    original_count = len(spec_list)

    if 'count' in container_args:
        if 'count_offset' in container_args:
            spec_list = spec_list[container_args['count_offset']:]
        spec_list = spec_list[:container_args['count']]

    return spec_list, original_count
631188
def _spec_to_matches(server_list, server_spec, mode):
    
    assert mode in ("uri", "hostname", "hostname_port")

    def match(server_doc):
        if mode == "hostname":
            return server_spec == server_doc["hostname"]
        elif mode == "hostname_port":
            return server_spec == "{}:{}".format(
                server_doc["hostname"], server_doc["port"]
            )
        elif mode == "uri":
            return server_spec == "{}://{}:{}".format(
                server_doc["scheme"], server_doc["hostname"], server_doc["port"]
            )
        else:
            raise NotImplementedError("Unreachable error! Something is very wrong.")

    return [server_doc for server_doc in server_list if match(server_doc)]
812205
function Specification (description, msg, f, options) {
  this.id = ++id;
  // Static fields:
  this.description = description;
  description.log_("Specification: " + msg);
  description.specifications.push(this);
  this.message = msg;
  this.behavior = f;
  this.stopOnFailure = false;
  this.expectationIntended = undefined;
  this.verbose = description.verbose;
  Object.assign(this, options || {});
  // Internal (dynamic) fields:
  this.expectations = [];
  this.result = undefined;
  this.raisedException = false;
  this.exception = null;
  this.index = 0;
  this.expectationAttempted = 0;
  this.expectationSuccessful = 0;
  this.pass = false;
}
526228
def _cuda_get_gpu_spec_string(gpu_ids=None):
    

    if gpu_ids is None:
        return ''

    if isinstance(gpu_ids, list):
        return ','.join(str(gpu_id) for gpu_id in gpu_ids)

    if isinstance(gpu_ids, int):
        return str(gpu_ids)

    return gpu_ids
614316
def parselinenos(spec, nlines=None):
    

    items = {}
    parts = spec.split(',')

    for part in parts:
        line_class = LINECLASS_RE.match(part)
        start = int(line_class.group('start'))

        if line_class.group('range'):
            if line_class.group('end'):
                end = int(line_class.group('end'))
            else:
                end = nlines

            for line_no in range(start, end + 1):
                items[line_no] = line_class.group('class')

        else:
            items[start] = line_class.group('class')

    return items
690042
public static String getPartitionSpecString(Map<String, String> spec) {
    StringBuilder sb = new StringBuilder();
    for (Map.Entry<String, String> entry : spec.entrySet()) {
      if (!sb.toString().isEmpty()) {
        sb.append(",");
      }
      sb.append(entry.getKey());
      sb.append("=");
      sb.append(getQuotedString(entry.getValue()));
    }
    return sb.toString();
  }
1358513
def get_specification(version: str) -> Mapping[str, Any]:
    

    spec_dir = config["bel"]["lang"]["specifications"]
    spec_dict = {}

    bel_versions = get_bel_versions()
    if version not in bel_versions:
        log.error("Cannot get unknown version BEL specification")
        return {"error": "unknown version of BEL"}

    # use this variable to find our parser file since periods aren't recommended in python module names
    version_underscored = version.replace(".", "_")

    json_fn = f"{spec_dir}/bel_v{version_underscored}.json"

    with open(json_fn, "r") as f:
        spec_dict = json.load(f)

    return spec_dict
622216
def listFormats(self, vendorSpecific=None):
        
        response = self.listFormatsResponse(vendorSpecific)
        return self._read_dataone_type_response(response, 'ObjectFormatList')
1260545
def parse_specs(cls, target_specs, build_root=None, exclude_patterns=None, tags=None):
    
    build_root = build_root or get_buildroot()
    spec_parser = CmdLineSpecParser(build_root)

    dependencies = tuple(OrderedSet(spec_parser.parse_spec(spec_str) for spec_str in target_specs))
    return Specs(
      dependencies=dependencies,
      exclude_patterns=exclude_patterns if exclude_patterns else tuple(),
      tags=tags)