Extracts absl-py flags that the user has specified and outputs their
    key-value mapping.

    By default, extracts only those flags in the current __package__
    and mainfile.

    Useful to put into a trial's param_map.
554767
def absl_flags():
    
    # TODO: need same thing for argparse
    flags_dict = flags.FLAGS.flags_by_module_dict()
    # only include parameters from modules the user probably cares about
    def _relevant_module(module_name):
        if __package__ and __package__ in module_name:
            return True
        if module_name == sys.argv[0]:
            return True
        return False
    return {
        flag.name: flag.value for module, flags in flags_dict.items()
        for flag in flags if _relevant_module(module)}
1175684
def get_compiler_flags():
    """"""
    compiler = get_default_fcompiler()
    if compiler == 'absoft':
        flags = ['-m64', '-O3', '-YEXT_NAMES=LCS', '-YEXT_SFX=_',
                 '-fpic', '-speed_math=10']
    elif compiler == 'gnu95':
        flags = ['-m64', '-fPIC', '-O3', '-ffast-math']
    elif compiler == 'intel':
        flags = ['-m64', '-fpp', '-free', '-O3', '-Tf']
    elif compiler == 'g95':
        flags = ['-O3', '-fno-second-underscore']
    elif compiler == 'pg':
        flags = ['-fast']
    else:
        flags = ['-m64', '-O3']
    return flags
206494
def _parse_flags(element):
    
    visible = True if element.get('visible') else False
    user = element.get('user')
    timestamp = element.get('timestamp')
    if timestamp:
        timestamp = utils.Timestamp.parse_isoformat(timestamp)
    tags = {}
    try:
        for tag in element['tag']:
            key = tag.get('k')
            value = tag.get('v')
            tags[key] = value
    except AttributeError:
        pass

    return visible, user, timestamp, tags
991207
def pkg_list(self):
        
        options = [
            "-l",
            "--list"
        ]
        flag = ["--index", "--installed", "--name"]
        name = INDEX = installed = False
        for arg in self.args[2:]:
            if flag[0] == arg:
                INDEX = True
            if flag[1] in arg:
                installed = True
            if flag[2] == arg:
                name = True
            if arg not in flag:
                usage("")
                raise SystemExit()
        if (len(self.args) > 1 and len(self.args) <= 5 and
                self.args[0] in options):
            if self.args[1] in self.meta.repositories:
                PackageManager(binary=None).package_list(self.args[1],
                                                         name,
                                                         INDEX,
                                                         installed)
            else:
                usage(self.args[1])
        else:
            usage("")
441605
def _GetFlagValues(self, flags):
    
    event_types = []
    for event_flag, description in self._FLAG_VALUES.items():
      if event_flag & flags:
        event_types.append(description)
    return ', '.join(event_types)
1097715
def parse(self, args=None):
        '''
        '''
        opts = dict()

        if args is None:
            import sys
            # skip over the program name with the [1:] slice
            args = sys.argv[1:]

        # arglist is a tuple of (is_flag, name) pairs
        arglist = peekable(parse_tokens(args))
        for is_flag, name in arglist:
            if is_flag is True:
                # .peek will return the default argument iff there are no more entries
                next_is_flag, next_name = arglist.peek(default=(None, None))
                # next_is_flag will be None if there are no more items, but True/False if there is a next item

                # if this argument looks for a subsequent (is set as boolean),
                #   and the subsequent is not a flag, consume it
                if next_is_flag is False:
                    opts[name] = next_name
                    # finally, advance our iterator, but since we already have the next values, just discard it
                    arglist.next()
                else:
                    # if there is no next thing, or the next thing is a flag,
                    #   all the boolean=False's in the world can't save you then
                    opts[name] = True
            else:
                # add positional argument
                opts.setdefault('_', []).append(name)

        return opts
227649
def to_s
      flags  = 0
      flags |= FLAG_COMPRESSED if compressed?
      flags |= FLAG_IV if iv
      flags |= FLAG_KEY if key
      flags |= FLAG_CIPHER_NAME if cipher_name
      flags |= FLAG_AUTH_TAG if auth_tag

      header = "#{MAGIC_HEADER}#{version.chr(SymmetricEncryption::BINARY_ENCODING)}#{flags.chr(SymmetricEncryption::BINARY_ENCODING)}"

      if iv
        header << [iv.length].pack('v')
        header << iv
      end

      if key
        encrypted = cipher.binary_encrypt(key, header: false)
        header << [encrypted.length].pack('v')
        header << encrypted
      end

      if cipher_name
        header << [cipher_name.length].pack('v')
        header << cipher_name
      end

      if auth_tag
        header << [auth_tag.length].pack('v')
        header << auth_tag
      end

      header
    end
737939
def get_access_flags_string(self):
        
        if self.access_flags_string == None:
            self.access_flags_string = get_access_flags_string(
                self.get_access_flags())

            if self.access_flags_string == "":
                self.access_flags_string = "0x%x" % self.get_access_flags()
        return self.access_flags_string
1203409
def _convert_pflags(self, pflags):
        """"""
        if (pflags & SFTP_FLAG_READ) and (pflags & SFTP_FLAG_WRITE):
            flags = os.O_RDWR
        elif pflags & SFTP_FLAG_WRITE:
            flags = os.O_WRONLY
        else:
            flags = os.O_RDONLY
        if pflags & SFTP_FLAG_APPEND:
            flags |= os.O_APPEND
        if pflags & SFTP_FLAG_CREATE:
            flags |= os.O_CREAT
        if pflags & SFTP_FLAG_TRUNC:
            flags |= os.O_TRUNC
        if pflags & SFTP_FLAG_EXCL:
            flags |= os.O_EXCL
        return flags
109730
def extract_explicit_namespace_bindings(element_name, attrs)
      element_name_local_part, element_name_prefix, element_name_uri = element_name
      ns = {}
      ns[element_name_prefix] = element_name_uri if element_name_prefix && element_name_uri

      attrs.each do |name, value|
        attr_local_part, attr_prefix, attr_uri = name
        if attr_prefix && attr_uri
          raise "bindings clash: '#{attr_prefix}'=>'#{ns[attr_prefix]}' , '#{attr_prefix}'=>'#{attr_uri}'" if ns.has_key?(attr_prefix) && ns[attr_prefix]!=attr_uri
          ns[attr_prefix] = attr_uri
        end
      end
      ns
    end
109069
def binary(self, name, flag):
        
        if self.meta.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag:
            sys.setrecursionlimit(10000)
            dependencies = []
            requires = Requires(name, self.repo).get_deps()
            if requires:
                for req in requires:
                    status(0)
                    if req and req not in self.black:
                        dependencies.append(req)
                if dependencies:
                    self.dep_results.append(dependencies)
                    for dep in dependencies:
                        self.binary(dep, flag)
            return self.dep_results
        else:
            return []
849875
def get_option_flags(option_num):
        
        opt_bytes = array.array('B', '\0\0')
        if option_num < 256:
            s = struct.Struct("!B")
            s.pack_into(opt_bytes, 0, option_num)
        else:
            s = struct.Struct("H")
            s.pack_into(opt_bytes, 0, option_num)
        critical = (opt_bytes[0] & 0x01) > 0
        unsafe = (opt_bytes[0] & 0x02) > 0
        nocache = ((opt_bytes[0] & 0x1e) == 0x1c)
        return (critical, unsafe, nocache)
518812
def _render_our_module_flags(self, module, output_lines, prefix=''):
    """"""
    flags = self._get_flags_defined_by_module(module)
    if flags:
      self._render_module_flags(module, flags, output_lines, prefix)
872814
def main(argString=None):
    
    # Getting and checking the options
    args = parseArgs(argString)
    checkArgs(args)

    logger.info("Options used:")
    for key, value in vars(args).iteritems():
        logger.info("  --{} {}".format(key.replace("_", "-"), value))

    # Checks the sample raw data
    logger.info("Checking the raw data files")
    sample_files = check_sample_files(args.bfile + ".fam", args.raw_dir)

    # Finds the markers to extract
    logger.info("Creating extraction list (autosome only)")
    create_extraction_file(args.bfile + ".bim", args.out)

    # Run plink
    logger.info("Computing frequency using Plink")
    run_plink(args.bfile, args.out, args.out + ".to_extract")

    # Run bafRegress
    logger.info("Running bafRegress")
    if args.sge:
        run_bafRegress_sge(sample_files, args.out, args.out + ".to_extract",
                           args.out + ".frq", args)
    else:
        run_bafRegress(sample_files, args.out, args.out + ".to_extract",
                       args.out + ".frq", args)
1244803
def extract_code_globals(cls, co):
        
        out_names = cls._extract_code_globals_cache.get(co)
        if out_names is None:
            try:
                names = co.co_names
            except AttributeError:
                # PyPy "builtin-code" object
                out_names = set()
            else:
                out_names = set(names[oparg]
                                for op, oparg in _walk_global_ops(co))

                # see if nested function have any global refs
                if co.co_consts:
                    for const in co.co_consts:
                        if type(const) is types.CodeType:
                            out_names |= cls.extract_code_globals(const)

            cls._extract_code_globals_cache[co] = out_names

        return out_names
909702
def get_symbol_map(self):
        
        # todo: make sure we return a list of strings!
        sm = _libxdo.xdo_get_symbol_map()

        # Return value is like:
        # ['alt', 'Alt_L', ..., None, None, None, ...]
        # We want to return only values up to the first None.
        # todo: any better solution than this?
        i = 0
        ret = []
        while True:
            c = sm[i]
            if c is None:
                return ret
            ret.append(c)
            i += 1
1022784
private void extractFlags(Msg msg)
    {
        //  Test whether IDENTITY flag is valid for this socket type.
        if (msg.isIdentity()) {
            assert (options.recvIdentity);
        }

        //  Remove MORE flag.
        rcvmore = msg.hasMore();
    }