query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Calculates tax and sets the tax_amount attribute It adds tax_amount across all line_items | def tax_total
self.tax_amount = line_items.inject(0.to_money) {|sum,l| sum + l.tax_amount }
self.tax_amount
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tax_total\n self.tax_amount = line_items.inject(Money.new(0, self.currency || Money.default_currency)) {|sum,l| sum + l.tax_amount }\n self.tax_rate # calculates average rate, leave for compatibility reasons\n self.tax_amount\n end",
"def tax_total\n self.tax_amount = line_items.inject(0.to_mone... | [
"0.81097406",
"0.8094271",
"0.8069933",
"0.7983228",
"0.7888361",
"0.7712322",
"0.7603968",
"0.75599104",
"0.75025153",
"0.7463609",
"0.74556184",
"0.7417416",
"0.74016404",
"0.7378952",
"0.73158586",
"0.7244204",
"0.7212161",
"0.71972996",
"0.71883035",
"0.7182206",
"0.71693... | 0.8239991 | 0 |
Gross amount including tax | def gross_total
self.gross_amount = self.net_total + self.tax_total
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gross_total_base\n net_total_base + tax_total_base\n end",
"def gross\n shop_sum_amount.to_f\n end",
"def gross\n \"%.2f\" % params['amount'].to_f\n end",
"def gross_total\n self.gross_amount = self.net_total + self.tax_total\n end",
"def gross_total\n self.... | [
"0.84241515",
"0.82324874",
"0.8151371",
"0.8142227",
"0.81110483",
"0.80715597",
"0.7923139",
"0.788691",
"0.78750384",
"0.78505445",
"0.7837462",
"0.78159577",
"0.7800431",
"0.774148",
"0.77377874",
"0.77335197",
"0.77287865",
"0.7724465",
"0.7704359",
"0.76974356",
"0.7697... | 0.8291345 | 1 |
is the number of line items stored in the order, though not to be confused by the items_count | def line_items_count
self.line_items.count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_items_count\n self.line_items.size\n end",
"def line_items_count\n self.line_items.size\n end",
"def items_count\n counter = 0\n self.line_items.each do |item|\n counter += item.quantity\n end\n counter\n end",
"def item_count\n self.line_... | [
"0.8230661",
"0.8137308",
"0.80761135",
"0.7706054",
"0.7498885",
"0.7437141",
"0.7413168",
"0.7388085",
"0.71818084",
"0.7095928",
"0.7057009",
"0.7049432",
"0.69631803",
"0.69130725",
"0.68500197",
"0.6790143",
"0.6747097",
"0.67358106",
"0.673511",
"0.67144257",
"0.6671206... | 0.83413106 | 0 |
Returns a commaseparated list of all errors found during the last attempt to create or update this +User+, as a String. | def get_all_errors
@user.errors.full_messages.compact.join(',')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_errors(user)\n user.errors.full_messages.collect { |msg| msg }\n end",
"def errors_string\n getErrors.map { |e| \"(#{e.object || ''}): #{e.error}\" }.join(', ').strip\n end",
"def user_error\n @user_error = @user.errors.full_messages.join(\", \") if @user.errors\n end",
"def erro... | [
"0.71963817",
"0.70207924",
"0.6992759",
"0.69470537",
"0.68783957",
"0.68774045",
"0.68539673",
"0.68101954",
"0.67272776",
"0.67213726",
"0.6628307",
"0.66108227",
"0.6581339",
"0.6579898",
"0.65383834",
"0.65383834",
"0.65375006",
"0.6537281",
"0.6537281",
"0.64647603",
"0... | 0.7678009 | 0 |
GET /electronica_consejeros GET /electronica_consejeros.json | def index
@electronica_consejeros = ElectronicaConsejero.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\r\n @electrica_consejeros = ElectricaConsejero.all\r\n end",
"def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end",
"def index\r\n @consejeros = Consejero.all\r\n end",
"def emergencias_en_c... | [
"0.6100777",
"0.6081103",
"0.6039845",
"0.5881513",
"0.58708245",
"0.5860574",
"0.57624704",
"0.575139",
"0.5743546",
"0.57031417",
"0.5685101",
"0.5678573",
"0.560582",
"0.5565333",
"0.55622256",
"0.5560455",
"0.5523816",
"0.5522598",
"0.55024314",
"0.54999936",
"0.5480792",... | 0.648375 | 0 |
POST /electronica_consejeros POST /electronica_consejeros.json | def create
respond_to do |format|
if @electronica_consejero.save
format.html { redirect_to @electronica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería electrónica correctamente.' }
format.json { render :show, status: :created, location: @electronica_consejero }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def electronica_consejero_params\r\n params.require(:electronica_consejero).permit(:nombre)\r\n end",
"def create\n \n @concesionarium = Concesionarium.new(concesionarium_params)\n @concesionarium.fecha_alta = DateTime.now\n @concesionarium.fin_jornada = params[:concesionarium][:fin_jornada]\... | [
"0.6034382",
"0.5672371",
"0.5455214",
"0.53913546",
"0.53644973",
"0.5353039",
"0.52604413",
"0.5205138",
"0.51874036",
"0.5186614",
"0.51464903",
"0.51287174",
"0.51047635",
"0.5099422",
"0.50955284",
"0.50713",
"0.50702494",
"0.5061025",
"0.504765",
"0.5043675",
"0.5041829... | 0.60219216 | 1 |
PATCH/PUT /electronica_consejeros/1 PATCH/PUT /electronica_consejeros/1.json | def update
respond_to do |format|
if @electronica_consejero.update(electronica_consejero_params)
format.html { redirect_to @electronica_consejero, notice: 'El nombre del consejero de ingeniería electrónica se actualizó correctamente.' }
format.json { render :show, status: :ok, location: @e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n for... | [
"0.6047602",
"0.6046005",
"0.60180074",
"0.5981659",
"0.59791887",
"0.5950685",
"0.5935914",
"0.59140956",
"0.59004563",
"0.59002775",
"0.58948636",
"0.58830106",
"0.586124",
"0.58570755",
"0.58549315",
"0.5812071",
"0.580023",
"0.57882714",
"0.57808936",
"0.57789594",
"0.577... | 0.63673013 | 0 |
DELETE /electronica_consejeros/1 DELETE /electronica_consejeros/1.json | def destroy
@electronica_consejero.destroy
respond_to do |format|
format.html { redirect_to electronica_consejeros_url, notice: 'El nombre del consejero de ingeniería electrónica se eliminó correctamente.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\r\n @electrica_consejero.destroy\r\n respond_to do |format|\r\n format.html { redirect_to electrica_consejeros_url, notice: 'El nombre del consejero de eléctrica se eliminó corrctamente.' }\r\n format.json { head :no_content }\r\... | [
"0.6801077",
"0.6752767",
"0.6747374",
"0.6673283",
"0.66552454",
"0.6636401",
"0.6630204",
"0.6629538",
"0.66218483",
"0.66087455",
"0.65999186",
"0.65981585",
"0.6586303",
"0.6584271",
"0.65812665",
"0.65766263",
"0.65762043",
"0.65662324",
"0.6565228",
"0.65646076",
"0.656... | 0.70612186 | 0 |
GET /aggregate_metadata/new GET /aggregate_metadata/new.json | def new
@aggregate_metadatum = AggregateMetadatum.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @aggregate_metadatum }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @generic_table_aggregation = GenericTable::Aggregation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generic_table_aggregation }\n end\n end",
"def new\n @aggregate = Aggregate.new\n\n respond_to do |format|\n format.html # new.... | [
"0.72327894",
"0.6883761",
"0.6498169",
"0.6356635",
"0.6336749",
"0.6269028",
"0.62444663",
"0.6195283",
"0.61915267",
"0.6171218",
"0.6136683",
"0.6108192",
"0.6089689",
"0.6065476",
"0.60532963",
"0.6044504",
"0.6021956",
"0.59996015",
"0.597882",
"0.59493625",
"0.59343773... | 0.7171001 | 1 |
DELETE /aggregate_metadata/1 DELETE /aggregate_metadata/1.json | def destroy
@aggregate_metadatum = AggregateMetadatum.find(params[:id])
@aggregate_metadatum.destroy
respond_to do |format|
format.html { redirect_to aggregate_metadata_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @aggregate = Aggregate.find(params[:id])\n @aggregate.destroy\n\n respond_to do |format|\n format.html { redirect_to(aggregates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @generic_table_aggregation = GenericTable::Aggregation.find(params[:id])\n @gen... | [
"0.7061719",
"0.6940591",
"0.665821",
"0.6319405",
"0.62139046",
"0.6188711",
"0.6140643",
"0.61159766",
"0.6101576",
"0.60518104",
"0.602551",
"0.6022767",
"0.60000885",
"0.599431",
"0.5991459",
"0.5990706",
"0.598761",
"0.5963732",
"0.5950042",
"0.59485394",
"0.5941474",
... | 0.74667597 | 0 |
Custom contexts This contexts provides all of the base hooks for testing against a cinchbot. It reduces the boilerplate code needed to run each test. It should only be used in the outermost context, as it creates and runs fake IRCd and cinchbot instances. | def describe_with_cinchbot(comment, &block)
context_class = context comment.to_s do
before(:context) do
@config = YAML.load_file File.join(TEST_ROOT, '/_config/cinchize.yml')
@ircd = Ircd.new @config['servers']['network_test']['nick'], @config['servers']['network_test']['channels'].first
@cinchb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tests(context = {})\n run_context(context)\n end",
"def setup_context\n context_methods.each do |m|\n @context.add_method m, self\n end\n\n @context.define_klass\n end",
"def context\n @context ||= new_context_mock(context_options, &finalize_proc)\n end"... | [
"0.6209821",
"0.6195415",
"0.60751075",
"0.6064487",
"0.5959",
"0.58956283",
"0.58710104",
"0.5670166",
"0.56409824",
"0.5559945",
"0.5499777",
"0.5499178",
"0.54598486",
"0.5417015",
"0.54143494",
"0.54040986",
"0.53947157",
"0.5393126",
"0.5379289",
"0.5352164",
"0.53438437... | 0.688177 | 0 |
message has been sent? | def msg_sent?
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def message_sent?\n message.state == 'sent'\n end",
"def message_sent?\n message.state == 'sent'\n end",
"def sent?\n @sent\n end",
"def sent?\n status == \"sent\"\n end",
"def sent?\n self.status == 'sent'\n end",
"def isMyMessage(message)\r\n return message[:type] == :S... | [
"0.8284723",
"0.8284723",
"0.75959855",
"0.7551515",
"0.75130814",
"0.7225751",
"0.72045344",
"0.70935863",
"0.6979547",
"0.68958366",
"0.68540007",
"0.68062705",
"0.6784982",
"0.6754748",
"0.6736147",
"0.67246544",
"0.6672796",
"0.6665824",
"0.6585081",
"0.654586",
"0.653150... | 0.8725867 | 0 |
Returns an array of symbols. one symbol (column name) for each column that contains errors. | def get_columns_with_errors(model_instance)
list = model_instance.errors.map {|e| e[0].to_sym}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def symbols cols\n decode_values :symbol, cols, true\n end",
"def symbol cols\n decode_values :symbol, cols\n end",
"def errors_for row\n ie = insert_error_for row\n return ie.errors if ie\n []\n end",
"def get_error_codes\n return [] unless has_errors\n\n ... | [
"0.66292393",
"0.6391423",
"0.6194046",
"0.61458564",
"0.5905524",
"0.5859968",
"0.5776734",
"0.57351685",
"0.5727503",
"0.57231647",
"0.568443",
"0.568443",
"0.5652499",
"0.56431997",
"0.5600503",
"0.5600503",
"0.5599031",
"0.55888855",
"0.5582325",
"0.55708283",
"0.5569409"... | 0.6694419 | 0 |
GET /item_classifications GET /item_classifications.json | def index
@item_classifications = ItemClassification.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classifications(classification)\n params = {\n classification: classification\n }.compact\n\n _get(\"/account/classifications\", params) { |json| json }\n end",
"def classifications\n classifications = @data[\"spData\"][\"classifications\"]\n if not classification... | [
"0.74938947",
"0.6546676",
"0.6271978",
"0.6238248",
"0.6019618",
"0.58877903",
"0.57893974",
"0.5712213",
"0.5604467",
"0.5598566",
"0.55552894",
"0.55282336",
"0.5467039",
"0.54494196",
"0.53976893",
"0.53608805",
"0.5352641",
"0.5285223",
"0.5266499",
"0.5261266",
"0.51702... | 0.7134696 | 1 |
POST /item_classifications POST /item_classifications.json | def create
@item_classification = ItemClassification.new(item_classification_params)
respond_to do |format|
if @item_classification.save
format.html { redirect_to @item_classification, notice: 'Classificação criada com sucesso.' }
format.json { render :show, status: :created, location: @i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n Rails.logger.debug \"[ClassificationsController.create] params.class: #{params.class}, params: #{params}\"\n @classifaction = Classification.new transaction_data: params\n @classifaction.classifiers << StatusCodeClassifier.classify( @classifaction.transaction_data )\n @classifaction.classi... | [
"0.68752795",
"0.64235",
"0.6372544",
"0.62622815",
"0.62548167",
"0.6230983",
"0.6185281",
"0.5894135",
"0.5883754",
"0.58039016",
"0.5800194",
"0.57796615",
"0.5743276",
"0.5738392",
"0.5689296",
"0.5666848",
"0.5621386",
"0.5615849",
"0.55777454",
"0.5522593",
"0.5520628",... | 0.70518345 | 0 |
PATCH/PUT /item_classifications/1 PATCH/PUT /item_classifications/1.json | def update
respond_to do |format|
if @item_classification.update(item_classification_params)
format.html { redirect_to @item_classification, notice: 'Classificação atualizada com sucesso.' }
format.json { render :show, status: :ok, location: @item_classification }
else
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @item_class = ItemClass.find(params[:id])\n\n respond_to do |format|\n if @item_class.update_attributes(params[:item_class])\n format.html { redirect_to @item_class, notice: 'Item class was successfully updated.' }\n format.json { head :no_content }\n else\n format... | [
"0.6593257",
"0.64225215",
"0.62495756",
"0.6179234",
"0.6169899",
"0.6161875",
"0.6157613",
"0.60572004",
"0.60232407",
"0.60232407",
"0.5975808",
"0.59710115",
"0.59693754",
"0.5926297",
"0.5923737",
"0.5919885",
"0.59079075",
"0.5902889",
"0.58795124",
"0.58580303",
"0.585... | 0.69023466 | 0 |
DELETE /item_classifications/1 DELETE /item_classifications/1.json | def destroy
@item_classification.destroy
respond_to do |format|
format.html { redirect_to item_classifications_url, notice: 'Classificação destruída com sucesso.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @item_class = ItemClass.find(params[:id])\n @item_class.destroy\n\n respond_to do |format|\n format.html { redirect_to item_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classification = Classification.find(params[:id])\n @classification... | [
"0.7069697",
"0.6966737",
"0.68684375",
"0.67958045",
"0.6764732",
"0.67601055",
"0.6741788",
"0.6691405",
"0.66383344",
"0.6622998",
"0.66023725",
"0.660065",
"0.65795094",
"0.657431",
"0.6515739",
"0.6508714",
"0.6505545",
"0.6489697",
"0.6486918",
"0.64576644",
"0.64466316... | 0.7602507 | 0 |
Find an `at_version` argument passed to a parent node. If one is found, then a design collection further up the AST has been filtered to reflect designs at that version, and so for consistency we should only present versions up to the given version here. | def at_version_arg(parent)
::Gitlab::Graphql::FindArgumentInParent.find(parent, :at_version, limit_depth: 4)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def at_version_arg(parent)\n # TODO: remove coercion when the compatibility layer is removed\n # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883\n version_id = ::Gitlab::Graphql::FindArgumentInParent.find(parent, :at_version, limit_depth: 4)\n version_id &&= VersionID.coerce_i... | [
"0.71986735",
"0.5502757",
"0.5502757",
"0.5296875",
"0.5281093",
"0.4997072",
"0.49869972",
"0.49748644",
"0.49568602",
"0.487335",
"0.48587286",
"0.48185122",
"0.47545165",
"0.4742101",
"0.47158268",
"0.47158268",
"0.47040713",
"0.47036502",
"0.46931508",
"0.4666548",
"0.46... | 0.75336194 | 0 |
test_reviewer_home Description: This method does the functional testing for the reviewer methods | def test_reviewer_home
post('index', {}, {})
assert_response(:success)
assert_template('tracker/index')
post('index', {}, lee_hweng_session)
assert_response(:success)
assert_template('tracker/reviewer_home')
#follow_redirect
#assert_no_tag :content => "POST Placement Review"
en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reviewer_home_setup\n\n @my_processed_reviews = DesignReview.my_processed_reviews(@logged_in_user)\n @my_unprocessed_reviews = DesignReview.my_unprocessed_reviews(@logged_in_user)\n @reviews_assigned_to_peers = DesignReview.reviews_assigned_to_peers(@logged_in_user)\n\n end",
"def test_Book... | [
"0.66551423",
"0.6332203",
"0.6191129",
"0.6191129",
"0.6176587",
"0.6167756",
"0.61099386",
"0.61099386",
"0.60264146",
"0.60121715",
"0.59816504",
"0.59816504",
"0.59480685",
"0.5923119",
"0.59166485",
"0.58933574",
"0.58933574",
"0.5888269",
"0.5796731",
"0.578586",
"0.575... | 0.6645554 | 1 |
test_home_page_redirects Description: This method does the functional testing for the home page redirects. | def test_home_page_redirects
post('admin_home', {}, {})
assert_redirected_to(:controller => 'tracker', :action => 'index')
post('reviewer_home', {}, {})
assert_redirected_to(:controller => 'tracker', :action => 'index')
post('manager_home', {}, {})
assert_redirected_to(:controller =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_home\n @current_test_name = \"Arch - Testing Home Page\"\n each_driver do\n each_view_redirects do\n common_elements?\n end\n end\n end",
"def test_redirection_location\n process :redirect_internal\n assert_equal 'http://test.host/nothing', @response.redirect_url\n\n ... | [
"0.7320344",
"0.6360665",
"0.6324019",
"0.62512463",
"0.6250545",
"0.6201612",
"0.61067814",
"0.60999626",
"0.60927147",
"0.6078423",
"0.60599536",
"0.60433877",
"0.600914",
"0.60048026",
"0.6003172",
"0.5982656",
"0.5966661",
"0.5938803",
"0.59338015",
"0.59211093",
"0.59140... | 0.78483963 | 0 |
GET /evaluation_builders GET /evaluation_builders.json | def index
@evaluation_builders = @event.evaluation_builders
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def builders\n @builders ||= {}\n end",
"def create\n @evaluation_builder = @event.evaluation_builders.new(evaluation_builder_params)\n @evaluation_builder.organization_id = @event.organization_id\n respond_to do |format|\n if @evaluation_builder.save\n format.html { redirect_to @eva... | [
"0.6326024",
"0.58953494",
"0.5822067",
"0.5636837",
"0.54995126",
"0.5397109",
"0.53636914",
"0.5260947",
"0.5214089",
"0.521052",
"0.51593083",
"0.51208234",
"0.51040334",
"0.5094756",
"0.5084226",
"0.50473994",
"0.5046111",
"0.5041808",
"0.5023494",
"0.4996326",
"0.4972197... | 0.7164198 | 0 |
POST /evaluation_builders POST /evaluation_builders.json | def create
@evaluation_builder = @event.evaluation_builders.new(evaluation_builder_params)
@evaluation_builder.organization_id = @event.organization_id
respond_to do |format|
if @evaluation_builder.save
format.html { redirect_to @evaluation_builder, notice: 'Evaluation builder was successfully... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @evaluation_builders = @event.evaluation_builders\n end",
"def evaluation_params\n params.require(:evaluation).permit(:collection, :resource, :body, :result, :executor, :title, :metrics, :subject)\n end",
"def evaluation_params\n params.require(:evaluation).permit(:collection, :res... | [
"0.63914",
"0.5834215",
"0.5834215",
"0.57765204",
"0.57526314",
"0.5736498",
"0.569705",
"0.56586725",
"0.56586367",
"0.5571939",
"0.55618864",
"0.55255866",
"0.55159396",
"0.5493366",
"0.5493366",
"0.5467565",
"0.5453863",
"0.5396073",
"0.5345025",
"0.5343318",
"0.5337721",... | 0.70834404 | 0 |
PATCH/PUT /evaluation_builders/1 PATCH/PUT /evaluation_builders/1.json | def update
respond_to do |format|
if @evaluation_builder.update(evaluation_builder_params)
format.html { redirect_to @evaluation_builder, notice: 'Evaluation builder was successfully updated.' }
format.json { render :show, status: :ok, location: @evaluation_builder }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @evaluation_builder = @event.evaluation_builders.new(evaluation_builder_params)\n @evaluation_builder.organization_id = @event.organization_id\n respond_to do |format|\n if @evaluation_builder.save\n format.html { redirect_to @evaluation_builder, notice: 'Evaluation builder was su... | [
"0.5711061",
"0.5580612",
"0.549172",
"0.5483218",
"0.54497766",
"0.54361546",
"0.5428085",
"0.54264385",
"0.53789794",
"0.5352767",
"0.53516227",
"0.53516227",
"0.53445953",
"0.5344294",
"0.5304438",
"0.53012675",
"0.5297968",
"0.52935",
"0.5289626",
"0.52838945",
"0.5276668... | 0.68652815 | 0 |
DELETE /evaluation_builders/1 DELETE /evaluation_builders/1.json | def destroy
@evaluation_builder.destroy
respond_to do |format|
format.html { redirect_to event_evaluation_builders_url(@event), notice: 'Evaluation builder was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rem_builder oid\n self.builders.delete oid\n end",
"def destroy\n @url_builder.destroy\n respond_to do |format|\n format.html { redirect_to url_builders_url, notice: 'Url builder was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evalu... | [
"0.67231166",
"0.62074894",
"0.6199313",
"0.61060494",
"0.61060494",
"0.6061286",
"0.6029576",
"0.6011401",
"0.60045004",
"0.5986365",
"0.59796447",
"0.58635396",
"0.5848857",
"0.58459795",
"0.5818568",
"0.58004755",
"0.57907605",
"0.5776911",
"0.57758254",
"0.57729393",
"0.5... | 0.72185 | 0 |
Calculate and set the corrective_change parameter, based on the old_system_value of the property. | def calculate_corrective_change(old_system_value)
# Only idempotent properties, and cases where we have an old system_value
# are corrective_changes.
if @property_instance.idempotent? &&
!@property_instance.sensitive &&
!old_system_value.nil?
# If the values aren't insync, we have confi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def changed_value(property)\n new_value = new_resource.send(property)\n return new_value if current_resource.nil?\n\n current_value = current_resource.send(property)\n\n return current_value if required_properties.include? property\n\n new_value == current_value ? nil : new_value\n end",
"def cha... | [
"0.6497386",
"0.60641843",
"0.6031669",
"0.5838843",
"0.5789279",
"0.5634075",
"0.55774206",
"0.5522548",
"0.55003774",
"0.54552",
"0.54224056",
"0.54061586",
"0.53566515",
"0.53543466",
"0.534424",
"0.53415537",
"0.5340293",
"0.53168666",
"0.5264588",
"0.52580327",
"0.524801... | 0.81333745 | 0 |
If it's a failure, use 'err', else use either the resource's log level (if available) or 'notice'. | def log_level
status == "failure" ? :err : (@default_log_level || :notice)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rollbar_level(severity)\n [:debug, :info, :warning, :error, :critical, :error][severity] || :error\n end",
"def level\n Logger::Severity.constants.each do |name|\n return name.downcase.to_sym if @logger.level.eql?(Logger::Severity.const_get(name))\n end\n raise \"error\"\n en... | [
"0.6471586",
"0.64533466",
"0.6344949",
"0.6226175",
"0.61946154",
"0.6092242",
"0.60480857",
"0.60421276",
"0.60421276",
"0.602095",
"0.60084015",
"0.60084015",
"0.59934914",
"0.59897155",
"0.5955885",
"0.5925081",
"0.5910066",
"0.58708024",
"0.5869981",
"0.5863575",
"0.5828... | 0.7750526 | 0 |
Remove the node if it is in a list. You should be careful to only remove nodes that are part of this list. | def remove?(node)
if node.head
return remove!(node)
end
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_from_list\n if in_list?\n decrement_positions_on_lower_items\n set_list_position(nil)\n end\n end",
"def remove_from_list(list)\n li = Fl::Framework::List::ListItem.query_for_listable_in_list(self, list).first\n if li.nil?\n false\n... | [
"0.6642302",
"0.6596331",
"0.64553654",
"0.6414349",
"0.63419306",
"0.63090044",
"0.62986803",
"0.62652946",
"0.62407154",
"0.617381",
"0.61465704",
"0.60795605",
"0.6079463",
"0.6073038",
"0.60277075",
"0.60013115",
"0.594602",
"0.59304744",
"0.5924987",
"0.5914537",
"0.5893... | 0.689051 | 0 |
update survey_answer, journal_entry.answered_at, csv_survey_answers.age, csv_score_rapports.age | created_at, csv_answers.age | def update_date
entry = JournalEntry.find(params[:journal_entry][:id])
entry.follow_up = params[:journal_entry][:follow_up]
date_param = params[:journal_entry][:created]
if date_param.blank?
entry.save
flash[:notice] = "Opfølgning er rettet"
redirect_to journaL_path(entry.journal)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateAnswer(ls,time)\n # ls is a list of list of answerd_factor_id, statistic_id pairs\n # t contains date information\n puts ls.inspect\n ls.each do |e|\n sid = e[0][1].to_i\n stat = Statistic.where(id: sid)\n\n amount = stat[0].EvalEquation(current_user.id, e)\n #if exists\n ... | [
"0.6230133",
"0.58326024",
"0.5832444",
"0.58173835",
"0.5680395",
"0.56374854",
"0.56374854",
"0.5615608",
"0.56051624",
"0.5558463",
"0.5546829",
"0.5539872",
"0.5533647",
"0.55181533",
"0.55128765",
"0.55125326",
"0.5503305",
"0.5495543",
"0.5476523",
"0.54755694",
"0.5475... | 0.6391308 | 0 |
GET /post302s/new GET /post302s/new.xml | def new
@post302 = Post302.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post302 }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @post302 = Post302.new(params[:post302])\n\n respond_to do |format|\n if @post302.save\n format.html { redirect_to(@post302, :notice => 'Post302 was successfully created.') }\n format.xml { render :xml => @post302, :status => :created, :location => @post302 }\n else\n ... | [
"0.72212535",
"0.65230787",
"0.6439",
"0.6321765",
"0.6261677",
"0.62541753",
"0.62162423",
"0.6197615",
"0.61881196",
"0.6173761",
"0.61640406",
"0.6133067",
"0.6119894",
"0.6119476",
"0.6112073",
"0.61101675",
"0.61096144",
"0.60991657",
"0.6096511",
"0.6085207",
"0.6083968... | 0.7872124 | 0 |
POST /post302s POST /post302s.xml | def create
@post302 = Post302.new(params[:post302])
respond_to do |format|
if @post302.save
format.html { redirect_to(@post302, :notice => 'Post302 was successfully created.') }
format.xml { render :xml => @post302, :status => :created, :location => @post302 }
else
format.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @post302 = Post302.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post302 }\n end\n end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def handle_302_found(respons... | [
"0.6120217",
"0.5955325",
"0.5949562",
"0.59292334",
"0.5918934",
"0.5697211",
"0.56586057",
"0.55532104",
"0.5456347",
"0.54507",
"0.54414684",
"0.542774",
"0.5393097",
"0.53402615",
"0.53277475",
"0.5300678",
"0.5291032",
"0.5270065",
"0.52504176",
"0.51715666",
"0.5163437"... | 0.67140645 | 0 |
PUT /post302s/1 PUT /post302s/1.xml | def update
@post302 = Post302.find(params[:id])
respond_to do |format|
if @post302.update_attributes(params[:post302])
format.html { redirect_to(@post302, :notice => 'Post302 was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n... | [
"0.6011841",
"0.59300005",
"0.591647",
"0.57253903",
"0.5571001",
"0.5543961",
"0.5415907",
"0.5407396",
"0.5377314",
"0.53258103",
"0.5306364",
"0.530303",
"0.5289401",
"0.5247236",
"0.5246094",
"0.5211587",
"0.52012855",
"0.5182247",
"0.5178692",
"0.5175493",
"0.51650393",
... | 0.65349734 | 0 |
DELETE /post302s/1 DELETE /post302s/1.xml | def destroy
@post302 = Post302.find(params[:id])
@post302.destroy
respond_to do |format|
format.html { redirect_to(post302s_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @post306 = Post306.find(params[:id])\n @post306.destroy\n\n respond_to do |format|\n format.html { redirect_to(post306s_ur... | [
"0.68401355",
"0.67884856",
"0.67702645",
"0.6734704",
"0.67324454",
"0.6721978",
"0.66853327",
"0.666699",
"0.66553324",
"0.6646322",
"0.66428",
"0.6632472",
"0.6623396",
"0.66042864",
"0.65998757",
"0.6596214",
"0.65933204",
"0.6580198",
"0.6576345",
"0.6572139",
"0.6567020... | 0.73653924 | 0 |
Sets the number of columns defined in TotalSpaces2. This does not change the actual number of desktops present, you should call add_desktops_on_display or remove_desktops_on_display as appropriate after changing the number of columns. display_id = TotalSpaces2.main_display[:display_id] TotalSpaces2.set_grid_columns_on_... | def set_grid_columns_on_display(columns, display_id)
TSApi.tsapi_setDefinedColumnsOnDisplay(columns, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_grid_columns(columns)\n TSApi.tsapi_setDefinedColumnsOnDisplay(columns, 0)\n end",
"def columns=(n)\n @columns = n\n end",
"def columns=(integer); end",
"def set_cols(visible, list)\n @rows = 1 if visible\n @cols = (depends_on & list).find_all { |u| u.visible }.inject(0) { |s, v... | [
"0.6480799",
"0.6065957",
"0.57874715",
"0.5679564",
"0.56277114",
"0.55837053",
"0.5569885",
"0.55534035",
"0.55436236",
"0.5448767",
"0.5390982",
"0.53886837",
"0.5314076",
"0.5309804",
"0.5278624",
"0.5226935",
"0.52188313",
"0.520026",
"0.519874",
"0.51839453",
"0.5180914... | 0.64236224 | 1 |
Command TotalSpaces2 to switch to the given space number on the main display. Returns false if the space number was invalid. The on_space_change notification will be sent. TotalSpaces2.move_to_space(1) | def move_to_space(space_number)
TSApi.tsapi_moveToSpaceOnDisplay(space_number, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_to_space_on_display(space_number, display_id)\n TSApi.tsapi_moveToSpaceOnDisplay(space_number, display_id)\n end",
"def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)\n TSApi.tsapi_moveSpaceOnDisplayToPositionOnDisplay(space_numbe... | [
"0.67794645",
"0.6774059",
"0.65374786",
"0.63984084",
"0.63631827",
"0.60728097",
"0.54985917",
"0.541382",
"0.5356555",
"0.53110063",
"0.52830863",
"0.52224225",
"0.5218815",
"0.52141035",
"0.52128756",
"0.51518625",
"0.5148263",
"0.5148263",
"0.5148263",
"0.5148263",
"0.51... | 0.7209901 | 0 |
Command TotalSpaces2 to switch to the given space number. Returns false if the space number was invalid. The on_space_change notification will be sent. display_id = TotalSpaces2.main_display[:display_id] TotalSpaces2.move_to_space_on_Display(1, display_id) | def move_to_space_on_display(space_number, display_id)
TSApi.tsapi_moveToSpaceOnDisplay(space_number, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_to_space(space_number)\n TSApi.tsapi_moveToSpaceOnDisplay(space_number, 0)\n end",
"def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)\n TSApi.tsapi_moveSpaceOnDisplayToPositionOnDisplay(space_number, from_display_id, position_num... | [
"0.7483297",
"0.7446562",
"0.7297412",
"0.70637596",
"0.68068033",
"0.65397274",
"0.5806738",
"0.56229657",
"0.55475396",
"0.55475396",
"0.55475396",
"0.55475396",
"0.55475396",
"0.5546392",
"0.5512218",
"0.55027515",
"0.5498527",
"0.5412345",
"0.53761727",
"0.5375988",
"0.53... | 0.78626525 | 0 |
Set the name for a space on the main display. Note that using this command will cause a layout change notification to be sent if the new name was different from that previously set. The maximum length for a name is 255 bytes. TotalSpaces2.set_name_for_space(1, "Home") | def set_name_for_space(space_number, name)
TSApi.tsapi_setNameForSpaceOnDisplay(space_number, name, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def home_name=(n)\n @home_name = n\n end",
"def set_name_for_space_on_display(space_number, name, display_id)\n TSApi.tsapi_setNameForSpaceOnDisplay(space_number, name, display_id)\n end",
"def changeName\r\n\t\tcheckSpace\r\n\tend",
"def change_space(namespace)\n update!(name: namespace)\n e... | [
"0.66215265",
"0.6485476",
"0.6408985",
"0.6023407",
"0.5976263",
"0.59232134",
"0.58171034",
"0.5785348",
"0.5760498",
"0.57510954",
"0.57435024",
"0.5672328",
"0.5667304",
"0.56596595",
"0.56539947",
"0.5625127",
"0.5606262",
"0.55691904",
"0.55521786",
"0.55503356",
"0.555... | 0.7430568 | 0 |
Set the name for a space. Note that using this command will cause a layout change notification to be sent if the new name was different from that previously set. The maximum length for a name is 255 bytes. display_id = TotalSpaces2.main_display[:display_id] TotalSpaces2.set_name_for_space_on_display(1, "Home", display_... | def set_name_for_space_on_display(space_number, name, display_id)
TSApi.tsapi_setNameForSpaceOnDisplay(space_number, name, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name_for_space(space_number, name)\n TSApi.tsapi_setNameForSpaceOnDisplay(space_number, name, 0)\n end",
"def home_name=(n)\n @home_name = n\n end",
"def changeName\r\n\t\tcheckSpace\r\n\tend",
"def set_space\n @space = Space.friendly.find(params[:id])\n redirect_to root_path un... | [
"0.7669021",
"0.6507637",
"0.6115902",
"0.6037224",
"0.6016562",
"0.60126317",
"0.5878414",
"0.5840199",
"0.58168834",
"0.57529753",
"0.57074565",
"0.5701779",
"0.5652545",
"0.5632509",
"0.5632509",
"0.5632509",
"0.5632509",
"0.5632509",
"0.5631495",
"0.5623806",
"0.5623806",... | 0.7571915 | 1 |
Cancel the on_space_change notification. | def cancel_on_space_change
$tsapi_on_space_change_block = nil
TSApi.tsapi_unsetSpaceWillChangeCallback
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancel\n super\n end",
"def cancel\n super\n end",
"def cancel\n super\n end",
"def destroy\n raise User::NotAuthorized, '삭제할 권한이 없습니다.' unless @space.updatable_by?(current_user)\n @space.destroy\n\n broadcast_delete_space(@space)\n end",
"def on_cancel\n\n doc = fetch(... | [
"0.5200666",
"0.5200666",
"0.5200666",
"0.51932776",
"0.51841074",
"0.5148234",
"0.5112529",
"0.5112529",
"0.510946",
"0.50615185",
"0.5046747",
"0.5046747",
"0.5046178",
"0.5045477",
"0.5045477",
"0.5045477",
"0.5045477",
"0.5045477",
"0.5045477",
"0.5045477",
"0.5045477",
... | 0.845955 | 0 |
Cancel the layout change notification | def cancel_on_layout_change
$tsapi_on_layout_change_block = nil
TSApi.tsapi_unsetLayoutChangedCallback
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onCancel(flag, view)\n self.reset(view)\n end",
"def onCancel(flag, view)\n self.reset(view)\n \tSketchup.undo\n end",
"def onCancel(flag, view)\n self.reset(view)\nend",
"def onCancel flag, view\n ## puts \"onCancel called\"\n\t\tself.reset(view)\n\tend",
"def uninstall\n ... | [
"0.6553298",
"0.6476466",
"0.6429745",
"0.61539626",
"0.57015985",
"0.5637399",
"0.5637399",
"0.5637399",
"0.56311345",
"0.56242657",
"0.5615695",
"0.5611285",
"0.5603243",
"0.559045",
"0.55856735",
"0.55856735",
"0.55856735",
"0.55856735",
"0.55856735",
"0.55856735",
"0.5585... | 0.800208 | 0 |
Move a window to a given space The window_id parameter must be fetched using window_list. Returns false if the space_number or window_id is invalid. | def move_window_to_space(window_id, space_number)
TSApi.tsapi_moveWindowToSpaceOnDisplay(window_id, space_number, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_window_to_space_on_display(window_id, space_number, display_id)\n TSApi.tsapi_moveWindowToSpaceOnDisplay(window_id, space_number, display_id)\n end",
"def move(new_session, new_number)\n return if @session == new_session && @number == new_number\n target = \"%s:%s\" % [new_session.iden... | [
"0.71380687",
"0.65211385",
"0.5892226",
"0.5865455",
"0.58550644",
"0.57853323",
"0.56763864",
"0.56398386",
"0.5562855",
"0.5517389",
"0.55158377",
"0.53663987",
"0.5365342",
"0.5238219",
"0.521678",
"0.5127838",
"0.50720066",
"0.50328624",
"0.50002134",
"0.49600253",
"0.49... | 0.77395153 | 0 |
Move a window to a given space on the main display The window_id parameter must be fetched using window_list. Returns false if the space_number or window_id is invalid. | def move_window_to_space_on_display(window_id, space_number, display_id)
TSApi.tsapi_moveWindowToSpaceOnDisplay(window_id, space_number, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_window_to_space(window_id, space_number)\n TSApi.tsapi_moveWindowToSpaceOnDisplay(window_id, space_number, 0)\n end",
"def move(new_session, new_number)\n return if @session == new_session && @number == new_number\n target = \"%s:%s\" % [new_session.identifier, new_number]\n\n res... | [
"0.80645144",
"0.6797437",
"0.6611871",
"0.64104223",
"0.62135607",
"0.61805105",
"0.61400187",
"0.61280125",
"0.59365577",
"0.5893151",
"0.5538876",
"0.54859734",
"0.54701316",
"0.5466194",
"0.5423151",
"0.53313196",
"0.5321003",
"0.52708215",
"0.5143366",
"0.5132162",
"0.51... | 0.7871263 | 1 |
Move space to a new position in the grid on the main display. Returns false if the space_number or position_number is not valid. TotalSpaces2.move_space_to_position(4, 2) | def move_space_to_position(space_number, position_number)
TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_space_to_position_on_display(space_number, position_number, display_id)\n TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, display_id)\n end",
"def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)\n TSApi.tsap... | [
"0.7345556",
"0.70695674",
"0.6993478",
"0.6809427",
"0.6794172",
"0.6789958",
"0.67232746",
"0.67206734",
"0.6659641",
"0.6518978",
"0.6413597",
"0.6403341",
"0.6389916",
"0.6382818",
"0.6381655",
"0.6354069",
"0.6308633",
"0.6292757",
"0.6283047",
"0.62776273",
"0.62717736"... | 0.7570759 | 0 |
Move space to a new position in the grid. Spaces can only be moved within their own display. Returns false if the space_number or position_number is not valid. display_id = TotalSpaces2.main_display[:display_id] TotalSpaces2.move_space_to_position_on_display(4, 2, display_id) | def move_space_to_position_on_display(space_number, position_number, display_id)
TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)\n TSApi.tsapi_moveSpaceOnDisplayToPositionOnDisplay(space_number, from_display_id, position_number, to_display_id)\n end",
"def move_space_to_position(space_number, position_number)\n TSAp... | [
"0.7740621",
"0.73314995",
"0.7271876",
"0.67355883",
"0.6600612",
"0.65086293",
"0.64791816",
"0.6478934",
"0.64209586",
"0.63598627",
"0.6342338",
"0.63348615",
"0.62164384",
"0.6209217",
"0.61665946",
"0.6141446",
"0.6128524",
"0.60923576",
"0.60510427",
"0.60484475",
"0.5... | 0.7992506 | 0 |
Move space to a new position on another screen. This won't work if you do not have displays have separate spaces enabled. Returns false if any parameters are not valid. display_id = TotalSpaces2.main_display[:display_id] display2_id = TotalSpaces2.display_list[1][:display_id] TotalSpaces2.move_space_on_display_to_posit... | def move_space_on_display_to_position_on_display(space_number, from_display_id, position_number, to_display_id)
TSApi.tsapi_moveSpaceOnDisplayToPositionOnDisplay(space_number, from_display_id, position_number, to_display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_space_to_position_on_display(space_number, position_number, display_id)\n TSApi.tsapi_moveSpaceToPositionOnDisplay(space_number, position_number, display_id)\n end",
"def move_to_space_on_display(space_number, display_id)\n TSApi.tsapi_moveToSpaceOnDisplay(space_number, display_id)\n end... | [
"0.79717374",
"0.77973783",
"0.73388463",
"0.6965127",
"0.69021106",
"0.6571451",
"0.6274849",
"0.6184589",
"0.61284095",
"0.61111426",
"0.6009155",
"0.5993963",
"0.5879582",
"0.58258116",
"0.5806621",
"0.57327735",
"0.572874",
"0.5727635",
"0.5725887",
"0.5724171",
"0.570859... | 0.8166593 | 0 |
Add desktops There can be at most 16 desktops unless the display has collected some when a secondary display has been unplugged. Returns true on success, false if number_to_add was zero, or would result in more than 16 desktops. The on_layout_change notification will be sent if a changed was made. TotalSpaces2.add_desk... | def add_desktops(number_to_add)
TSApi.tsapi_addDesktopsOnDisplay(number_to_add, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_desktops_on_display(number_to_add, display_id)\n TSApi.tsapi_addDesktopsOnDisplay(number_to_add, display_id)\n end",
"def remove_desktops(number_to_remove)\n TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, 0)\n end",
"def desktops\n @desktops ||= if available?\n Libats... | [
"0.7062807",
"0.54731876",
"0.53513676",
"0.5337657",
"0.525137",
"0.51632684",
"0.49705702",
"0.48633435",
"0.48525223",
"0.48099914",
"0.47970316",
"0.4655567",
"0.46508253",
"0.45151818",
"0.44761214",
"0.4452858",
"0.44372815",
"0.44363898",
"0.44302163",
"0.4296588",
"0.... | 0.74095416 | 0 |
Add desktops There can be at most 16 desktops unless the display has collected some when a secondary display has been unplugged. Returns true on success, false if number_to_add was zero, or would result in more than 16 desktops. The on_layout_change notification will be sent if a changed was made. display_id = TotalSpa... | def add_desktops_on_display(number_to_add, display_id)
TSApi.tsapi_addDesktopsOnDisplay(number_to_add, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_desktops(number_to_add)\n TSApi.tsapi_addDesktopsOnDisplay(number_to_add, 0)\n end",
"def remove_desktops_on_display(number_to_remove, display_id)\n TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, display_id)\n end",
"def remove_desktops(number_to_remove)\n TSApi.tsapi_remove... | [
"0.7482838",
"0.61482394",
"0.569244",
"0.5281861",
"0.51685375",
"0.5076606",
"0.4891148",
"0.48880905",
"0.48796102",
"0.47549608",
"0.47183523",
"0.46594033",
"0.4594886",
"0.45712245",
"0.45316643",
"0.45222574",
"0.4403283",
"0.43503955",
"0.42971486",
"0.4292949",
"0.42... | 0.77525324 | 0 |
Remove desktops The highest numbered desktops are removed. Removing a desktop you are currently on will result in TotalSpaces2 switching to another dektop. Any windows present on a desktop being removed will be moved to one of the remaining desktops. Returns true on success, false if number_to_remove was zero or would ... | def remove_desktops(number_to_remove)
TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_desktops_on_display(number_to_remove, display_id)\n TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, display_id)\n end",
"def add_desktops(number_to_add)\n TSApi.tsapi_addDesktopsOnDisplay(number_to_add, 0)\n end",
"def desktops\n @desktops ||= if available?\n Libats... | [
"0.71847725",
"0.55630857",
"0.51586",
"0.48049235",
"0.46907488",
"0.46150577",
"0.4537496",
"0.4483417",
"0.4475176",
"0.4461352",
"0.44572833",
"0.4424133",
"0.43214753",
"0.42999113",
"0.42979833",
"0.42798176",
"0.42550057",
"0.42425928",
"0.42243078",
"0.4211777",
"0.42... | 0.784 | 0 |
Remove desktops The highest numbered desktops are removed. Removing a desktop you are currently on will result in TotalSpaces2 switching to another dektop. Any windows present on a desktop being removed will be moved to one of the remaining desktops. Returns true on success, false if number_to_remove was zero or would ... | def remove_desktops_on_display(number_to_remove, display_id)
TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, display_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_desktops(number_to_remove)\n TSApi.tsapi_removeDesktopsOnDisplay(number_to_remove, 0)\n end",
"def add_desktops_on_display(number_to_add, display_id)\n TSApi.tsapi_addDesktopsOnDisplay(number_to_add, display_id)\n end",
"def add_desktops(number_to_add)\n TSApi.tsapi_addDesktopsO... | [
"0.7939232",
"0.58576113",
"0.583454",
"0.51110566",
"0.46880496",
"0.46064773",
"0.4504501",
"0.44935206",
"0.44927365",
"0.4477538",
"0.44751856",
"0.44677877",
"0.44565356",
"0.4432883",
"0.44187096",
"0.44145742",
"0.43738288",
"0.43343857",
"0.43275428",
"0.43227485",
"0... | 0.81090945 | 0 |
Move a particular window to the front and activate it. This might be usful after moving windows to other desktops. | def set_front_window(window_id)
TSApi.tsapi_setFrontWindow(window_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bring_current_window_to_front\n @fox_driver.switch_to.window(@fox_driver.window_handles.first)\n end",
"def show_window\r\n if visible?\r\n bring_to_front()\r\n else\r\n show_modal()\r\n end\r\n end",
"def activate_process_window( pid )\n pid , hwnd = find_parent_pr... | [
"0.8180855",
"0.71666",
"0.68272626",
"0.672905",
"0.66991854",
"0.6625408",
"0.6625408",
"0.65658736",
"0.6436523",
"0.6216314",
"0.62056345",
"0.61770236",
"0.6118638",
"0.59979236",
"0.5974988",
"0.5963231",
"0.5954785",
"0.59114265",
"0.58638746",
"0.5833954",
"0.5806035"... | 0.71877915 | 1 |
Bind an app to a space. The bundle_id is normally in the format "com.apple.mail" Setting the space_uuid to AllSpaces will result in an app appearing on every desktop. Setting the space_uuid to nil will delete the setting for the given bundle_id. TotalSpaces2.bind_app_to_space("com.apple.mail", "AllSpaces") | def bind_app_to_space(bundle_id, space_uuid)
TSApi.tsapi_bindAppToSpace(bundle_id, space_uuid)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_app\n @app = App.find(params[:uid])\n end",
"def fill_app\n if @param_storage.app_id == nil\n apps = @app_service.all\n @param_storage.store_app_id(apps[0].id) if apps.count == 1\n end\n end",
"def modify_application(app_name, namespace, public_hostname)\n end",
... | [
"0.5276577",
"0.51932913",
"0.50844276",
"0.5054723",
"0.5017959",
"0.50005805",
"0.49933314",
"0.49660257",
"0.4934812",
"0.48842895",
"0.48402733",
"0.48287034",
"0.48214543",
"0.48156542",
"0.47961557",
"0.47172606",
"0.47152334",
"0.47052324",
"0.4700782",
"0.4697362",
"0... | 0.84763855 | 0 |
returns the current week, from the specified array of weeks, based on the weeks' start times | def get_current_week_from_weeks(weeks)
now = DateTime.now
weeks.each { |week|
if now < week.start_time
return (week.number - 1)
end
}
return weeks.last.number
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_week\n week_split.select { |c| c.include?(day) }.flatten\n end",
"def weeks\n\t\tk = offset( first_day.cwday )\n\n [ first_week( k ) ] + middle_weeks( DPW - k )\n end",
"def setup_weeks(week_start)\n a_date = self.first\n the_last = self.last\n @weeks = []\n\n while (a_date ... | [
"0.7211833",
"0.71016705",
"0.7082129",
"0.68672514",
"0.6796819",
"0.67799085",
"0.6770836",
"0.6714053",
"0.67011446",
"0.66379714",
"0.6625588",
"0.66176665",
"0.6592336",
"0.6592336",
"0.6567472",
"0.6564778",
"0.6496082",
"0.6460043",
"0.64545846",
"0.6451746",
"0.644248... | 0.71990055 | 1 |
returns the week number based on whether any games in that particular week have already started | def game_week
now = DateTime.now
all_games = NflSchedule.where(year: Date.today.year)
.order(:start_time)
week_started = 0
all_games.each { |game|
if (week_started < game.week) && (now > game.start_time)
week_started = game.week
end
}
return week_st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def week( date = Date.today )\n (0...weeks.size).find { |i| weeks[i].include? date } + 1\n end",
"def week\n working_date = DateTime.new(self.year, 1, 1)\n working_date.week_day_start = self.week_day_start\n working_date = (working_date-working_date.send(\"wday_offset\"))\n week_num = 0\n work... | [
"0.7157287",
"0.7049902",
"0.6924994",
"0.6918694",
"0.6899286",
"0.6851943",
"0.6797575",
"0.6718376",
"0.6714368",
"0.6697344",
"0.6673988",
"0.66644907",
"0.6648989",
"0.6647416",
"0.6618264",
"0.6610505",
"0.6610505",
"0.6570503",
"0.6503514",
"0.6502665",
"0.64974725",
... | 0.8510001 | 0 |
GET /university_profiles/1 GET /university_profiles/1.json | def show
@university_profile = UniversityProfile.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @university_profile }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university }\n end\n end",
"def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ... | [
"0.69243425",
"0.69243425",
"0.6900653",
"0.68601173",
"0.67913383",
"0.66611785",
"0.66429806",
"0.6641157",
"0.6624576",
"0.655977",
"0.6556821",
"0.65536",
"0.65536",
"0.6533507",
"0.6520157",
"0.65135384",
"0.650938",
"0.6475463",
"0.6452095",
"0.64447385",
"0.64406747",
... | 0.79866904 | 0 |
GET /university_profiles/new GET /university_profiles/new.json | def new
@university_profile = UniversityProfile.new
@university_profile.university_courses || @user.build_university_courses
respond_to do |format|
format.html # new.html.erb
format.json { render json: @university_profile }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @university_profile = UniversityProfile.new(params[:university_profile])\n \n respond_to do |format|\n if @university_profile.save\n format.html { redirect_to @university_profile, notice: 'University profile was successfully created.' }\n format.json { render json: ... | [
"0.7789181",
"0.75316393",
"0.75316393",
"0.7491082",
"0.7491082",
"0.7491082",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7471185",
"0.7407796",
"0.7406522",
"0.7333984",
"0.73157513",
"0.72933996",
"0.7232191",... | 0.76105875 | 1 |
POST /university_profiles POST /university_profiles.json | def create
@university_profile = UniversityProfile.new(params[:university_profile])
respond_to do |format|
if @university_profile.save
format.html { redirect_to @university_profile, notice: 'University profile was successfully created.' }
format.json { render json: @university... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @profile = Profile.create({\n name: params['profile']['name'],\n speciality: params['profile']['speciality'],\n city: params['profile']['city'],\n user_id: current_user['id']\n })\n @profile.save\n respond_with(@profile)\n end",
"def new\n @university_... | [
"0.6690696",
"0.64980185",
"0.6478158",
"0.6445904",
"0.6445904",
"0.6445125",
"0.64365804",
"0.6431544",
"0.63678014",
"0.63593143",
"0.6352346",
"0.6352069",
"0.6275461",
"0.6266235",
"0.62626374",
"0.6231612",
"0.6195032",
"0.6195032",
"0.6173253",
"0.61378783",
"0.6126015... | 0.75853705 | 0 |
PUT /university_profiles/1 PUT /university_profiles/1.json | def update
@university_profile = UniversityProfile.find(params[:id])
respond_to do |format|
if @university_profile.update_attributes(params[:university_profile])
format.html { redirect_to @university_profile, notice: 'University profile was successfully updated.' }
format.json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @profiles = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profiles.update(profile_params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profiles }\n ... | [
"0.66502464",
"0.66496396",
"0.6640017",
"0.6640017",
"0.66112286",
"0.65614825",
"0.64841443",
"0.64750904",
"0.6467817",
"0.6464113",
"0.64370036",
"0.64363295",
"0.6420192",
"0.6406723",
"0.6373182",
"0.6362654",
"0.6348551",
"0.63437223",
"0.63220936",
"0.6296308",
"0.629... | 0.74559146 | 0 |
DELETE /university_profiles/1 DELETE /university_profiles/1.json | def destroy
@university_profile = UniversityProfile.find(params[:id])
@university_profile.destroy
respond_to do |format|
format.html { redirect_to university_profiles_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile... | [
"0.73018855",
"0.73018855",
"0.72988856",
"0.7292494",
"0.72700727",
"0.7269712",
"0.7269712",
"0.72634286",
"0.72577834",
"0.7250551",
"0.72116023",
"0.72109306",
"0.72109306",
"0.72109306",
"0.7207924",
"0.7207924",
"0.7207924",
"0.7207924",
"0.7207924",
"0.7207924",
"0.720... | 0.7634479 | 0 |
Find the basic blocks in an array of instructions. | def basic_blocks(insns)
# Jump and branch targets give us the start of each basic block.
targets = targets(insns)
# Create a basic block for each jump or branch target.
blocks = {}
targets.each_with_index do |start, index|
# Slice the instructions that form this blo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blocks\n @block_stacks.map { |candidates| candidates&.first }\n end",
"def basic_blocks\n @basic_block_collection ||= BasicBlockCollection.new(self)\n end",
"def get_blocks\n if (branches = @cur_state.branches[@tape.val])\n branches.map { |branch| branch.block } \n else\n ... | [
"0.62876546",
"0.599573",
"0.5870855",
"0.5801424",
"0.5785719",
"0.57395476",
"0.54923743",
"0.53547287",
"0.5333158",
"0.5319296",
"0.52905166",
"0.52682805",
"0.52349675",
"0.5191449",
"0.5181",
"0.51454115",
"0.5140853",
"0.51077753",
"0.5099594",
"0.50637573",
"0.5048022... | 0.6558905 | 0 |
Convert one basic block to a fragment of graph. | def basic_block_to_fragment(insns, ip=0, profile=nil)
# Basic blocks start with a merge node.
merge = Node.new(:merge)
# We're going to build up a list of names and stack values coming into
# this basic block that we're going to need to connect up later when
# we form a complet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_local_graph(block)\n block_flow = dfg.block_flows.fetch(block.id)\n\n # A map of instructions to nodes.\n insn_nodes = {}\n\n # Create a node for each instruction in the block.\n block.each_with_length do |insn, offset|\n node = InsnNode.new(insn, ... | [
"0.6396569",
"0.60814226",
"0.5910024",
"0.5480614",
"0.542897",
"0.5424043",
"0.53848016",
"0.5323638",
"0.5311645",
"0.5270826",
"0.52481115",
"0.52298474",
"0.52169645",
"0.52151054",
"0.5191754",
"0.5168946",
"0.51431596",
"0.5138544",
"0.5137062",
"0.5137062",
"0.5035485... | 0.6367712 | 1 |
Handle warning emails to all users | def warning_email(user, warning)
@user = user
@warning = warning
mail to: @user.email, subject: 'CastleBridge Warning Email'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def low_credit_warning_to_admin(user)\n @user = user\n @advertiser = user.advertiser\n\n set_attachments\n\n case APP_CONFIG['app_country']\n when 'AR'\n mail(to: 'sebastian@socialtarget.net', subject: \"Anunciante con crédito debajo de $1000 - Its time to go social\")\n when 'CO'\n ... | [
"0.70432657",
"0.6561599",
"0.65585905",
"0.6485254",
"0.64650327",
"0.63884485",
"0.63472915",
"0.6287187",
"0.61808294",
"0.61514384",
"0.6129055",
"0.608857",
"0.6080138",
"0.6079046",
"0.60732603",
"0.6066005",
"0.60626",
"0.6043357",
"0.6039502",
"0.6032962",
"0.60136604... | 0.73420143 | 0 |
Reindex specific user only , instead of whole class. | def reindex_user!
Sunspot.index! self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_index\n \t\t@users = User.all\n \tend",
"def reindex!\n find(:all).each { |r| r.update_index(true) }\n end",
"def reindex!\n indexed if generate_solr_index\n end",
"def index_user\n @user = User.find(params[:id])\n @projects = @user.projects\n @user_index = true\... | [
"0.6265393",
"0.6084645",
"0.5906952",
"0.58696413",
"0.5845604",
"0.58391255",
"0.57809186",
"0.57809186",
"0.57558084",
"0.57063913",
"0.569151",
"0.56685054",
"0.56460935",
"0.5637015",
"0.56242466",
"0.56186455",
"0.5601047",
"0.55523485",
"0.55472046",
"0.55432546",
"0.5... | 0.8281975 | 0 |
Instantiates a new securityContainerRegistryEvidence and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.security.containerRegistryEvidence"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize()\n super\n @odata_type = \"#microsoft.graph.security.registryKeyEvidence\"\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.security.googleCloudResourceEvidence\"\n end",
"def initialize()\n ... | [
"0.641984",
"0.57567924",
"0.56801087",
"0.5619467",
"0.5546558",
"0.5406718",
"0.53548807",
"0.5220076",
"0.5012527",
"0.4963109",
"0.49273753",
"0.4919461",
"0.48658895",
"0.48651102",
"0.48417595",
"0.48417595",
"0.47785822",
"0.4772516",
"0.47507504",
"0.47369826",
"0.473... | 0.6913321 | 0 |
Sets the registry property value. The registry URI. | def registry=(value)
@registry = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def registry_key=(value)\n @registry_key = value\n end",
"def registry_path=(path=nil)\n if(path)\n custom_paths[:registry_directory] = path\n end\n custom_paths[:registry_directory]\n end",
"def registry_path=(path=nil)\n if(path)\n custom_paths[:... | [
"0.65558785",
"0.64465743",
"0.64465743",
"0.6398272",
"0.6398272",
"0.62428886",
"0.62428886",
"0.61232847",
"0.6087306",
"0.59248924",
"0.58984023",
"0.56568646",
"0.5648688",
"0.56280875",
"0.56248456",
"0.56008685",
"0.5574204",
"0.556259",
"0.55327195",
"0.55165225",
"0.... | 0.7437524 | 0 |
DELETE /qs/1 DELETE /qs/1.json | def destroy
@q.destroy
respond_to do |format|
format.html { redirect_to qs_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @q = Q.find_by_unique_id(params[:id])\n @q.destroy\n\n respond_to do |format|\n format.html { redirect_to qs_url }\n format.json { head :no_content }\n end\n end",
"def delete(*rest) end",
"def delete!\n request! :delete\n end",
"def delete\n if body.empty? && ... | [
"0.72193485",
"0.7048139",
"0.69685876",
"0.6932484",
"0.6922741",
"0.68599194",
"0.68480086",
"0.6827804",
"0.68137574",
"0.681348",
"0.6812168",
"0.6812168",
"0.67819947",
"0.6755975",
"0.6731847",
"0.67178446",
"0.6711751",
"0.66873634",
"0.66723126",
"0.6664109",
"0.66443... | 0.71344167 | 1 |
even if list order is incorrect, parser shouldn't failed and it is recognized as toplevel. | def test_nested_ordered_list_incorrect
assert_nothing_raised do
parser = Juli::Parser.new
parser.parse(data_path('t005.txt'), Juli::Visitor::Tree.new)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_first_list_line(indentation, content); end",
"def parse_list; end",
"def parse_list; end",
"def parse_in_order(*files)\n global_state = OpenStruct.new\n\n return if before_parse_list_callbacks.any? do |cb|\n cb.call(files, global_state) == false\n end\n\n ... | [
"0.6116236",
"0.57363546",
"0.57363546",
"0.57267565",
"0.5679573",
"0.55632204",
"0.55284613",
"0.5456274",
"0.53122115",
"0.5292543",
"0.5285692",
"0.5249667",
"0.5249475",
"0.5222049",
"0.5221276",
"0.5219012",
"0.52121663",
"0.51987255",
"0.5186715",
"0.5168006",
"0.51656... | 0.71884537 | 0 |
ajax answer the next page for paginated Prescriber search | def nextPrescribers
@searchPrescribers = Prescriber.nextPrescribers params[:start], params[:page], 9
render template: 'common/search/js/nextSearchPrescribers.js'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_next_page\n @browser.pluggable_parser.html = SearchPaginationParser\n\n @pagination.next\n previous_length = @results.size\n\n page = @browser.get(ajax_url)\n\n @results += page.search('.match_row').collect do |node|\n OKCupid::Profile.from_search_result(node)\n end\n\... | [
"0.7283596",
"0.719351",
"0.712438",
"0.70285916",
"0.6978852",
"0.6977104",
"0.6951121",
"0.69150895",
"0.6810806",
"0.6777248",
"0.6773149",
"0.6772437",
"0.6758603",
"0.67236286",
"0.67172444",
"0.6712684",
"0.66220665",
"0.66186017",
"0.6617014",
"0.6600223",
"0.6563989",... | 0.79200375 | 0 |
DELETE /prescribers/1 DELETE /prescribers/1.json | def destroy
@prescriber.destroy
respond_to do |format|
format.html { redirect_to prescribers_url, notice: 'Prescriber was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n re... | [
"0.75229764",
"0.74989325",
"0.7479443",
"0.7448541",
"0.7271936",
"0.7231357",
"0.71948296",
"0.7047412",
"0.7020993",
"0.6973432",
"0.6947614",
"0.6896681",
"0.6887121",
"0.6860743",
"0.68337417",
"0.67372745",
"0.67372745",
"0.67372745",
"0.67214495",
"0.66357785",
"0.6631... | 0.7593302 | 0 |
Return true if one of the sample attachments is audio | def contains_audio?
result = false
sample_attachments.map{|sa| result = true if sa.is_audio?}
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def audio?\n not audio_formats.empty?\n end",
"def audio?\n !!( content_type =~ Transit.config.audio_regexp )\n end",
"def is_audio_type?\n file_content_type =~ /\\Aaudio\\/.*\\Z/\n end",
"def audio?\n has_stream_of :audio\n end",
"def audio?\n if mime_type == 'application/mx... | [
"0.8035807",
"0.80038804",
"0.7881955",
"0.7846738",
"0.7820245",
"0.77520734",
"0.773891",
"0.77171326",
"0.7713901",
"0.76059484",
"0.7589621",
"0.7556706",
"0.7498337",
"0.7420775",
"0.7122937",
"0.7079695",
"0.7054178",
"0.6868039",
"0.686134",
"0.6780883",
"0.67526555",
... | 0.87240237 | 0 |
Return true if one of the sample attachments is video | def contains_video?
result = false
sample_attachments.map{|sa| result = true if sa.is_video?}
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def video?\n attributes['_type'].split('::').last == 'Video'\n end",
"def is_video_type?\n file_content_type =~ %r(video)\n end",
"def video?\n !!( content_type =~ Transit.config.video_regexp )\n end",
"def is_video_type?\n photo_content_type =~ %r(video)\n end",
"def video?\n self.t... | [
"0.79525316",
"0.78907645",
"0.78466475",
"0.77067894",
"0.76821923",
"0.7587372",
"0.75550485",
"0.7538511",
"0.74831045",
"0.74105394",
"0.7335338",
"0.7266732",
"0.7214892",
"0.7164728",
"0.713228",
"0.7058546",
"0.693672",
"0.69328326",
"0.66700315",
"0.66283065",
"0.6609... | 0.86776674 | 0 |
Return true if one of the sample attachments is document | def contains_document?
result = false
sample_attachments.map{|sa| result = true if sa.is_document?}
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def document?\n self.type == \"Document\"\n end",
"def document?\n self.type == \"Assetabler::Document\"\n end",
"def attachments?\n self.primary_attachment.file? || self.secondary_attachment.file?\n end",
"def has_attachment?\n @has_attachment ||=\n mime_parts(\"text/plain\").any? do... | [
"0.7421489",
"0.72226393",
"0.6975207",
"0.68808115",
"0.6841749",
"0.6834438",
"0.6796937",
"0.6764376",
"0.675387",
"0.6752013",
"0.67345655",
"0.6716876",
"0.6655362",
"0.66215694",
"0.6601603",
"0.6555731",
"0.65441716",
"0.65441716",
"0.6525107",
"0.65045315",
"0.6482741... | 0.865764 | 0 |
Return true if one of the sample attachments is image | def contains_image?
result = false
sample_attachments.map{|sa| result = true if sa.is_image?}
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image?\n attachment_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end",
"def image?\n self.file_content_type == 'image/png' || self.file_content_type == 'image/jpeg'\n end",
"def is_image?\n !(attachment_content_type =~ /^image.*/).nil?\n end",
"def image... | [
"0.80624455",
"0.790793",
"0.7903999",
"0.7877861",
"0.7830063",
"0.77670777",
"0.77140826",
"0.7678046",
"0.7607985",
"0.75995284",
"0.7590618",
"0.7553504",
"0.75505286",
"0.7527717",
"0.75230056",
"0.75034297",
"0.7499868",
"0.74776083",
"0.7396043",
"0.737016",
"0.7362303... | 0.8637065 | 0 |
Get videos using playlist ID | def get_vidio_playlist key id
#playlstId is the Uploads ID in channel_details
channel_vidios = Youtube.get('/playlistItems?part=snippet&playlistId=UU-lHJZR3Gqxm24_Vd_AJ5Yw&key=' + key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_folder_videos folder_id, **args\n get(\"/projects/#{folder_id}/videos\", args)\n end",
"def get_playlist_vids(playlist)\n Log.log.debug \"Returning playlist vids\"\n vids = Array.new\n playlist.playlist_items.each {|item| vids << item.video_id}\n return vids\nend",
"def get_album_videos... | [
"0.7393167",
"0.7364249",
"0.72655493",
"0.72349536",
"0.7198465",
"0.7108157",
"0.70506155",
"0.6948062",
"0.69414",
"0.68620986",
"0.6840494",
"0.6794294",
"0.6747574",
"0.67393523",
"0.67171973",
"0.6639431",
"0.65199244",
"0.6486782",
"0.645982",
"0.6438722",
"0.6438313",... | 0.76672584 | 0 |
POST /work_articles POST /work_articles.json | def create
@work_article = WorkArticle.new(work_article_params)
respond_to do |format|
if @work_article.save
format.html { redirect_to @work_article, notice: t('notifications_masc.success.resource.created',
resource: t('work_articles.form... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def CreateArticle params = {}\n \n APICall(path: 'help_center/articles.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n @article = article_create(params[:article])\n @article.save\n respond_with(@article)\n end",
"def new\n 1.times { @work.work_docum... | [
"0.6688001",
"0.6559612",
"0.64289474",
"0.6302313",
"0.6291157",
"0.62713116",
"0.6265053",
"0.6246627",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.62459236",
"0.6245551",
"0.... | 0.7352004 | 0 |
PATCH/PUT /work_articles/1 PATCH/PUT /work_articles/1.json | def update
respond_to do |format|
if @work_article.update(work_article_params)
format.html { redirect_to @work_article, notice: t('notifications_masc.success.resource.updated',
resource: t('work_articles.form.resource')) }
format.json ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateArticle id,params = {}\n \n APICall(path: \"help_center/articles/#{id}.json\",method: 'PUT',payload: params.to_json)\n \n end",
"def update\n @article = article_get(params[:id])\n @article.update(params[:article])\n respond_with(@article)\n end",
"def update\n@arti... | [
"0.683489",
"0.66110164",
"0.6573552",
"0.65556955",
"0.651049",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.65005606",
"0.6486083",
"0.64733094",
"0.64401406",
"0.6435243",
"0.6435243",
"0.6... | 0.71084225 | 0 |
DELETE /work_articles/1 DELETE /work_articles/1.json | def destroy
@work_article.destroy
respond_to do |format|
format.html { redirect_to work_articles_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @journalarticle.destroy\n respond_to do |format|\n format.html { redirect_to journalarticles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @article = Article.find(params[:id]) \n @article.destroy\n\n respond_to do |format|\n format.html {... | [
"0.7500433",
"0.7470679",
"0.7420912",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
"0.74196225",
... | 0.7961522 | 0 |
Converts all .less files in +paths+ to STYLESHEETS_PATH/[filename].css. Options: compress Remove all newlines? `true` or `false`. | def run(options = {})
paths.map {|path| Dir["#{path}/*.less"]}.flatten.each {|less_source|
destination_filename = "#{File.basename(less_source, File.extname(less_source))}.css"
destination = "#{STYLESHEETS_PATH}/#{destination_filename}"
if !File.exists?(destination) || File.stat(less_source... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(options = {})\n paths.each do |path|\n Dir.chdir(path) do\n Dir[\"**/*.less\"].each do |less_sheet|\n directory = File.dirname(less_sheet)\n target_filename = File.basename(less_sheet, File.extname(less_sheet)) + \".css\"\n destination = \"#{directory}/#{target_fil... | [
"0.7510991",
"0.6587842",
"0.648634",
"0.6003342",
"0.58771884",
"0.57534343",
"0.57087606",
"0.5706346",
"0.564547",
"0.5538915",
"0.5530495",
"0.5498455",
"0.5482426",
"0.54446524",
"0.5368469",
"0.5366193",
"0.5358923",
"0.53150177",
"0.5286185",
"0.52545947",
"0.52465004"... | 0.74376744 | 1 |
execute cassandra's nodetool and return output as string | def nodetool_cmd(cmd)
`nodetool -h #{config[:hostname]} -p #{config[:port]} #{cmd}`
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodetool_info()\n out = `/opt/cassandra/bin/nodetool info`\n if $? == 0\n props = {}\n out.split(\"\\n\").each do |line|\n p = line.split(':')\n props[p.first.strip] = p.last.strip\n end\n return props\n else\n Chef::Log.warn(\"nodetool info failed with #{out}\")... | [
"0.729716",
"0.7255151",
"0.65591836",
"0.64272225",
"0.62905943",
"0.6068972",
"0.55621904",
"0.5561114",
"0.553326",
"0.5374738",
"0.53602976",
"0.5345723",
"0.533696",
"0.5305658",
"0.5277773",
"0.52724266",
"0.5243136",
"0.5241147",
"0.51969904",
"0.5177964",
"0.5145338",... | 0.7289284 | 1 |
$ nodetool status Datacenter: LON5 ================ Status=Up/Down |/ State=Normal/Leaving/Joining/Moving Address Load Tokens Owns Host ID Rack UN 172.16.1.1 1.88 GB 256 ? 5uu5274d0c1c46f1b73cc28ffdcad10e A125 DN 172.16.1.2 2.55 GB 256 ? 4uu6478c0e29468cad38f417ccbcf403 A125 UL 172.16.1.3 3.24 GB 256 ? fuu0063da0334a78... | def parse_ndstatus# rubocop:disable all
nodestatus = nodetool_cmd('status')
nodestatus.each_line do |line|
next if line.match(/^Datacenter:/)
next if line.match(/^=======/)
next if line.match(/^Status/)
next if line.match(/State/)
next if line.match(/^--/)
next if line.match(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodetool_status()\n out = `/opt/cassandra/bin/nodetool status`\n raise 'nodetool status failed' if $? != 0\n rows = out.split(\"\\n\")\n hash = {}\n dc_exp = /Datacenter: (.*)/\n #vnode\n #-- Address Load Tokens Owns Host ID Rack\n #non-v... | [
"0.7737813",
"0.6181872",
"0.61708474",
"0.6081172",
"0.60521984",
"0.60478556",
"0.60059553",
"0.5970989",
"0.5956296",
"0.59406185",
"0.587981",
"0.58758706",
"0.5836375",
"0.5666798",
"0.5561863",
"0.55394286",
"0.5536466",
"0.553646",
"0.5511233",
"0.55034906",
"0.5483987... | 0.6368932 | 1 |
Return the default locale for the object | def default_locale
evaluate_localization_option!(:default_locale)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_locale\n @default_locale ||= self.languages.get_default.code.to_sym\n end",
"def default_locale\n return nil unless localized?\n u_lc = I18n.locale.to_sym\n available_locales.include?(u_lc) ? u_lc : available_locales[0]\n end",
"def default_locale\n self.found_l... | [
"0.85959285",
"0.85721165",
"0.8507327",
"0.84019864",
"0.84001434",
"0.8325649",
"0.8325224",
"0.8095079",
"0.8036071",
"0.7681259",
"0.7654299",
"0.76017535",
"0.7587714",
"0.7577989",
"0.7527154",
"0.75127846",
"0.74955946",
"0.74854386",
"0.74854386",
"0.74168646",
"0.738... | 0.8614655 | 0 |
Return the missing translation placeholder | def missing_translation_placeholder field
evaluate_localization_option!(:placeholder, field)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def t(key, default = '')\n c = I18n.t(key)\n if c.match(/translation missing/i)\n c = I18n.t(key, locale: 'en') \n # Still not found. Return default if set\n c = default unless default.blank?\n end\n c\nend",
"def missing_translations\n @translations.select { |x, v| v.nil? or v.blank? }\n en... | [
"0.69179493",
"0.69086456",
"0.68666464",
"0.64853626",
"0.6466796",
"0.63806796",
"0.6345606",
"0.63341725",
"0.62771535",
"0.62229925",
"0.61943775",
"0.619145",
"0.6030112",
"0.60056806",
"0.5980776",
"0.5962088",
"0.5919397",
"0.5820558",
"0.58130896",
"0.58051103",
"0.57... | 0.8087824 | 0 |
Remove the node at the end of the list and returns its value | def remove_last
raise 'No such element' if @size == 0
elt = @tail.value
if @size == 1
@head = nil
@tail = nil
else
@tail = @tail.previous
@tail.next.previous = nil
@tail.next = nil
end
@size -= 1
return e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_last\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the tail node\n # Move the tail to the previous node\n data = @tail.data\n @tail = @tail.prev_node\n @size -= 1\n\n # removes the same element from @head, if it was final element/node\n ... | [
"0.76912916",
"0.76468843",
"0.76380104",
"0.7616181",
"0.7535436",
"0.7535436",
"0.7514628",
"0.746096",
"0.7437617",
"0.7427888",
"0.7426113",
"0.7405219",
"0.7369827",
"0.73540777",
"0.73195404",
"0.72737217",
"0.7241131",
"0.7230956",
"0.7210715",
"0.7208132",
"0.71975386... | 0.7675069 | 1 |
Return the last element without removing it | def peek_last
raise 'No such element' if @size == 0
@tail.value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last\n all[all.size - 1]\n end",
"def last\n @ordered_elements.last\n end",
"def last\n self.slice(self.size - 1)\n end",
"def remove_last\n raise 'No such element' if @size == 0\n elt = @tail.value\n if @size == 1\n @head = nil\n @tail = nil\n ... | [
"0.80725735",
"0.7964494",
"0.79640603",
"0.79158497",
"0.7905291",
"0.7895912",
"0.78623027",
"0.78465277",
"0.7833645",
"0.7832916",
"0.7814255",
"0.7789193",
"0.7780709",
"0.7772687",
"0.77211624",
"0.7698924",
"0.7688206",
"0.7605398",
"0.7603993",
"0.7597297",
"0.7584099... | 0.7988893 | 1 |
Initialize a node with value v, previous p and next n | def initialize(v, n, p)
@value = v
@next = n
@previous = p
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(value, prev_node = nil, next_node = nil)\n @prev_node = prev_node\n @next_node = next_node\n @value = value\n end",
"def initialize(value = nil, next_node = nil, prev_node = nil)\n @value = value\n @next = next_node\n @prev = prev_node\n end",
"def ini... | [
"0.71622914",
"0.70657563",
"0.6996835",
"0.69682926",
"0.6892347",
"0.6859073",
"0.6813041",
"0.6787243",
"0.6725085",
"0.65873814",
"0.6585844",
"0.6493821",
"0.6493821",
"0.6493821",
"0.6493821",
"0.6420695",
"0.62953573",
"0.6289484",
"0.6244451",
"0.6244451",
"0.6136073"... | 0.8784927 | 0 |
Evaluates the content of block and stores the result as content_for :sidebar. Because content_for concatenates the block, you can call sidebar multiple time and yield all the final content once. See ActionView::Helpers::CaptureHelpercontent_for for the full API documentation. ==== Examples Sidebar => Sidebar | def sidebar(&block)
content_for :sidebar, &block
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sidebar!\n content_for(:layout_sidebar) do\n 'true'\n end\n end",
"def content_for(capture)\n @layout_block.call(capture)\n end",
"def main_content\n yield if block_given?\n end",
"def sidebar(classes: ['col-xs-7', 'col-sm-3', 'col-md-2'])\n sidebar!\n\n render l... | [
"0.66405404",
"0.6490057",
"0.63716316",
"0.6263863",
"0.6109316",
"0.6081218",
"0.6054966",
"0.60003746",
"0.5991545",
"0.59018505",
"0.58933085",
"0.5887339",
"0.5884539",
"0.5819926",
"0.5818763",
"0.57900333",
"0.57422894",
"0.5738098",
"0.56696993",
"0.5635347",
"0.56198... | 0.77649873 | 0 |
GET /meeting_follow_ups GET /meeting_follow_ups.json | def index
@meeting_follow_ups = MeetingFollowUp.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_meeting_follow_up\n @meeting_follow_up = MeetingFollowUp.find(params[:id])\n end",
"def follows\n @follows = @user.follows\n\n respond_to do |format|\n format.html\n format.json { render :json => { :follows => @follows.map{|x| x.as_json(:json => 'friendship')}, :user => @user.as_j... | [
"0.7167343",
"0.6800076",
"0.65426886",
"0.6451123",
"0.64492124",
"0.6442069",
"0.6425024",
"0.6414452",
"0.63749695",
"0.6348674",
"0.63486063",
"0.63486063",
"0.63213414",
"0.6321218",
"0.63194114",
"0.63147223",
"0.6311293",
"0.6299652",
"0.6295459",
"0.6282238",
"0.62232... | 0.76104784 | 0 |
POST /meeting_follow_ups POST /meeting_follow_ups.json | def create
@meeting_follow_up = MeetingFollowUp.new(meeting_follow_up_params)
respond_to do |format|
if @meeting_follow_up.save
format.html { redirect_to meeting_follow_up_record_employee_plans_path(plan_id: params[:meeting_follow_up][:employee_plan_id]), notice: 'Meeting follow up was successfull... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_meeting_follow_up\n @meeting_follow_up = MeetingFollowUp.find(params[:id])\n end",
"def create\n @followup = Followup.new(params[:followup])\n\n respond_to do |format|\n if @followup.save\n format.html { redirect_to @followup, notice: 'Followup was successfully created.' }\n ... | [
"0.7173046",
"0.70722497",
"0.6831158",
"0.680749",
"0.67757136",
"0.67615384",
"0.6730447",
"0.6703397",
"0.6695028",
"0.6619811",
"0.65630436",
"0.6536067",
"0.6532339",
"0.65041983",
"0.6481618",
"0.6477108",
"0.6424949",
"0.6374317",
"0.63689923",
"0.6357284",
"0.63559866... | 0.740117 | 0 |
PATCH/PUT /meeting_follow_ups/1 PATCH/PUT /meeting_follow_ups/1.json | def update
respond_to do |format|
if @meeting_follow_up.update(meeting_follow_up_params)
format.html { redirect_to @meeting_follow_up, notice: 'Meeting follow up was successfully updated.' }
format.json { render :show, status: :ok, location: @meeting_follow_up }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @followup.update(followup_params)\n format.html { redirect_to @job, notice: 'Follow Up was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n end\n end\n end",
"def set_meeting_follow_up\n @meeting_fo... | [
"0.71014017",
"0.7076065",
"0.68999743",
"0.67279977",
"0.6709095",
"0.6685333",
"0.6641011",
"0.66218376",
"0.662026",
"0.66142136",
"0.65985835",
"0.6596244",
"0.6591943",
"0.65765494",
"0.6532943",
"0.6532943",
"0.65260845",
"0.65260845",
"0.6520211",
"0.650386",
"0.645504... | 0.77513665 | 0 |
DELETE /meeting_follow_ups/1 DELETE /meeting_follow_ups/1.json | def destroy
@meeting_follow_up.destroy
respond_to do |format|
format.html { redirect_to meeting_follow_ups_url, notice: 'Meeting follow up was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @meetup = Meetup.find(params[:id])\n @meetup.destroy\n\n respond_to do |format|\n format.html { redirect_to meetups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @followup = Followup.find(params[:id])\n @followup.destroy\n\n respond_to do |for... | [
"0.7540107",
"0.75148785",
"0.7488016",
"0.743424",
"0.73862845",
"0.73069745",
"0.7246522",
"0.7242107",
"0.72354347",
"0.7194497",
"0.7190162",
"0.71547395",
"0.71210456",
"0.71198684",
"0.7102919",
"0.7101492",
"0.709414",
"0.70831645",
"0.70728",
"0.70728",
"0.70470136",
... | 0.7894181 | 0 |
Internal: Builds body of a mixin Returns string representation of a mixin with asset helper functions | def build_mixin_body(scope)
@mixin_body ||= if assets_hash(scope).values.all? {|value| value != '' }
<<-STYL
asset-url(key)
return pair[1] if pair[0] == key for pair in #{assets_hash(scope)[:url]} ()
asset-path(key)
return pair[1] if pair[0] == key for pair in #{assets_hash(scope)[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mixin(object) \n mixin_name = split(object)\n \"@mixin #{mixin_name} {}\"\n end",
"def mixin!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = MIXIN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule bloc... | [
"0.59575987",
"0.5882066",
"0.5737601",
"0.56425184",
"0.5620741",
"0.5512886",
"0.5392681",
"0.5277109",
"0.52173066",
"0.5085455",
"0.50521475",
"0.5029077",
"0.500078",
"0.49996826",
"0.49738535",
"0.49738535",
"0.49738535",
"0.49738535",
"0.49738535",
"0.49738535",
"0.497... | 0.7738047 | 0 |
Returns the cache of defined VMs for a user. It is a hash with VM id as key and VmUsage as value | def vms(user)
vms=@users[user]
@users[user]=vms=Hash.new if !vms
vms
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_by_ued_memcache_key_object\n MemcacheKey.new('user.user_kyc_comparison_detail')\n end",
"def total(user)\n usage=VmUsage.new(0.0, 0, 0)\n \n @users[user].each do |id, vm|\n usage.cpu+=vm.cpu\n usage.memory+=vm.memory\n usage.num_vms+=1\n ... | [
"0.58682954",
"0.5799822",
"0.5727434",
"0.5687913",
"0.56238204",
"0.5487336",
"0.5487336",
"0.5391021",
"0.5336172",
"0.5331508",
"0.5326577",
"0.5312997",
"0.5299143",
"0.52479255",
"0.5247538",
"0.52272415",
"0.5207831",
"0.51692975",
"0.51444256",
"0.51214546",
"0.511293... | 0.6922262 | 0 |
Returns total consumption by a user into a VmUsage object | def total(user)
usage=VmUsage.new(0.0, 0, 0)
@users[user].each do |id, vm|
usage.cpu+=vm.cpu
usage.memory+=vm.memory
usage.num_vms+=1
end if @users[user]
usage
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_billable_usage\n @attributes[:total_billable_usage]\n end",
"def user_cost\n @attributes[:user_cost]\n end",
"def usage_cost\n @attributes[:usage_cost]\n end",
"def monthly_print_usage_by_user\n return @monthly_print_usage_by_user\n end",
"def dro... | [
"0.6384523",
"0.635422",
"0.63443184",
"0.6292223",
"0.6256888",
"0.62505805",
"0.61222386",
"0.6118661",
"0.6085477",
"0.60595334",
"0.60502285",
"0.5998154",
"0.5955037",
"0.59361607",
"0.59205896",
"0.58673525",
"0.5851864",
"0.57405496",
"0.5729764",
"0.5720738",
"0.57084... | 0.82086825 | 0 |
GET /hp_searches GET /hp_searches.json | def index
@hp_searches = HpSearch.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @searches = @website.searches.all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @searches }\n end\n end",
"def search\n spotyfy_client = SpotyfyClient.new(params[:search])\n spotyfy_client.perform\n items = SpotyfyService.parse_hash... | [
"0.7296706",
"0.70765066",
"0.69592625",
"0.6931639",
"0.69005084",
"0.6898424",
"0.68895966",
"0.6795751",
"0.6735968",
"0.6694264",
"0.6690708",
"0.66719383",
"0.6662774",
"0.6654845",
"0.66119957",
"0.6576677",
"0.6557585",
"0.6506874",
"0.64949286",
"0.6491554",
"0.648044... | 0.7465054 | 0 |
POST /hp_searches POST /hp_searches.json | def create
@hp_search = HpSearch.new(hp_search_params)
respond_to do |format|
if @hp_search.save
format.html { redirect_to @hp_search, notice: 'Hp search was successfully created.' }
format.json { render :show, status: :created, location: @hp_search }
else
format.html { rend... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_saved_search(query)\n post(\"/saved_searches/create.json\", :query => query)\n end",
"def create\n @search = @website.searches.new params[:search]\n\n\t\t@search.url = @website.search_url(params[:search_terms]) if params[:search_terms]\n\n @search.terms = @search.description.split(' ') i... | [
"0.67871493",
"0.6487988",
"0.64730036",
"0.64707506",
"0.6438359",
"0.63838005",
"0.6288693",
"0.6272228",
"0.6264629",
"0.62407804",
"0.61506045",
"0.6135573",
"0.61323357",
"0.6046458",
"0.60401076",
"0.6008405",
"0.6001088",
"0.5994454",
"0.59741265",
"0.5971785",
"0.5968... | 0.6966397 | 0 |
PATCH/PUT /hp_searches/1 PATCH/PUT /hp_searches/1.json | def update
respond_to do |format|
if @hp_search.update(hp_search_params)
format.html { redirect_to @hp_search, notice: 'Hp search was successfully updated.' }
format.json { render :show, status: :ok, location: @hp_search }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @advance_search.update(advance_search_params)\n format.html { redirect_to @advance_search, notice: 'Advance search was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n forma... | [
"0.64139813",
"0.6264316",
"0.6264315",
"0.6244814",
"0.6235557",
"0.61979836",
"0.6161067",
"0.6154005",
"0.6151688",
"0.6132266",
"0.61019284",
"0.61019284",
"0.61019284",
"0.61019284",
"0.60997224",
"0.60997224",
"0.60997224",
"0.6085722",
"0.6074767",
"0.6025214",
"0.5983... | 0.67113817 | 0 |
DELETE /hp_searches/1 DELETE /hp_searches/1.json | def destroy
@hp_search.destroy
respond_to do |format|
format.html { redirect_to hp_searches_url, notice: 'Hp search was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @advance_search.destroy\n respond_to do |format|\n format.html { redirect_to advance_searches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @search.destroy\n respond_to do |format|\n format.html { redirect_to searches_url }\n format.json {... | [
"0.7428843",
"0.710959",
"0.710959",
"0.710959",
"0.710959",
"0.710959",
"0.70994884",
"0.7082889",
"0.70809025",
"0.7042368",
"0.700188",
"0.6971907",
"0.6955675",
"0.6955675",
"0.6955675",
"0.6955675",
"0.6933841",
"0.6917134",
"0.6901846",
"0.6892551",
"0.6835365",
"0.68... | 0.74369824 | 0 |
one_task.rake one_task task will run another_task.rake another_task task will run my_tasks_all_mine.rake mine:task1 task will run mine:task2 task has a duplicate (will not run) mine:task3 task has a duplicate (will not run) mine:task4 task will run other_tasks_run_all.rake other_task1_run_me task will run other_task2_r... | def create_rake_files(base_dir)
one_task_fn = File.join(base_dir, 'one_task.rake')
make_tasks_in_file(['one_task'], one_task_fn) if ok_to_create?(one_task_fn)
another_task_fn = File.join(base_dir, 'another_task.rake')
make_tasks_in_file(['another_task'], another_task_fn) if ok_to_create?(another_task_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_tasks_to_run\n self.all_tasks - all_tasks_previously_run - all_tasks_duplicates\n end",
"def files_with_tasks_to_run\n\n # load all tasks into self.all_tasks\n get_tasks_from_rakefiles\n\n set_and_log_tasks_already_ran(self.all_tasks)\n set_and_log_duplicate_tasks(self.all_tas... | [
"0.668701",
"0.6261065",
"0.6249257",
"0.6139295",
"0.61092496",
"0.60806847",
"0.60745454",
"0.6054341",
"0.5837602",
"0.58354",
"0.5820692",
"0.58128023",
"0.58128023",
"0.5773079",
"0.5767463",
"0.57456684",
"0.57239646",
"0.5723327",
"0.5699236",
"0.56813097",
"0.5676584"... | 0.6910386 | 0 |
If the file exists, ask if it's ok to overwrite. return true only if they said it was ok to overwrite. If the file does not exist, return true (it's ok to create it) | def ok_to_create?(filepath)
File.exist?(filepath) ? prompt_to_overwrite?(filepath) : true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def overwrite?(path)\n if File.exist?(path)\n return yes? \"A file already exists at '#{ path }'. Do you want to overwrite? [y/n]\"\n end\n true\n end",
"def write_prep outfile\n return true unless File.exists? outfile\n\n # OK, file exists. See if we can clobber ... | [
"0.787595",
"0.7612725",
"0.6988596",
"0.69432896",
"0.6587998",
"0.65100396",
"0.6501122",
"0.6500705",
"0.6461536",
"0.6434471",
"0.6405404",
"0.6359023",
"0.6343919",
"0.6288038",
"0.620873",
"0.61942965",
"0.6192671",
"0.61546654",
"0.6145405",
"0.61445737",
"0.6137306",
... | 0.8330788 | 0 |
Make rake tasks for of the tasks in tasknames, in the file named filepath. Makes all directories needed for the filepath if they don't already exist. | def make_tasks_in_file(tasknames = [], filepath = '.', task_body = "\n", namespace: '')
indent = ""
filedir = File.dirname(filepath)
FileUtils.mkdir_p(filedir) unless Dir.exist?(filedir)
File.open(filepath, 'w') do |f|
unless namespace.empty?
indent = " "
f.puts namespace_start(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_rake_files(base_dir)\n\n one_task_fn = File.join(base_dir, 'one_task.rake')\n make_tasks_in_file(['one_task'], one_task_fn) if ok_to_create?(one_task_fn)\n\n another_task_fn = File.join(base_dir, 'another_task.rake')\n make_tasks_in_file(['another_task'], another_task_fn) if ok_to_create?(an... | [
"0.6867006",
"0.65400964",
"0.6450239",
"0.6214098",
"0.5953491",
"0.5820577",
"0.5759924",
"0.5693695",
"0.56675607",
"0.56675607",
"0.56378096",
"0.5621367",
"0.56165826",
"0.5611207",
"0.5603605",
"0.5560159",
"0.5543449",
"0.5492799",
"0.54762465",
"0.5452826",
"0.5451332... | 0.71497864 | 0 |
Code for a simple task. The body of the task is given :task_body | def simple_rake_task(task_name = 'test_task', indent: '', task_body: "\n")
"\n" + indent +
"desc 'task named #{task_name}'\n" +
indent + "task :#{task_name} do\n" +
indent + " " + task_body +
indent + "end\n\n"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simpleTasks _args\n \"simpleTasks _args;\" \n end",
"def task\n end",
"def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\nend",
"def createSimpleTask _obj, _args\n \"_obj createSimpleTask _args;\" \n end",
"def description\n ... | [
"0.70842534",
"0.70090413",
"0.69444466",
"0.69333863",
"0.69081366",
"0.681818",
"0.67373914",
"0.6728013",
"0.67245424",
"0.6723103",
"0.66986424",
"0.6596913",
"0.6589006",
"0.65321743",
"0.65222645",
"0.644586",
"0.6442598",
"0.643196",
"0.63979",
"0.6396713",
"0.6366232"... | 0.81454754 | 0 |
Sets the input & output paths for the given script build phase. | def set_input_output_paths(phase, input_paths_by_config, output_paths_by_config)
if input_output_paths_use_filelist?(phase)
[input_paths_by_config, output_paths_by_config].each do |hash|
hash.each do |file_list, files|
generator = Generator::FileList.new(files... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_input_path_to_script_phase(script_phase, name, platform)\n input_path = \"$(SRCROOT)/#{make_carthage_build_path(name, platform)}\"\n script_phase.input_paths << input_path\nend",
"def create_or_update_copy_xcframeworks_script_phase_to_target(native_target, script_path, input_paths_by_config = {}, o... | [
"0.70612246",
"0.62567437",
"0.599926",
"0.58901983",
"0.5833597",
"0.5638008",
"0.5605595",
"0.54814017",
"0.5459682",
"0.5343731",
"0.5314638",
"0.53031904",
"0.5272214",
"0.52284694",
"0.5151068",
"0.51070803",
"0.5095115",
"0.50818783",
"0.5044566",
"0.5038619",
"0.502718... | 0.6996949 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.