This method should be called before running the calculation to make
        sure that the most important requirements are satisfied.

        Return:
            List of strings with inconsistencies/errors.
494313
def look_before_you_leap(self):
        
        errors = []

        try:
            self.check_dependencies()
        except self.Error as exc:
            errors.append(str(exc))

        if self.has_db:
            try:
                self.manager.db_connector.get_collection()
            except Exception as exc:
                errors.append("""
                    ERROR while trying to connect to the MongoDB database:
                        Exception:
                            %s
                        Connector:
                            %s
                    """ % (exc, self.manager.db_connector))

        return "\n".join(errors)
1021629
def satisfy(self, *requirements):
        
        versions = []
        for req_range in requirements:
            try:
                version = self._detected_versions[req_range.name]
            except KeyError:
                try:
                    version = req_range.requirement.detect_version()
                except ArcanaRequirementNotFoundError as e:
                    if self._fail_on_missing:
                        raise
                    else:
                        logger.warning(e)
                except ArcanaVersionNotDetectableError as e:
                    if self._fail_on_undetectable:
                        raise
                    else:
                        logger.warning(e)
                else:
                    self._detected_versions[req_range.name] = version
            if not req_range.within(version):
                raise ArcanaVersionError(
                    "Detected {} version {} is not within requested range {}"
                    .format(req_range.requirement, version, req_range))
            versions.append(version)
        return versions
250367
def get_environment_requirements_list():
    
    requirement_list = []
    requirements = check_output([sys.executable, '-m', 'pip', 'freeze'])

    for requirement in requirements.split():
        requirement_list.append(requirement.decode("utf-8"))

    return requirement_list
851274
def requirements(self, requires):
        '''
        
        '''
        if requires:
            if isinstance(requires, basestring) and \
               os.path.isfile(os.path.abspath(requires)):
                self._requirements_file = os.path.abspath(requires)
            else:
                if isinstance(self._requirements, basestring):
                    requires = requires.split()
                self._requirements_file = None
                self._requirements = requires
        else:
            # If the default requirements file is found use that
            if os.path.isfile(self._requirements_file):
                return
            self._requirements, self._requirements_file = None, None
333809
def _find_error(vals):
    

    err_vals = []
    for en in vals:
        c = en[2]
        conc = [float(i)/sum(c) for i in c]

        err = abs(en[0]-en[1])

        err_vals.append([conc,err])

    return err_vals
1137001
def get_missing_requirements(func, requires, d):
    
    if not requires:
        return None
    if any(i in d for i in IGNORE.get(func, [])):
        raise SkipComponent()
    req_all, req_any = split_requirements(requires)
    d = set(d.keys())
    req_all = [r for r in req_all if r not in d]
    req_any = [r for r in req_any if set(r).isdisjoint(d)]
    if req_all or req_any:
        return req_all, req_any
    else:
        return None
1314129
def check_important_variables(self):
        
        if len(self.important_variables - set(self.args.keys())):
            raise TypeError("Some important variables are not set")
834138
public List<String> toList() {

        List<String> errorStrings = new ArrayList<String>();
        ErrorIterator errIterator = iterator();
        while (errIterator.hasNext()) {
            ValidationError err = errIterator.next();
            errorStrings.add(err.getMessage());
        }
        return errorStrings;
    }
112080
def list_musts(options):
    
    validator_list = [
        timestamp,
        modified_created,
        object_marking_circular_refs,
        granular_markings_circular_refs,
        marking_selector_syntax,
        observable_object_references,
        artifact_mime_type,
        character_set,
        software_language,
        patterns
    ]

    # --strict-types
    if options.strict_types:
        validator_list.append(types_strict)

    # --strict-properties
    if options.strict_properties:
        validator_list.append(properties_strict)

    return validator_list
1342514
def validate(self):
        
        errors = []
        for param in self.required_params:
            if (not hasattr(self, param) or getattr(self, param) is None):
                errors.append("missing %s parameter" % (param))
        if (len(errors) > 0):
            raise IIIFInfoError("Bad data for info.json: " + ", ".join(errors))
        return True
1135981
def _validate_incompatibilities(self, incompatibles):
        """"""
        for element in incompatibles:
            if type(element) is list:
                i = [a for a in element if self._get_parameter(a)]
                if len(i) > 1:
                    raise ValueError("Options {} are incompatible".format(" and ".join(i)))
            elif type(incompatibles) is dict:
                if self._get_parameter(element):
                    for b in incompatibles[element]:
                        if self._get_parameter(b):
                            raise ValueError("Options %s and %s are incompatible."
                                             % (element, b))
            else:
                for a in element:
                    if self._get_parameter(a):
                        for b in incompatibles[a]:
                            if self._get_parameter(b):
                                raise ValueError("Options %s and %s are incompatible."
                                                 % (a, b))
452145
def values(self):
        
        if self._values is None:
            self._values = self.calculateValues()
        return self._values
401128
def get_install_requires():
    
    requirements = []
    for line in open('requirements.txt').readlines():
        # skip to next iteration if comment or empty line
        if line.startswith('#') or line == '' or line.startswith('http') or line.startswith('git'):
            continue
        # add line to requirements
        requirements.append(line)
    return requirements
116217
def _ensure_values(data: Mapping[str, Any]) -> Tuple[Dict[str, Any], bool]:
    
    to_return = {}
    should_write = False
    for keyname, typekind, default in REQUIRED_DATA:
        if keyname not in data:
            LOG.debug(f"Defaulted config value {keyname} to {default}")
            to_return[keyname] = default
            should_write = True
        elif not isinstance(data[keyname], typekind):
            LOG.warning(
                f"Config value {keyname} was {type(data[keyname])} not"
                f" {typekind}, defaulted to {default}")
            to_return[keyname] = default
            should_write = True
        else:
            to_return[keyname] = data[keyname]
    return to_return, should_write
1057240
def FormatProblem(self, d=None):
    
    if not d:
      d = self.GetDictToFormat()

    output_error_text = self.__class__.ERROR_TEXT % d
    if ('reason' in d) and d['reason']:
      return '%s\n%s' % (output_error_text, d['reason'])
    else:
      return output_error_text
1271112
def get_conflicts(self):
        
        conflicts = []
        if self._array and self._range:
            conflicts.append('cannot use range expressions on arrays')
        return conflicts
761595
def choices(self):
        
        if isinstance(self.validator, list):
            return self.validator[0].print_choices()
        return self.validator.print_choices()