100+ results for '_ pluck'

Not the results you expected?

Line.cpp (https://github.com/jtnimoy/Bandwidth.git) C++ · 195 lines

44 x3 = y3 = x4 = y4 = 0;

45 radius = lineWidth;

46 pluckCounter = 0;

47 }

48

115 }

116

117 pluckCounter = max(0,pluckCounter-1);

118

119 radius = fmin(fmax(lineWidth, radius-5),50);

137 glBegin(GL_LINES);

138

139 if(pluckCounter==0){

140 glColor4b(

141 color.red() * 255.0,

labels_controller.rb (https://gitlab.com/deckar01/gitlab-ce) Ruby · 164 lines

93 def set_priorities

94 Label.transaction do

95 available_labels_ids = @available_labels.where(id: params[:label_ids]).pluck(:id)

96 label_ids = params[:label_ids].select { |id| available_labels_ids.include?(id.to_i) }

97

reportable.rb (https://gitlab.com/Rambabu.d/sujala) Ruby · 140 lines

135

136 def names(column)

137 to_model(column).pluck(:name).uniq

138 end

139 end

stat_graph_contributors_graph_spec.js (https://gitlab.com/ayufan/gitlab-ce-repo-2) JavaScript · 133 lines

112

113 describe("#get_dates", function () {

114 it("plucks the date field from data collection", function () {

115 var graph = new ContributorsMasterGraph()

116 var data = [{date: "2013-01-01"}, {date: "2012-12-15"}]

order-summary-item.tsx (https://gitlab.com/remyvianne/krowkaramel) TypeScript · 215 lines

54

55 // Prepare props to pass to the __experimentalApplyCheckoutFilter filter.

56 // We need to pluck out receiveCart.

57 // eslint-disable-next-line no-unused-vars

58 const { receiveCart, ...cart } = useStoreCart();

named.rb (https://github.com/benolee/rails.git) Ruby · 158 lines

131 #

132 # def self.titles

133 # pluck(:title)

134 # end

135 # end

README.md (https://gitlab.com/blocknotary/IonicInterviews) Markdown · 118 lines

77 * [object.filter](https://www.npmjs.com/package/object.filter): Create a new object filtered to have only properties for which the callback returns true. | [homepage](https://github.com/jonschlinkert/object.filter "Create a new object filtered to have only properties for which the callback returns true.")

78 * [object.pick](https://www.npmjs.com/package/object.pick): Returns a filtered copy of an object with only the specified keys, similar to `_.pick… [more](https://github.com/jonschlinkert/object.pick) | [homepage](https://github.com/jonschlinkert/object.pick "Returns a filtered copy of an object with only the specified keys, similar to`_.pick` from lodash / underscore.")

79 * [object.pluck](https://www.npmjs.com/package/object.pluck): Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with… [more](https://github.com/jonschlinkert/object.pluck) | [homepage](https://github.com/jonschlinkert/object.pluck "Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with values unmodified from those of the original object.")

80 * [object.reduce](https://www.npmjs.com/package/object.reduce): Reduces an object to a value that is the accumulated result of running each property… [more](https://github.com/jonschlinkert/object.reduce) | [homepage](https://github.com/jonschlinkert/object.reduce "Reduces an object to a value that is the accumulated result of running each property in the object through a callback.")

81

virtual-dom-parser.ts (https://github.com/Foundry376/Mailspring.git) TypeScript · 168 lines

45

46 getRawFullString(fullString) {

47 return _.pluck(fullString, 'element').join('');

48 }

49

job_config_builder_spec.rb (https://github.com/simpsonjulian/jenkins.rb.git) Ruby · 150 lines

37 before do

38 @config = Jenkins::JobConfigBuilder.new(:ruby) do |c|

39 c.scm = "http://github.com/drnic/picasa_plucker.git"

40 c.rubies = %w[1.8.7 1.9.2 rbx-head jruby]

41 end

stat_graph_contributors_graph_spec.js (https://gitlab.com/jacobvosmaer-gitlab/gitlab-ce) JavaScript · 128 lines

109

110 describe("#get_dates", function () {

111 it("plucks the date field from data collection", function () {

112 var graph = new ContributorsMasterGraph();

113 var data = [{ date: "2013-01-01" }, { date: "2012-12-15" }];

project_team.rb (https://gitlab.com/mahcsig/gitlab-ce) Ruby · 207 lines

100

101 source_members = source_project.project_members.to_a

102 target_user_ids = target_project.project_members.pluck(:user_id)

103

104 source_members.reject! do |member|

sinon_extensions.js (https://bitbucket.org/schatt/chorus.git) JavaScript · 248 lines

110 fetch.succeed(response, pagination);

111 } else {

112 throw "No fetch found for " + model.url() + ". Found fetches for: [" + _.pluck(this.fetches(), 'url').join(', ') + "]";

113 }

114 },

120 update.succeed(response, pagination);

121 } else {

122 throw "No update found for " + model.url() + ". Found updates for: [" + _.pluck(this.creates(), 'url').join(', ') + "]";

123 }

124 },

130 create.succeed(response);

131 } else {

132 throw "No create found for " + model.url() + ". Found creates for: [" + _.pluck(this.creates(), 'url').join(', ') + "]";

133 }

134 },

test_nestedset.py (https://github.com/frappe/frappe.git) Python · 235 lines

98

99 min_lft = 1

100 max_rgt = frappe.qb.from_("Test Tree DocType").select(Max(Field("rgt"))).run(pluck=True)[0]

101

102 for record in records:

refresh_service_spec.rb (https://gitlab.com/gwawr/gitlab-ee) Ruby · 312 lines

278 refresh_service.execute(@oldrev, @newrev, 'refs/heads/feature')

279

280 issue_ids = MergeRequestsClosingIssues.where(merge_request: merge_request).pluck(:issue_id)

281 expect(issue_ids).to eq([issue.id])

282 end

297 refresh_service.execute(@oldrev, @newrev, 'refs/heads/feature')

298

299 issue_ids = MergeRequestsClosingIssues.where(merge_request: merge_request).pluck(:issue_id)

300 expect(issue_ids).to eq([issue.id])

301 end

DocumentModel.php (https://github.com/akaunting/akaunting.git) PHP · 196 lines

65 $percent = 0;

66

67 $discount = $this->totals->where('code', 'discount')->makeHidden('title')->pluck('amount')->first();

68

69 if ($discount) {

70 $sub_total = $this->totals->where('code', 'sub_total')->makeHidden('title')->pluck('amount')->first();

71

72 $percent = number_format((($discount * 100) / $sub_total), 0);

Model.php (https://github.com/Anankke/SSPanel-Uim.git) PHP · 54 lines

33 * @method Eloquent\Model[]|static getModels($columns = ['*']) Get the hydrated models without eager loading.

34 * @method \Illuminate\Support\LazyCollection cursor() Get a lazy collection for the given query.

35 * @method \Illuminate\Support\Collection pluck($column, $key = null) Get an array with the values of a given column.

36 * @method \Illuminate\Contracts\Pagination\LengthAwarePaginator paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) Paginate the given query.

37 * @method \Illuminate\Contracts\Pagination\Paginator simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) Paginate the given query into a simple paginator.

Rule.php (https://github.com/houdunwang/video.git) PHP · 155 lines

116 public function delRuleByName($name)

117 {

118 $rid = $this->where('name', $name)->pluck('rid');

119

120 return WeChat::removeRule($rid);

130 public function getRidByName($name)

131 {

132 return self::where('siteid', siteid())->where('name', $name)->pluck('rid') ?: 0;

133 }

134

show_controller.js.coffee (https://github.com/xbmc/chorus2.git) CoffeeScript · 137 lines

25 key: 'set'

26 type: 'string'

27 pluck: false

28 }

29 {

32 key: 'genre'

33 type: 'array'

34 pluck: false

35 }

36 {

105 filterVal = false

106 if more.type is 'array'

107 filterVals = if more.pluck then _.pluck(movie.get(more.key), more.pluck) else movie.get(more.key)

108 filterVals = _.shuffle filterVals.slice(0, 4)

109 filterVal = _.first filterVals

sa-TotalMonthlyByReseller.js (https://gitlab.com/stoicsoftware/netsuite-sku-analytics) JavaScript · 342 lines

308 return {

309 "label": R.pipe(R.head, R.prop("resellerName"))(data),

310 "data": R.pluck("sales")(data)

311 };

312 }

Accounts.php (https://github.com/akaunting/akaunting.git) PHP · 227 lines

42 public function create()

43 {

44 $currencies = Currency::enabled()->pluck('name', 'code');

45

46 $currency = Currency::where('code', '=', setting('default.currency'))->first();

86 public function edit(Account $account)

87 {

88 $currencies = Currency::enabled()->pluck('name', 'code');

89

90 $account->default_account = ($account->id == setting('default.account')) ? 1 : 0;

203

204 if (isset($account->currency_code)) {

205 $currencies = Currency::enabled()->pluck('name', 'code')->toArray();

206

207 if (array_key_exists($account->currency_code, $currencies)) {

todo_service.rb (https://gitlab.com/alexsanford/gitlab-ce) Ruby · 342 lines

204 # Only update those that are not really on that state

205 todos = todos.where.not(state: state)

206 todos_ids = todos.pluck(:id)

207 todos.unscope(:order).update_all(state: state)

208 current_user.update_todos_count_cache

Arr.php (https://gitlab.com/wilmertri/tutorial_mvc) PHP · 528 lines

353

354 /**

355 * Pluck an array of values from an array.

356 *

357 * @param array $array

360 * @return array

361 */

362 public static function pluck($array, $value, $key = null)

363 {

364 $results = [];

365

366 list($value, $key) = static::explodePluckParameters($value, $key);

367

368 foreach ($array as $item) {

issuable_finder.rb (https://gitlab.com/lee.claude/gitlab-ce.git) Ruby · 227 lines

186 def by_milestone(items)

187 if milestones?

188 items = items.where(milestone_id: milestones.try(:pluck, :id))

189 end

190

214 item_ids = LabelLink.joins(:label).

215 where('labels.title in (?)', label_names).

216 where(target_type: klass.name).pluck(:target_id)

217

218 items = items.where(id: item_ids)

h2_http_proxy.cc (https://github.com/saaras-io/yastack.git) C++ · 134 lines

58 f.fixture_data = ffd;

59 f.cq = grpc_completion_queue_create_for_next(nullptr);

60 f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);

61

62 return f;

personal_access_token_spec.rb (https://gitlab.com/18dit020/gitlab) Ruby · 326 lines

172 end

173

174 describe '.pluck_names' do

175 it 'returns the names of the tokens' do

176 pat1 = create(:personal_access_token)

177 pat2 = create(:personal_access_token)

178

179 expect(described_class.pluck_names).to contain_exactly(pat1.name, pat2.name)

180 end

181 end

util.ts (https://github.com/WhisperSystems/Signal-Browser.git) TypeScript · 260 lines

213 const result: null | number = db

214 .prepare<EmptyQuery>(`SELECT count(*) from ${table};`)

215 .pluck(true)

216 .get();

217 if (isNumber(result)) {

project_authorizations_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 311 lines

31

32 it 'includes the correct projects' do

33 expect(authorizations.pluck(:project_id))

34 .to include(owned_project.id, other_project.id, group_project.id)

35 end

187

188 it 'includes nested groups' do

189 expect(authorizations.pluck(:project_id)).to include(nested_project.id)

190 end

191

notification_recipient_service.rb (https://gitlab.com/kivlor/gitlab-ce) Ruby · 302 lines

154 end

155

156 scope.pluck(:user_id)

157 end

158

174

175 def user_ids_with_global_level_watch(ids)

176 settings_with_global_level_of(:watch, ids).pluck(:user_id)

177 end

178

179 def user_ids_with_global_level_custom(ids, action)

180 settings_with_global_level_of(:custom, ids).pluck(:user_id)

181 end

182

backend.memory.test.js (https://github.com/SEL-Columbia/formhub.git) JavaScript · 370 lines

31 var data = _wrapData();

32 equal(data.fields.length, 7);

33 deepEqual(['id', 'date', 'x', 'y', 'z', 'country', 'label'], _.pluck(data.fields, 'id'));

34 equal(memoryData.length, data.data.length);

35 });

82 data.query({q: 'UK'}).then(function(out) {

83 equal(out.total, 3);

84 deepEqual(_.pluck(out.hits, 'country'), ['UK', 'UK', 'UK']);

85 });

86

249 dataset.fetch().then(function(datasetAgain) {

250 equal(dataset.get('name'), memoryData.metadata.name);

251 deepEqual(_.pluck(dataset.fields.toJSON(), 'id'), _.pluck(data.fields, 'id'));

252 equal(dataset.recordCount, 6);

253 });

section_spec.rb (https://github.com/benjaminvialle/Markus.git) Ruby · 106 lines

86 before { section.update_starter_file_group(assignment.id, starter_file_groups.first.id) }

87 it 'should assign the new starter file group' do

88 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)

89 expect(ids).to include starter_file_groups.first.id

90 end

94 before { section.update_starter_file_group(assignment.id, starter_file_groups.first.id) }

95 it 'should assign the new starter file group' do

96 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)

97 expect(ids).to include starter_file_groups.first.id

98 end

99 it 'should remove the old starter file group' do

100 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)

101 expect(ids).not_to include starter_file_groups.second.id

102 end

arr-helpers.php (https://gitlab.com/knowthecode/ktc-must-use) PHP · 343 lines

227 }

228

229 if ( ! function_exists( 'fulcrum_array_pluck' ) ) {

230 /**

231 * Pluck an array of values from an array.

237 * @return array

238 */

239 function fulcrum_array_pluck( $array, $value, $key = null ) {

240 return Arr::pluck( $array, $value, $key );

template.php (https://github.com/dxw/buddypress.git) PHP · 378 lines

32

33 $users = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();

34 $user_ids = wp_list_pluck( $users, 'ID' );

35 sort( $user_ids );

36

85

86 $requests = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();

87 $request_ids = wp_list_pluck( $requests, 'ID' );

88 $this->assertEquals( $request_ids, array( $u1 ) );

89

118

119 $requests = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();

120 $request_ids = wp_list_pluck( $requests, 'ID' );

121 $this->assertEquals( array(), $request_ids );

122

search_results.rb (https://gitlab.com/523/gitlab-ce) Ruby · 258 lines

205

206 # Filter milestones by authorized projects.

207 # For performance reasons project_id is being plucked

208 # to be used on a smaller query.

209 #

213 milestones.where(project_id: project_ids_relation)

214 .select(:project_id).distinct

215 .pluck(:project_id)

216

217 return Milestone.none if project_ids.nil?

person.js (https://github.com/Impactstory/impactstory-tng.git) JavaScript · 149 lines

63

64 // total posts

65 var postCounts = _.pluck(data.sources, "posts_count")

66 data.numPosts = postCounts.reduce(function(a, b){return a + b}, 0)

67

68 // date of earliest publication

69 var earliestPubYear = _.min(_.pluck(data.products, "year"))

70 if (earliestPubYear > 0 && earliestPubYear <= 2015) {

71 data.publishingAge = 2016 - earliestPubYear

graph.js (https://github.com/aslanides/aixijs.git) JavaScript · 222 lines

13 }

14

15 rowPluck(m, idx) {

16 let d = m.d;

17 let out = new Matrix(d, 1);

RoleController.php (https://github.com/roladn/laravel-sentinel-crud-starter.git) PHP · 220 lines

43 */

44 public function create()

45 { $roles = Role::get()->pluck('name', 'id');

46 return View('backEnd.roles.create',compact('roles'));

47 }

entry.js (https://github.com/devdazed/node.git) JavaScript · 212 lines

124 }

125

126 // if the queue gets too big, then pluck off whatever we can.

127 // this should be fairly rare.

128 var mql = this._maxQueueLen

VersionManager.php (https://gitlab.com/fbi/october) PHP · 463 lines

281 $this->databaseVersions[$code] = Db::table('system_plugin_versions')

282 ->where('code', $code)

283 ->pluck('version')

284 ;

285 }

backfill_project_repositories_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 106 lines

40 describe '.on_hashed_storage' do

41 it 'finds projects with repository on hashed storage' do

42 projects = described_class.on_hashed_storage.pluck(:id)

43

44 expect(projects).to match_array([project_hashed_storage_1.id, project_hashed_storage_2.id])

48 describe '.on_legacy_storage' do

49 it 'finds projects with repository on legacy storage' do

50 projects = described_class.on_legacy_storage.pluck(:id)

51

52 expect(projects).to match_array([project_legacy_storage_3.id, project_legacy_storage_4.id, project_legacy_storage_5.id])

59 create(:project_repository, project: project_legacy_storage_3)

60

61 projects = described_class.without_project_repository.pluck(:id)

62

63 expect(projects).to contain_exactly(project_hashed_storage_2.id, project_legacy_storage_4.id, project_legacy_storage_5.id)

dast_site_profile.rb (https://gitlab.com/zillemarco/gitlab) Ruby · 132 lines

37

38 def self.names(site_profile_ids)

39 find(*site_profile_ids).pluck(:name)

40 rescue ActiveRecord::RecordNotFound

41 []

ProjectsController.php (https://gitlab.com/mlnkv/ribbbon) PHP · 134 lines

102 //

103 // // Get the id of the user being sent the invite

104 // $user_id = DB::table('users')->whereEmail(Input::get('email'))->pluck('id');

105 //

106 // if( count(Projectuser::whereUserId($user_id)->whereProjectId($id)->get()) != 0 )

117 //

118 // // Prepare email invitation & send it

119 // $project_name = Project::find($id)->pluck('name');

120 // $project_url = url() . '/projects/'.$id;

121 // sendProjectInviteMail(Input::get('email'), $project_name, $project_url);

stat_graph_contributors_graph.js (https://gitlab.com/Razzeee/gitlab-ce) JavaScript · 278 lines

119

120 ContributorsMasterGraph.prototype.get_dates = function(data) {

121 return _.pluck(data, 'date');

122 };

123

collection_proxy.rb (https://github.com/kuroda/rails.git) Ruby · 126 lines

40

41 delegate :group, :order, :limit, :joins, :where, :preload, :eager_load, :includes, :from,

42 :lock, :readonly, :having, :pluck, :to => :scoped

43

44 delegate :target, :load_target, :loaded?, :scoped,

records_fetcher_spec.rb (https://gitlab.com/realsatomic/gitlab) Ruby · 146 lines

24 shared_examples 'match returned records' do

25 it 'returns issues in the correct order' do

26 returned_iids = records_fetcher.serialized_records.pluck(:iid).map(&:to_i)

27

28 expect(returned_iids).to eq(expected_issue_ids)

dast_latest_gitlab_ci_yaml_spec.rb (https://gitlab.com/realsatomic/gitlab) Ruby · 172 lines

25 let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }

26 let(:pipeline) { service.execute!(:push).payload }

27 let(:build_names) { pipeline.builds.pluck(:name) }

28 let(:ci_pipeline_yaml) { "stages: [\"dast\"]\n" }

29

methods.ts (https://github.com/funkia/list.git) TypeScript · 414 lines

17 last(): A | undefined;

18 map<B>(f: (a: A) => B): List<B>;

19 pluck<K extends keyof A>(key: K): List<A[K]>;

20 foldl<B>(f: (acc: B, value: A) => B, initial: B): B;

21 reduce<B>(f: (acc: B, value: A) => B, initial: B): B;

133 };

134

135 List.prototype.pluck = function<A, K extends keyof A>(

136 this: List<A>,

137 key: K

138 ): List<A[K]> {

139 return L.pluck(key, this);

140 } as any;

141

volumes.go (https://github.com/dotcloud/docker.git) Go · 140 lines

112

113 // For now, the only thing we can update is availability. Instead of

114 // converting the whole spec, just pluck out the availability if it has

115 // been set.

116

expand.js (https://gitlab.com/jorgegoes/jointswp-child) JavaScript · 248 lines

44 defIndex = this.opt.default;

45 }

46 var defStr = this.opt.choices.pluck("key");

47 this.rawDefault = defStr[ defIndex ];

48 defStr[ defIndex ] = String( defStr[defIndex] ).toUpperCase();

collection.md (https://gitlab.com/DamZou/test) Markdown · 233 lines

112

113

114 ## pluck(list, propName):Array

115

116 Extract a list of property values.

128 ];

129

130 pluck(users, 'name'); // ["John", "Jane"]

131 pluck(users, 'age'); // [21, 27]

142 };

143

144 pluck(users, 'name'); // ['John', 'Mary']

145 ```

146

147 See: [array/pluck](array.html#pluck), [object/pluck](object.html#pluck)

148

149

dast_api_latest_gitlab_ci_yaml_spec.rb (https://gitlab.com/zillemarco/gitlab) Ruby · 130 lines

37 let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }

38 let(:pipeline) { service.execute!(:push).payload }

39 let(:build_names) { pipeline.builds.pluck(:name) }

40

41 before do

102 context 'when CI_GITLAB_FIPS_MODE=false' do

103 let(:build_dast_api) { pipeline.builds.find_by(name: 'dast_api') }

104 let(:build_variables) { build_dast_api.variables.pluck(:key, :value) }

105

106 before do

115 context 'when CI_GITLAB_FIPS_MODE=true' do

116 let(:build_dast_api) { pipeline.builds.find_by(name: 'dast_api') }

117 let(:build_variables) { build_dast_api.variables.pluck(:key, :value) }

118

119 before do

adduser.js (https://bitbucket.org/chunyang/socket-io-demo.git) JavaScript · 137 lines

34 }

35

36 // pluck off any other username/password/token. it needs to be the

37 // same as the user we're becoming now. replace them on error.

38 var pre = { username: this.conf.get('username')

editRole.blade.php (https://github.com/lubusIN/laravel-gymie.git) PHP · 94 lines

58 <div class="panel-body">

59 @foreach($permissions->groupBy('group_key') as $permission_group)

60 <h5>{{$permission_group->pluck('group_key')->pop()}}</h5>

61 <div class="row">

62 @foreach($permission_group as $permission)

cycle_analytics_events_spec.rb (https://gitlab.com/solidnerd/gitlab-ce) Ruby · 134 lines

24 get project_cycle_analytics_issue_path(project, format: :json)

25

26 first_issue_iid = project.issues.sort_by_attribute(:created_desc).pluck(:iid).first.to_s

27

28 expect(json_response['events']).not_to be_empty

44 expect(json_response['events']).not_to be_empty

45

46 first_mr_iid = project.merge_requests.sort_by_attribute(:created_desc).pluck(:iid).first.to_s

47

48 expect(json_response['events'].first['iid']).to eq(first_mr_iid)

59 get project_cycle_analytics_review_path(project, format: :json)

60

61 first_mr_iid = project.merge_requests.sort_by_attribute(:created_desc).pluck(:iid).first.to_s

62

63 expect(json_response['events']).not_to be_empty

backbone.babysitter.js (https://bitbucket.org/synapsos/lounge-old.git) JavaScript · 213 lines

195 'select', 'reject', 'every', 'all', 'some', 'any', 'include',

196 'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',

197 'last', 'without', 'isEmpty', 'pluck'];

198

199 _.each(methods, function(method) {

itertoolz.pxd (https://github.com/ryfeus/lambda-packs.git) Cython · 278 lines

137

138

139 cdef class _pluck_index:

140 cdef object ind

141 cdef object iterseqs

142

143

144 cdef class _pluck_index_default:

145 cdef object ind

146 cdef object iterseqs

148

149

150 cdef class _pluck_list:

151 cdef list ind

152 cdef object iterseqs

stock_transfer.js.coffee (https://github.com/chienyuan/spree.git) CoffeeScript · 179 lines

160

161 contains: (id) ->

162 _.contains(_.pluck(@variants, 'id'), id)

163

164 render: ->

product-attributes.php (https://github.com/woothemes/woocommerce.git) PHP · 268 lines

142

143 // Ensure our custom attribute is not in the results (proof of core endpoint).

144 $names = wp_list_pluck( $attributes, 'name' );

145 $this->assertNotContains( 'Numeric Size', $names );

146 }

165

166 // Results should include "number" and "Numeric Size".

167 $names = wp_list_pluck( $attributes, 'name' );

168 $this->assertContains( 'number', $names );

169 $this->assertContains( 'Numeric Size', $names );

244 $this->assertEquals( 3, count( $terms ) );

245

246 $slugs = wp_list_pluck( $terms, 'slug' );

247 $this->assertContains( 'small', $slugs );

248 $this->assertContains( 'large', $slugs );

index.ts (https://gitlab.com/nguyenthehiep3232/marius) TypeScript · 105 lines

55 export { pairwise } from '../internal/operators/pairwise';

56 export { partition } from '../internal/operators/partition';

57 export { pluck } from '../internal/operators/pluck';

58 export { publish } from '../internal/operators/publish';

59 export { publishBehavior } from '../internal/operators/publishBehavior';

session.php (https://gitlab.com/haque.mdmanzurul/wp-harpar-carolyn) PHP · 430 lines

385 protected function update_sessions( $sessions ) {

386 if ( ! has_filter( 'attach_session_information' ) ) {

387 $sessions = wp_list_pluck( $sessions, 'expiration' );

388 }

389

lfs_restorer_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 128 lines

70

71 expect(

72 project.lfs_objects_projects.pluck(:repository_type)

73 ).to contain_exactly('project', 'wiki')

74 end

113

114 expect(

115 project.lfs_objects_projects.pluck(:repository_type)

116 ).to contain_exactly('project')

117 end

pretty-error.coffee (https://gitlab.com/chriswhalen/flipkicks) CoffeeScript · 309 lines

121

122 unskipPackage: (packages...) ->

123 array.pluckOneItem(@_packagesToSkip, pkg) for pkg in packages

124 @

125

133

134 unskipPath: (paths...) ->

135 array.pluckOneItem(@_pathsToSkip, path) for path in paths

136 @

137

145

146 unskip: (callbacks...) ->

147 array.pluckOneItem(@_skipCallbacks, cb) for cb in callbacks

148 @

149

issuable_collections.rb (https://gitlab.com/jamedjo/gitlab-ce) Ruby · 114 lines

11

12 def issuable_meta_data(issuable_collection, collection_type)

13 # map has to be used here since using pluck or select will

14 # throw an error when ordering issuables by priority which inserts

15 # a new order into the collection.

facts.rb (https://github.com/theforeman/foreman.git) Ruby · 105 lines

59 default: '',

60 full_name: N_('Default location'),

61 collection: proc { Hash[Location.all.pluck(:title).map { |title| [title, title] }] })

62 setting('default_organization',

63 type: :string,

65 default: '',

66 full_name: N_('Default organization'),

67 collection: proc { Hash[Organization.all.pluck(:title).map { |title| [title, title] }] })

68 setting('update_hostgroup_from_facts',

69 type: :boolean,

ArticleController.php (https://bitbucket.org/clickmysoft/ecocar_rental.git) PHP · 171 lines

76

77

78 $x2 = CategoryPostModel::where('post_id',$id)->get()->pluck('category_id')->toArray();

79 $x3 = TagPostModel::where('post_id',$id)->get()->pluck('tag_id')->toArray();

contributions_calendar.rb (https://gitlab.com/markglenfletcher/gitlab-ee) Ruby · 97 lines

75 # use IN(project_ids...) instead. It's the intersection of two users so

76 # the list will be (relatively) short

77 @contributed_project_ids ||= projects.distinct.pluck(:id)

78 authed_projects = Project.where(id: @contributed_project_ids)

79 .with_feature_available_for_user(feature, current_user)

collection.js (https://gitlab.com/nVySin/Mo_Grabber) JavaScript · 42 lines

28 'min': require('./collection/min'),

29 'partition': require('./collection/partition'),

30 'pluck': require('./collection/pluck'),

31 'reduce': require('./collection/reduce'),

32 'reduceRight': require('./collection/reduceRight'),

remote-db.service.ts (https://gitlab.com/hearoy/M1-projetNomade) TypeScript · 172 lines

109 };

110 // get the keys of the albums, from the metadata'

111 const keys$ = this._metas.take(1).pluck<string>('0', '$key');

112 // get the albums, from each key ~ [albums[photos... ]... ]

113 const albums$$ = keys$.map(key => this.createAlbumPath(key));

querying.rb (https://github.com/mickeyreiss/rails.git) Ruby · 67 lines

11 :where, :preload, :eager_load, :includes, :from, :lock, :readonly,

12 :having, :create_with, :uniq, :references, :none, :to => :all

13 delegate :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :ids, :to => :all

14

15 # Executes a custom SQL query against your database and returns all the results. The results will

Artist.php (https://gitlab.com/Kille250/myimouto) PHP · 282 lines

266 {

267 if (strpos($name, 'http') === 0) {

268 // $conds = array('artists.id IN (?)', self::where(['url' => $name])->pluck('id'));

269 // $sql = self::where('true');

270 if (!$ids = self::find_all_by_url($name)->getAttributes('id'))

criterion.rb (https://github.com/tobioboye/Markus.git) Ruby · 272 lines

119 Criterion.assign_all_tas(criterion_ids, ta_ids, assignment)

120 criterion_ta_ids = criteria

121 .map { |criterion| criterion.criterion_ta_associations.pluck(:id) }

122 .reduce(:+)

123 Criterion.unassign_tas(criterion_ta_ids, criterion_ids, assignment)

nijie.rb (https://github.com/r888888888/danbooru.git) Ruby · 174 lines

23 def image_urls_from_page

24 if doujin?

25 images = page&.search("#dojin_left .left img").to_a.pluck("src")

26 images += page&.search("#dojin_diff img.mozamoza").to_a.pluck("data-original")

27 else

28 images = page&.search("div#gallery a > .mozamoza").to_a.pluck("src")

29 end

30

left_outer_join_association_test.rb (https://github.com/cjolly/rails.git) Ruby · 91 lines

38

39 def test_left_outer_joins_return_has_value_for_every_comment

40 all_post_ids = Post.pluck(:id)

41 assert_equal all_post_ids, all_post_ids & Post.left_outer_joins(:comments).pluck(:id)

data_sources_controller_spec.rb (https://bitbucket.org/schatt/chorus.git) Ruby · 241 lines

41 it "filters by gpdb data sources" do

42 get :index, :entity_type => "gpdb_data_source", :all => true

43 decoded_response.map(&:id).should =~ GpdbDataSource.pluck(:id)

44 end

45

46 it "filters by oracle data sources" do

47 get :index, :entity_type => "oracle_data_source", :all => true

48 decoded_response.map(&:id).should =~ OracleDataSource.pluck(:id)

49 end

50 end

SpotlightSeeder.php (https://github.com/ppy/osu-web.git) PHP · 131 lines

84 // beatmaps

85 $beatmaps = Beatmap::where('playmode', $v)->orderByRaw('RAND()')->limit(rand(4, 10))->get();

86 $beatmapsetIds = array_unique($beatmaps->pluck('beatmapset_id')->toArray());

87

88 DB::connection('mysql-charts')->table($spotlight->beatmapsetsTableName($mode))->insert(

index.d.ts (https://github.com/xuliangzhan/xe-utils.git) TypeScript Typings · 189 lines

34 export * from './unzip'

35 export * from './zipObject'

36 export * from './pluck'

37 export * from './invoke'

38 export * from './toArrayTree'

taxonomy.php (https://github.com/livinglab/openlab.git) PHP · 314 lines

265 if ( false === $terms ) {

266 $terms = wp_get_object_terms( $post_id, $taxonomy );

267 wp_cache_add( $post_id, wp_list_pluck( $terms, 'term_id' ), $taxonomy . '_relationships' );

268 }

269

querying.rb (https://github.com/oscardelben/rails.git) Ruby · 69 lines

12 :where, :preload, :eager_load, :includes, :from, :lock, :readonly,

13 :having, :create_with, :uniq, :references, :none, :to => :scoped

14 delegate :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :to => :scoped

15

16 # Executes a custom SQL query against your database and returns all the results. The results will

wiredep.js (https://gitlab.com/laurenmbeatty/collaborate_2016) JavaScript · 146 lines

49 ('stream', opts.stream ? opts.stream : {});

50

51 $._.pluck(config.get('file-types'), 'detect').

52 forEach(function (fileType) {

53 Object.keys(fileType).

user_serializer.rb (https://gitlab.com/mba811/discourse.git) Ruby · 257 lines

211

212 def muted_category_ids

213 CategoryUser.lookup(object, :muted).pluck(:category_id)

214 end

215

216 def tracked_category_ids

217 CategoryUser.lookup(object, :tracking).pluck(:category_id)

218 end

219

220 def watched_category_ids

221 CategoryUser.lookup(object, :watching).pluck(:category_id)

222 end

223

list_service.rb (https://gitlab.com/jamedjo/gitlab-ce) Ruby · 73 lines

51

52 def board_label_ids

53 @board_label_ids ||= board.lists.movable.pluck(:label_id)

54 end

55

remove_duplicated_cs_findings_without_vulnerability_id_spec.rb (https://gitlab.com/axil/gitlab) Ruby · 106 lines

60 expect(finding_identifiers.all.count). to eq(4)

61

62 location_fingerprints = findings.pluck(:location_fingerprint).flat_map { |x| Gitlab::Database::ShaAttribute.new.deserialize(x) }

63

64 expect(location_fingerprints).to match_array(expected_fingerprints)

choices.js (https://gitlab.com/jorgegoes/jointswp-child) JavaScript · 173 lines

97

98 /**

99 * Pluck a particular key from the choices

100 * @param {String} propertyName Property name to select

101 * @return {Array} Selected properties

102 */

103

104 Choices.prototype.pluck = function( propertyName ) {

105 return _.pluck( this.realChoices, propertyName );

custom_project_templates_finder_spec.rb (https://gitlab.com/michold/git-lab-playground) Ruby · 108 lines

64 end

65

66 expect(subject.execute.pluck(:name)).to match_array(available_templates)

67 end

68

72 end

73

74 expect(subject.execute.pluck(:name)).to match_array(available_templates)

75 end

76 end

querying.rb (https://github.com/bradediger/rails.git) Ruby · 64 lines

11 :having, :create_with, :uniq, :distinct, :references, :none, :unscope, to: :all

12 delegate :count, :average, :minimum, :maximum, :sum, :calculate, to: :all

13 delegate :pluck, :ids, to: :all

14

15 # Executes a custom SQL query against your database and returns all the results. The results will

list.js (https://gitlab.com/blocknotary/IonicInterviews) JavaScript · 184 lines

39 this.selected = def;

40 } else if (!_.isNumber(def) && def != null) {

41 this.selected = this.opt.choices.pluck('value').indexOf(def);

42 }

43

ExportHelper.class.php (https://github.com/marcoax/maguttiCms.git) PHP · 163 lines

51 public function getHeadersFromConfig()

52 {

53 return collect($this->config['field_exportable'])->pluck('label')->toArray();

54 }

55

FieldsController.php (https://github.com/marketplacekit/marketplacekit.git) PHP · 148 lines

26 {

27 $filters = Filter::orderBy('position', 'ASC')->get();

28 save_language_file('filters', $filters->pluck('name'));

29 }

30

build_gitlab_ci_yaml_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 58 lines

14 let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }

15 let(:pipeline) { service.execute!(:push) }

16 let(:build_names) { pipeline.builds.pluck(:name) }

17

18 before do

LogMessageFormatter.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 173 lines

78 $endpoint

79 ) {

80 $method = $this->pluck('method', $requestData);

81 $argument = $this->pluck('argument', $requestData);

82

83 $status = $this->pluck('status', $responseData);

84

85 if ($status->code !== 0) {

115 $logMessageTokens = [];

116

117 $method = $this->pluck('method', $requestData);

118 $argument = $this->pluck('argument', $requestData);

119 $metadata = $this->pluck('metadata', $requestData) ?: [];

120

121 $response = $this->pluck('response', $responseData);

status_collection.rb (git://github.com/gitlabhq/gitlabhq.git) Ruby · 142 lines

129 .latest

130 .ordered_by_stage

131 .pluck(*STATUSES_COLUMNS)

132

133 raw_statuses.map do |row|

set_helpers_test.js (https://github.com/fangel/RelAlg.js.git) JavaScript · 126 lines

107 })

108 })

109 describe("Pluck", function() {

110 it("Should pluck out the values in the given positions", function() {

111 assert.deepEqual([], SetHelper.Pluck([1,2,3], []))

112 assert.deepEqual([1], SetHelper.Pluck([1,2,3], [0]))

113 assert.deepEqual([2], SetHelper.Pluck([1,2,3], [1]))

114 assert.deepEqual([3], SetHelper.Pluck([1,2,3], [2]))

115 assert.deepEqual([1,2], SetHelper.Pluck([1,2,3], [0,1]))

116 assert.deepEqual([2,3], SetHelper.Pluck([1,2,3], [1,2]))

117 assert.deepEqual([1,2,3], SetHelper.Pluck([1,2,3], [0,1,2]))

118 })

119 it("Should ignore positions that are not in the set", function() {

issue_actions.rb (https://gitlab.com/hvlad/gitlab-ce) Ruby · 217 lines

70

71 @updates[:remove_label_ids] =

72 quick_action_target.labels.on_project_boards(quick_action_target.project_id).where.not(id: label_id).pluck(:id) # rubocop: disable CodeReuse/ActiveRecord

73 @updates[:add_label_ids] = [label_id]

74

aspects_dropdown_view_spec.js (https://github.com/bloodpet/diaspora.git) JavaScript · 126 lines

1 describe("app.views.AspectsDropdown", function () {

2 function selectedAspects(view){

3 return _.pluck(view.$("input.aspect_ids").serializeArray(), "value")

4 }

5

stk.h (https://github.com/pd-l2ork/pd.git) C Header · 92 lines

51 #include<Phonemes.h>

52 #include<PitShift.h>

53 #include<PluckTwo.h>

54 #include<Plucked.h>

CountryLoader.php (https://github.com/rinvex/country.git) PHP · 248 lines

155 }

156

157 $result = static::pluck($target, $key);

158

159 return in_array('*', $key) ? static::collapse($result) : $result;

173

174 /**

175 * Pluck an array of values from an array.

176 *

177 * @param array $array

181 * @return array

182 */

183 protected static function pluck($array, $value, $key = null)

184 {

185 $results = [];

enumerable_test.rb (https://github.com/kuroda/rails.git) Ruby · 136 lines

128 end

129

130 def test_pluck_single_method

131 person = Struct.new(:name)

132 people = [ person.new("David"), person.new("Jamie") ]

133

134 assert_equal [ "David", "Jamie" ], people.pluck(:name)

135 end

136 end

rut4.htm (https://github.com/pcalcado/StMarkov.git) HTML · 178 lines

70 4:7</font>

71 <td>

72 Now this was the manner in former time in Israel concerning redeeming and concerning changing, for to confirm all things; a man plucked off his shoe, and gave it to his neighbour: and this was a testimony in Israel. <tr>

73 <td valign=top>

74 <font size=-1>

conversations_controller.rb (https://github.com/prellele/diaspora.git) Ruby · 121 lines

38 recipients_param, column = [%i(contact_ids id), %i(person_ids person_id)].find {|param, _| params[param].present? }

39 if recipients_param

40 person_ids = current_user.contacts.mutual.where(column => params[recipients_param].split(",")).pluck(:person_id)

41 end

42

101 current_user.contacts.find(params[:contact_id]).id

102 elsif params[:aspect_id]

103 current_user.aspects.find(params[:aspect_id]).contacts.pluck(:id).join(",")

104 end

105

114 def contacts_data

115 current_user.contacts.mutual.joins(person: :profile)

116 .pluck(*%w(contacts.id profiles.first_name profiles.last_name people.diaspora_handle))

117 .map {|contact_id, *name_attrs|

118 {value: contact_id, name: ERB::Util.h(Person.name_from_attrs(*name_attrs)) }

query_cache_spec.rb (https://gitlab.com/vsailakshmi/mongoid) Ruby · 446 lines

371 end

372

373 it "#pluck returns the same count of objects" do

374 expect(Band.pluck(:name).length).to eq(123)

387 end

388

389 it "returns the same count of objects when using #pluck" do

390 expect(Band.pluck(:name).length).to eq(123)

sa-TotalMonthly.js (https://gitlab.com/stoicsoftware/netsuite-sku-analytics) JavaScript · 252 lines

244 * @function values

245 */

246 var values = R.pluck("sales");

247

248 exports.values = values;

has_custom_fields.rb (https://gitlab.com/Ruwan-Ranganath/discourse) Ruby · 222 lines

59

60 klass.where(foreign_key => ids, :name => whitelisted_fields)

61 .pluck(foreign_key, :name, :value).each do |cf|

62 result[cf[0]] ||= {}

63 append_custom_field(result[cf[0]], cf[1], cf[2])

95 .where("#{fk} in (?)", map.keys)

96 .where("name in (?)", fields)

97 .pluck(fk, :name, :value).each do |id, name, value|

98

99 preloaded = map[id].preloaded_custom_fields

213 def refresh_custom_fields_from_db

214 target = Hash.new

215 _custom_fields.pluck(:name,:value).each do |key, value|

216 self.class.append_custom_field(target, key, value)

217 end

completion_queue.h (https://gitlab.com/AshleyMcVeigh/cloudComputingAssignment) C Header · 100 lines

42 /* These trace flags default to 1. The corresponding lines are only traced

43 if grpc_api_trace is also truthy */

44 extern int grpc_cq_pluck_trace;

45 extern int grpc_cq_event_timeout_trace;

46 extern int grpc_trace_operation_failures;

validators.rb (https://gitlab.com/jamgregory/gitlab-ce) Ruby · 316 lines

304

305 def aliases(value)

306 value.select { |s| s.is_a?(Hash) && s[:ports] }.pluck(:alias) # rubocop:disable CodeReuse/ActiveRecord

307 end

308

wp-backbone.js (https://gitlab.com/thisishayat/itv-2016) JavaScript · 386 lines

195 // view. Used in conjunction with `Views.render()`.

196 detach: function() {

197 $( _.pluck( this.all(), 'el' ) ).detach();

198 return this;

199 },

293 return this;

294

295 managers = _.chain( views ).pluck('views').flatten().value();

296

297 // Render the views if necessary.

305

306 // Insert or replace the views.

307 this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options );

308

309 // Set attached and trigger ready if the current view is already

favorites.html (https://repo.or.cz/cds-indico.git) HTML · 111 lines

74 dataType: 'json',

75 data: {

76 user_id: _.pluck(list, 'id')

77 },

78 traditional: true,

Revenues.php (https://github.com/akaunting/akaunting.git) PHP · 232 lines

33 $revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);

34

35 $customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');

36

37 $categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');

38

39 $accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');

40

41 return view('sales.revenues.index', compact('revenues', 'customers', 'categories', 'accounts'));

59 public function create()

60 {

61 $accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');

62

63 $currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();

getPageOfComment.php (https://github.com/WordPress/wordpress-develop.git) PHP · 549 lines

486 remove_filter( 'wp_get_current_commenter', array( $this, 'get_current_commenter' ) );

487

488 $this->assertContains( $new_unapproved, wp_list_pluck( $comments, 'comment_ID' ) );

489 }

490

535 );

536

537 $this->assertContains( $new_unapproved, wp_list_pluck( $comments, 'comment_ID' ) );

538

539 wp_set_current_user( $current_user );

otp_key_rotator.rb (https://gitlab.com/blackst0ne/gitlab-ce) Ruby · 87 lines

36 ActiveRecord::Base.transaction do

37 User.with_two_factor.in_batches do |relation| # rubocop: disable Cop/InBatches

38 rows = relation.pluck(:id, :encrypted_otp_secret, :encrypted_otp_secret_iv, :encrypted_otp_secret_salt)

39 rows.each do |row|

40 user = %i[id ciphertext iv salt].zip(row).to_h

qc_assay.rb (https://github.com/sanger/sequencescape.git) Ruby · 64 lines

13 .qc_results

14 .distinct

15 .pluck(:assay_type, :assay_version)

16 .map do |assay_type, assay_version|

17 create!(seed: qc_assay, properties: { assay_type: assay_type, assay_version: assay_version })

listing.rb (https://gitlab.com/atonb117/sharetribe) Ruby · 145 lines

105 )

106

107 ids = listings.pluck(:id)

108 ListingImage.where(listing_id: ids).destroy_all

109