Searches for profiles
349542
public function searchAction()
    {
        $numberPage = 1;
        if ($this->request->isPost()) {
            $query = Criteria::fromInput($this->di, 'Modules\User\Models\Profiles', $this->request->getPost());
            $this->persistent->searchParams = $query->getParams();
        } else {
            $numberPage = $this->request->getQuery("page", "int");
        }

        $parameters = [];
        if ($this->persistent->searchParams) {
            $parameters = $this->persistent->searchParams;
        }

        $profiles = Profiles::find($parameters);
        if (count($profiles) == 0) {

            $this->flash->notice("The search did not find any profiles");

            return $this->dispatcher->forward([
                "action" => "index"
            ]);
        }

        $paginator = new Paginator([
            "data" => $profiles,
            "limit" => 10,
            "page" => $numberPage
        ]);

        $this->view->page = $paginator->getPaginate();
    }
1221615
public function getProfiles(){
        if($this->loadProfiles != 'ALL'){
            $this->connection->select('name');
            $this->connection->from($this->tableProfile);
            $profiles= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC);
            foreach ($profiles as $profile) {
                $this->getProfile($profile['name']);
            }
            $this->loadModules= 'ALL';
        }
        return $this->profiles;
    }
154781
public List<Profile> findAllProfiles() throws Exception {
        ArrayList<Profile> allProfiles = new ArrayList<>();
        PreparedStatement statement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_PROFILE);
            results = statement.executeQuery();
            while (results.next()) {
                allProfiles.add(this.getProfileFromResultSet(results));
            }
        } catch (Exception e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
        return allProfiles;
    }
958248
def profile
      unless @profile
        if associated_profile
          @profile = Profile.new(associated_profile)
        else
          options = {:fields => 'user_id', :includes => 'Profile'}
          options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
          tmp = User.find(username, options)
          @profile = Profile.new(tmp.associated_profile)
        end
      end
      @profile
    end
128523
def list_service_profiles(self, retrieve_all=True, **_params):
        """"""
        return self.list('service_profiles', self.service_profiles_path,
                         retrieve_all, **_params)
1062460
def profile_path(profile_id, profile):
    """"""
    user = os.path.expanduser("~")
    return os.path.join(user, profile_id + profile)
415434
def profile_list(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('profile:list', **{
        'storage': ctx.repo.create_secure_service('storage'),
    })
280850
def _item_list(profile=None):
    '''
    
    '''
    g_client = _auth(profile)
    ret = []
    for item in g_client.items.list():
        ret.append(item.__dict__)
        #ret[item.name] = {
        #        'name': item.name,
        #    }
    return ret
1098329
def possible_target_profiles(nickname, server, all_profiles_dict,
                             org_vm, autonomous=True, output='path'):
    
    assert output in ['path', 'name']
    profiles_in_svr = get_profiles_in_svr(nickname, server,
                                          all_profiles_dict,
                                          org_vm)
    # list of possible autonomous profiles for testing
    possible_profiles = []

    for profile_inst in profiles_in_svr:
        profile_org_name = profile_name(org_vm, profile_inst, short=True)
        if autonomous:
            if all_profiles_dict[profile_org_name].type == 'autonomous':
                possible_profiles.append(profile_inst)
        else:
            if not all_profiles_dict[profile_org_name].type == 'component':
                possible_profiles.append(profile_inst)

    if output == 'path':
        possible_profiles = [inst.path for inst in possible_profiles]
    elif output == 'name':
        possible_profiles = [profile_name(org_vm, inst)
                             for inst in possible_profiles]

    return possible_profiles
112199
def _get_forms(profile, instance, request, undo=False, prefix=""):
    
    anonymous = profile is None and request.user.username == ANONYMOUS_USERNAME

    if not profile and not anonymous:
        return []

    if prefix:
        prefix += "-{}".format(instance.pk)
    else:
        prefix = "{}".format(instance.pk)

    kwargs = dict(
        initial={"pk": instance.pk},
        profile=profile,
        prefix=prefix,
        undo=undo,
    )

    ret = []
    if (not instance.closed or undo) and instance.workshifter:
        workshifter = instance.workshifter or instance.liable
        pool = instance.pool

        if not profile:
            managers = []
        else:
            managers = Manager.objects.filter(incumbent__user=profile.user)

        verify, blow = False, False

        # The many ways a person can be eligible to verify a shift...
        if instance.verify == AUTO_VERIFY:
            pass
        elif instance.verify == SELF_VERIFY:
            verify = True
        elif instance.verify == OTHER_VERIFY and profile != workshifter:
            verify = True
        elif instance.verify == ANY_MANAGER_VERIFY and managers:
            verify = True
        elif instance.verify == POOL_MANAGER_VERIFY and \
          set(managers).intersections(pool.managers):
            verify = True
        elif instance.verify == WORKSHIFT_MANAGER_VERIFY and \
          any(i.workshift_manager for i in managers):
            verify = True

        if verify and not instance.verifier:
            # Verify Shift
            action = "{}-{}".format(VerifyShiftForm.action_name, instance.pk)
            ret.append(
                VerifyShiftForm(
                    data=request.POST if action in request.POST else None,
                    **kwargs
                )
            )

        if pool.any_blown:
            blow = True

        if profile:
            pool_managers = pool.managers.filter(incumbent__user=profile.user)
            if pool_managers.count():
                blow = True

        if blow and not instance.blown:
            # Blown Shift
            action = "{}-{}".format(BlownShiftForm.action_name, instance.pk)
            ret.append(
                BlownShiftForm(
                    data=request.POST if action in request.POST else None,
                    **kwargs
                )
            )

    if profile is not None:
        marked_blown = UndoShiftForm.check_marked_blown(instance, profile)

        if marked_blown or instance.verifier == profile:
            # Undo Verify Shift
            action = "{}-{}".format(UndoShiftForm.action_name, instance.pk)
            ret.append(
                UndoShiftForm(
                    data=request.POST if action in request.POST else None,
                    **kwargs
                )
            )

    if not instance.closed:
        if not instance.workshifter:
            # Sign In
            action = "{}-{}".format(SignInForm.action_name, instance.pk)
            ret.append(
                SignInForm(
                    data=request.POST if action in request.POST else None,
                    **kwargs
                )
            )
        liable = instance.workshifter or instance.liable
        if (undo and liable is not None) or \
           instance.workshifter == profile:
            # Sign Out
            action = "{}-{}".format(SignOutForm.action_name, instance.pk)
            ret.append(
                SignOutForm(
                    data=request.POST if action in request.POST else None,
                    **kwargs
                )
            )

    return ret
744014
def network_profiles(self, obj):
        """"""

        profile_name_list = self.network_profile_name_list(obj)

        profile_list = []
        for profile_name in profile_name_list:
            profile = Profile()
            flags = DWORD()
            access = DWORD()
            xml = LPWSTR()
            self._wlan_get_profile(self._handle, obj['guid'],
                                   profile_name, byref(xml), byref(flags),
                                   byref(access))
            # fill profile info
            profile.ssid = re.search(r'<name>(.*)</name>', xml.value).group(1)
            auth = re.search(r'<authentication>(.*)</authentication>',
                                 xml.value).group(1).upper()

            profile.akm = []
            if auth not in akm_str_to_value_dict:
                if auth not in auth_str_to_value_dict:
                    profile.auth = AUTH_ALG_OPEN
                else:
                    profile.auth = auth_str_to_value_dict[auth]
                    profile.akm.append(AKM_TYPE_NONE)
            else:
                    profile.auth = AUTH_ALG_OPEN
                    profile.akm.append(akm_str_to_value_dict[auth])

            profile_list.append(profile)

        return profile_list
996975
function(profiles) {
			profiles = utils.parseJSON(profiles);
			var snippets = {};
			Object.keys(profiles).forEach(function(syntax) {
				var options = profiles[syntax];
				if (!(syntax in snippets)) {
					snippets[syntax] = {};
				}
				snippets[syntax].profile = normalizeProfile(options);
			});

			this.loadSnippets(snippets);
		}
1043741
def _item_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = []
    for item in kstone.items.list():
        ret.append(item.__dict__)
        # ret[item.name] = {
        #         'id': item.id,
        #         'name': item.name,
        #         }
    return ret
903951
def profile_application_list(request):
    
    config = tables.RequestConfig(request, paginate={"per_page": 5})

    person = request.user
    my_applications = Application.objects.get_for_applicant(person)
    my_applications = ApplicationTable(my_applications, prefix="mine-")
    config.configure(my_applications)

    requires_attention = Application.objects.requires_attention(request)
    requires_attention = ApplicationTable(requires_attention, prefix="attn-")
    config.configure(requires_attention)

    return render(
        template_name='kgapplications/profile_applications.html',
        context={
            'person': request.user,
            'my_applications': my_applications,
            'requires_attention': requires_attention,
        },
        request=request)
620791
def profiler(profiles, projectpath,parameters,serviceid,servicename,serviceurl,printdebug=None):
    """"""

    parameters = sanitizeparameters(parameters)

    matched = []
    program = Program(projectpath)
    for profile in profiles:
        if profile.match(projectpath, parameters)[0]:
            matched.append(profile)
            program.update( profile.generate(projectpath,parameters,serviceid,servicename,serviceurl) )

    return matched, program
686605
def searchusers(self, pattern):
        
        return [User(self, **rawuser) for rawuser in
                self._getusers(match=pattern).get('users', [])]
462990
def validate_profile_exists(self):
        """"""

        if self.args.profile_name not in self.profiles:
            self.handle_error('Could not find profile "{}"'.format(self.args.profile_name))