Get a single user

@link https://developer.github.com/v3/users/#get-a-single-user

@param string $username

@return array
@throws \Exception
180880
public function getSingleUser(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username', $username));
    }
384445
public function load($username): UserInterface
    {
        if ($username !== '') {
            $key = mb_strtolower($username);
            $user = $this->get($key);
            if ($user) {
                return $user;
            }
        } else {
            $key = '';
        }

        $directory = $this->getFlexDirectory();

        /** @var User $object */
        $object = $directory->createObject(
            [
                'username' => $username,
                'state' => 'enabled'
            ],
            $key
        );

        return $object;
    }
1245505
public function loadUserByUsername($username)
    {
        if (null === $user = $this->findOneBy(array('_login' => $username))) {
            throw new UsernameNotFoundException(sprintf('Unknown username `%s`.', $username));
        }

        return $this->checkActivatedStatus($user);
    }
1055846
public function username($username = null)
    {
        if (func_num_args() === 0) {
            return $this->_username;
        }
        $this->_username = $username ?: null;
        return $this;
    }
665735
public function loadUserByUsername($username)
    {
        if (!$this->queryField || !$username) {
            return false;
        }

        $user = $this->documentModel->getRepository()->findOneBy(
            [
                $this->queryField => new \MongoRegex('/^'.preg_quote($username).'$/i')
            ]
        );

        return $user ? $user : false;
    }
908541
private function findByUsername(string $username)
    {
        if ($this->userRepository instanceof UserRepositoryInterface) {
            return $this->userRepository->findByUsername($username);
        }

        return $this->userRepository->findOneBy(['username' => $username]);
    }
274063
public function getFromUsername( $username ) {
		$result = $this->api->getRequest(
			new SimpleRequest(
				'query', [
				'list' => 'users',
				'ususers' => $username,
				'usprop' => 'gender|emailable|registration|editcount|rights|implicitgroups|groups|blockinfo',
			]
			)
		);

		return $this->newUserFromListUsersResult( array_shift( $result['query']['users'] ) );
	}
605343
public function getMemberByUsername($username)
    {
        $timeStamp = time();
        $result = $this->em->getRepository($this->entity['m']['name'])->findOneBy(array('username' => $username));
        if (is_null($result)) {
            return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
        }
        return new ModelResponse($result, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
    }
1338928
public function getUserByName($username)
    {
        return $this->getUsers()->then(function (array $users) use ($username) {
            foreach ($users as $user) {
                if ($user->getUsername() === $username) {
                    return $user;
                }
            }

            throw new UserNotFoundException("The user \"$username\" does not exist.");
        });
    }
1162425
protected function getUserByName(string $username)
    {
        $found_user = null;
        $users      = $this->getWordpressParameter('users');

        foreach ($users as $user) {
            if ($username === $user['username']) {
                $found_user = $user;
                break;
            }
        }

        if ($found_user === null) {
            throw new RuntimeException("[W801] User not found for name \"{$username}\"");
        }

        return $found_user;
    }
728580
public function getUserIdFromLogin(string $username): int
    {
        return (int) $this->getDriver()->user->get($username, ['by' => 'login'])->ID;
    }
1170107
private function resolveUser($username)
    {
        if (isset($this->knownUsers[strtolower($username)])) {
            return $this->knownUsers[strtolower($username)];
        }

        $repository = $this->entityManager->getRepository(User::class);
        $user = $repository->findOneBy(['uName' => $username]);

        // If we couldn't find the user by username, let's try to get it by email
        if (!$user) {
            $user = $repository->findOneBy(['uEmail' => $username]);
        }

        // No user to actually track against.
        if (!$user) {
            return null;
        }

        /**
         * I don't know what detach is doing or why it's here, but it's causing an exception on UserSignup
         * not being a known entity. Much like drugs, `detach` is not the answer
         */
        //$this->entityManager->detach($user);
        $this->knownUsers[strtolower($username)] = $user;
        return $user;
    }
1281818
public static function getByEmail(string $email) : Users
    {
        $user = self::findFirst([
            'conditions' => 'email = ?0',
            'bind' => [$email]
        ]);

        if (!$user) {
            throw new Exception('No User Found');
        }

        return $user;
    }
477973
public function &getUser($channelname, $username)
    {
        if (!$this->_channelsyncing) {
            $this->log(SMARTIRC_DEBUG_NOTICE, 'WARNING: getUser() is called and'
                .' the required Channel Syncing is not activated!',
                __FILE__, __LINE__
            );
            return;
        }

        if ($this->isJoined($channelname, $username)) {
            return $this->getChannel($channelname)->users[strtolower($username)];
        }
    }
394769
public function loadUserByUsername($username): User
    {
        foreach ($this->userRepositoryCollection->all() as $repository) {
            $user = $repository->findByUsername($username);

            if ($user instanceof User) {
                return $user;
            }
        }

        throw new UsernameNotFoundException(
            sprintf('Username "%s" does not exist.', $username)
        );
    }
1326768
public static function user($username)
    {
        $username = urlencode($username);

        return self::get(self::BASE_URL . '/json.php?username=' . $username);
    }
369463
public function getUser($name = null)
  {
      if (!$name) {
          $this->wrapper->checkScope('user_read');

          return $this->wrapper->request('GET', 'user', [], true);
      }

      return $this->wrapper->request('GET', "users/$name");
  }