Similar to :meth:`get_input_peer`, but for :tl:`InputUser`'s alone.
971087
def get_input_user(entity):
    """"""
    try:
        if entity.SUBCLASS_OF_ID == 0xe669bf46:  # crc32(b'InputUser'):
            return entity
    except AttributeError:
        _raise_cast_fail(entity, 'InputUser')

    if isinstance(entity, types.User):
        if entity.is_self:
            return types.InputUserSelf()
        else:
            return types.InputUser(entity.id, entity.access_hash or 0)

    if isinstance(entity, types.InputPeerSelf):
        return types.InputUserSelf()

    if isinstance(entity, (types.UserEmpty, types.InputPeerEmpty)):
        return types.InputUserEmpty()

    if isinstance(entity, types.UserFull):
        return get_input_user(entity.user)

    if isinstance(entity, types.InputPeerUser):
        return types.InputUser(entity.user_id, entity.access_hash)

    _raise_cast_fail(entity, 'InputUser')
44038
def remote(self) -> Optional[str]:
        
        if isinstance(self._transport_peername, (list, tuple)):
            return self._transport_peername[0]
        else:
            return self._transport_peername
960387
def ssh_authorized_peers(peer_interface, user, group=None,
                         ensure_local_user=False):
    
    if ensure_local_user:
        ensure_user(user, group)
    priv_key, pub_key = get_keypair(user)
    hook = hook_name()
    if hook == '%s-relation-joined' % peer_interface:
        relation_set(ssh_pub_key=pub_key)
    elif hook == '%s-relation-changed' % peer_interface or \
            hook == '%s-relation-departed' % peer_interface:
        hosts = []
        keys = []

        for r_id in relation_ids(peer_interface):
            for unit in related_units(r_id):
                ssh_pub_key = relation_get('ssh_pub_key',
                                           rid=r_id,
                                           unit=unit)
                priv_addr = relation_get('private-address',
                                         rid=r_id,
                                         unit=unit)
                if ssh_pub_key:
                    keys.append(ssh_pub_key)
                    hosts.append(priv_addr)
                else:
                    log('ssh_authorized_peers(): ssh_pub_key '
                        'missing for unit %s, skipping.' % unit)
        write_authorized_keys(user, keys)
        write_known_hosts(user, hosts)
        authed_hosts = ':'.join(hosts)
        relation_set(ssh_authorized_hosts=authed_hosts)
793569
def _inputcooker_getc(self, block=True):
        """"""
        if self.rawq:
            ret = self.rawq[0]
            self.rawq = self.rawq[1:]
            return ret
        if not block:
            if not self.inputcooker_socket_ready():
                return ''
        ret = self.sock.recv(20)
        self.eof = not(ret)
        self.rawq = self.rawq + ret
        if self.eof:
            raise EOFError
        return self._inputcooker_getc(block)
1112408
def get_user():
    '''
    
    '''
    if HAS_PWD:
        ret = pwd.getpwuid(os.geteuid()).pw_name
    elif HAS_WIN_FUNCTIONS and salt.utils.win_functions.HAS_WIN32:
        ret = salt.utils.win_functions.get_current_user()
    else:
        raise CommandExecutionError(
            'Required external library (pwd or win32api) not installed')
    return salt.utils.stringutils.to_unicode(ret)
427255
public static String getPrivateInput(String prompt) {
        System.out.print(prompt);

        PrivateInputThread privateInput = new PrivateInputThread();
        BufferedReader in =
            new BufferedReader(new InputStreamReader(System.in));

        privateInput.start();
        try {
            return in.readLine();
        } catch(Exception e) {
            return null;
        } finally {
            privateInput.kill();
        }
    }
1173162
def p_parse(cls, input, methodname=None, parse_all=True):
        
        if methodname is None:
            methodname = cls.__default__
        p = cls(input)
        result = getattr(p, methodname)()
        if result is cls.NoMatch or parse_all and p.p_peek() is not None:
            p.p_raise()
        return result
747337
def input(self):
        """"""
        if self._input is None:
            input_file = self.environ['wsgi.input']
            content_length = self.content_length or 0
            self._input = WsgiInput(input_file, self.content_length)
        return self._input
1269831
def canonical_peer( self, peer ):
        
        their_host, their_port = url_to_host_port( peer )

        if their_host in ['127.0.0.1', '::1']:
            their_host = 'localhost'

        return "%s:%s" % (their_host, their_port)
1213266
def get_fptr(self):
        """"""
        cmpfunc = ctypes.CFUNCTYPE(ctypes.c_int,
                                   WPARAM,
                                   LPARAM,
                                   ctypes.POINTER(KBDLLHookStruct))
        return cmpfunc(self.handle_input)
696309
def getPeerStats(self):
        
        info_dict = {}
        output = util.exec_command([ntpqCmd, '-n', '-c', 'peers'])
        for line in output.splitlines():
            mobj = re.match('\*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+', line)
            if mobj:
                info_dict['ip'] = mobj.group(1)
                cols = line.split()
                info_dict['stratum'] = int(cols[2])
                info_dict['delay'] = float(cols[7]) / 1000.0
                info_dict['offset'] = float(cols[8]) / 1000.0
                info_dict['jitter'] = float(cols[9]) / 1000.0
                return info_dict
        else:
            raise Exception("Execution of command failed: %s" % ntpqCmd)
        return info_dict
823839
def step(self, con=None, path=None, peer_table=None, local_inv=None):
        
        if path is None:
            path = self.atlasdb_path

        peer_hostports = []
        stale_peers = []

        num_peers = None
        peer_hostports = None

        with AtlasPeerTableLocked(peer_table) as ptbl:
            num_peers = len(ptbl.keys())
            peer_hostports = ptbl.keys()[:]

            # who are we going to ping?
            # someone we haven't pinged in a while, chosen at random
            for peer in peer_hostports:
                if not atlas_peer_has_fresh_zonefile_inventory( peer, peer_table=ptbl ):
                    # haven't talked to this peer in a while
                    stale_peers.append(peer)
                    log.debug("Peer %s has a stale zonefile inventory" % peer)

        if len(stale_peers) > 0:
            log.debug("Refresh zonefile inventories for %s peers" % len(stale_peers))

        for peer_hostport in stale_peers:
            # refresh everyone
            log.debug("%s: Refresh zonefile inventory for %s" % (self.hostport, peer_hostport))
            res = atlas_peer_refresh_zonefile_inventory( self.hostport, peer_hostport, 0, con=con, path=path, peer_table=peer_table, local_inv=local_inv )
            if res is None:
                log.warning("Failed to refresh zonefile inventory for %s" % peer_hostport)
        
        return
1013526
def get_inputs(node, kwargs):
    """"""
    name = node["name"]
    proc_nodes = kwargs["proc_nodes"]
    index_lookup = kwargs["index_lookup"]
    inputs = node["inputs"]
    attrs = node.get("attrs", {})

    input_nodes = []
    for ip in inputs:
        input_node_id = index_lookup[ip[0]]
        input_nodes.append(proc_nodes[input_node_id].name)

    return name, input_nodes, attrs
708501
def get_input(self):
        
        user_input = web.input(
            user=[],
            task=[],
            aggregation=[],
            org_tags=[],
            grade_min='',
            grade_max='',
            sort_by="submitted_on",
            order='0',  # "0" for pymongo.DESCENDING, anything else for pymongo.ASCENDING
            limit='',
            filter_tags=[],
            filter_tags_presence=[],
            date_after='',
            date_before='',
            stat='with_stat',
        )

        # Sanitise inputs
        for item in itertools.chain(user_input.task, user_input.aggregation):
            if not id_checker(item):
                raise web.notfound()

        if user_input.sort_by not in self._allowed_sort:
            raise web.notfound()

        digits = [user_input.grade_min, user_input.grade_max, user_input.order, user_input.limit]
        for d in digits:
            if d != '' and not d.isdigit():
                raise web.notfound()

        return user_input
789619
function getUserInputFromStdin() {
    // set up stdin
    const keypress = require("keypress")
    keypress(process.stdin)
    process.stdin.setRawMode(true)
    process.stdin.resume()

    // A Subject is something that you can push values at, and
    // it can be subscribed to as an Observable of those values
    const s = new Subject()

    // set up handler and return the stream as Observable
    process.stdin.on("keypress", (ch, key = {}) => {
      if (key.name == "x" || (key && key.ctrl && key.name == "c")) {
        process.stdin.pause()
        s.complete()
        log("\nBye!")
        process.exit()
      }
      if (ch === "0" || Number(ch)) {
        s.next(Number(ch))
      } else {
        process.stdin.pause()
        log("Not 0-9.\nBye!")
        s.complete()
      }
    })

    return s.asObservable()
  }
629905
def get_local_user():
    
    # TODO: I don't understand why these lines were added outside the
    # try/except, since presumably it means the attempt at catching ImportError
    # wouldn't work. However, that's how the contributing user committed it.
    # Need an older Windows box to test it out, most likely.
    import getpass

    username = None
    # All Unix and most Windows systems support the getpass module.
    try:
        username = getpass.getuser()
    # Some SaaS platforms raise KeyError, implying there is no real user
    # involved. They get the default value of None.
    except KeyError:
        pass
    # Older (?) Windows systems don't support getpass well; they should
    # have the `win32` module instead.
    except ImportError:  # pragma: nocover
        if win32:
            import win32api
            import win32security  # noqa
            import win32profile  # noqa

            username = win32api.GetUserName()
    return username
1090095
def get(type=None, **ArgConfig):
  
  """
  ArgConfig.update(type=type)
  return gatherInput(**reconfigArg(ArgConfig))