query stringlengths 7 6.41k | document stringlengths 12 28.8k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|
Swktch on / off marking on the current file or directory. | def toggle_mark
main.toggle_mark current_item
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark!\n\t\t\t\t@marked = true\n\t\t\tend",
"def edl_mark \n send_cmd(\"edl_mark\")\n end",
"def flags; changeset.flags(@path); end",
"def toggle\n if on?\n off\n else\n on\n end\n end",
"def switch_flag\n\t\t@flag = !@flag\n\tend",
"def turn_on\n 'If the thermoc... | [
"0.57452375",
"0.56885517",
"0.5654512",
"0.5560023",
"0.55504096",
"0.5456111",
"0.54291165",
"0.540916",
"0.53911823",
"0.5383848",
"0.5345398",
"0.53184044",
"0.5282469",
"0.5273503",
"0.5237769",
"0.5228008",
"0.5194415",
"0.51476866",
"0.5141669",
"0.51280946",
"0.510652... | 0.5859266 | 0 |
Accept user input, and directly execute it as a Ruby method call to the controller. ==== Parameters +preset_command+ A command that would be displayed at the command line before user input. +default_argument+ A default argument for the command. | def process_command_line(preset_command: nil, default_argument: nil)
prompt = preset_command ? ":#{preset_command} " : ':'
command_line.set_prompt prompt
cmd, *args = command_line.get_command(prompt: prompt, default: default_argument).split(' ')
if cmd && !cmd.empty? && respond_to?(cmd)
ret = self.public_send cmd, *args
clear_command_line
ret
end
rescue Interrupt
clear_command_line
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process(raw_input)\n clean_input, verbosity = sanitize_input raw_input\n\n if clean_input.length > 0\n command = find_command(clean_input) || @modes.current_mode.dynamic_command(clean_input) || @modes.global_mode.command_not_found\n user_args = extract_user_args command, cle... | [
"0.5753752",
"0.5311514",
"0.52760154",
"0.5255442",
"0.5209559",
"0.52045923",
"0.5193481",
"0.5190856",
"0.512851",
"0.5098161",
"0.5068501",
"0.50610435",
"0.505512",
"0.5027248",
"0.50228804",
"0.49825186",
"0.49575496",
"0.4947826",
"0.49460825",
"0.49459407",
"0.4941197... | 0.80562204 | 0 |
convert angle into radian | def to_rad(angle)
angle * Math::PI / 180
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def radian_angle\n @angle * Math::PI / 180.0\n end",
"def deg2rad(angle)\n angle * (Math::PI / 180.0)\n end",
"def rad2rad(rad)\r\n remt(rad, PI2)\r\n end",
"def to_rad\n self * Math::PI / 180\n end",
"def grados2radianes(alfa)\n\t\treturn ((alfa*Math::PI)/180)\n\tend",
"def d... | [
"0.8188487",
"0.81217587",
"0.80756223",
"0.79066086",
"0.7888177",
"0.7733667",
"0.7690215",
"0.7642279",
"0.7455517",
"0.7417873",
"0.7374782",
"0.73061264",
"0.72938514",
"0.72599244",
"0.70856446",
"0.70856446",
"0.70626193",
"0.7046213",
"0.7024125",
"0.70218194",
"0.700... | 0.842279 | 0 |
GET /rows/1 GET /rows/1.xml | def show
@row = Row.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @row }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def row(row_id); get(\"#{link('rows')}/#{row_id}\"); end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @line_items }\n end\n end",
"def show\n @datashows = Datashow.find(params[:id])\n\n respond_to do ... | [
"0.6468013",
"0.58220077",
"0.5796088",
"0.57727957",
"0.5766898",
"0.5766898",
"0.5700217",
"0.5696157",
"0.5677216",
"0.5623952",
"0.56088895",
"0.5596446",
"0.5593269",
"0.5592369",
"0.55885434",
"0.55766624",
"0.5574343",
"0.5570168",
"0.5565081",
"0.5565081",
"0.556031",... | 0.62354 | 1 |
Serves predictions for the buyers | def predictions
raise "Err"
buyer_suggestions = PropertyBuyer.suggest_buyers(params[:str]).select([:id, :name, :image_url]).limit(20)
render json: buyer_suggestions, status: 200
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict\n\t\t@bio = Bio.where(:user_id => current_user.id).last \n\n\t\t# Game_date and @players transformed to JSON and send to API in order to fetch player predictions\n\t\t@game_date = params[:game_date]\n\t\t@players = params[:players] \n\n\t\t# API Returns player predictions\n\t\t\t#first look in databas... | [
"0.66308594",
"0.65091336",
"0.6460537",
"0.6067307",
"0.6058793",
"0.6032062",
"0.5990188",
"0.5979455",
"0.5977669",
"0.59733355",
"0.5946819",
"0.59376407",
"0.58779806",
"0.57795596",
"0.5755886",
"0.5754334",
"0.5754334",
"0.57266814",
"0.57213825",
"0.5720535",
"0.57189... | 0.6594821 | 1 |
buyer tracking history curl XGET H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4OCwiZXhwIjoxNTAzNTEwNzUyfQ.7zo4a8g4MTSTURpU5kfzGbMLVyYN_9dDTKIBvKLSvPo" ' | def tracking_history
buyer = user_valid_for_viewing?('Buyer')
if !buyer.nil?
events = Events::Track.where(buyer_id: buyer.id).order("created_at desc")
results = events.map do |event|
{
udprn: event.udprn,
hash_str: event.hash_str,
type_of_tracking: Events::Track::REVERSE_TRACKING_TYPE_MAP[event.type_of_tracking],
created_at: event.created_at,
tracking_id: event.id
}
end
render json: results, status: 200
else
render json: { message: 'Authorization failed' }, status: 401
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_wechat_access_token\n res = RestClient.get \"https://foodtrust.cn/wx/get-access-token?badge=#{ENV['RDS_AGENT']}\"\n #ap res.code; res.cookies; ap res.headers; ap res.body\n return JSON.parse(res.body)['access_token']\nend",
"def get_json_bitbucket_action header\n header['x-event-key'][0]\n end... | [
"0.5797186",
"0.5700164",
"0.56709397",
"0.5640822",
"0.5569054",
"0.54849124",
"0.5482643",
"0.54783344",
"0.5473061",
"0.5461563",
"0.5458975",
"0.54404914",
"0.5436548",
"0.54051435",
"0.5400448",
"0.5377582",
"0.5368418",
"0.53604376",
"0.5323719",
"0.5309286",
"0.5294859... | 0.6094292 | 0 |
Get tracking stats for a buyer curl XGET H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0MywiZXhwIjoxNDg1NTMzMDQ5fQ.KPpngSimK5_EcdCeVj7rtIiMOtADL0o5NadFJi2Xs4c" " | def tracking_stats
buyer = @current_user
property_tracking_count = Events::Track.where(buyer_id: buyer.id).where(type_of_tracking: Events::Track::TRACKING_TYPE_MAP[:property_tracking]).count
street_tracking_count = Events::Track.where(buyer_id: buyer.id).where(type_of_tracking: Events::Track::TRACKING_TYPE_MAP[:street_tracking]).count
locality_tracking_count = Events::Track.where(buyer_id: buyer.id).where(type_of_tracking: Events::Track::TRACKING_TYPE_MAP[:locality_tracking]).count
stats = {
type: (buyer.is_premium? ? 'Premium' : 'Standard'),
locality_tracking_count_limit: Events::Track::BUYER_LOCALITY_PREMIUM_LIMIT[buyer.is_premium.to_s],
street_tracking_count_limit: Events::Track::BUYER_STREET_PREMIUM_LIMIT[buyer.is_premium.to_s],
property_tracking_count_limit: Events::Track::BUYER_PROPERTY_PREMIUM_LIMIT[buyer.is_premium.to_s],
locality_tracking_count: locality_tracking_count,
property_tracking_count: property_tracking_count,
street_tracking_count: street_tracking_count
}
render json: stats, status: 200
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def usage\n @headers['x-ratelimit-usage']\n end",
"def get_member_brief_stats(custid)\n res = $client.get(\"/membersite/member/CareerStats.do?custid=#{custid}\", $headers)\n start = res.body.index('buf = \\'{\"memberSince\"') + 7\n length = res.body.index(\"MemberProfile.driver = extractJSON\") - ... | [
"0.629435",
"0.62524647",
"0.6112888",
"0.6063808",
"0.5868",
"0.58195317",
"0.57700455",
"0.5760547",
"0.5760547",
"0.5737094",
"0.5737094",
"0.5677557",
"0.5658288",
"0.564761",
"0.56249946",
"0.5598312",
"0.55890745",
"0.55623746",
"0.5556137",
"0.5533361",
"0.5524257",
... | 0.64779234 | 0 |
Get tracking filters and find details of properties in type of tracking TODO: Net HTTP calls made with hardcoded hostnames to be removed TODO: tracking id should be returned or not? | def tracking_details
buyer = @current_user
type_of_tracking = (params[:type_of_tracking] || "property_tracking").to_sym
if type_of_tracking == :property_tracking
udprns = Events::Track.where(buyer_id: buyer.id).where(type_of_tracking: Events::Track::TRACKING_TYPE_MAP[:property_tracking]).pluck(:udprn)
api = PropertySearchApi.new(filtered_params: {})
body = api.fetch_details_from_udprns(udprns)
render json: {property_details: body}, status: 200
else
if params["hash_str"].present?
body = Oj.load(Net::HTTP.get(URI.parse(URI.encode("http://52.66.124.42/api/v0/properties/search?hash_str=#{params['hash_str']}"))))
render json: {property_details: body}, status: 200
else
body = []
search_hashes = Events::Track.where(buyer_id: buyer.id).where(type_of_tracking: Events::Track::TRACKING_TYPE_MAP[type_of_tracking]).pluck(:hash_str).compact
search_hashes.each do |search_hash|
### TODO: Fix this. Use internal methods rather than calling the api
body = Oj.load(Net::HTTP.get(URI.parse(URI.encode("http://api.prophety.co.uk/api/v0/properties/search?hash_str=#{search_hash}")))) + body
end
render json: {search_hashes: search_hashes, property_details: body}
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trackers(query, type=nil)\n if type.nil?\n is_valid_with_error(__method__, [:ipv4, :domain], query)\n if domain?(query)\n query = normalize_domain(query)\n end\n get('host-attributes/trackers', {'query' => query})\n else\n is_valid_with_error(__method__, [:... | [
"0.597705",
"0.59144413",
"0.5735036",
"0.5617689",
"0.54666567",
"0.5431689",
"0.54226965",
"0.5419066",
"0.53725445",
"0.5345034",
"0.5329371",
"0.5322544",
"0.5312536",
"0.52893865",
"0.5265697",
"0.5249971",
"0.5234865",
"0.5217012",
"0.52111447",
"0.5188541",
"0.51814127... | 0.65677255 | 0 |
Edit tracking details curl XPOST H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0MywiZXhwIjoxNDg1NTMzMDQ5fQ.KPpngSimK5_EcdCeVj7rtIiMOtADL0o5NadFJi2Xs4c" " | def edit_tracking
buyer = @current_user
destroyed = Events::Track.where(id: params[:tracking_id].to_i).last.destroy
render json: { message: 'Destroyed tracking request' }, status: 200
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tracking_params\n params.permit(:location, :trip_request_id)\n end",
"def post_curl\n `curl -X \"POST\" -H \"Authorization: Basic #{_encode}\" -d grant_type=client_credentials https://accounts.spotify.com/api/token`\n end",
"def tracking_params\n params.require(:tracking).permit(:content, ... | [
"0.540576",
"0.53994876",
"0.5268931",
"0.52506155",
"0.52359056",
"0.52315164",
"0.5205049",
"0.5192182",
"0.51643455",
"0.51627517",
"0.5141517",
"0.5140408",
"0.5091574",
"0.5076165",
"0.5075412",
"0.5070239",
"0.50637466",
"0.5051737",
"0.50487304",
"0.5031082",
"0.498484... | 0.5718332 | 0 |
Info about the premium charges monthly curl XGET ' | def info_premium
render json: { value: (PropertyBuyer::PREMIUM_COST*100) }, status: 200
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def credits\n return nil unless have_key?\n url = \"/v1/credits\"\n #Hashie::Mash.new(\n self.class.post(url, :headers => headers_for(url)).parsed_response\n end",
"def show(charge_token)\n api_response(api_get(\"#{PATH}/#{charge_token}\"))\n end",
"def billing\n request('billin... | [
"0.56957513",
"0.56536996",
"0.5617652",
"0.55346733",
"0.54489124",
"0.54278827",
"0.54152215",
"0.5404938",
"0.5353512",
"0.53332824",
"0.53332824",
"0.5309007",
"0.5282927",
"0.52481157",
"0.5220851",
"0.5192615",
"0.5178005",
"0.51483846",
"0.5146838",
"0.51355654",
"0.51... | 0.56641144 | 1 |
Create a new Response object for the given Net::SFTP::Request instance, and with the given data. If there is no :code key in the data, the code is assumed to be FX_OK. | def initialize(request, data={}) #:nodoc:
@request, @data = request, data
@code, @message = data[:code] || FX_OK, data[:message]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_with_code(code, subcode)\n OpenStruct.new(name: code_name(code), code: code, subcode: subcode)\n end",
"def initialize(data, status_code)\n @data = data\n @statusCode = status_code\n end",
"def _success(data,code)\n status code\n response.headers['Conte... | [
"0.6052174",
"0.55225223",
"0.5418228",
"0.5374258",
"0.5374032",
"0.5334785",
"0.53197",
"0.530625",
"0.5239993",
"0.5202389",
"0.51979333",
"0.5196144",
"0.5151053",
"0.5093738",
"0.5084425",
"0.5067291",
"0.50454336",
"0.4987059",
"0.49779797",
"0.4945318",
"0.49262756",
... | 0.57564694 | 1 |
Returns +true+ if the status code is FX_OK; +false+ otherwise. | def ok?
code == FX_OK
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ok?\n @status == OK\n end",
"def is_ok?\n code == OK_CODE\n end",
"def success?\n (status_code.to_s =~ /2../) ? true : false\n end",
"def ok?\n @status == 200\n end",
"def is_successful?\n status_code == '0'\n end",
"def success?\n\t\t!!( @status and @status.ex... | [
"0.74520737",
"0.7108859",
"0.7098609",
"0.7043127",
"0.7035813",
"0.6967889",
"0.6966165",
"0.6905255",
"0.6896311",
"0.6857539",
"0.6839474",
"0.6802789",
"0.6788055",
"0.6776196",
"0.6763993",
"0.6753299",
"0.6742513",
"0.6727451",
"0.6726015",
"0.6707289",
"0.6688147",
... | 0.83634627 | 0 |
Returns +true+ if the status code is FX_EOF; +false+ otherwise. | def eof?
code == FX_EOF
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n return @stream.eof?\n end",
"def eof?\n io.eof?\n end",
"def eof?\n @eof\n end",
"def eof?\n @eof\n end",
"def eof?\n @eof\n end",
... | [
"0.7336073",
"0.7336073",
"0.7336073",
"0.72984815",
"0.72851884",
"0.7255248",
"0.7255248",
"0.7255248",
"0.72539973",
"0.7221933",
"0.7221933",
"0.7221933",
"0.7211516",
"0.71952873",
"0.71592677",
"0.7016629",
"0.6980623",
"0.6976482",
"0.69627213",
"0.69623184",
"0.692446... | 0.8081804 | 0 |
GET /polling_sessions/new GET /polling_sessions/new.json | def new
@polling_session = PollingSession.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @polling_session }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @polling_session = PollingSession.new(params[:polling_session])\n\n respond_to do |format|\n if @polling_session.save\n format.html { redirect_to @polling_session, notice: 'Polling session was successfully created.' }\n format.json { render json: @polling_session, status: :cre... | [
"0.7200673",
"0.6922426",
"0.68400216",
"0.679016",
"0.66888666",
"0.6647991",
"0.63777757",
"0.63396496",
"0.6328666",
"0.6305696",
"0.6293725",
"0.62511176",
"0.6195757",
"0.61729836",
"0.6103391",
"0.60841775",
"0.6060703",
"0.6017639",
"0.59978026",
"0.5979473",
"0.597579... | 0.80017734 | 0 |
POST /polling_sessions POST /polling_sessions.json | def create
@polling_session = PollingSession.new(params[:polling_session])
respond_to do |format|
if @polling_session.save
format.html { redirect_to @polling_session, notice: 'Polling session was successfully created.' }
format.json { render json: @polling_session, status: :created, location: @polling_session }
else
format.html { render action: "new" }
format.json { render json: @polling_session.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @polling_session = PollingSession.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @polling_session }\n end\n end",
"def create_single_poll_session(poll_id,poll_sessions__course_id__,opts={})\n query_param_keys = [\n \n ]\n\n ... | [
"0.6141677",
"0.6007205",
"0.59136736",
"0.59000343",
"0.58953667",
"0.58930206",
"0.58599037",
"0.58243406",
"0.5788784",
"0.57812786",
"0.5772482",
"0.5752685",
"0.5741058",
"0.57021147",
"0.57020754",
"0.56545407",
"0.56434214",
"0.5627708",
"0.5618583",
"0.55769926",
"0.5... | 0.6964131 | 0 |
PUT /polling_sessions/1 PUT /polling_sessions/1.json | def update
@polling_session = PollingSession.find(params[:id])
respond_to do |format|
if @polling_session.update_attributes(params[:polling_session])
format.html { redirect_to @polling_session, notice: 'Polling session was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @polling_session.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_single_poll_session(poll_id,id,poll_sessions__course_id__,poll_sessions__course_section_id__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :poll_sessions__course_id__,\n :poll_sessions__course_section_id__,\n :poll_sessions__has_public_result... | [
"0.62015176",
"0.6142145",
"0.6055531",
"0.6052481",
"0.5942413",
"0.59289163",
"0.58133686",
"0.5766334",
"0.5756454",
"0.57487214",
"0.57074255",
"0.5697528",
"0.56855774",
"0.5656672",
"0.5631655",
"0.56300336",
"0.5626987",
"0.56072384",
"0.56072384",
"0.5606675",
"0.5598... | 0.68678343 | 0 |
DELETE /polling_sessions/1 DELETE /polling_sessions/1.json | def destroy
@polling_session = PollingSession.find(params[:id])
@polling_session.destroy
respond_to do |format|
format.html { redirect_to polling_sessions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_session\n request.method = :get\n request.uri = '_session'\n Couchdbtools.execute(request)\n end",
"def destroy\n @yoga_session = YogaSession.find(params[:id])\n @yoga_session.destroy\n\n respond_to do |format|\n format.html { redirect_to yoga_sessions_url }\n form... | [
"0.6872393",
"0.6747178",
"0.66962314",
"0.6695935",
"0.66853786",
"0.66851443",
"0.66586506",
"0.6655968",
"0.66477543",
"0.6643424",
"0.66171086",
"0.6616865",
"0.6606987",
"0.6604662",
"0.6598259",
"0.65948504",
"0.65540737",
"0.65282935",
"0.652107",
"0.65035516",
"0.6440... | 0.7535422 | 0 |
Extract url from json and get files | def download
URI.extract(json, ['http', 'https']).each do |url|
get_asset(url)
end
json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def json_at(url)\n JSON.parse(open(url).read, symbolize_names: true)[:objects]\nend",
"def get_urls( search_url )\n urls = []\n result_json = parse_json( search_url )\n result_json['items'].each do |item|\n urls << item['url']\n end\n\n return urls\nend",
"def get_file(url); end",
"def get_json(url)... | [
"0.67730147",
"0.67432445",
"0.6627193",
"0.66143686",
"0.64659387",
"0.64624846",
"0.6248586",
"0.6248171",
"0.62244123",
"0.6207111",
"0.620166",
"0.609987",
"0.6023666",
"0.6012393",
"0.6009479",
"0.6003042",
"0.5988958",
"0.5979974",
"0.59771436",
"0.59398866",
"0.5939069... | 0.69814074 | 0 |
GET /solicitacao_tipos GET /solicitacao_tipos.json | def index
@solicitacao_tipos = SolicitacaoTipo.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n tips = Tip.all\n json_response(tips)\n end",
"def show\n @tip_so = TipSo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tip_so }\n end\n end",
"def show\n json_response(@tip)\n end",
"def tecnicos_p... | [
"0.65108067",
"0.64022475",
"0.61986303",
"0.61943024",
"0.61738473",
"0.60719556",
"0.60466915",
"0.6017275",
"0.5969186",
"0.5969186",
"0.5964207",
"0.59610367",
"0.59297687",
"0.59143305",
"0.591277",
"0.590865",
"0.59049314",
"0.58742553",
"0.58641595",
"0.5852805",
"0.57... | 0.7046238 | 0 |
DELETE /solicitacao_tipos/1 DELETE /solicitacao_tipos/1.json | def destroy
@solicitacao_tipo.destroy
respond_to do |format|
format.html { redirect_to solicitacao_tipos_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @tip_so = TipSo.find(params[:id])\n @tip_so.destroy\n\n respond_to do |format|\n format.html { redirect_to tip_sos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitu... | [
"0.7579861",
"0.7466454",
"0.74196404",
"0.7383597",
"0.7359379",
"0.7359123",
"0.73443264",
"0.73396087",
"0.73336804",
"0.73320884",
"0.7324677",
"0.7316358",
"0.73079914",
"0.7290945",
"0.72845405",
"0.71892256",
"0.7168368",
"0.71579796",
"0.7135689",
"0.7111101",
"0.7103... | 0.784042 | 0 |
GET /u_sers/1 GET /u_sers/1.json | def show
@u_ser = USer.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @u_ser }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @u_sers = USer.all\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @use... | [
"0.72598606",
"0.64190686",
"0.61925536",
"0.6137131",
"0.6118909",
"0.58885694",
"0.58674437",
"0.584617",
"0.57275486",
"0.57150984",
"0.5712456",
"0.57095677",
"0.57087487",
"0.56723416",
"0.56693363",
"0.5663225",
"0.5655754",
"0.5607923",
"0.5603253",
"0.55927724",
"0.55... | 0.669042 | 1 |
GET /u_sers/new GET /u_sers/new.json | def new
@u_ser = USer.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @u_ser }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @u = U.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @u }\n end\n end",
"def new\n @usr = Usr.new\n \n respond_to do |format|\n format.html # new.html.haml\n format.js # new.js.rjs\n format.xml { render :xml => @usr... | [
"0.7417012",
"0.71170324",
"0.7092639",
"0.70402247",
"0.7038747",
"0.69986254",
"0.6989611",
"0.6915032",
"0.69037205",
"0.68724126",
"0.68586445",
"0.685825",
"0.68405515",
"0.68140286",
"0.680881",
"0.6794129",
"0.67895055",
"0.67843366",
"0.67783564",
"0.67762804",
"0.675... | 0.7504908 | 0 |
POST /u_sers POST /u_sers.json | def create
@u_ser = USer.new(params[:u_ser])
respond_to do |format|
if @u_ser.save
format.html { redirect_to @u_ser, notice: 'U ser was successfully created.' }
format.json { render json: @u_ser, status: :created, location: @u_ser }
else
format.html { render action: "new" }
format.json { render json: @u_ser.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @u_ser = USer.new(u_ser_params)\n\n respond_to do |format|\n if @u_ser.save\n format.html { redirect_to @u_ser, notice: 'U ser was successfully created.' }\n format.json { render :show, status: :created, location: @u_ser }\n else\n format.html { render :new }\n ... | [
"0.634905",
"0.6186928",
"0.57403594",
"0.5651373",
"0.56368405",
"0.5628509",
"0.55825585",
"0.5521971",
"0.5495161",
"0.5338382",
"0.5268426",
"0.5267577",
"0.5261323",
"0.52466214",
"0.52267075",
"0.520776",
"0.5193178",
"0.5183848",
"0.51413196",
"0.51302457",
"0.51100314... | 0.6416255 | 0 |
PUT /u_sers/1 PUT /u_sers/1.json | def update
@u_ser = USer.find(params[:id])
respond_to do |format|
if @u_ser.update_attributes(params[:u_ser])
format.html { redirect_to @u_ser, notice: 'U ser was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @u_ser.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @u_ser.update(u_ser_params)\n format.html { redirect_to @u_ser, notice: 'U ser was successfully updated.' }\n format.json { render :show, status: :ok, location: @u_ser }\n else\n format.html { render :edit }\n format.json { render js... | [
"0.63182807",
"0.6270266",
"0.598554",
"0.58476627",
"0.5657172",
"0.5600045",
"0.55445385",
"0.5544309",
"0.55440676",
"0.5539058",
"0.5495385",
"0.5483849",
"0.54661477",
"0.54532695",
"0.54205054",
"0.5383168",
"0.5339815",
"0.5328165",
"0.532579",
"0.53112024",
"0.5309192... | 0.65416086 | 0 |
DELETE /u_sers/1 DELETE /u_sers/1.json | def destroy
@u_ser = USer.find(params[:id])
@u_ser.destroy
respond_to do |format|
format.html { redirect_to u_sers_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @u_ser.destroy\n respond_to do |format|\n format.html { redirect_to u_sers_url, notice: 'U ser was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uder.destroy\n respond_t... | [
"0.6946302",
"0.69276553",
"0.667342",
"0.6612868",
"0.65867144",
"0.6580875",
"0.6554371",
"0.65526795",
"0.6550917",
"0.6549767",
"0.654431",
"0.65373445",
"0.6532813",
"0.6529876",
"0.65264964",
"0.65020865",
"0.6501794",
"0.64871585",
"0.64734113",
"0.64729655",
"0.645458... | 0.7272203 | 0 |
returns whether conversation has any associated unread posts | def any_unread? usr
@conv.posts.each do |post|
if post.unread?(usr) && post.recipient_id == usr.id
return true
end
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_unread?\n Message.any_in(conversation_id: conversations.map(&:id)).ne(read_by: id).present?\n end",
"def has_unread_messages?\n received_messages.count > 0\n end",
"def any_unread? usr\n ConversationProcessor.new(self).any_unread? usr\n end",
"def unread? user_id\n !unread_messages(use... | [
"0.79774034",
"0.7608553",
"0.73700744",
"0.730161",
"0.7006697",
"0.6941816",
"0.6934406",
"0.6927607",
"0.69178337",
"0.6910893",
"0.68594486",
"0.68594486",
"0.68594486",
"0.6850814",
"0.68155205",
"0.6780257",
"0.6730168",
"0.6643015",
"0.66117275",
"0.66050315",
"0.66005... | 0.80610716 | 0 |
sets all posts in a convo to 'removed' | def remove_posts usr
@conv.posts.each do |post|
if usr.id == post.user_id
post.status = 'removed'
elsif usr.id == post.recipient_id
post.recipient_status = 'removed'
end
post.save
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_posts usr\n ConversationProcessor.new(self).remove_posts usr\n end",
"def clear!\n @posts = nil\n end",
"def after_destroy(post)\n post = post.to_post\n Notification.where(:scope => 'mention',\n :source_ids => {'Post' => post.id}).each do |notification|\n notification.rem... | [
"0.6978334",
"0.6913233",
"0.6187236",
"0.61253244",
"0.6107475",
"0.60547864",
"0.604865",
"0.6046654",
"0.60339445",
"0.6005888",
"0.6005888",
"0.6005888",
"0.6005485",
"0.5974702",
"0.5935466",
"0.59247625",
"0.59185445",
"0.59035033",
"0.58933",
"0.5884303",
"0.58808655",... | 0.73982596 | 0 |
mark all posts in a conversation | def mark_all_posts usr
return false if usr.blank?
@conv.posts.each do |post|
post.mark_as_read! for: usr if post
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark_all_posts usr\n ConversationProcessor.new(self).mark_all_posts usr\n end",
"def mark_all_readed\n doctor.notifications.update_all unreaded: false\n send_json doctor.notifications, true\n end",
"def mark_read_messages(conversation)\n time = Time.current\n conversation = Conversation.fi... | [
"0.8151513",
"0.6205402",
"0.6189774",
"0.58371794",
"0.56703055",
"0.56609356",
"0.55997",
"0.55727977",
"0.5549892",
"0.54906887",
"0.54813874",
"0.5453417",
"0.54390085",
"0.54188335",
"0.5398069",
"0.5370722",
"0.5357503",
"0.53451574",
"0.53398174",
"0.53383404",
"0.5307... | 0.69614565 | 1 |
Initializes an instance url:: URL to a BigBlueButton server (e.g. salt:: Secret salt for this server version:: API version: 0.7 (valid for 0.7, 0.71 and 0.71a) | def initialize(url, salt, version='0.7', debug=false)
@supported_versions = ['0.7','0.8']
@url = url
@salt = salt
@debug = debug
if version.nil?
@version = get_api_version
else
@version = version
end
unless @supported_versions.include?(@version)
raise BigBlueButtonException.new("BigBlueButton error: Invalid API version #{version}. Supported versions: #{@supported_versions.join(', ')}")
end
puts "BigBlueButtonAPI: Using version #{@version}" if @debug
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(url, salt, version='0.7', debug=false)\n @supported_versions = ['0.7', '0.8']\n @url = url\n @salt = salt\n @debug = debug\n @timeout = 10 # default timeout for api requests\n @request_headers = {} # http headers sent in all requests\n\n @version = version ... | [
"0.7773854",
"0.75203896",
"0.7190561",
"0.6984908",
"0.6750601",
"0.67253166",
"0.67134416",
"0.67134416",
"0.67134416",
"0.66722953",
"0.6669814",
"0.66446024",
"0.66299945",
"0.6591506",
"0.6515754",
"0.649704",
"0.64923084",
"0.6490326",
"0.6474378",
"0.6450362",
"0.64403... | 0.7768183 | 1 |
Returns the url used to join the meeting meeting_id:: Unique identifier for the meeting user_name:: Name of the user password:: Password for this meeting used to set the user as moderator or attendee user_id:: Unique identifier for this user web_voice_conf:: Custom voiceextension for users using VoIP | def join_meeting_url(meeting_id, user_name, password,
user_id = nil, web_voice_conf = nil)
params = { :meetingID => meeting_id, :password => password, :fullName => user_name,
:userID => user_id, :webVoiceConf => web_voice_conf }
get_url(:join, params)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def join_meeting_url(meeting_id, user_name, password, options={})\n valid_options = [:userID, :webVoiceConf]\n valid_options += [:createTime] if @version >= \"0.8\"\n options.reject!{ |k,v| !valid_options.include?(k) }\n\n params = { :meetingID => meeting_id, :password => password, :fullName =>... | [
"0.8092655",
"0.7162452",
"0.713902",
"0.7123276",
"0.700276",
"0.6416468",
"0.5919399",
"0.5888902",
"0.5880316",
"0.5797665",
"0.57330704",
"0.5627439",
"0.54624236",
"0.5445873",
"0.5445873",
"0.5440448",
"0.5386621",
"0.53849703",
"0.5333603",
"0.5322903",
"0.531965",
"... | 0.80475104 | 1 |
Returns true or false as to whether meeting is open. A meeting is only open after at least one participant has joined. meeting_id:: Unique identifier for the meeting | def is_meeting_running?(meeting_id)
hash = send_api_request(:isMeetingRunning, { :meetingID => meeting_id } )
hash[:running].downcase == "true"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def meeting_running?(id)\n prepare\n @api.is_meeting_running?(id)\n end",
"def is_meeting_running?(meeting_id)\n hash = send_api_request(:isMeetingRunning, { :meetingID => meeting_id } )\n BigBlueButtonFormatter.new(hash).to_boolean(:running)\n end",
"def open?\n\t\t@time = Time.now.to_form... | [
"0.6380261",
"0.62248003",
"0.6221971",
"0.6039648",
"0.6039648",
"0.59506863",
"0.590294",
"0.57762027",
"0.57440346",
"0.572106",
"0.5709472",
"0.5704064",
"0.5704059",
"0.57009107",
"0.5669436",
"0.5643488",
"0.5627048",
"0.5624854",
"0.55969566",
"0.5593739",
"0.55860245"... | 0.6326372 | 1 |
Make a simple request to the server to test the connection | def test_connection
response = send_api_request(:index)
response[:returncode]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_connection\n args = get_connection_args(\"#{endpoint}/auth\")\n args[:raw_response] = true\n RestClient::Request.execute(args)\n end",
"def make_http_request\n Net::HTTP.get_response('localhost', '/ping', 3000).body\nend",
"def talk_to_server(host, port, request)\n socket = TCPSocket.open(... | [
"0.7246728",
"0.6996201",
"0.6960943",
"0.69358444",
"0.6804451",
"0.67962855",
"0.6730802",
"0.6646011",
"0.6623835",
"0.660756",
"0.65600026",
"0.6557589",
"0.6467756",
"0.643878",
"0.64028424",
"0.6393356",
"0.6374452",
"0.6329454",
"0.6299891",
"0.62986606",
"0.62953645",... | 0.7188415 | 1 |
alias for summary also add descr shortcut?? | def desc() summary; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def summary\n # TODO\n end",
"def description\n return summary\n end",
"def summary\n end",
"def summary\n end",
"def summary; end",
"def summary; end",
"def summary; end",
"def summary; end",
"def summary *args\n @summary = args.first if args.size > 0\n end",
"def summary\n ... | [
"0.7998052",
"0.7950138",
"0.7838732",
"0.7838732",
"0.77272326",
"0.77272326",
"0.77272326",
"0.77272326",
"0.7421978",
"0.7414017",
"0.74064475",
"0.73783284",
"0.7327787",
"0.7302037",
"0.7216659",
"0.7126676",
"0.7118923",
"0.7118923",
"0.7118923",
"0.7118923",
"0.7118923... | 0.80219734 | 0 |
We allow document series to be assigned directly on an edition for speed tagging | def document_series_ids=(ids)
raise(StandardError, 'cannot assign document series to an unsaved edition') unless persisted?
document.document_series_ids = ids
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_series\n @series = Series.find(params[:id])\n @cv = ControlledVocabulary.physical_object_cv('Film')\n @l_cv = ControlledVocabulary.language_cv\n end",
"def doc_series=(doc_series)\n if !doc_series.nil? && doc_series.to_s.length > 64\n fail ArgumentError, 'invalid value for \... | [
"0.6066456",
"0.59444135",
"0.586813",
"0.5756031",
"0.5699041",
"0.56461513",
"0.5550231",
"0.5543285",
"0.55068195",
"0.549942",
"0.5484264",
"0.5462294",
"0.5453271",
"0.53783274",
"0.5371826",
"0.5329701",
"0.5264035",
"0.5261391",
"0.52533966",
"0.5242429",
"0.52258044",... | 0.6322694 | 0 |
Return the width of the named style. +style_name+ defaults to the attribute's default_style. | def width(style_name=nil)
style_name ||= reflection.default_style
if style_name.equal?(:original)
from_examination :@original_width
else
dimensions(style_name).at(0)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def width(style_name='original')\n geometry(style_name).width.to_i\n end",
"def width=(value)\n @style.width = value\n end",
"def width\n if present?(options[:width])\n options[:width]\n\n elsif present?(options[:name])\n geometry.bordered_width\n\n else\n... | [
"0.81040615",
"0.6777788",
"0.6354896",
"0.63064265",
"0.6129217",
"0.60608274",
"0.6014019",
"0.5883229",
"0.5732189",
"0.57186073",
"0.56601983",
"0.5639279",
"0.5637219",
"0.56321603",
"0.55771065",
"0.55676115",
"0.5557213",
"0.5552883",
"0.5549331",
"0.55278665",
"0.5527... | 0.8343923 | 0 |
Return the height of the named style. +style_name+ defaults to the attribute's default_style. | def height(style_name=nil)
style_name ||= reflection.default_style
if style_name.equal?(:original)
from_examination :@original_height
else
dimensions(style_name).at(1)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def height(style_name='original')\n geometry(style_name).height.to_i\n end",
"def height=(value)\n @style.height = value\n end",
"def css_style_height(height = '')\n height = height.to_s.as_css_size\n height.blank? ? '' : \"height:#{height};\"\n end",
"def height(name)\n Tk.... | [
"0.8258957",
"0.6859417",
"0.6647148",
"0.6227877",
"0.5940879",
"0.57866794",
"0.5767589",
"0.5680373",
"0.5674596",
"0.5670273",
"0.5635982",
"0.5614297",
"0.5612909",
"0.55806106",
"0.5521675",
"0.5512786",
"0.5479372",
"0.5478817",
"0.5478198",
"0.5468598",
"0.54672617",
... | 0.84590805 | 0 |
Return the aspect ratio of the named style. +style_name+ defaults to the attribute's default_style. | def aspect_ratio(style_name=nil)
style_name ||= reflection.default_style
if style_name.equal?(:original)
original_width = from_examination(:@original_width)
original_height = from_examination(:@original_height)
original_width.to_f / original_height
else
w, h = *dimensions(style_name)
w.to_f / h
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def width(style_name=nil)\n style_name ||= reflection.default_style\n if style_name.equal?(:original)\n from_examination :@original_width\n else\n dimensions(style_name).at(0)\n end\n end",
"def height(style_name=nil)\n style_name ||= reflection.default_s... | [
"0.66587573",
"0.6197773",
"0.61951274",
"0.6068867",
"0.60096115",
"0.5917236",
"0.58478194",
"0.5703756",
"0.56912726",
"0.5612362",
"0.5597567",
"0.559034",
"0.5562877",
"0.55475664",
"0.5538559",
"0.5532147",
"0.5456631",
"0.5376528",
"0.5312218",
"0.52979004",
"0.5293787... | 0.85200244 | 0 |
Return the width and height of the named style, as a 2element array. | def dimensions(style_name=nil)
style_name ||= reflection.default_style
if style_name.equal?(:original)
original_width = from_examination(:@original_width)
original_height = from_examination(:@original_height)
[original_width, original_height]
else
resize_dimensions(dimensions(:original), reflection.styles[style_name])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dimensions\n case @options[:style]\n when 'horizontal'\n [@colors.size, 1]\n when 'vertical'\n [1, @colors.size]\n end\n end",
"def styles\n return @metadata[:styles]\n end",
"def dimensions(style = :original)\n @dimensions ||= {}\n return {} unless is_bit... | [
"0.6866974",
"0.67288405",
"0.6516567",
"0.65090215",
"0.64856255",
"0.6415302",
"0.634943",
"0.6193142",
"0.6119825",
"0.6119825",
"0.603385",
"0.58650863",
"0.5858989",
"0.58505297",
"0.58187747",
"0.5804687",
"0.57633615",
"0.5755147",
"0.56933",
"0.5682097",
"0.56781006",... | 0.7086445 | 0 |
Return the dimensions, as an array [width, height], that result from resizing +original_dimensions+ for the given +style+. | def resize_dimensions(original_dimensions, style)
if style.filled?
style.dimensions
else
original_aspect_ratio = original_dimensions[0].to_f / original_dimensions[1]
target_aspect_ratio = style.dimensions[0].to_f / style.dimensions[1]
if original_aspect_ratio > target_aspect_ratio
width = style.dimensions[0]
height = (width / original_aspect_ratio).round
else
height = style.dimensions[1]
width = (height * original_aspect_ratio).round
end
[width, height]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dimensions(style_name=nil)\n style_name ||= reflection.default_style\n if style_name.equal?(:original)\n original_width = from_examination(:@original_width)\n original_height = from_examination(:@original_height)\n [original_width, original_height]\n else\n ... | [
"0.82603425",
"0.72764045",
"0.7099696",
"0.6898156",
"0.64568",
"0.63955665",
"0.63532746",
"0.63532746",
"0.63038194",
"0.5962581",
"0.5961278",
"0.59209335",
"0.57798636",
"0.57654184",
"0.57485104",
"0.5705169",
"0.57042444",
"0.57042444",
"0.5652785",
"0.56102395",
"0.55... | 0.82804507 | 0 |
NOM pvalue: Nominal p value; that is, the statistical significance of the enrichment score. The nominal p value is not adjusted for gene set size or multiple hypothesis testing; therefore, it is of limited use in comparing gene sets. | def nominal_p_value
@nominal_p_value ||= @fields[5].to_f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_protein_probability(protein_node)\n\n\t\t#MS:1002403\n\t\tis_group_representative=(self.get_cvParam(protein_node,\"MS:1002403\")!=nil)\n\t\tif is_group_representative\n\t\t\treturn \tself.get_cvParam(protein_node.parent,\"MS:1002470\").attributes['value'].to_f*0.01\n\t\telse\n\t\t\treturn 0\n\t\tend\n\tend... | [
"0.56107986",
"0.55354834",
"0.5495203",
"0.53964394",
"0.53731257",
"0.5365285",
"0.51771814",
"0.50220495",
"0.5021046",
"0.48743036",
"0.48438528",
"0.48422042",
"0.48233116",
"0.48105547",
"0.4800551",
"0.4794564",
"0.47921255",
"0.4788358",
"0.4784487",
"0.47657344",
"0.... | 0.62969375 | 0 |
FDR qvalue: False discovery rate; that is, the estimated probability that the normalized enrichment score (NES) represents a false positive finding. For example, an FDR of 25% indicates that the result is likely to be valid 3 out of 4 times. | def fdr_q_value
@fdr_q_value ||= @fields[6].to_f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fdr(error_rate = 0.0001)\n sequences = self.dna_hash.values\n if sequences.size == 0\n return {}\n else\n seq_count = self.size\n observed_hash = variant_for_poisson(sequences)\n p_unadjusted = []\n observed_hash.each do |k, v|\n p_value = 1 - `Rscript... | [
"0.6152747",
"0.57610196",
"0.57374275",
"0.5729737",
"0.5564448",
"0.54393005",
"0.54335916",
"0.5427187",
"0.5425854",
"0.5371067",
"0.5337704",
"0.5335693",
"0.5324293",
"0.531646",
"0.5305478",
"0.5281855",
"0.52783436",
"0.5275544",
"0.5264172",
"0.5223553",
"0.5222835",... | 0.6098612 | 1 |
FWER pvalue: Familywiseerror rate; that is, a more conservatively estimated probability that the normalized enrichment score represents a false positive finding. Because the goal of GSEA is to generate hypotheses, the GSEA team recommends focusing on the FDR statistic. | def fwer_p_value
@fwer_p_value ||= @fields[7].to_f
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fare\n return PENALTY_FARE if penalty?\n return MINIMUM_FARE\n end",
"def do_rff(fv, sv)\n hf = get_marginal_entropy(fv)\n hs = get_marginal_entropy(sv)\n hfs = get_conditional_entropy(fv, sv)\n \n # symmetrical uncertainty\n 2*(hf-hfs)/(hf+hs)\n end",
"def efg\n ... | [
"0.6240372",
"0.6228662",
"0.6042909",
"0.59502393",
"0.59360594",
"0.5899151",
"0.58332646",
"0.58183885",
"0.580707",
"0.56314766",
"0.55448127",
"0.5517625",
"0.5503823",
"0.5485083",
"0.54778224",
"0.54732966",
"0.5448831",
"0.54374516",
"0.54349446",
"0.54298985",
"0.540... | 0.68583584 | 0 |
POST /practitioner_roles POST /practitioner_roles.json | def create
@practitioner_role = PractitionerRole.new(practitioner_role_params)
respond_to do |format|
if @practitioner_role.save
format.html { redirect_to @practitioner_role, notice: 'Practitioner role was successfully created.' }
format.json { render :show, status: :created, location: @practitioner_role }
else
format.html { render :new }
format.json { render json: @practitioner_role.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_role(role)\n role = {\n \"id\"=>nil,\n \"name\"=>nil, \n \"description\"=>\"\", \n \"sessionTimeout\"=>\"60\",\n \"roles\"=>[],\n \"privileges\"=>[]\n }.merge(role);\n post(\"#{url_base}/roles\", {\"data\"=>role})[\"data\"]\n end",
"def CreateRole params = {}\n ... | [
"0.70966846",
"0.68966454",
"0.67919576",
"0.66241574",
"0.66051143",
"0.65650886",
"0.653956",
"0.64436543",
"0.6442777",
"0.6413613",
"0.63957596",
"0.635207",
"0.63496995",
"0.6345488",
"0.63403267",
"0.6282266",
"0.6282266",
"0.6282266",
"0.62611324",
"0.62566733",
"0.625... | 0.7032563 | 1 |
PATCH/PUT /practitioner_roles/1 PATCH/PUT /practitioner_roles/1.json | def update
respond_to do |format|
if @practitioner_role.update(practitioner_role_params)
format.html { redirect_to @practitioner_role, notice: 'Practitioner role was successfully updated.' }
format.json { render :show, status: :ok, location: @practitioner_role }
else
format.html { render :edit }
format.json { render json: @practitioner_role.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def UpdateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n respond_to do |format|\n if @team_role.update(team_role_params)\n format.html { redirect_to lab_team_roles_path(@lab), notice: 'Team role was ... | [
"0.7071717",
"0.686072",
"0.68333566",
"0.6822314",
"0.68108964",
"0.677246",
"0.6718536",
"0.6697436",
"0.66946715",
"0.6692879",
"0.66622573",
"0.666203",
"0.66609925",
"0.6653987",
"0.6629426",
"0.6610442",
"0.6591068",
"0.6565691",
"0.654898",
"0.6538467",
"0.65236104",
... | 0.7223109 | 0 |
DELETE /practitioner_roles/1 DELETE /practitioner_roles/1.json | def destroy
@practitioner_role.destroy
respond_to do |format|
format.html { redirect_to practitioner_roles_url, notice: 'Practitioner role was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @lab_role = LabRole.find(params[:id])\n @lab_role.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_roles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @role = Role.find(params[:id])\n @role.destroy\n \n respond_to do |format... | [
"0.7363247",
"0.7234942",
"0.72219765",
"0.71962875",
"0.7191758",
"0.7175023",
"0.7149711",
"0.71210355",
"0.71153915",
"0.71071374",
"0.7080056",
"0.70769376",
"0.7055473",
"0.7050793",
"0.70415354",
"0.7039209",
"0.7012131",
"0.70101774",
"0.7009771",
"0.69979894",
"0.6991... | 0.7533551 | 0 |
Following method will delete actual credentials and update default signing credentials in signing.properties file (inside SigningConfigs folder) | def restore_default_signing_credentials()
system($cmd_to_remove_signing_directory)
system($cmd_to_create_new_signing_file)
IO.copy_stream($path_to_default_signing_file, $path_to_actual_signing_file)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset()\n Dir[File.join(@keystore, \"*\")].each { |f| FileUtils.remove_entry_secure f }\n end",
"def rotate_credentials!\n clear_all_reviewer_sessions!\n generate_credentials\n save!\n end",
"def destroy()\n FileUtils.remove_entry_secure(@keystore)\n end",
"def sign_out\n Rai... | [
"0.6000053",
"0.57287073",
"0.5718047",
"0.5712944",
"0.5558645",
"0.55017227",
"0.54360753",
"0.5368876",
"0.5344141",
"0.5324556",
"0.5323831",
"0.53217494",
"0.5254176",
"0.5242718",
"0.5236519",
"0.52344626",
"0.52273536",
"0.5218138",
"0.52134675",
"0.51720977",
"0.51638... | 0.7454791 | 0 |
GET /fake_answers GET /fake_answers.json | def index
@fake_answers = FakeAnswer.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def answers\n request('answers')\n end",
"def show\n render json: @answer\n end",
"def index\n @answers = Answer.where(url_params)\n if @answers.size == 1\n @answers.first!\n end\n render json: @answers\n end",
"def show\n @quiz = params[:quiz_id]\n @fake_answers = Fak... | [
"0.72328824",
"0.6914773",
"0.6857219",
"0.6836569",
"0.6794836",
"0.6794836",
"0.6794836",
"0.6794836",
"0.6748096",
"0.6711686",
"0.67115384",
"0.6679088",
"0.6662031",
"0.6576235",
"0.6550996",
"0.6509215",
"0.6509215",
"0.6509215",
"0.65022916",
"0.6499834",
"0.6479792",
... | 0.76433223 | 0 |
POST /fake_answers POST /fake_answers.json | def create
@fake_answer = FakeAnswer.new(fake_answer_params)
@fake_answer.question_id = params[:question_id]
respond_to do |format|
if @fake_answer.save
format.html { redirect_to question_path(params[:quiz_id], params[:question_id]), notice: 'Fake answer was successfully created.' }
format.json { render :show, status: :created, location: @fake_answer }
else
format.html { render :new }
format.json { render json: @fake_answer.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fake_answer_params\n params.require(:fake_answer).permit(:answer, :question_id, :quiz_id)\n end",
"def index\n @fake_answers = FakeAnswer.all\n end",
"def create\n passed = true\n count = 0\n if params[:status] == \"listOfAnswers\"\n params[:answers].each do |ans|\n @answer... | [
"0.70002824",
"0.6714093",
"0.66228753",
"0.66215265",
"0.6574405",
"0.65624535",
"0.64825547",
"0.64625627",
"0.6457008",
"0.64533365",
"0.64462394",
"0.6436141",
"0.64115065",
"0.64115065",
"0.6404387",
"0.6402076",
"0.63927054",
"0.6369385",
"0.6366281",
"0.63653",
"0.6358... | 0.7353894 | 0 |
PATCH/PUT /fake_answers/1 PATCH/PUT /fake_answers/1.json | def update
respond_to do |format|
if @fake_answer.update(fake_answer_params)
format.html { redirect_to @fake_answer, notice: 'Fake answer was successfully updated.' }
format.json { render :show, status: :ok, location: @fake_answer }
else
format.html { render :edit }
format.json { render json: @fake_answer.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @question = Question.update(params[:id], { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n respond_to do |format|\n format.json { render :json => @question.as_json({:include => :answers}) }\n\n # if @que... | [
"0.68757325",
"0.6873886",
"0.6738325",
"0.6663481",
"0.64679563",
"0.64679563",
"0.6457721",
"0.64376235",
"0.6424249",
"0.64161676",
"0.64153993",
"0.6397989",
"0.6345244",
"0.63425946",
"0.6326939",
"0.6321163",
"0.6320706",
"0.6319739",
"0.63186616",
"0.6309624",
"0.63096... | 0.7129221 | 0 |
DELETE /fake_answers/1 DELETE /fake_answers/1.json | def destroy
@fake_answer.destroy
respond_to do |format|
format.html { redirect_to fake_answers_url, notice: 'Fake answer was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n answer = Answer.find(params[:answer_id])\n answer.destroy\n \n render json: {success: true}\n end",
"def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n ... | [
"0.75515115",
"0.74374837",
"0.74374837",
"0.74100095",
"0.7392629",
"0.73762643",
"0.73700905",
"0.73700905",
"0.7281447",
"0.7258693",
"0.72482276",
"0.7225049",
"0.7220558",
"0.71750474",
"0.7172923",
"0.7167194",
"0.7167163",
"0.7167163",
"0.7167163",
"0.7167163",
"0.7167... | 0.76496696 | 0 |
This method is invoked whenever Burp Scanner discovers a new, unique issue. | def newScanIssue(issue)
event = {
'details' => issue.getIssueDetail,
'vulnerability' => issue.issueName,
'severity' => issue.severity,
'url' => issue.url.to_s,
'port' => issue.port,
'host' => issue.host
}
send_event(event)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_stale_issues\n handle_newly_stale_issues\n handle_stale_and_unmergable_prs\n end",
"def after_create(issue)\n user_agent_detail_service.create\n handle_add_related_issue(issue)\n resolve_discussions_with_issue(issue)\n create_escalation_status(issue)\n\n super\n end... | [
"0.6083699",
"0.6028642",
"0.58497536",
"0.58497536",
"0.5809531",
"0.5809531",
"0.54663014",
"0.5306853",
"0.52345395",
"0.5159733",
"0.51464957",
"0.5123844",
"0.5071489",
"0.50656337",
"0.50563616",
"0.5019229",
"0.49901628",
"0.49799582",
"0.49799582",
"0.49753729",
"0.49... | 0.69553334 | 0 |
turn a gray entry to white | def turn_to_white(entry)
raise "Only a gray entry can be turned to white" unless entry.mode == Entry::MODE_GRAY
entry.be_white!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_to_black(entry)\n\t\traise \"Only a gray entry can be turned to black\" unless entry.mode == Entry::MODE_GRAY\n\t\tentry.be_black!\n\t\tdecrement!(:entries_num)\n\tend",
"def white\n colorize(37)\n end",
"def white!\n self.color = :white\n end",
"def cancel_black(entry)\n\t\traise \"Ony a bl... | [
"0.76192683",
"0.72442156",
"0.68534315",
"0.6730867",
"0.65915555",
"0.65083206",
"0.63472074",
"0.6335894",
"0.62846035",
"0.62692386",
"0.62544256",
"0.61990064",
"0.5952079",
"0.59362036",
"0.5896998",
"0.58859175",
"0.5861792",
"0.583852",
"0.5828988",
"0.58006966",
"0.5... | 0.87834173 | 0 |
turn a gray entry to black | def turn_to_black(entry)
raise "Only a gray entry can be turned to black" unless entry.mode == Entry::MODE_GRAY
entry.be_black!
decrement!(:entries_num)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_to_white(entry)\n\t\traise \"Only a gray entry can be turned to white\" unless entry.mode == Entry::MODE_GRAY\n\t\tentry.be_white!\n\tend",
"def cancel_black(entry)\n\t\traise \"Ony a black entry can be canceled to gray\" unless entry.mode == Entry::MODE_BLACK\n\t\tentry.be_gray!\n\t\tincrement!(:entrie... | [
"0.7797748",
"0.75115925",
"0.6641252",
"0.66394764",
"0.65816045",
"0.6565367",
"0.6558141",
"0.6558141",
"0.6283044",
"0.6276112",
"0.6149354",
"0.6124538",
"0.61047447",
"0.60704416",
"0.6023583",
"0.600836",
"0.59670526",
"0.5965099",
"0.5965099",
"0.59643584",
"0.5951229... | 0.85430205 | 0 |
cancel a black entry to gray | def cancel_black(entry)
raise "Ony a black entry can be canceled to gray" unless entry.mode == Entry::MODE_BLACK
entry.be_gray!
increment!(:entries_num)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_to_black(entry)\n\t\traise \"Only a gray entry can be turned to black\" unless entry.mode == Entry::MODE_GRAY\n\t\tentry.be_black!\n\t\tdecrement!(:entries_num)\n\tend",
"def safe_colorize_deactive\n CLIColorize.off\n end",
"def turn_to_white(entry)\n\t\traise \"Only a gray entry can be turned to ... | [
"0.7253252",
"0.6806319",
"0.67141515",
"0.6550353",
"0.6340775",
"0.6270994",
"0.609823",
"0.60920995",
"0.60874283",
"0.60336524",
"0.60202163",
"0.6017151",
"0.5893231",
"0.5872357",
"0.581119",
"0.57405347",
"0.571675",
"0.5708805",
"0.56946933",
"0.5683745",
"0.5659697",... | 0.8708618 | 0 |
Get typographic and morphosyntactic normalization of an input text using an analyzer of ElasticSearch. (string) text Input text. | def normalize2(text, analyzer = nil)
Entry.normalize(text, normalizer2, analyzer)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pre_normalize(text); end",
"def normalize1(text, analyzer = nil)\n\t\tEntry.normalize(text, normalizer1, analyzer)\n\tend",
"def normalize(text) #:nodoc:\n normalized_text = text.to_s.downcase\n normalized_text = Numerizer.numerize(normalized_text)\n normalized_text.gsub!(/['\"\\.]/, '')\n ... | [
"0.73448277",
"0.68200576",
"0.65461254",
"0.62681997",
"0.6033383",
"0.59138775",
"0.58968383",
"0.58936214",
"0.5863743",
"0.5764376",
"0.5729348",
"0.56959754",
"0.56768626",
"0.5668627",
"0.5617253",
"0.5614357",
"0.56085706",
"0.56003666",
"0.5592124",
"0.5585808",
"0.54... | 0.6842146 | 1 |
Calculate Krippendorff's alpha (interrater reliability) Assumed input (Matrix) [ [ nil, nil, nil, nil, nil, 3, 4, 1, 2, 1, 1, 3, 3, nil, 3 ], coder 1 [ 1, nil, 2, 1, 3, 3, 4, 3, nil, nil, nil, nil, nil, nil, nil], coder 2 [ nil, nil, 2, 1, 3, 4, 4, nil, 2, 1, 1, 3, 3, nil, 4 ] coder 3 ] | def krippendorff_alpha
in_array = self.to_a
in_array_flattened = in_array.transpose.flatten
unique_values = in_array.flatten.compact.uniq
# We need to keep track of the skip indexes separately since we can't send nils via C array of double
skip_indexes = []
in_array_flattened.each_with_index do |element, i|
skip_indexes << i if element.nil?
end
# Reformat the in_array to not have nil
skip_indexes.each {|i| in_array_flattened[i] = 0 }
FFI::MemoryPointer.new(:double, in_array_flattened.size) do |in_array_ptr|
FFI::MemoryPointer.new(:double, unique_values.size) do |unique_values_ptr|
FFI::MemoryPointer.new(:int, skip_indexes.size) do |skip_indexes_ptr|
in_array_ptr.write_array_of_double(in_array_flattened)
unique_values_ptr.write_array_of_double(unique_values)
skip_indexes_ptr.write_array_of_int(skip_indexes)
return _krippendorff_alpha(in_array_ptr, row_count, column_count, skip_indexes_ptr, skip_indexes.size, unique_values_ptr, unique_values.size)
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fleiss(matrix)\n debug = true\n\n # n Number of rating per subjects (number of human raters)\n n = checkEachLineCount(matrix) # PRE : every line count must be equal to n\n i_N = matrix.size\n k = matrix[0].size\n\n if debug\n puts \"#{n} raters.\"\n puts \"#{i_N} subjects.\"\n puts \"#{k} cat... | [
"0.659812",
"0.56843007",
"0.54977244",
"0.52980226",
"0.520264",
"0.5083619",
"0.5061918",
"0.50556916",
"0.50504255",
"0.5031081",
"0.49978867",
"0.4965376",
"0.49543536",
"0.49212122",
"0.4915246",
"0.4910321",
"0.49029636",
"0.4896388",
"0.48898193",
"0.48720384",
"0.4861... | 0.61531466 | 1 |
GET /wishlist_items GET /wishlist_items.xml | def index
@wishlist_items = WishlistItem.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @wishlist_items }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @wishlist_item = WishlistItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wishlist_item }\n end\n end",
"def show\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n format.html # s... | [
"0.7702818",
"0.7389687",
"0.7069813",
"0.70656097",
"0.70206",
"0.6967141",
"0.6891797",
"0.68861693",
"0.688251",
"0.6779779",
"0.67751074",
"0.6771312",
"0.6677934",
"0.6667456",
"0.64915663",
"0.6464108",
"0.64375645",
"0.6430342",
"0.632434",
"0.6292687",
"0.62863684",
... | 0.7948633 | 0 |
GET /wishlist_items/1 GET /wishlist_items/1.xml | def show
@wishlist_item = WishlistItem.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @wishlist_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @wishlist_items = WishlistItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wishlist_items }\n end\n end",
"def show\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.e... | [
"0.78592396",
"0.751913",
"0.7107771",
"0.70018244",
"0.69793105",
"0.69069713",
"0.68212384",
"0.6718996",
"0.6705311",
"0.6702776",
"0.6637464",
"0.6612683",
"0.6573811",
"0.6497558",
"0.6494542",
"0.64729625",
"0.6472366",
"0.6445448",
"0.6427236",
"0.64050853",
"0.6292535... | 0.7829301 | 1 |
GET /wishlist_items/new GET /wishlist_items/new.xml | def new
@wishlist_item = WishlistItem.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @wishlist_item }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @wish_list_item = WishListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list_item }\n end\n end",
"def new\n @wish_list = WishList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { rend... | [
"0.80365664",
"0.7672576",
"0.75745106",
"0.75463885",
"0.72669226",
"0.72669226",
"0.71113026",
"0.71113026",
"0.71113026",
"0.71113026",
"0.71113026",
"0.71113026",
"0.71113026",
"0.71113026",
"0.7104713",
"0.7048624",
"0.70458513",
"0.6994171",
"0.69870645",
"0.698051",
"0... | 0.8076632 | 0 |
PUT /wishlist_items/1 PUT /wishlist_items/1.xml | def update
@wishlist_item = WishlistItem.find(params[:id])
respond_to do |format|
if @wishlist_item.update_attributes(params[:wishlist_item])
format.html { redirect_to(@wishlist_item, :notice => 'Wishlist item was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @wishlist_item.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n if @wish_list_item.update_attributes(params[:wish_list_item])\n format.html { redirect_to(@wish_list_item, :notice => 'Wish list item was successfully updated.') }\n format.xml { head :ok }\n e... | [
"0.7283253",
"0.7260425",
"0.7176752",
"0.7163197",
"0.70719266",
"0.706832",
"0.70471656",
"0.70294124",
"0.69872826",
"0.6974909",
"0.6967413",
"0.6899808",
"0.68313503",
"0.6638728",
"0.6629651",
"0.6618489",
"0.6618489",
"0.6618489",
"0.6618489",
"0.6618489",
"0.66137534"... | 0.7591988 | 0 |
DELETE /wishlist_items/1 DELETE /wishlist_items/1.xml | def destroy
@wishlist_item = WishlistItem.find(params[:id])
@wishlist_item.destroy
respond_to do |format|
format.html { redirect_to(store_path, :notice => 'Item has been removed from your wishlist.') }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @wish_list_item = WishListItem.find(params[:id])\n @wish_list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(wish_list_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wishlistitem = Wishlistitem.find(params[:id])\n @wishlistite... | [
"0.7499399",
"0.72535795",
"0.7193845",
"0.71509445",
"0.7015333",
"0.699125",
"0.69773203",
"0.69632375",
"0.69632375",
"0.69607407",
"0.6893657",
"0.68016624",
"0.67435944",
"0.6742987",
"0.6742987",
"0.67184496",
"0.6668846",
"0.6650799",
"0.66481614",
"0.6621747",
"0.6606... | 0.7620046 | 0 |
Whether or not this event is a search event. | def search?
type == :search
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search?\n self.rel == \"search\"\n end",
"def has_simple_search?\n self.search_type.to_s == \"simple\" && !self.is_static?\n end",
"def searchable?\n @args[:search].present?\n end",
"def event?\n entry_type == :event\n end",
"def searching?\n @searching\n end",
"de... | [
"0.7050877",
"0.68856",
"0.68108463",
"0.6662095",
"0.66348374",
"0.6611465",
"0.65955347",
"0.65955347",
"0.6538532",
"0.6480304",
"0.64727294",
"0.64443326",
"0.64290655",
"0.6394361",
"0.6394361",
"0.63826466",
"0.63657427",
"0.6335163",
"0.62802213",
"0.62311774",
"0.6182... | 0.77010936 | 0 |
Checks the given runtime options for required options. If no required options exist, returns true. Otherwise, checks the keys of the runtime options to see if they contain all of the required options. | def check_options_requirements(runtime_options)
required_options = options[:requires] || options[:require]
return true unless required_options
([required_options].flatten - runtime_options.keys).size == 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid?(options)\n (@required_options - options.keys).size == 0\n end",
"def required_by_option?(options)\n req = (options.is_a?(Hash) ? options.stringify_keys[:required] : options)\n !(req.to_s === 'false' || req.nil?)\n end",
"def requiredOptionsSet()\n\t\t@@opt.each... | [
"0.74803275",
"0.7443251",
"0.71763015",
"0.69971865",
"0.672289",
"0.6709709",
"0.66750807",
"0.66280764",
"0.660845",
"0.6574304",
"0.6508954",
"0.6440833",
"0.6428106",
"0.6428106",
"0.64270777",
"0.64260393",
"0.6373272",
"0.6348179",
"0.6328891",
"0.6257842",
"0.6226288"... | 0.86579126 | 0 |
kill all processes including servers, clients and trema PIDs for server and clients are in PID files | def kill_all_processes
puts "KILL : all processes"
pid_servers = PID_DIR_PATH + "/" + PID_FILE_PREFIX_SERVER + "*"
pid_clients = PID_DIR_PATH + "/" + PID_FILE_PREFIX_CLIENT + "*"
# for servers
Dir::glob(pid_servers).each do |f|
if File::ftype(f) == "file"
pid_server = f.split( "." )[1]
$pids_s.delete(pid_server)
begin
File.delete(f)
Process.kill('KILL', pid_server.to_i)
# puts "KILL : server [" + pid_server + "] was killed"
rescue Errno::ESRCH
STDERR.puts "KILL : server [" + pid_server + "]: No such process"
rescue
STDERR.puts "ERROR : Can't kill server process [" + pid_server + "]"
end
end
end
# for clients
Dir::glob(pid_clients).each do |f|
if File::ftype(f) == "file"
pid_client = f.split( "." )[1]
$pids_c.delete(pid_client)
begin
File.delete(f)
Process.kill('KILL', pid_client.to_i)
# puts "KILL : client [" + pid_client + "] was killed"
rescue Errno::ESRCH
STDERR.puts "KILL : client [" + pid_client + "]: No such process"
rescue
STDERR.puts "ERROR : Can't kill client process [" + pid_client + "]"
end
end
end
# for trema
cmd = TREMA + " killall"
system(cmd)
$pids_c.each{|pid|
if process_working?(pid.to_i) then Process.kill('KILL', pid.to_i) end
}
$pids_s.each{|pid|
if process_working?(pid.to_i) then Process.kill('KILL', pid.to_i) end
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kill_procs(options={})\n # Give it a good try to delete all processes.\n # This abuse is necessary to release locks on polyinstantiated\n # directories by pam_namespace.\n\n procfilter=\"-u #{uid}\"\n if options[:init_owned]\n procfilter << \" -P 1\"\n end\... | [
"0.7158874",
"0.7088136",
"0.70101285",
"0.70016754",
"0.66099197",
"0.65603936",
"0.65290403",
"0.6455944",
"0.644798",
"0.6398452",
"0.6323112",
"0.6299266",
"0.62884915",
"0.62718755",
"0.62341315",
"0.6202883",
"0.6136912",
"0.61367756",
"0.6114428",
"0.6107549",
"0.60939... | 0.84458905 | 0 |
List all the groups. | def list
@groups = Group.find(:all, :order => 'name')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_groups\n BrickFTP::API::Group.all\n end",
"def list_groups\n BrickFTP::API::Group.all\n end",
"def hc_group_list_all(id)\n org=Org.find(id)\n org.hc_groups.all(:order=>'group_name')\n end",
"def groups\n find(:group).map { |g| g.content }\n end",
"def hc_group_li... | [
"0.80761874",
"0.80761874",
"0.7736165",
"0.75816",
"0.75493896",
"0.74877626",
"0.74477017",
"0.7395149",
"0.7394693",
"0.7374675",
"0.7362523",
"0.73018074",
"0.72810775",
"0.726793",
"0.72521836",
"0.72483486",
"0.7229844",
"0.72212493",
"0.72163373",
"0.7161532",
"0.71327... | 0.82609266 | 0 |
Give the given group either ALL or NO permissions to all the folders | def give_permissions_to_folders(group, permission_to_everything)
Folder.find(:all).each do |folder|
add_to_group_permissions(group, folder, permission_to_everything)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def folder_permissions_groups_only\n @attributes[:folder_permissions_groups_only]\n end",
"def add_to_group_permissions(group, folder, permission_to_everything)\n group_permission = GroupPermission.new\n group_permission.folder = folder\n group_permission.group = group\n group_permiss... | [
"0.6821695",
"0.67130405",
"0.657511",
"0.64386684",
"0.6430437",
"0.6218378",
"0.61804175",
"0.61694455",
"0.61454076",
"0.6142309",
"0.6113165",
"0.60897017",
"0.6087991",
"0.6047705",
"0.6013864",
"0.5988046",
"0.5961569",
"0.593958",
"0.592791",
"0.59166545",
"0.59166545"... | 0.72214156 | 0 |
Add the given group and folder to GroupPermissions and (dis)allow everything | def add_to_group_permissions(group, folder, permission_to_everything)
group_permission = GroupPermission.new
group_permission.folder = folder
group_permission.group = group
group_permission.can_create = permission_to_everything
group_permission.can_read = permission_to_everything
group_permission.can_update = permission_to_everything
group_permission.can_delete = permission_to_everything
group_permission.save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_group_permission(g)\n\t\t\n\tend",
"def give_permissions_to_folders(group, permission_to_everything)\n Folder.find(:all).each do |folder|\n add_to_group_permissions(group, folder, permission_to_everything)\n end\n end",
"def chg_permission(groups, arg, mode)\n arg = UserGroup.one... | [
"0.7064186",
"0.70187306",
"0.6718033",
"0.66990846",
"0.66494733",
"0.6522002",
"0.6452796",
"0.6426728",
"0.6351635",
"0.6336575",
"0.59725577",
"0.59701014",
"0.5951281",
"0.594292",
"0.59112537",
"0.59099084",
"0.5904136",
"0.5890368",
"0.5828501",
"0.5821654",
"0.5812975... | 0.76209146 | 0 |
The group called 'admins' can not be edited or deleted. By calling this method via a before_filter, you makes sure this doesn't happen. | def do_not_rename_or_destroy_admins_group
if @group and @group.is_the_administrators_group?
redirect_to :action => 'list' and return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prevent_zero_group_admins\n @membership = Membership.find(params[:id])\n @group = @membership.group\n if @group.has_one_admin? && (@membership.user == current_user)\n flash[:danger] = \"You cannot quit unless there are other group admins.\"\n redirect_to @group\n end\n end"... | [
"0.7619519",
"0.7419459",
"0.73993146",
"0.7336209",
"0.72050196",
"0.716738",
"0.71550626",
"0.71160245",
"0.7100673",
"0.707253",
"0.6985762",
"0.6985762",
"0.6983571",
"0.6955274",
"0.6932021",
"0.6932021",
"0.6932021",
"0.6890417",
"0.6867892",
"0.68626344",
"0.6836359",
... | 0.8197735 | 0 |
Check if a group exists before executing an action. If it doesn't exist: redirect to 'list' and show an error message | def does_group_exist
@group = Group.find(params[:id])
rescue
flash.now[:group_error] = 'Someone else deleted the group. Your action was cancelled.'
redirect_to :action => 'list' and return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_group_exists\n if (Group.where(group_params).count != 0)\n redirect_to Group.where(group_params).first\n end\n end",
"def require_member_of_group\n if !member_of(current_group)\n # TODO: Add flash alert\n redirect_back fallback_location: home_path\n ... | [
"0.82312167",
"0.72790205",
"0.6956808",
"0.69134754",
"0.6887473",
"0.6844776",
"0.68217444",
"0.6724733",
"0.6607002",
"0.65707684",
"0.65427035",
"0.6513769",
"0.65013766",
"0.648523",
"0.64541197",
"0.6423775",
"0.64009565",
"0.6399634",
"0.63661057",
"0.6362678",
"0.6353... | 0.78789526 | 1 |
Given a "square" array of subarrays, find the sum of values from the first value of the first array, the second value of the second array, the third value of the third array, and so on... Example 1: exampleArray = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] diagonalSum(exampleArray) => 4 Example 2: exampleArray = [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]] diagonalSum(exampleArray) => 5 | def diagonalSum(matrix)
total = 0
(0...matrix.length).each {|sub| total += matrix[sub][sub]}
return total
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def two_d_sum(array)\n sum = 0 \n array.each do |sub_array|\n sub_array.each do |num|\n sum += num \n end\n end\n\n sum\nend",
"def two_d_sum(arr)\n\tsum = 0\n arr.each do |subArray|\n subArray.each do |i|\n sum += i\n end\n end\n return sum\nend",
"def multi_dimensional_sum(array)... | [
"0.7323168",
"0.7081612",
"0.70787966",
"0.70787966",
"0.7062459",
"0.7032922",
"0.6994547",
"0.6981598",
"0.69581056",
"0.69496137",
"0.688263",
"0.6870832",
"0.68320256",
"0.6738789",
"0.67178303",
"0.67083365",
"0.6698856",
"0.66214037",
"0.6598974",
"0.65600705",
"0.65573... | 0.7112105 | 1 |
DELETE /test_bookings/1 DELETE /test_bookings/1.xml | def destroy
@test_booking = TestBooking.find(params[:id])
@test_booking.destroy
respond_to do |format|
format.html { redirect_to(test_bookings_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n... | [
"0.6633766",
"0.6633766",
"0.65779567",
"0.6555827",
"0.65358436",
"0.6470717",
"0.64569455",
"0.63899976",
"0.63726103",
"0.63538194",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6347651",
"0.6320892... | 0.70728403 | 0 |
GET /company_types GET /company_types.json | def index
@company_types = CompanyType.all
render json: @company_types
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n render json: @company_type\n end",
"def index\n @type_companies = TypeCompany.all\n end",
"def type\n fetch('company.type')\n end",
"def index\n @admin_company_types = Admin::CompanyType.all\n end",
"def byState\n @company_types = CompanyType.where(\"state_id = ?\", co... | [
"0.72950727",
"0.7109263",
"0.70026845",
"0.6909386",
"0.66707665",
"0.65155303",
"0.6488321",
"0.6471277",
"0.6434962",
"0.6343553",
"0.6329315",
"0.6266198",
"0.626582",
"0.6236602",
"0.61953914",
"0.61433315",
"0.6132888",
"0.6130129",
"0.6122113",
"0.61215746",
"0.6113127... | 0.78606737 | 0 |
GET /company_types/byState/1 GET /company_types/byState/1.json | def byState
@company_types = CompanyType.where("state_id = ?", company_type_params[:state_id])
render json: @company_types
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def byState\n @companies = Company.where(\"state_id = ?\", company_params[:state_id])\n\n render json: @companies\n end",
"def index\n @company_types = CompanyType.all\n\n render json: @company_types\n end",
"def show\n render json: @company_type\n end",
"def index\n @type_companies = Ty... | [
"0.7681558",
"0.70722884",
"0.66862345",
"0.657447",
"0.650979",
"0.6132571",
"0.61007315",
"0.6017717",
"0.5965307",
"0.59387076",
"0.5898496",
"0.58936423",
"0.58797354",
"0.5841357",
"0.5807216",
"0.5777385",
"0.5771038",
"0.57659376",
"0.57552516",
"0.5754214",
"0.5742081... | 0.8612504 | 0 |
GET /company_types/1 GET /company_types/1.json | def show
render json: @company_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @company_types = CompanyType.all\n\n render json: @company_types\n end",
"def index\n @type_companies = TypeCompany.all\n end",
"def type\n fetch('company.type')\n end",
"def index\n @admin_company_types = Admin::CompanyType.all\n end",
"def set_type_company\n @t... | [
"0.77569324",
"0.719821",
"0.7186441",
"0.6849857",
"0.66516054",
"0.6590242",
"0.6520687",
"0.64819556",
"0.6416951",
"0.6383246",
"0.63786995",
"0.63211143",
"0.62555534",
"0.6238684",
"0.6238684",
"0.6238684",
"0.6238684",
"0.6237996",
"0.6227353",
"0.6204575",
"0.6188086"... | 0.75830656 | 1 |
POST /company_types POST /company_types.json | def create
@company_type = CompanyType.new(company_type_params)
if @company_type.save
render json: @company_type, status: :created, location: @company_type
else
render json: @company_type.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @type_company = TypeCompany.new(type_company_params)\n\n respond_to do |format|\n if @type_company.save\n format.html { redirect_to @type_company, notice: 'Type company was successfully created.' }\n format.json { render :show, status: :created, location: @type_company }\n ... | [
"0.6962814",
"0.680279",
"0.66868913",
"0.66208154",
"0.6563562",
"0.63400257",
"0.6174167",
"0.61677396",
"0.6143639",
"0.611549",
"0.6110198",
"0.60799456",
"0.6071588",
"0.6069727",
"0.6054",
"0.6036068",
"0.6017305",
"0.5914957",
"0.5914957",
"0.5900653",
"0.5900653",
"... | 0.74006945 | 0 |
PATCH/PUT /company_types/1 PATCH/PUT /company_types/1.json | def update
@company_type = CompanyType.find(params[:id])
if @company_type.update(company_type_params)
head :no_content
else
render json: @company_type.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @company = Company.friendly.find(params[:id])\n\n @company.companytype_id = params[:companytype_id]\n\n\n\n respond_to do |format|\n\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { rend... | [
"0.7487825",
"0.72119653",
"0.71939164",
"0.66199285",
"0.6487162",
"0.63711363",
"0.63375306",
"0.6316484",
"0.629656",
"0.628524",
"0.62073284",
"0.6207322",
"0.6205282",
"0.6205282",
"0.6192688",
"0.61853135",
"0.6184857",
"0.6184724",
"0.61748064",
"0.61711967",
"0.615462... | 0.7569093 | 0 |
DELETE /company_types/1 DELETE /company_types/1.json | def destroy
@company_type.destroy
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @admin_company_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_company_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type = Type.find(params[:type])\n @type.destroy\n\n respond_to do |format|\n format.html { re... | [
"0.7776477",
"0.77046293",
"0.75599265",
"0.7225775",
"0.71949357",
"0.7111012",
"0.70134944",
"0.69842565",
"0.6972056",
"0.69720095",
"0.6943254",
"0.691763",
"0.691763",
"0.691763",
"0.687737",
"0.6860584",
"0.6852094",
"0.6852094",
"0.6852094",
"0.6852094",
"0.6852094",
... | 0.78043586 | 0 |
GET /gltf_models GET /gltf_models.json | def index
@gltf_models = GltfModel.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def models(make, year, category)\n make_id = get_object_id make\n category_id = get_object_id category\n response = get_url \"Models/#{make_id}/#{year}/#{category_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetModelsResult\"].map{|r| Models::Model.from_response_hash(r)}\n ... | [
"0.6366516",
"0.6159299",
"0.6093915",
"0.60801965",
"0.60612905",
"0.6038504",
"0.6016536",
"0.5965578",
"0.5925854",
"0.59045404",
"0.5847773",
"0.58083856",
"0.580603",
"0.58016175",
"0.58016175",
"0.57885665",
"0.5757472",
"0.57548827",
"0.5749606",
"0.5745169",
"0.574000... | 0.7086729 | 0 |
POST /gltf_models POST /gltf_models.json | def create
@gltf_model = GltfModel.new(gltf_model_params)
respond_to do |format|
if @gltf_model.save
format.html { redirect_to @gltf_model, notice: 'Gltf model was successfully created.' }
format.json { render :show, status: :created, location: @gltf_model }
else
format.html { render :new }
format.json { render json: @gltf_model.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train\n training = @prediction.trainedmodels.insert.request_schema.new\n training.id = 'emotion_prediction_id'\n training.storage_data_location = DATA_OBJECT\n result = @client.execute(\n :api_method => @prediction.trainedmodels.insert,\n :headers => {'Content-Type' => 'application/js... | [
"0.6156778",
"0.60116416",
"0.5969718",
"0.5738165",
"0.57204694",
"0.5691531",
"0.56770587",
"0.5587047",
"0.5572569",
"0.55326736",
"0.54894453",
"0.5426242",
"0.54190004",
"0.5395249",
"0.53938514",
"0.5375051",
"0.53728",
"0.53425467",
"0.53425467",
"0.5333202",
"0.527856... | 0.64486474 | 0 |
DELETE /gltf_models/1 DELETE /gltf_models/1.json | def destroy
@gltf_model.destroy
respond_to do |format|
format.html { redirect_to gltf_models_url, notice: 'Gltf model was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n ... | [
"0.703142",
"0.70152724",
"0.7012977",
"0.7012977",
"0.7012977",
"0.69774354",
"0.695762",
"0.6933614",
"0.69286406",
"0.69202924",
"0.68830276",
"0.68643343",
"0.6862609",
"0.684401",
"0.6813616",
"0.67322826",
"0.6717871",
"0.6689857",
"0.6684332",
"0.6680368",
"0.66801465"... | 0.7454775 | 0 |
Format kyc Always receives [Hash] :NOTE Reading data to format from key:'user_kyc' Author: Tejas Date: 24/09/2018 Reviewed By: Sets result_type, user_kyc | def show(data_to_format)
formatted_data = {
result_type: 'user_kyc',
user_kyc: user_kyc_base(data_to_format[:user_kyc_detail], data_to_format[:admin])
}
formatted_data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_kyc_data\n @user_kyc_detail.present? ?\n {\n kyc_status: kyc_status,\n admin_action_types: @user_kyc_detail.admin_action_types_array,\n whitelist_status: @user_kyc_detail.whitelist_status\n }\n :\n {}\n end",
"def user_ky... | [
"0.6807346",
"0.5872701",
"0.5729006",
"0.5681961",
"0.56758815",
"0.5665296",
"0.5606227",
"0.5606227",
"0.5600151",
"0.55636805",
"0.5479883",
"0.5454042",
"0.54291064",
"0.5420745",
"0.53460443",
"0.5343816",
"0.53428787",
"0.5298603",
"0.5291671",
"0.52900153",
"0.5271627... | 0.6669875 | 1 |
Format pre signed url for put Always receives [Hash] :NOTE Reading data to format from key:'file_upload_put' Author: Aniket Date: 20/09/2018 Reviewed By: | def get_pre_singed_url_for_put(data_to_format)
formatted_data = {
result_type: 'file_upload_put',
file_upload_put: data_to_format
}
formatted_data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_signed_put_url(upload, duration)\n # use Fog config\n storage = Fog::Storage.new(Rails.configuration.x.fog_configuration)\n \n # set request attributes\n headers = { \"Content-Type\" => upload.content_type }\n options = { \"path_style\" => \"true\" }\n \n # generate ... | [
"0.67966163",
"0.6775661",
"0.6487616",
"0.6379967",
"0.63140744",
"0.62500286",
"0.62426245",
"0.6237337",
"0.61933255",
"0.6190393",
"0.6108691",
"0.60999954",
"0.60978055",
"0.609427",
"0.60238963",
"0.60124534",
"0.59918123",
"0.59866756",
"0.5971516",
"0.5941019",
"0.593... | 0.8047017 | 0 |
Get Admin Name Author: Tejas Date: 24/09/2018 Reviewed By: | def admin_name(last_acted_by, admin)
last_acted_by = last_acted_by.to_i
if (last_acted_by > 0)
admin[:name]
elsif (last_acted_by == Admin::AUTO_APPROVE_ADMIN_ID)
GlobalConstant::Admin.auto_approved_admin_name
else
''
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAuthorName\n\t\treturn User.find(self.user_id).username\n\tend",
"def attribution\n user = roles.creator.first&.user\n user = roles.administrator.not_creator.first&.user if user.blank?\n return [] if user.blank?\n\n text = user&.name(false)\n orcid = user.identifier_for_scheme(scheme: 'orci... | [
"0.68571734",
"0.67655355",
"0.6757834",
"0.67468387",
"0.6733212",
"0.6718094",
"0.6714925",
"0.66346055",
"0.66316706",
"0.66230094",
"0.6576259",
"0.6576259",
"0.65704286",
"0.6569066",
"0.6560141",
"0.65553147",
"0.6551965",
"0.65485185",
"0.653709",
"0.6532437",
"0.65282... | 0.7266418 | 0 |
Get response for sending KYC approve email Author: Mayur Date: 03/12/2018 Reviewed By: | def email_kyc_approve(data_to_format)
{}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_approve_email\n 'send_approve_email'\n end",
"def approved_notification\n @user = params[:user]\n mail(to: @user.email, subject: 'Library Card Request Approved')\n end",
"def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end",
"def confirm(viper)\n @vip... | [
"0.66857827",
"0.6537127",
"0.6378747",
"0.63589156",
"0.63566065",
"0.63520384",
"0.6348529",
"0.61139035",
"0.6097678",
"0.6060128",
"0.60555786",
"0.6052152",
"0.60403436",
"0.60151994",
"0.59832114",
"0.5970294",
"0.5968385",
"0.59408766",
"0.59185123",
"0.5907257",
"0.59... | 0.74177253 | 0 |
Get response for sending KYC report issue email Author: Mayur Date: 14/12/2018 Reviewed By: | def email_kyc_report_issue(data_to_format)
{}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def email_kyc_approve(data_to_format)\n {}\n end",
"def email_report_issue(params)\n http_helper.send_post_request(\"#{@url_prefix}/#{get_user_id!(params)}/email/report-issue\", params)\n end",
"def response(expo_attendee_id)\n @expo_attendee = ExpoAttendee.find(expo_attendee_id)... | [
"0.62613153",
"0.60695267",
"0.5953663",
"0.5815612",
"0.58054847",
"0.57805985",
"0.5767882",
"0.57628787",
"0.575934",
"0.57584065",
"0.57250553",
"0.57060987",
"0.56945837",
"0.568172",
"0.5637443",
"0.5605159",
"0.5601538",
"0.55704343",
"0.55512136",
"0.55248755",
"0.552... | 0.68020076 | 0 |
GET /brite_td_aswaxman_rt_waxmen GET /brite_td_aswaxman_rt_waxmen.json | def index
@brite_td_aswaxman_rt_waxmen = BriteTdAswaxmanRtWaxman.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @brite_rt_waxmen = BriteRtWaxman.all\n end",
"def index\n @brite_td_asbarabasi_rt_waxmen = BriteTdAsbarabasiRtWaxman.all\n end",
"def set_brite_td_aswaxman_rt_waxman\n @brite_td_aswaxman_rt_waxman = BriteTdAswaxmanRtWaxman.find(params[:id])\n end",
"def set_brite_td_asbarabasi_rt_... | [
"0.7266996",
"0.7229159",
"0.62999576",
"0.6242721",
"0.6136489",
"0.6088682",
"0.5998789",
"0.5962454",
"0.5942457",
"0.5917993",
"0.5908924",
"0.5906845",
"0.5883261",
"0.58676434",
"0.5851696",
"0.5821017",
"0.5816894",
"0.581649",
"0.58136463",
"0.5810217",
"0.58024997",
... | 0.73295295 | 0 |
POST /brite_td_aswaxman_rt_waxmen POST /brite_td_aswaxman_rt_waxmen.json | def create
@brite_td_aswaxman_rt_waxman = BriteTdAswaxmanRtWaxman.new(brite_td_aswaxman_rt_waxman_params)
respond_to do |format|
if @brite_td_aswaxman_rt_waxman.save
format.html { redirect_to @brite_td_aswaxman_rt_waxman, notice: 'Brite td aswaxman rt waxman was successfully created.' }
format.json { render :show, status: :created, location: @brite_td_aswaxman_rt_waxman }
else
format.html { render :new }
format.json { render json: @brite_td_aswaxman_rt_waxman.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @brite_td_asbarabasi_rt_waxman = BriteTdAsbarabasiRtWaxman.new(brite_td_asbarabasi_rt_waxman_params)\n\n respond_to do |format|\n if @brite_td_asbarabasi_rt_waxman.save\n format.html { redirect_to @brite_td_asbarabasi_rt_waxman, notice: 'Brite td asbarabasi rt waxman was successfully... | [
"0.7143289",
"0.7027948",
"0.6670264",
"0.6601159",
"0.6490194",
"0.6452989",
"0.6346805",
"0.6303172",
"0.615388",
"0.6103412",
"0.6006599",
"0.5991535",
"0.58698064",
"0.5828309",
"0.58092797",
"0.58057415",
"0.5580395",
"0.5450999",
"0.5449492",
"0.543886",
"0.54376894",
... | 0.7195034 | 0 |
PATCH/PUT /brite_td_aswaxman_rt_waxmen/1 PATCH/PUT /brite_td_aswaxman_rt_waxmen/1.json | def update
respond_to do |format|
if @brite_td_aswaxman_rt_waxman.update(brite_td_aswaxman_rt_waxman_params)
format.html { redirect_to @brite_td_aswaxman_rt_waxman, notice: 'Brite td aswaxman rt waxman was successfully updated.' }
format.json { render :show, status: :ok, location: @brite_td_aswaxman_rt_waxman }
else
format.html { render :edit }
format.json { render json: @brite_td_aswaxman_rt_waxman.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @brite_rt_waxman.update(brite_rt_waxman_params)\n format.html { redirect_to @brite_rt_waxman, notice: 'Brite rt waxman was successfully updated.' }\n format.json { render :show, status: :ok, location: @brite_rt_waxman }\n else\n format.html... | [
"0.6856805",
"0.67771626",
"0.6650239",
"0.65176123",
"0.6372956",
"0.6281362",
"0.6272229",
"0.6253973",
"0.62455356",
"0.62190616",
"0.6189634",
"0.61780995",
"0.6168091",
"0.61661756",
"0.6151665",
"0.6149953",
"0.61417776",
"0.61407286",
"0.61232656",
"0.6098669",
"0.6096... | 0.6817557 | 1 |
DELETE /brite_td_aswaxman_rt_waxmen/1 DELETE /brite_td_aswaxman_rt_waxmen/1.json | def destroy
@brite_td_aswaxman_rt_waxman.destroy
respond_to do |format|
format.html { redirect_to brite_td_aswaxman_rt_waxmen_url, notice: 'Brite td aswaxman rt waxman was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @brite_td_asbarabasi_rt_waxman.destroy\n respond_to do |format|\n format.html { redirect_to brite_td_asbarabasi_rt_waxmen_url, notice: 'Brite td asbarabasi rt waxman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brite_rt_waxma... | [
"0.723907",
"0.7148391",
"0.6709805",
"0.66736525",
"0.66564125",
"0.6645162",
"0.6642611",
"0.66244006",
"0.659273",
"0.65717876",
"0.65699446",
"0.65517086",
"0.6549124",
"0.6523843",
"0.65189874",
"0.6508655",
"0.6506563",
"0.65052927",
"0.65009266",
"0.6497982",
"0.648512... | 0.7212478 | 1 |
with this Object method we can obtain a hash named "hashinfo" with the gene information (from de Gene Classe) corresponding to the idmutant_gene we have in the StockData Class. | def gene_information(i)
if $gene[i].geneid == $stockdata[i].idmutant_gene
$hashinfo["#{$stockdata[i].stock}"] = $gene[i]
end
return $hashinfo
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n [_hash, name, owner].hash\n end",
"def hash\n\n self.h.fei.hash\n end",
"def hash\n data.hash\n end",
"def hash\n\t\treturn self.name.to_s.hash\n\tend",
"def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"def hash\r\n id.hash\r\n end",
"def has... | [
"0.6465471",
"0.6442642",
"0.6309819",
"0.62425673",
"0.62281996",
"0.6226559",
"0.61924684",
"0.61439884",
"0.6132281",
"0.61163396",
"0.6110101",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.610977",
"0.6106149",
"0.60... | 0.81766635 | 0 |
Do we have all the information necessary to subscribe to the list? | def wants_to_subscribe?
source_is_ffcrm? && has_list?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subscribed; end",
"def suscription_on?\n is_subscribed == true\n end",
"def subscribe?\n self.type == :subscribe\n end",
"def subscriptions; end",
"def subscriptions; end",
"def subscriptions; end",
"def subscribed?\n self.type == :subscribed\n end",
"def IsSubscribed=(arg0)",... | [
"0.7369187",
"0.70999265",
"0.7083483",
"0.7030307",
"0.7030307",
"0.7030307",
"0.69052047",
"0.69015425",
"0.69015425",
"0.6881362",
"0.68245757",
"0.6804293",
"0.67777437",
"0.6748859",
"0.67058784",
"0.66932976",
"0.6669622",
"0.66626",
"0.6660518",
"0.66113245",
"0.658001... | 0.7500854 | 0 |
Retrieves the cell information based on the parameters specified inside the `cell` object | def get_cell(cell)
query_cell_info '/cell/get', cell
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cell(cell)\n @board[cell]\n end",
"def get_cell(row, column)\n @fields[row][column]\n end",
"def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end",
"def get_elem cell\n\t\treturn @elements[cell]\n\tend",
"def cell(row, col, sheet ... | [
"0.6700249",
"0.65839696",
"0.65731555",
"0.6518436",
"0.6300283",
"0.6229153",
"0.6165501",
"0.6158154",
"0.6138333",
"0.6138228",
"0.61308724",
"0.6109513",
"0.60202676",
"0.59902996",
"0.5939663",
"0.5932703",
"0.5928645",
"0.5925812",
"0.5908698",
"0.58960766",
"0.5867328... | 0.8008553 | 0 |
Retrieves the cell information and the measures used to calculate its position based on the parameters specified in the cell object | def get_cell_measures(cell)
query_cell_info '/cell/getMeasures', cell
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coordinates(cell)\n row = @cell_coordinates[cell][0]\n col = @cell_coordinates[cell][1]\n [row, col]\n end",
"def get_cell(cell)\n query_cell_info '/cell/get', cell\n end",
"def cells\n @cells\n end",
"def cells\n @cells\n end",
"def cells\n attributes.fet... | [
"0.62560666",
"0.6222559",
"0.62159985",
"0.62159985",
"0.60673016",
"0.5987495",
"0.5933318",
"0.58349663",
"0.5792557",
"0.57904845",
"0.5641396",
"0.56357855",
"0.56024545",
"0.5574954",
"0.5553867",
"0.5543224",
"0.5542443",
"0.55342656",
"0.55334157",
"0.55284816",
"0.55... | 0.6489639 | 0 |
Retrieves all the cells located inside the bounding box and whose parameters match the ones specified in the options | def get_cells_in_area(bbox, options = {})
raise ArgumentError, 'options must be a Hash' unless options.is_a? Hash
raise ArgumentError, 'bbox must be of type BBox' unless bbox.is_a? BBox
params = {bbox: bbox.to_s, fmt: 'xml'}
params.merge!(options.reject { |key| !GET_IN_AREA_ALLOWED_PARAMS.include? key})
exec_req_and_parse_response '/cell/getInArea', params
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data(bounding_box)\n top, left, bottom, right = bounding_box.coords\n @table.where(:lng => (left..right), :lat => (bottom..top)).all\n end",
"def cells(options = {}, &block)\n cell_regex = /^cell_([0-9]+)_/\n\n options ||= { }\n\n result = block_given? ? yield : (options[:values] || [''... | [
"0.62607753",
"0.6017512",
"0.58347434",
"0.58320624",
"0.57840544",
"0.54796183",
"0.5473193",
"0.5397516",
"0.5372596",
"0.535785",
"0.5335334",
"0.5335334",
"0.53150153",
"0.53017",
"0.5301368",
"0.5300782",
"0.52827024",
"0.5268867",
"0.52373934",
"0.52369547",
"0.5225494... | 0.68340975 | 0 |
Adds a measure (specified by the measure object) to a given cell (specified by the cell object). In case of success the response object will also contain the cell_id and the measure_id of the newly created measure. Although the library does not check this, a valid APIkey must have been specified while initializing the this object | def add_measure(cell, measure)
raise ArgumentError, "cell must be of type Cell" unless cell.is_a? Cell
raise ArgumentError, "measure must be of type Measure" unless measure.is_a? Measure
params = cell.to_query_hash
params[:lat] = measure.lat
params[:lon] = measure.lon
params[:signal] = measure.signal if measure.signal
params[:measured_at] = measure.taken_on if measure.taken_on
exec_req_and_parse_response "/measure/add", params
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_measure_from_excel(measure)\n hash = {}\n hash[:classname] = measure['measure_file_name']\n hash[:name] = measure['name']\n hash[:display_name] = measure['display_name']\n hash[:measure_type] = measure['measure_type']\n hash[:uid] = measure['uid'] ? measure['uid'] ... | [
"0.57950705",
"0.5664046",
"0.5627946",
"0.5536319",
"0.55269486",
"0.55268526",
"0.54663694",
"0.5388411",
"0.532066",
"0.523672",
"0.51744306",
"0.51744306",
"0.51744306",
"0.5152329",
"0.50993246",
"0.5095497",
"0.50752085",
"0.50752085",
"0.50652915",
"0.4980319",
"0.4941... | 0.78555423 | 0 |
List the measures added with a given API key. | def list_measures
exec_req_and_parse_response "/measure/list"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @kr_measures = KrMeasure.all\n end",
"def stats(api_key = nil)\n if api_key && (!api_key.is_a? String)\n error = InvalidOptions.new(['API key(String)'], ['API key(String)'])\n raise error\n end\n\n # Disable cache for API key status calls\n get_request('/stats/',... | [
"0.6055472",
"0.5997235",
"0.5745264",
"0.5745264",
"0.57444793",
"0.57245135",
"0.57245135",
"0.56308895",
"0.5582681",
"0.5532264",
"0.5520591",
"0.55136263",
"0.54849344",
"0.54823804",
"0.5416524",
"0.5400436",
"0.5388314",
"0.5388314",
"0.5334119",
"0.53151244",
"0.53097... | 0.6961849 | 0 |
Deletes a measure previously added with the same API key. | def delete_measure(measure_id)
raise ArgumentError,"measure_id cannot be nil" unless measure_id
exec_req_and_parse_response "/measure/delete", {id: measure_id}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @measure = Measure.find(params[:id])\n\n respond_to do |format|\n if @measure.destroy\n format.html { redirect_to measures_url,\n notice: (crud_notice('destroyed', @measure) + \"#{undo_link(@measure)}\").html_safe }\n format.json { head :no_cont... | [
"0.70181394",
"0.6752842",
"0.6710834",
"0.65900517",
"0.65266734",
"0.64706707",
"0.6384439",
"0.6384439",
"0.6384439",
"0.63701534",
"0.62971586",
"0.6178128",
"0.61148435",
"0.6089075",
"0.599364",
"0.5984563",
"0.59323937",
"0.590877",
"0.58892596",
"0.5842503",
"0.583474... | 0.76766664 | 0 |
GET /admin/kpi_templates/1 GET /admin/kpi_templates/1.json | def show
@admin_kpi_template = Admin::KpiTemplate.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_kpi_template }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"def mcget_templates\n # setup_mcapi.folders.list(\"template\")\n setup_mcapi.templates.list({user: true},{include_drag_and_drop: true})\n end",
"def index\n @admin_kpi_templates = Admin::Kp... | [
"0.7437772",
"0.72739434",
"0.7184176",
"0.7163274",
"0.7069067",
"0.70222825",
"0.69964737",
"0.6929837",
"0.6895858",
"0.68114465",
"0.6743925",
"0.6649605",
"0.6595382",
"0.6536871",
"0.6528256",
"0.6518652",
"0.6498555",
"0.6482097",
"0.6478377",
"0.64602774",
"0.6455248"... | 0.7289812 | 1 |
GET /admin/kpi_templates/new GET /admin/kpi_templates/new.json | def new
@admin_kpi_template = Admin::KpiTemplate.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_kpi_template }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @admin_template = Template.new\n @admin_template.build_template_content\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template }\n end\n end",
"def create\n @admin_kpi_template = Admin::KpiTemplate.new(params[:admin_kpi_templat... | [
"0.7628031",
"0.7491061",
"0.73979896",
"0.7318499",
"0.72550195",
"0.72364664",
"0.7184336",
"0.7154141",
"0.69101703",
"0.68970555",
"0.68610317",
"0.6832197",
"0.6823529",
"0.67503005",
"0.6732363",
"0.67298216",
"0.6721883",
"0.6720589",
"0.66778696",
"0.666765",
"0.66629... | 0.7802102 | 0 |
POST /admin/kpi_templates POST /admin/kpi_templates.json | def create
@admin_kpi_template = Admin::KpiTemplate.new(params[:admin_kpi_template])
respond_to do |format|
if @admin_kpi_template.save
format.html { redirect_to @admin_kpi_template, notice: 'Kpi template was successfully created.' }
format.json { render json: @admin_kpi_template, status: :created, location: @admin_kpi_template }
else
format.html { render action: "new" }
format.json { render json: @admin_kpi_template.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @admin_kpi_template = Admin::KpiTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_kpi_template }\n end\n end",
"def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"de... | [
"0.6622259",
"0.6582469",
"0.6530488",
"0.64118797",
"0.6294986",
"0.62941164",
"0.62474686",
"0.617519",
"0.6167039",
"0.6138981",
"0.61165845",
"0.6113474",
"0.6102534",
"0.6098116",
"0.6085632",
"0.6077751",
"0.6077751",
"0.6077629",
"0.6065601",
"0.60522896",
"0.6044563",... | 0.714878 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.