Finds the ID of the IM with a particular user by name, with the option
		to automatically create a new channel if it doesn't exist.
178748
def find_im_by_user_name(self, name, auto_create=True):
		
		uid = self.find_user_by_name(name)[0]
		try:
			return self.find_im_by_user_id(uid)
		except KeyError:
			# IM does not exist, create it?
			if auto_create:
				response = self.api.im.open(token=self.token, user=uid)
				return response[u'channel'][u'id']
			else:
				raise
878504
def url(self) -> str:
        
        if self.chat.type not in [ChatType.SUPER_GROUP, ChatType.CHANNEL]:
            raise TypeError('Invalid chat type!')
        elif not self.chat.username:
            raise TypeError('This chat does not have @username')

        return f"https://t.me/{self.chat.username}/{self.message_id}"
572170
def add_client(self, user_id=None):
        
        if user_id is None:
            # generate a random uuid if it's an unauthenticated client
            self.channel = 'public'
            user_id = uuid.uuid1().hex
        else:
            self.channel = 'private'
        
        self.id = user_id
        self.channels[self.channel][self.id] = self
        print 'Client connected to the %s channel.' % self.channel
743222
function findUser(id, user, callback) {
	if (typeof user.save === 'function') {
		callback(null, user);
	} else {
		orionAccount.findByUsername(id, callback);
	}
}
904576
def created_by(self):
        
        if self.api and self.created_by_id:
            return self.api._get_user(self.created_by_id)
531029
def user(id)
      if id
        cached_user = users.detect {|u| u[:id] == id }
        user = cached_user || fetch_user(id)
        self.users << user
        user
      end
    end
9737
def find_by_name name
      name = CGI.escape name.downcase.gsub(/\s/, '')
      DynamicModel.new perform_request api_url "summoners/by-name/#{name}"
    end
1241992
def get_chat_member(self, user_id):
        
        return self.bot.api_call(
            "getChatMember", chat_id=str(self.id), user_id=str(user_id)
        )
577811
def channel(self, match):
        
        if len(match) == 9 and match[0] in ('C','G','D'):
            return self._lookup(Channel, 'id', match)
        return self._lookup(Channel, 'name', match)
1342080
def setSignalName(self, name: str):
        
        self.isHook = False
        self.messengerName = name
1083164
def get_user_id(user_id_or_username):
    
    user_id_or_username = user_id_or_username.lower()
    if not user_id_or_username.startswith("user-"):
        user_id = "user-" + user_id_or_username.lower()
    else:
        user_id = user_id_or_username
    return user_id
760540
def get_recipient_unchecked(channel_id)
            @users.values
                .find { |user| user.modes.keys
                    .any { |channel| channel == channel_id }}
        end
478952
def find(*_, **kwargs):
    
    click.echo(green('\nFind user:'))
    click.echo(green('-' * 40))

    with get_app().app_context():
        user = find_user(kwargs)

    if not user:
        click.echo(red('Not found\n'))
        return

    click.echo(str(user) + '\n')
    return
822386
def get_by_id(self, id):
        """"""
        user = super(ExtendedUsersService, self).get_by_id(id)
        user.first_name = 'John' + str(id)
        user.last_name = 'Smith' + str(id)
        user.gender = 'male'
        return user
889581
def find_user(session, username):
    """"""
    resp = _make_request(session, FIND_USER_URL, username)
    if not resp:
        raise VooblyError('user not found')
    try:
        return int(resp[0]['uid'])
    except ValueError:
        raise VooblyError('user not found')
1192628
def new(self, user, name, description=None):
        
        uri = self.client.remote + '/users/{0}/feeds'.format(user)

        data = {
            'feed': {
                'name': name,
                'description': description
            }
        }

        resp = self.client.post(uri, data)
        return resp
1151898
function (username, channel) {
        var list = this.getUserNotifications(username);
        // if we are not tracking the user there is no notifications
        if (list === null) {
            return false;
        }

        // return if the channel is in the users list
        return list.indexOf(channel) >= 0;
    }