query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Create an integration for the specified app. | def create_integration(app_id, integration_create_body, opts = {})
data, _status_code, _headers = create_integration_with_http_info(app_id, integration_create_body, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_integration_with_http_info(app_id, integration_create_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: IntegrationApi.create_integration ...\"\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.cli... | [
"0.6851142",
"0.6613742",
"0.6320141",
"0.6286776",
"0.6243598",
"0.61107016",
"0.6092274",
"0.60061455",
"0.59643096",
"0.5952713",
"0.5895749",
"0.5852185",
"0.57128704",
"0.5695547",
"0.5677204",
"0.56629384",
"0.56376237",
"0.5623359",
"0.56065327",
"0.56010187",
"0.55648... | 0.7144803 | 0 |
Create an integration for the specified app. | def create_integration_with_http_info(app_id, integration_create_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: IntegrationApi.create_integration ..."
end
# verify the required parameter 'app_id' is set
if @api_client.config.client_side_val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_integration(app_id, integration_create_body, opts = {})\n data, _status_code, _headers = create_integration_with_http_info(app_id, integration_create_body, opts)\n return data\n end",
"def create_for_app(app_auth_request = nil)\n build_request(app_auth_request || { api_key: @api_ke... | [
"0.7144803",
"0.6613742",
"0.6320141",
"0.6286776",
"0.6243598",
"0.61107016",
"0.6092274",
"0.60061455",
"0.59643096",
"0.5952713",
"0.5895749",
"0.5852185",
"0.57128704",
"0.5695547",
"0.5677204",
"0.56629384",
"0.56376237",
"0.5623359",
"0.56065327",
"0.56010187",
"0.55648... | 0.6851142 | 1 |
Delete the specified integration. | def delete_integration(app_id, integration_id, opts = {})
delete_integration_with_http_info(app_id, integration_id, opts)
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_integration(auth, server_id, integration_id)\n MijDiscord::Core::API.request(\n :guilds_sid_integrations_iid,\n server_id,\n :delete,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/integrations/#{integration_id}\",\n Authorization: auth\n )\n ... | [
"0.7705007",
"0.7387403",
"0.7291439",
"0.7242794",
"0.70122725",
"0.68807834",
"0.65916157",
"0.6534435",
"0.6441573",
"0.6350197",
"0.6205371",
"0.6205371",
"0.6205371",
"0.6205371",
"0.619457",
"0.61403406",
"0.61036325",
"0.60600567",
"0.60487884",
"0.6025649",
"0.6010878... | 0.65985185 | 6 |
Delete the specified integration. | def delete_integration_with_http_info(app_id, integration_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: IntegrationApi.delete_integration ..."
end
# verify the required parameter 'app_id' is set
if @api_client.config.client_side_validation &... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_integration(auth, server_id, integration_id)\n MijDiscord::Core::API.request(\n :guilds_sid_integrations_iid,\n server_id,\n :delete,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/integrations/#{integration_id}\",\n Authorization: auth\n )\n ... | [
"0.7705007",
"0.7387403",
"0.7291439",
"0.7242794",
"0.70122725",
"0.68807834",
"0.65985185",
"0.65916157",
"0.6441573",
"0.6350197",
"0.6205371",
"0.6205371",
"0.6205371",
"0.6205371",
"0.619457",
"0.61403406",
"0.61036325",
"0.60600567",
"0.60487884",
"0.6025649",
"0.601087... | 0.6534435 | 8 |
Get the specified integration. | def get_integration(app_id, integration_id, opts = {})
data, _status_code, _headers = get_integration_with_http_info(app_id, integration_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def integration\n @integration\n end",
"def set_integration\n @integration = Integration.find(params[:id])\n end",
"def set_integration\n @integration = Integration.find(params[:id])\n end",
"def integration_name; end",
"def integration_path(integration)\n \"spec/integration/#{... | [
"0.72498006",
"0.615705",
"0.615705",
"0.6006859",
"0.5965343",
"0.59372413",
"0.57735324",
"0.5680734",
"0.5329793",
"0.529376",
"0.529376",
"0.529376",
"0.5270806",
"0.52328277",
"0.5192563",
"0.51766986",
"0.5165119",
"0.5150433",
"0.51286215",
"0.5099464",
"0.5062347",
... | 0.67320865 | 1 |
Get the specified integration. | def get_integration_with_http_info(app_id, integration_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: IntegrationApi.get_integration ..."
end
# verify the required parameter 'app_id' is set
if @api_client.config.client_side_validation && app_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def integration\n @integration\n end",
"def get_integration(app_id, integration_id, opts = {})\n data, _status_code, _headers = get_integration_with_http_info(app_id, integration_id, opts)\n return data\n end",
"def set_integration\n @integration = Integration.find(params[:id])\n ... | [
"0.72498006",
"0.67320865",
"0.615705",
"0.615705",
"0.6006859",
"0.5965343",
"0.57735324",
"0.5680734",
"0.5329793",
"0.529376",
"0.529376",
"0.529376",
"0.5270806",
"0.52328277",
"0.5192563",
"0.51766986",
"0.5165119",
"0.5150433",
"0.51286215",
"0.5099464",
"0.5062347",
... | 0.59372413 | 6 |
Get the specified integration's menu. | def get_integration_menu(app_id, integration_id, opts = {})
data, _status_code, _headers = get_integration_menu_with_http_info(app_id, integration_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMenu(menu)\n end",
"def menu\n response[\"menu\"]\n end",
"def menu\n @menu ||= Interface::Menu.new(self)\n end",
"def get_permission_menu\n return @client.raw(\"get\", \"/helpers/menu\")\n end",
"def get_permission_menu\n @client.raw('get', '/helpers/menu')\n en... | [
"0.8057258",
"0.73783845",
"0.7023886",
"0.69802",
"0.69117165",
"0.6782335",
"0.67647916",
"0.6726301",
"0.6502469",
"0.6478615",
"0.6383293",
"0.6349364",
"0.63136274",
"0.62679",
"0.6260542",
"0.6230084",
"0.6230084",
"0.61998355",
"0.6198331",
"0.6192469",
"0.6186416",
... | 0.6116323 | 24 |
Get the specified integration&39;s menu. | def get_integration_menu_with_http_info(app_id, integration_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: IntegrationApi.get_integration_menu ..."
end
# verify the required parameter 'app_id' is set
if @api_client.config.client_side_validati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMenu(menu)\n end",
"def menu\n response[\"menu\"]\n end",
"def main_Menu_Name\n Goldberg.menu.main_Menu_Name\n end",
"def get_permission_menu\n @client.raw('get', '/helpers/menu')\n end",
"def get_Menu_Item\n item_name = session[:goldberg][:menu_item]\n end",
"... | [
"0.738",
"0.6905551",
"0.65372527",
"0.6433806",
"0.6427877",
"0.6426081",
"0.63800097",
"0.62675285",
"0.6221076",
"0.6219634",
"0.6149875",
"0.61408615",
"0.60928905",
"0.5998326",
"0.59744567",
"0.5964217",
"0.59331447",
"0.59310305",
"0.59239626",
"0.5912258",
"0.58638066... | 0.57358354 | 30 |
List integrations for the specified app. | def list_integrations(app_id, opts = {})
data, _status_code, _headers = list_integrations_with_http_info(app_id, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_integrations_with_http_info(app_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: IntegrationApi.list_integrations ...\"\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.client_side_validation && app_... | [
"0.69517565",
"0.66954434",
"0.6122563",
"0.6005462",
"0.5984",
"0.59315574",
"0.588744",
"0.587151",
"0.5828431",
"0.58080006",
"0.5699765",
"0.56705964",
"0.56573564",
"0.5644541",
"0.5643877",
"0.5595212",
"0.55887514",
"0.55709916",
"0.5567373",
"0.55255437",
"0.5505226",... | 0.7768685 | 0 |
List integrations for the specified app. | def list_integrations_with_http_info(app_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: IntegrationApi.list_integrations ..."
end
# verify the required parameter 'app_id' is set
if @api_client.config.client_side_validation && app_id.nil?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_integrations(app_id, opts = {})\n data, _status_code, _headers = list_integrations_with_http_info(app_id, opts)\n return data\n end",
"def index\n @cargapp_integrations = CargappIntegration.all\n end",
"def gcp_integration_list\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/in... | [
"0.7768685",
"0.66954434",
"0.6122563",
"0.6005462",
"0.5984",
"0.59315574",
"0.588744",
"0.587151",
"0.5828431",
"0.58080006",
"0.5699765",
"0.56705964",
"0.56573564",
"0.5644541",
"0.5643877",
"0.5595212",
"0.55887514",
"0.55709916",
"0.5567373",
"0.55255437",
"0.5505226",
... | 0.69517565 | 1 |
open stream if it is not opened | def openInputStream(stream)
if stream.getByteStream
stream
else stream.getSystemId
url = URL.new(stream.getSystemId)
if url.scheme == 'file' && url.login == 'localhost'
s = open(url.urlpath)
stream.setByteStream(s)
return stream
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream\n synchronize { open! if @stream.nil?; @stream }\n end",
"def open\n [head, open_stream] * \"\"\n end",
"def open_for_read\n end",
"def opened\n raise NotImplementedError\n end",
"def opened\n end",
"def open?(uri); end",
"def open\n raise N... | [
"0.7339549",
"0.7217188",
"0.7017325",
"0.68971705",
"0.6892756",
"0.68614554",
"0.6831465",
"0.67196023",
"0.67196023",
"0.67196023",
"0.6670562",
"0.6632796",
"0.6599022",
"0.659435",
"0.6583291",
"0.65678537",
"0.6554574",
"0.65405786",
"0.65405786",
"0.649767",
"0.649767"... | 0.7028352 | 2 |
locator is DummyLoacator or SAXParser | def pushLocator(locator)
@locators.push(locator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init\n super\n @parser = Nokogiri::XML::SAX::Parser.new(self)\n end",
"def pluggable_parser; end",
"def xpath; end",
"def xpath; end",
"def guarded_locator\n return unguarded_locator if unguarded_locator\n self.locator = case \n when template_id \n then ... | [
"0.54403627",
"0.54353094",
"0.5331464",
"0.5331464",
"0.5323597",
"0.53094536",
"0.52768916",
"0.52768916",
"0.52514124",
"0.52442515",
"0.5233952",
"0.5233952",
"0.52205575",
"0.52205575",
"0.52205575",
"0.52205575",
"0.5216149",
"0.51741236",
"0.5150851",
"0.51454365",
"0.... | 0.47519806 | 46 |
creates an output string with the attributes | def to_string
"Person: #{@name} with ID: #{@id}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n %(<#{ @name }#{attributes}>)\n end",
"def buildAttrString(attributes)\r\n str = \"\"\r\n\r\n attributes.each do |key, val|\r\n str += \" #{key}='#{val}'\"\r\n end # attributes.each\r\n\r\n puts \"attrib str: #{str}\" if $DEBUG\r\n str\r\n end",
"def to_s\n\t\tstr... | [
"0.70676124",
"0.69913065",
"0.69572973",
"0.6885285",
"0.6814431",
"0.6814334",
"0.6723114",
"0.6710767",
"0.66344506",
"0.6621498",
"0.6596937",
"0.65846497",
"0.6574082",
"0.6574082",
"0.65589637",
"0.6546136",
"0.6447666",
"0.6438252",
"0.6433854",
"0.64112175",
"0.641121... | 0.0 | -1 |
creates an output string for the storage in a file. The format serves the output format of the output file | def to_file
"#{@name};#{@id}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output\n super(@file_format => @file_path)\n end",
"def output(format = :pls)\n format = format.to_sym\n raise ArgumentError.new(\"Format must be one of #{FORMATS.join(', ')}\") unless FORMATS.include? format\n\n case format\n when :text\n create_text\n when :m3u\n create_m3u... | [
"0.6752186",
"0.6707946",
"0.6540297",
"0.65016735",
"0.63808095",
"0.6338184",
"0.629629",
"0.6273258",
"0.6243573",
"0.6202686",
"0.6180343",
"0.6178243",
"0.6171372",
"0.6159488",
"0.6127152",
"0.6079241",
"0.6079177",
"0.6078967",
"0.60682523",
"0.606595",
"0.6065869",
... | 0.643774 | 4 |
Sjaak van den Berg | def solution(str)
str.scan(/.{1,2}/).map { |e| e[1].nil? ? e + '_' : e }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def schubert; end",
"def schumann; end",
"def zuruecksetzen()\n end",
"def berlioz; end",
"def bellini; end",
"def berg; end",
"def suivre; end",
"def sichtbar_machen()\n @dach.sichtbar_machen\n @gebaedekoerpe.sichtbar_machen\n @fenster.sichtbar_machen\n @tuer.sichtbar_machen\n end",
... | [
"0.7576614",
"0.70595306",
"0.6850953",
"0.68300265",
"0.6652317",
"0.6635704",
"0.64665234",
"0.63879704",
"0.6330819",
"0.6307666",
"0.62543666",
"0.6253937",
"0.624926",
"0.6169856",
"0.61295396",
"0.6115479",
"0.6113548",
"0.6109211",
"0.6101353",
"0.60676706",
"0.6044888... | 0.0 | -1 |
Metodos com as acoes | def clicar_mais
botao_mais.click
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agregarMetodos unaClase\n self.metodos.each do |metodo|\n self.agregar_metodo(unaClase,metodo[0],&metodo[1])\n end\n end",
"def mostra_tudo\n apius.mostra_resumo\n apide.mostra_resumo\n apifr.mostra_resumo\n apimt.mostra_resumo\n apies.mostra_resumo\n apigm.mostra_re... | [
"0.65920645",
"0.61804634",
"0.60283506",
"0.59670466",
"0.59558773",
"0.5917663",
"0.5875348",
"0.584869",
"0.58067334",
"0.5750085",
"0.5726463",
"0.57190263",
"0.5707834",
"0.56836814",
"0.56429607",
"0.56264055",
"0.5625946",
"0.55977833",
"0.55887204",
"0.5569029",
"0.55... | 0.0 | -1 |
Get Balance Returns the satoshi balance, usd balance and user viewable balance for an address. For ERC20 tokens you need to pass in the contract ID and the number of decimal places. | def get_balance(coin_type, address, opts = {})
data, _status_code, _headers = get_balance_with_http_info(coin_type, address, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_balance(address)\n #res = get(\"addr/\"+address+\"?noCache=1\")\n #(res['balance'] + res['unconfirmedBalance']).to_BTCFloat\n get(\"addr/\"+address+\"?noCache=1\")['balance'].to_BTCFloat\n end",
"def getBalance\n result = @driver.GetBalance(:ApiKey => @apikey)\n if result.ge... | [
"0.7314825",
"0.7064698",
"0.7058756",
"0.7047591",
"0.70419425",
"0.6912272",
"0.6876645",
"0.6855768",
"0.6848979",
"0.6766944",
"0.6706207",
"0.6704455",
"0.6694413",
"0.6686138",
"0.66808015",
"0.6654461",
"0.6653663",
"0.66328526",
"0.66308385",
"0.66022456",
"0.65820444... | 0.6409655 | 28 |
Get Balance Returns the satoshi balance, usd balance and user viewable balance for an address. For ERC20 tokens you need to pass in the contract ID and the number of decimal places. | def get_balance_with_http_info(coin_type, address, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AddressApi.get_balance ...'
end
# verify the required parameter 'coin_type' is set
if @api_client.config.client_side_validation && coin_type.nil?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_balance(address)\n #res = get(\"addr/\"+address+\"?noCache=1\")\n #(res['balance'] + res['unconfirmedBalance']).to_BTCFloat\n get(\"addr/\"+address+\"?noCache=1\")['balance'].to_BTCFloat\n end",
"def getBalance\n result = @driver.GetBalance(:ApiKey => @apikey)\n if result.ge... | [
"0.7314825",
"0.7064698",
"0.7058756",
"0.7047591",
"0.70419425",
"0.6912272",
"0.6876645",
"0.6855768",
"0.6848979",
"0.6766944",
"0.6706207",
"0.6704455",
"0.6694413",
"0.6686138",
"0.66808015",
"0.6654461",
"0.6653663",
"0.66328526",
"0.66308385",
"0.66022456",
"0.65820444... | 0.6009009 | 59 |
Get Balances Returns the satoshi balance, usd balance and user viewable balance for a set of addresses. | def get_balances(coin_type, addresses, opts = {})
data, _status_code, _headers = get_balances_with_http_info(coin_type, addresses, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def balances()\n request(\"#{@base_url}/account/getbalances\")\n end",
"def balances\n accounts.with_balance\n end",
"def get_balance(campaigns=[])\n api_call(\"GetBalance\",campaigns)\n end",
"def balance_get(addrs, opts = {})\n data, _status_code, _headers = balance_get_wit... | [
"0.74727434",
"0.7321444",
"0.70134366",
"0.6885689",
"0.6794347",
"0.66981107",
"0.6664422",
"0.66523874",
"0.6526944",
"0.6502147",
"0.6439209",
"0.6362929",
"0.6355836",
"0.6242885",
"0.61715746",
"0.6142293",
"0.61202776",
"0.61202776",
"0.6096186",
"0.6052373",
"0.601010... | 0.6930441 | 3 |
Get Balances Returns the satoshi balance, usd balance and user viewable balance for a set of addresses. | def get_balances_with_http_info(coin_type, addresses, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AddressApi.get_balances ...'
end
# verify the required parameter 'coin_type' is set
if @api_client.config.client_side_validation && coin_type.nil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def balances()\n request(\"#{@base_url}/account/getbalances\")\n end",
"def balances\n accounts.with_balance\n end",
"def get_balance(campaigns=[])\n api_call(\"GetBalance\",campaigns)\n end",
"def get_balances(coin_type, addresses, opts = {})\n data, _status_code, _headers =... | [
"0.7472963",
"0.73218185",
"0.70138323",
"0.69302154",
"0.68847734",
"0.6795169",
"0.66982496",
"0.6664758",
"0.66524965",
"0.6526493",
"0.6502047",
"0.64378977",
"0.6362507",
"0.6355805",
"0.6243328",
"0.6170598",
"0.61407363",
"0.61192966",
"0.61192966",
"0.60962254",
"0.60... | 0.60515785 | 20 |
Get History Returns the transaction history for an address or addresses. | def get_history(coin_type, addresses, opts = {})
data, _status_code, _headers = get_history_with_http_info(coin_type, addresses, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def account_history\n get('account/history')\n end",
"def history(source = nil)\n params = {\n source: source\n }.compact\n\n _get(\"/account/history\", params) { |json| json }\n end",
"def history\n return @history\n end",
"def history\n ... | [
"0.6927592",
"0.6697385",
"0.66865224",
"0.66865224",
"0.66652024",
"0.6635105",
"0.662819",
"0.6581782",
"0.65809345",
"0.65712684",
"0.6365599",
"0.6362947",
"0.6352777",
"0.634292",
"0.633991",
"0.62977517",
"0.62903494",
"0.62755895",
"0.62742704",
"0.6235512",
"0.6234274... | 0.746888 | 0 |
Get History Returns the transaction history for an address or addresses. | def get_history_with_http_info(coin_type, addresses, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AddressApi.get_history ...'
end
# verify the required parameter 'coin_type' is set
if @api_client.config.client_side_validation && coin_type.nil?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_history(coin_type, addresses, opts = {})\n data, _status_code, _headers = get_history_with_http_info(coin_type, addresses, opts)\n data\n end",
"def account_history\n get('account/history')\n end",
"def history(source = nil)\n params = {\n source: source\n }.... | [
"0.746888",
"0.6927592",
"0.6697385",
"0.66865224",
"0.66865224",
"0.66652024",
"0.6635105",
"0.662819",
"0.6581782",
"0.65809345",
"0.65712684",
"0.6365599",
"0.6362947",
"0.6352777",
"0.634292",
"0.62977517",
"0.62903494",
"0.62755895",
"0.62742704",
"0.6235512",
"0.6234274... | 0.633991 | 15 |
Returns USVolume object with a size equal to the number in tablespoons. | def tbsp
Measurements::USVolume.new(self, :tbsp)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def table_size=(size)\n @cc.table_size = size\n end",
"def table_size=(size)\n @cc.table_size = size\n end",
"def canonic_size( size )\n if canonic_type == :decimal && size.is_a?( Integer )\n [ size, 0 ]\n else\n size\n end\n end",
"def size... | [
"0.5175514",
"0.5175514",
"0.5155415",
"0.5120031",
"0.51182884",
"0.5102779",
"0.50798607",
"0.5065726",
"0.5028498",
"0.50036186",
"0.50030273",
"0.49416253",
"0.4940065",
"0.49171522",
"0.4906548",
"0.49032065",
"0.4852276",
"0.48051637",
"0.48004478",
"0.47943437",
"0.478... | 0.5085982 | 6 |
Returns USVolume object with size equal to the number in fluid ounces. | def fl_oz
Measurements::USVolume.new(self, :fl_oz)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
"def volume\n return nil if dimension_u.nil? || dimension_v.nil? || dimension_w.ni... | [
"0.6204754",
"0.5772888",
"0.5600196",
"0.5472153",
"0.5405416",
"0.5397362",
"0.53869087",
"0.53432214",
"0.53106874",
"0.52871823",
"0.52752054",
"0.52500933",
"0.52413994",
"0.5163299",
"0.51154315",
"0.5080425",
"0.50712526",
"0.5071105",
"0.5050411",
"0.5044691",
"0.5040... | 0.5373153 | 7 |
Returns USVolume object with size equal to the number in cups. | def cups
Measurements::USVolume.new(self, :cup)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
"def size\n sku.size * amount\n end",
"def piece_count=(v)\n return if v.nil... | [
"0.59053004",
"0.5895638",
"0.53773814",
"0.5276277",
"0.5270556",
"0.5211324",
"0.515371",
"0.5089328",
"0.5083918",
"0.5066057",
"0.5033164",
"0.50311327",
"0.49864823",
"0.49481007",
"0.4923944",
"0.4914555",
"0.4902628",
"0.48771346",
"0.48523316",
"0.48504195",
"0.483769... | 0.6999369 | 0 |
Returns USVolume object with size equal to the number in pints. | def pints
Measurements::USVolume.new(self, :pint)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
"def size(num)\n params(size: num)\n end",
"def bid_volume\n @bi... | [
"0.54818875",
"0.52362853",
"0.51518744",
"0.50460017",
"0.49586555",
"0.4953716",
"0.49293515",
"0.49263522",
"0.49217504",
"0.49129778",
"0.49011004",
"0.48987666",
"0.48982686",
"0.48757625",
"0.48498526",
"0.48389614",
"0.4837991",
"0.4832898",
"0.4831524",
"0.48302537",
... | 0.591707 | 0 |
Returns USVolume object with size equal to the number in quarts. | def quarts
Measurements::USVolume.new(self, :quart)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
"def size\n sku.size * amount\n end",
"def get_volume_of_cuboid(length, width, ... | [
"0.58693725",
"0.57066494",
"0.55376124",
"0.5508433",
"0.54773945",
"0.5356651",
"0.5325346",
"0.5288244",
"0.52838975",
"0.52795494",
"0.52773076",
"0.526648",
"0.52329814",
"0.51955104",
"0.51882565",
"0.51796865",
"0.5142378",
"0.511737",
"0.50706977",
"0.5068005",
"0.504... | 0.6697649 | 0 |
Returns USVolume object with size equal to the number in gallons. | def gallons
Measurements::USVolume.new(self, :gallon)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preboil_volume_gallons\n boil_off_gallons + @batch_size_gallons\n end",
"def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end",
... | [
"0.54164016",
"0.54120004",
"0.54046893",
"0.51552993",
"0.5092678",
"0.5036013",
"0.5012161",
"0.5001489",
"0.49648178",
"0.49374592",
"0.49356452",
"0.49311453",
"0.49130836",
"0.4911076",
"0.4909478",
"0.49091643",
"0.4909143",
"0.49090102",
"0.48976865",
"0.48694587",
"0.... | 0.6488842 | 0 |
properly formats the time | def padded(num)
if num <= 0
"00"
elsif num < 10
"0" + num.to_s
else
num.to_s
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def formattimeanddate(unformattedtime)\n unformattedtime.strftime('%I:%M:%S %p - %d %m %Y')\n end",
"def format_time(time)\n return time.strftime(\"%l:%M%p\")\n end",
"def format_time\n hours = format_hour @hour\n minutes = format_minute @minutes\n ampm = @hour < 12 ? @@ampm_hash['a'] : @@ampm... | [
"0.81690294",
"0.79916906",
"0.7936207",
"0.79025716",
"0.78992206",
"0.78752506",
"0.7859879",
"0.78264236",
"0.7731965",
"0.7684614",
"0.76450264",
"0.76369077",
"0.7611573",
"0.7575992",
"0.7575992",
"0.7575992",
"0.75607324",
"0.7508419",
"0.74513304",
"0.74320227",
"0.74... | 0.0 | -1 |
recreates the array to show the range of time between the breaks, thus preparing it for the CountingMinutes method | def TimeRecreator(time1, time2)
time1 = time1.split("-").pop + "-"
time1 += time2.split("-").shift
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_times_array(padding = true)\n @times = (padding) ? [@start_dt - 1.hour] : [@start_dt]\n \n # and including every 1/2 hour until one hour after the selected end time\n while true do\n tmp = @times.last + 30.minutes\n (padding) ? (tmp == (@end_dt + 1.hour)) ? break : '' : (tmp == @end_dt... | [
"0.7078079",
"0.66560566",
"0.6642302",
"0.66038734",
"0.64250267",
"0.6342845",
"0.6201754",
"0.614959",
"0.61229086",
"0.59673417",
"0.58816534",
"0.58641773",
"0.5860681",
"0.58066803",
"0.57719225",
"0.5770065",
"0.57268566",
"0.5713473",
"0.56946844",
"0.56618726",
"0.56... | 0.0 | -1 |
current user keeps track of the user logged in so we can display (log in or log out as..) links on the layout view | def current_user
@current_user ||= User.find(session[:user_id]) if
session[:user_id]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_user\n\t\tview_context.current_user\n\tend",
"def user_layout\n if user_signed_in?\n # If user is admin, set admin flag\n if current_user.admin?\n @admin = true\n end\n # set users fullname for display\n @user_name = current_user.name\n @user = current_user\n ... | [
"0.7643973",
"0.75631905",
"0.7511521",
"0.749292",
"0.74634653",
"0.7450103",
"0.74430835",
"0.7407329",
"0.7407329",
"0.74049497",
"0.74004626",
"0.7374364",
"0.7371413",
"0.73526466",
"0.7342652",
"0.73397124",
"0.73215735",
"0.7320007",
"0.7316836",
"0.7312192",
"0.728954... | 0.0 | -1 |
Silly but usable form prototype Not really meant to be used in a real case It uses a textarea for everything Override it Or even better, use SequelCrushyform plugin instead | def backend_fields(cols)
o = ''
cols.each do |c|
identifier = "#{id.to_i}-#{self.class}-#{c}"
o << "<label for='#{identifier}'>#{c.to_s.capitalize}</label><br />\n"
o << "<textarea id='#{identifier}' name='model[#{c}]'>#{self.send(c)}</textarea><br />\n"
end
o
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def form; end",
"def text_area; end",
"def forms; end",
"def ing_form; end",
"def _whimsy_forms_input(\n name: nil,\n label: 'Enter string',\n type: 'text',\n rows: nil, # If rows, then is a textarea instead of input\n value: '',\n required: false,\n readonly: false,\n icon: nil,\n ... | [
"0.69717735",
"0.6828864",
"0.6736481",
"0.6622064",
"0.646594",
"0.6458824",
"0.6398401",
"0.63951117",
"0.6384517",
"0.6329208",
"0.62643474",
"0.6250424",
"0.6152034",
"0.61251277",
"0.6071548",
"0.60506016",
"0.6025205",
"0.6015348",
"0.5955236",
"0.59534067",
"0.589042",... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_user
@user = User.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def user_params
params.require(:user).permit(:name, :screct_pass, :password)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Create/Update a payment method via Samurai Transparent Redirect | def new
params[:payment_method_token] ||= current_user.payment_method_token
setup_for_transparent_redirect(params)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_card\n host_url = request.protocol + request.host_with_port \n begin\n result = ChargeBee::HostedPage.update_payment_method(\n { :customer => { :id => @customer_id },\n :redirect_url => host_url + \"/ssp/redirect_handler\",\n :cancel_url => host_url + \"/ssp/sub... | [
"0.67622805",
"0.65974426",
"0.6524096",
"0.64714646",
"0.64684016",
"0.6382394",
"0.62416726",
"0.6196449",
"0.61962",
"0.618633",
"0.6182604",
"0.61604583",
"0.61436427",
"0.6111525",
"0.6106515",
"0.60960484",
"0.6043334",
"0.6027591",
"0.6023871",
"0.60003936",
"0.5974660... | 0.6167424 | 11 |
Purchase the article, and redirect to it | def purchase
load_and_verify_payment_method(params)
redirect_to new_article_order_path(@article, payment_method_params) and return unless @payment_method
@order = current_user.orders.create :article=>@article
@transaction = Samurai::Processor.the_processor.purchase(
@payment_method.token,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def purchase\r\n redirect_to \"http://www.1shoppingcart.com/app/javanof.asp?MerchantID=31593&ProductID=3257357\"\r\n end",
"def link_form\n @purchase = Purchase.find_by_id params[:id]\n if !@purchase\n redirect_to '/admin/purchases'\n return\n end\n end",
"def publish\n\t\t@article.publ... | [
"0.7462033",
"0.6610919",
"0.6511793",
"0.6447817",
"0.6308654",
"0.6249633",
"0.6147074",
"0.6108893",
"0.6039982",
"0.59578794",
"0.5948272",
"0.59429306",
"0.5930706",
"0.5916562",
"0.5914955",
"0.59072477",
"0.5904656",
"0.5895368",
"0.5848823",
"0.5847925",
"0.584238",
... | 0.7350066 | 1 |
Define an empty process | def process(*)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n @processes = []\n end",
"def initialize(process); end",
"def initialize(process)\n self.process = process\n end",
"def initialize(pid) \r\n @pid = pid\r\n @h = Ragweed::Wrap32::open_process(pid)\r\n @a = arena()\r\n end",
"def process\n # no-op by default\n en... | [
"0.6707049",
"0.6685897",
"0.64436495",
"0.6033135",
"0.5954204",
"0.58781004",
"0.5843107",
"0.57428735",
"0.57397515",
"0.5702551",
"0.5649816",
"0.56327695",
"0.5602616",
"0.55662453",
"0.54700893",
"0.5456875",
"0.54407895",
"0.54248744",
"0.5404583",
"0.5395417",
"0.5385... | 0.0 | -1 |
Perform the process of importing the market data. Returns true if no errors are found, false otherwise. | def process
market_data.each do |data|
slug = data['slug']
coin = Coin.find_by_slug(slug)
if coin.nil?
add_error(slug, "Unknown coin: #{data['name']}")
next
end
quote_time = DateTime.parse(data['quote']['USD']['last_updated'])
next if coin.worths.where(quote: '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def errored_during_import?\n import_errors.present?\n end",
"def import_failed?\n IMPORT_ERRORS.include? import_progress[:status]\n end",
"def product_import_initial_values\n if @temp_file.blank?\n errors.add(:file_missing, \"file missing\")\n return false\n end\n\n begin\n file... | [
"0.65212786",
"0.6429779",
"0.63465726",
"0.63124794",
"0.6290406",
"0.62252414",
"0.6194359",
"0.6144693",
"0.6131027",
"0.6080742",
"0.6058366",
"0.5913003",
"0.5905774",
"0.58662623",
"0.5775019",
"0.5770703",
"0.5743499",
"0.5722491",
"0.5658417",
"0.5636622",
"0.56263375... | 0.0 | -1 |
GET /customers GET /customers.json | def index
@customers = []
#take params from search on Index view, or if no search, assume todays date
#send to model to apply SEARCH function, which retrieves matching records and requests only CONFIRMED records
if params[:customer]
@customers = Customer.search(params[:customer])
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @customers = @user.customers.all\n render json: @customers\n end",
"def customers(options = {})\n perform_get_with_object('/customers', options, Epages::CustomersResponse)\n end",
"def index\n @user = current_user\n @customers = @user.custo... | [
"0.80477434",
"0.7958279",
"0.78736347",
"0.7785999",
"0.7759871",
"0.7743631",
"0.7737657",
"0.7650475",
"0.7650475",
"0.7644552",
"0.76392215",
"0.7563173",
"0.7439835",
"0.74304175",
"0.74225414",
"0.7395726",
"0.72824943",
"0.72764957",
"0.7261613",
"0.72505057",
"0.72505... | 0.0 | -1 |
GET /customers/1 GET /customers/1.json | def show
@customer = Customer.find(params[:id])
@bookings = Booking.where(:email => @customer[:email])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_customer(id)\n get(\"customers/#{id}\")\n end",
"def get_customer(id)\n get(\"customers/#{id}\")\n end",
"def index\n @customers = @user.customers.all\n render json: @customers\n end",
"def index\n @user = current_user\n @customers = @user.custom... | [
"0.78568625",
"0.78568625",
"0.7680524",
"0.76006114",
"0.7533196",
"0.7516672",
"0.7499743",
"0.7383202",
"0.7336955",
"0.7336955",
"0.7336955",
"0.7336955",
"0.7336955",
"0.7336955",
"0.73160666",
"0.7308929",
"0.7281901",
"0.71956944",
"0.71879476",
"0.7172753",
"0.7169239... | 0.0 | -1 |
POST /customers POST /customers.json | def subscribe
@customer = Customer.new(customer_params)
if Customer.where(:email => @customer.email).count == 1
redirect_to static_pages_hfsk_get_in_touch_path, notice: 'We already have you on the list!'
else
respond_to do |format|
if @customer.save
format.html { redirect_to st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @customer = @user.customers.build(customer_params)\n if @customer.save\n render json: @customer, status: :created\n else\n render json: @customer.errors, status: :unprocessable_entity\n end\n\n ... | [
"0.7583026",
"0.7368963",
"0.72758555",
"0.7225672",
"0.7224766",
"0.7142322",
"0.7116918",
"0.7109281",
"0.7102696",
"0.70753646",
"0.7068943",
"0.7054525",
"0.70359194",
"0.70359194",
"0.70350176",
"0.703466",
"0.70175",
"0.7017294",
"0.7017294",
"0.7017294",
"0.7017294",
... | 0.0 | -1 |
POST /customers POST /customers.json | def create
@customer = Customer.new(customer_params)
respond_to do |format|
if @customer.save
format.html { redirect_to @customer, notice: 'Customer was successfully created.' }
format.json { render :show, status: :created, location: @customer }
else
format.html { render ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @customer = @user.customers.build(customer_params)\n if @customer.save\n render json: @customer, status: :created\n else\n render json: @customer.errors, status: :unprocessable_entity\n end\n\n ... | [
"0.7583026",
"0.7368963",
"0.72758555",
"0.7225672",
"0.7224766",
"0.7142322",
"0.7116918",
"0.7109281",
"0.7102696",
"0.70753646",
"0.7068943",
"0.7054525",
"0.70359194",
"0.70359194",
"0.70350176",
"0.703466",
"0.70175",
"0.7017294",
"0.7017294",
"0.7017294",
"0.7017294",
... | 0.7011197 | 23 |
PATCH/PUT /customers/1 PATCH/PUT /customers/1.json | def update
respond_to do |format|
if @customer.update(customer_params)
format.html { redirect_to @customer, notice: 'Customer was successfully updated.' }
format.json { render :show, status: :ok, location: @customer }
else
format.html { render :edit }
format.json { render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end",
"def update\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n if @customer.update_attributes(params[:customer])\n #format.html { redirect_to customers_path }\n format.json { head :ok ... | [
"0.6988014",
"0.6921667",
"0.6921389",
"0.6746401",
"0.6746401",
"0.6746401",
"0.6746401",
"0.6746401",
"0.6746401",
"0.6746401",
"0.67379916",
"0.6729548",
"0.669213",
"0.669213",
"0.669213",
"0.6614732",
"0.66107404",
"0.6601309",
"0.6599307",
"0.6581087",
"0.65642476",
"... | 0.6525123 | 38 |
DELETE /customers/1 DELETE /customers/1.json | def destroy
@customer.destroy
respond_to do |format|
format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |for... | [
"0.7459997",
"0.7459997",
"0.74485695",
"0.74485695",
"0.74485695",
"0.74485695",
"0.74485695",
"0.74485695",
"0.74485695",
"0.7435839",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7429404",
"0.7364333",
"0.732843",
"0.7298528... | 0.7141246 | 45 |
Use callbacks to share common setup or constraints between actions. | def set_customer
@customer = Customer.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def customer_params
params.require(:customer).permit(:name, :phone, :email, :desc, :subscribed, :accessible, :child_friendly)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
GET /billing_infos/1 GET /billing_infos/1.json | def show
@billing_info = BillingInfo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @billing_info }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @billing_infos = BillingInfo.all\n end",
"def index\n @billing_infos = BillingInfo.all\n end",
"def billing\n request('billing', :get)\n end",
"def new\n @billing_info = BillingInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render ... | [
"0.75080043",
"0.75080043",
"0.74623305",
"0.7396445",
"0.72180706",
"0.68948686",
"0.6824466",
"0.6790777",
"0.6790777",
"0.6718435",
"0.67106795",
"0.6700457",
"0.66852",
"0.6640941",
"0.66219884",
"0.65196025",
"0.65196025",
"0.6509366",
"0.6470568",
"0.6448489",
"0.644394... | 0.81548774 | 0 |
GET /billing_infos/new GET /billing_infos/new.json | def new
@billing_info = BillingInfo.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @billing_info }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @billing_info = BillingInfo.new(params[:billing_info])\n\n respond_to do |format|\n if @billing_info.save\n format.html { redirect_to @billing_info, notice: 'Billing info was successfully created.' }\n format.json { render json: @billing_info, status: :created, location: @bill... | [
"0.7669924",
"0.75603896",
"0.7530572",
"0.72412294",
"0.72412294",
"0.7150039",
"0.712442",
"0.70535386",
"0.70535386",
"0.7028865",
"0.7011408",
"0.7000077",
"0.69844526",
"0.69825524",
"0.69704396",
"0.69704396",
"0.69704396",
"0.6957729",
"0.6957729",
"0.6937579",
"0.6932... | 0.8308673 | 0 |
POST /billing_infos POST /billing_infos.json | def create
@billing_info = BillingInfo.new(params[:billing_info])
respond_to do |format|
if @billing_info.save
format.html { redirect_to @billing_info, notice: 'Billing info was successfully created.' }
format.json { render json: @billing_info, status: :created, location: @billing_info }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @billing_info = BillingInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @billing_info }\n end\n end",
"def create\n @billing_info = BillingInfo.new(billing_info_params)\n @billing_info.company_id = current_user.company_id\n\n res... | [
"0.72587776",
"0.7185455",
"0.69965315",
"0.69143224",
"0.6884329",
"0.68250376",
"0.6822092",
"0.6804976",
"0.6750653",
"0.6750653",
"0.66991025",
"0.66827124",
"0.66827124",
"0.6565685",
"0.6546315",
"0.650386",
"0.6472567",
"0.6433595",
"0.63902986",
"0.6374602",
"0.637036... | 0.7785259 | 0 |
PUT /billing_infos/1 PUT /billing_infos/1.json | def update
@billing_info = BillingInfo.find(params[:id])
respond_to do |format|
if @billing_info.update_attributes(params[:billing_info])
format.html { redirect_to @billing_info, notice: 'Billing info was successfully updated.' }
format.json { head :no_content }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @billing_info.update(billing_info_params)\n format.html { redirect_to @billing_info, notice: 'Billing info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json {... | [
"0.7353004",
"0.72369725",
"0.72369725",
"0.7159049",
"0.704509",
"0.70017296",
"0.6880946",
"0.6879077",
"0.68785393",
"0.68317735",
"0.6506148",
"0.6471375",
"0.6402917",
"0.63708013",
"0.63098514",
"0.63009953",
"0.62468094",
"0.62392145",
"0.6224508",
"0.6224508",
"0.6224... | 0.75241995 | 0 |
DELETE /billing_infos/1 DELETE /billing_infos/1.json | def destroy
@billing_info = BillingInfo.find(params[:id])
@billing_info.destroy
respond_to do |format|
format.html { redirect_to billing_infos_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @billing_info.destroy\n respond_to do |format|\n format.html { redirect_to billing_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @billing_info.destroy\n respond_to do |format|\n format.html { redirect_to select_plan_path }\n format.j... | [
"0.8067053",
"0.79237777",
"0.7494958",
"0.7356279",
"0.7349171",
"0.72781503",
"0.7186637",
"0.7138617",
"0.70773065",
"0.7047433",
"0.70213205",
"0.688862",
"0.681967",
"0.67866445",
"0.6781592",
"0.6772383",
"0.6701584",
"0.6701584",
"0.66995645",
"0.66784316",
"0.6646599"... | 0.80869853 | 0 |
Updates the order and advances to the next state (when possible.) Overriden by the promo gem if it exists. | def update
op = object_params
if op && op[:payments_attributes]
@order.payments.where('spree_payments.state = "checkout"').destroy_all
end
# binding.pry
if @order.update_attributes(op)
fire_event('spree.checkout.update')
if @order.next
state_callback(:af... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complete_order_step(order, order_step)\n original_state = order.state\n order.state = order_step\n\n if !order.next\n order.state = original_state\n order.save(validate: false) # store data from paypal. user will be redirect to 'personal' tab\n end\n end",
"def order_upgrade\n @or... | [
"0.7348647",
"0.7116942",
"0.7114427",
"0.7059295",
"0.6950519",
"0.69288135",
"0.6909866",
"0.68980557",
"0.67957497",
"0.6714615",
"0.667935",
"0.66670233",
"0.6596521",
"0.6525653",
"0.6493509",
"0.6483893",
"0.6455525",
"0.6422882",
"0.63958985",
"0.6367494",
"0.6339467",... | 0.69522107 | 4 |
Provides a route to redirect after order completion | def completion_route
order_path(@order, :checkout_complete => true)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def completion_route\n thankyou_order_url(@order)\n end",
"def completion_route\n return order_path(@order) unless @order.user.anonymous?\n token_order_path(@order, @order.user.token)\n end",
"def completion_route\n order_path(@order)\n end",
"def redirect_or_complete_order\n @order = Sp... | [
"0.74368024",
"0.7307958",
"0.72201335",
"0.69129425",
"0.66553843",
"0.6452472",
"0.62485075",
"0.62060976",
"0.6169361",
"0.611184",
"0.6103027",
"0.6096453",
"0.6055876",
"0.60554457",
"0.60248774",
"0.60073847",
"0.6004088",
"0.59874326",
"0.5986176",
"0.5959058",
"0.5949... | 0.74656683 | 0 |
Provides a description for the next matcher | def desc(string)
@last_description = string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description\n \"#{match.description} #{label}\"\n end",
"def next_match_title\n \"Match#{next_match_number}\"\n end",
"def matcher_name; end",
"def matcher_name; end",
"def get_description_from_matcher(should_or_should_not, method, *args, &block) #:nodoc:\n verb = should_or_should_not.to... | [
"0.7377276",
"0.7241259",
"0.72155446",
"0.72155446",
"0.6540536",
"0.6452032",
"0.6452032",
"0.62308383",
"0.61723787",
"0.61723787",
"0.61167103",
"0.61050314",
"0.6079136",
"0.5879723",
"0.570075",
"0.5685373",
"0.5679126",
"0.56703204",
"0.5669363",
"0.5667035",
"0.566426... | 0.0 | -1 |
A list of regular expressions to apply to input being sent to the plugin, along with blocks of actions to perform. Each element is a [regexp, options, action, description] array. | def matchers
@matchers ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exec(input, events=[])\n match = input.scan(@regexp)\n\n if match\n events << self\n events << CLOSE\n events << match.length\n end\n\n events\n end",
"def regexps; end",
"def exec(input, events=[])\n match = input.scan(@regexp)\n\n if match\n ... | [
"0.5920286",
"0.59070987",
"0.5900984",
"0.5639694",
"0.5551771",
"0.55253947",
"0.55253947",
"0.5500414",
"0.5488807",
"0.5464021",
"0.5416229",
"0.5403914",
"0.53894776",
"0.5377114",
"0.5373245",
"0.5370417",
"0.5365531",
"0.5341026",
"0.5288651",
"0.52825713",
"0.52825713... | 0.0 | -1 |
Creates a new instance of this plugin to reply to a particular object over that object's connection | def initialize(reply_to, private_sender = nil)
self.reply_to = reply_to
self.connection = reply_to.connection
self.private_sender = private_sender
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reply\n message = self.class.new(:subject => subject, :body => body)\n message.sender = sender\n message.to(to)\n message\n end",
"def reply\n message = self.message.class.new(:subject => subject, :body => body)\n message.sender = receiver\n message.to(sender)\n message\n end",
"d... | [
"0.6619756",
"0.6294441",
"0.61245936",
"0.59539574",
"0.58021915",
"0.57856745",
"0.5731792",
"0.5727099",
"0.56824994",
"0.56238294",
"0.562338",
"0.5615103",
"0.5558081",
"0.5557623",
"0.55218357",
"0.54805046",
"0.5468875",
"0.5423861",
"0.5400584",
"0.53714174",
"0.53667... | 0.61363816 | 2 |
Send +message+ back to the HipChat server. If +to+ == +:room+, replies to the room. If +to+ == nil, responds in the manner the original message was sent. Otherwise, PMs the message to +to+. | def reply(message, to = nil)
if to == :room
reply_to.reply(message, nil)
else
reply_to.reply(message, to || private_sender)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reply_message(params)\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n call_api(:method => :post, :uri => @api_base.merge(\"room/#{room_id}/reply\"), :body_params => params)\n end",
"def broadcast_to(room, msg)\n\t\t\tm = G... | [
"0.66002274",
"0.63776666",
"0.6189043",
"0.6087626",
"0.579443",
"0.55950856",
"0.55942017",
"0.5593525",
"0.5549418",
"0.5490347",
"0.5483273",
"0.5465405",
"0.54620755",
"0.5447426",
"0.54408777",
"0.542646",
"0.5415297",
"0.54127085",
"0.5405789",
"0.53953594",
"0.5394616... | 0.78462917 | 0 |
An ordered list of all words in the message with any reference to the bot's nick stripped out. If +command+ is passed in, it is also stripped out. This is useful to separate the 'parameters' from the 'commands' in a message. | def words(message, command = nil)
reply = at_nick.downcase
command = command.downcase if command
message.split.reject {|word| word.downcase == reply || word.downcase == command }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def without_nick(message)\n possible_nick, command = message.split(' ', 2)\n if possible_nick.casecmp(at_nick) == 0\n command\n else\n message\n end\n end",
"def words\n message.split\n end",
"def command_list m\n get_list escape m.channel.to_s #logic/pug\n end",
"def strip_mes... | [
"0.5913243",
"0.5908133",
"0.55127823",
"0.5350945",
"0.5346824",
"0.5246391",
"0.52345324",
"0.51931435",
"0.51899606",
"0.51899606",
"0.5138439",
"0.5127919",
"0.5068915",
"0.50436324",
"0.5021841",
"0.50095546",
"0.49676156",
"0.4961847",
"0.49489635",
"0.49471855",
"0.494... | 0.7779327 | 0 |
Removes the first word in message if it is a reference to the bot's nick | def without_nick(message)
possible_nick, command = message.split(' ', 2)
if possible_nick.casecmp(at_nick) == 0
command
else
message
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nick_part(nick, reason=nil)\n return if not @names.include?(nick)\n\n @names.delete(nick)\n reason = \" (#{reason})\" if reason\n @bridge.add(:xmpp, :irc, SYSTEM_USER, \"#{nick} just left the IRC channel#{reason}\")\n end",
"def part msg\n msg.connection.channels.each_value do |chan|\n ... | [
"0.6668592",
"0.6528002",
"0.64406157",
"0.6282258",
"0.616248",
"0.6085518",
"0.6074179",
"0.60251206",
"0.5927969",
"0.5865599",
"0.57653135",
"0.5722443",
"0.56778085",
"0.5623015",
"0.55778295",
"0.55585176",
"0.55238044",
"0.5521788",
"0.55213225",
"0.55183566",
"0.55121... | 0.7735524 | 0 |
Do whatever you need to do to handle this message. If you want to stop the plugin execution chain, return +true+ from this method. Plugins are handled in the order that they appear in Robut::Plugin.plugins | def handle(time, sender_nick, message)
if matchers.empty?
raise NotImplementedError, "Implement me in #{self.class.name}!"
else
find_match(message)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plugin_allowed?(plugin_name); end",
"def check_command_plugins(msg)\n @command_plugins.each do |name, block, options|\n begin\n if name =~ /^!/\n if msg =~ /^#{name}\\b/\n msg = msg.gsub(/!\\S+\\s*/, \"\")\n block.call(msg)\n end\n ... | [
"0.6325551",
"0.62367857",
"0.6164796",
"0.60785544",
"0.6007291",
"0.5962489",
"0.5795329",
"0.5782844",
"0.5770373",
"0.5750689",
"0.5722477",
"0.57117766",
"0.5711286",
"0.5685568",
"0.56665176",
"0.5653379",
"0.5589711",
"0.5587254",
"0.5587254",
"0.55451167",
"0.5534572"... | 0.0 | -1 |
Returns a list of messages describing the commands this plugin handles. | def usage
matchers.map do |regexp, options, action, description|
next unless description
if options[:sent_to_me]
at_nick + " " + description
else
description
end
end.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commands\r\n @help_commands\r\n end",
"def supported_commands\n commands.keys\n end",
"def commands\n help_list = {}\n @commands.map do |cmd|\n info = Commands.const_get(\"#{cmd}\".capitalize!).info #=> {cmd => \"Description\"}\n help_list[info.keys.fir... | [
"0.7376699",
"0.71981084",
"0.7175714",
"0.71377116",
"0.7118447",
"0.7076356",
"0.69700766",
"0.69661564",
"0.69610155",
"0.6958765",
"0.6949494",
"0.6937923",
"0.6906225",
"0.68263763",
"0.68210495",
"0.6768222",
"0.67420834",
"0.6732571",
"0.6715132",
"0.6713857",
"0.66952... | 0.0 | -1 |
Accessor for the store instance | def store
connection.store
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def store\n return self.class.store\n end",
"def store\r\n return @store\r\n end",
"def store\n self.class.store\n end",
"def store\n @store\n end",
"def store\n @store\n end",
"def store\n @store ||= Store.new\n end",
"def store\n @@store ||= Store.ge... | [
"0.8226905",
"0.8001342",
"0.7885092",
"0.77482486",
"0.77482486",
"0.7727425",
"0.7605554",
"0.7543315",
"0.7268862",
"0.7232325",
"0.71001565",
"0.70652306",
"0.7015164",
"0.69960433",
"0.6986383",
"0.6943777",
"0.6903568",
"0.68448627",
"0.67239094",
"0.6713173",
"0.667436... | 0.6671886 | 21 |
Find and run all the actions associated with matchers that match +message+. | def find_match(message)
matchers.each do |regexp, options, action, description|
if options[:sent_to_me] && !sent_to_me?(message)
next
end
if match_data = without_nick(message).match(regexp)
# Return true explicitly if this matcher explicitly returned true
break true if ins... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_message(message)\n @routes\n .reduce(Set.new) do |memo, (matcher, handlers)|\n memo = memo.merge(handlers) if matcher.matches_message?(message)\n memo\n end\n end",
"def find_all_actions_matching(matcher)\n actions.find_all ... | [
"0.6615374",
"0.5999747",
"0.5943788",
"0.59328794",
"0.5838377",
"0.57649815",
"0.5702747",
"0.5565897",
"0.55282384",
"0.55019957",
"0.54770076",
"0.543302",
"0.53932214",
"0.5376062",
"0.5372585",
"0.5343184",
"0.5332027",
"0.529163",
"0.52706647",
"0.52423775",
"0.5238046... | 0.63537383 | 1 |
The matchers defined by this plugin's class | def matchers
self.class.matchers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matchers\n @matchers ||= []\n end",
"def matchers\n @known_classes.select {|c| c <= ::Dat::Analysis::Matcher }\n end",
"def matchers\n @matchers ||= {}\n end",
"def matchers\n keywords[\"matchers\"] || {}\n end",
"def matchers\n @components.values\n end",
"def ... | [
"0.8306234",
"0.8095706",
"0.7902726",
"0.7770168",
"0.77267176",
"0.7543323",
"0.7486974",
"0.7264918",
"0.70219404",
"0.70219404",
"0.7006018",
"0.7006018",
"0.68073285",
"0.67789936",
"0.64395064",
"0.643461",
"0.63800454",
"0.6373047",
"0.6373047",
"0.6272541",
"0.6218911... | 0.8092014 | 2 |
Performs a merge on the repository. | def merge(commits, no_ff: false)
cmd = %w[merge --no-edit --no-log]
cmd << '--no-ff' if no_ff
cmd += Array(commits)
GitCommandResult.new(*run_git(cmd))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge(user_name, repo_name, params={})\n normalize! params\n filter! VALID_MERGE_PARAM_NAMES, params\n assert_required_keys REQUIRED_MERGE_PARAMS, params\n\n post_request(\"/repos/#{user_name}/#{repo_name}/merges\", params)\n end",
"def merge_commit\n @org = Org.find(params[:id])\... | [
"0.6891649",
"0.6853526",
"0.67897743",
"0.6756966",
"0.6728625",
"0.6727991",
"0.6724148",
"0.66722584",
"0.6646858",
"0.6584396",
"0.65783495",
"0.65542936",
"0.6520926",
"0.6506543",
"0.6503335",
"0.648635",
"0.64468616",
"0.63653654",
"0.63375306",
"0.6325263",
"0.6287157... | 0.5928583 | 38 |
NOTE: This has been made private, as it's no longer used publicly, but the tests for other methods in this class currently depend on it. | def log(format: nil)
format_pattern =
case format
when :author
'%aN'
when :message
'%B'
end
cmd = %w[log --topo-order]
cmd << "--format='#{format_pattern}'" if format_pattern
output, = run_git(cmd)
output&.squeeze!("\n") if format_patte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def internal; end",
"def probers; end",
"def spec; end",
"def spec; end",
"def private_method\n end",
"def implemented_in; end",
"def ... | [
"0.77232206",
"0.62547386",
"0.62547386",
"0.6213682",
"0.6213682",
"0.6213682",
"0.6213682",
"0.5989635",
"0.5921189",
"0.5841518",
"0.5841518",
"0.5762026",
"0.57382655",
"0.57127005",
"0.5686586",
"0.56837904",
"0.56354177",
"0.5612077",
"0.5594109",
"0.5594109",
"0.559410... | 0.0 | -1 |
NOTE: This has been made private, as it's no longer used publicly, but the tests for other methods in this class currently depend on it. | def commit(files, no_edit: false, amend: false, message: nil, author: nil)
run_git ['add', *Array(files)] if files
cmd = %w[commit]
cmd << '--no-edit' if no_edit
cmd << '--amend' if amend
cmd << %[--author="#{author}"] if author
cmd += ['--message', %["#{message}"]] if message
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def implementation; end",
"def implementation; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def internal; end",
"def probers; end",
"def spec; end",
"def spec; end",
"def private_method\n end",
"def implemented_in; end",
"def ... | [
"0.77232206",
"0.62547386",
"0.62547386",
"0.6213682",
"0.6213682",
"0.6213682",
"0.6213682",
"0.5989635",
"0.5921189",
"0.5841518",
"0.5841518",
"0.5762026",
"0.57382655",
"0.57127005",
"0.5686586",
"0.56837904",
"0.56354177",
"0.5612077",
"0.5594109",
"0.5594109",
"0.559410... | 0.0 | -1 |
Input: Two arrays as arguments Output: An array that contains all of the values from the argument arrays Rules: All duplicates must be removed even if there are duplicates in the original arrays EXAMPLES: merge([1, 3, 5], [3, 6, 9]) == [1, 3, 5, 6, 9] ALGORITHM: Initialize empty combined array Iterate through each elem... | def merge(arr1, arr2)
merged = []
arr1.each { |el| merged << el }
arr2.each { |el| merged << el }
merged.uniq
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge(array1, array2)\n # (array1 + array2).uniq\n array1 | array2\nend",
"def merge(array_1, array_2)\n (array_1 + array_2).uniq\nend",
"def merge(array_1, array_2)\n (array_1 + array_2).uniq\nend",
"def merge(array1, array2)\n (array1 + array2).uniq\nend",
"def merge(arr1, arr2)\r\n merged_arra... | [
"0.772638",
"0.7712564",
"0.7712564",
"0.7669934",
"0.7624815",
"0.7519792",
"0.7515528",
"0.74978894",
"0.7487255",
"0.74742985",
"0.7473642",
"0.7438787",
"0.74316174",
"0.74158764",
"0.7400684",
"0.7400684",
"0.7379904",
"0.7378722",
"0.7364808",
"0.7360046",
"0.73570305",... | 0.7567011 | 5 |
GET /disatance_and_times GET /disatance_and_times.json | def index
@disatance_and_times = DisatanceAndTime.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n render :json => @timecard.to_json(:include => :time_entry), status: :ok\n end",
"def set_disatance_and_time\n @disatance_and_time = DisatanceAndTime.find(params[:id])\n end",
"def index\n @timecards = TimeCard.all\n render :json => @timecards.to_json(:include => :time_entry), statu... | [
"0.64136195",
"0.6285597",
"0.62769437",
"0.62163085",
"0.6099392",
"0.60022205",
"0.5944305",
"0.5899647",
"0.58721507",
"0.58182645",
"0.5808619",
"0.5808281",
"0.57819",
"0.5777804",
"0.57705355",
"0.57500273",
"0.57400453",
"0.5731615",
"0.56889737",
"0.5687546",
"0.56570... | 0.7489211 | 0 |
GET /disatance_and_times/1 GET /disatance_and_times/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @disatance_and_times = DisatanceAndTime.all\n end",
"def show\n render :json => @timecard.to_json(:include => :time_entry), status: :ok\n end",
"def show\n @nursing_time = NursingTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { ... | [
"0.7261556",
"0.6566656",
"0.63707715",
"0.6319267",
"0.6292924",
"0.62879294",
"0.6216548",
"0.61538696",
"0.61334884",
"0.60958594",
"0.60204345",
"0.6000614",
"0.59909314",
"0.59870553",
"0.59870553",
"0.59599185",
"0.5956315",
"0.59465414",
"0.59288746",
"0.5889409",
"0.5... | 0.0 | -1 |
POST /disatance_and_times POST /disatance_and_times.json | def create
@disatance_and_time = DisatanceAndTime.new(disatance_and_time_params)
respond_to do |format|
if @disatance_and_time.save
format.html { redirect_to @disatance_and_time, notice: 'Disatance and time was successfully created.' }
format.json { render :show, status: :created, locatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disatance_and_time_params\n params.require(:disatance_and_time).permit(:start_id, :end_id, :cost_time, :distance)\n end",
"def set_disatance_and_time\n @disatance_and_time = DisatanceAndTime.find(params[:id])\n end",
"def index\n @disatance_and_times = DisatanceAndTime.all\n end",
"de... | [
"0.6476341",
"0.64049864",
"0.6137282",
"0.59819573",
"0.59797984",
"0.58441556",
"0.5719973",
"0.57143366",
"0.57141",
"0.56469536",
"0.5605883",
"0.5602034",
"0.55547816",
"0.5551453",
"0.54402834",
"0.54284286",
"0.5420759",
"0.5411625",
"0.53763384",
"0.5375875",
"0.53628... | 0.71925676 | 0 |
PATCH/PUT /disatance_and_times/1 PATCH/PUT /disatance_and_times/1.json | def update
respond_to do |format|
if @disatance_and_time.update(disatance_and_time_params)
format.html { redirect_to @disatance_and_time, notice: 'Disatance and time was successfully updated.' }
format.json { render :show, status: :ok, location: @disatance_and_time }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @time_off_request = TimeOffRequest.find(params[:id])\n respond_to do |format|\n if @time_off_request.update_attributes(params[:time_off_request])\n format.html { redirect_to admin_time_off_requests_url, notice: 'Time off request was successfully updated.' }\n format.json {... | [
"0.64765316",
"0.6354351",
"0.6337179",
"0.63341516",
"0.6331484",
"0.6283852",
"0.6266696",
"0.6223409",
"0.6210575",
"0.6158644",
"0.6134187",
"0.61199147",
"0.6117282",
"0.60922605",
"0.60922605",
"0.6075431",
"0.6071622",
"0.60702175",
"0.6068346",
"0.60498685",
"0.604288... | 0.7111923 | 0 |
DELETE /disatance_and_times/1 DELETE /disatance_and_times/1.json | def destroy
@disatance_and_time.destroy
respond_to do |format|
format.html { redirect_to disatance_and_times_url, notice: 'Disatance and time was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @nursing_time = NursingTime.find(params[:id])\n @nursing_time.destroy\n\n respond_to do |format|\n format.html { redirect_to nursing_times_url }\n format.json { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @time_gap = Ti... | [
"0.694231",
"0.6882681",
"0.6847577",
"0.68420106",
"0.6825202",
"0.68122077",
"0.67942166",
"0.675718",
"0.6752113",
"0.67442197",
"0.6717403",
"0.6713383",
"0.67035717",
"0.6677627",
"0.66670835",
"0.6655729",
"0.66526985",
"0.66516083",
"0.66468483",
"0.6644592",
"0.662652... | 0.7547343 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_disatance_and_time
@disatance_and_time = DisatanceAndTime.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def disatance_and_time_params
params.require(:disatance_and_time).permit(:start_id, :end_id, :cost_time, :distance)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_exams
@course = Course.find(params[:course_id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def exam_params
params.require(:exam).permit(:title, :date, :minimum)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.638045... | 0.0 | -1 |
Determine Domain Mapentry and DbModel from entity expression. | def db_table_column(expr, entry = nil)
storage_map = storage_map(:db, expr.domain_name)
db = fetch_storage_class(storage_map.storage_key)
column = storage_map.storage_attr(expr.domain_attr)
[db.table_name, column]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_for(model) # @private :nodoc:\n entity_mapping[model] or raise \"model #{model} exists, but is not included in domain\"\n end",
"def entity_class\n self.class.name.sub(/Mapper$/, '').constantize\n end",
"def entity_class\n @entity_class ||= (\"::\" + self.class.name.split('::').... | [
"0.5643843",
"0.52450395",
"0.4989761",
"0.49816296",
"0.47330636",
"0.47177687",
"0.46242404",
"0.46222666",
"0.45947158",
"0.458505",
"0.45841733",
"0.4520969",
"0.4491989",
"0.44900355",
"0.4474696",
"0.44639853",
"0.44362858",
"0.44317403",
"0.44317403",
"0.44098812",
"0.... | 0.4150493 | 52 |
Converts an entity expression into a valid active record expresion expression. | def convert_expr(expr, values = [], entry = nil)
if expr_conjunction?(expr)
return convert_conjunction(expr, values, entry)
end
column = qualified_db_column(expr, entry)
op = expr.op
arg = case expr.op
when 'in', 'not in' then '(?)'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_expression(expr); end",
"def compose_expression(expression_object, model:, column_name:, column_node:, column_type:)\n expression_object => {expressions:, value: raw_value}\n\n raise \"column_type not supplied (it was #{column_type})\" unless column_type.is_a?(Symbol)\n unless column_nod... | [
"0.594437",
"0.5938093",
"0.5765557",
"0.5683596",
"0.56009287",
"0.5495079",
"0.5488852",
"0.54812586",
"0.53991836",
"0.5252175",
"0.51958126",
"0.51896244",
"0.50873345",
"0.5057998",
"0.50463855",
"0.5019224",
"0.5010823",
"0.50105554",
"0.49776268",
"0.49641386",
"0.4957... | 0.5827323 | 2 |
Validates if a record exists in the table that matches the array with the conditions given. | def exists?(domain_expr)
domain_name = domain_expr.domain_name
domain_attr = domain_expr.domain_attr
entry = find(domain_name, domain_attr)
db_expr, values = convert_expr(domain_expr, [], entry)
db = storage_class_from_entry(entry, :db)
db.exists?([db_expr, *values])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_records(records)\n records.select do |record|\n conditions.matches?(record)\n end\n end",
"def valid_for_table?(table)\n conditions.reject {|c| c.valid?(table)}.length == 0\n end",
"def contains?(record)\n begin\n val = relation.exists?(record.id)\n @val... | [
"0.62262666",
"0.60879207",
"0.58493316",
"0.58382636",
"0.58099544",
"0.5785698",
"0.57691896",
"0.57451737",
"0.5638104",
"0.55933505",
"0.5590019",
"0.5579047",
"0.5554377",
"0.54853755",
"0.54511994",
"0.5392826",
"0.5361285",
"0.53538",
"0.5304673",
"0.5295494",
"0.52816... | 0.0 | -1 |
Build an order by expression for the given db relation based on the criteria | def order(criteria, relation)
return relation unless criteria.order?
order_str = convert_order_exprs(criteria.order_by)
relation.order(order_str)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ordered_expression_sql(oe)\n \"#{literal(oe.expression)} #{oe.descending ? 'DESC' : 'ASC'}\"\n end",
"def order_clause\n col = case sort_params[:sort_col]\n when 'title'\n 'data_management_plans.title'\n when 'funder'\n 'affiliations_fundings.name'\n ... | [
"0.75010216",
"0.7099373",
"0.68840533",
"0.67797357",
"0.67084724",
"0.66659886",
"0.6641338",
"0.65924454",
"0.6576974",
"0.65731865",
"0.6567868",
"0.6567868",
"0.6567868",
"0.64731634",
"0.64426976",
"0.6419537",
"0.64078844",
"0.6319218",
"0.62645566",
"0.6216829",
"0.61... | 0.7313954 | 1 |
Eventhough there is no mapping here we add the interface for consistency. | def limit(criteria, relation)
return relation unless criteria.limit?
relation.limit(criteria.limit)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interface; end",
"def interface; end",
"def extended_interfaces; end",
"def implementation; end",
"def implementation; end",
"def implemented_in; end",
"def included_interfaces; end",
"def interface_methods; end",
"def interface_cache; end",
"def private; end",
"def interface; self.class.in... | [
"0.7398163",
"0.7398163",
"0.69439346",
"0.6828789",
"0.6828789",
"0.6798203",
"0.6726874",
"0.6680803",
"0.66495556",
"0.65726215",
"0.65630645",
"0.6488888",
"0.6428369",
"0.6422376",
"0.64166355",
"0.6409539",
"0.6409539",
"0.6286831",
"0.61982375",
"0.61192346",
"0.611240... | 0.0 | -1 |
Creates a new EOTSocketWrapper around a socket | def initialize(socket)
@socket = socket
@buf = ''
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_socket\n @socket = Socket.new(:INET, :DGRAM)\n @socket.connect_nonblock Socket.sockaddr_in(@port, @host)\n end",
"def initialize(socket)\n @socket = socket\n end",
"def initialize(socket)\n @socket = socket\n end",
"def socket(address, type)\n SSocket.new(address, type)\n ... | [
"0.6944357",
"0.6882511",
"0.6882511",
"0.687172",
"0.68658364",
"0.68256104",
"0.6817308",
"0.6766037",
"0.67635745",
"0.6750334",
"0.67347884",
"0.671933",
"0.6696477",
"0.6682419",
"0.6666936",
"0.6605963",
"0.65808684",
"0.6578559",
"0.6574825",
"0.65638435",
"0.65493625"... | 0.62662816 | 39 |
Reads from the socket until an EOT is found Extra characters may be read from the socket, but they are kept in a buffer to be used with the next call to read_until_eot(). If there is a gap in transmission longer than the timeout, nil will be returned. The total time spent waiting for data may be longer than the timeout... | def read_until_eot(timeout)
#Read until eot or timeout.
eot_index = @buf.index("\004")
received = nil
gotMessage = nil
#Do we already have a message ready?
unless eot_index
#Read until EOT or timeout
while gotMessage = IO.select([@socket], nil, nil, timeout) do
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read timeout = DEFAULT_READ_TIMEOUT\n return @responses.shift unless @responses.empty?\n\n results = select([ @socket ], nil, nil, timeout)\n\n @buff += @socket.recv(4 * 1024) if (results and results[0].include? @socket) # results nil on timeout\n\n if @buff =~ /^(.*\\r\\n)(.*)$/m # network ... | [
"0.7202537",
"0.6935118",
"0.6922779",
"0.6868883",
"0.68577427",
"0.68392587",
"0.6663246",
"0.6610376",
"0.65222",
"0.6501486",
"0.6442421",
"0.6406714",
"0.63326937",
"0.6298922",
"0.62532824",
"0.62458324",
"0.6205767",
"0.61006474",
"0.60950625",
"0.6082923",
"0.6075475"... | 0.8419876 | 0 |
Sends the message followed by an EOT The message must not contain any EOT characters. | def send_message(message)
@socket.write(message)
@socket.write("\004")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send(message)\n ## empty\n end",
"def raw_send(message)\n TalkerBase.instance.output << \"#{id} send #{message}\"\n end",
"def send_message(message)\n check_parenthesis(message)\n puts \"Send: #{message}\" if @debug\n connection{|c| c.write(message)}\n end",
"def user_messag... | [
"0.6222513",
"0.5871565",
"0.5838897",
"0.57932895",
"0.57378227",
"0.573628",
"0.573301",
"0.5667312",
"0.5657688",
"0.5657688",
"0.5655679",
"0.5630043",
"0.5626042",
"0.56259376",
"0.56259376",
"0.56123877",
"0.55861443",
"0.5558713",
"0.55460066",
"0.5545948",
"0.5533304"... | 0.5795542 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_tender
@tender = Core::Tender.find(params[:tender_id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def documents_params
params.permit(:collaboration_id, files: {} )
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.638045... | 0.0 | -1 |
I don't think this matters in this code in particular, but I added it to see it if threw errors. | def initialize(flavors, empty = true)
@flavors = flavors
@pez_num = @flavors.count
@empty = empty
if @pez_num > 0
@empty = false
else
@empty = true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error?()\n #This is a stub, used for indexing\n end",
"def error?; end",
"def error?; end",
"def error?; end",
"def check_errors;\n end",
"def recover_from(_error); end",
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def error; end",
"def ... | [
"0.73161227",
"0.69901925",
"0.69901925",
"0.69901925",
"0.6862229",
"0.67636776",
"0.67267555",
"0.67267555",
"0.67267555",
"0.67267555",
"0.67267555",
"0.67267555",
"0.67267555",
"0.6686846",
"0.6682008",
"0.66449404",
"0.6588388",
"0.6588388",
"0.65459013",
"0.6542581",
"0... | 0.0 | -1 |
Can improve grid for any size using info here | def display_grid
puts %Q(
+---+---+---+---+---+
| | | | | | @ = Player
| #{$grid[0][0]} | #{$grid[0][1]} | #{$grid[0][2]} | #{$grid[0][3]} | #{$grid[0][4]} | #{$mtoken} = Monster
| | | | | | £ = Treasure
+-----------------... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_grid size\n self.tiles.clear\n size.to_i.times do |row|\n size.to_i.times do |column|\n self.tiles.build({\n x: column,\n y: row\n })\n end\n end\n end",
"def size \n\n\t\t# Set the basic metrics\n\t\tcase @board_size\n\t\twhen :small \t\t\t\t# A 20x2... | [
"0.7394661",
"0.678781",
"0.6545926",
"0.6526463",
"0.6403333",
"0.6317571",
"0.6317076",
"0.6288921",
"0.6278691",
"0.6259219",
"0.6254892",
"0.62515086",
"0.6251438",
"0.6251086",
"0.62305075",
"0.616885",
"0.61599207",
"0.6143663",
"0.6141863",
"0.61374235",
"0.613372",
... | 0.0 | -1 |
Esto debe ser par las graficas | def espacios_disponibles_carros
Space.where(sp_state: false, sp_type: 'CARRO').count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def graficas\n end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def subgenres; end",
"def gallaries\n paintings.map{|paint| paint.gallery}\n\n end",... | [
"0.7505228",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6015003",
"0.59437126",
"0.58620274",
"0.5850691",
"0.5816513",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
... | 0.0 | -1 |
Esto debe ser par las graficas | def espacios_disponibles_motos
Space.where(sp_state: false, sp_type: 'MOTO').count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def graficas\n end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def subgenres; end",
"def gallaries\n paintings.map{|paint| paint.gallery}\n\n end",... | [
"0.7505228",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6028549",
"0.6015003",
"0.59437126",
"0.58620274",
"0.5850691",
"0.5816513",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
"0.5795069",
... | 0.0 | -1 |
Given a hash with numeric values, return the key for the smallest value | def key_for_min_value(name_hash)
lowest = []
name_hash.each do |key, value|
lowest << value
end
low = []
if lowest[0] == nil
nil
elsif lowest[0] < lowest[1] && lowest[0] < lowest[2]
low << lowest[0]
elsif lowest[1] < lowest[0] && lowest[1] < lowest[2]
low << lowest[1]
elsif lowest[2] < lowest[0] &... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend",
"def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n... | [
"0.8821222",
"0.8777674",
"0.87769854",
"0.8745862",
"0.8689437",
"0.86553806",
"0.865241",
"0.86165065",
"0.8587693",
"0.8572328",
"0.85674095",
"0.8550907",
"0.8529734",
"0.8529734",
"0.85182345",
"0.84936565",
"0.8475531",
"0.8475531",
"0.8466132",
"0.8449126",
"0.84490585... | 0.0 | -1 |
for the routes we always want to be in the projectcontect this contect is not session based, just only via the /project_name/ in the url so we can use different projects in different tabs (for copy and paste for example) | def before_all(project_id = false)
# set locale
I18n.default_locale = :en
@projects = Project::get_all(settings.full_projects_path)
@bc = []
if project_id
@project = Project.new(File.join(settings.full_projects_path, project_id))
@bc << { name: @project.id, link: named_route(:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n u = User.find(session[:user_id])\n pid = u.project_id\n if pid.nil?\n redirect_to :controller =>'dashboard', :action=> 'setup'\n else\n session[:project_id] = pid\n redirect_to project_index_url\n end\n \n end",
"def url_for_project_named(name)\n eval ... | [
"0.7060891",
"0.67263806",
"0.66895217",
"0.6680684",
"0.6648931",
"0.65772027",
"0.6571671",
"0.6539149",
"0.6538217",
"0.6511793",
"0.65048754",
"0.64638245",
"0.64603454",
"0.64509",
"0.64423335",
"0.64154226",
"0.64062476",
"0.64061487",
"0.6376967",
"0.6374029",
"0.63287... | 0.6068256 | 69 |
sets a new flash for everything | def flash text, type = 'success', title = false
session[:flashes] = [] unless session[:flashes]
session[:flashes] << {
type: type,
text: text,
title: title
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_flash(action)\n set_normal_flash(action)\n set_flash_now(action)\n end",
"def flash=(_arg0); end",
"def flash; end",
"def flash; end",
"def set_flash\n flash[:messages]=@fired_events.find_all { |e| e.block_type.in? Message.descendant_types }.map do |e|\n {message:e.... | [
"0.79773283",
"0.7358748",
"0.70422643",
"0.70422643",
"0.70194656",
"0.70070183",
"0.6982077",
"0.69740444",
"0.6944463",
"0.6872727",
"0.68266016",
"0.68012387",
"0.6790817",
"0.676446",
"0.6747825",
"0.674222",
"0.6718694",
"0.6639093",
"0.6629538",
"0.6607797",
"0.6604943... | 0.6291005 | 53 |
is the current request an ajax request? | def xhr?
@env['HTTP_X_REQUESTED_WITH'] =~ /XMLHttpRequest/i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ajaxcheck(request)\n if request.xhr? == true\n return true\n else\n return false\n end\nend",
"def ajax?\n return @ajax\n end",
"def ajax?\n params[:ajax] || request.path.start_with?(\"/ajax/\")\n end",
"def xhr?\n @env[\"HTTP_X_REQUESTED_WITH\"] == \"XMLHttpRequest\"\n e... | [
"0.8252138",
"0.8122436",
"0.80464596",
"0.8017102",
"0.7959077",
"0.7914178",
"0.7896626",
"0.7841903",
"0.77518094",
"0.7746662",
"0.77203226",
"0.75191224",
"0.75191224",
"0.7231327",
"0.71409243",
"0.71152735",
"0.71011204",
"0.7093701",
"0.70812833",
"0.70812833",
"0.708... | 0.8116672 | 2 |
GET /test_suites/1 GET /test_suites/1.json | def show
@test_suite = TestSuite.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @test_suite }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @testsuites = Testsuite.all\n end",
"def index\n @test_suite = TestSuite.find(params[:test_suite_id])\n @test_cases = @test_suite.test_cases\n end",
"def get_test_suite(page, options = {})\n options[:basic_auth] = @auth\n options[:body] = {\n page: page\n }\n self.class.... | [
"0.7127071",
"0.66317534",
"0.6518662",
"0.6468737",
"0.6447091",
"0.64078796",
"0.63427174",
"0.6319057",
"0.62383205",
"0.6215924",
"0.6206373",
"0.6141135",
"0.6119665",
"0.6093669",
"0.6085884",
"0.6085157",
"0.6083917",
"0.60749465",
"0.60663307",
"0.60386413",
"0.600156... | 0.74278927 | 0 |
GET /test_suites/new GET /test_suites/new.json | def new
@test_suite = TestSuite.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @test_suite }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @test_suite = TestSuite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @test_suite }\n end\n end",
"def create\n @test_suite = TestSuite.new(params[:test_suite])\n\n respond_to do |format|\n if @test_suite.save\n format.h... | [
"0.6997694",
"0.6991543",
"0.68222594",
"0.68136525",
"0.6809018",
"0.677885",
"0.677787",
"0.67206436",
"0.67137027",
"0.665657",
"0.6572995",
"0.65578413",
"0.65549487",
"0.6513213",
"0.6509294",
"0.6509294",
"0.64772874",
"0.6471136",
"0.6469058",
"0.64507097",
"0.6445442"... | 0.7865455 | 0 |
POST /test_suites POST /test_suites.json | def create
@test_suite = TestSuite.new(params[:test_suite])
respond_to do |format|
if @test_suite.save
format.html { redirect_to @test_suite, notice: 'Test suite was successfully created.' }
format.json { render json: @test_suite, status: :created, location: @test_suite }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @test_suite = TestSuite.new(test_suite_params)\n\n respond_to do |format|\n if @test_suite.save\n format.html { redirect_to @test_suite, notice: 'Test suite was successfully created.' }\n format.json { render :show, status: :created, location: @test_suite }\n else\n ... | [
"0.7096308",
"0.6967058",
"0.6523598",
"0.6320188",
"0.6234519",
"0.6133401",
"0.61276287",
"0.6062026",
"0.5996524",
"0.5969822",
"0.59578073",
"0.588298",
"0.5876363",
"0.58427393",
"0.5825716",
"0.5790882",
"0.5785391",
"0.57215536",
"0.571685",
"0.5716376",
"0.5688778",
... | 0.7056425 | 1 |
PUT /test_suites/1 PUT /test_suites/1.json | def update
@test_suite = TestSuite.find(params[:id])
respond_to do |format|
if @test_suite.update_attributes(params[:test_suite])
format.html { redirect_to @test_suite, notice: 'Test suite was successfully updated.' }
format.json { head :no_content }
else
format.html { rende... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @testsuite.update(testsuite_params)\n format.html { redirect_to @testsuite, notice: 'Testsuite was successfully updated.' }\n format.json { render :show, status: :ok, location: @testsuite }\n else\n format.html { render :edit }\n for... | [
"0.69552743",
"0.6828003",
"0.67865163",
"0.6758148",
"0.66596055",
"0.65655124",
"0.63800573",
"0.6289394",
"0.6152779",
"0.61485344",
"0.60898936",
"0.6041604",
"0.5929602",
"0.59279466",
"0.5898638",
"0.5891064",
"0.5890445",
"0.58609986",
"0.5839565",
"0.5831368",
"0.5793... | 0.7087594 | 0 |
DELETE /test_suites/1 DELETE /test_suites/1.json | def destroy
@test_suite = TestSuite.find(params[:id])
@test_suite.destroy
respond_to do |format|
format.html { redirect_to test_suites_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @testsuite.destroy\n respond_to do |format|\n format.html { redirect_to testsuites_url, notice: 'Testsuite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_suite.destroy\n respond_to do |format|\n format.html { redir... | [
"0.7463388",
"0.7450908",
"0.7425022",
"0.7218806",
"0.70049936",
"0.70049936",
"0.6989501",
"0.6988764",
"0.69378406",
"0.69378406",
"0.69358045",
"0.69153684",
"0.68908775",
"0.68725216",
"0.6868106",
"0.68638223",
"0.6809734",
"0.68038315",
"0.678919",
"0.67684346",
"0.672... | 0.77769333 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.