Check the dynamic symbol versions.

    Parameters
    ----------
    objdump_string : string
        The dynamic symbol table entries of the file (result of `objdump -T` command).
775539
def check_dependicies(objdump_string):
    
    GLIBC_version = re.compile(r'0{16}[ \t]+GLIBC_(\d{1,2})[.](\d{1,3})[.]?\d{,3}[ \t]+')
    versions = GLIBC_version.findall(objdump_string)
    assert len(versions) > 1
    for major, minor in versions:
        assert int(major) <= 2
        assert int(minor) <= 14

    GLIBCXX_version = re.compile(r'0{16}[ \t]+GLIBCXX_(\d{1,2})[.](\d{1,2})[.]?(\d{,3})[ \t]+')
    versions = GLIBCXX_version.findall(objdump_string)
    assert len(versions) > 1
    for major, minor, patch in versions:
        assert int(major) == 3
        assert int(minor) == 4
        assert patch == '' or int(patch) <= 19

    GOMP_version = re.compile(r'0{16}[ \t]+G?OMP_(\d{1,2})[.](\d{1,2})[.]?\d{,3}[ \t]+')
    versions = GOMP_version.findall(objdump_string)
    assert len(versions) > 1
    for major, minor in versions:
        assert int(major) == 1
        assert int(minor) == 0
78957
def get_version_string(check_name):
    
    version = VERSION.search(read_version_file(check_name))
    if version:
        return version.group(1)
282807
def get_version():
    
    here = os.path.abspath(os.path.dirname(__file__))
    jbxapi_file = os.path.join(here, "jbxapi.py")

    with open(jbxapi_file) as f:
        content = f.read()
        match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M)

    if not match:
        raise RuntimeError("Unable to find version string.")
    return match.group(1)
178384
def is_unicode_string(string):
    
    if string is None:
        return None
    if PY2:
        return isinstance(string, unicode)
    return isinstance(string, str)
53101
def format(self):
        
        if self.dynamic_version_of is not None:
            return self.dynamic_version_of.format

        if not self._format:
            self._format = '%s_%%s' % self.name
        return self._format
1310842
def version(which="num"):
    """"""
    if which in VERSIONS:
        return VERSIONS[which]
    else:
        raise CoconutException(
            "invalid version type " + ascii(which),
            extra="valid versions are " + ", ".join(VERSIONS),
        )
1268637
def isprintable(string):
    
    string = string.strip()
    if not string:
        return True
    if sys.version_info[0] == 3:
        try:
            return string.isprintable()
        except Exception:
            pass
        try:
            return string.decode('utf-8').isprintable()
        except Exception:
            pass
    else:
        if string.isalnum():
            return True
        printable = ('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST'
                     'UVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c')
        return all(c in printable for c in string)
644775
private String getPackageVersion(String packageInfoString) {
        // packageInfoString for example - audit-libs-2.7.6-3.el7-x86_64
        try {
            String firstDotString = packageInfoString.substring(0, packageInfoString.indexOf(Constants.DOT));
            int lastIndexOfHyphen = firstDotString.lastIndexOf(Constants.DASH);
            int lastIndexOfDot = packageInfoString.lastIndexOf(Constants.DOT);
            String packVersion = packageInfoString.substring(lastIndexOfHyphen + 1, lastIndexOfDot);
            if (StringUtils.isNotBlank(packVersion)) {
                return packVersion;
            }
        } catch (Exception e) {
            logger.warn("Failed to create package version : {}", e.getMessage());
        }
        return null;
    }
130378
def _check_input_names(symbol, names, typename, throw):
    """"""
    args = symbol.list_arguments()
    for name in names:
        if name in args:
            continue
        candidates = [arg for arg in args if
                      not arg.endswith('_weight') and
                      not arg.endswith('_bias') and
                      not arg.endswith('_gamma') and
                      not arg.endswith('_beta')]
        msg = "\033[91mYou created Module with Module(..., %s_names=%s) but " \
              "input with name '%s' is not found in symbol.list_arguments(). " \
              "Did you mean one of:\n\t%s\033[0m"%(
                  typename, str(names), name, '\n\t'.join(candidates))
        if throw:
            raise ValueError(msg)
        else:
            warnings.warn(msg)
892671
public static AsteriskVersion getDetermineVersionFromString(String coreLine)
    {
        for (AsteriskVersion version : knownVersions)
        {
            for (Pattern pattern : version.patterns)
            {
                if (pattern.matcher(coreLine).matches())
                {
                    return version;
                }
            }
        }

        return null;
    }
1270750
def _extract_version(version_string, pattern):
    
    if version_string:
        match = pattern.match(version_string.strip())
        if match:
            return match.group(1)
    return ""
655560
def find_version_by_string_lib(line):  # type: (str)->Optional[str]
    
    if not line:
        return None
    simplified_line = simplify_line(line)
    version = None
    if simplified_line.startswith("version="):
        if '"' not in simplified_line:
            pass
            # logger.debug("Weird version string, no double quote : " + unicode((full_path, line, simplified_line)))
        else:
            if "=" in simplified_line:
                post_equals = simplified_line.split("=")[0]
                if '"' in post_equals:
                    parts = post_equals.split('"')

                    if len(parts) != 3:
                        # logger.debug("Weird string, more than 3 parts : " + unicode((full_path, line, simplified_line)))
                        version = parts[0]
    return version
979364
def current_version_option_validator(ctx, param, value):
    

    current_version = None

    if value:
        try:
            current_version = Version(value)
        except ValueError:
            ctx.fail(f"{value} is not a valid version string")

    # Look for the last git tag for the curren version
    git = Git()
    tag_pattern = ctx.params["tag_pattern"]
    versions = tag_analyzer(git.tags, tag_pattern, Version)

    # User provided current version. Try to find a tag that match it.
    if current_version:
        for version in versions:
            if version == current_version:
                current_version = version
                break
    elif versions:
        current_version = versions[0]

    ctx.params["current_tag"] = current_version.tag if current_version else None
    ctx.params["versions"] = versions

    return current_version
133913
def _get_version(name, results):
    '''
    
    '''
    for line in salt.utils.itertools.split(results, '\n'):
        if not line:
            continue
        try:
            pkgname, pkgver = line.rsplit('-', 1)
        except ValueError:
            continue
        if pkgname == name:
            return pkgver
    return None
311791
def symbol(self, index):
        """"""
        #if index is actually a string, just return it
        if isinstance(index, str):
            return index
        elif (index < 0) or (index >= self.symtab.table_len):
            self.error("symbol table index out of range")
        sym = self.symtab.table[index]
        #local variables are located at negative offset from frame pointer register
        if sym.kind == SharedData.KINDS.LOCAL_VAR:
            return "-{0}(1:%14)".format(sym.attribute * 4 + 4)
        #parameters are located at positive offset from frame pointer register
        elif sym.kind == SharedData.KINDS.PARAMETER:
            return "{0}(1:%14)".format(8 + sym.attribute * 4)
        elif sym.kind == SharedData.KINDS.CONSTANT:
            return "${0}".format(sym.name)
        else:
            return "{0}".format(sym.name)
163412
def _get_dynamic_attr(self, attname, obj, default=None):
        
        try:
            attr = getattr(self, attname)
        except AttributeError:
            return default
        if callable(attr):
            # Check co_argcount rather than try/excepting the function and
            # catching the TypeError, because something inside the function
            # may raise the TypeError. This technique is more accurate.
            try:
                code = six.get_function_code(attr)
            except AttributeError:
                code = six.get_function_code(attr.__call__)
            if code.co_argcount == 2:       # one argument is 'self'
                return attr(obj)
            else:
                return attr()
        return attr
478532
def safe_unicode(obj, *args):
    
    try:
        return unicode(obj, *args)  # noqa for undefined-variable
    except UnicodeDecodeError:
        # obj is byte string
        ascii_text = str(obj).encode('string_escape')
        try:
            return unicode(ascii_text)  # noqa for undefined-variable
        except NameError:
            # This is Python 3, just return the obj as it's already unicode
            return obj
    except NameError:
        # This is Python 3, just return the obj as it's already unicode
        return obj