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 |
|---|---|---|---|---|---|---|
GET /magazines GET /magazines.json | def index
@magazines = Magazine.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @magissues = Magissue.all\n @magazines = Magazine.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @magissues }\n end\n end",
"def index\n@magazines = Magazine.all\nend",
"def show\n @magzine = Magzine.find(params[:id])\n\n ... | [
"0.6659627",
"0.6467082",
"0.6440691",
"0.6130968",
"0.6038243",
"0.59940106",
"0.5991416",
"0.59370166",
"0.5842765",
"0.5840806",
"0.5819476",
"0.5742363",
"0.5730488",
"0.5727327",
"0.5703852",
"0.5681324",
"0.5646103",
"0.562473",
"0.56184125",
"0.56181586",
"0.5576871",
... | 0.6554077 | 1 |
returns an array of numbers needed to calculate the factorial for a given number | def numbers_to_calculate_factorial(number)
factorials = [number]
number.times do
if number > 1 # <-- ensures 0 is not pushed into the factorials array
factorials << number - 1
number -= 1
end
end
factorials
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def factorial n\n arr = []\n while n >= 1\n arr.push n\n n -=1\n end\n arr.reduce(:*)\nend",
"def factorial n\n\treturn (1..n).reduce(:*)\nend",
"def factorial(n)\n # until ((n - 1) = 0)\n # do n - 1\n if n == 0\n return 1\n else\n fact_array = Array.new(n) {|f| f = f + 1}\n fact_array.inj... | [
"0.81138426",
"0.7770233",
"0.77066725",
"0.77008164",
"0.7647926",
"0.76333183",
"0.76022875",
"0.7587209",
"0.7568949",
"0.75637376",
"0.7553988",
"0.7553575",
"0.7518669",
"0.7494432",
"0.746128",
"0.74447817",
"0.7431704",
"0.7416647",
"0.73908263",
"0.73858714",
"0.73680... | 0.796926 | 1 |
PUBLIC METHODS Returns number of link_tracking assocations Only used for reporting purposes | def tracking_total_count
link_tracking.count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_links\n @links_count = Link.count\n end",
"def number_of_internal_links_to_page(link)\n @ilps[link]\n end",
"def total_link_count\n @sitemaps_link_count\n end",
"def count_edge\n count = 0\n @f_net.each_with_index do |followees, follower|\n count += followees_of(f... | [
"0.6871865",
"0.64864355",
"0.6403187",
"0.6376514",
"0.6310534",
"0.62912786",
"0.614341",
"0.6124568",
"0.6071571",
"0.60666233",
"0.6051078",
"0.6041124",
"0.60318494",
"0.6031757",
"0.60292643",
"0.5957545",
"0.59478354",
"0.5946964",
"0.59419936",
"0.59167325",
"0.591411... | 0.7829485 | 0 |
Creates comma seperated list of subjects. | def subject_list
list = []
subjects.each { |subject| list << subject.name }
list.to_sentence
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subjects_column\n list = []\n subjects.each { |subject| list << subject.name }\n list.join(';')\n end",
"def format_final_subject(subjects)\n if subjects.size == 1\n subjects[0]\n elsif subjects.size == 2\n subjects[0] + ' and ' + subjects[1]\n else\n last_subject = subjects... | [
"0.7360715",
"0.7082522",
"0.6774296",
"0.6663561",
"0.649294",
"0.6472248",
"0.6449567",
"0.64210546",
"0.64110374",
"0.6395672",
"0.639089",
"0.6365869",
"0.6358851",
"0.63236743",
"0.62995267",
"0.6240473",
"0.62367433",
"0.6182755",
"0.6158407",
"0.6116354",
"0.60407895",... | 0.8026546 | 0 |
Creates comma seperated list of resources. | def resource_list
list = []
resources.each { |rss| list << rss.name }
list.to_sentence
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_resources_list\n resources = YARD::Registry.all(:resource).uniq.sort_by {|resource| resource.name.to_s}\n generate_full_list(resources, 'Resource', 'resources')\nend",
"def list\n puts local_resources.map { |name, resource| name }.join(\" \")\n end",
"def manipulate_resource_list(res... | [
"0.6936104",
"0.6747082",
"0.61592853",
"0.61461926",
"0.60896844",
"0.6058486",
"0.60176593",
"0.5978648",
"0.5978303",
"0.59137356",
"0.59137356",
"0.5774169",
"0.5719946",
"0.57097274",
"0.5532093",
"0.5520681",
"0.5493826",
"0.5463864",
"0.54344106",
"0.54301393",
"0.5415... | 0.71257883 | 0 |
Calls the association for vendor unless nil, and returns the vendors name. | def vendor_name
vendor&.name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vendors\n fetch(@config[:sales_path], 'Sales.getVendors')\n end",
"def denormalize_vendor_name\n self.vendor_name = vendor.try(:name) if vendor_id_changed?\n end",
"def getVendors\n fetch(@config[:sales_path], 'Sales.getVendors')\n end",
"def vendor\n FarMar::Vendor.all.find {|inst... | [
"0.6861759",
"0.67460877",
"0.66345555",
"0.65800905",
"0.65171427",
"0.64869577",
"0.6462256",
"0.6462256",
"0.6458595",
"0.6408482",
"0.6378536",
"0.6343719",
"0.63358545",
"0.6308895",
"0.6294236",
"0.6282399",
"0.625751",
"0.6251122",
"0.62116283",
"0.6205272",
"0.615741"... | 0.7084646 | 0 |
Checks to see if the campus only designation is set | def campus_only?
access == 'Campus Only Access (No Proxy)'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def design_data_filled_in?\n !self.description.blank? && \n !self.platform.blank? && \n !self.product_type.blank? && \n !self.project.blank? &&\n !self.design_directory.blank? &&\n !self.incoming_directory.blank?\n end",
"def is_none_fields\n\t\tunless self.designation!=\"none\" && self.depart... | [
"0.64387053",
"0.6382764",
"0.6297314",
"0.629274",
"0.6036108",
"0.6029512",
"0.5967276",
"0.5959347",
"0.59436333",
"0.5917164",
"0.59119636",
"0.59104216",
"0.5866875",
"0.5866",
"0.58163923",
"0.58155763",
"0.5809384",
"0.57872176",
"0.57797986",
"0.5771028",
"0.57668847"... | 0.71379286 | 0 |
Creates a hash to use in the lib_guides CSV. LibGuides requries the use of these fields vendor name url enable_proxy description more_info enable_new enable_trial types keywords target slug best_bets subjects desc_pos lib_note enable_popular enable_hidden internal_note owner resource_icons thumbnail content_id | def csv_hash
{
vendor: self.vendor_name,
name: self.name,
url: self.url,
enable_proxy: self.access == 2 ? 1 : 0,
description: self.description,
more_info: '',
enable_new: self.new_database.to_i,
enable_trial: self.trial_database.to_i,
types: self.resources.pluck... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n [id, url, external_id, first_name, last_name, middle_name, birth_date, gender, language, phone, allow_phone_contact, email, allow_email_contact, notes, date_created, date_modified, ext_date_created, ext_date_modified, doc_type, doc_issuer_info, doc_series, doc_number, department_code, department_na... | [
"0.58540606",
"0.569996",
"0.569961",
"0.5690804",
"0.5656755",
"0.55939984",
"0.5590626",
"0.55799085",
"0.55768716",
"0.5380645",
"0.53769743",
"0.5376363",
"0.53473294",
"0.52938974",
"0.52769786",
"0.5270105",
"0.52567416",
"0.52555573",
"0.5247419",
"0.524464",
"0.518830... | 0.6994874 | 0 |
Creates a hash to use in the link_tracking CSV. name tracking_count | def link_tracking_csv_hash
{
name: self.name,
count: self.tracking_count
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_tracking_all_csv_hash\n {\n name: self.name,\n count: self.tracking_total_count\n }\n end",
"def tracking_total_count\n link_tracking.count\n end",
"def hash\n [event_count, hour, index_id, index_name, org_name, public_id, retention].hash\n end",
"def hash_with_meta\n ... | [
"0.7942738",
"0.655014",
"0.5951549",
"0.59169096",
"0.56994236",
"0.56967753",
"0.56949496",
"0.56888336",
"0.5644522",
"0.5614125",
"0.55630755",
"0.55587757",
"0.555015",
"0.5527527",
"0.55229855",
"0.55197436",
"0.5477085",
"0.54755986",
"0.5457154",
"0.5448609",
"0.54378... | 0.82694614 | 0 |
Creates a hash to use in the link_tracking CSV. name tracking_count | def link_tracking_all_csv_hash
{
name: self.name,
count: self.tracking_total_count
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_tracking_csv_hash\n {\n name: self.name,\n count: self.tracking_count\n }\n end",
"def tracking_total_count\n link_tracking.count\n end",
"def hash\n [event_count, hour, index_id, index_name, org_name, public_id, retention].hash\n end",
"def hash_with_meta\n to_hash.m... | [
"0.82694614",
"0.655014",
"0.5951549",
"0.59169096",
"0.56994236",
"0.56967753",
"0.56949496",
"0.56888336",
"0.5644522",
"0.5614125",
"0.55630755",
"0.55587757",
"0.555015",
"0.5527527",
"0.55229855",
"0.55197436",
"0.5477085",
"0.54755986",
"0.5457154",
"0.5448609",
"0.5437... | 0.7942738 | 1 |
Minting a UUID creates a uuid for the record to use as a stable URL. | def mint_uuid
self.url_uuid ||= Time.now.to_i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assign_uuid\n self.id = UUIDTools::UUID.timestamp_create().to_s\n end",
"def olduuid uuid\n\trf = uuid\n\trf.insert(8, \"-\")\n\trf.insert(13, \"-\")\n\trf.insert(18, \"-\")\n\trf.insert(23, \"-\")\n\treturn rf\nend",
"def assign_uuid\n self.uuid ||= SecureRandom.urlsafe_base64(8)\n end",
"def se... | [
"0.7151515",
"0.7116209",
"0.70197177",
"0.6967005",
"0.6967005",
"0.69323456",
"0.69114065",
"0.69034666",
"0.6880051",
"0.6832904",
"0.6822393",
"0.6807721",
"0.6758876",
"0.6692003",
"0.66883385",
"0.6672042",
"0.66676366",
"0.66676366",
"0.66215223",
"0.66215223",
"0.6621... | 0.73970217 | 0 |
Sanitize the Description field | def sanitize_description
self.description = Sanitize.fragment(self.description, Sanitize::Config::BASIC)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_description\n ActionView::Base.full_sanitizer.sanitize(description)\n end",
"def sanitize_description(description)\n ActionController::Base.helpers.strip_tags(description)\n end",
"def sanitize(str)\n DescriptionSanitizer.new.sanitize(str)\n end",
"def strip_html_from_descripti... | [
"0.86052674",
"0.818869",
"0.79620963",
"0.79508424",
"0.7610957",
"0.7522478",
"0.73051304",
"0.72501075",
"0.7115807",
"0.7115807",
"0.7077657",
"0.7049413",
"0.688072",
"0.6849992",
"0.68337715",
"0.67843926",
"0.67068034",
"0.66686803",
"0.6633985",
"0.6612287",
"0.659806... | 0.85810536 | 1 |
GET /address_ranges GET /address_ranges.xml | def index
@address_ranges = AddressRange.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @address_ranges }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end",
"def show\n @address_range = AddressRange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @address_range }\n end\n end",
"def addresses\n query(:address)\n... | [
"0.71258813",
"0.70020956",
"0.6716909",
"0.6642833",
"0.6642207",
"0.6616891",
"0.6436227",
"0.6320094",
"0.62539095",
"0.6191286",
"0.6138709",
"0.61239856",
"0.6113165",
"0.60821533",
"0.60797316",
"0.6066117",
"0.60290074",
"0.59926397",
"0.59444547",
"0.59332615",
"0.590... | 0.764934 | 0 |
GET /address_ranges/1 GET /address_ranges/1.xml | def show
@address_range = AddressRange.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @address_range }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @address_ranges = AddressRange.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @address_ranges }\n end\n end",
"def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end",
"def addresses\n message = { nodes: { item: reso... | [
"0.7589515",
"0.6680216",
"0.64837545",
"0.6442109",
"0.6379526",
"0.6326249",
"0.6319453",
"0.6297263",
"0.61365956",
"0.6007442",
"0.59893113",
"0.598717",
"0.59617144",
"0.5916575",
"0.5892676",
"0.5883728",
"0.58831286",
"0.5863897",
"0.58419794",
"0.5834285",
"0.5825903"... | 0.7181083 | 1 |
GET /address_ranges/new GET /address_ranges/new.xml | def new
@address_range = AddressRange.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @address_range }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @address_range = AddressRange.new(params[:address_range])\n\n respond_to do |format|\n if @address_range.save\n format.html { redirect_to(@address_range, :notice => 'Address range was successfully created.') }\n format.xml { render :xml => @address_range, :status => :created,... | [
"0.7020179",
"0.6578958",
"0.6534841",
"0.64456725",
"0.636473",
"0.63185894",
"0.6191496",
"0.61611456",
"0.6108384",
"0.6108164",
"0.61023813",
"0.60937256",
"0.60937256",
"0.60937256",
"0.60822916",
"0.60728127",
"0.6062728",
"0.60596687",
"0.60425746",
"0.6027718",
"0.601... | 0.7757886 | 0 |
POST /address_ranges POST /address_ranges.xml | def create
@address_range = AddressRange.new(params[:address_range])
respond_to do |format|
if @address_range.save
format.html { redirect_to(@address_range, :notice => 'Address range was successfully created.') }
format.xml { render :xml => @address_range, :status => :created, :location ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @address_ranges = AddressRange.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @address_ranges }\n end\n end",
"def set_Addresses(value)\n set_input(\"Addresses\", value)\n end",
"def set_Addresses(value)\n set_inpu... | [
"0.618804",
"0.57795507",
"0.57795507",
"0.57795507",
"0.5689063",
"0.56120056",
"0.55950505",
"0.55307364",
"0.54745066",
"0.5470775",
"0.5408936",
"0.5361865",
"0.53574586",
"0.5313097",
"0.5311192",
"0.53001124",
"0.52669245",
"0.52386886",
"0.5228782",
"0.52141345",
"0.51... | 0.676713 | 0 |
PUT /address_ranges/1 PUT /address_ranges/1.xml | def update
@address_range = AddressRange.find(params[:id])
respond_to do |format|
if @address_range.update_attributes(params[:address_range])
format.html { redirect_to(@address_range, :notice => 'Address range was successfully updated.') }
format.xml { head :ok }
else
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @address_range = AddressRange.find(params[:id])\n @address_range.destroy\n\n respond_to do |format|\n format.html { redirect_to(address_ranges_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @address_range = AddressRange.new(params[:address_range])\n\n res... | [
"0.6048564",
"0.6047081",
"0.5803277",
"0.5617189",
"0.55028325",
"0.5500738",
"0.549334",
"0.549334",
"0.549334",
"0.5490639",
"0.54773134",
"0.5451156",
"0.5450174",
"0.544981",
"0.5437329",
"0.5435551",
"0.5423937",
"0.5389015",
"0.5377304",
"0.5377304",
"0.53731817",
"0... | 0.6945595 | 0 |
DELETE /address_ranges/1 DELETE /address_ranges/1.xml | def destroy
@address_range = AddressRange.find(params[:id])
@address_range.destroy
respond_to do |format|
format.html { redirect_to(address_ranges_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n # @address = Address.find(params[:id])\n @address = Address.find_by_permalink!(params[:id])\n @address.destroy\n\n respond_to do |format|\n format.html { redirect_to(addresses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @addresses = Address.paginate(:... | [
"0.6621146",
"0.6513962",
"0.64668447",
"0.64514786",
"0.64365184",
"0.639238",
"0.6360946",
"0.6347938",
"0.6303641",
"0.6299742",
"0.6296713",
"0.62823236",
"0.6269874",
"0.6232789",
"0.621946",
"0.62039477",
"0.6174779",
"0.61666787",
"0.61666787",
"0.61666787",
"0.6166678... | 0.74123067 | 0 |
Returns INTEGER counting days in current month. | def days_in_current_month
current_month = Time.now.month
current_year = Time.now.year
return Time.days_in_month(current_month, current_year)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def days_in_month\n raw = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][self.month]\n self.month == 2 && leap_year? ? raw + 1 : raw\n end",
"def days_in_month\n Time.send(\"month_days\", self.year, self.month)\n end",
"def days_in_month\n @date_time_value.days_in_month... | [
"0.7958529",
"0.7760566",
"0.77477634",
"0.7633565",
"0.7561991",
"0.7361875",
"0.73452634",
"0.7280365",
"0.72696865",
"0.72352314",
"0.7186616",
"0.71821344",
"0.71554923",
"0.71471286",
"0.69383425",
"0.69253033",
"0.6899651",
"0.6887485",
"0.6853021",
"0.6853021",
"0.6833... | 0.8186216 | 0 |
Moves the current history pointer to the previous element (that is one step further in the past) and returns the newly pointed element. | def prev
@history_idx += 1 if @history_idx < @history.length - 1
current
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prev(current)\n l = current\n l = l[0,1] if (l.length > 0 and l[0,1] == '\\n')\n l = l[-1,1] if (l.length > 0 and l[-1,1] == '\\n')\n if (@position > 0)\n if (@position == (@history.length - 1))\n @history[@history.length - 1] = l\n ... | [
"0.7648471",
"0.76401293",
"0.7209635",
"0.72022784",
"0.7194428",
"0.7159589",
"0.7047654",
"0.7037475",
"0.6994902",
"0.6948232",
"0.689169",
"0.68300444",
"0.6796553",
"0.67949843",
"0.67706877",
"0.6741709",
"0.67394346",
"0.6704532",
"0.6704532",
"0.670226",
"0.66865456"... | 0.77930534 | 0 |
Moves the current history pointer to the next element (thaat is one step closer to the presetn) and returns the newly pointed element | def next
@history_idx -= 1 if @history_idx > -1
current
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_history()\r\n (@history_offset == @history_length) ? nil : @the_history[@history_offset+=1]\r\n end",
"def next_history\n if @history_index && @history_index > 0\n @history_index -= 1\n else\n @history_index = @history.size - 1\n end\n\n self.value = @history[@histo... | [
"0.73704445",
"0.7265829",
"0.7068525",
"0.67087567",
"0.6537481",
"0.6415236",
"0.63090694",
"0.62513655",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6246461",
"0.6227113",
"0.6213634",
"0.61494094",
"0.61464626",
"0.6112267... | 0.73061115 | 1 |
Resets the history pointer to the buffer element (that is the one before the first stored history element) | def rewind
@history_idx = -1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def invalidate_history!\n @history = nil\n end",
"def clear_history\n while ! Readline::HISTORY.empty? do\n Readline::HISTORY.pop\n end\n end",
"def reset_buffer(new_buf = '')\n @buf.replace new_buf\n @index = 0\n end",
"def reset_buffer(new_buf = '')\n @... | [
"0.6910569",
"0.6810145",
"0.6697332",
"0.6697332",
"0.6679277",
"0.6674285",
"0.66414785",
"0.6491298",
"0.64660424",
"0.6448663",
"0.641956",
"0.64177734",
"0.6415567",
"0.6381573",
"0.63773525",
"0.63536155",
"0.63415563",
"0.63090706",
"0.6292373",
"0.62809396",
"0.621756... | 0.78869045 | 0 |
Remove the contents of this history object and rereads the contents from the specified file if possible | def reset(filename)
@history = []
@history_idx = -1
unless filename.nil? or !File.exists? filename
@history = File.readlines(filename).map { |l| l.rstrip }.reverse
end
@backend = File.open filename, "a+" unless filename.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_history_pop(file)\n file_history = $file_history.to_h\n current_history = file_history.pop\n file_history.each_pair do |index, file_name|\n if file_name == current_history\n $file_history.delete_field(\"#{index}\")\n break\n end\n end\n end",
"def remove_file(file)\n... | [
"0.71817815",
"0.63751286",
"0.6349643",
"0.6238109",
"0.6167352",
"0.6147301",
"0.613519",
"0.60584646",
"0.6045717",
"0.5993199",
"0.5970578",
"0.595704",
"0.5955714",
"0.5949767",
"0.59279424",
"0.59141594",
"0.5882294",
"0.5870342",
"0.5870315",
"0.5845483",
"0.5841303",
... | 0.6485957 | 1 |
finds an executable in a bin/ subdirectory of kit | def find_executable(name)
@project.from_directory do
Find.find("kit") do |path|
next unless path =~ /bin\/#{name}$/
log.debug("found #{name} executable: #{path}")
return path
end
end
log.debug("#{name} executable not found")
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_executable(name)\n @project.from_directory do\n Find.find(\"kit\") do |path|\n next unless path =~ /bin\\/#{name}$/\n\n log.debug(\"found #{name} executable: #{path}\")\n return path\n end\n end\n\n log.debug(\"#{name} executable not found\")\n ... | [
"0.7895467",
"0.77567035",
"0.7591221",
"0.74290407",
"0.69405586",
"0.67673683",
"0.67673683",
"0.6649963",
"0.66474813",
"0.6564241",
"0.6562498",
"0.6555854",
"0.6535594",
"0.65153646",
"0.65153646",
"0.65153646",
"0.6509538",
"0.6509538",
"0.6509538",
"0.6509538",
"0.6509... | 0.802898 | 0 |
runs an external executable, returns true on success | def run_executable(full_commandline)
log.debug "running #{full_commandline}"
Process.wait(Process.spawn(full_commandline))
$CHILD_STATUS.exitstatus == 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(cmd)\n puts \"#{cmd}\"\n success = system(cmd)\n exit $?.exitstatus unless success\nend",
"def run_local(cmd)\n require 'English'\n\n system cmd\n return unless $CHILD_STATUS.exitstatus != 0\n puts 'exit code: ' + $CHILD_STATUS.exitstatus.to_s\n exit\nend",
"def run_and_success?(cmd)\n run(c... | [
"0.6728844",
"0.67173827",
"0.66895247",
"0.6555961",
"0.6529454",
"0.6493891",
"0.6481035",
"0.6436771",
"0.6343834",
"0.6307714",
"0.6292022",
"0.6257594",
"0.6257594",
"0.6257037",
"0.6249493",
"0.6249493",
"0.6249493",
"0.6249493",
"0.6249493",
"0.6241809",
"0.6240104",
... | 0.68685037 | 0 |
Returns the PortalState object | def portal_state
PortalState.new(@attributes.fetch('portalstate', {}))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state\n object.state_code\n end",
"def state\n State.instance\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @state\n end",
"def state\n return @... | [
"0.59792286",
"0.59518296",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5929874",
"0.5906659",
"0.5902567",
"0.5850017",
"0.584304",
"0.5839588",
"0.57897943",
"0.57891196",
"0.57562983",
"0.57551974"... | 0.87963104 | 0 |
Returns the SoftwareUpdate object | def software_update
SoftwareUpdate.new(@attributes.fetch('swupdate', {}))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_info\n @update_info ||= AssUpdater::UpdateInfo.new(self)\n end",
"def GetSuSEUpdate\n ParseInstallationKernelCmdline() if !@cmdline_parsed\n @suse_update\n end",
"def swversion\n @attributes.fetch('swversion', nil)\n end",
"def SetSystemUpdate\n if FileUtils.E... | [
"0.5878141",
"0.58539855",
"0.54987025",
"0.5446719",
"0.5428455",
"0.5419265",
"0.5419265",
"0.54175717",
"0.5409225",
"0.53936625",
"0.53472394",
"0.53249264",
"0.53140825",
"0.5305173",
"0.5304717",
"0.5264395",
"0.5261148",
"0.5254372",
"0.5246036",
"0.52016485",
"0.51739... | 0.8493367 | 0 |
Returns the WhitelistUsers collection | def whitelist_users
WhitelistUsers.new(@attributes.fetch('whitelist', {}))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_whitelist\n return FavouriteGroup.find(:first, :conditions => { :user_id => self.id, :name => FavouriteGroup::WHITELIST_NAME } )\n end",
"def users\n gateway_check\n @users\n end",
"def getUsers\n return @Users \n end",
"def list_users\n @users = User.find(:all)\n end",
... | [
"0.682823",
"0.67415094",
"0.6709476",
"0.669769",
"0.6677032",
"0.6606394",
"0.65836114",
"0.6573908",
"0.6542157",
"0.6536618",
"0.65181386",
"0.6490743",
"0.64857095",
"0.64775896",
"0.64578116",
"0.6447137",
"0.6427343",
"0.64268154",
"0.6416052",
"0.63747704",
"0.6372644... | 0.7653604 | 0 |
Returns the DHCP status | def dhcp
@attributes.fetch('dhcp', false)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dhcp?\n config[\"dhcp\"]\n end",
"def status\n logger.info \"Retrieving Vagrant status for #{description}\"\n output = connection.execute!(:status).stdout\n Derelict::Parser::Status.new(output)\n end",
"def status\n\n\t\tstat = vzctl('status', ctid).split(\" \")\n\t\tif exists?\n\... | [
"0.6808077",
"0.6267389",
"0.6238432",
"0.6195908",
"0.6152561",
"0.610695",
"0.6074891",
"0.60657024",
"0.6051591",
"0.6026054",
"0.5983046",
"0.59187996",
"0.58491516",
"0.58484167",
"0.58290845",
"0.5809957",
"0.5771963",
"0.5771963",
"0.57662857",
"0.57662857",
"0.5766285... | 0.6974938 | 0 |
GET /book_commentaries GET /book_commentaries.json | def index
@book_commentaries = BookCommentary.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n # retrieve comments from db, including the user\n comments = @book.comments.includes(:user).order(id: :desc)\n render json: comments, status: :ok\n end",
"def index\n if params[:user_id]\n @comments = find_user.comments\n render json: @comments\n elsif params[:book_i... | [
"0.7269053",
"0.6924966",
"0.6839732",
"0.6730201",
"0.65364146",
"0.6447092",
"0.64128506",
"0.6361969",
"0.6346279",
"0.63274133",
"0.62399083",
"0.6164545",
"0.61640817",
"0.61523545",
"0.6130221",
"0.6126142",
"0.61240786",
"0.6059368",
"0.6043839",
"0.60238475",
"0.60025... | 0.7526721 | 0 |
POST /book_commentaries POST /book_commentaries.json | def create
@book_commentary = BookCommentary.new(book_commentary_params)
respond_to do |format|
if @book_commentary.save
format.html { redirect_to @book_commentary.book, notice: 'Book commentary was successfully created.' }
format.json { render :show, status: :created, location: @book_com... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def book_commentary_params\n params.require(:book_commentary).permit(:commentary, :book_id)\n end",
"def create\n @book = Book.new(book_params)\n if params[:commit] == \"追加\" then\n @book.comments.build\n\n render :action => :new\n return\n end\n\n respond_to do |format|\n ... | [
"0.6826987",
"0.6520261",
"0.6514716",
"0.6291203",
"0.6246639",
"0.6140885",
"0.607609",
"0.60046864",
"0.5999688",
"0.59468454",
"0.590584",
"0.5870856",
"0.58676445",
"0.5865396",
"0.58407503",
"0.5827393",
"0.58258957",
"0.5804135",
"0.58033305",
"0.5802826",
"0.578414",
... | 0.7377099 | 0 |
PATCH/PUT /book_commentaries/1 PATCH/PUT /book_commentaries/1.json | def update
respond_to do |format|
if @book_commentary.update(book_commentary_params)
format.html { redirect_to @book_commentary.book, notice: 'Book commentary was successfully updated.' }
format.json { render :show, status: :ok, location: @book_commentary }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @book_comment.update(book_comment_params)\n format.html { redirect_to @book_comment, notice: 'Book comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_comment }\n else\n format.html { render :edit... | [
"0.6877143",
"0.67144275",
"0.6464367",
"0.64537007",
"0.64527667",
"0.635846",
"0.6312781",
"0.63031095",
"0.6302168",
"0.62990785",
"0.62827307",
"0.62820816",
"0.6276795",
"0.62756705",
"0.62756705",
"0.62756705",
"0.62756705",
"0.62756705",
"0.62756705",
"0.62756705",
"0.... | 0.71911746 | 0 |
DELETE /book_commentaries/1 DELETE /book_commentaries/1.json | def destroy
@book_commentary.destroy
respond_to do |format|
format.html { redirect_to book_commentaries_url, notice: 'Book commentary was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @book_comment.destroy\n respond_to do |format|\n format.html { redirect_to book_comments_url, notice: 'Book comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n book = Book.find(params[:id])\n book.destr... | [
"0.719447",
"0.71053886",
"0.7040906",
"0.69956386",
"0.69318724",
"0.6911507",
"0.68779343",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.68657327",
"0.6857221",
"... | 0.7600936 | 0 |
When compile_time is defined, apply the action immediately and then set the action :nothing to ensure that it does not run a second time. | def after_created
if compile_time
self.run_action(:apply)
self.action :nothing
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\n return unless compile_time\n... | [
"0.7337755",
"0.7337755",
"0.73346776",
"0.73346776",
"0.73346776",
"0.7017283",
"0.6670972",
"0.5671043",
"0.5574656",
"0.5496656",
"0.5482355",
"0.54752153",
"0.54570234",
"0.54261786",
"0.5349615",
"0.52819955",
"0.5270714",
"0.52345407",
"0.52345407",
"0.522855",
"0.52094... | 0.7755296 | 0 |
GET /pincodes GET /pincodes.json | def index
@pincodes = Pincode.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @pinns = Pinn.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pinns }\n end\n end",
"def show\n @pin = Pin.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pin }\n ... | [
"0.66209865",
"0.65024006",
"0.64920735",
"0.64920735",
"0.64606917",
"0.63331336",
"0.6213703",
"0.6092277",
"0.604419",
"0.60405517",
"0.6034724",
"0.600906",
"0.59777343",
"0.5956686",
"0.59523654",
"0.59447885",
"0.59447885",
"0.59447885",
"0.59447885",
"0.59431803",
"0.5... | 0.73530585 | 0 |
POST /pincodes POST /pincodes.json | def create
@pincode = Pincode.new(pincode_params)
respond_to do |format|
if @pincode.save
#format.html { redirect_to @pincode, notice: 'Pincode was successfully created.' }
format.html { redirect_to @pincode}
format.json { render :show, status: :created, location: @pincode }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @pin = Pin.new(pin_params)\n\n respond_to do |format|\n if @pin.save\n format.html { redirect_to @pin, notice: 'Pin was successfully created.' }\n format.json { render :show, status: :created, location: @pin }\n else\n format.html { render :new }\n format.js... | [
"0.6640933",
"0.65767336",
"0.6539915",
"0.6485346",
"0.6480422",
"0.6459656",
"0.64265215",
"0.6419159",
"0.6414415",
"0.6401089",
"0.622553",
"0.6216474",
"0.6129631",
"0.6069508",
"0.6067379",
"0.6010744",
"0.6008424",
"0.5973045",
"0.5935262",
"0.5910594",
"0.5891158",
... | 0.7291816 | 0 |
PATCH/PUT /pincodes/1 PATCH/PUT /pincodes/1.json | def update
respond_to do |format|
if @pincode.update(pincode_params)
format.html { redirect_to @pincode, notice: 'Pincode was successfully updated.' }
format.json { render :show, status: :ok, location: @pincode }
else
format.html { render :edit }
format.json { render json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\nrespond_to do |format|\nif @pin.update(pin_params)\nformat.html { redirect_to @pin, notice: 'Pin was successfully updated.' }\nformat.json { head :no_content }\nelse\nformat.html { render action: 'edit' }\nformat.json { render json: @pin.errors, status: :unprocessable_entity }\nend\nend\nend",
"def u... | [
"0.69030184",
"0.6818426",
"0.6812871",
"0.6812871",
"0.6812871",
"0.6718848",
"0.6590765",
"0.6590765",
"0.65562606",
"0.63871425",
"0.63722503",
"0.6309864",
"0.61906856",
"0.6174563",
"0.616733",
"0.615695",
"0.6151942",
"0.61344767",
"0.61334074",
"0.61328584",
"0.6077509... | 0.71307683 | 0 |
DELETE /pincodes/1 DELETE /pincodes/1.json | def destroy
@pincode.destroy
respond_to do |format|
format.html { redirect_to pincodes_url, notice: 'Pincode was successfully destroyed.' }
format.json { head :no_content }
token = session[:access_token]
url = URI.parse(ENDPOINTS_URI)
req = Net::HTTP::Get.new(url.request_uri)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n\n @pin = Pin.find(params[:id])\n @pin.destroy\n\n respond_to do |format|\n format.html { redirect_to pins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pin = Pin.find(params[:id])\n @pin.destroy\n\n respond_to do |format|\n format.html {... | [
"0.73731863",
"0.7341634",
"0.72937644",
"0.72321224",
"0.71924895",
"0.7171025",
"0.7171025",
"0.7171025",
"0.7171025",
"0.7108285",
"0.7105541",
"0.70870423",
"0.7010709",
"0.698839",
"0.698839",
"0.69621",
"0.69590116",
"0.6956193",
"0.6943747",
"0.68746156",
"0.68582976",... | 0.7403092 | 0 |
Lock the hour if explicitly set by hour_of_day, but allow for the nearest hour during DST start to keep the correct interval. | def validate_hour_lock(time, schedule)
hour = value || schedule.start_time.send(type)
hour = 24 + hour if hour < 0
if hour >= time.hour
hour - time.hour
else
if dst_offset = TimeUtil.dst_change(time)
hour - time.hour + dst_offset
else
24 - time.hour + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lazy_hour=(newhour)\n newhour = newhour.to_f\n \n #Add days for every 24 hours given.\n if newhour > 24 or newhour < 0\n days = (newhour.to_f / 24.0).floor\n newhour -= (days.to_f * 24.0)\n self.add_days(days)\n end\n \n #Convert any decimals to setting minute.\n diff = n... | [
"0.5926051",
"0.5670867",
"0.55618924",
"0.54835975",
"0.5386091",
"0.5386091",
"0.5363356",
"0.5363356",
"0.53500473",
"0.5318553",
"0.52943623",
"0.52839106",
"0.523311",
"0.52099615",
"0.52004397",
"0.5195707",
"0.51875013",
"0.5129389",
"0.5124246",
"0.5116015",
"0.510548... | 0.6800757 | 0 |
For monthly rules that have no specified day value, the validation relies on the schedule start time and jumps to include every month even if it has fewer days than the schedule's start day. Negative day values (from month end) also include all months. Positive day values are taken literally so months with fewer days w... | def validate_day_lock(time, schedule)
days_in_month = TimeUtil.days_in_month(time)
date = Date.new(time.year, time.month, time.day)
if value && value < 0
start = TimeUtil.day_of_month(value, date)
month_overflow = days_in_month - TimeUtil.days_in_next_month(time)
elsif value && ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_date_in_month(d,m)\n d >= 1 and Time.days_in_month(m,start.year) >= d ? d : raise(ArgumentError, \"invalid day #{d} for #{m}\") \n end",
"def day_not_valid?\n return impossible_day_number? && wrong_day_number_in_month\n end",
"def get_days_month(date=nil)\n date ||= @date\n\n... | [
"0.7001527",
"0.62598765",
"0.61938107",
"0.61187536",
"0.59830344",
"0.59707874",
"0.5893304",
"0.5869121",
"0.5854358",
"0.5848651",
"0.58238876",
"0.5803935",
"0.578741",
"0.5786882",
"0.57745934",
"0.5769968",
"0.57583195",
"0.5659315",
"0.56385165",
"0.5567894",
"0.55448... | 0.66260153 | 1 |
associate messages into a thread. assumes the messages are only between two people, and there cannot be any variation in from/to address names (i ignore the numbers, since sometimes they change slightly) | def threadify(messages)
last_id = {}
messages.map do |message|
last_id[message.from[0]] = message.message_id
message.in_reply_to = last_id[message.to[0]]
message
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end",
"def thread_message! message\n startt = Time.now\n\n ## build the path of msgids from leaf to ancestor\n ids = [message.safe_msgid] + message.safe_refs.reverse\n ... | [
"0.5749039",
"0.56749094",
"0.5664571",
"0.56416094",
"0.5601903",
"0.5589465",
"0.55216014",
"0.551259",
"0.5502344",
"0.5498952",
"0.5493851",
"0.5443518",
"0.542724",
"0.5423484",
"0.53741634",
"0.5358581",
"0.5355106",
"0.5331421",
"0.5331259",
"0.530086",
"0.529664",
"... | 0.7152579 | 0 |
Checks whether auto validations are currently disabled (see +disable_auto_validations+ method that takes a block) | def disabled_auto_validations?
@disable_auto_validations || false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def without_auto_validations\n previous, @disable_auto_validations = @disable_auto_validations, true\n yield\n ensure\n @disable_auto_validations = previous\n self\n end",
"def run_validations\n true\n end",
"def perform_validation?\n self.skip... | [
"0.72191864",
"0.70191395",
"0.677645",
"0.6667524",
"0.65297925",
"0.6347098",
"0.6329164",
"0.6315907",
"0.6284857",
"0.6218642",
"0.6195896",
"0.61859536",
"0.6157636",
"0.6151492",
"0.6151492",
"0.6143809",
"0.6104223",
"0.5998064",
"0.59955347",
"0.597162",
"0.59692377",... | 0.8485069 | 0 |
Disable generation of validations for the duration of the given block | def without_auto_validations
previous, @disable_auto_validations = @disable_auto_validations, true
yield
ensure
@disable_auto_validations = previous
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eval_validation_directives_block(state, &block)\n # each validate block should be a \"fresh start\" and not interfere with the\n # previous blocks\n state.singleton_class.clear_validators!\n state.singleton_class.class_eval(&block)\n\n state.validate || invalid!(sta... | [
"0.62083584",
"0.61888754",
"0.61296207",
"0.60618997",
"0.6052558",
"0.6046336",
"0.5999179",
"0.5992014",
"0.5943124",
"0.5930466",
"0.5856872",
"0.584841",
"0.582962",
"0.5810356",
"0.5808401",
"0.5782497",
"0.57733977",
"0.57358164",
"0.570605",
"0.5702345",
"0.5702345",
... | 0.6628382 | 0 |
Pwrake version of backquote command | def pwrake_backquote(cmd)
conn = Pwrake::Shell.current
if conn.kind_of?(Pwrake::Shell)
res = conn.backquote(*cmd)
status = Rake::PseudoStatus.new(conn.status)
else
res = `#{cmd}`
status = $?
status = Rake::PseudoStatus.new(1) if status.nil?
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quote\n %q[(?:\"|')?]\n end",
"def requote(value) return restore_ends(value, '\"') end",
"def change_quotemarks!\n local_copy.in_place :perl, \"s/\\\"/'/g\"\n end",
"def shq(s) # sh(1)-style quoting\n sprintf(\"'%s'\", s.gsub(/'/, \"'\\\\\\\\''\"))\nend",
"def unquote\n\t\teach { |e| ... | [
"0.61661613",
"0.60998255",
"0.5990482",
"0.5903647",
"0.5884288",
"0.58399826",
"0.5773177",
"0.57671887",
"0.57631254",
"0.5745385",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"0.57357204",
"... | 0.74655515 | 0 |
Returns all patients with a viral load in the selected range and the regimens they are on the given point in time. | def patients
Observation.select('patient_id, birthdate, patient_current_regimen(patient_id, obs_datetime) as regimen')
.joins(:encounter)
.joins('INNER JOIN person USING (person_id)')
.where(concept_id: ConceptName.find_by_name('Viral load').concept_id,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_visiting_patients(date)\n day_start, day_end = TimeUtils.day_bounds(date)\n Patient.find_by_sql(\n [\n 'SELECT patient.* FROM patient INNER JOIN encounter USING (patient_id)\n WHERE encounter.encounter_datetime BETWEEN ? AND ?\n AND encounter.voided = 0 AND patient.voide... | [
"0.5873042",
"0.5644456",
"0.5568839",
"0.5292783",
"0.5276463",
"0.52721125",
"0.5224486",
"0.5165538",
"0.5164641",
"0.513881",
"0.51188076",
"0.5094088",
"0.5060091",
"0.50489724",
"0.5042062",
"0.5038151",
"0.49660924",
"0.4962078",
"0.493262",
"0.493262",
"0.49099264",
... | 0.6235888 | 0 |
Insert game_object into the map | def insert(game_object)
start_x = ( game_object.bb.left / @grid[0] ).to_i
stop_x = ( game_object.bb.right / @grid[0] ).to_i
(start_x ... stop_x).each do |x|
start_y = ( game_object.bb.top / @grid[1] ).to_i
stop_y = ( game_object.bb.bottom / @grid[1] ).to_i
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert_object(object, map)\r\n if map[object.handle.to_s].nil?\r\n map[object.handle.to_s] = object\r\n end\r\n end",
"def insert_object g\n @objects.add g\n end",
"def << game_object\n @mutex.synchronize do\n @ghash[game_object.game_object_id] = game_object\n end\n end"... | [
"0.7335261",
"0.7278942",
"0.7018534",
"0.6873131",
"0.68568444",
"0.67495483",
"0.65670407",
"0.6445105",
"0.6411099",
"0.6343711",
"0.63436955",
"0.63297254",
"0.62959",
"0.62278605",
"0.61978894",
"0.61600703",
"0.6109239",
"0.6107178",
"0.608967",
"0.60234284",
"0.5992161... | 0.77957714 | 0 |
Removes a specific game object from the map, replace the cellvalue with nil | def delete(game_object)
range_x, range_y = @game_object_positions[game_object]
return unless range_x && range_y
range_x.each do |x|
range_y.each do |y|
@map[x][y] = nil
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove!(jumped_pos)\n board[jumped_pos] = nil\n end",
"def clear_at(cell)\n coordinate = @board_map.fetch(cell)\n set_cell(coordinate[0],coordinate[1],cell)\n end",
"def delete_object(x, y)\n @generator_flag = false if @grid[y][x].object.class == MapAbxn::Generator\n @grid[y][x] ... | [
"0.6912418",
"0.6892103",
"0.67292494",
"0.63333184",
"0.6273143",
"0.6214252",
"0.61556935",
"0.6099111",
"0.6014436",
"0.59929305",
"0.5987733",
"0.5987733",
"0.59856796",
"0.59667414",
"0.5956288",
"0.5935599",
"0.5918449",
"0.5918449",
"0.59118706",
"0.5907783",
"0.589930... | 0.71792775 | 0 |
Clear the game object residing in the cell given by real world coordinates x/y | def clear_at(x, y)
lookup_x = (x / @grid[0]).to_i
lookup_y = (y / @grid[1]).to_i
@map[lookup_x][lookup_y] = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_at(cell)\n coordinate = @board_map.fetch(cell)\n set_cell(coordinate[0],coordinate[1],cell)\n end",
"def clear(row, col)\n cell = @grid[row][col]\n cell.clear = true\n cell.detonated?\n end",
"def clear\n @x = 0.0\n @y = 0.0\n end",
"def clear(x,y)\n if getsq(... | [
"0.7377549",
"0.72605497",
"0.7105468",
"0.7035787",
"0.6756658",
"0.67354476",
"0.66895396",
"0.66590184",
"0.6643097",
"0.664032",
"0.65423584",
"0.6502671",
"0.6464164",
"0.6455628",
"0.6430879",
"0.63509613",
"0.6348454",
"0.6347402",
"0.63472384",
"0.63088566",
"0.627655... | 0.77544993 | 0 |
Return the first game object occupying any of the cells that given 'game_object' covers | def from_game_object(game_object)
start_x = (game_object.bb.left / @grid[0]).to_i
stop_x = (game_object.bb.right / @grid[0]).to_i
(start_x .. stop_x).each do |x|
start_y = (game_object.bb.top / @grid[1]).to_i
stop_y = (game_object.bb.bottom / @grid[1]).to_i
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object\n next_x = @cur_x + DIRECTION[@hero_direction][0]\n next_y = @cur_y + DIRECTION[@hero_direction][1]\n return if next_x < 0 || next_x > 14 || next_y < 0 || next_y > 14\n #look at new square in room\n next_square = @room[next_x][next_y]\n if next_square == CHAR_POTION || ... | [
"0.63153857",
"0.6085368",
"0.59655094",
"0.5937466",
"0.5867346",
"0.577208",
"0.5715233",
"0.5714156",
"0.56617445",
"0.56548476",
"0.55852556",
"0.5571266",
"0.55704904",
"0.5519726",
"0.5486104",
"0.54313165",
"0.5396928",
"0.53897804",
"0.5383057",
"0.5380996",
"0.536082... | 0.6868127 | 0 |
Yields all game objects occupying any of the cells that given 'game_object' covers | def each_collision(game_object)
start_x = (game_object.bb.left / @grid[0]).to_i
stop_x = (game_object.bb.right / @grid[0]).to_i
(start_x ... stop_x).each do |x|
start_y = (game_object.bb.top / @grid[1]).to_i
stop_y = (game_object.bb.bottom / @grid[1]).to_i
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scan_cells(&block)\n scan_all(cells_criteria, &block)\n end",
"def from_game_object(game_object)\r\n start_x = (game_object.bb.left / @grid[0]).to_i\r\n stop_x = (game_object.bb.right / @grid[0]).to_i\r\n \r\n (start_x .. stop_x).each do |x|\r\n start_y = (game_object.bb.t... | [
"0.5865903",
"0.5782244",
"0.57566696",
"0.57566696",
"0.5697716",
"0.56021726",
"0.5548103",
"0.55251366",
"0.54347396",
"0.5401786",
"0.53337115",
"0.5326179",
"0.5289907",
"0.5274942",
"0.5254335",
"0.51963204",
"0.51589024",
"0.5103795",
"0.51024944",
"0.51024944",
"0.505... | 0.6755905 | 0 |
Initialize auditor proxy with given audit id === Parameters audit_id(Integer):: ID of audit entry that should be appended to | def initialize(audit_id)
@audit_id = audit_id
@buffer = ''
@timer = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(audit_id)\n @audit_id = audit_id\n @size = 0\n @buffer = ''\n @mutex = Mutex.new\n end",
"def set_audit_trail\n @audit_trail = AuditTrail.find(params[:id])\n end",
"def set_audit\n @audit = Audit.find(params[:id])\n end",
"def set_audit\n @... | [
"0.6672957",
"0.66558164",
"0.6623255",
"0.6609278",
"0.6609278",
"0.6609278",
"0.6347319",
"0.5956987",
"0.5813992",
"0.57651794",
"0.54123336",
"0.54123336",
"0.54123336",
"0.5396907",
"0.5396907",
"0.53919405",
"0.53872263",
"0.5371375",
"0.53407997",
"0.53042173",
"0.5291... | 0.70679754 | 0 |
Start new audit section === Parameters title(String):: Title of new audit section, will replace audit status as well options[:category](String):: Optional, must be one of RightScale::EventCategories::CATEGORIES === Return true:: Always return true | def create_new_section(title, options={})
send_request('create_new_section', normalize_options(title, options))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_section(title, options={})\n send_audit(:kind => :new_section, :text => title, :category => options[:category])\n end",
"def start_section(level, title)\n end",
"def audit_create\n if self.class.auditing_enabled\n write_audit(:create)\n end\n true... | [
"0.73888993",
"0.56593436",
"0.55276334",
"0.5206795",
"0.51364654",
"0.4957813",
"0.4898732",
"0.48579478",
"0.48226672",
"0.47788987",
"0.4730682",
"0.46824598",
"0.46711978",
"0.46370515",
"0.46322766",
"0.46135393",
"0.46021947",
"0.4595317",
"0.45554098",
"0.4524991",
"0... | 0.5897409 | 1 |
Append output to current audit section === Parameters text(String):: Output to append to audit entry === Return true:: Always return true | def append_output(text)
EM.next_tick do
@buffer << text
if @buffer.size > MIN_AUDIT_SIZE
flush_buffer
else
reset_timer
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_log_text(text)\n self.log_text = \"\" if self.log_text.nil?\n self.log_text += text + \"\\n\"\n end",
"def append_changes_to_existing_text\n return @append_changes_to_existing_text\n end",
"def append_info(text, options={})\n send_audit(:kind => :info, :text ... | [
"0.668661",
"0.65745723",
"0.6496115",
"0.64246005",
"0.6338253",
"0.6125426",
"0.6090944",
"0.60546625",
"0.59142715",
"0.5893096",
"0.5879269",
"0.5794972",
"0.5742017",
"0.5698856",
"0.56838536",
"0.56573397",
"0.56521744",
"0.56470317",
"0.56370914",
"0.5546997",
"0.55327... | 0.69587207 | 0 |
Append info text to current audit section. A special marker will be prepended to each line of audit to indicate that text is not some output. Text will be linewrapped. === Parameters text(String):: Informational text to append to audit entry options[:category](String):: Optional, must be one of RightScale::EventCategor... | def append_info(text, options={})
options[:category] ||= EventCategories::NONE # Do not event by default
send_request('append_info', normalize_options(text, options))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_info(text, options={})\n send_audit(:kind => :info, :text => text, :category => options[:category])\n end",
"def add_log_text(text)\n self.log_text = \"\" if self.log_text.nil?\n self.log_text += text + \"\\n\"\n end",
"def append_output(text)\n EM.next_tick do\n @bu... | [
"0.8102762",
"0.6049828",
"0.5541821",
"0.54422396",
"0.5223464",
"0.5218588",
"0.51746696",
"0.51523423",
"0.5133926",
"0.5130126",
"0.5128555",
"0.5081727",
"0.5050941",
"0.50506866",
"0.5019863",
"0.49904555",
"0.49424884",
"0.4918231",
"0.49061364",
"0.4903813",
"0.489946... | 0.7396576 | 1 |
Actually send audits to core agent and log failures === Parameters request(String):: Request that should be sent to auditor actor text(String):: Text to be audited === Return true:: Always return true | def internal_send_request(request, options)
log_method = request == 'append_error' ? :error : :info
log_text = AuditFormatter.send(format_method(request), options[:text])[:detail]
log_text.chomp.split("\n").each { |l| RightLinkLog.__send__(log_method, l) }
options[:audit_id] = @audit_id
Ri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setMessage(content, isRequest)\n\n @txt_input.text = \"Text is not Modified.\".to_java_bytes if @txt_input.textModified\n\n if isRequest\n makelog \"start request audit\"\n @txt_input.text = \"HTTP Request is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n resultlist =... | [
"0.5594382",
"0.54898816",
"0.5463866",
"0.53713053",
"0.52279836",
"0.52273935",
"0.51133627",
"0.51123583",
"0.5106037",
"0.5105007",
"0.50954145",
"0.506699",
"0.5065968",
"0.5065968",
"0.50434613",
"0.5024757",
"0.5018423",
"0.5017952",
"0.501069",
"0.5003455",
"0.4999490... | 0.68053806 | 0 |
Normalize options for creating new audit section of updating audit summary === Parameters text(String):: New section title or new status options(Hash):: Optional hash specifying category === Return opts(Hash):: Options hash ready for calling corresponding auditor operation | def normalize_options(text, options)
opts = options || {}
opts[:text] = text
opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION
unless EventCategories::CATEGORIES.include?(opts[:category])
RightLinkLog.warn("Invalid notification category '#{opts[:category]}', using generic catego... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_options(text, options)\n if text.is_a? Hash\n # we need to dup the text object because we're deleting keys from this object which manipulates the object passed in here\n # if this object is reused after beeing injected into this component, the keys would be missing\n ... | [
"0.58698285",
"0.56669676",
"0.56419086",
"0.5485371",
"0.5347494",
"0.5022771",
"0.49565056",
"0.49172178",
"0.4915692",
"0.49007463",
"0.48998454",
"0.48915353",
"0.48915353",
"0.48280305",
"0.48031807",
"0.4754392",
"0.47411186",
"0.47337097",
"0.47330752",
"0.4727763",
"0... | 0.67551696 | 0 |
Audit formatter method to call to format message sent through +request+ === Parameters request(String):: Request used to audit text === Return method(Symbol):: Corresponding audit formatter method | def format_method(request)
method = case request
when 'update_status' then :status
when 'create_new_section' then :new_section
when 'append_output' then :output
when 'append_info' then :info
when 'append_error' then :error
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def internal_send_request(request, options)\n log_method = request == 'append_error' ? :error : :info\n log_text = AuditFormatter.send(format_method(request), options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| RightLinkLog.__send__(log_method, l) }\n options[:audit_id] = @audit... | [
"0.5900999",
"0.5893942",
"0.5893942",
"0.58552265",
"0.5797278",
"0.57363343",
"0.5613109",
"0.5613109",
"0.560822",
"0.5553612",
"0.5510399",
"0.5501452",
"0.54906946",
"0.54812396",
"0.5450201",
"0.54351956",
"0.54351956",
"0.54080254",
"0.53963983",
"0.53963983",
"0.53963... | 0.6902804 | 0 |
Toolbar configuration for CKEditor | def editor_toolbar
[
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_toolbars\n # TODO\n end",
"def toolbar\n @css_class << 'toolbar'\n return self\n end",
"def load_toolbar\n @nav_body_content = \"admin/assignments/toolbar\"\n end",
"def configuration(*args)\n result = @@toolbar_config ||=\n YAML.load_file(RedmineCkeditor::... | [
"0.71775883",
"0.6951312",
"0.6895092",
"0.679198",
"0.6313865",
"0.6313865",
"0.62365603",
"0.6226606",
"0.6161785",
"0.61287934",
"0.60430986",
"0.57587034",
"0.5718484",
"0.5607573",
"0.5573634",
"0.55553687",
"0.5534893",
"0.5523974",
"0.55203676",
"0.5507239",
"0.5502666... | 0.7525186 | 0 |
store the last visited controller action | def last_visited(action_name, controller_name)
if(action_name =='find' and controller_name == 'search')
session[:action]='back'
session[:controller]=controller_name
elsif(action_name =='index' and controller_name == 'main_menu')
session[:action]=action_name
session[:controller]=c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_action\n Rails.application.routes.recognize_path(request.referrer)[:action]\n end",
"def store_location\n unless controller_name == \"sessions\" || action_name == \"activate\"\n session[:return_to] =\n if request.get?\n request.request_uri\n else\n request.... | [
"0.7239229",
"0.65947676",
"0.65531045",
"0.6485375",
"0.63915485",
"0.63915485",
"0.63915485",
"0.63915485",
"0.63915485",
"0.63915485",
"0.63901985",
"0.63856924",
"0.6344792",
"0.631518",
"0.62859535",
"0.6241631",
"0.62188554",
"0.61764526",
"0.6174074",
"0.6171718",
"0.6... | 0.78936595 | 0 |
POST /countries POST /countries.json | def create
@country = Country.new(country_params)
if @country.save
render json: @country, status: :created, location: @country
else
render json: @country.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @country = Country.create!(valid_params)\n json_response(@country, :created)\n end",
"def create\n @countries = Countries.new(params[:countries])\n\n respond_to do |format|\n if @countries.save\n flash[:notice] = 'Countries was successfully created.'\n forma... | [
"0.6796667",
"0.67311287",
"0.6698475",
"0.6669663",
"0.6616013",
"0.66079766",
"0.6571803",
"0.6571803",
"0.6502894",
"0.6424183",
"0.63651943",
"0.6294456",
"0.6235747",
"0.6230718",
"0.62012476",
"0.619645",
"0.61840296",
"0.61809963",
"0.6166233",
"0.61520326",
"0.6140303... | 0.70150197 | 0 |
PATCH/PUT /countries/1 PATCH/PUT /countries/1.json | def update
@country = Country.find(params[:id])
if @country.update(country_params)
head :no_content
else
render json: @country.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @country = Country.find(params[:id])\n if @country.update_attributes(:name=>params[:body][:country])\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@country.errors)\n end\n end",
"def update\n @country = Country.find(params[:id])\n\n respond_to ... | [
"0.67843103",
"0.65163016",
"0.65161604",
"0.64781624",
"0.64471155",
"0.64471155",
"0.6271849",
"0.62705564",
"0.62705564",
"0.62290484",
"0.6198192",
"0.61881363",
"0.61826915",
"0.61327964",
"0.61049324",
"0.6103624",
"0.6080693",
"0.60623884",
"0.60623884",
"0.60549664",
... | 0.67023206 | 1 |
Gets the assignedUserPrincipalName property value. UPN of the user the device will be assigned | def assigned_user_principal_name
return @assigned_user_principal_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assigned_user_principal_name=(value)\n @assigned_user_principal_name = value\n end",
"def assigned_user\n User.find_by_id(assigned_id).full_name\n end",
"def assigned_user_name(issue)\n if has_assigned_user?(issue)\n User.find_by(id: issue.user_issue.user_id).name\n ... | [
"0.711039",
"0.6570505",
"0.6569766",
"0.6473234",
"0.6473234",
"0.6473234",
"0.6473234",
"0.6473234",
"0.62527835",
"0.62527835",
"0.62527835",
"0.6228687",
"0.6213782",
"0.61877847",
"0.6187155",
"0.61507785",
"0.61430955",
"0.61430955",
"0.61430955",
"0.61430955",
"0.61430... | 0.76104075 | 0 |
Sets the assignedUserPrincipalName property value. UPN of the user the device will be assigned | def assigned_user_principal_name=(value)
@assigned_user_principal_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_principal_name=(value)\n @user_principal_name = value\n end",
"def user_principal_name=(value)\n @user_principal_name = value\n end",
"def user_principal_name=(value)\n @user_principal_name = value\n end",
"def user_princi... | [
"0.64495754",
"0.64495754",
"0.64495754",
"0.64495754",
"0.64495754",
"0.62757325",
"0.6000005",
"0.59446996",
"0.59135413",
"0.58558893",
"0.58558893",
"0.58558893",
"0.5779624",
"0.571185",
"0.5684831",
"0.5684831",
"0.5671444",
"0.5671299",
"0.5668903",
"0.5653878",
"0.561... | 0.76899457 | 0 |
Gets the groupTag property value. Group Tag of the Windows autopilot device. | def group_tag
return @group_tag
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_tag=(value)\n @group_tag = value\n end",
"def group\n @group.name\n end",
"def group\n return @group\n end",
"def group\n return @group\n end",
"def device_tag\n return @device_tag\n en... | [
"0.72739",
"0.6650034",
"0.6575842",
"0.6575842",
"0.6474362",
"0.639696",
"0.63197726",
"0.63156873",
"0.6269976",
"0.6268997",
"0.6258324",
"0.6226683",
"0.62137276",
"0.62137276",
"0.61333174",
"0.6128991",
"0.6121046",
"0.61202705",
"0.6103257",
"0.60861814",
"0.6079471",... | 0.7440861 | 0 |
Sets the groupTag property value. Group Tag of the Windows autopilot device. | def group_tag=(value)
@group_tag = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_group(group)\n send_request(FUNCTION_SET_GROUP, [group], 'k4', 0, '')\n end",
"def group=(value)\n @group = value\n end",
"def group=(value)\n @group = value\n end",
"def set_group(param)\n @group = param\n end",
"def tag(t... | [
"0.6995956",
"0.69234306",
"0.69234306",
"0.6817846",
"0.65841335",
"0.6557671",
"0.6365477",
"0.63241565",
"0.6316847",
"0.62117404",
"0.62117404",
"0.62117404",
"0.62117404",
"0.62117404",
"0.62117404",
"0.62117404",
"0.6177378",
"0.6153126",
"0.61382973",
"0.6099297",
"0.6... | 0.79322875 | 0 |
Gets the hardwareIdentifier property value. Hardware Blob of the Windows autopilot device. | def hardware_identifier
return @hardware_identifier
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hardware_identifier=(value)\n @hardware_identifier = value\n end",
"def hardware_id\n config.hardware_id ||= \"aal-#{SecureRandom.uuid}\"\n end",
"def physical_device_id\n return @physical_device_id\n end",
"def hardware_node\n ... | [
"0.7267722",
"0.6816238",
"0.66773564",
"0.64218706",
"0.6417946",
"0.6249328",
"0.61052483",
"0.59381914",
"0.59381914",
"0.59381914",
"0.59381914",
"0.5927582",
"0.5761347",
"0.5741232",
"0.5711874",
"0.5550906",
"0.5550906",
"0.5550906",
"0.55166835",
"0.55166835",
"0.5516... | 0.8226272 | 0 |
Sets the hardwareIdentifier property value. Hardware Blob of the Windows autopilot device. | def hardware_identifier=(value)
@hardware_identifier = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hardware_identifier\n return @hardware_identifier\n end",
"def hardware_id\n config.hardware_id ||= \"aal-#{SecureRandom.uuid}\"\n end",
"def set_hardware\n @hardware = Hardware.find(params[:id])\n end",
"def set_hardware\n @hardware = Hardware.find(params[:... | [
"0.7052961",
"0.6750583",
"0.67390734",
"0.67390734",
"0.67390734",
"0.6581593",
"0.56818354",
"0.56209815",
"0.54742146",
"0.54734427",
"0.54734427",
"0.54734427",
"0.54734427",
"0.5430827",
"0.5416021",
"0.53931653",
"0.5378978",
"0.53646004",
"0.52603596",
"0.522259",
"0.5... | 0.8225751 | 0 |
Gets the importId property value. The Import Id of the Windows autopilot device. | def import_id
return @import_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def import_id=(value)\n @import_id = value\n end",
"def set_import\n @import = Import.find(params[:id])\n end",
"def set_import\n @import = Import.find(params[:id])\n end",
"def set_import\n @import = Import.find(params[:id])\n end",
"def o_id\n return... | [
"0.7528263",
"0.56846404",
"0.56846404",
"0.56846404",
"0.5631391",
"0.5570709",
"0.5436435",
"0.52523243",
"0.5170957",
"0.5113595",
"0.5111083",
"0.5110832",
"0.50994015",
"0.5068636",
"0.50657415",
"0.5061992",
"0.5054191",
"0.50173575",
"0.49988312",
"0.4989196",
"0.49891... | 0.8241686 | 0 |
Sets the importId property value. The Import Id of the Windows autopilot device. | def import_id=(value)
@import_id = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_import\n @import = Import.find(params[:id])\n end",
"def set_import\n @import = Import.find(params[:id])\n end",
"def set_import\n @import = Import.find(params[:id])\n end",
"def set_imports_import\n @imports_import = Imports::Import.find(params[:imports_import_id])\n ... | [
"0.71332693",
"0.71332693",
"0.71332693",
"0.69587696",
"0.69079155",
"0.6735145",
"0.6099198",
"0.60803604",
"0.60089505",
"0.5708596",
"0.5529925",
"0.55043834",
"0.5451965",
"0.5360999",
"0.5251674",
"0.5168001",
"0.51387125",
"0.51029664",
"0.5060682",
"0.50552183",
"0.50... | 0.8216101 | 0 |
Gets the productKey property value. Product Key of the Windows autopilot device. | def product_key
return @product_key
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_key=(value)\n @product_key = value\n end",
"def product_key=(value)\n @product_key = value\n end",
"def product_id\n read('product_id')\n end",
"def get_product_key(mfg, product)\n data = YAML.load(open_file('tires', mfg))\n ... | [
"0.71052",
"0.71052",
"0.65456605",
"0.6536803",
"0.6341489",
"0.59433043",
"0.5859368",
"0.5786929",
"0.57842684",
"0.57315797",
"0.56997687",
"0.56843996",
"0.56843996",
"0.5618955",
"0.5618955",
"0.5616199",
"0.5596805",
"0.5596805",
"0.55737513",
"0.55473846",
"0.5533415"... | 0.77352536 | 1 |
Sets the productKey property value. Product Key of the Windows autopilot device. | def product_key=(value)
@product_key = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_key\n return @product_key\n end",
"def product_key\n return @product_key\n end",
"def set_Product(value)\n set_input(\"Product\", value)\n end",
"def set_product\n @product = current_api_v1_user.products.find(params[:id])\n e... | [
"0.631538",
"0.631538",
"0.62289715",
"0.595696",
"0.59250706",
"0.5784014",
"0.5782986",
"0.569839",
"0.56960464",
"0.5683324",
"0.5668215",
"0.5625743",
"0.5609744",
"0.5609506",
"0.5575163",
"0.55740464",
"0.556353",
"0.55520785",
"0.55420566",
"0.55420566",
"0.55420566",
... | 0.775446 | 1 |
Gets the serialNumber property value. Serial number of the Windows autopilot device. | def serial_number
return @serial_number
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serial\n fetch('device.serial')\n end",
"def serial_number; Common.serial_number(@handle); end",
"def serial_number=(value)\n @serial_number = value\n end",
"def get_serial_number(data)\n data['product']['serial_number'] || 'n/a'\n end",
"def serial_value(seria... | [
"0.76277477",
"0.72662205",
"0.71312696",
"0.6519197",
"0.6414575",
"0.6366991",
"0.63403445",
"0.62553483",
"0.6236588",
"0.62254167",
"0.61764246",
"0.6069209",
"0.5968872",
"0.5964111",
"0.5946545",
"0.59112406",
"0.5675265",
"0.5640561",
"0.55946356",
"0.55946356",
"0.557... | 0.7828287 | 0 |
Sets the serialNumber property value. Serial number of the Windows autopilot device. | def serial_number=(value)
@serial_number = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n _get_serial_number\n end\n _backup filename\n ... | [
"0.68039805",
"0.6481677",
"0.6414766",
"0.6243922",
"0.6243922",
"0.6036031",
"0.5881071",
"0.56531096",
"0.56531096",
"0.56011415",
"0.5586165",
"0.53466207",
"0.53370655",
"0.52936906",
"0.5254781",
"0.5181164",
"0.5111061",
"0.50999695",
"0.50883293",
"0.5063474",
"0.5041... | 0.7994854 | 0 |
GET /consignments GET /consignments.json | def index
@consignments = Consignment.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @consignees = Consignee.all\n end",
"def index\n @consents = Consent.all\n render json: @consents\n end",
"def index\n @concerts = Concert.all\n end",
"def index\n @concerts = Concert.all\n end",
"def index\n @concerts = Concert.all\n end",
"def index\n @concerts = C... | [
"0.65958065",
"0.6586459",
"0.631165",
"0.631165",
"0.631165",
"0.631165",
"0.6124376",
"0.6124376",
"0.6117937",
"0.6021862",
"0.59828436",
"0.5871482",
"0.5787465",
"0.57773304",
"0.56654274",
"0.5660294",
"0.56458366",
"0.56456226",
"0.5644179",
"0.5611808",
"0.55818397",
... | 0.7629327 | 0 |
POST /consignments POST /consignments.json | def create
@consignment = Consignment.new(consignment_params)
respond_to do |format|
if @consignment.save
format.html { redirect_to @consignment, notice: 'Consignment was successfully created.' }
format.json { render action: 'show', status: :created, location: @consignment }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html {redirect_to @consignment, notice: 'Consignment was successfully created.'}\n format.json {render :show, status: :created, location: @consignment}\n else\n ... | [
"0.6604186",
"0.6229841",
"0.58449376",
"0.58449376",
"0.58073545",
"0.5775212",
"0.57567745",
"0.571386",
"0.56987745",
"0.56949973",
"0.5642516",
"0.55265236",
"0.54432213",
"0.5442408",
"0.54422826",
"0.5436934",
"0.53627443",
"0.53457934",
"0.5338138",
"0.53258866",
"0.53... | 0.66653985 | 0 |
PATCH/PUT /consignments/1 PATCH/PUT /consignments/1.json | def update
respond_to do |format|
if @consignment.update(consignment_params)
format.html { redirect_to @consignment, notice: 'Consignment was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @consignment.update(consignment_params)\n format.html {redirect_to @consignment, notice: 'Consignment was successfully updated.'}\n format.json {render :show, status: :ok, location: @consignment}\n else\n format.html {render :edit}\n ... | [
"0.6403328",
"0.6294707",
"0.6294707",
"0.61792785",
"0.61617196",
"0.60776126",
"0.6048915",
"0.6040333",
"0.6033305",
"0.59755737",
"0.59654635",
"0.59556365",
"0.59541935",
"0.59223056",
"0.5919229",
"0.59164006",
"0.5899871",
"0.5894683",
"0.58939004",
"0.5884851",
"0.588... | 0.6564134 | 0 |
DELETE /consignments/1 DELETE /consignments/1.json | def destroy
@consignment.destroy
respond_to do |format|
format.html { redirect_to consignments_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @consignment.destroy\n respond_to do |format|\n format.html {redirect_to consignments_url, notice: 'Consignment was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @concert.destroy\n respond_to do |format|\n format.html { redire... | [
"0.7197135",
"0.7153355",
"0.7153355",
"0.7153355",
"0.7153081",
"0.7095347",
"0.70908487",
"0.6935456",
"0.69350666",
"0.69225204",
"0.6900589",
"0.6899424",
"0.688592",
"0.6876435",
"0.6813495",
"0.67988205",
"0.6797606",
"0.67936486",
"0.67827827",
"0.67798585",
"0.6765328... | 0.7501797 | 0 |
Wait for CR reception | def wait_cr(tmo=nil)
t = Machine.millis + tmo if tmo
loop {
rsp = self.gets
return rsp.chomp if rsp.size > 0
raise "XBee response timeout" if t && t <= Machine.millis
Machine.delay(10)
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_cr(tmo=nil)\n tmo += Machine.millis if tmo\n s = \"\"\n while true\n c = @wifi.getc\n return s if c == CR\n if c\n s << c\n else\n raise \"XBee-wifi response timeout #{s}\" if tmo && tmo <= Machine.millis\n Machine.delay(1)\n end... | [
"0.6965205",
"0.61147755",
"0.61147755",
"0.61147755",
"0.6060272",
"0.6046571",
"0.6046426",
"0.60385346",
"0.60335195",
"0.6018435",
"0.6004146",
"0.60003126",
"0.59788054",
"0.5954433",
"0.59417325",
"0.59417325",
"0.5935579",
"0.58947027",
"0.5872913",
"0.5872913",
"0.584... | 0.6982404 | 0 |
Enter AT command mode | def enter_at_mode
while gets.size > 0; end # discard remain data
Machine.delay(1000) # wait 1 second
loop {
self.write '+'; Machine.delay(1)
self.write '+'; Machine.delay(1)
self.write '+'
Machine.delay(1000) # wait 1 second
rsp = self.gets
return rsp i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n ... | [
"0.79628927",
"0.6037958",
"0.59522617",
"0.5886517",
"0.5865999",
"0.5796071",
"0.568493",
"0.5670516",
"0.56375766",
"0.5600464",
"0.5562368",
"0.5549148",
"0.5516799",
"0.54940027",
"0.54439783",
"0.54282176",
"0.54164267",
"0.54159",
"0.54127866",
"0.53951305",
"0.5360886... | 0.6227585 | 1 |
Leave AT command mode | def leave_at_mode
at_cr('atcn', 1000)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n ... | [
"0.65236264",
"0.5687906",
"0.5608127",
"0.5498567",
"0.5478476",
"0.54426515",
"0.5437525",
"0.54296577",
"0.5415443",
"0.5314649",
"0.52843994",
"0.52319396",
"0.5220315",
"0.5208994",
"0.51994467",
"0.5198483",
"0.51576954",
"0.5143111",
"0.51408416",
"0.51394117",
"0.5133... | 0.70869315 | 0 |
run processes the issue and queues up an issue job. | def run
case issue.action
when "opened"
job = PuppetLabs::Trello::TrelloIssueJob.new
job.issue = issue
delayed_job = job.queue
logger.info "Successfully queued up opened issue #{issue.repo_name}/#{issue.number} as job #{delayed_job.id}"
body = {
'job_id' => delayed_job.id,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n process_queue\n RailsPipeline.logger.info \"Queue: '#{@queue}'. Processed: #{@processed}\"\n if Time.now - @failure_last_checked > @failure_check_interval\n @failure_last_checked = Time.now\n check_for_failures\n end\n end",
"def queue_job; end",
"def work\n ... | [
"0.65592515",
"0.64498305",
"0.6415142",
"0.62587124",
"0.61834025",
"0.61501986",
"0.61204076",
"0.61118776",
"0.60305685",
"0.59963465",
"0.59804034",
"0.59628177",
"0.5936655",
"0.5936655",
"0.59322083",
"0.5904609",
"0.5882505",
"0.5876635",
"0.5872128",
"0.58446383",
"0.... | 0.7201812 | 0 |
Skip spaces from given position. | def skipSpaces(pos)
max = @src.length
while pos < max
ch = charCodeAt(@src, pos)
break if !isSpace(ch)
pos += 1
end
return pos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skip_space(ix, direction)\n diff = { :left => -1, :right => 1 }[direction]\n ix += diff until ix < 1 || char_at(ix) =~ /[^ \\t]/ || char_at(ix).blank?\n ix\n end",
"def skip_whitespace\n self.advance while self.current == \" \"\n end",
"def skip_space; end",
"def skip_space=(_... | [
"0.785046",
"0.7280818",
"0.7052874",
"0.6980078",
"0.69480604",
"0.6884099",
"0.6850493",
"0.67137694",
"0.6597582",
"0.6578728",
"0.64784604",
"0.63058054",
"0.61339027",
"0.60148954",
"0.6012264",
"0.6006008",
"0.5991304",
"0.596291",
"0.5935698",
"0.5920882",
"0.5895509",... | 0.74079305 | 1 |
Skip spaces from given position in reverse. | def skipSpacesBack(pos, min)
return pos if pos <= min
while (pos > min)
return pos + 1 if !isSpace(charCodeAt(@src, pos -= 1))
end
return pos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skip_space(ix, direction)\n diff = { :left => -1, :right => 1 }[direction]\n ix += diff until ix < 1 || char_at(ix) =~ /[^ \\t]/ || char_at(ix).blank?\n ix\n end",
"def skip_whitespace\n self.advance while self.current == \" \"\n end",
"def skipSpaces(pos)\n max = @src.le... | [
"0.7369067",
"0.6451939",
"0.64301026",
"0.6069461",
"0.6020661",
"0.59331566",
"0.5921333",
"0.59127516",
"0.5790662",
"0.5773551",
"0.57260996",
"0.5724223",
"0.57127446",
"0.5690661",
"0.56866723",
"0.5681247",
"0.5628295",
"0.5617192",
"0.56161934",
"0.56072617",
"0.56052... | 0.67966926 | 1 |
Skip char codes from given position | def skipChars(pos, code)
max = @src.length
while pos < max
break if (charCodeAt(@src, pos) != code)
pos += 1
end
return pos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skipCharsBack(pos, code, min)\n return pos if pos <= min\n\n while (pos > min)\n return (pos + 1) if code != charCodeAt(@src, pos -= 1)\n end\n return pos\n end",
"def skipSpaces(pos)\n max = @src.length\n while pos < max\n ch = charCodeAt(@src... | [
"0.7625582",
"0.7116165",
"0.66701615",
"0.6624932",
"0.6547856",
"0.6514175",
"0.6122884",
"0.6100048",
"0.60094655",
"0.59441096",
"0.59182614",
"0.5864476",
"0.579636",
"0.5763872",
"0.56008554",
"0.5596652",
"0.55702883",
"0.5556906",
"0.55505705",
"0.5533722",
"0.5500484... | 0.8502206 | 0 |
Skip char codes reverse from given position 1 | def skipCharsBack(pos, code, min)
return pos if pos <= min
while (pos > min)
return (pos + 1) if code != charCodeAt(@src, pos -= 1)
end
return pos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skipChars(pos, code)\n max = @src.length\n while pos < max\n break if (charCodeAt(@src, pos) != code)\n pos += 1\n end\n return pos\n end",
"def backward characters\n if (@char - characters) >= 0\n @char -= characters\n char\n else\n fal... | [
"0.6886522",
"0.6289645",
"0.6183639",
"0.6162006",
"0.61287296",
"0.61197",
"0.6042372",
"0.5956071",
"0.5954503",
"0.59443563",
"0.5914544",
"0.5882674",
"0.58488417",
"0.5838668",
"0.5828542",
"0.5804168",
"0.5799085",
"0.5787559",
"0.5780467",
"0.57640636",
"0.575358",
... | 0.6812393 | 1 |
Draws the kelvins screen on the Shoes app window. | def kelvins_screen
@heading = 'Kelvins = temperature + 273.15'
background('images/conversions_large.png')
# Kelvins screen header
ScreenHeader.new(self, '/title_screen/conversions_screen', @@font, @heading)
# Kelvins screen content
flow(:height => 640, :width => 1080, :scroll => true) do
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n call Screen.setColor(true)\n call draw\n end",
"def draw(window)\n window.draw_quad(top_left_x_view, top_left_y_view, 0x33ffffff,\n bottom_right_x_view, top_left_y_view, 0x33ffffff,\n bottom_right_x_view, bottom_right_y_view, 0x33ffffff,\n ... | [
"0.6606168",
"0.6362887",
"0.6183852",
"0.6148091",
"0.6133532",
"0.6118135",
"0.6115432",
"0.60270387",
"0.5982933",
"0.5910254",
"0.59055966",
"0.5904751",
"0.58965105",
"0.5881203",
"0.5866509",
"0.5801632",
"0.5777589",
"0.57502574",
"0.5747857",
"0.57348573",
"0.5722634"... | 0.65770435 | 1 |
caching related releases on release page. either updated in 1 hour or via an updated_at attribute change | def related_releases
Rails.cache.fetch("releases/release-#{id}", :expires_in => 1.hour) do
real_releases.all(:order => 'date DESC', :limit => 15)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_new_release_metadata\n return false if new_files.empty?\n msg \"Caching metadata for new releases\"\n new_files.each {|f| f.fetch}\n end",
"def update_cache\n # Does nothing...up to subclasses to implement.\n end",
"def get_cache_version\n data = get_from_cdn(... | [
"0.6106076",
"0.60914594",
"0.6018742",
"0.6010483",
"0.60036814",
"0.5987728",
"0.59363794",
"0.58373016",
"0.58260685",
"0.58200955",
"0.5788265",
"0.5787008",
"0.5759254",
"0.5759254",
"0.5727306",
"0.5688849",
"0.5688849",
"0.56579304",
"0.56527627",
"0.56527627",
"0.5642... | 0.77269983 | 0 |
Load artist releases upon tracking a new artist on the timeline, limiting to 5 most recent | def timeline_releases
real_releases.order('date DESC').limit(5)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform\n artists = Artist.where(\"past_event_freshness <= ?\", 5.days.ago)\n\n artists.each do |a|\n Saver::PastEvents.perform_async(a.lastfm_id)\n end\n end",
"def top_artists\n \n artists=[]\n spotify_artists = JSON.parse(api_call(\"https://api.spotify.com/\",\"v1/me/top/artists\")... | [
"0.6380666",
"0.6238475",
"0.61190766",
"0.6062939",
"0.59994924",
"0.5809105",
"0.57804525",
"0.57104266",
"0.5693334",
"0.5613974",
"0.55636334",
"0.5541392",
"0.5466652",
"0.54422843",
"0.54377097",
"0.54362065",
"0.54139894",
"0.5408272",
"0.5401707",
"0.5396842",
"0.5380... | 0.64480793 | 0 |
print song title, duration, genre in a single line | def display_song
return "Title: #{song_title}, Duration: #{duration}, Genre: #{genre}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_songs\n songs.each { |song| puts \"#{song.name}\" }\n end",
"def print_songs\n songs.each do |song|\n puts \"#{song.name}\"\n end\n end",
"def print_songs\n @songs.each {|x| puts \"#{x.name}\\n\"}\n end",
"def print_songs\n songs.each {|song| puts so... | [
"0.694044",
"0.693019",
"0.69180095",
"0.6859085",
"0.68539625",
"0.68472224",
"0.68147373",
"0.67926705",
"0.67706805",
"0.67706805",
"0.67474157",
"0.6737379",
"0.67038304",
"0.6696807",
"0.6696009",
"0.6690794",
"0.6690794",
"0.6674225",
"0.6664251",
"0.66498226",
"0.66440... | 0.79902846 | 1 |
add album first check if album exists | def add_album(new_album)
if @albums.include?(new_album)
puts "The album has already been added"
else
@albums.push(new_album)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_album(new_album)\n @albums.include?(new_album) ? (puts \"The album has already been added\") : @albums.push(new_album)\n end",
"def album\r\n #prepare_new_album extracted for reuse from spec\r\n prepare_new_album unless @content\r\n end",
"def get_or_create_album(path, album_url: nil)\... | [
"0.76650983",
"0.7251075",
"0.6756253",
"0.6748371",
"0.66566396",
"0.66259724",
"0.65905446",
"0.65157336",
"0.6461365",
"0.6450731",
"0.6413395",
"0.64083856",
"0.63962734",
"0.6385524",
"0.6371382",
"0.637038",
"0.63059765",
"0.6291961",
"0.6274533",
"0.62670827",
"0.62518... | 0.77341413 | 0 |
add artist to Top 10 and check if number of artist is not more than 10 | def add_artist(new_artist)
if @artists.length > 10
@artists.shift
else
@artists.push(new_artist)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_artist(new_artist)\n @artists.length > 10 ? @artists.shift : @artists.push(new_artist)\n end",
"def top_tracks_for_random_artist\n unless @artist\n @artist = Lineup.select_random_artist\n end\n\n options = { :query => { :api_key => LASTFM_API_KEY, :limit => \"10\", :format => \"jso... | [
"0.691101",
"0.64831734",
"0.6441237",
"0.63333327",
"0.6108964",
"0.587203",
"0.5822928",
"0.5773656",
"0.57640713",
"0.57528085",
"0.5726043",
"0.57206106",
"0.57145727",
"0.56875575",
"0.5681751",
"0.56659925",
"0.56645536",
"0.5651497",
"0.5651497",
"0.5636721",
"0.561052... | 0.68331295 | 1 |
Build a new stanza type:: [Symbol] or nil, see Iqtype to:: [JID] Recipient | def initialize(type = nil, to = nil)
super("iq")
if not to.nil?
set_to(to)
end
if not type.nil?
set_type(type)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n iq = connection.iq_stanza({'to'=>jid.bare,'type'=>'set'},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('create',:node => node_id)\n )\n )\n\n send_iq_stanza_fibered iq\n end",
"def as_xmpp_message(to, persp=:default, body=nil, type... | [
"0.53103083",
"0.52353144",
"0.51437414",
"0.51390505",
"0.5002836",
"0.49288005",
"0.49260974",
"0.489273",
"0.48723128",
"0.48156852",
"0.4814744",
"0.48142424",
"0.47736892",
"0.47358915",
"0.47107753",
"0.47054",
"0.46958858",
"0.46947265",
"0.46892735",
"0.4682797",
"0.4... | 0.62846315 | 0 |
Get the type of the Iq stanza The following values are allowed: :get :set :result :error result:: [Symbol] or nil | def type
case super
when 'get' then :get
when 'set' then :set
when 'result' then :result
when 'error' then :error
else nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type\n result_hash['typ']\n end",
"def type\n return @type if @type != \"unknown\"\n info\n @type\n end",
"def type\n return :unknown unless properties['result_type']\n\n properties['result_type'].to_sym\n end",
"def type\r\n\t\t\t`#{BITS::BITSADMIN} /gettype ... | [
"0.66498125",
"0.65237457",
"0.64089954",
"0.6404076",
"0.6266697",
"0.626455",
"0.622348",
"0.62213725",
"0.6218859",
"0.62078166",
"0.62077034",
"0.62077034",
"0.62077034",
"0.6187456",
"0.616204",
"0.61487144",
"0.61487144",
"0.6139651",
"0.6113391",
"0.6094898",
"0.608166... | 0.66038674 | 1 |
Set the type of the Iq stanza (chainingfriendly) v:: [Symbol] or nil | def set_type(v)
self.type = v
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type=(type); end",
"def set_type\n end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type(val); @type = val; self; end",
"def type=(val)\n case val\n when :error then super('error')\n when :probe then super(... | [
"0.6026808",
"0.5948321",
"0.594715",
"0.594715",
"0.594715",
"0.594715",
"0.594715",
"0.5889045",
"0.58708346",
"0.5870461",
"0.58276063",
"0.57351464",
"0.5718711",
"0.57041264",
"0.5682197",
"0.5648664",
"0.56269836",
"0.56218255",
"0.5598361",
"0.5564985",
"0.55600333",
... | 0.60567546 | 0 |
Delete old elements named newquery.name newquery:: [REXML::Element] will be added | def query=(newquery)
delete_elements(newquery.name)
add(newquery)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_by_query(queries)\n queries = [queries] unless queries.is_a?(Array)\n build do |xml|\n xml.delete do |delete_node|\n queries.each { |query| delete_node.query query }\n end\n end\n end",
"def delete_by_query query, opts = {}\n update opts.merge(:data => xml.delete_by_query... | [
"0.6609964",
"0.5961317",
"0.5631487",
"0.55475813",
"0.5470925",
"0.54295766",
"0.5419503",
"0.53961045",
"0.53300124",
"0.52318823",
"0.52173513",
"0.51731414",
"0.5161339",
"0.5124656",
"0.50857574",
"0.50843495",
"0.50525343",
"0.50003606",
"0.49995553",
"0.49843356",
"0.... | 0.6704397 | 0 |
Returns the iq's query's namespace, or nil result:: [String] | def queryns
e = first_element('query')
if e
return e.namespace
else
return nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def namespace\n @namespace ||= schema.attributes['Namespace'].value\n end",
"def namespace\n @namespace.ns\n end",
"def namespace\n @namespace ||= metadata.xpath('//Schema').first.attributes['Namespace'].value\n end",
"def namespace\n nil\n end",
"def namespace(ns)\n ns.bla... | [
"0.62251186",
"0.61939293",
"0.6178149",
"0.61747146",
"0.6174442",
"0.6170957",
"0.61697423",
"0.613811",
"0.613811",
"0.5976586",
"0.59408724",
"0.5939381",
"0.589501",
"0.58919036",
"0.58858776",
"0.58840847",
"0.587895",
"0.57759184",
"0.5766562",
"0.57509565",
"0.5745048... | 0.79844165 | 0 |
Add an element to the Iq stanza element:: [REXML::Element] Element to add. Will be automatically converted (imported) to a class registered with add_elementclass | def typed_add(element)
if element.kind_of?(REXML::Element) && @@element_classes.has_key?(element.name)
super(@@element_classes[element.name]::import(element))
else
super(element)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def <<(element)\n @elements << element\n self\n end",
"def element_add\r\n @env.issue.element_add @meta.element_add ElementAdd.new(@env).insert @is.element_add\r\n end",
"def << elem\n unless @element_type.nil? or elem.is_a?(@element_type)\n raise TypeError.new(\"Cannot add e... | [
"0.6366394",
"0.63614696",
"0.62773705",
"0.62410116",
"0.61146027",
"0.61146027",
"0.61146027",
"0.61146027",
"0.61146027",
"0.61146027",
"0.6065162",
"0.5983684",
"0.5965557",
"0.5958431",
"0.5924581",
"0.59024113",
"0.58999926",
"0.589973",
"0.5877168",
"0.5833075",
"0.579... | 0.65134525 | 0 |
Iterates the given block for each RDF quad in the input. | def each_quad(&block)
each_statement do |statement|
block.call(*statement.to_quad)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_quad(&block)\n if block_given?\n each_statement do |statement|\n block.call(*statement.to_quad)\n end\n end\n enum_for(:each_quad)\n end",
"def each(solutions:, &block)\n super do |stmt|\n block.call(RDF::Statement.from(stmt.to_quad))\n ... | [
"0.7068529",
"0.66853106",
"0.6563826",
"0.637273",
"0.63396627",
"0.61988866",
"0.61057884",
"0.6056404",
"0.60215825",
"0.6017053",
"0.6017053",
"0.6000423",
"0.5961103",
"0.59479266",
"0.594221",
"0.59064204",
"0.5891409",
"0.5873933",
"0.5841416",
"0.5818396",
"0.58069956... | 0.7171513 | 0 |
Set all the level names at once and saves the object. ===Params: levels:: An array containing every level name. A rubric criterion contains RUBRIC_LEVELS levels. If the array is smaller, only the first levels are set. If the array is bigger, higher indexes are ignored. ===Returns: Whether the save operation was success... | def set_level_names(levels)
levels.each_with_index do |level, index|
self['level_' + index.to_s + '_name'] = level
end
save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def levels=(levels)\n @levels = levels\n clear_levels_cache!\n end",
"def input_dosing_levels(levels)\n my_levels = levels.split(',')\n for i in 0..my_levels.size()-1\n add_level.click if i > 1\n dosing_factor_levels[i].set my_levels[i]\n end\n end",
"def levels(lev... | [
"0.71385366",
"0.62222093",
"0.6181587",
"0.59082156",
"0.56003654",
"0.55802184",
"0.55802184",
"0.55479366",
"0.55303395",
"0.55172014",
"0.54905945",
"0.54611444",
"0.5395873",
"0.5388535",
"0.536256",
"0.5360733",
"0.531737",
"0.5310692",
"0.52956796",
"0.5260223",
"0.525... | 0.75213766 | 0 |
before_create :build_image def start_generation MiddleMan.worker(:snap_generator_worker).async_generate(:arg => self.id) end | def start_generation
Nanite.request("/nanny/generate", self.id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @image = Image.new(image_params)\n\n respond_to do |format|\n if @image.save\n GenerateThumbnailsJob.perform_later(@image.id)\n\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: @ima... | [
"0.6473505",
"0.6185129",
"0.6088528",
"0.6026558",
"0.59738034",
"0.5969435",
"0.5946117",
"0.5837913",
"0.5803837",
"0.57497644",
"0.5741899",
"0.5731147",
"0.57152545",
"0.56883013",
"0.5672436",
"0.56591755",
"0.56484574",
"0.5623527",
"0.56118107",
"0.5593125",
"0.558440... | 0.6741161 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.