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 |
|---|---|---|---|---|---|---|
number, return the negative of that number. If the number is 0 or negative, return the original number. | def negative(number)
number > 0 ? (number * -1) : number
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def negative(number)\n if number > 0\n -number\n else\n return number\n end\nend",
"def negative(number)\n return number if number.negative? || number.zero?\n -number\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
... | [
"0.84400934",
"0.82569116",
"0.812424",
"0.812424",
"0.80540895",
"0.80276227",
"0.8022706",
"0.79611444",
"0.7944778",
"0.7914502",
"0.78699344",
"0.78699344",
"0.78699344",
"0.78699344",
"0.786686",
"0.78650326",
"0.78636545",
"0.78063285",
"0.77588415",
"0.77488",
"0.77398... | 0.8133102 | 2 |
Returns the size of the deck | def size
cards.size
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size\n deck.size\n end",
"def count\n @deck.size\n end",
"def length\n @fulldeck.length # => 52\n end",
"def size\n @cards.size\n end",
"def size\n @cards.size\n end",
"def size\n @cards.size\n end",
"def size\n return @cards.length\n end",
"de... | [
"0.94003105",
"0.84423864",
"0.8125935",
"0.80669385",
"0.80669385",
"0.7955371",
"0.79423875",
"0.7750547",
"0.76502717",
"0.7591381",
"0.7537148",
"0.74552876",
"0.744512",
"0.73515713",
"0.7347998",
"0.73432094",
"0.7282276",
"0.72787035",
"0.72439766",
"0.7231798",
"0.721... | 0.812801 | 2 |
Draws last n cards from the deck | def draw(amount = 1)
cards.pop(amount)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drawCards!(n)\n\t\treturn @cards.pop(n)\n end",
"def draw_cards(count)\n self.deck.shift(count)\n end",
"def draw_card(number_of_cards)\n for i in 1..number_of_cards\n @hand.push(@deck.pop)\n end\n end",
"def draw3more(deck)\n for i in 1..3\n @cardsShown << deck.draw\n end\n ... | [
"0.81865597",
"0.8018772",
"0.7957726",
"0.7911588",
"0.725285",
"0.7251688",
"0.72080594",
"0.71938294",
"0.7152711",
"0.71021986",
"0.7042433",
"0.6970247",
"0.6941676",
"0.6932184",
"0.69250476",
"0.691803",
"0.68921643",
"0.68679756",
"0.68451685",
"0.6832259",
"0.6823827... | 0.70727247 | 10 |
Returns the cards of the deck in a different order | def shuffle!
cards.shuffle!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cards(deck)\n\n end",
"def order_list\n\t\t@cards = @cards.order(:cmc)\n\tend",
"def getCards(aDeck)\n\t\treturn 13.times{self << aDeck.next}\t\n\tend",
"def get_cards\n cards = []\n index = 0\n [2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11].each do |num|\n 24.times do\n ... | [
"0.77542835",
"0.7496468",
"0.7380668",
"0.7374169",
"0.73601794",
"0.73345554",
"0.73098147",
"0.7277669",
"0.7218854",
"0.7089644",
"0.7041236",
"0.7019243",
"0.6992009",
"0.6986571",
"0.6975113",
"0.6932877",
"0.6930461",
"0.69242555",
"0.690597",
"0.6904038",
"0.6900083",... | 0.0 | -1 |
Resets the deck to its initial state | def reset!
@cards = load_cards
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset\n @cards = Card.suits.keys.map do |suit|\n Card.values.map {|i| Card.new(suit, i)}\n end.flatten\n @dealt = []\n self\n end",
"def reset!\n self.cards = CARDS.dup\n end",
"def reset!\n @hands.each(&:discard!)\n @cards += @used\n @used = []\n end... | [
"0.7677289",
"0.7619788",
"0.7354242",
"0.72920626",
"0.7029121",
"0.70242834",
"0.69429487",
"0.6933892",
"0.6880998",
"0.68518317",
"0.6824319",
"0.6736215",
"0.67171663",
"0.6687541",
"0.66756934",
"0.66600865",
"0.66305983",
"0.66120774",
"0.66120774",
"0.66015124",
"0.66... | 0.7718841 | 0 |
Part 1 Soma os elementos de um array, retorna 0 para array vazio | def sum arr
if !arr.empty?
soma = 0
arr.each do |elt| ; soma += elt ; end
return soma
end
return 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Array(p0) end",
"def get_first_array_elements(body, parts)\n part_count = 0\n parts.each do |part|\n part_count += 1\n body[full_part] = body[full_part][0] if body[full_part].is_a?(Array)\n end\n return body\nend",
"def array_start\n []\n end",
"def array()\n\t\t@array\n\tend",
... | [
"0.655238",
"0.6332136",
"0.62203276",
"0.60372776",
"0.60257393",
"0.5957594",
"0.5908274",
"0.58215123",
"0.5799673",
"0.57981676",
"0.5790108",
"0.57866806",
"0.57819414",
"0.57503223",
"0.57440674",
"0.5698903",
"0.56874263",
"0.5668195",
"0.56679726",
"0.56610996",
"0.56... | 0.0 | -1 |
Soma os dois maiores elementos de um array, retorna 0 para array vazio | def max_2_sum arr
if arr.count > 1
arr_ord = arr.sort
return arr_ord[-1] + arr_ord[-2]
elsif arr.count == 1
return arr[0]
else
return 0
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def length\n array.first.size\n end",
"def test_returns_count\n assert(\n FromArray.new([1, 2, 3]).count == 3\n )\n assert(\n FromArray.new([]).count.zero?\n )\n end",
"def arraysum\n return self.inject(0){|acc,i|acc +i}\n end",
"def size\n return @array.size... | [
"0.63044745",
"0.6272252",
"0.6239469",
"0.6157792",
"0.6141516",
"0.61352324",
"0.6130367",
"0.6127148",
"0.6089858",
"0.60550934",
"0.60275215",
"0.59983313",
"0.5997854",
"0.5979171",
"0.5962313",
"0.59592086",
"0.5947168",
"0.5947168",
"0.59308636",
"0.5891704",
"0.588338... | 0.0 | -1 |
e.g. Feed, Item, Site, etc. Helpers | def feed_path( feed )
"/feed/#{feed.key}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def feed_items\n feed_item\n end",
"def saw_item(item); end",
"def links_feed\n end",
"def featured_item(items)\n\n end",
"def only_blogs items\n only_ items, :blog\nend",
"def item; end",
"def item; end",
"def item; end",
"def item; end",
"def item; end",
"def type\n return @type i... | [
"0.6706791",
"0.6393365",
"0.62268436",
"0.6208559",
"0.61873645",
"0.6127472",
"0.6127472",
"0.6127336",
"0.6127336",
"0.6127336",
"0.5877778",
"0.5853885",
"0.58315575",
"0.5823589",
"0.5820171",
"0.5819839",
"0.5819839",
"0.5778131",
"0.57364994",
"0.56929934",
"0.5689447"... | 0.0 | -1 |
p my_min([0, 3, 5, 4, 5, 10, 1, 90]) this is O of n squared | def my_min_improved(arr)
min = arr[0]
arr.each do |el|
min = el if el < min
end
return min
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_min_2(nums) # O(n)\n smallest = 0\n nums.each do |num|\n smallest = num if num < smallest\n end\n smallest\nend",
"def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min ... | [
"0.7378233",
"0.73757845",
"0.7360287",
"0.72964483",
"0.72632223",
"0.72324157",
"0.71904904",
"0.70650923",
"0.7016497",
"0.70115554",
"0.699908",
"0.699556",
"0.69848216",
"0.6976887",
"0.69636387",
"0.69513434",
"0.68599117",
"0.6849337",
"0.6840293",
"0.68294907",
"0.682... | 0.6695315 | 35 |
p my_min_improved([0, 3, 5, 4, 5, 10, 1, 90]) this is O of n | def largest_contiguous_subsum(arr)
i = 0
subs = []
while i < arr.length
j = i
while j < arr.length
subs << arr[i..j]
j += 1
end
i += 1
end
return (subs.max {|a, b| a.sum <=> b.sum}).sum
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend",
"def my_better_min(list)\n min = list[0] #1\n\n list.each_with_index do |ele_1, i| ... | [
"0.7334273",
"0.7281849",
"0.72502804",
"0.7223876",
"0.7141298",
"0.7120812",
"0.71145725",
"0.7108195",
"0.70895696",
"0.70615995",
"0.70613986",
"0.70403975",
"0.7039384",
"0.70318496",
"0.6968392",
"0.69553643",
"0.6932657",
"0.6920475",
"0.69008267",
"0.68753076",
"0.687... | 0.0 | -1 |
This is the last step because any failure here wouldn't prevent the other steps from running | def install_javascript_dependencies
inject_into_file 'app/assets/javascripts/application.js', after: '//= require blacklight/blacklight' do
"\n// Required by Arclight" \
"\n//= require arclight/arclight"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_failed; end",
"def failures; end",
"def failures; end",
"def failures; end",
"def step_result; end",
"def do_failure; end",
"def running_test_step; end",
"def run_succeeded; end",
"def proceed!; end",
"def proceed!; end",
"def handle_post_mortem; end",
"def post_process; end",
"def ... | [
"0.6997873",
"0.6466996",
"0.6466996",
"0.6466996",
"0.63887274",
"0.6353059",
"0.6287806",
"0.62694573",
"0.6244597",
"0.6244597",
"0.616333",
"0.6131668",
"0.60797805",
"0.6048473",
"0.6048473",
"0.6048473",
"0.6048473",
"0.6048473",
"0.6048473",
"0.6048473",
"0.6048473",
... | 0.0 | -1 |
Put whatever you need here to initialize the DB conn. | def initialize(hostname="localhost")
# localhost is the default if there's no arg
@hostname = hostname
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize()\n # calling base constructor\n super()\n\n # trying to connect to database\n begin\n # setting the db configuration file path\n db_config_file_path = \"#{File.dirname(__FILE__)}/db/database.yml\"\n\n # creating a pointer to the file content\n f_db_config = File.open... | [
"0.7427078",
"0.7242181",
"0.7222761",
"0.7080685",
"0.7033233",
"0.6997479",
"0.69647",
"0.6934885",
"0.6909456",
"0.6909456",
"0.6896935",
"0.68697697",
"0.6865477",
"0.6854281",
"0.6850265",
"0.68415785",
"0.6816952",
"0.6812647",
"0.67680484",
"0.6763926",
"0.676068",
"... | 0.0 | -1 |
setup for list of vehicles | def list_cars
puts "==================================================================="
Car.print_all
puts "==================================================================="
puts "\nEnter a number and press 'enter' to pick the desired vehicle."
puts "Type 'exit' to quit."
puts "\nTo see the cheapest car type 'cheap'."
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vehicles; end",
"def create_vehicles vehicle\n self.create_vehicle(:four_wheeler => vehicle[:four_wheeler],:two_wheeler => vehicle[:two_wheeler],:none => vehicle[:none])\n end",
"def launch_vehicle; end",
"def initialize\n @cars = []\n ready_go\n end",
"def vehicles\n @vehicles ||= begi... | [
"0.71356285",
"0.69482875",
"0.6406161",
"0.6243949",
"0.61998963",
"0.61825305",
"0.61575156",
"0.6152966",
"0.6152966",
"0.6152966",
"0.6152966",
"0.6152966",
"0.61162424",
"0.61162424",
"0.61162424",
"0.61162424",
"0.61162424",
"0.61162424",
"0.61162424",
"0.61162424",
"0.... | 0.0 | -1 |
Checks if the user logged in is authorized to modify the project | def can_add?
project = Project.find(params[:project_id])
if logged_in?
user = User.find(session[:user_id])
if user.projects.include?(project)
member = project.members.find_by_user_id(user)
if (member.member_role.role == "creator" or member.member_role.role == "administrator")
return true
end
end
end
redirect_to project, :notice => "You're not authorized to modify this project!"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_modify?\n project = Project.find(params[:id])\n \n if logged_in?\n user = User.find(session[:user_id])\n if user.projects.include?(project)\n member = project.members.find_by_user_id(user)\n if (member.member_role.role == \"creator\" or member.member_role.role == \"administ... | [
"0.8410987",
"0.8073768",
"0.7732395",
"0.7507087",
"0.74223757",
"0.73820734",
"0.73510873",
"0.7308573",
"0.7284115",
"0.7282567",
"0.72600067",
"0.7211678",
"0.7165469",
"0.7106593",
"0.710168",
"0.70938843",
"0.7072224",
"0.7051062",
"0.703633",
"0.70139915",
"0.70057815"... | 0.7774453 | 2 |
Use callbacks to share common setup or constraints between actions. | def set_author
@author = Author.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 |
Only allow a trusted parameter "white list" through. | def author_params
params.require(:author).permit(:name, :email_address, :bio, :password, :password_confirmation, :authorization_token, :authorized, :profile_image)
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 |
Use parser to parse the configmap toml file to a ruby structure | def parseConfigMap
begin
# Check to see if config map is created
if (File.file?(@configMapMountPath))
puts "config::configmap container-azm-ms-agentconfig for agent settings mounted, parsing values"
parsedConfig = Tomlrb.load_file(@configMapMountPath, symbolize_keys: true)
puts "config::Successfully parsed mounted config map"
return parsedConfig
else
puts "config::configmap container-azm-ms-agentconfig for agent settings not mounted, using defaults"
return nil
end
rescue => errorStr
ConfigParseErrorLogger.logError("Exception while parsing config map for agent settings : #{errorStr}, using defaults, please check config map for errors")
return nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_config(config); end",
"def load_toml(path)\n ConfigHash.new(TOML.parse(path.read, :symbolize_keys => true))\n end",
"def initialize\n @tree = YAML::parse(File.open(CONFIG_FILE))\n end",
"def parse(config_file)\n open(config_file) do |f|\n parse_string(f.read, config_file)\n ... | [
"0.67521816",
"0.63717693",
"0.62796634",
"0.6276525",
"0.6223976",
"0.6051447",
"0.6005092",
"0.596364",
"0.59565127",
"0.5909066",
"0.59022576",
"0.5881128",
"0.58657265",
"0.58593446",
"0.58540523",
"0.58540523",
"0.5822434",
"0.57986236",
"0.57943016",
"0.57805634",
"0.57... | 0.6176473 | 5 |
Use the ruby structure created after config parsing to set the right values to be used as environment variables | def populateSettingValuesFromConfigMap(parsedConfig)
begin
if !parsedConfig.nil? && !parsedConfig[:agent_settings].nil?
if !parsedConfig[:agent_settings][:health_model].nil? && !parsedConfig[:agent_settings][:health_model][:enabled].nil?
@enable_health_model = parsedConfig[:agent_settings][:health_model][:enabled]
puts "enable_health_model = #{@enable_health_model}"
end
chunk_config = parsedConfig[:agent_settings][:chunk_config]
if !chunk_config.nil?
nodesChunkSize = chunk_config[:NODES_CHUNK_SIZE]
if !nodesChunkSize.nil? && is_number?(nodesChunkSize) && (@nodesChunkSizeMin..@nodesChunkSizeMax) === nodesChunkSize.to_i
@nodesChunkSize = nodesChunkSize.to_i
puts "Using config map value: NODES_CHUNK_SIZE = #{@nodesChunkSize}"
end
podsChunkSize = chunk_config[:PODS_CHUNK_SIZE]
if !podsChunkSize.nil? && is_number?(podsChunkSize) && (@podsChunkSizeMin..@podsChunkSizeMax) === podsChunkSize.to_i
@podsChunkSize = podsChunkSize.to_i
puts "Using config map value: PODS_CHUNK_SIZE = #{@podsChunkSize}"
end
eventsChunkSize = chunk_config[:EVENTS_CHUNK_SIZE]
if !eventsChunkSize.nil? && is_number?(eventsChunkSize) && (@eventsChunkSizeMin..@eventsChunkSizeMax) === eventsChunkSize.to_i
@eventsChunkSize = eventsChunkSize.to_i
puts "Using config map value: EVENTS_CHUNK_SIZE = #{@eventsChunkSize}"
end
deploymentsChunkSize = chunk_config[:DEPLOYMENTS_CHUNK_SIZE]
if !deploymentsChunkSize.nil? && is_number?(deploymentsChunkSize) && (@deploymentsChunkSizeMin..@deploymentsChunkSizeMax) === deploymentsChunkSize.to_i
@deploymentsChunkSize = deploymentsChunkSize.to_i
puts "Using config map value: DEPLOYMENTS_CHUNK_SIZE = #{@deploymentsChunkSize}"
end
hpaChunkSize = chunk_config[:HPA_CHUNK_SIZE]
if !hpaChunkSize.nil? && is_number?(hpaChunkSize) && (@hpaChunkSizeMin..@hpaChunkSizeMax) === hpaChunkSize.to_i
@hpaChunkSize = hpaChunkSize.to_i
puts "Using config map value: HPA_CHUNK_SIZE = #{@hpaChunkSize}"
end
podsEmitStreamBatchSize = chunk_config[:PODS_EMIT_STREAM_BATCH_SIZE]
if !podsEmitStreamBatchSize.nil? && is_number?(podsEmitStreamBatchSize) &&
podsEmitStreamBatchSize.to_i <= @podsChunkSize && podsEmitStreamBatchSize.to_i >= @podsEmitStreamBatchSizeMin
@podsEmitStreamBatchSize = podsEmitStreamBatchSize.to_i
puts "Using config map value: PODS_EMIT_STREAM_BATCH_SIZE = #{@podsEmitStreamBatchSize}"
end
nodesEmitStreamBatchSize = chunk_config[:NODES_EMIT_STREAM_BATCH_SIZE]
if !nodesEmitStreamBatchSize.nil? && is_number?(nodesEmitStreamBatchSize) &&
nodesEmitStreamBatchSize.to_i <= @nodesChunkSize && nodesEmitStreamBatchSize.to_i >= @nodesEmitStreamBatchSizeMin
@nodesEmitStreamBatchSize = nodesEmitStreamBatchSize.to_i
puts "Using config map value: NODES_EMIT_STREAM_BATCH_SIZE = #{@nodesEmitStreamBatchSize}"
end
end
# fbit config settings
fbit_config = parsedConfig[:agent_settings][:fbit_config]
if !fbit_config.nil?
fbitFlushIntervalSecs = fbit_config[:log_flush_interval_secs]
if !fbitFlushIntervalSecs.nil? && is_number?(fbitFlushIntervalSecs) && fbitFlushIntervalSecs.to_i > 0
@fbitFlushIntervalSecs = fbitFlushIntervalSecs.to_i
puts "Using config map value: log_flush_interval_secs = #{@fbitFlushIntervalSecs}"
end
fbitTailBufferChunkSizeMBs = fbit_config[:tail_buf_chunksize_megabytes]
if !fbitTailBufferChunkSizeMBs.nil? && is_number?(fbitTailBufferChunkSizeMBs) && fbitTailBufferChunkSizeMBs.to_i > 0
@fbitTailBufferChunkSizeMBs = fbitTailBufferChunkSizeMBs.to_i
puts "Using config map value: tail_buf_chunksize_megabytes = #{@fbitTailBufferChunkSizeMBs}"
end
fbitTailBufferMaxSizeMBs = fbit_config[:tail_buf_maxsize_megabytes]
if !fbitTailBufferMaxSizeMBs.nil? && is_number?(fbitTailBufferMaxSizeMBs) && fbitTailBufferMaxSizeMBs.to_i > 0
if fbitTailBufferMaxSizeMBs.to_i >= @fbitTailBufferChunkSizeMBs
@fbitTailBufferMaxSizeMBs = fbitTailBufferMaxSizeMBs.to_i
puts "Using config map value: tail_buf_maxsize_megabytes = #{@fbitTailBufferMaxSizeMBs}"
else
# tail_buf_maxsize_megabytes has to be greater or equal to tail_buf_chunksize_megabytes
@fbitTailBufferMaxSizeMBs = @fbitTailBufferChunkSizeMBs
puts "config::warn: tail_buf_maxsize_megabytes must be greater or equal to value of tail_buf_chunksize_megabytes. Using tail_buf_maxsize_megabytes = #{@fbitTailBufferMaxSizeMBs} since provided config value not valid"
end
end
# in scenario - tail_buf_chunksize_megabytes provided but not tail_buf_maxsize_megabytes to prevent fbit crash
if @fbitTailBufferChunkSizeMBs > 0 && @fbitTailBufferMaxSizeMBs == 0
@fbitTailBufferMaxSizeMBs = @fbitTailBufferChunkSizeMBs
puts "config::warn: since tail_buf_maxsize_megabytes not provided hence using tail_buf_maxsize_megabytes=#{@fbitTailBufferMaxSizeMBs} which is same as the value of tail_buf_chunksize_megabytes"
end
fbitTailMemBufLimitMBs = fbit_config[:tail_mem_buf_limit_megabytes]
if !fbitTailMemBufLimitMBs.nil? && is_number?(fbitTailMemBufLimitMBs) && fbitTailMemBufLimitMBs.to_i > 0
@fbitTailMemBufLimitMBs = fbitTailMemBufLimitMBs.to_i
puts "Using config map value: tail_mem_buf_limit_megabytes = #{@fbitTailMemBufLimitMBs}"
end
end
end
rescue => errorStr
puts "config::error:Exception while reading config settings for agent configuration setting - #{errorStr}, using defaults"
@enable_health_model = false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def example_env_vars\n Parser.call(read)\n rescue Errno::ENOENT, FormatError\n {}\n end",
"def config_from_env\n CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env_vars|\n if va... | [
"0.70209014",
"0.70209014",
"0.70209014",
"0.70209014",
"0.68703663",
"0.65631396",
"0.6512647",
"0.6511904",
"0.6506707",
"0.6472019",
"0.64699167",
"0.6466354",
"0.6464643",
"0.6440466",
"0.643739",
"0.6430409",
"0.6411087",
"0.63769996",
"0.6376613",
"0.6372308",
"0.633520... | 0.0 | -1 |
GET /people GET /people.json | def index
=begin
search_inputs = params[:search_inputs]
klass = class_for(search_inputs[:model]) || Person
search_term = search_inputs[:search_term] || ""
institutions = search_inputs[:institutions] || ""
tag_list = search_inputs[:tag_list] || ""
@records = Search.new(model: klass, search_term: search_term, tag_list: tag_list, institutions: institutions, page: params[:page]).search
@search_inputs = params[:search_inputs]
=end
#@people = Person.all.order(:name).page(params[:page]).per(20)
#@people = Person.all.limit(25)
#@people = Person.all
#@people = Person.all.order(:name).page(params[:page])
if params[:search_inputs].present?
@search_inputs = OpenStruct.new(params[:search_inputs])
else
@search_inputs = OpenStruct.new(model: "Person")
end
@records = Search.new(@search_inputs).search
@records = @records.page(params[:page]).per(20)
respond_to do |format|
format.html
format.js { render :file => "/people/search_people.js.erb" }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n\t\tall_people = Person.all.sort_by(&:id)\n\t\tif all_people\n\t\t\trender json: {people: all_people}\n\t\telse\n\t\t\trender body: 'People Not Found', status: 404\n\t\tend\n\tend",
"def people\n Sifter.\n get(api_people_url).\n fetch(\"people\", []).\n map { |p| Sifter::Person.new(p... | [
"0.75080985",
"0.7490487",
"0.7490487",
"0.73151547",
"0.72153556",
"0.7154834",
"0.7154834",
"0.71427387",
"0.7037789",
"0.70082515",
"0.699553",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.6980208",
"0.69641876"... | 0.0 | -1 |
GET /people/1 GET /people/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @person }\n end\n end",
"def person(id)\n get(\"/catalog/people/#{id.to_s}\")\n end",
"def show\n @person = get_person(params[:id])\n respond_to do |format|\n format.html #... | [
"0.73654115",
"0.72936606",
"0.7278633",
"0.7278633",
"0.72337806",
"0.7217525",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.716031",
"0.7136041",
"0.70801747",
"0.7075092",
"0.7065",
"0.70224607",
"0.69983834",
"0.6986... | 0.0 | -1 |
POST /people POST /people.json | def create
@person = Person.new(person_params)
@record = @person
respond_to do |format|
if @person.save
format.html { redirect_to @person, notice: 'Person was successfully created.' }
format.json { render :show, status: :created, location: @person }
format.js { render :file => "/basic/create.js.erb" }
else
format.html { render :new }
format.json { render json: @person.errors, status: :unprocessable_entity }
format.js { render :file => "/basic/faulty_create.js.erb" }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v1_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"def create\n @person = Person.new... | [
"0.6787028",
"0.67639786",
"0.67471504",
"0.67430043",
"0.6740321",
"0.6729967",
"0.6695623",
"0.66938925",
"0.66387355",
"0.6607146",
"0.6599289",
"0.6555189",
"0.6555189",
"0.6555189",
"0.6555189",
"0.65208775",
"0.65106755",
"0.6495074",
"0.6495074",
"0.6495074",
"0.649507... | 0.0 | -1 |
PATCH/PUT /people/1 PATCH/PUT /people/1.json | def update
@record = @person
respond_to do |format|
if @person.update(person_params)
format.html { redirect_to @person, notice: 'Person was successfully updated.' }
format.json { render :show, status: :ok, location: @person }
format.js { render :file => "/basic/update.js.erb" }
else
format.html { render :edit }
format.json { render json: @person.errors, status: :unprocessable_entity }
format.js { render :file => "/basic/update.js.erb" }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_requ... | [
"0.7046178",
"0.6955489",
"0.68781364",
"0.66859853",
"0.6622123",
"0.6622123",
"0.6622123",
"0.6622123",
"0.6622123",
"0.6618028",
"0.66086507",
"0.66086507",
"0.6599896",
"0.6584526",
"0.65779114",
"0.6543081",
"0.6543081",
"0.6543081",
"0.65398455",
"0.6506056",
"0.6504997... | 0.0 | -1 |
DELETE /people/1 DELETE /people/1.json | def destroy
@person.destroy
respond_to do |format|
format.html { redirect_to people_url, notice: 'Person was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @person = Person.find(params[:id])\n @person.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end",
"def destroy\n ## note use of method chaining to combine find & destroy into one line\n Person.find(params[:id]).destroy\n respond_t... | [
"0.756637",
"0.75528497",
"0.755258",
"0.755258",
"0.755258",
"0.7542481",
"0.75265175",
"0.75265175",
"0.75265175",
"0.75265175",
"0.7441367",
"0.7421742",
"0.7409622",
"0.7409622",
"0.7409622",
"0.7409622",
"0.7409622",
"0.7394193",
"0.7350797",
"0.72796255",
"0.72706586",
... | 0.7168784 | 37 |
Use callbacks to share common setup or constraints between actions. | def set_person
@person = Person.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 person_params
params.require(:person).permit(:form_of_address, :firstname, :lastname, :email, :phone, :phone2, :description, :gender, :language, :website, :institution_ids => [], :functionality_list => [], :target_group_list => [], :topic_ids => [])
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 /displays/1 GET /displays/1.json | def show
@display = Display.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @display }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @displays = Display.all\n end",
"def show\n @hardware = Hardware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @hardware }\n end\n end",
"def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n ... | [
"0.7406387",
"0.67018",
"0.65529764",
"0.6539569",
"0.6536577",
"0.6519089",
"0.6515544",
"0.64929235",
"0.6418445",
"0.64058226",
"0.64058226",
"0.6384856",
"0.63755006",
"0.637004",
"0.6350795",
"0.63322103",
"0.6331071",
"0.6294739",
"0.6294739",
"0.62918437",
"0.6291266",... | 0.7049758 | 1 |
GET /displays/new GET /displays/new.json | def new
@display = Display.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @display }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end",
"def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cloud }\n end\n end",
... | [
"0.6886341",
"0.685189",
"0.684743",
"0.6839169",
"0.6816413",
"0.6801673",
"0.67967474",
"0.67844576",
"0.6777947",
"0.6776038",
"0.6770538",
"0.67643064",
"0.67564976",
"0.6720139",
"0.6720139",
"0.6720139",
"0.6720139",
"0.67104584",
"0.6678559",
"0.6678559",
"0.6673926",
... | 0.77718985 | 0 |
POST /displays POST /displays.json | def create
@display = Display.new(params[:display])
respond_to do |format|
if @display.save
format.html { redirect_to @display, :notice => 'Display was successfully created.' }
format.json { render :json => @display, :status => :created, :location => @display }
else
format.html { render :action => "new" }
format.json { render :json => @display.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @displays = Display.all\n end",
"def create\n @display = Display.new(display_params)\n\n respond_to do |format|\n if @display.save\n format.html { redirect_to @display, notice: 'Display was successfully created.' }\n format.json { render :show, status: :created, location:... | [
"0.68353724",
"0.6693141",
"0.66206634",
"0.62149626",
"0.60705906",
"0.606343",
"0.6028818",
"0.5991701",
"0.59580225",
"0.5944896",
"0.5805641",
"0.57829994",
"0.5702711",
"0.5686948",
"0.56582",
"0.5646385",
"0.56419927",
"0.5515144",
"0.5499322",
"0.54961264",
"0.54907817... | 0.66608626 | 2 |
PUT /displays/1 PUT /displays/1.json | def update
@display = Display.find(params[:id])
respond_to do |format|
if @display.update_attributes(params[:display])
format.html { redirect_to @display, :notice => 'Display was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }
format.json { render :json => @display.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @display.update(display_params)\n format.html { redirect_to @display, notice: 'Display was successfully updated.' }\n format.json { render :show, status: :ok, location: @display }\n else\n format.html { render :edit }\n format.json {... | [
"0.6391333",
"0.6046896",
"0.6025971",
"0.599391",
"0.59579",
"0.5889966",
"0.5852696",
"0.5840017",
"0.5769007",
"0.5767611",
"0.5656527",
"0.5615269",
"0.5615269",
"0.5611087",
"0.55896235",
"0.55652785",
"0.5553896",
"0.55279565",
"0.5514554",
"0.5513218",
"0.5500137",
"... | 0.64890707 | 0 |
DELETE /displays/1 DELETE /displays/1.json | def destroy
@display = Display.find(params[:id])
@display.destroy
respond_to do |format|
format.html { redirect_to displays_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @display = Display.find(params[:id])\n @display.destroy\n\n respond_to do |format|\n format.html { redirect_to(displays_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @display.destroy\n respond_to do |format|\n format.html { redirect_to displays_url... | [
"0.7295277",
"0.7247227",
"0.6883154",
"0.68739027",
"0.68485904",
"0.6832466",
"0.68277794",
"0.68199867",
"0.67659575",
"0.67593324",
"0.66454387",
"0.66435814",
"0.66037893",
"0.66037893",
"0.6603657",
"0.66025704",
"0.66011417",
"0.6591571",
"0.65859663",
"0.654852",
"0.6... | 0.748138 | 0 |
Compatibility methods for Rails 2 templates | def pickle_path
options.paths?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rendered_templates; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def template; end",
"def _render_template(options); end",
"def _render_template(options); end",
"def extensions_for(template_class); end",... | [
"0.66565067",
"0.65028983",
"0.65028983",
"0.65028983",
"0.65028983",
"0.65028983",
"0.65028983",
"0.65028983",
"0.64364225",
"0.64364225",
"0.64215994",
"0.64215994",
"0.63985896",
"0.6364262",
"0.6347739",
"0.6285156",
"0.6234638",
"0.6234638",
"0.61536205",
"0.6146451",
"0... | 0.0 | -1 |
List the house contract based on the houseid/userid/roleId combination | def contracts
#if isAuth(@userhouselink.house) # only house owner or admin can delete
id = params[:id]
print "contracts id=" + id.to_s
#houseId_userId_roleNumber
houseId,userId,role = id.to_s.split("_")
print "houseId=" + houseId.to_s + ", userId=" + userId.to_s + ", role=" + role.to_s
if(houseId && userId && role)
@user_house_contracts = UserHouseContract.where(:house_id => houseId, :user_id => userId, :role => role)
else
@errMsg = "Invalid input format."
print @errMsg
render 'error', :status => :unprocessable_entity
end
#
#end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n \n if User.find(session[:id]).role_type == \"admin\"\n @house_interest_lists = HouseInterestList.all\n elsif User.find(session[:id]).role_type == \"buyer\"\n @house_interest_lists = HouseInterestList.where(\"user_id = ?\", session[:id])\n else\n # TODO Filter all houses which... | [
"0.7065561",
"0.6148539",
"0.5889526",
"0.5803619",
"0.58031493",
"0.5802085",
"0.57494056",
"0.5730157",
"0.5725203",
"0.56907874",
"0.5658419",
"0.56570804",
"0.5607655",
"0.5600839",
"0.559615",
"0.55758566",
"0.5557621",
"0.55381143",
"0.5494804",
"0.5486327",
"0.54849654... | 0.7446135 | 0 |
Gets the applicableArchitectures property value. Contains properties for Windows architecture. | def applicable_architectures
return @applicable_architectures
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_architectures=(value)\n @applicable_architectures = value\n end",
"def detect_architecture()\r\n\t\tprint_status(\"Attempting to automatically detect the architecture\")\r\n\t\tres = send_serialized_request(\"osarch.bin\")\r\n\t\tif (res.body =~ /(i386|x86)/i)\r\n\t\t\tar... | [
"0.754819",
"0.67374974",
"0.6482059",
"0.6465427",
"0.63852566",
"0.6374508",
"0.6170374",
"0.61428696",
"0.61124086",
"0.6077849",
"0.60704404",
"0.59934604",
"0.59934604",
"0.5914384",
"0.5903381",
"0.5903381",
"0.5887445",
"0.58827317",
"0.5850506",
"0.5844784",
"0.581159... | 0.8083377 | 0 |
Sets the applicableArchitectures property value. Contains properties for Windows architecture. | def applicable_architectures=(value)
@applicable_architectures = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_architectures\n return @applicable_architectures\n end",
"def supported_archs\n @supported_archs ||= Dir.glob(File.join(__dir__, 'consts', 'sys_nr', '*.rb'))\n .map { |f| File.basename(f, '.rb').to_sym }\n .so... | [
"0.6752265",
"0.5448921",
"0.5242476",
"0.5205646",
"0.5181193",
"0.5133941",
"0.50813645",
"0.5079059",
"0.50757474",
"0.50558347",
"0.49650002",
"0.49574012",
"0.4948594",
"0.4945317",
"0.48942187",
"0.48512644",
"0.4807871",
"0.47687423",
"0.4767766",
"0.4755526",
"0.47236... | 0.8062361 | 0 |
Gets the applicableDeviceTypes property value. Contains properties for Windows device type. | def applicable_device_types
return @applicable_device_types
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_device_types=(value)\n @applicable_device_types = value\n end",
"def allowed_types\n\t\t[Device]\n\tend",
"def platform_types\n get(\"platform-types\")[\"types\"]\n end",
"def allowed_types\n\t\t[Device, Domain]\n\tend",
"def allowed_types\n\t\t[Domain,Devic... | [
"0.76458436",
"0.6872334",
"0.630855",
"0.6050196",
"0.59861934",
"0.5977894",
"0.592861",
"0.5922494",
"0.5885626",
"0.58193094",
"0.5695545",
"0.5625735",
"0.5588949",
"0.5587785",
"0.5554366",
"0.55500036",
"0.5540546",
"0.5490816",
"0.5484551",
"0.54590076",
"0.5453824",
... | 0.84048593 | 0 |
Sets the applicableDeviceTypes property value. Contains properties for Windows device type. | def applicable_device_types=(value)
@applicable_device_types = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applicable_device_types\n return @applicable_device_types\n end",
"def allowed_types\n\t\t[Device]\n\tend",
"def set_UsageTypes(value)\n set_input(\"UsageTypes\", value)\n end",
"def device_type=(value)\n @device_type = value\n end",
"... | [
"0.6758772",
"0.5762656",
"0.570532",
"0.56365144",
"0.5500077",
"0.5481403",
"0.5264788",
"0.526408",
"0.512341",
"0.5111277",
"0.5111277",
"0.5079081",
"0.50491333",
"0.50402194",
"0.50382125",
"0.50145364",
"0.50114244",
"0.49923953",
"0.49885377",
"0.49813613",
"0.4972244... | 0.82789534 | 0 |
Gets the committedContainedApps property value. The collection of contained apps in the committed mobileAppContent of a windowsUniversalAppX app. | def committed_contained_apps
return @committed_contained_apps
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def committed_contained_apps=(value)\n @committed_contained_apps = value\n end",
"def managed_apps\n return @managed_apps\n end",
"def apps\n return @apps\n end",
"def compliant_apps_list\n return @compliant_apps_lis... | [
"0.7249253",
"0.65224946",
"0.6446249",
"0.63637567",
"0.63637567",
"0.6301004",
"0.6301004",
"0.62364256",
"0.6193645",
"0.6193645",
"0.61709696",
"0.59477043",
"0.59101737",
"0.5873077",
"0.5834695",
"0.58264476",
"0.5772239",
"0.57623154",
"0.5684509",
"0.55921525",
"0.557... | 0.7778579 | 0 |
Sets the committedContainedApps property value. The collection of contained apps in the committed mobileAppContent of a windowsUniversalAppX app. | def committed_contained_apps=(value)
@committed_contained_apps = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def committed_contained_apps\n return @committed_contained_apps\n end",
"def managed_apps=(value)\n @managed_apps = value\n end",
"def apps=(value)\n @apps = value\n end",
"def installed_apps=(value)\n @installed_app... | [
"0.647464",
"0.62848115",
"0.6057803",
"0.5866532",
"0.5866532",
"0.58548427",
"0.58548427",
"0.5799521",
"0.5799521",
"0.57533014",
"0.56424147",
"0.55927914",
"0.5431217",
"0.53694624",
"0.53576523",
"0.5320876",
"0.5204975",
"0.5072575",
"0.5072575",
"0.50648826",
"0.50232... | 0.78734946 | 0 |
Instantiates a new windowsUniversalAppX and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.windowsUniversalAppX"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(window_or_handle)\n @main_window = case window_or_handle\n when Window\n window_or_handle\n when Integer\n Window.new window_or_handle\n else\n raise WinGui:... | [
"0.6252148",
"0.58806974",
"0.5633095",
"0.5610413",
"0.539812",
"0.5367561",
"0.53484225",
"0.528339",
"0.5231668",
"0.5147744",
"0.51375055",
"0.51279587",
"0.5097683",
"0.5095246",
"0.50710464",
"0.5061951",
"0.50201494",
"0.4995328",
"0.4979578",
"0.49622387",
"0.49612227... | 0.6203908 | 1 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"applicableArchitectures" => lambda {|n| @applicable_architectures = n.get_enum_value(MicrosoftGraph::Models::WindowsArchitecture) },
"applicableDeviceTypes" => lambda {|n| @applicable_device_types = n.get_enum_value(MicrosoftGraph::Models::WindowsDeviceType) },
"committedContainedApps" => lambda {|n| @committed_contained_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileContainedApp.create_from_discriminator_value(pn) }) },
"identityName" => lambda {|n| @identity_name = n.get_string_value() },
"identityPublisherHash" => lambda {|n| @identity_publisher_hash = n.get_string_value() },
"identityResourceIdentifier" => lambda {|n| @identity_resource_identifier = n.get_string_value() },
"identityVersion" => lambda {|n| @identity_version = n.get_string_value() },
"isBundle" => lambda {|n| @is_bundle = n.get_boolean_value() },
"minimumSupportedOperatingSystem" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WindowsMinimumOperatingSystem.create_from_discriminator_value(pn) }) },
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.0 | -1 |
Gets the identityName property value. The Identity Name. | def identity_name
return @identity_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_name=(value)\n @identity_name = value\n end",
"def name\n \"identity\"\n end",
"def name\n \"identity\"\n end",
"def name\n @name ||= metadata.attributes['Name'].value\n end",
"def iname\n attributes['name']\n end",
... | [
"0.77704644",
"0.68171906",
"0.670793",
"0.63422227",
"0.63371587",
"0.63371587",
"0.63371587",
"0.6310999",
"0.6257595",
"0.62386453",
"0.61399966",
"0.61399966",
"0.61110246",
"0.61110246",
"0.61110246",
"0.61110246",
"0.60955626",
"0.60774475",
"0.60698193",
"0.60634214",
... | 0.8184187 | 0 |
Sets the identityName property value. The Identity Name. | def identity_name=(value)
@identity_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(vmname)\n execute(:set_name, VMID: vm_id, VMName: vmname)\n end",
"def set_name(name)\n @name = name\n end",
"def set_name(name)\n unless name.nil?\n @name = name\n end\n @name\n end",
"def set_name(a_name)\n @name = a_name\n end",
"def set_Name(value)\n ... | [
"0.64760625",
"0.63080764",
"0.62054354",
"0.6166203",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6107941",
"0.6071007",
"0.6032065",
"0.6002141",
"0.5986748",
"0.59534484",
"0.59531736",
"0.5943592",
"0.5943592",
"0.5943592"... | 0.80607766 | 0 |
Gets the identityPublisherHash property value. The Identity Publisher Hash. | def identity_publisher_hash
return @identity_publisher_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_publisher_hash=(value)\n @identity_publisher_hash = value\n end",
"def subscriber_hash(email)\n # Simple hash of the email address.\n Digest::MD5.hexdigest(email)\n end",
"def publisher_id\n @@publisher_id\n end... | [
"0.7262022",
"0.62221134",
"0.61998796",
"0.6110589",
"0.59888893",
"0.59888893",
"0.59888893",
"0.59888893",
"0.594417",
"0.57995397",
"0.5771863",
"0.5764781",
"0.5687812",
"0.56190515",
"0.5553423",
"0.5553423",
"0.5543121",
"0.554274",
"0.553105",
"0.55155444",
"0.5499481... | 0.7749287 | 0 |
Sets the identityPublisherHash property value. The Identity Publisher Hash. | def identity_publisher_hash=(value)
@identity_publisher_hash = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_publisher_hash\n return @identity_publisher_hash\n end",
"def publisher_id=(pub_id)\n @@publisher_id = pub_id\n end",
"def publisher=(value)\n @publisher = value\n end",
"def publisher=(value)\n @publisher = value\n ... | [
"0.641728",
"0.61349046",
"0.5713129",
"0.5713129",
"0.5713129",
"0.5713129",
"0.53256893",
"0.5321547",
"0.5266213",
"0.5255182",
"0.5234663",
"0.5234663",
"0.5196565",
"0.51780987",
"0.5134948",
"0.51230896",
"0.5120138",
"0.5120138",
"0.5106773",
"0.5087401",
"0.5058881",
... | 0.8067959 | 0 |
Gets the identityResourceIdentifier property value. The Identity Resource Identifier. | def identity_resource_identifier
return @identity_resource_identifier
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_resource_identifier=(value)\n @identity_resource_identifier = value\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resour... | [
"0.79088676",
"0.67911166",
"0.67911166",
"0.67911166",
"0.6789129",
"0.6429631",
"0.6417267",
"0.6417267",
"0.6417267",
"0.6131746",
"0.6023177",
"0.5972557",
"0.58868754",
"0.58250946",
"0.579673",
"0.57639194",
"0.5756805",
"0.57225823",
"0.5676673",
"0.56735003",
"0.56734... | 0.85948515 | 0 |
Sets the identityResourceIdentifier property value. The Identity Resource Identifier. | def identity_resource_identifier=(value)
@identity_resource_identifier = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id(resource_id)\n Apipie.set_resource_id(@c... | [
"0.70811224",
"0.70811224",
"0.70811224",
"0.6454386",
"0.63288367",
"0.6233248",
"0.58926857",
"0.57745105",
"0.57745105",
"0.574675",
"0.5626062",
"0.5456853",
"0.53346324",
"0.53346324",
"0.53346324",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314172",
"0.5314... | 0.84304595 | 0 |
Gets the identityVersion property value. The identity version. | def identity_version
return @identity_version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def identity_version=(value)\n @identity_version = value\n end",
"def version_id\n return @version_id\n end",
"def version_number\n return @version_number\n end",
"def version_number\n @version\n end",
"def version\n ... | [
"0.8012434",
"0.7202184",
"0.71312004",
"0.70702577",
"0.67199373",
"0.6626703",
"0.6626703",
"0.66263837",
"0.66263837",
"0.66263837",
"0.66263837",
"0.66263837",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
"0.65953803",
... | 0.86396176 | 0 |
Sets the identityVersion property value. The identity version. | def identity_version=(value)
@identity_version = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version_id=(value)\n @version_id = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def v... | [
"0.69507086",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6835644",
"0.6761322",
"0.6648685",
"0.6618371",
"0.6590801",
"0.65704435",
"0.6199865",
"0.615906",
"0.6068511",
"0.6020224",
"0.6013223",
"0.6013223",
... | 0.842419 | 0 |
Gets the isBundle property value. Whether or not the app is a bundle. | def is_bundle
return @is_bundle
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bundled?\n $BUNDLE || ENV.key?(\"BUNDLE\")\n end",
"def is_bundle=(value)\n @is_bundle = value\n end",
"def bundle?\n @descriptive_detail.bundle?\n end",
"def bundle_exists?\n File.exists? self.bundle_dir\n end",
"def bundle?\n @product_composition.hum... | [
"0.7860241",
"0.7747696",
"0.71905863",
"0.6793058",
"0.66005206",
"0.65717113",
"0.64848053",
"0.6107878",
"0.6011536",
"0.59816766",
"0.59372455",
"0.5902744",
"0.587771",
"0.5790042",
"0.5768125",
"0.57109594",
"0.57063776",
"0.5587821",
"0.555296",
"0.55318785",
"0.552023... | 0.86101365 | 0 |
Sets the isBundle property value. Whether or not the app is a bundle. | def is_bundle=(value)
@is_bundle = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_bundle\n return @is_bundle\n end",
"def bundled?\n $BUNDLE || ENV.key?(\"BUNDLE\")\n end",
"def set_bundle\n @bundle = Bundle.find(params[:id])\n end",
"def bundle()\n merge(notbundle: 'true')\n end",
"def bundle?\n @descriptive_detail.bundl... | [
"0.7101724",
"0.6549954",
"0.6123661",
"0.5884388",
"0.5600334",
"0.55814475",
"0.5572675",
"0.548277",
"0.5374566",
"0.537286",
"0.5306937",
"0.5306665",
"0.50813246",
"0.5070391",
"0.50437355",
"0.5022118",
"0.4991801",
"0.4991801",
"0.49761167",
"0.4884269",
"0.48604423",
... | 0.8297566 | 0 |
Gets the minimumSupportedOperatingSystem property value. The minimum operating system required for a Windows mobile app. | def minimum_supported_operating_system
return @minimum_supported_operating_system
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimum_supported_operating_system=(value)\n @minimum_supported_operating_system = value\n end",
"def os_minimum_version\n return @os_minimum_version\n end",
"def os_minimum_version\n return @os_minimum_version\n end",
"def ope... | [
"0.7969517",
"0.71976584",
"0.71976584",
"0.6334428",
"0.6334428",
"0.63101476",
"0.6273507",
"0.6273507",
"0.6257329",
"0.6246654",
"0.62266916",
"0.6124294",
"0.61151314",
"0.61151314",
"0.6106756",
"0.59954673",
"0.59906447",
"0.59522414",
"0.5950611",
"0.59461236",
"0.592... | 0.8513557 | 0 |
Sets the minimumSupportedOperatingSystem property value. The minimum operating system required for a Windows mobile app. | def minimum_supported_operating_system=(value)
@minimum_supported_operating_system = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def minimum_supported_operating_system\n return @minimum_supported_operating_system\n end",
"def os_minimum_version=(value)\n @os_minimum_version = value\n end",
"def os_minimum_version=(value)\n @os_minimum_version = value\n end",
... | [
"0.71812075",
"0.68334085",
"0.68334085",
"0.587645",
"0.587645",
"0.5864988",
"0.5864988",
"0.55708003",
"0.55708003",
"0.55708003",
"0.5568457",
"0.52787787",
"0.5254271",
"0.5254271",
"0.5193076",
"0.5176393",
"0.5176393",
"0.50513387",
"0.5029917",
"0.49848616",
"0.496970... | 0.8417662 | 0 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_enum_value("applicableArchitectures", @applicable_architectures)
writer.write_enum_value("applicableDeviceTypes", @applicable_device_types)
writer.write_collection_of_object_values("committedContainedApps", @committed_contained_apps)
writer.write_string_value("identityName", @identity_name)
writer.write_string_value("identityPublisherHash", @identity_publisher_hash)
writer.write_string_value("identityResourceIdentifier", @identity_resource_identifier)
writer.write_string_value("identityVersion", @identity_version)
writer.write_boolean_value("isBundle", @is_bundle)
writer.write_object_value("minimumSupportedOperatingSystem", @minimum_supported_operating_system)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964"... | 0.0 | -1 |
the old profile page had review filter on the main profile page. These are the params used to come across in the query string. Here I'm redirecting to the new profile reviews page, WITHOUT those parameters...I am not attempting to translate the old param values in the the new ones. | def redirect_old_review_filters
old_params = [:min_rating, :N, :Ne, :Nf, :Nrc, :Ns, :page, :sort]
if old_params.inject(false) { |memo, key| memo |= params.has_key?(key) }
permanent_redirect_to :profile_mode => @profile_mode,
:screen_name => params[:screen_name],
:controller => 'profile_reviews', :action => 'index', :N => params[:N]
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_review_status # :norobots:\n pass_query_params\n id = params[:id].to_s\n desc = NameDescription.find(id)\n if is_reviewer?\n desc.update_review_status(params[:value])\n end\n redirect_to(:action => 'show_name', :id => desc.name_id,\n :params => query_params)\n end",
... | [
"0.61475843",
"0.6129108",
"0.6120188",
"0.60081196",
"0.60081196",
"0.59394747",
"0.5898609",
"0.5879598",
"0.58793443",
"0.5776228",
"0.577145",
"0.5763739",
"0.57447124",
"0.5743676",
"0.5727358",
"0.5713074",
"0.5713074",
"0.5712933",
"0.56751096",
"0.5644288",
"0.5622947... | 0.8074964 | 0 |
params.require(:venue).permit(:name, :street, :city, :state, :country, :latitude, :longitude, :popularity_rating) | def venue_params
params.require(:venue).permit(:name, :street, :city, :state, :country, :latitude, :longitude, :popularity_rating)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def venue_params\n params.require(:venue).permit(:name, :address, :longitude, :latitude, :neighborhood_id, :owner, :menu_address, :phone_number, :genre, :urbanist, :open_table_id,:spr_rank)\n end",
"def venue_params\n params.require(:venue).permit(:name, :street, :zip, :city)\n end",
"def venue_par... | [
"0.8762258",
"0.8758704",
"0.8664499",
"0.85965633",
"0.8529291",
"0.8449578",
"0.82946223",
"0.8227379",
"0.81355715",
"0.8134661",
"0.7883928",
"0.7754324",
"0.77355796",
"0.7674995",
"0.7602287",
"0.7564811",
"0.75022167",
"0.7477081",
"0.74583536",
"0.7436551",
"0.7428146... | 0.9377816 | 0 |
Initialiser. Cells are the cells in the object Children are other objects | def initialize(cells)
@cells = cells
@children = []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize\n\t\t@cells = []\n\n\t\t9.times { @cells << Cell.new }\t\n\tend",
"def initialize(cell)\n super(cell)\n end",
"def initialize(cell, tentCell)\n super(cell, tentCell)\n end",
"def initialize\n @cells = reset!\n end",
"def initialize\n\t\t@width = 5\n\t\t@height = 5\n\t\t@cells = [... | [
"0.7319839",
"0.7152518",
"0.6953881",
"0.6845339",
"0.6780871",
"0.67352074",
"0.6710445",
"0.6701461",
"0.66248107",
"0.65675783",
"0.6563345",
"0.6559393",
"0.65571487",
"0.6544548",
"0.65354687",
"0.6524417",
"0.65029985",
"0.6488611",
"0.63776654",
"0.63671166",
"0.63579... | 0.7936095 | 0 |
For every `redirect_from` entry, generate a redirect page | def generate_redirect_from(doc)
doc.redirect_from.each do |path|
doc.site.pages << RedirectPage.redirect_from(doc, path)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def redirects; end",
"def generate(site)\n site.pages.select{|x| x.data.key? 'redirects' }.each do |p|\n p.data['redirects'].each do |r|\n redirect = RedirectPage.new(site, site.source, r, p.url)\n redirect.render(site.layouts, site.site_payload)\n redirect.write(site.dest)... | [
"0.6977429",
"0.6628007",
"0.6411655",
"0.6241093",
"0.61140233",
"0.61140233",
"0.61088634",
"0.60609436",
"0.60413414",
"0.60293114",
"0.59945375",
"0.5988351",
"0.5974561",
"0.5970313",
"0.5949967",
"0.59362626",
"0.5935935",
"0.5901778",
"0.5893381",
"0.58883876",
"0.5860... | 0.7692713 | 0 |
Write the code for artist_name and artist_name= so that an Artist can be retrieved from, and associated with, a Song instance | def artist_name
if self.name
self.name
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def artist\n @artist #tells song its artist name\n end",
"def set_song_and_artist\n\t\t@artist = Artist.find(params[:artist_id])\n\t @song = Song.find(params[:id])\n\tend",
"def artist_name\n self.artist.name\n end",
"def artist_name\n self.artist.name\n end",
"def artist_name\n self.artist... | [
"0.7586012",
"0.741601",
"0.74090403",
"0.74090403",
"0.74090403",
"0.74090403",
"0.7334526",
"0.7333408",
"0.732647",
"0.7317326",
"0.72852516",
"0.72826177",
"0.72744125",
"0.72744125",
"0.72744125",
"0.72668594",
"0.72484213",
"0.72325116",
"0.7196208",
"0.71789896",
"0.71... | 0.70510495 | 29 |
Email Action (this will render the appropriate view on GET requests and process the form and send the email on POST requests) | def email
@searches = current_user.searches
if request.post? and validate_email_params
# only send searches that were checked in the email form
@searches = Array.new
@comments = Hash.new
current_user.searches.each do |s|
if params[(s.id).to_s] == "1"
@searches << s
@comments[s.id] = params[("notes_" + (s.id).to_s)]
end
end
email = SearchMailer.email_search(@searches, @comments, {:to => params[:to], :message => params[:message]}, url_options)
email.deliver
flash[:success] = I18n.t("blacklight.email.success")
respond_to do |format|
format.html { redirect_to catalog_path(params['id']) }
format.js { render 'email_sent' }
end and return
end
respond_to do |format|
format.html
format.js { render :layout => false }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def emailform\n end",
"def emailform\n end",
"def email\n\n email = email_params\n ContactMailer.status_email(email[:email], email[:subject], email[:body]).deliver\n render nothing: true, status: 200\n\n # put logic for sending an email\n # TODO: send the email here.\n end",
"def email\n\t\te... | [
"0.7690707",
"0.7690707",
"0.7319876",
"0.7173991",
"0.7116096",
"0.6907408",
"0.6902524",
"0.6847956",
"0.67486763",
"0.6741648",
"0.66759884",
"0.6669743",
"0.6640802",
"0.66180766",
"0.65459716",
"0.65459716",
"0.6534295",
"0.6524143",
"0.6510644",
"0.648438",
"0.64535683"... | 0.71540964 | 4 |
Sends the request to be processed | def show
Marmite::Services::ShowEndpoint.new(
controller: self, find_by_conditions: show_params
).call
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_request; end",
"def send_request\n @response = _send_request\n end",
"def send_request(req); end",
"def send\n http = EM::HttpRequest.new(@uri).post(@request_options)\n\n http.callback do\n process(http.response)\n end\n\n http.errback do\n fail(http.error)\... | [
"0.78337497",
"0.7794403",
"0.7487524",
"0.7373616",
"0.7163445",
"0.7137458",
"0.7057114",
"0.6938887",
"0.6921218",
"0.6884615",
"0.6871176",
"0.68633646",
"0.6840231",
"0.68096685",
"0.6784899",
"0.6779854",
"0.677738",
"0.6767688",
"0.6747331",
"0.6704803",
"0.66950464",
... | 0.0 | -1 |
Responds to request with show_ok status and resource | def show_ok(resource:)
render json: resource, status: :ok, include: show_includes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_ok\n controller.show_ok(resource: resource)\n end",
"def show\n respond_with client, resource\n end",
"def show\n render status: :ok\n end",
"def status_ok(resource)\n respond_to do |format|\n format.json { render json: resource.to_json, status: :ok, content_type: 'applic... | [
"0.75861204",
"0.7107819",
"0.70973635",
"0.69898677",
"0.69344246",
"0.6845681",
"0.67787755",
"0.6707929",
"0.6670621",
"0.6666087",
"0.6666087",
"0.66628885",
"0.66368407",
"0.6619437",
"0.65775377",
"0.6562515",
"0.653197",
"0.6495018",
"0.6492195",
"0.64832294",
"0.64468... | 0.7460887 | 1 |
Responds to request with show_not_found status | def show_not_found
render_json_error(code: :show_not_found, status: :not_found)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def not_found\n respond_with 404\n end",
"def not_found\n render status: :not_found\n end",
"def not_found\n render json: nil, status: :not_found\n end",
"def not_found\n respond_with 404\n end",
"def not_found\n render nothing: true, status: 404\n end",
"def r... | [
"0.87444544",
"0.86586356",
"0.8517404",
"0.8498333",
"0.84431237",
"0.83946866",
"0.83327377",
"0.83072567",
"0.83072567",
"0.83072567",
"0.8283587",
"0.81711495",
"0.8161163",
"0.8159651",
"0.8148798",
"0.8136897",
"0.8128108",
"0.8109985",
"0.8108956",
"0.8081026",
"0.8076... | 0.84642595 | 4 |
def begin_of_association_chain current_user end | def index
redirect_to root_path unless session_logged_in?
@tours = Tour.accessible_by(current_ability, :update)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def begin_of_association_chain\n current_account\n end",
"def begin_of_association_chain\n self.action_name != 'index' ? current_user : super\n end",
"def begin_of_association_chain\n # raise self.action_name.inspect\n case self.action_name\n when 'index', 'show' : super\n ... | [
"0.8182152",
"0.7887554",
"0.7854218",
"0.73525923",
"0.6838905",
"0.6319382",
"0.62200934",
"0.62200934",
"0.6209075",
"0.61923635",
"0.6145919",
"0.6026599",
"0.60245365",
"0.60021377",
"0.59820646",
"0.597158",
"0.5949079",
"0.58941394",
"0.58800745",
"0.5863176",
"0.58445... | 0.0 | -1 |
TODO: Add pagination for large data TODO: What happens with failed dealers? INFO: For current requirement only the first address is required | def load_dealers
fetch_dealers.each do |row|
data = parse_dealer_data(row)
dealer = Dealer.where(name: data['name']).first_or_initialize
dealer.attributes = data
log("dealer import failed: #{dealer.errors.full_messages.join(', ')}") unless dealer.save
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_address_details\n @address_summary = AddressSummary.new\n # Carry forward the default country otherwise it gets lost\n @address_detail = Address.find(find_params[:search_results], params[:address][:default_country])\n if @address_detail.nil?\n @address_summary.errors.add(:postcode, :no_ad... | [
"0.6580404",
"0.6275801",
"0.62286896",
"0.62041205",
"0.61447453",
"0.6120963",
"0.6088918",
"0.5984164",
"0.5981787",
"0.59658325",
"0.596367",
"0.5960186",
"0.59379095",
"0.59318125",
"0.58989215",
"0.58222353",
"0.5803938",
"0.5803726",
"0.5800973",
"0.5797129",
"0.578015... | 0.0 | -1 |
insert new node at far left and swap up | def insert(root, node)
if node.nil?
nil
elsif root.nil?
self.root = node
else
go_to_bottom(nil,node)
parent_compare(node, node.parent)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert_left(obj)\n self.left, self.right = obj.left, obj\n reinsert_horizontal\n end",
"def insert_into_merged_list_and_shift_left(bst_node, head)\n puts \"appending #{bst_node.value} to \" + (head.nil? ? \"nil\" : \"#{head.value}\") if $debug\n bst_node.right = head\n head = bst_node\n bst_... | [
"0.7448322",
"0.7152601",
"0.71071416",
"0.70332634",
"0.7007829",
"0.69527614",
"0.68152666",
"0.68092024",
"0.6799836",
"0.67880434",
"0.67690784",
"0.6729478",
"0.6717278",
"0.66991746",
"0.6688645",
"0.66832846",
"0.66471803",
"0.66450846",
"0.66450846",
"0.66450846",
"0.... | 0.62356776 | 62 |
send added element to the bottomleftmost open slot | def go_to_bottom(nodes=nil, target)
next_row = []
if nodes.nil?
nodes = [self.root]
end
nodes.each do |node|
if node.left.nil?
node.left = target
node.left.parent = node
return
elsif node.right.nil?
node.right = target
node.right.parent = node
return
else
next_row << node.left
next_row << node.right
end
end
if next_row.count > 0
go_to_bottom(next_row, target)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(child, left, right, top, bottom, &block)\n super(child, false, &block)\n\n gtk_instance.attach(child.gtk_instance, left, right, top, bottom)\n end",
"def add_a_message\n @browser.span(:id=>\"newsharecontent_message_arrow\").fire_event('onclick')\n end",
"def add_button_clicked\n\t\t\n\... | [
"0.5934024",
"0.58491117",
"0.57798165",
"0.5734739",
"0.5547285",
"0.55358326",
"0.54540944",
"0.54123014",
"0.5362697",
"0.5359288",
"0.5346858",
"0.5331006",
"0.5304069",
"0.52547014",
"0.52547014",
"0.5254105",
"0.5228458",
"0.51974076",
"0.51938343",
"0.5189093",
"0.5187... | 0.0 | -1 |
compare parent and child, recursively checking up the tree | def parent_compare(child, parent)
unless parent.nil?
if child.rating < parent.rating
swap(child, parent)
parent_compare(child, child.parent)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parent_compare(child, parent)\n\t\tunless parent.nil?\n\t\t\tif child.value < parent.value\n\t\t\t\tswap(child, parent)\n\t\t\t\tparent_compare(child, child.parent)\n\t\t\tend \n\t\tend\n\tend",
"def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\... | [
"0.7698191",
"0.76954085",
"0.73967916",
"0.6939286",
"0.6810775",
"0.6622524",
"0.64040846",
"0.64040846",
"0.6366886",
"0.6350879",
"0.632821",
"0.6301763",
"0.6298614",
"0.62883073",
"0.6266008",
"0.62332404",
"0.6211303",
"0.61859876",
"0.6176367",
"0.611656",
"0.6078743"... | 0.72217125 | 3 |
compare parent to both left, right kids, recursively checking down the tree | def child_compare(parent)
unless parent.nil?
if parent.left.nil? && parent.right.nil?
nil
elsif parent.right.nil?
if parent.rating > parent.left.rating
swap(parent.left, parent)
end
else
if parent.rating > parent.left.rating || parent.rating > parent.right.rating
if parent.left.rating < parent.right.rating
swap(parent.left, parent)
child_compare(parent.left)
else
swap(parent.right, parent)
child_compare(parent.right)
end
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.value > parent.left.value\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.value > parent.left.value || parent.value >... | [
"0.66738623",
"0.6379302",
"0.6372852",
"0.62830114",
"0.6165596",
"0.61002564",
"0.6074607",
"0.6064618",
"0.60307646",
"0.600181",
"0.59663904",
"0.5957884",
"0.5940037",
"0.5921143",
"0.5893615",
"0.589213",
"0.5883418",
"0.5883418",
"0.588056",
"0.58666825",
"0.581503",
... | 0.6884053 | 0 |
swap a parent and child node | def swap(child, parent)
if child.rating < parent.rating
temp_left = child.left
temp_right = child.right
child.parent = parent.parent
parent.parent = child
unless parent.left.nil?
if parent.left == child
child.left = parent
else
child.left = parent.left
end
end
unless parent.right.nil?
if parent.right == child
child.right = parent
else
child.right = parent.right
end
end
parent.left = temp_left
parent.right = temp_right
if child.parent.nil?
self.root = child
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def swap_children\r\n tempChild = leftChild\r\n self.leftChild= rightChild\r\n self.rightChild= tempChild\r\n end",
"def swap_parent_reference_to_node(parent, first_node, second_node)\n unless parent.nil?\n kids = parent.kids\n index = kids.index first_node\n kids[index] = sec... | [
"0.7920206",
"0.7836606",
"0.7603572",
"0.7519623",
"0.7362544",
"0.71404225",
"0.6972435",
"0.69414866",
"0.69414866",
"0.69414866",
"0.6917175",
"0.69125867",
"0.68733317",
"0.6865146",
"0.6836016",
"0.68043",
"0.6798682",
"0.6732176",
"0.6732176",
"0.66964984",
"0.66964984... | 0.77118224 | 2 |
locate the node, swap in bottomrightmostnode (brmn) | def delete(root, data)
target = find(root, data) unless data.nil?
unless target.nil?
brmn = find_bottom_right_most_node(root)
if brmn != target
target.title = brmn.title
target.rating = brmn.rating
# remove link to brmn from former parent
unless brmn.parent.nil?
if brmn.parent.right.title == brmn.title
brmn.parent.right = nil
else
brmn.parent.left = nil
end
brmn.parent = nil
end
unless target.parent.nil?
parent_compare(target, target.parent)
end
child_compare(target)
else
self.root = nil
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def swap_node_position(higher_node, lower_node)\n temp_element_title = higher_node.title\n temp_element_rating = higher_node.rating\n higher_node.title = lower_node.title\n higher_node.rating = lower_node.rating\n lower_node.title = temp_element_title\n lower_node.rating = temp_element_rating\n ... | [
"0.6861301",
"0.6621641",
"0.63294697",
"0.62387097",
"0.620867",
"0.6160486",
"0.61226386",
"0.60626054",
"0.60581636",
"0.60091597",
"0.6008396",
"0.59560114",
"0.5921214",
"0.5921214",
"0.5921214",
"0.5899254",
"0.58901775",
"0.58901775",
"0.5870264",
"0.5817148",
"0.57996... | 0.0 | -1 |
stack + api_clients + commits | + commit_deployments | | + statuses | + statuses + github_hooks + hooks + merge_requests + tasks + chunks | def perform(stack)
Shipit::ApiClient.where(stack_id: stack.id).delete_all
commits_ids = Shipit::Commit.where(stack_id: stack.id).pluck(:id)
tasks_ids = Shipit::Task.where(stack_id: stack.id).pluck(:id)
commit_deployments_ids = Shipit::CommitDeployment.where(task_id: tasks_ids).pluck(:id)
Shipit::CommitDeploymentStatus.where(commit_deployment_id: commit_deployments_ids).delete_all
Shipit::CommitDeployment.where(id: commit_deployments_ids).delete_all
Shipit::Status.where(commit_id: commits_ids).delete_all
Shipit::Commit.where(id: commits_ids).delete_all
Shipit::GithubHook.where(stack_id: stack.id).destroy_all
Shipit::Hook.where(stack_id: stack.id).delete_all
Shipit::MergeRequest.where(stack_id: stack.id).delete_all
tasks_ids.each_slice(100) do |ids|
Shipit::OutputChunk.where(task_id: ids).delete_all
Shipit::Task.where(id: ids).delete_all
end
stack.destroy!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def any_status_hook\n repo = params[:name]\n link = \"https://github.com/#{repo}\"\n sha = params[:sha]\n state = params[:state]\n context = params[:context]\n description = params[:description]\n target = params[:target_url]\n\n return if state == 'pending' || (state == 'success' && contex... | [
"0.61647576",
"0.58703977",
"0.584306",
"0.57866275",
"0.5592362",
"0.55889255",
"0.5503179",
"0.54864395",
"0.5481213",
"0.547735",
"0.54599607",
"0.5425859",
"0.5423382",
"0.5401531",
"0.5398338",
"0.53948724",
"0.5391921",
"0.53889024",
"0.5387526",
"0.5312344",
"0.5284636... | 0.0 | -1 |
Returns the AWS SQS Client | def sqs
@sqs ||= Aws::SQS::Client.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aws_sns_client\n return @aws_sns_client if @aws_sns_client\n\n @aws_sns_client = Aws::SNS::Client.new(region: self.class.sms_aws_region)\n end",
"def sqs\n @sqs ||= Chore::Queues::SQS.sqs_client\n end",
"def new_sqs_client type\n ::AWS::SQS.new aws_identity(type)\n ... | [
"0.76662487",
"0.73675054",
"0.72776425",
"0.69445866",
"0.6934433",
"0.6890007",
"0.6863533",
"0.6842974",
"0.67306465",
"0.6724365",
"0.6619779",
"0.6612059",
"0.6589289",
"0.6540269",
"0.6493663",
"0.62928706",
"0.62598026",
"0.6164521",
"0.6153829",
"0.60942745",
"0.60536... | 0.82289195 | 0 |
Returns the AWS SNS Client | def sns
@sns ||= Aws::SNS::Client.new(
http_idle_timeout: @sns_keep_alive_timeout,
http_continue_timeout: @sns_continue_timeout
)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aws_sns_client\n return @aws_sns_client if @aws_sns_client\n\n @aws_sns_client = Aws::SNS::Client.new(region: self.class.sms_aws_region)\n end",
"def loadSNSClient\n @snsClient = Aws::SNS::Client.new(access_key_id: ENV['h_aws_access_key_id'],\n secret_acce... | [
"0.8669044",
"0.73946285",
"0.7279516",
"0.6532922",
"0.649756",
"0.6448559",
"0.64463377",
"0.6383555",
"0.6354256",
"0.6325573",
"0.63059914",
"0.62951267",
"0.6238947",
"0.62069494",
"0.62035877",
"0.6196929",
"0.6169629",
"0.6125074",
"0.6058878",
"0.60009885",
"0.5926739... | 0.8201545 | 1 |
Returns the URL of the queue. The queue will be created when it does | def get_queue_url(queue)
_queue_name = EventQ.create_queue_name(queue.name)
response= sqs.get_queue_url(
queue_name: aws_safe_name(_queue_name),
queue_owner_aws_account_id: @aws_account,
)
return response.queue_url
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_queue_url(job)\n sqs.create_queue(queue_name: job.queue_name)[:queue_url]\n end",
"def q_url\n return @q_url if @q_url\n @q_url = @sqs_queue.url\n @q_url\n end",
"def url_for queue_name, options = {}\n client_opts = {}\n client_opts[:queue_name] = queue_name\n cli... | [
"0.8356241",
"0.7993868",
"0.78340125",
"0.7714697",
"0.7523829",
"0.7433941",
"0.6970222",
"0.6856534",
"0.68550134",
"0.6828697",
"0.6806844",
"0.68064815",
"0.6769797",
"0.6768849",
"0.6765052",
"0.67594606",
"0.6718448",
"0.66820514",
"0.66189307",
"0.6608374",
"0.6574295... | 0.7745954 | 3 |
Submitted by Tamiko Terada METHOD to change a string into a float or integer | def numberfy(input_string)
if input_string.include?(".")
input_string.to_f
else input_string.to_i
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _floatify(str, increment = true)\n if (( inf = str.to_s.match(/^([+-])?inf/i) ))\n (inf[1] == \"-\" ? -1.0 : 1.0) / 0.0\n elsif (( number = str.to_s.match(/^\\((-?\\d+)/i) ))\n number[1].to_i + (increment ? 1 : -1)\n else\n Float str.to_s\n end\n rescue ArgumentError... | [
"0.7880569",
"0.76887447",
"0.7662379",
"0.74015605",
"0.7341799",
"0.7297155",
"0.7295221",
"0.72076696",
"0.71883386",
"0.71503234",
"0.7052117",
"0.7029434",
"0.7016831",
"0.69424295",
"0.6936431",
"0.6873007",
"0.682689",
"0.6819563",
"0.6817027",
"0.681161",
"0.6742396",... | 0.7362033 | 4 |
METHOD to validate user operator | def valid_operator(user_operator)
possible_operators = [ "add", "+", "subtract", "-", "multiply", "x", "*", "divide", "/" ]
possible_operators.include?(user_operator)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_operator\n if device_limit.to_i < 0\n errors.add(:device_limit, 'Device limit count is invalid')\n return\n end\n if event_limit.to_i < 0\n errors.add(:event_limit, 'Event limit count is invalid')\n return\n end\n if discount.to_i < 0 or discount.to_i > 100\n er... | [
"0.71468246",
"0.68399924",
"0.6823085",
"0.6731083",
"0.65548277",
"0.65451396",
"0.65140384",
"0.6379725",
"0.6262707",
"0.6242223",
"0.6209113",
"0.6187763",
"0.61659664",
"0.61523",
"0.6121679",
"0.60405684",
"0.5977044",
"0.5974359",
"0.5951384",
"0.5947278",
"0.5944696"... | 0.7872635 | 0 |
METHOD to calculate values based on allowed operators | def calculator_method(operator, number_1, number_2)
case operator
when "add"
total = number_1 + number_2
when "+"
total = number_1 + number_2
when "subtract"
total = number_1 - number_2
when "-"
total = number_1 - number_2
when "multiply"
total = number_1 * number_2
when "x"
total = number_1 * number_2
when "*"
total = number_1 * number_2
when "divide"
total = number_1.to_f / number_2.to_f
when "/"
total = number_1.to_f / number_2.to_f
end
return total
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate(starting_value, operations)\n sum = starting_value\n operations.each do |ops|\n operator = ops[0]\n operand = ops[1]\n \n case operator\n when '+'\n sum += operand \n when '-'\n sum -= operand\n when '*'\n sum *= operand\n when '/'\n sum /... | [
"0.7253338",
"0.7205134",
"0.7165941",
"0.71519744",
"0.70692754",
"0.7048209",
"0.7030856",
"0.68696004",
"0.68678373",
"0.6843849",
"0.683048",
"0.67676485",
"0.676318",
"0.6742941",
"0.674119",
"0.6716485",
"0.6698805",
"0.6693024",
"0.667439",
"0.66666836",
"0.66640687",
... | 0.6631697 | 22 |
METHOD to check if a string is a valid number | def can_be_number(string)
forced_as_f = string.to_f # force string to be a float
forced_as_i = string.to_i # force string to be an integer
return string == forced_as_f.to_s || string == forced_as_i.to_s # see if either of the forced strings equal the original
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_number?(number_string)\n number_string.to_i.to_s == number_string\n end",
"def is_number?(string)\n true if Integer(string) && Integer(string) >= 0 rescue false\n end",
"def valid_number?(number_string)\n number_string.to_i.to_s == number_string\nend",
"def valid_number?(number_string)\n ... | [
"0.8375915",
"0.8356822",
"0.8346799",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"0.8339616",
"... | 0.0 | -1 |
In integer math, there are no fractions. So if you are using integer literals, you will be using integer math, which means, for example... 1 / 2 => 0 In floating point math, there are fractions. So... 1.0 / 2.0 => 0.5 write your code here | def ftoc (tempin)
if tempin==32 then
0
elsif tempin==212 then
100
else
fraction = 5.0/9.0
tempout = (tempin -32) *fraction
puts "temp output is: "+tempout.to_s
tempout
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_division_by_zero; 5 / 0; end",
"def do_division_by_zero; 5 / 0; end",
"def do_division_by_zero; 5 / 0; end",
"def /(other)\n to_i / other.to_i\n end",
"def accurate_division(int, int_two)\n int = int.to_f\n int_two = int_two\n q = int / int_two\n return q.round(3)\nend",
"def division num1... | [
"0.71012163",
"0.71012163",
"0.71012163",
"0.6869738",
"0.6840164",
"0.67509156",
"0.6730201",
"0.6719234",
"0.6633448",
"0.6600493",
"0.6586154",
"0.65727",
"0.65411144",
"0.65374625",
"0.6472743",
"0.644004",
"0.64253",
"0.64150524",
"0.6413298",
"0.6397246",
"0.6368068",
... | 0.0 | -1 |
Configures the arguments for the command | def set_options(opts)
@total_news = 25
opts.version = EndiFeed::VERSION
opts.banner = <<MSG
Usage: endifeed [options] [arguments]
Description:
EndiFeed, get the latest news from endi.com / El Nuevo Dia Newspaper.
Options:
MSG
opts.set_program_name 'EndiFeed'
opts.on('-n [total]', Integer, '--news', 'total of news to fetch') do |total|
@total_news = total
end
opts.on_tail('-v', '--version', 'display the version of EndiFeed') do
puts opts.version
exit
end
opts.on_tail('-h', '--help', 'print this help') do
puts opts.help
exit
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_arguments (args)\n end",
"def cmd(options={})\n arguments\n end",
"def parse_arguments\n @command_line_options = {}\n @config.insert 0, '<command_line>', @command_line_options\n\n @options = OptionParser.new do |opts|\n opts.on('-a', '--application STRING', 'set a... | [
"0.6851698",
"0.6839158",
"0.67602855",
"0.6481678",
"0.63648564",
"0.62990767",
"0.62857676",
"0.6284748",
"0.62606597",
"0.6217661",
"0.62170756",
"0.6206977",
"0.61065453",
"0.6098411",
"0.6085733",
"0.6068653",
"0.6066898",
"0.6066203",
"0.6052572",
"0.60509276",
"0.60501... | 0.0 | -1 |
Parses the commandline arguments and runs the executable | def parse
opts = OptionParser.new(&method(:set_options))
opts.parse!(@args)
get_news
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _run(argv = [])\n execute(parse_options(argv))\n end",
"def run\n begin\n raise TooManyArgumentsError.new(@arguments) if @arguments.length > 1\n \n print_version if @options.version?\n scan if @options.scan?\n rename_given_file unless @arguments.empty?\n ... | [
"0.73103446",
"0.72798985",
"0.7119934",
"0.7116121",
"0.71020675",
"0.7100862",
"0.7098278",
"0.7090309",
"0.7084803",
"0.70708126",
"0.70662713",
"0.70662713",
"0.70662713",
"0.70662713",
"0.70662713",
"0.70662713",
"0.70338595",
"0.7031114",
"0.69899166",
"0.6985908",
"0.6... | 0.0 | -1 |
one represents the percentage of characters in the string that are lowercase letters, one the percentage of characters that are uppercase letters, and one the percentage of characters that are neither. You may assume that the string will always contain at least one character. | def letter_percentages(str)
percentages = {}
str_length = str.length.to_f
percentages[:lowercase] = ((str.count('a-z') / str_length) * 100).round(1)
percentages[:uppercase] = ((str.count('A-Z') / str_length) * 100).round(1)
percentages[:neither] = 100 - percentages[:lowercase] - percentages[:uppercase]
percentages
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def letter_percentages(str)\n hsh = { lowercase: 0, uppercase: 0, neither: 0 }\n\n str.chars.each do |elem|\n if elem =~ /[a-z]/\n hsh[:lowercase] += 1\n elsif elem =~ /[A-Z]/\n hsh[:uppercase] += 1\n else\n hsh[:neither] += 1\n end\n end\n hsh.transform_values! { |v| format('%.1f', ... | [
"0.72065175",
"0.71859896",
"0.71580446",
"0.7116647",
"0.7090129",
"0.70728993",
"0.7062781",
"0.7021826",
"0.69425255",
"0.69388753",
"0.679409",
"0.6360381",
"0.6263177",
"0.6212856",
"0.62003666",
"0.6186049",
"0.6178867",
"0.60719454",
"0.6059661",
"0.6053832",
"0.601185... | 0.7353618 | 0 |
We skip check when: association isn't a `HasOne` or `HasMany` association has `through` option associated class doesn't exist | def preconditions
%i[
has_one
has_many
].include?(association.macro) && association.through_reflection.nil? && association.klass
rescue StandardError
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unused_preload_associations_for?(klass, association)\n Bullet.collected_unused_eager_association_notifications.select do |notification|\n notification.base_class == klass.to_s && notification.associations.include?(association)\n end.present?\n end",
"def preconditions\n ... | [
"0.70514137",
"0.68552464",
"0.684273",
"0.6782048",
"0.6423",
"0.6415613",
"0.628376",
"0.62309015",
"0.6226636",
"0.6216277",
"0.61456573",
"0.61237365",
"0.61225384",
"0.6017212",
"0.6014498",
"0.60036373",
"0.60026085",
"0.60016125",
"0.5968144",
"0.5964782",
"0.59437877"... | 0.69059914 | 1 |
Table of possible statuses | index | status | | | | | persisted | ok | | missing | fail | | def check
if unique_has_one_association?
check_unique_has_one
else
check_remaining
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @status = Status.last || Status.new(available: \"unavailable\", created_at: DateTime.now)\n end",
"def statuses; end",
"def states\n [\n 'CREATE_IN_PROGRESS',\n 'CREATE_IN_PROGRESS',\n 'CREATE_FAILED',\n 'CREATE_COMPLETE',\n 'ROLLBACK_IN_PROGRESS',\n ... | [
"0.7586717",
"0.72169495",
"0.65638685",
"0.65629876",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6541373",
"0.6508803",
"0.6508803",
"0.6508803",
"0.6508803",
"0.64868414",
"0.64868414",
"0.64801353",
"0.6460762... | 0.0 | -1 |
Boot Firefox, go to loginpage, wait for user to login, and return cookies | def cookies_from_selenium
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "https://min.e-boks.dk/logon.aspx?logontype=oces"
loop do
break if driver.title =~ %r(^e-Boks )
sleep 1
end
cookies = driver.manage.all_cookies
driver.quit
cookies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login \n headless = Headless.new\n headless.start\n \n @browser = Watir::Browser.start LOGIN_URL\n\n # Delete all expired cookies\n delete_cookies_if_expire\n # Use unexpired cookies that match the given email and password\n the_cookies = use_cookies\n\n # Fresh log... | [
"0.73265994",
"0.71788573",
"0.7105065",
"0.67447335",
"0.67420727",
"0.67062974",
"0.6684113",
"0.6642855",
"0.6633111",
"0.65554416",
"0.65110373",
"0.64730686",
"0.64524496",
"0.6445762",
"0.6437271",
"0.643003",
"0.63793963",
"0.63672096",
"0.63672096",
"0.6344731",
"0.63... | 0.7189555 | 1 |
Download all messages on a folder page. | def process_page(folderpage, folderpath, folderpath_hidden, agent)
folderpage.search('//div[@id="messages"]/ul/li/dl').each do |msg|
elm = msg.xpath('.//dt/label/input').first
if elm["name"] != "did"
$stderr.puts "Error. HTML may have changed, and script needs updating."
$stderr.puts reason
exit 1
end
did = elm["value"]
title = msg.xpath('.//dt/label/span').first.content
sender = msg.xpath('.//dd[@class="content"]/span').first.content
links = msg.xpath('.//dd[@class="content"]/ul/li/a')
date = msg.xpath('.//dd[@class="actions"]/span').first.content.split('-').reverse.join('-')
puts " - found Document ID: #{did} from #{date} (\"#{sender} - #{title}\")"
links.each do |link|
doctitle = title
doctitle = "#{title} (#{link["title"]})" if link["title"] != title # Attachment
query_args = link["href"].split('?', 2)[1]
duid = query_args.match(/duid=(\w+)&/).captures.first
url = "https://download.e-boks.dk/privat/download.aspx?#{query_args.gsub('&', '&')}" # don't ask - the link is pseudo-escaped from e-boks's side
file = "#{did}-#{duid}.pdf"
if File.exist? "#{folderpath_hidden}/#{file}"
puts " already downloaded, skipping."
next
else
puts " downloading #{did} (#{doctitle})"
File.open("#{folderpath_hidden}/#{file}", "w") { |f| f.write agent.get_file(url) }
doctitle.gsub!(/\//, ':')
# Determine filename, uniquifying if necessary
filename = "#{date} - #{sender} - #{doctitle}"
i = 2
while File.exist?("#{folderpath}/#{filename}.pdf")
filename = "#{date} - #{sender} - #{doctitle} (#{i})"
i += 1
end
if SYMLINK
File.symlink(".documents/#{file}", "#{folderpath}/#{filename}.pdf")
else
File.link("#{folderpath_hidden}/#{file}", "#{folderpath}/#{filename}.pdf")
end
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_messages(folder, archive_folder, batch_limit, href_regex, reporter=nil, &proc)\n messages = []\n \n if folder == archive_folder # don't descend into archive folder\n log.info \"skipping folder '#{folder}' because it's the archive folder\"\n return messages\n ... | [
"0.6543573",
"0.6444406",
"0.6011316",
"0.5998763",
"0.5922031",
"0.59205854",
"0.59190524",
"0.591469",
"0.588878",
"0.58723277",
"0.5839488",
"0.5838414",
"0.5829674",
"0.5797315",
"0.5721657",
"0.57160383",
"0.5700563",
"0.5658236",
"0.56576896",
"0.56278104",
"0.56202483"... | 0.64967245 | 1 |
GET /userfiles GET /userfiles.json | def index
@userfiles = Userfile.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def userfiles_get(opts = {})\n data, _status_code, _headers = userfiles_get_with_http_info(opts)\n data\n end",
"def userfiles_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserfilesApi.userfiles_get ...'\n end\n ... | [
"0.74386764",
"0.72443485",
"0.70898545",
"0.70364046",
"0.698765",
"0.6909906",
"0.688336",
"0.67609966",
"0.6703759",
"0.6636144",
"0.6633775",
"0.655056",
"0.6527293",
"0.650271",
"0.639786",
"0.63615525",
"0.63561296",
"0.63057435",
"0.6299428",
"0.6281447",
"0.6263779",
... | 0.7202668 | 2 |
GET /userfiles/1 GET /userfiles/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @userfile = Userfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @userfile }\n end\n end",
"def userfiles_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calli... | [
"0.7591945",
"0.7170485",
"0.71091115",
"0.7090143",
"0.7037206",
"0.692273",
"0.67089075",
"0.6702334",
"0.6617328",
"0.65394187",
"0.65242696",
"0.65155894",
"0.6508128",
"0.64658505",
"0.64155704",
"0.64118934",
"0.6386925",
"0.6377543",
"0.6351391",
"0.63489425",
"0.63407... | 0.0 | -1 |
POST /userfiles POST /userfiles.json | def create
@userfile = Userfile.new(userfile_params)
respond_to do |format|
if @userfile.save
format.html { redirect_to @userfile, notice: 'Userfile was successfully created.' }
format.json { render :show, status: :created, location: @userfile }
else
format.html { render :new }
format.json { render json: @userfile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @userfile = Userfile.new(params[:userfile])\n \n\n respond_to do |format|\n if @userfile.save\n format.html {\n render :json => [@userfile.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n f... | [
"0.68337363",
"0.67957366",
"0.6751274",
"0.65877485",
"0.6498353",
"0.64395106",
"0.64334106",
"0.6379515",
"0.63752466",
"0.6269953",
"0.6223095",
"0.61931324",
"0.61877227",
"0.61765426",
"0.6164663",
"0.6108705",
"0.6107378",
"0.6081538",
"0.6059723",
"0.59783614",
"0.596... | 0.66661066 | 3 |
PATCH/PUT /userfiles/1 PATCH/PUT /userfiles/1.json | def update
respond_to do |format|
if @userfile.update(userfile_params)
format.html { redirect_to @userfile, notice: 'Userfile was successfully updated.' }
format.json { render :show, status: :ok, location: @userfile }
else
format.html { render :edit }
format.json { render json: @userfile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @userfile = Userfile.find(params[:id])\n\n respond_to do |format|\n if @userfile.update_attributes(params[:userfile])\n format.html { redirect_to @userfile, notice: 'Userfile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ren... | [
"0.69275093",
"0.6792722",
"0.6777871",
"0.66698885",
"0.66286117",
"0.6622167",
"0.62421894",
"0.6200773",
"0.61399335",
"0.6110376",
"0.6042729",
"0.60135764",
"0.59915954",
"0.5953033",
"0.5946752",
"0.59448725",
"0.59307116",
"0.59276414",
"0.5918037",
"0.5907959",
"0.588... | 0.66609365 | 4 |
DELETE /userfiles/1 DELETE /userfiles/1.json | def destroy
@userfile.destroy
respond_to do |format|
format.html { redirect_to userfiles_url, notice: 'Userfile was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @userfile = Userfile.find(params[:id])\n @userfile.destroy\n\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_file.destroy\n respond_to do |format|\n format.html { redirect_to u... | [
"0.75363964",
"0.7422391",
"0.7362244",
"0.7313111",
"0.72862923",
"0.71802795",
"0.71015304",
"0.70886976",
"0.7021113",
"0.69476765",
"0.6907134",
"0.68676865",
"0.68504906",
"0.6832666",
"0.6823374",
"0.681007",
"0.6796322",
"0.67942774",
"0.6772355",
"0.67696077",
"0.6765... | 0.7451433 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_userfile
@userfile = Userfile.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 userfile_params
params.require(:userfile).permit(:filename, :date_created, :owner, :size)
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.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.0 | -1 |
Initializes the AuthorizationRequest object Params: +client+:: +ProcessOut+ client instance | def initialize(client)
@client = client
@id = ""
@project = nil
@customer = nil
@token = nil
@url = ""
@authorized = false
@name = ""
@currency = ""
@return_url = ""
@cancel_url = ""
@custom = ""
@sandbox = false
@created_at = ""
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorize_request\n if request.path_info.include?('clients')\n @current_user = AuthorizeClientApiRequest.new(request.parameters[:client_uuid], request.headers).call[:user]\n elsif request.path_info.include?('apps')\n @current_device = AuthorizeDeviceApiRequest.new(request.parameters[:device_uui... | [
"0.63436586",
"0.6340879",
"0.6340879",
"0.6235493",
"0.6233758",
"0.61631924",
"0.615039",
"0.6119844",
"0.6118497",
"0.61141825",
"0.6109101",
"0.6103155",
"0.6077492",
"0.60768455",
"0.60768455",
"0.60768455",
"0.60768455",
"0.60768455",
"0.60768455",
"0.60768455",
"0.6076... | 0.61766315 | 5 |
Fills the object with data coming from the API Params: +data+:: +Hash+ of data coming from the API | def fill_with_data(data)
if data.include? "id"
@id = data["id"]
end
if data.include? "project"
@project = data["project"]
end
if data.include? "customer"
@customer = data["customer"]
end
if data.include? "token"
@token = data["token"]
end
if data.include? "url"
@url = data["url"]
end
if data.include? "authorized"
@authorized = data["authorized"]
end
if data.include? "name"
@name = data["name"]
end
if data.include? "currency"
@currency = data["currency"]
end
if data.include? "return_url"
@return_url = data["return_url"]
end
if data.include? "cancel_url"
@cancel_url = data["cancel_url"]
end
if data.include? "custom"
@custom = data["custom"]
end
if data.include? "sandbox"
@sandbox = data["sandbox"]
end
if data.include? "created_at"
@created_at = data["created_at"]
end
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_with_data(data)\n if data.include? \"id\"\n @id = data[\"id\"]\n end\n if data.include? \"project\"\n @project = data[\"project\"]\n end\n if data.include? \"url\"\n @url = data[\"url\"]\n end\n if data.include? \"name\"\n @name = data[\"name\... | [
"0.8257124",
"0.80399275",
"0.79668176",
"0.7144249",
"0.696927",
"0.6897578",
"0.6859003",
"0.675878",
"0.6719612",
"0.67161655",
"0.6714151",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6680818",
"0.6648529",
"0.6644291",
... | 0.82482195 | 1 |
Get the customer linked to the authorization request. Params: +options+:: +Hash+ of options | def customer(options = nil)
request = Request.new(@client)
path = "/authorization-requests/" + CGI.escape(@id) + "/customers"
data = {
}
response = Response.new(request.get(path, data, options))
return_values = Array.new
body = response.body
body = body["customer"]
customer = Customer(self._client)
return_values.push(customer.fill_with_data(body))
return_values[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customerGet(options={})\n assert_valid_keys(options, :customerId)\n assert_keys_exists(options, :customerId)\n execute(:customerGet, options)\n end",
"def customerGet(options={})\n assert_valid_keys(options, :customerId)\n assert_keys_exists(options, :customerId)\n ... | [
"0.7612801",
"0.7612801",
"0.7438744",
"0.71672285",
"0.66973925",
"0.66973925",
"0.66216516",
"0.6543561",
"0.634384",
"0.62946665",
"0.6291615",
"0.6291615",
"0.62848425",
"0.62813157",
"0.6277352",
"0.61704564",
"0.6137568",
"0.6137568",
"0.6133101",
"0.60970366",
"0.60749... | 0.78930485 | 0 |
Create a new authorization request for the given customer ID. Params: +customer_id+:: ID of the customer +options+:: +Hash+ of options | def create(customer_id, options = nil)
request = Request.new(@client)
path = "/authorization-requests"
data = {
"name"=> @name,
"currency"=> @currency,
"return_url"=> @return_url,
"cancel_url"=> @cancel_url,
"custom"=> @custom,
'customer_id'=> customer_id
}
response = Response.new(request.post(path, data, options))
return_values = Array.new
body = response.body
body = body["authorization_request"]
return_values.push(self.fill_with_data(body))
return_values[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customerCreate(options = {})\n assert_valid_keys(options, :accessKey, :testMode, :customerId, :freeParams)\n assert_keys_exists(options, :customerId)\n execute(:customerCreate, options)\n end",
"def customerCreate(options={})\n assert_valid_keys(options, :customerId, :freePar... | [
"0.7060646",
"0.6959064",
"0.6959064",
"0.66844",
"0.65551436",
"0.65031236",
"0.64348817",
"0.6369084",
"0.6367614",
"0.6260787",
"0.62348676",
"0.622578",
"0.6216633",
"0.61589926",
"0.61455727",
"0.61365706",
"0.6065897",
"0.60240555",
"0.600908",
"0.59845006",
"0.59527653... | 0.8213277 | 0 |
Find an authorization request by its ID. Params: +authorization_request_id+:: ID of the authorization request +options+:: +Hash+ of options | def find(authorization_request_id, options = nil)
request = Request.new(@client)
path = "/authorization-requests/" + CGI.escape(authorization_request_id) + ""
data = {
}
response = Response.new(request.get(path, data, options))
return_values = Array.new
body = response.body
body = body["authorization_request"]
obj = AuthorizationRequest.new(@client)
return_values.push(obj.fill_with_data(body))
return_values[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_request_by_id(id)\n @search_requests[id]\n end",
"def find_hash(id, options = {})\n options.assert_valid_keys(:request_level)\n level = find_level(options[:request_level])\n record = self.find(id, :select => level.select_field.join(', '), :include => level.include_field)\n ... | [
"0.5601527",
"0.54645497",
"0.5462754",
"0.5349435",
"0.5208992",
"0.51834184",
"0.5129201",
"0.507622",
"0.5052594",
"0.50379044",
"0.50206035",
"0.49878615",
"0.4969185",
"0.4958501",
"0.49483415",
"0.49384612",
"0.49118584",
"0.48981726",
"0.48665774",
"0.48523477",
"0.481... | 0.81766945 | 0 |
GET /employee/list GET /employee/list.json | def list
employee = params[:employee].blank? ? '' : params[:employee]
staff_id = params[:staff_id].blank? ? '' : params[:staff_id]
employment_status = params[:employment_status].blank? ? 0 : params[:employment_status].to_i
supervisor = params[:supervisor].blank? ? '' : params[:supervisor]
designation = params[:designation].blank? ? 0 : params[:designation].to_i
dept = params[:dept].blank? ? 0 : params[:dept].to_i
pgnum = params[:pgnum].blank? ? 1 : params[:pgnum].to_i
pgsize = params[:pgsize].blank? ? 0 : params[:pgsize].to_i
sortcolumn = params[:sortcolumn].blank? ? EmployeeHelper::DEFAULT_SORT_COLUMN : params[:sortcolumn]
sortdir = params[:sortdir].blank? ? EmployeeHelper::DEFAULT_SORT_DIR : params[:sortdir]
sort = ApplicationHelper::Sort.new(sortcolumn, sortdir)
filters = { :employee => employee,
:staff_id => staff_id,
:employment_status => employment_status,
:supervisor => supervisor,
:designation => designation,
:dept => dept }
if employee.blank? && staff_id.blank? && employment_status == 0 && supervisor.blank? && designation == 0 && dept == 0
@data = EmployeeHelper.get_all(pgnum, pgsize, sort)
else
@data = EmployeeHelper.get_filter_by(filters, pgnum, pgsize, sort)
end
respond_to do |fmt|
fmt.html { render :partial => 'list' }
fmt.json { render :json => @data }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list \n @employees = Employee.find( :all ) # return an array of all Employees\n end",
"def index\n @employees = current_owner.employees.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end",
"def list_customers_ma... | [
"0.8005089",
"0.7503042",
"0.72854495",
"0.7276252",
"0.71964896",
"0.7133813",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.7084595",
"0.70835644",
"0.7079828",
"0.707381",
"0.7066723",
... | 0.6538066 | 51 |
GET /employee/new GET /employee/new.json | def new
@employee = Employee.new
@employee_contact = EmployeeContact.new
@employee_ec_contact = EmployeeEcContact.new
@employee_job = EmployeeJob.new
@employee_salary = EmployeeSalary.new
@employee_qualification = EmployeeQualification.new
@employee_membership = EmployeeMembership.new
@employee_spouse = EmployeeSpouse.new
@form_id = 'add-form'
@users = User.order(:username).all
@supervisors = Employee.all
@designations = Designation.order(:title).all
@employment_statuses = EmploymentStatus.order(:name).all
@job_categories = JobCategory.order(:name).all
@departments = Department.order(:name).all
respond_to do |fmt|
fmt.html { render :partial => 'form' }
fmt.json { render :json => @employee }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end",
"def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee ... | [
"0.81893736",
"0.81893736",
"0.81893736",
"0.7611292",
"0.7589045",
"0.75668526",
"0.7556919",
"0.7536802",
"0.7536802",
"0.75309247",
"0.7503714",
"0.74465406",
"0.7384635",
"0.7384635",
"0.7342567",
"0.7319641",
"0.7319641",
"0.72911775",
"0.72911775",
"0.723434",
"0.722770... | 0.69411194 | 58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.