Get a user from their username

@param string $username
@throws EndpointNotSupportedByApiVersionException
@return array|json
496823
public function getUserByUsername($username)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        $params = [
            'login' => $username,
        ];

        return $this->get('users', $params);
    }
134821
public function find($username, $expand = true)
    {
        $parameters['username'] = $username;
        $parameters['expand'] = $expand;
        return $this->apiClient->callEndpoint('user', $parameters);
    }
353795
public function get($username)
    {
        return isset($this->storage[$username]) ? $this->storage[$username] : false;
    }
180880
public function getSingleUser(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username', $username));
    }
644430
public function listSubscriptions(string $username = null): array
    {
        if (null !== $username) {
            return $this->getApi()->request($this->getApi()->sprintf('/users/:username/subscriptions',
                $this->getActivity()->getOwner(), $this->getActivity()->getRepo(), $username));
        }

        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/user/subscriptions', $this->getActivity()->getOwner(),
                                                 $this->getActivity()->getRepo()));
    }
160265
public function loadUserByUsername($username)
    {
        $slackUser = $this->client->getSlackUserFromOAuthCode($username);

        if (!$slackUser->isValid()) {
            throw new UsernameNotFoundException('No access token found.');
        }

        $user = $this->userService->findBySlackUserId($slackUser->getUserId());

        if (!empty($user)) {
            return $user;
        }

        $user = $this->userService->findUserByEmail($slackUser->getEmail());

        if (!empty($user)) {
            $user->setSlackUserId($slackUser->getUserId());

            return $user;
        }

        return $this->registerUser($slackUser);
    }
910091
public function getUserConfig($serverName, $userName)
    {
        list($response) = $this->getUserConfigWithHttpInfo($serverName, $userName);
        return $response;
    }
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);
    }
528687
public function loadUserByUsername($username)
    {
        $user = $this->segmentalizer->loadUserByUsername($username);
        if (call_user_func($this->filter, $user)) {
            return $user;
        }
        throw new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
    }
140054
public function delete($username)
    {
        $parameters['username'] = $username;
        return $this->apiClient->callEndpoint(
            'user',
            $parameters,
            null,
            HttpMethod::REQUEST_DELETE
        );
    }
313735
public function find($username)
    {
        $response = $this->search($username);
        foreach ($response->get() as $user) {
            if ($username === $user['username']) {
                return $this->get($user['id']);
            }
        }
        return null;
    }
758455
public function getUserForUsername($username)
    {
        if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username)) {
            return false;
        }
        
        // Get the access entity
        $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username);

        if ($accessEntity === false) {
            return false;
        }
        
        return $accessEntity;
    }
949106
public function getUserByUsername($username)
    {
        $return = array();

        $users = $this->repository->users;
        foreach ($users as $user) {
            if ($user->username == $username) {
                $return = $user;
                break;
            }
        }

        return $return;
    }
202443
public static function find($username)
    {
        $user = json_decode(self::get("/users/{$username}")->getBody(), true);
        
        return new self($user);
    }
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());
    }
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;
    }
1348057
def _get_user(self, username):
        """"""
        data = self.client.get(self._key(username))
        if data is None:
            return None
        return json.loads(data.decode())