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 |
|---|---|---|---|---|---|---|
Escape HTML characters so that raw text can be safely inserted as HTML | def htmlEscape(string)
return string.gsub('&', '&').gsub('>', '>').gsub('<', '<')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def html_escape(text)\n text.to_s.gsub(/[\\\"><&]/) { |s| HTML_ESCAPE[s] }\n end",
"def escape_html(html)\n html.to_s.gsub(/&/n, '&').gsub(/\\\"/n, '"').gsub(/>/n, '>').gsub(/</n, '<').gsub(/\\//, '/')\n end",
"def html_escape(text)\n Rack::Utils.escape_html(text)\n e... | [
"0.8309713",
"0.82658935",
"0.82540995",
"0.8106718",
"0.80504036",
"0.7961665",
"0.7961665",
"0.7952977",
"0.79405886",
"0.7925126",
"0.7923376",
"0.7909791",
"0.78074104",
"0.77950966",
"0.77950966",
"0.7792022",
"0.7771446",
"0.7762217",
"0.77330816",
"0.773238",
"0.773127... | 0.7552316 | 34 |
"AJAX" style post request to the server, with a callback | def post(target, data, &block)
xhr = XMLHttpRequest.new()
xhr.open('POST', "../json/#{target}", true)
xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8')
xhr.responseType = 'text'
def xhr.onreadystatechange()
if xhr.readyState == 4
data = nil
begin
if xhr.status ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(path, headers, body, &callback)\n request('POST', path, headers, body, &callback)\n end",
"def post(target, data, &block)\n xhr = XMLHttpRequest.new()\n xhr.open('POST', \"actions/#{target}\", true)\n xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8')\n xhr.responseType =... | [
"0.67773664",
"0.6601284",
"0.6595329",
"0.6541795",
"0.65414405",
"0.6538024",
"0.65194964",
"0.64949596",
"0.6427209",
"0.6405466",
"0.6399475",
"0.63986313",
"0.6373768",
"0.6337788",
"0.6322749",
"0.6308524",
"0.63063866",
"0.63044107",
"0.62966335",
"0.62949",
"0.6292252... | 0.6293085 | 20 |
Create a new Entry | def create_entries(opts = {})
data, _status_code, _headers = create_entries_with_http_info(opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @entry = Entry.new\n end",
"def create\n create_entry\n end",
"def create_entry!(*args)\n delegate_to_entry('create!', args)\n end",
"def entry\n Entry.new\n end",
"def create\n puts \"In entries#create, params=#{params}\"\n entity_id = params[:entity_i... | [
"0.7959312",
"0.7862125",
"0.76975477",
"0.7399378",
"0.7284483",
"0.72697544",
"0.71676034",
"0.7133841",
"0.69589144",
"0.6951241",
"0.6934058",
"0.6894969",
"0.6892984",
"0.6892984",
"0.6892984",
"0.6873778",
"0.6860385",
"0.68574864",
"0.683033",
"0.6799588",
"0.6796473",... | 0.60983205 | 77 |
Create a new Entry | def create_entries_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EntriesApi.create_entries ...'
end
# resource path
local_var_path = '/api/v1/entries'
# query parameters
query_params = opts[:query_params] || {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @entry = Entry.new\n end",
"def create\n create_entry\n end",
"def create_entry!(*args)\n delegate_to_entry('create!', args)\n end",
"def entry\n Entry.new\n end",
"def create\n puts \"In entries#create, params=#{params}\"\n entity_id = params[:entity_i... | [
"0.7959312",
"0.7862125",
"0.76975477",
"0.7399378",
"0.7284483",
"0.72697544",
"0.71676034",
"0.7133841",
"0.69589144",
"0.6951241",
"0.6934058",
"0.6894969",
"0.6892984",
"0.6892984",
"0.6892984",
"0.6873778",
"0.6860385",
"0.68574864",
"0.683033",
"0.6799588",
"0.6796473",... | 0.0 | -1 |
Search for entries matching filters | def index_entries(opts = {})
data, _status_code, _headers = index_entries_with_http_info(opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(params)\n filter_name, keywords, field_queries = extract params\n scope = filtered_by filter_name\n query = text_search keywords\n query = field_search field_queries, query\n scope.where query\n end",
"def search(query)\n @all.each_with_object([])... | [
"0.6855478",
"0.6819002",
"0.6777145",
"0.6702245",
"0.6511468",
"0.6511468",
"0.650644",
"0.65003675",
"0.63454217",
"0.6331225",
"0.632857",
"0.631837",
"0.6273089",
"0.62692046",
"0.62542474",
"0.6242933",
"0.6236533",
"0.6234944",
"0.6234944",
"0.62055206",
"0.61966443",
... | 0.0 | -1 |
Search for entries matching filters | def index_entries_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EntriesApi.index_entries ...'
end
# resource path
local_var_path = '/api/v1/entries'
# query parameters
query_params = opts[:query_params] || {}
qu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search(params)\n filter_name, keywords, field_queries = extract params\n scope = filtered_by filter_name\n query = text_search keywords\n query = field_search field_queries, query\n scope.where query\n end",
"def search(query)\n @all.each_with_object([])... | [
"0.6855478",
"0.6819002",
"0.6777145",
"0.6702245",
"0.6511468",
"0.6511468",
"0.650644",
"0.65003675",
"0.63454217",
"0.6331225",
"0.632857",
"0.631837",
"0.6273089",
"0.62692046",
"0.62542474",
"0.6242933",
"0.6236533",
"0.6234944",
"0.6234944",
"0.62055206",
"0.61966443",
... | 0.0 | -1 |
Update an existing Entry | def update_entries(id, opts = {})
data, _status_code, _headers = update_entries_with_http_info(id, opts)
data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @entry = args[:entry] if args.key?(:entry)\n end",
"def update\n @update_success = @entry.update(entry_params)\n super\n end",
"def update\n @entry = Entry.find(params[:id])\n\n respond_to do |format|\n if @entry.update_attributes(params[:entry])\n ... | [
"0.79070234",
"0.7698772",
"0.73452157",
"0.7320202",
"0.72323716",
"0.7185381",
"0.7185381",
"0.7185381",
"0.71754897",
"0.71748614",
"0.71451604",
"0.71451604",
"0.7138019",
"0.71098757",
"0.7108633",
"0.710642",
"0.710642",
"0.710642",
"0.7083376",
"0.7073384",
"0.7027247"... | 0.0 | -1 |
Update an existing Entry | def update_entries_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: EntriesApi.update_entries ...'
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update!(**args)\n @entry = args[:entry] if args.key?(:entry)\n end",
"def update\n @update_success = @entry.update(entry_params)\n super\n end",
"def update\n @entry = Entry.find(params[:id])\n\n respond_to do |format|\n if @entry.update_attributes(params[:entry])\n ... | [
"0.79070234",
"0.7698772",
"0.73452157",
"0.7320202",
"0.72323716",
"0.7185381",
"0.7185381",
"0.7185381",
"0.71754897",
"0.71748614",
"0.71451604",
"0.71451604",
"0.7138019",
"0.71098757",
"0.7108633",
"0.710642",
"0.710642",
"0.710642",
"0.7083376",
"0.7073384",
"0.7027247"... | 0.0 | -1 |
Setup the dependency requirements for the callback | def setup(*_)
require 'patron'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_dependencies\n end",
"def dependencies; end",
"def dependencies; end",
"def dependencies; end",
"def dependencies=(_arg0); end",
"def dependencies\n raise \"#{self.class} needs to overwrite dependencies\"\n end",
"def before_all(key, options)\n required(key) ... | [
"0.6575637",
"0.65594006",
"0.65594006",
"0.65594006",
"0.64633787",
"0.61715835",
"0.6079675",
"0.6052002",
"0.6047906",
"0.59821576",
"0.5968214",
"0.59563583",
"0.5901722",
"0.590016",
"0.5887467",
"0.5814836",
"0.5754744",
"0.57530206",
"0.5751862",
"0.5746712",
"0.572206... | 0.5604041 | 28 |
Physical ID of the resource created | def physical_resource_id
"#{self.class.name.split('::').last}-#{Carnivore.uuid}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_id\n return \"%s:%s\" % [self.resource_type, self.id]\n end",
"def resource_id\n send self.class.resource_id\n end",
"def id\n \"p-#{resource.id}\"\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n ... | [
"0.7797884",
"0.7624784",
"0.7520891",
"0.73743737",
"0.73743737",
"0.73743737",
"0.72517335",
"0.7222314",
"0.7199689",
"0.70018375",
"0.692554",
"0.69071174",
"0.6905103",
"0.6856219",
"0.6838273",
"0.68212336",
"0.6787711",
"0.6787711",
"0.6778979",
"0.6744637",
"0.6712508... | 0.8515887 | 0 |
Send response to the waiting stack | def respond_to_stack(response, response_url)
unless(VALID_RESOURCE_STATUS.include?(response['Status']))
raise ArgumentError.new "Invalid resource status provided. Got: #{response['Status']}. Allowed: #{VALID_RESOURCE_STATUS.join(', ')}"
end
if(response['Status'] == 'FAILED' && !respons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait\n \n # If the command has not been sent, or a response was already received. a\n # call to this method doesn't make any sense.\n raise Exception.new(\"Can't wait for response. The command was not send yet, or a response was already received.\") if @response_received == nil\n ... | [
"0.67530644",
"0.6530225",
"0.6515129",
"0.6492504",
"0.6271963",
"0.6144799",
"0.6144799",
"0.6097672",
"0.60165215",
"0.59868765",
"0.59735125",
"0.59731203",
"0.596733",
"0.596733",
"0.596733",
"0.59658897",
"0.59518397",
"0.5932791",
"0.59270513",
"0.586247",
"0.58212024"... | 0.0 | -1 |
Unpack message and create payload | def unpack(message)
payload = super
if(self.is_a?(Jackal::Cfn::Resource))
begin
if(payload['Message'])
payload = MultiJson.load(payload['Message']).to_smash
payload = transform_parameters(payload)
payload[:origin_type] = message[:message].g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unpack(message)\n payload = super\n if(self.class == Jackal::Cfn::Event)\n begin\n unless(payload.get(:data, :cfn_event))\n payload = format_event(payload.fetch('Body', 'Message', payload))\n payload[:origin_type] = message[:message].get('Body', 'Type... | [
"0.710813",
"0.6986811",
"0.6706475",
"0.6528558",
"0.64641255",
"0.64204985",
"0.63859016",
"0.6255469",
"0.6159768",
"0.61405224",
"0.6133293",
"0.61029845",
"0.6081042",
"0.6077328",
"0.6057204",
"0.6052907",
"0.60302293",
"0.6026357",
"0.60199404",
"0.60062534",
"0.595549... | 0.70783406 | 1 |
Generate payload and drop | def execute(message)
data_payload = unpack(message)
payload = new_payload(
config.fetch(:name, :jackal_cfn),
:cfn_resource => data_payload
)
if(config[:reprocess])
debug "Reprocessing received message! #{payload}"
Carnivore::Supervisor.supervisor[d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_payload(attributes, _record)\n fields = self.encoder.schema_fields\n payload = attributes.stringify_keys\n payload.delete_if do |k, _|\n k.to_sym != :payload_key && !fields.map(&:name).include?(k)\n end\n end",
"def generate_rop_payload(rop, payload, opts={}... | [
"0.6454642",
"0.6059785",
"0.6011976",
"0.5849499",
"0.578041",
"0.56837124",
"0.5612073",
"0.5608123",
"0.5608123",
"0.55572385",
"0.5554902",
"0.5530629",
"0.550776",
"0.5485087",
"0.5442348",
"0.5392634",
"0.5349398",
"0.53311956",
"0.5321127",
"0.5293448",
"0.52853125",
... | 0.0 | -1 |
Custom wrap to send resource failure | def failure_wrap(message)
begin
payload = unpack(message)
yield payload
rescue => e
error "Unexpected error encountered processing custom resource - #{e.class}: #{e.message}"
debug "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
cfn_resource = payload.get(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrapped_exception; end",
"def do_failure; end",
"def failure\n {:response=>:failure}\n end",
"def post_fail_message; end",
"def respond_bad_request; make_response(nil, false, 400, \"Bad Request\") end",
"def failure\n super\n end",
"def resource_failed_retriable(resource, action, retry_co... | [
"0.6743527",
"0.63123566",
"0.6283881",
"0.62282234",
"0.6209821",
"0.6166746",
"0.6159917",
"0.6150336",
"0.61288244",
"0.61268336",
"0.6097793",
"0.6046986",
"0.6046986",
"0.60292095",
"0.6025635",
"0.6013818",
"0.60086775",
"0.59989816",
"0.5995954",
"0.5981411",
"0.594679... | 0.7572874 | 0 |
Initializes balance to equal 0 and in_journey is false | def initialize
@balance = 0
@in_journey = false
@entry_station != nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(balance = 0)\n @balance = balance\n @in_journey\n @maximum_balance = MAXIMUM_BALANCE\n @journey_history = []\n end",
"def initialize\n @balance = DEFAULT_VALUE\n @max_bal = MAX_BALANCE\n @in_journey = IN_JOURNEY\n @min_balance = MIN_BALANCE\n @min_fare = MIN_FARE\n @... | [
"0.7384639",
"0.72987765",
"0.728322",
"0.72136205",
"0.7058198",
"0.69777614",
"0.69409204",
"0.6861286",
"0.6768684",
"0.6465786",
"0.64366776",
"0.6423922",
"0.630827",
"0.6252637",
"0.6247391",
"0.6212532",
"0.61859864",
"0.6156614",
"0.60916287",
"0.60640216",
"0.6048310... | 0.7825981 | 0 |
If top up amount is greater than maximum balance limit then raise error | def top_up(amount)
if balance + amount > MAX_BALANCE_LIMIT
raise "Invalid amount, maximum balance limit is #{MAX_BALANCE_LIMIT}"
end
@balance += amount
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exceed_top_up?(amount, balance)\n (balance += amount) > MAX_TOP_UP\n end",
"def top_up(money)\n @money = money\n raise \"Maximum balance of #{maximum_balance} exceeded\" if maximum\n @balance += money\n return\n end",
"def top_up(gbp)\n fail 'Cannot exceed #{MAXIMUM_BALANCE}' if @balance... | [
"0.8113485",
"0.7880704",
"0.7514147",
"0.7207528",
"0.7032126",
"0.6707437",
"0.66659594",
"0.6592426",
"0.65642196",
"0.652873",
"0.6493092",
"0.638481",
"0.63526416",
"0.62013257",
"0.61971027",
"0.6151343",
"0.6144178",
"0.6122068",
"0.6108926",
"0.6101087",
"0.6083136",
... | 0.78582066 | 2 |
If user touches in their oyster card, let error appear otherwise Make in_journey to equal true: | def touch_in(station)
fail "Less than £1" if @balance < MIN_BALANCE
@in_journey = true
@entry_station = station
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def does_it_land?\n if self.robot.moves.count < 1 \n errors.add(:base, :landing_error) if !self.is_move_available?\n end\n end",
"def touch_in(station)\n deduct(PENALTYFARE) if @in_joureny == true\n min_balance? ? (fail \"insufficent funds\") : @the_journey.start(station)\n @in_journey = tru... | [
"0.61321133",
"0.58812946",
"0.5791582",
"0.57654154",
"0.57346696",
"0.5607373",
"0.55965847",
"0.55943966",
"0.5583883",
"0.5558783",
"0.5558641",
"0.5548537",
"0.55278814",
"0.5512954",
"0.55060744",
"0.55016243",
"0.54976475",
"0.5494734",
"0.548382",
"0.5470637",
"0.5458... | 0.5345918 | 40 |
If user touches in their oyster card, let error appear otherwise make in_journey to equal false: | def touch_out
deduct(CHARGE)
@in_journey = false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_if_not_passable\n ## TODO: BUGGED: STOPS IF HITS WATER\n tempx = ($game_map.screen.pictures[@picture_index].x) / 32\n tempy = ($game_map.screen.pictures[@picture_index].y) / 32\n if $game_map.check_passage(tempx.round, tempy.round, 0x0200) || $game_map.check_passage(tempx.round, tempy.round, 0... | [
"0.5963753",
"0.5936897",
"0.5812695",
"0.58011156",
"0.57821405",
"0.57339025",
"0.5733768",
"0.5730802",
"0.566664",
"0.5656094",
"0.5647733",
"0.5621957",
"0.55962366",
"0.55841935",
"0.55836546",
"0.5567244",
"0.5557926",
"0.5555931",
"0.5555931",
"0.55415297",
"0.5537792... | 0.5834103 | 2 |
in_journey to equal false: | def deduct(amount)
@balance -= amount
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_journey?\n !(voyage[:start] == nil)\n end",
"def in_journey?\n journey_history_hash[\"touch_in\"] != 'no_data' && journey_history_hash[\"touch_out\"] == 'no_data'\n end",
"def journey_complete?\n false\n end",
"def in_journey?\n @entry_station != nil\n end",
"def touch_out\n d... | [
"0.718109",
"0.6784017",
"0.66426456",
"0.66256",
"0.622354",
"0.59242773",
"0.5909751",
"0.57310086",
"0.5698503",
"0.5673809",
"0.56564015",
"0.56398076",
"0.5635331",
"0.5580831",
"0.5572093",
"0.5560022",
"0.5555655",
"0.5539937",
"0.55380225",
"0.5536034",
"0.5521872",
... | 0.0 | -1 |
Width in pixels when in expanded state | def expanded_width
source_node[:expandedWidth].to_i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def width\n return @window_width # outer width\nend",
"def expanded_height\n source_node[:expandedHeight].to_i\n end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"def width; end",
"de... | [
"0.66237867",
"0.66125107",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.65528625",
"0.6479877",
"0.6440924",
"0.6440924",
"0.63730067",
"0.62840253",
"0.6255057",
"0.6241833",
"0.62260944",
"0.62260944",
"... | 0.80979526 | 0 |
Height in pixels when in expanded state | def expanded_height
source_node[:expandedHeight].to_i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def height; end",
"def height; end",
"def visible_height\n @win.maxy - 2\n end",
"def height\n attr('height')\n end",
"def contents_height\r\n item_height\r\n end",
"def contents_height\n item_height\n end",
"def fullheight\n return self.bitmap.height.to_f * self.zoom_y\n en... | [
"0.6930224",
"0.6930224",
"0.6883127",
"0.68638754",
"0.67481494",
"0.672618",
"0.6719818",
"0.6687472",
"0.6676668",
"0.6676668",
"0.66660225",
"0.6662725",
"0.66261375",
"0.6585199",
"0.65765053",
"0.65721774",
"0.657001",
"0.657001",
"0.656947",
"0.65666276",
"0.6551425",
... | 0.8113004 | 0 |
Defines the method to use for communication with the companion | def api_framework
source_node[:apiFramework]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def methods() end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def methods; end",
"def methods; end",... | [
"0.6754469",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6629649",
"0.6597192",
"0.6597192",
"0.6597192",
"0.6597192",
"0.6411075",
"0.6411075",
"0.6411075",
"0.6411075",
"... | 0.0 | -1 |
URI to open as destination page when user clicks on creative | def click_through_url
URI.parse source_node.at('NonLinearClickThrough').content.strip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visit\n redirect_to @product.affiliate_link\n end",
"def link_to_landing_page \n \"/about/#{url_uuid}\"\n end",
"def click(link); end",
"def click_on_event option\n visits event_path(option.event)\n clicks_link option.description\n end",
"def url_for_me(action)\n if action ==... | [
"0.6167133",
"0.61598974",
"0.60075635",
"0.59525037",
"0.5925844",
"0.59191585",
"0.5896727",
"0.5889518",
"0.588461",
"0.5852168",
"0.58222747",
"0.58199733",
"0.58181036",
"0.58029085",
"0.5780055",
"0.57765716",
"0.57765716",
"0.57714957",
"0.57524323",
"0.5730441",
"0.57... | 0.0 | -1 |
Whether it is acceptable to scale the mediafile. | def scalable?
source_node[:scalable]=="true"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_size\n if ( (audio? || video?) && media.try(:value).try(:is_a?, ActionDispatch::Http::UploadedFile) && media.value.tempfile.size > MAX_MEDIA_SIZE ) ||\n ( image? && media.present? && media.file.size > MAX_MEDIA_SIZE ) ||\n ( media.is_a?(ActionDispatch::Http::UploadedFile) && media.tempf... | [
"0.70295644",
"0.7015021",
"0.69973326",
"0.6919213",
"0.66911334",
"0.65976465",
"0.6574844",
"0.65326285",
"0.64013666",
"0.63964987",
"0.63480335",
"0.634782",
"0.6329028",
"0.63184255",
"0.6305323",
"0.62910986",
"0.61886364",
"0.61877793",
"0.6177407",
"0.6165064",
"0.61... | 0.6160128 | 21 |
Whether the mediafile must have its aspect ratio maintained when scaled | def maintain_aspect_ratio?
source_node[:maintainAspectRatio]=="true"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_wider_aspect_ratio?(size1, size2)\n aspect_ratio(size1) > aspect_ratio(size2)\n end",
"def fixed_ratio?\n fullsize_settings[:dimensions].all?(&:present?)\n end",
"def aspect_ratio\n return 'none' unless fixed_ratio?\n dims = fullsize_settings[:dimensions]\n dims[0].to_f / dims[... | [
"0.72264206",
"0.71093696",
"0.6753308",
"0.6698196",
"0.6684895",
"0.667735",
"0.66098267",
"0.6579846",
"0.6502467",
"0.64911646",
"0.6444627",
"0.64357805",
"0.6402643",
"0.63717926",
"0.62659556",
"0.62634325",
"0.6262898",
"0.62565637",
"0.61965513",
"0.61735684",
"0.617... | 0.76231325 | 1 |
Suggested duration to display nonlinear ad, typically for animation to complete. Expressed in standard time format hh:mm:ss | def min_suggested_duration
source_node[:minSuggestedDuration]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration\n 30\n end",
"def friendly_duration\n min = @duration / 60\n utes = 60 * min\n sec = @duration - utes\n return \"#{min} Minutes and #{sec} seconds\" \n end",
"def sho... | [
"0.7159937",
"0.7159937",
"0.7159937",
"0.7159937",
"0.7159937",
"0.70602226",
"0.701689",
"0.70137626",
"0.6980602",
"0.6932454",
"0.68658733",
"0.6802869",
"0.6802352",
"0.6798703",
"0.67049235",
"0.6670125",
"0.6665652",
"0.66149384",
"0.66108865",
"0.65839785",
"0.6534720... | 0.0 | -1 |
you should change this to whatever logic you need | def require_login
unless current_admin
session[:return_to] ||= request.referer
if request.xhr?
render json: fail_update_response("LOGOUT")
else
redirect_to login_url
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def suivre; end",
"def schubert; end",
"def formation; end",
"def who_we_are\r\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def operations; end",
"def opera... | [
"0.6680568",
"0.6304486",
"0.62407464",
"0.61390704",
"0.6130255",
"0.5891143",
"0.5881706",
"0.5881706",
"0.5881706",
"0.5881706",
"0.5800437",
"0.5800437",
"0.5783648",
"0.5783648",
"0.5777169",
"0.5769373",
"0.5728024",
"0.57179224",
"0.57179224",
"0.5642857",
"0.5638196",... | 0.0 | -1 |
Given a hash with numeric values, return the key for the smallest value | def key_for_min_value(name_hash)
key_1 = nil
value_1 = nil
name_hash.each do |key,value|
if key_1.nil?
key_1 = key
value_1 = value
elsif value < value_1
key_1 = key
value_1 = value
end
end
key_1
end | {
"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 |
GET /consultations GET /consultations.json | def index
# @consultations = Consultation.all
@indications = Indication.order(:created_at)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"def index\n @consultors = Consultor.all\n end",
"def index\n @consultors = Consultor.all\n end",
"def show\n ... | [
"0.7201495",
"0.68126756",
"0.68126756",
"0.6759969",
"0.67549556",
"0.6530221",
"0.6466502",
"0.63372964",
"0.6291208",
"0.6270779",
"0.6235732",
"0.6231178",
"0.6214897",
"0.6182111",
"0.6180217",
"0.61667705",
"0.6150178",
"0.61476016",
"0.6140267",
"0.6129273",
"0.6111814... | 0.59044147 | 31 |
Never trust parameters from the scary internet, only allow the white list through. | def consultation_params
params[:consultation]
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 |
Function Declarations Usage Message Function | def usage
print_line("Meterpreter Script to flood host with a process")
print_line(@exec_opts.usage)
raise Rex::Script::Completed
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def functions\n\n end",
"def usage; end",
"def usage; end",
"def declarations; end",
"def message() end",
"def functionName(parameter1, parameter2)\n puts parameter1\n puts parameter2\nend",
"def declaration=(_arg0); end",
"def say_hello name # starts with a definition\n puts \"hello #{name},... | [
"0.6598317",
"0.65585816",
"0.65585816",
"0.6469759",
"0.6410829",
"0.63473165",
"0.63314193",
"0.6219847",
"0.6206193",
"0.6158793",
"0.6158793",
"0.6158793",
"0.61094385",
"0.61094385",
"0.61093926",
"0.61063725",
"0.60621965",
"0.60621965",
"0.60621965",
"0.6026156",
"0.59... | 0.0 | -1 |
in m DISTANCES aproximacio a la distancia en metres per la formula de Haversine ( ( | def haversine_distance(lat1, lon1, lat2, lon2)
dlon_rad = (lon2 - lon1) * RAD_PER_DEG
dlat_rad = (lat2 - lat1) * RAD_PER_DEG
lat1_rad = lat1 * RAD_PER_DEG
lat2_rad = lat2 * RAD_PER_DEG
a = (Math.sin(dlat_rad/2))**2 + Math.cos(lat1_rad) * Math.cos(lat2_rad) * (Math.sin(dlon_rad/2))**2
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_measurement; end",
"def haversine_distance(alocation, miles=false)\n # Get latitude and longitude\n res=100000.0\n lat1 = self.latitude\n lon1 = self.longitude\n if !alocation.nil?\n\n lat2 = alocation.latitude\n lon2 = alocation.longitude\n\n # Calculate radial arcs for latitu... | [
"0.68469995",
"0.6814141",
"0.6773086",
"0.6645313",
"0.66095287",
"0.66095287",
"0.659446",
"0.6568364",
"0.65292895",
"0.64966",
"0.6483297",
"0.64799577",
"0.6460327",
"0.6449149",
"0.63964665",
"0.63674796",
"0.63625604",
"0.6354967",
"0.63471955",
"0.63418424",
"0.634099... | 0.613912 | 44 |
aproximacio a la distancia en metres per la formula de Pitagoras en la que se suposa que la terra es plana (valid fins a distancies de 20Km). L'error varia depenent de la latitut ( | def flatearth_distance(lat1, lon1, lat2, lon2)
dlon_rad = (lon2 - lon1) * RAD_PER_DEG
a = PI/2 - lat1 * RAD_PER_DEG
b = PI/2 - lat2 * RAD_PER_DEG
c = Math.sqrt( a**2 + b**2 - 2 * a * b * Math.cos(dlon_rad))
d = EARTH_RADIUS * c
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcular_ganancia\n dolar = Option.instance.dolar_libre.to_f\n dinero_acumulado = self.movements.inject(0) do |total,m|\n total + m.monto_neto\n end\n precio_en_dolares = (dinero_acumulado / dolar)\n return (precio_en_dolares - self.copia.precio_com... | [
"0.6656702",
"0.6406137",
"0.62147266",
"0.6153514",
"0.6039182",
"0.5977558",
"0.5905856",
"0.5879883",
"0.5879154",
"0.58767354",
"0.5862693",
"0.5841658",
"0.58027536",
"0.5799225",
"0.57956046",
"0.5767171",
"0.57600397",
"0.5757484",
"0.5751235",
"0.57305235",
"0.5729529... | 0.0 | -1 |
aproximacio segons la llei esferica dels cosinus ( | def slcosinus_distance(lat1, lon1, lat2, lon2)
dlon_rad = (lon2 - lon1) * RAD_PER_DEG
lat1_rad = lat1 * RAD_PER_DEG
lat2_rad = lat2 * RAD_PER_DEG
c = Math.acos(Math.sin(lat1_rad)*Math.sin(lat2_rad) +
Math.cos(lat1_rad)*Math.cos(lat2_rad) * Math.cos(dlon_rad))
d = EARTH_RADIUS * c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def huella\n\t\tindice1 = 0\n\t\t#dependiendo del vct de cada ingrediente, se le pone un indice\n\t\tif vct < 670\n\t\t\tindice1 = 1\n\t\t\t\n\t\telsif vct > 830\n\t\t\tindice1 = 3\n\t\telse \n\t\t\tindice1 = 2\n\t\tend \n\t\tindice2 = 0\n\t\t#dependiendo de los gases emitidos de cada ingrediente, \n\t\t#se le pon... | [
"0.6828949",
"0.6589916",
"0.6579581",
"0.6500465",
"0.6496158",
"0.6443228",
"0.6439168",
"0.6419649",
"0.64134854",
"0.63799745",
"0.6376074",
"0.63662684",
"0.63622",
"0.635527",
"0.63512254",
"0.630729",
"0.62306106",
"0.622693",
"0.62231165",
"0.6222762",
"0.622178",
"... | 0.0 | -1 |
aproximacio equirectangular. Only one trig function and a squared root. ( | def equirectangular_distance(lat1, lon1, lat2, lon2)
dlon = lon2 - lon1
dlat = lat2 - lat1
avlat_rad = (lat2 + lat1)/2 * RAD_PER_DEG
x = dlon * Math.cos(avlat_rad)
c = RAD_PER_DEG * Math.sqrt(x*x + dlat*dlat)
d = EARTH_RADIUS * c
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def funcion1(x)\n\t y = -x * Math.sin(Math.sqrt(x.abs))\n\t # y = -x * Math.sin(Math.sqrt(x.abs * (Math::PI / 180.0 )))\n\t\ty\n\tend",
"def radial_basis(x)\n\t\tMath::E ** ( - (x**2) )\t\t\n\tend",
"def trig\n\tnum = gets.to_f\n\n\tcosine = Math.cos(num)\n\tsine = Math.sin(num)\n\ttang = Math.tan(num)\n\n\tc... | [
"0.6309028",
"0.606378",
"0.59069383",
"0.5883601",
"0.5816427",
"0.57974285",
"0.57276356",
"0.5686838",
"0.5611648",
"0.5604888",
"0.55889386",
"0.5582789",
"0.55636775",
"0.54743725",
"0.5451083",
"0.5375555",
"0.5368854",
"0.5325241",
"0.5324713",
"0.53054404",
"0.5294307... | 0.0 | -1 |
BEARINGS Angle inicial entre 2 posicions (l'angle canvia al seguir un gran cercle u "orthodrome") ( | def orthodrome_init_angle(lat1, lon1, lat2, lon2)
dlon = (lon2 - lon1) * RAD_PER_DEG
cola1 = Math.cos(lat1 * RAD_PER_DEG)
sila1 = Math.sin(lat1 * RAD_PER_DEG)
cola2 = Math.cos(lat2 * RAD_PER_DEG)
sila2 = Math.sin(lat2 * RAD_PER_DEG)
y = Math.sin(dlon) * cola2
x = cola1 * sila2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def other_angle(a, b)\n 180 - (a + b)\nend",
"def other_angle(a, b)\n 180 - (a + b)\nend",
"def angle_b\n Angle.new(\n self,\n :b,\n (\n (\n Math.acos((a**2 + c**2 - b**2) / (2.0 * a * c)) * 180\n ) / Math::PI\n )\n )\n ... | [
"0.77607906",
"0.77488637",
"0.7432322",
"0.72847944",
"0.7169885",
"0.6946548",
"0.6918142",
"0.68630004",
"0.6840941",
"0.68336713",
"0.6818087",
"0.68166643",
"0.6753691",
"0.6750245",
"0.6653359",
"0.66470414",
"0.6640879",
"0.6593316",
"0.656768",
"0.65117383",
"0.650490... | 0.70296556 | 5 |
aproximacio a sac de l'angle entre 2 posicions. Valida per distancies petites. Creada per mi mateix (MME) | def equirectangular_angle(lat1, lon1, lat2, lon2)
dlon = lon2 - lon1
dlat = lat2 - lat1
avlat_rad = (lat2 + lat1)/2 * RAD_PER_DEG
x = dlon * Math.cos(avlat_rad)
y = dlat
angle = Math.atan2(x,y)/RAD_PER_DEG # angle in degrees
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def combat_2ennemi(user_nameP, barret, ennemi1, ennemi2)\n puts ' _________ ________ _____ __________ ________________ '\n puts ' \\_ ___ \\ \\_____ \\ / \\\\______ \\ / _ \\__ ___/ '\n puts ' / \\ \\/ / | \\ / \\ / \\| | _/ / /_\\ \\| | '\n p... | [
"0.602687",
"0.59200495",
"0.58025104",
"0.5790651",
"0.5787216",
"0.5731454",
"0.5696355",
"0.558904",
"0.55371994",
"0.55343693",
"0.5525924",
"0.5492991",
"0.5491093",
"0.548531",
"0.5441397",
"0.54401463",
"0.5439508",
"0.54317325",
"0.54292846",
"0.53835917",
"0.5383159"... | 0.0 | -1 |
MIDPOINTS Half way point between two points. Returns coordinates array [lat, lon] of the mid point within a great cirle path (shortest surface path) | def orthodrome_midpoint(lat1, lon1, lat2, lon2)
dlon = (lon2 - lon1) * RAD_PER_DEG
cola1 = Math.cos(lat1 * RAD_PER_DEG)
sila1 = Math.sin(lat1 * RAD_PER_DEG)
cola2 = Math.cos(lat2 * RAD_PER_DEG)
sila2 = Math.sin(lat2 * RAD_PER_DEG)
x = cola2 * Math.cos(dlon)
y = cola2 * Math.sin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def midpoint\n Point.new((x1 + x2) / 2, (y1 + y2) / 2)\n end",
"def find_midpoint(addr1,addr2)\n dlong = addr2[1] - addr1[1]\n bx = Math.cos(addr2[0]) * Math.cos(dlong)\n by = Math.cos(addr2[0]) * Math.sin(dlong)\n latmid = Math.atan2((Math.sin(addr1[0]) + Math.sin(addr2[0])), Math.sqrt(( Math.co... | [
"0.67657155",
"0.6230195",
"0.60827184",
"0.5940809",
"0.58509636",
"0.58503944",
"0.57359004",
"0.5720991",
"0.5611139",
"0.55673945",
"0.55184054",
"0.53590447",
"0.5270703",
"0.5190869",
"0.516958",
"0.5064318",
"0.5036161",
"0.5029965",
"0.50280505",
"0.5013692",
"0.50098... | 0.6276274 | 1 |
If sessions should be remembered by default or not. Default: false Accepts: Boolean | def remember_me(value = nil)
config(:remember_me, value, false)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remember_me?\n false\n end",
"def remember_me?\n false\n end",
"def remember_me() return true; end",
"def remember_me?\n self.remember_me ==\"1\"\n end",
"def remember_me\n true\n end",
"def remember_me\n true\n end",
"def remember_me\n true\n end",
"def re... | [
"0.7696783",
"0.7696783",
"0.75205046",
"0.7510487",
"0.74729556",
"0.74729556",
"0.74729556",
"0.72811615",
"0.7063824",
"0.7054525",
"0.7054525",
"0.7003484",
"0.6849417",
"0.6822305",
"0.6797072",
"0.6751317",
"0.670357",
"0.6685071",
"0.6629983",
"0.65911925",
"0.65887105... | 0.71204597 | 8 |
The length of time until the cookie expires. Default: 3.months Accepts: Integer, length of time in seconds, such as 60 or 3.months | def remember_me_for(value = :_read)
config(:remember_me_for, value, 3.months, :_read)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expiry_time\n session[:expires_at] || 3.days.from_now\n end",
"def cookie_expiration\n super\n end",
"def expiration\n @expiration ||= 60 * 60 * 24 * 30 # 30 days\n end",
"def cookie_expires(symbol)\n cookies[symbol.to_s].expires\n end",
"def expires_in\n options[:expires_in]\n... | [
"0.7260988",
"0.67771703",
"0.67660284",
"0.6572734",
"0.6518522",
"0.6391483",
"0.6391483",
"0.6338242",
"0.63350344",
"0.6268456",
"0.62311226",
"0.62177515",
"0.6209953",
"0.62092435",
"0.617079",
"0.6167244",
"0.61666775",
"0.6148202",
"0.61263436",
"0.6057405",
"0.605653... | 0.0 | -1 |
Is the cookie going to expire after the session is over, or will it stick around? | def remember_me
return @remember_me if defined?(@remember_me)
@remember_me = self.class.remember_me
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def session_expired?\n ! (Time.now < session[:expire_at])\n end",
"def session_expiry\n reset_session if session[:expiry_time] and session[:expiry_time] < Time.now\n\n session[:expiry_time] = MAX_SESSION_PERIOD.seconds.from_now\n return true\n end",
"def refresh_expiration\n self.needs_new_c... | [
"0.78431475",
"0.75199896",
"0.7494625",
"0.7494625",
"0.73937273",
"0.7295315",
"0.7293184",
"0.7286472",
"0.7239357",
"0.7233131",
"0.7180921",
"0.7147434",
"0.7103905",
"0.7069731",
"0.7055231",
"0.702959",
"0.6993847",
"0.6980654",
"0.6971696",
"0.6969683",
"0.6959118",
... | 0.0 | -1 |
Accepts a boolean as a flag to remember the session or not. Basically to expire the cookie at the end of the session or keep it for "remember_me_until". | def remember_me=(value)
@remember_me = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def session_remember\n httpsession = Thread.current[:hayabusa][:httpsession]\n raise \"Could not figure out HTTP-session.\" if !httpsession\n session = httpsession.session\n raise \"Could not get session-variable from HTTP-session.\" if !session\n session[:remember] = 1\n \n self.cookie(\n ... | [
"0.73916006",
"0.7342578",
"0.73255914",
"0.7206114",
"0.71570694",
"0.7144627",
"0.7137126",
"0.7070906",
"0.7022782",
"0.7022782",
"0.7022782",
"0.69527733",
"0.69527733",
"0.6947318",
"0.69252884",
"0.69080573",
"0.6879704",
"0.6877383",
"0.68367887",
"0.6767537",
"0.67648... | 0.66616726 | 60 |
How long to remember the user if remember_me is true. This is based on the class level configuration: remember_me_for | def remember_me_for
return unless remember_me?
self.class.remember_me_for
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remember_me\n remember_me_for Ubiquo::Settings.context(:ubiquo_authentication).get(:remember_time)\n end",
"def remember_me\n remember_me_for 2.years\n end",
"def remember_me\n remember_me_for REMEMBER_ME_TIME\n end",
"def remember_me_for\n 10.years\n end",
"def remember_me\n remembe... | [
"0.7919459",
"0.7817373",
"0.7784388",
"0.77594024",
"0.77157855",
"0.7597479",
"0.7558704",
"0.7539569",
"0.7532223",
"0.75180906",
"0.75180906",
"0.7511062",
"0.7457107",
"0.7452609",
"0.74417084",
"0.7434991",
"0.7430245",
"0.7430245",
"0.7430245",
"0.7430245",
"0.7430245"... | 0.7225576 | 79 |
When to expire the cookie. See remember_me_for configuration option to change this. | def remember_me_until
return unless remember_me?
remember_me_for.from_now
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cookie_expiration\n super\n end",
"def expire\n self.expires_on = DateTime.current\n self\n end",
"def refresh_expiration\n self.needs_new_cookie = true\n end",
"def refresh_expiration\n self.needs_new_cookie = true\n end",
"def expires_after\n @expires_after ||=\n ... | [
"0.7866517",
"0.7042537",
"0.7036406",
"0.7036406",
"0.70064956",
"0.699696",
"0.6985513",
"0.69068116",
"0.6896222",
"0.6855843",
"0.68082607",
"0.68028194",
"0.6742465",
"0.6726405",
"0.671561",
"0.6637407",
"0.66168195",
"0.66135526",
"0.6585588",
"0.65632576",
"0.65549976... | 0.0 | -1 |
Tries to validate the session from information in the cookie | def persist_by_cookie
if cookie_credentials
self.unauthorized_record = search_for_record("find_by_persistence_token", cookie_credentials)
valid?
else
false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_session_cookie(_item)\n nil\n end",
"def validate_cookie\n if cookies[:caboose_user_id] && User.exists?(cookies[:caboose_user_id])\n user = User.find(cookies[:caboose_user_id])\n login_user(user)\n return true\n end\n return false\n end",
"def val... | [
"0.7542024",
"0.711248",
"0.69921863",
"0.69485545",
"0.69368374",
"0.6918382",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
"0.68954533",
... | 0.0 | -1 |
def check_presence if :restaurant_id == nil || :customer_id == nil || :date == nil errors.add(:field, "this is needed!") return end end | def capacity_available
if self.restaurant.availability(self.party_size, self.time) < 0
errors.add(:party_size, "Inadequate capacity")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_nulls\n# if self.name.nil? && self.dynamic_type_id.nil?\n# flash[:notice] = \"You must fill in something !\"\n if self.dynamic_type_id.nil?\n self.dynamic_type_id = 3\n end\n if self.name.nil?\n self.name = \"please enter a name\"\n end\n# end\n end",
"... | [
"0.7319035",
"0.69908744",
"0.6864611",
"0.6844001",
"0.6800009",
"0.6786568",
"0.66769713",
"0.66349703",
"0.66127145",
"0.6599904",
"0.6506322",
"0.64857614",
"0.64848334",
"0.64685345",
"0.6463436",
"0.6449333",
"0.644654",
"0.644654",
"0.64345664",
"0.64345664",
"0.643063... | 0.0 | -1 |
check if prices for order exist | def check_order
order.each { |e| e[0].capitalize.constantize.price }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def priced?()\n priced = true\n if (self.order_in_lines.length == 0)\n return false\n end\n self.order_in_lines.each do |line|\n if (not line.price or line.price == 0)\n priced = false\n end\n end\n return priced\n end",
"def check_price\n end",
... | [
"0.69013166",
"0.6861784",
"0.6669326",
"0.66652304",
"0.6605663",
"0.6522453",
"0.6438968",
"0.63980407",
"0.63787645",
"0.6371733",
"0.6286517",
"0.62312734",
"0.6202022",
"0.61697525",
"0.6164078",
"0.6162283",
"0.61409384",
"0.61318165",
"0.6121301",
"0.61133045",
"0.6089... | 0.6626063 | 4 |
Creates a new password and sends an email to the user | def forgot_password
@user = User.find_by_email(params[:email])
if @user
random_password = Array.new(10).map { (65 + rand(58)).chr }.join
@user.password = random_password
@user.save!
respond_to do |format|
format.js { @alert = "Recover password email sent!" }
end
#Send user forgot password ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_new_password(user_id, password)\n @company = Company.first\n\n @user = User.find(user_id)\n @password = password\n\n mail(to: @user.email, subject: \"Get a grip studios new password\")\n end",
"def send_new_password(template)\n\n pass = create_new_password\n set_password(pass)\n sa... | [
"0.81694233",
"0.8149543",
"0.7966634",
"0.78495103",
"0.7831971",
"0.78188795",
"0.77990824",
"0.7738548",
"0.7712447",
"0.77070653",
"0.7693617",
"0.7629557",
"0.7590751",
"0.75641686",
"0.7557685",
"0.7557685",
"0.7557685",
"0.7557685",
"0.7552159",
"0.75443923",
"0.754100... | 0.7281476 | 47 |
Creates a new account, sends welcome email to user | def register
@user = User.new(user_params)
respond_to do |format|
if @user.save
# Send user welcome email
UserNotification.welcome_email(@user).deliver
format.js { @errors = [] }
else
format.js { @errors = @user.errors }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_account(user)\n @user = user\n @user_name = @user.full_name\n @user_email = @user.email\n\n mail(to: @user.email, subject: 'Welcome to the jungle')\n end",
"def create\n\t\tif @user.save\n\t\t\tflash[:notice] = \"Your account has been successfully created!\"\n\t\t\tUserMailer.welcome_email(@... | [
"0.81225675",
"0.79760367",
"0.7711003",
"0.76361555",
"0.76286983",
"0.75406337",
"0.7510189",
"0.7450156",
"0.7448354",
"0.7421687",
"0.7378476",
"0.7369781",
"0.73688143",
"0.7341141",
"0.7308949",
"0.73024493",
"0.7295441",
"0.72924906",
"0.72894233",
"0.7284012",
"0.7279... | 0.0 | -1 |
Log user in and sets session variable | def create
user = User.find_by_email(params[:email])
if user and user.authenticate(params[:password])
session[:agent_id] = user.id
respond_to do |format|
format.js { @alert = "" }
end
else
respond_to do |format|
format.js { @alert = "Sorry wrong username or passord" }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_in(user)\n session[:user_id] = user.id\n end",
"def user_log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end",
"def log_in(user)\n session[:user_id] = user.id\n end... | [
"0.8234603",
"0.8152341",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81251794",
"0.81181467",
"0.80974114",
"0.8015642",
"0.80051416",
... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def user_params
params.permit(:first_name, :last_name, :email, :password, :password_confirmation)
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 |
Crossing the bridge, you've barely reached the other side of the stream when a program comes up to you, clearly in distress. "It's my child process," she says, "he's gotten lost in an infinite grid!" Fortunately for her, you have plenty of experience with infinite grids. Unfortunately for you, it's a hex grid. The hexa... | def solve(directions)
directions = parse(directions)
steps = map(directions)
count(steps)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def carve_passage_from(x,y)\n\t\tdirections = [@@N,@@S,@@E,@@W].sort_by{rand}\n\t\tdirections.each do |direction|\n\t\t\t#\n\t\t\t# Render updates of the maze on a \"cell-by-cell\" basis\n\t\t\t#\n\t\t\tif @animate\n\t\t\t display(x,y)\n\t\t\t sleep @delay\n\t\t\tend\n\n\t\t\tdx,dy = x + @@DX[direction],... | [
"0.58303756",
"0.5768152",
"0.5588042",
"0.5530551",
"0.53762245",
"0.5370459",
"0.5360772",
"0.53457385",
"0.5307653",
"0.5299517",
"0.52965426",
"0.5280873",
"0.52799773",
"0.52799773",
"0.5278538",
"0.52758276",
"0.5251745",
"0.52517015",
"0.52411735",
"0.5237",
"0.5226157... | 0.0 | -1 |
def welcome puts "" 25 puts "Welcome to tv series app".green puts "" 25 puts "" end def create_new_user puts "what is your name?".red name = gets.chomp | def create_new_user
name = @prompt.ask("what is your name?".red)
@user = User.find_by(name: name)
if @user
# User.exists?(@user.name)
puts "Welcome back #{@user.name}"
show_current_series
current_series
remove_from_series_list
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_user\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"Tell us a little about yourself. It will only take a moment.\"\n puts \"\"\n puts \"What is your name?\"\n puts \"\"\n new_user_full_name = gets.s... | [
"0.86092687",
"0.76746523",
"0.76576424",
"0.75693643",
"0.75543",
"0.7554164",
"0.7525697",
"0.75131863",
"0.7462495",
"0.74525625",
"0.74431705",
"0.740296",
"0.74004585",
"0.7387101",
"0.7368599",
"0.736675",
"0.73497814",
"0.73385566",
"0.7334779",
"0.72980106",
"0.728860... | 0.75653714 | 4 |
End of new functionality test | def get_user_input
input = @prompt.ask("Enter a series_name:".red)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testing_end\n end",
"def after_test(_test); end",
"def after_test(_test); end",
"def after_test(_test); end",
"def end; end",
"def end; end",
"def end; end",
"def running_test_case; end",
"def test_case; end",
"def testing\n # ...\n end",
"def after; end",
"def after; end... | [
"0.8146546",
"0.7368898",
"0.7368898",
"0.7368898",
"0.71097547",
"0.71097547",
"0.71097547",
"0.7052921",
"0.700908",
"0.69983095",
"0.6979698",
"0.6979698",
"0.693444",
"0.693444",
"0.6929827",
"0.6929827",
"0.69131625",
"0.68974894",
"0.68974894",
"0.687275",
"0.687275",
... | 0.0 | -1 |
TODO Get the fuck off of CanCan, it is such a pain to use Usage: There are two ways to authorize. 1. add 'load_and_authorize_resource' at the top of the controller make sure to only try and authorize(here in ability.rb) the object that load_and_authorize_resource instantiates. Do not create an object yourself inside th... | def initialize(current_user)
# Define abilities for the passed in user here.
current_user ||= User.new # guest user (not logged in)
# admin can access everything
if current_user.admin?
can :manage, :all
else
# index, new, and create are open to everyone
can [:index, :new, :create]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorize_resource(*args); end",
"def authorize_resource\n EffectiveResources.authorize!(self, action_name.to_sym, resource)\n end",
"def authorize_access\r\n # authorize!(action_name.to_sym, \"#{controller_name}_controller\".camelcase.constantize)\r\n end",
"def authorize\n end",
"def... | [
"0.75217396",
"0.74272615",
"0.7353765",
"0.7251368",
"0.7251368",
"0.71319574",
"0.7049525",
"0.70350146",
"0.7022065",
"0.7004353",
"0.6947318",
"0.69260025",
"0.69131184",
"0.69131184",
"0.6892732",
"0.68829036",
"0.6818154",
"0.6801593",
"0.67960757",
"0.6785153",
"0.6784... | 0.0 | -1 |
this method is required to allow method calls directly to player object exa. move(:up) vs player.move(:up) | def method_missing(m, *args)
player.send(m, *args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move(player, x, y)\n\n end",
"def move; end",
"def move; end",
"def Move(player, start, stop)\r\n end",
"def move\n\n end",
"def U\r\n move_method(4) \r\nend",
"def move\n \n end",
"def move\n \n end",
"def moving!\n end",
"def player_move(player)\n if player_one == player... | [
"0.7682027",
"0.71460396",
"0.71460396",
"0.71106786",
"0.7042432",
"0.70168245",
"0.7014268",
"0.7014268",
"0.6932065",
"0.690603",
"0.68875855",
"0.6881317",
"0.68491584",
"0.6792599",
"0.676897",
"0.67557263",
"0.6754496",
"0.67269397",
"0.6716592",
"0.6703221",
"0.6675963... | 0.6011949 | 95 |
These methods return a single array from their collections for a given spot on the board | def row index
rows[index / 9]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_col(col)\n board = $boggle_board\n board.map{|array| array[col]}\nend",
"def get_piece_locations\n @board.search(Piece, @color)\n end",
"def get_col(col)\n $boggle_board.map {|boggle_board| boggle_board[col] }\nend",
"def pieces\n self.cells.values.map {|c| c.piece }.compact.uniq\n e... | [
"0.61204004",
"0.6035528",
"0.6006389",
"0.5984257",
"0.5957067",
"0.5942434",
"0.59376895",
"0.5932574",
"0.5931005",
"0.5886414",
"0.58676004",
"0.5852874",
"0.5843852",
"0.5842786",
"0.5784615",
"0.5741265",
"0.5735952",
"0.5732054",
"0.57277924",
"0.5719243",
"0.57178944"... | 0.0 | -1 |
Check if a user has a role. | def has_role?(role)
list ||= self.roles.map(&:name)
list.include?(role.to_s) || list.include?('admin')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_role?(role)\n current_user && current_user.has_role?(role)\n end",
"def has_role?(role)\n current_user && current_user.has_role?(role)\n end",
"def user_role?\n roles.any? { |role| Roles.user_roles.include?(role) }\n end",
"def has_role? user_role\n role_subject && role_subject.has_r... | [
"0.84074676",
"0.84074676",
"0.8357367",
"0.834063",
"0.8287326",
"0.82594836",
"0.8197438",
"0.8193615",
"0.8180773",
"0.8172182",
"0.8138071",
"0.8110604",
"0.8098894",
"0.80977607",
"0.8091092",
"0.80854297",
"0.8075235",
"0.8075235",
"0.8057121",
"0.8029851",
"0.8018554",... | 0.7976081 | 28 |
Not using open id | def not_using_openid?
identity_url.blank?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def using_open_id?(identifier = nil) #:doc:\n identifier ||= open_id_identifier\n !identifier.blank? || request.env[Rack::OpenID::RESPONSE]\n end",
"def using_open_id?(identity_url = nil) #:doc:\n identity_url ||= params[:openid_identifier] || params[:openid_url]\n !identity_url.blank? || ... | [
"0.6678766",
"0.65161383",
"0.64001226",
"0.6314665",
"0.62673277",
"0.62193227",
"0.6187546",
"0.6165956",
"0.6148184",
"0.61291236",
"0.61053",
"0.60747296",
"0.593842",
"0.59357065",
"0.5911064",
"0.59107774",
"0.58893394",
"0.58632153",
"0.5829147",
"0.5792056",
"0.577885... | 0.6273983 | 8 |
Overwrite password_required for open id | def password_required?
new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def password_required?; end",
"def password_required?; false; end",
"def password_required?\n if new_record? && oauth_account\n false\n else\n super\n end\n end",
"def password_required=(value)\n @password_required = value\n end",
"def password_required=(value)... | [
"0.71904653",
"0.71528774",
"0.71395254",
"0.6892267",
"0.6892267",
"0.6892267",
"0.68723685",
"0.68723685",
"0.6819348",
"0.679459",
"0.6785954",
"0.6785954",
"0.6766361",
"0.6766361",
"0.6766361",
"0.6759476",
"0.67070824",
"0.6677438",
"0.6677438",
"0.6673893",
"0.6673893"... | 0.66744465 | 23 |
Set the method to call on identifiers going into the database: DB[:items] SELECT FROM items DB.identifier_input_method = :upcase DB[:items] SELECT FROM ITEMS | def identifier_input_method=(v)
reset_default_dataset
@identifier_input_method = v
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identifier_input_method_default\n return super if defined?(super)\n :upcase if folds_unquoted_identifiers_to_uppercase?\n end",
"def identifier_input_method=(v)\n raise_if_frozen!(%w\"identifier_input_method= with_identifier_input_method\")\n skip_symbol_cache!\n @opts... | [
"0.64742327",
"0.606218",
"0.5993302",
"0.55762917",
"0.55197674",
"0.5463244",
"0.5437362",
"0.5418241",
"0.5359803",
"0.5357218",
"0.5332369",
"0.53261745",
"0.53237003",
"0.52471256",
"0.52347755",
"0.5215532",
"0.5214836",
"0.51702476",
"0.51694256",
"0.5134307",
"0.51309... | 0.6384298 | 1 |
Set whether to quote identifiers (columns and tables) for this database: DB[:items] SELECT FROM items DB.quote_identifiers = true DB[:items] SELECT FROM "items" | def quote_identifiers=(v)
reset_default_dataset
@quote_identifiers = v
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote_identifiers?\n @opts.fetch(:quote_identifiers, db.quote_identifiers?)\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers_default\n true\n end",
"def quote_identifiers?\n ... | [
"0.7108182",
"0.647802",
"0.647802",
"0.6451622",
"0.6418039",
"0.62377906",
"0.6220861",
"0.61782897",
"0.60976166",
"0.6044149",
"0.6044149",
"0.5969378",
"0.594705",
"0.5941652",
"0.5895363",
"0.58851516",
"0.5881552",
"0.585254",
"0.5784013",
"0.5749945",
"0.5733863",
"... | 0.6656485 | 1 |
Returns true if the database quotes identifiers. | def quote_identifiers?
@quote_identifiers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote_identifiers?\n @opts.fetch(:quote_identifiers, db.quote_identifiers?)\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers_default\n true\n end",
"def quote?(c)\n c == '\... | [
"0.8401652",
"0.8213007",
"0.8213007",
"0.6258726",
"0.60911703",
"0.60499936",
"0.6018938",
"0.5983928",
"0.59563154",
"0.59363943",
"0.58290035",
"0.5821704",
"0.58066136",
"0.58020395",
"0.5795896",
"0.57936233",
"0.5787272",
"0.5752759",
"0.5726516",
"0.5726516",
"0.57046... | 0.8220736 | 1 |
Return a dataset that uses the default identifier input and output methods for this database. Used when parsing metadata so that column symbols are returned as expected. | def _metadata_dataset
super.
with_identifier_input_method(identifier_input_method_default).
with_identifier_output_method(identifier_output_method_default)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_default_dataset\n Sequel.synchronize{@symbol_literal_cache.clear}\n @default_dataset = dataset\n end",
"def convert_input_dataset(ds)\n case ds\n when Symbol, SQL::Identifier, SQL::QualifiedIdentifier, SQL::AliasedExpression, LiteralString\n self.simple_table = db.li... | [
"0.63469005",
"0.62881184",
"0.627643",
"0.6251551",
"0.618202",
"0.6162",
"0.6138623",
"0.6135922",
"0.6066852",
"0.6064727",
"0.5916525",
"0.5916525",
"0.5784966",
"0.5780518",
"0.5780518",
"0.57796556",
"0.5778772",
"0.5774198",
"0.5717994",
"0.56709576",
"0.56408405",
"... | 0.7084262 | 0 |
Upcase identifiers on input if database folds unquoted identifiers to uppercase. | def identifier_input_method_default
return super if defined?(super)
:upcase if folds_unquoted_identifiers_to_uppercase?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def folds_unquoted_identifiers_to_uppercase?\n true\n end",
"def format_case(identifier)\n if database_metadata.upcase_identifiers?\n identifier =~ /[a-z]/ ? identifier : identifier.downcase\n else\n identifier\n end\n end",
"def native_case(identifier)\n if databas... | [
"0.75934887",
"0.7084187",
"0.69408953",
"0.68937665",
"0.6806098",
"0.67715997",
"0.6725696",
"0.66340417",
"0.64872694",
"0.6446172",
"0.64160734",
"0.6414102",
"0.640594",
"0.637638",
"0.6331373",
"0.6297425",
"0.62907666",
"0.6249018",
"0.6247038",
"0.62410617",
"0.62204"... | 0.6741547 | 6 |
Downcase identifiers on output if database folds unquoted identifiers to uppercase. | def identifier_output_method_default
return super if defined?(super)
:downcase if folds_unquoted_identifiers_to_uppercase?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def folds_unquoted_identifiers_to_uppercase?\n true\n end",
"def format_case(identifier)\n if database_metadata.upcase_identifiers?\n identifier =~ /[a-z]/ ? identifier : identifier.downcase\n else\n identifier\n end\n end",
"def native_case(identifier)\n if databas... | [
"0.75341314",
"0.74642897",
"0.714171",
"0.68259937",
"0.6729714",
"0.6671262",
"0.6584952",
"0.6531173",
"0.64536536",
"0.64108294",
"0.64062464",
"0.63865674",
"0.6367778",
"0.6356193",
"0.6353803",
"0.6335032",
"0.63105637",
"0.6271148",
"0.62373006",
"0.62313837",
"0.6231... | 0.68194216 | 4 |
Reset the identifier mangling options. Overrides any already set on the instance. Only for internal use by shared adapters. | def reset_identifier_mangling
# SEQUEL5: Stop checking Database.*
@quote_identifiers = @opts.fetch(:quote_identifiers){(qi = Database.quote_identifiers).nil? ? quote_identifiers_default : qi}
@identifier_input_method = @opts.fetch(:identifier_input_method){(iim = Database.identifier_input_method... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset!\n @options = Name.defaults.dup\n end",
"def reset_options!\n @options = self::DEFAULT_OPTIONS.clone # 'self::' is necessary with ruby 1.8\n end",
"def reset!\n @options = {}\n end",
"def reset\n self.options = nil\n self.option_processors = nil\n ... | [
"0.6280473",
"0.6256506",
"0.6080228",
"0.5998918",
"0.59854144",
"0.5766986",
"0.5721901",
"0.56418455",
"0.56134933",
"0.56134933",
"0.56127185",
"0.56110364",
"0.5594192",
"0.5514194",
"0.5502266",
"0.5476273",
"0.5435391",
"0.5419881",
"0.54183364",
"0.5357138",
"0.535401... | 0.7870191 | 0 |
Set the method to call on identifiers going into the database for this dataset | def identifier_input_method=(v)
raise_if_frozen!(%w"identifier_input_method= with_identifier_input_method")
skip_symbol_cache!
@opts[:identifier_input_method] = v
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _dataset_method\n :\"_#{self[:name]}_dataset\"\n end",
"def identifier_input_method=(v)\n reset_default_dataset\n @identifier_input_method = v\n end",
"def dataset_method\n :\"#{self[:name]}_dataset\"\n end",
"def dataset_method\n :\"#{self[:name]}_dataset\... | [
"0.6624791",
"0.6561811",
"0.62552947",
"0.6254155",
"0.61938983",
"0.61741096",
"0.6031134",
"0.59181964",
"0.58952117",
"0.58710045",
"0.5842612",
"0.5842612",
"0.5812189",
"0.5781854",
"0.57747585",
"0.5743334",
"0.55810803",
"0.5570735",
"0.5557942",
"0.55463934",
"0.5512... | 0.5436271 | 28 |
The String instance method to call on identifiers before sending them to the database. | def identifier_output_method
@opts.fetch(:identifier_output_method, db.identifier_output_method)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identifier_string\n name\n end",
"def to_s\n @identifier.to_s.upcase\n end",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\t\t\tend",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\t\t\tend",
"def id\n super.to_s.tr('.', '_')\n... | [
"0.6773236",
"0.6726314",
"0.6681785",
"0.6681785",
"0.6649954",
"0.6608561",
"0.6608561",
"0.657327",
"0.6551573",
"0.65362215",
"0.6528478",
"0.64999855",
"0.645992",
"0.64436585",
"0.63790053",
"0.6308521",
"0.62696445",
"0.6254141",
"0.6251493",
"0.6251493",
"0.62461275",... | 0.0 | -1 |
Set the method to call on identifiers coming the database for this dataset | def identifier_output_method=(v)
raise_if_frozen!(%w"identifier_output_method= with_identifier_output_method")
@opts[:identifier_output_method] = v
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _dataset_method\n :\"_#{self[:name]}_dataset\"\n end",
"def identifier_input_method=(v)\n reset_default_dataset\n @identifier_input_method = v\n end",
"def def_model_dataset_method(meth)\n return if respond_to?(meth, true)\n\n if meth.to_s =~ /\\A[A-Za-z_][A-Za-z0-9... | [
"0.6643229",
"0.66098887",
"0.62784094",
"0.6276356",
"0.62709385",
"0.62646115",
"0.60368955",
"0.59317994",
"0.59067935",
"0.5834757",
"0.581605",
"0.5705722",
"0.5705722",
"0.57054085",
"0.5701737",
"0.5667697",
"0.5659949",
"0.55983734",
"0.5516385",
"0.5513253",
"0.55103... | 0.5683435 | 15 |
Check with the database to see if identifier quoting is enabled | def quote_identifiers?
@opts.fetch(:quote_identifiers, db.quote_identifiers?)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers?\n @quote_identifiers\n end",
"def quote_identifiers_default\n true\n end",
"def force_quotes?() @force_quotes end",
"def with_qu... | [
"0.75174403",
"0.75174403",
"0.746984",
"0.6296756",
"0.5958378",
"0.5815473",
"0.58102864",
"0.5739704",
"0.5731706",
"0.5712597",
"0.5688008",
"0.56746745",
"0.5669466",
"0.56651914",
"0.5610807",
"0.5597874",
"0.5561484",
"0.55357444",
"0.552124",
"0.55158275",
"0.55158275... | 0.7920528 | 0 |
Return a modified dataset with identifier_input_method set. | def with_identifier_input_method(meth)
clone(:identifier_input_method=>meth, :skip_symbol_cache=>true)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identifier_input_method=(v)\n reset_default_dataset\n @identifier_input_method = v\n end",
"def _metadata_dataset\n super.\n with_identifier_input_method(identifier_input_method_default).\n with_identifier_output_method(identifier_output_method_default)\n end"... | [
"0.7479923",
"0.6776263",
"0.62602633",
"0.6031974",
"0.59979784",
"0.59132737",
"0.59132737",
"0.5900692",
"0.5876149",
"0.58455974",
"0.5783344",
"0.57120395",
"0.5709173",
"0.5685088",
"0.5680543",
"0.5645637",
"0.5645183",
"0.56261486",
"0.56164396",
"0.5576587",
"0.55713... | 0.67486084 | 2 |
Return a modified dataset with identifier_output_method set. | def with_identifier_output_method(meth)
clone(:identifier_output_method=>meth)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _metadata_dataset\n super.\n with_identifier_input_method(identifier_input_method_default).\n with_identifier_output_method(identifier_output_method_default)\n end",
"def identifier_output_method\n @opts.fetch(:identifier_output_method, db.identifier_output_method)\n ... | [
"0.70140094",
"0.6685923",
"0.6422816",
"0.63105714",
"0.59350693",
"0.5548431",
"0.55252755",
"0.5409899",
"0.53889734",
"0.5342131",
"0.52555364",
"0.5252124",
"0.5129215",
"0.5100856",
"0.509165",
"0.50700337",
"0.50687826",
"0.5036526",
"0.5014006",
"0.5014006",
"0.501400... | 0.6991017 | 1 |
Convert the identifier to the version used in the database via identifier_input_method. | def input_identifier(v)
(i = identifier_input_method) ? v.to_s.send(i) : v.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_identifier(identifier)\n case identifier\n when SQL::Identifier\n identifier.value.to_s\n else\n identifier\n end\n end",
"def to_identifier(identifier)\n case identifier\n when String, Symbol then identifier.to_sym\n whe... | [
"0.6665848",
"0.6091485",
"0.57756",
"0.5756698",
"0.57330894",
"0.5691244",
"0.5625954",
"0.5529772",
"0.5517853",
"0.5487539",
"0.5479136",
"0.5477171",
"0.54471594",
"0.5441303",
"0.5435606",
"0.5386319",
"0.537876",
"0.53625876",
"0.5337354",
"0.53176147",
"0.5299659",
... | 0.6560117 | 1 |
Modify the identifier returned from the database based on the identifier_output_method. | def output_identifier(v)
v = 'untitled' if v == ''
(i = identifier_output_method) ? v.to_s.send(i).to_sym : v.to_sym
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identifier_output_method\n @opts.fetch(:identifier_output_method, db.identifier_output_method)\n end",
"def identifier_output_method=(v)\n raise_if_frozen!(%w\"identifier_output_method= with_identifier_output_method\")\n @opts[:identifier_output_method] = v\n end",
"def with_... | [
"0.7681118",
"0.7090504",
"0.70779604",
"0.6325136",
"0.6303797",
"0.6238056",
"0.6145633",
"0.6105762",
"0.60130996",
"0.5966312",
"0.5954244",
"0.593717",
"0.59007126",
"0.58942145",
"0.5871",
"0.58450675",
"0.5796341",
"0.5790511",
"0.57643145",
"0.57643145",
"0.5764117",
... | 0.5937952 | 11 |
GET /posts GET /posts.json | def index
# @posts = Post.where(["linked_account_id in (?) AND (post_at > ? or post_at is null)", current_user.linked_accounts.pluck(:id), DateTime.now]).order("post_at asc")
# @posts = Post.where(["linked_account_id in (?)", current_user.linked_accounts.pluck(:id)])
@posts = Post.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n ... | [
"0.7865315",
"0.7494904",
"0.7494433",
"0.7494433",
"0.7488696",
"0.74314564",
"0.728645",
"0.728645",
"0.728645",
"0.72562826",
"0.72522277",
"0.7247287",
"0.7246305",
"0.72221965",
"0.72042215",
"0.72039723",
"0.7169929",
"0.71689725",
"0.71644753",
"0.7121855",
"0.71152896... | 0.0 | -1 |
GET /posts/1 GET /posts/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def show\n render json: Post.find(params[\"id\"])\n end",
"def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
... | [
"0.77110183",
"0.73537844",
"0.73433185",
"0.73379177",
"0.73228735",
"0.7293139",
"0.7275997",
"0.7256934",
"0.7161576",
"0.7158913",
"0.71552676",
"0.71552676",
"0.7119547",
"0.7094749",
"0.7094749",
"0.7094749",
"0.70943594",
"0.7071599",
"0.70607626",
"0.70452625",
"0.703... | 0.0 | -1 |
POST /posts POST /posts.json | def create
linked_account_ids = post_params.delete(:linked_account_ids)
linked_accounts = current_user.linked_accounts.where(id: linked_account_ids)
save_successful = create_multiple_from_linked_accounts(linked_accounts)
# @post = Post.new(post_params)
respond_to do |format|
if save_successf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n render json: Post.create(params[\"post\"])\n end",
"def create\n respond_with Post.create(params[:posts])\n end",
"def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end",
"def create\n @post = Post.new(post_params)\n @po... | [
"0.74463975",
"0.73221767",
"0.73072433",
"0.7123966",
"0.7015686",
"0.701327",
"0.69841874",
"0.6939327",
"0.69313824",
"0.69053805",
"0.68196476",
"0.6812792",
"0.6793222",
"0.6792862",
"0.6779654",
"0.6779654",
"0.67625546",
"0.67602354",
"0.67515427",
"0.6735786",
"0.6698... | 0.0 | -1 |
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json | def update
respond_to do |format|
if @post.update(post_params)
format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }
format.json { render :show, status: :ok, location: @post }
else
format.html { render :edit }
format.json { render json: @post.er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n respond_with Post.update(params[:id], params[:posts])\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n forma... | [
"0.71867543",
"0.7042899",
"0.6774105",
"0.67672604",
"0.6669961",
"0.6649129",
"0.657972",
"0.6556958",
"0.6551495",
"0.6549005",
"0.6535034",
"0.6531995",
"0.6497553",
"0.64958835",
"0.6468818",
"0.64319825",
"0.6428907",
"0.64275557",
"0.64273673",
"0.64193714",
"0.6419366... | 0.0 | -1 |
DELETE /posts/1 DELETE /posts/1.json | def destroy
@post.destroy
respond_to do |format|
format.html { redirect_to posts_url, notice: 'Post was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param... | [
"0.8046884",
"0.76902676",
"0.7583626",
"0.75803024",
"0.7568048",
"0.75047046",
"0.75031126",
"0.74750155",
"0.74671036",
"0.74650854",
"0.746482",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_post
@post = Post.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 post_params
hsh = params.require(:post).permit(:text, :type, :post_at, :linked_account_id, :linked_account_ids => [])
hsh[:post_at] = Chronic.parse(hsh[:post_at]) if hsh[:post_at].present?
hsh
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 /todos GET /todos.json | def index
@todos = Todo.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @todos = Todo.all\n json_response(@todos)\n end",
"def show\n todo = Todo.find_by_id(params[:id])\n render json: todo.todos\n end",
"def index\n @todos = @list.todos\n render json: @todos\n end",
"def index\n @todos = Todo.all\n render json: @todos\n ... | [
"0.80015033",
"0.7946748",
"0.7915049",
"0.7910324",
"0.767061",
"0.75529414",
"0.7513659",
"0.74718785",
"0.74510056",
"0.7441282",
"0.74228525",
"0.7407939",
"0.7388406",
"0.72670317",
"0.7216767",
"0.7216767",
"0.71763384",
"0.71687216",
"0.7158836",
"0.71497715",
"0.71280... | 0.7112157 | 26 |
GET /todos/1 GET /todos/1.json | def show
@todo = Todo.find(params[:id]) #not through before filter as we're checking there for user, in show it's read only so it's safe to show to all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n todo = Todo.find_by_id(params[:id])\n render json: todo.todos\n end",
"def show\n puts params[:id]\n render json: Todo.find(params[:id])\n end",
"def show\n @todo = @list.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { r... | [
"0.7953201",
"0.7647965",
"0.7603146",
"0.7571494",
"0.75503665",
"0.751457",
"0.7503114",
"0.7458781",
"0.7458781",
"0.7443962",
"0.7373681",
"0.72946733",
"0.7290071",
"0.72630847",
"0.7247785",
"0.72369283",
"0.7234159",
"0.71743184",
"0.71338177",
"0.7111886",
"0.71102434... | 0.0 | -1 |
POST /todos POST /todos.json | def create
@todo = Todo.new(todo_params)
@todo.user_id = current_user.id
respond_to do |format|
if @todo.save
format.html { redirect_to list_path(@todo.list), notice: 'Todo was successfully created.' }
format.json { render :show, status: :created, location: @todo }
else
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @todo = Todo.create(todo_params)\n render json: @todo\n end",
"def create\n @todo = Todo.new(todo_params)\n if @todo.save\n render json: @todo, status: :created, location: @todo\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
... | [
"0.77191365",
"0.7682156",
"0.7584383",
"0.7571844",
"0.7390803",
"0.7379874",
"0.73744744",
"0.7349123",
"0.7333154",
"0.73257005",
"0.7285942",
"0.7235614",
"0.722343",
"0.72165036",
"0.72165036",
"0.72165036",
"0.71789914",
"0.7135808",
"0.7118579",
"0.71103877",
"0.702635... | 0.6973365 | 22 |
PATCH/PUT /todos/1 PATCH/PUT /todos/1.json | def update
respond_to do |format|
if @todo.update(todo_params)
format.html { redirect_to list_path(@todo.list), notice: 'Todo was successfully updated.' }
format.json { render :show, status: :ok, location: @todo }
else
format.html { render :edit }
format.json { render jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json... | [
"0.73876435",
"0.73800725",
"0.72687894",
"0.7246782",
"0.70655125",
"0.70095533",
"0.695816",
"0.69538754",
"0.69361985",
"0.69361985",
"0.68700045",
"0.6847399",
"0.68226784",
"0.6788569",
"0.67627513",
"0.6751422",
"0.6751128",
"0.6751128",
"0.6726497",
"0.6714954",
"0.670... | 0.66567206 | 21 |
DELETE /todos/1 DELETE /todos/1.json | def destroy
@todo.destroy
respond_to do |format|
format.html { redirect_to todos_url, notice: 'Todo was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n render json: nil, status: :ok\n end",
"def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n ... | [
"0.79151887",
"0.7865625",
"0.77419454",
"0.77419454",
"0.7713188",
"0.7664772",
"0.7655661",
"0.7619602",
"0.7612175",
"0.75980675",
"0.75966346",
"0.7569626",
"0.7567462",
"0.75221884",
"0.75175065",
"0.75142604",
"0.75054616",
"0.7441618",
"0.7424936",
"0.74210566",
"0.738... | 0.73562056 | 27 |
Use callbacks to share common setup or constraints between actions. | def set_todo
# this will search todos of only current user, securing the project this way
@todo = current_user.todos.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 todo_params
params.require(:todo).permit(:name, :checked, :list_id)
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 |
Translates the input text and stores it to the output text At some point, it will do the actual translation, for now it does nothign | def translate_input_text
if self.language
self.output_text = self.language.translate(self.input_text)
else
self.output_text = self.input_text
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def translate(text,dictonary)\nend",
"def translate text\n split_arr = text.split(\" \")\n split_arr_trans = split_arr.map { |word| \n (@@found_dict.key? word) ? @@found_dict[word] : (@@found_dict[word]=process_word(word); @@found_dict[word])\n }\n return split_arr_trans.join(\" \")\n end",
"... | [
"0.7277268",
"0.7240093",
"0.7239669",
"0.7110667",
"0.7035492",
"0.6913321",
"0.6890278",
"0.6801753",
"0.6714831",
"0.6709473",
"0.6676868",
"0.6637599",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6629618",
"0.6569199",
"... | 0.85170096 | 0 |
GET /st_has_deps GET /st_has_deps.json | def index
@st_has_deps = StHasDep.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_dependencies?\n update_for.length > 0 or requires.length > 0\n end",
"def deps_satisfied?(deps)\n deps.each do |dep|\n if dep.to_s =~ /^no_(.*)$/\n return false if @used_legos.include?( $1 )\n else\n return false unless @used_legos.include?( dep.to_s )\n end\n end\n\n true\nend"... | [
"0.664916",
"0.654933",
"0.62939364",
"0.62885255",
"0.62870073",
"0.62566555",
"0.62037945",
"0.61133456",
"0.6022716",
"0.5990468",
"0.59582514",
"0.5956456",
"0.59435797",
"0.59306365",
"0.5912542",
"0.59063077",
"0.59050524",
"0.5887407",
"0.58787316",
"0.58765465",
"0.58... | 0.70777345 | 0 |
GET /st_has_deps/1 GET /st_has_deps/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @st_has_deps = StHasDep.all\n end",
"def request_dependencies\n end",
"def has_dependencies?\n update_for.length > 0 or requires.length > 0\n end",
"def check_dependencies\n ok = true\n\n @config.each_pair { |type, values|\n next if !values.instance_of?(Array)\n _... | [
"0.70691454",
"0.6040055",
"0.6022914",
"0.596768",
"0.5955613",
"0.5928609",
"0.5925376",
"0.5895723",
"0.5816758",
"0.57527393",
"0.5697761",
"0.5665558",
"0.56564426",
"0.56564426",
"0.56564426",
"0.5653535",
"0.56408197",
"0.56405073",
"0.5639411",
"0.5638058",
"0.5635806... | 0.0 | -1 |
POST /st_has_deps POST /st_has_deps.json | def create
@st_has_dep = StHasDep.new(st_has_dep_params)
respond_to do |format|
if @st_has_dep.save
format.html { redirect_to @st_has_dep, notice: 'St has dep was successfully created.' }
format.json { render :show, status: :created, location: @st_has_dep }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_dependencies?\n update_for.length > 0 or requires.length > 0\n end",
"def deps_satisfied?(deps)\n deps.each do |dep|\n if dep.to_s =~ /^no_(.*)$/\n return false if @used_legos.include?( $1 )\n else\n return false unless @used_legos.include?( dep.to_s )\n end\n end\n\n true\nend"... | [
"0.683444",
"0.66331786",
"0.65274006",
"0.6408237",
"0.6373267",
"0.63201666",
"0.6252797",
"0.60327303",
"0.59952694",
"0.599453",
"0.59690446",
"0.5961911",
"0.5960527",
"0.5960067",
"0.59132046",
"0.5873628",
"0.5864868",
"0.58605283",
"0.5814376",
"0.58088225",
"0.580882... | 0.5945071 | 14 |
PATCH/PUT /st_has_deps/1 PATCH/PUT /st_has_deps/1.json | def update
respond_to do |format|
if @st_has_dep.update(st_has_dep_params)
format.html { redirect_to @st_has_dep, notice: 'St has dep was successfully updated.' }
format.json { render :show, status: :ok, location: @st_has_dep }
else
format.html { render :edit }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @dependency.update(dependency_params)\n format.html { redirect_to @dependency, notice: 'Dependency was successfully updated.' }\n format.json { render :show, status: :ok, location: @dependency }\n else\n format.html { render :edit }\n ... | [
"0.5962525",
"0.58566445",
"0.56241256",
"0.56056905",
"0.5605329",
"0.55381966",
"0.5536844",
"0.55261886",
"0.5477421",
"0.5459484",
"0.54520655",
"0.5444927",
"0.54436415",
"0.54412055",
"0.5404717",
"0.5388185",
"0.5369044",
"0.53601784",
"0.53512406",
"0.53422457",
"0.53... | 0.6582094 | 0 |
DELETE /st_has_deps/1 DELETE /st_has_deps/1.json | def destroy
@st_has_dep.destroy
respond_to do |format|
format.html { redirect_to st_has_deps_url, notice: 'St has dep was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @stu_has_dep.destroy\n respond_to do |format|\n format.html { redirect_to stu_has_deps_url, notice: 'Stu has dep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @service_dependance = ServiceDependance.find(params[:id])\n @serv... | [
"0.65879154",
"0.6346515",
"0.6243931",
"0.6180601",
"0.6174073",
"0.6118575",
"0.6063317",
"0.60134137",
"0.5816985",
"0.5799205",
"0.5795967",
"0.5728521",
"0.5719803",
"0.5716195",
"0.5644465",
"0.5641048",
"0.56120026",
"0.56117857",
"0.5607601",
"0.5590655",
"0.558589",
... | 0.7146879 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_st_has_dep
@st_has_dep = StHasDep.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 st_has_dep_params
params.require(:st_has_dep).permit(:department_id, :student_id)
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 |
duplicates a data criteria. This is important because we may be modifying source data criteria like patient characteristic birthdate to add restrictions the restrictions added may be different for the numerator, denominator, different IPP_1, IPP_2, etc. | def duplicate_data_criteria(data_criteria, parent_id)
if (data_criteria.is_a? HQMF::Converter::SimpleDataCriteria and data_criteria.precondition_id == parent_id)
new_data_criteria = data_criteria
else
new_data_criteria = HQMF::Converter::SimpleDataCriteria.from_data_criteria(data_crit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simplify_criteria(checklist_test)\n criteria = checklist_test.checked_criteria[0, 2]\n criteria[0].source_data_criteria = 'DiagnosisActiveMajorDepressionIncludingRemission_precondition_40'\n criteria[0].code = '14183003'\n criteria[0].code_complete = true\n criteria[0].attribute_code = '63161005... | [
"0.63006365",
"0.5553563",
"0.5527629",
"0.5512974",
"0.54140073",
"0.54122496",
"0.53895515",
"0.5381441",
"0.53016704",
"0.5269918",
"0.52516466",
"0.5245863",
"0.52146024",
"0.519569",
"0.51742375",
"0.5139762",
"0.51091367",
"0.5104598",
"0.50943196",
"0.50676304",
"0.506... | 0.69991904 | 0 |
make sure that if a data criteria is used as a target, that it is not deleted by someone else. this is required for birthdate in NQF0106 | def validate_not_deleted(target)
@v2_data_criteria_to_delete[target] = false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsubstituable_data_criteria?(data_criteria)\n cr = data_criteria\n cr['negation'] || cr['definition'] == 'derived' || cr['type'] == 'derived' || (cr['type'] == 'characteristic' && cr['property'] == 'birthtime')\n end",
"def remove_assessment_data_if_employee_not_assessed\n # if is_not_assessed?\n ... | [
"0.62890947",
"0.5882484",
"0.58802706",
"0.5592124",
"0.5585252",
"0.5574038",
"0.5568518",
"0.55581236",
"0.5511789",
"0.5501143",
"0.54960656",
"0.5493446",
"0.549009",
"0.5479043",
"0.5474206",
"0.5446111",
"0.54407483",
"0.5426858",
"0.5405737",
"0.54011416",
"0.5391391"... | 0.7449382 | 0 |
grouping data criteria are used to allow a single reference off of a temporal reference or subset operator grouping data criteria can reference either regular data criteria as children, or other grouping data criteria | def create_group_data_criteria(preconditions, type, value, parent_id, id, standard_category, qds_data_type)
extract_group_data_criteria_tree(HQMF::DataCriteria::UNION,preconditions, type, parent_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_group_data_criteria_tree(conjunction, preconditions, type, parent_id)\n \n children = []\n preconditions.each do |precondition|\n if (precondition.comparison?) \n if (precondition.reference.id == HQMF::Document::MEASURE_PERIOD_ID)\n children << measure_period_c... | [
"0.6329269",
"0.62302256",
"0.6080654",
"0.6034187",
"0.5932438",
"0.5916987",
"0.59155285",
"0.5910265",
"0.58908755",
"0.5866469",
"0.5829356",
"0.5771114",
"0.5766789",
"0.57425374",
"0.573406",
"0.5712862",
"0.56296504",
"0.56295836",
"0.56129473",
"0.56068486",
"0.559961... | 0.68933153 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.