returns url of profile image of a user
770065
def img_url(obj, profile_app_name, profile_model_name):
    
    try:
        content_type = ContentType.objects.get(
            app_label=profile_app_name,
            model=profile_model_name.lower()
        )
    except ContentType.DoesNotExist:
        return ""
    except AttributeError:
        return ""

    Profile = content_type.model_class()
    fields = Profile._meta.get_fields()
    profile = content_type.model_class().objects.get(user=obj.user)
    for field in fields:
        if hasattr(field, "upload_to"):
            return field.value_from_object(profile).url
960043
public function getAvatar() : ? string
    {
        //$this->cdn
        $cdn = \Phalcon\DI::getDefault()->getCdn() . '/avatars/';
        $avatar = $cdn . 'nopicture.png';

        if (!empty($this->profile_image)) {
            $avatar = $cdn . $this->profile_image;
        } elseif (!empty($this->profile_remote_image)) {
            $avatar = $this->profile_remote_image;
        }

        return $avatar;
    }
1079695
def get_gallery_profile(self):
        """"""
        url = (self._imgur._base_url + "/3/account/{0}/"
               "gallery_profile".format(self.name))
        return self._imgur._send_request(url)
377835
def save_profile(self, **params):
        
        image = self.get_image()
        if (image is None):
            return

        profile = image.get('profile', None)
        if profile is None:
            # If image has no profile then create one
            profile = Settings.SettingGroup()
            image.set(profile=profile)

        self.logger.debug("saving to image profile: params=%s" % (
            str(params)))
        profile.set(**params)
        return profile
300199
def profile_pic_url(self) -> str:
        """"""
        if self._context.is_logged_in:
            try:
                return self._iphone_struct['hd_profile_pic_url_info']['url']
            except (InstaloaderException, KeyError) as err:
                self._context.error('{} Unable to fetch high quality profile pic.'.format(err))
                return self._metadata("profile_pic_url_hd")
        else:
            return self._metadata("profile_pic_url_hd")
1211347
def get_user_profile_photos(self, user_id, **options):
        
        return self.api_call("getUserProfilePhotos", user_id=str(user_id), **options)
469094
def update_profile_image(self, filename, file_=None):
        
        headers, post_data = API._pack_image(filename, 700, f=file_)
        return bind_api(
            api=self,
            path='/account/update_profile_image.json',
            method='POST',
            payload_type='user',
            allowed_param=['include_entities', 'skip_status'],
            require_auth=True
        )(self, post_data=post_data, headers=headers)
456885
def image_activation_profiles(self):
        
        # We do here some lazy loading.
        if not self._image_activation_profiles:
            self._image_activation_profiles = \
                ActivationProfileManager(self, profile_type='image')
        return self._image_activation_profiles
385006
def author(self):
        
        from .author import Author

        url = self.soup['author']['profileUrl']
        name = self.soup['author']['name']
        motto = self.soup['author']['bio']
        template = self.soup['author']['avatar']['template']
        photo_id = self.soup['author']['avatar']['id']
        photo_url = template.format(id=photo_id, size='r')
        return Author(url, name, motto, photo_url=photo_url,
                      session=self._session)
271065
def get_profile(self):
        
        r = self._session.get(API_URL + "/logins/me")
        r.raise_for_status()

        return r.json()
649061
def getImageObject(url, referrer, session, max_content_bytes=MaxImageBytes):
    """"""
    return urlopen(url, session, referrer=referrer, max_content_bytes=max_content_bytes, stream=True)
1062460
def profile_path(profile_id, profile):
    """"""
    user = os.path.expanduser("~")
    return os.path.join(user, profile_id + profile)
1285225
def GET_user_profile( self, path_info, user_id ):
        
        if not check_name(user_id) and not check_subdomain(user_id):
            return self._reply_json({'error': 'Invalid name or subdomain'}, status_code=400)

        blockstackd_url = get_blockstackd_url()
        resp = blockstackd_client.resolve_profile(user_id, hostport=blockstackd_url)
        if json_is_error(resp):
            self._reply_json({'error': resp['error']}, status_code=404)
            return

        self._reply_json(resp['profile'])
        return
885500
def get_user_profile(self, user_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        self.logger.debug("GET /api/v1/users/{user_id}/profile with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/users/{user_id}/profile".format(**path), data=data, params=params, single_item=True)
886417
def image_url(path, only_path=False, cache_buster=True, dst_color=None, src_color=None, spacing=None, collapse_x=None, collapse_y=None):
    
    return _image_url(path, only_path, cache_buster, dst_color, src_color, False, None, spacing, collapse_x, collapse_y)
471011
def get_profile_data(self, raw_token):
        """"""
        try:
            response = self.request('get', self.profile_url, token=raw_token)
            response.raise_for_status()
        except RequestException as e:
            logger.error('Unable to fetch user profile: {0}'.format(e))
            return None
        else:
            return response.json() or response.text
584419
def _get_profile(self, user_account):
        """"""

        try:
            # TODO: Load active profile, not just any
            user_profile = objectmodels['profile'].find_one(
                {'owner': str(user_account.uuid)})
            self.log("Profile: ", user_profile,
                     user_account.uuid, lvl=debug)
        except Exception as e:
            self.log("No profile due to error: ", e, type(e),
                     lvl=error)
            user_profile = None

        if not user_profile:
            default = {
                'uuid': std_uuid(),
                'owner': user_account.uuid,
                'userdata': {
                    'notes': 'Default profile of ' + user_account.name
                }
            }
            user_profile = objectmodels['profile'](default)
            user_profile.save()

        return user_profile