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 |
|---|---|---|---|---|---|---|
Extract outputs from stack hash | def extract_outputs(stack_hash)
outputs = []
if(stack_hash[:outputs])
outputs += stack_hash[:outputs].map do |output|
Smash.new(:key => output[:name], :value => output[:finalValue])
end
end
stack_hash.fetch(:resources, []).each do |resource|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stack_outputs(name)\n list = client.describe_stacks stack_name: name\n raise StandardError, \"stack: '#{name}' does not exist\" if list.stacks.empty?\n\n outputs = {}\n list.stacks.first.outputs.each do |x|\n outputs[x.output_key] = x.output_value\n end\n\n ... | [
"0.6308744",
"0.627303",
"0.6010338",
"0.59049094",
"0.5800646",
"0.5702913",
"0.5597827",
"0.55602944",
"0.5459044",
"0.5459044",
"0.5459044",
"0.54110825",
"0.5343382",
"0.5333893",
"0.5331919",
"0.5319655",
"0.53183067",
"0.5294882",
"0.5281151",
"0.52662575",
"0.5262031",... | 0.81391597 | 0 |
check if the collection accepts a given mime type; watch out for wildcards | def accept?(mime_type)
if mime_type =~ @@mime_re
p1, p2 = $1, $2
else
return false # WTF?
end
@accept.each do |pat|
pat = pat.to_s # working around REXML ticket 164
if pat =~ @@mime_re
if ($1 == p1 || $1 == "*") && ($2 == p2 || $2 == "*")
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def accept? ctype\n unless self.class.force_mime_type\n ctype = Regexp.escape ctype\n ctype = ctype.gsub(\"\\\\*\", \"[^/]*\")\n matcher = %r{#{ctype}}\n end\n\n !!self.class.mime_types.find do |mt|\n if matcher\n mt =~ matcher\n else\n mt == ctype\n end\n en... | [
"0.77527916",
"0.7095487",
"0.7025823",
"0.7024764",
"0.6996454",
"0.6996454",
"0.68388236",
"0.67528176",
"0.6731191",
"0.6707233",
"0.66846454",
"0.6659487",
"0.6642042",
"0.66240144",
"0.66003674",
"0.656797",
"0.65612775",
"0.65606403",
"0.6481699",
"0.6474869",
"0.642912... | 0.7534508 | 1 |
Failing to get your bid is referred to as 'going set'. | def got_set
return self.bid != self.tricks
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bid\n self.bids.last.nil? ? Bid.new : self.bids.last\n end",
"def last_bid\n self.bids.last rescue nil\n end",
"def completed_bid\n completed_response.present? ? completed_response.bid : nil\n end",
"def give_bid(auction, bid)\r\n if Time.now > auction.due_date\r\n raise TradeExce... | [
"0.6487028",
"0.6323811",
"0.6147629",
"0.6105298",
"0.6056604",
"0.6041588",
"0.59762716",
"0.5968541",
"0.5896258",
"0.5883508",
"0.58788943",
"0.5874227",
"0.5859775",
"0.583372",
"0.57465434",
"0.5743956",
"0.57323456",
"0.5723878",
"0.5690312",
"0.56802124",
"0.56180745"... | 0.67868507 | 0 |
We can't find the affiliation the ussual way we have to improvise Given the afid, we search on every tag until we find the desired one | def search_affiliation(afid)
x=xml.at_xpath("//affiliation[@afid=\"#{afid}\"]")
if !x
raise "I can't find affiliation #{afid}"
else
name=x.xpath("organization").map { |e| e.text }.join(";")
city=process_path(xml, "//affiliation[@afid=\"#{afid}\"]/city-group")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_atags(docs)\n # # Get doc\n # docs = get_docs(5)\n # \n # #meta_tags\n # meta_tags = nil\n # \n # # New docs\n # docs_new = []\n \n # href a tags\n a_tags_href = []\n \n vendor_list = []\n \n # #debug\n # get_next_sibling = true\n \n ... | [
"0.590376",
"0.5432035",
"0.5379096",
"0.5280769",
"0.52232337",
"0.5214042",
"0.5203483",
"0.51446444",
"0.5131581",
"0.5070167",
"0.50618696",
"0.50216",
"0.5018306",
"0.5005684",
"0.4998981",
"0.49887428",
"0.49848282",
"0.49715587",
"0.4959267",
"0.49370062",
"0.49348316"... | 0.63149714 | 0 |
Some affiliations doesn't have an id. We could create it hashing the name and the country on unidentified filliations on head tag The process only add the affiliation if name is not nil | def get_id_affiliation(name,city,country)
"NS:"+Digest::MD5.hexdigest("#{name}|#{city}|#{country}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end",
"def whole_affil (new_party_affiliation)\n if new_party_affiliation == \"d\"\n \"Democrat\"\n else new_party_affiliation == \"r\"\n \"Republican\"\n end\n end",
"def affiliation(name, req, desc)\n par... | [
"0.6552755",
"0.63314086",
"0.6319816",
"0.6306494",
"0.6286656",
"0.6192693",
"0.6044704",
"0.6001544",
"0.5920927",
"0.5915045",
"0.58951914",
"0.5835764",
"0.5796683",
"0.57721776",
"0.575169",
"0.56669104",
"0.5664022",
"0.54773456",
"0.5442214",
"0.5425252",
"0.54157853"... | 0.6663589 | 0 |
Author groups gives us information about the authors groups as appears on the head. Could be useful to retrieve information about missing affilitations Authorgroups with authors duplicated are eliminated | def process_author_groups
author_groups_temp=xml.xpath("//bibrecord/head/author-group").map do |ag|
process_one_author_group(ag)
end
#authors_list= []
@author_groups=author_groups_temp
# @author_groups=[]
# author_groups_temp.each do |ag|
# @author_group... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authors\n return [] if @feed.channel.managingEditor.nil? && @feed.channel.dc_publishers.empty?\n [@feed.channel.managingEditor, ((@feed.channel.dc_publishers.empty?) ? nil : @feed.channel.dc_publishers.collect{|dcp| dcp.content})].flatten.uniq.compact.reject{|au| au == '' || au.match(/^\\s+$/)}\n... | [
"0.66087204",
"0.65596133",
"0.6469133",
"0.64406973",
"0.6352643",
"0.631016",
"0.62032485",
"0.6108853",
"0.6099265",
"0.605933",
"0.60199654",
"0.5991378",
"0.5990169",
"0.5973147",
"0.5963548",
"0.5954336",
"0.5940188",
"0.5936823",
"0.58808535",
"0.5876544",
"0.5861544",... | 0.7421567 | 0 |
GET /users/pending Pending means not approved or denied | def pending
@pending_users = User.where(isApproved:false).where(isDenied:false).paginate(:page => params[:pending_users_page], :per_page => 10)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pending\n @user = User.find(params[:id])\n end",
"def pending\n getProfile\n where = \"status = 'p' and (owner_id = ? OR patient_id = ?)\"\n if @user.is_therapist?\n where = \"status = 'p' and (owner_id = ? OR therapist_id = ?)\"\n end\n @appointments = Appointment.where(where, @user.... | [
"0.7111376",
"0.71027184",
"0.70551986",
"0.69427",
"0.6917578",
"0.6872288",
"0.6868832",
"0.68666303",
"0.6816035",
"0.67986715",
"0.6765894",
"0.66890544",
"0.6633979",
"0.656105",
"0.65558445",
"0.6549094",
"0.6532761",
"0.65259486",
"0.65259486",
"0.6436157",
"0.6407817"... | 0.8107582 | 0 |
GET /users/approved Already approved but might need to promote to admin/deactivate | def approved
@approved_users = User.where(isApproved:true).where(isDenied:false).paginate(:page => params[:uapproved_users_page], :per_page => 10)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_approve_user\n @user.update(approved: true)\n redirect_to admin_path, notice: \"User Approved\"\n end",
"def approve_user\n # set the enabled flag to true for the user\n # send out approval notification\n end",
"def check_approved\n redirect_to animals_path, notice: \"Your account ... | [
"0.736827",
"0.7141964",
"0.7017434",
"0.69277424",
"0.6907994",
"0.6892134",
"0.6878522",
"0.6877722",
"0.683432",
"0.68088764",
"0.67704177",
"0.67638624",
"0.67159086",
"0.66962975",
"0.6673881",
"0.66597944",
"0.66548467",
"0.6630106",
"0.661955",
"0.6603707",
"0.6574236"... | 0.8073963 | 0 |
GET /users/denied Already denied but might need to approve | def denied
@denied_users = User.where(isDenied:true).where(isApproved:false).paginate(:page => params[:denied_users_page], :per_page => 10)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def denied\n end",
"def access_denied\n\n end",
"def deny_user(id)\n post(\"users/#{id}/deny\").user\n end",
"def access_denied\n end",
"def denied\n return @denied\n end",
"def denied=(value)\n @denied = value\n end",
"def access_den... | [
"0.742787",
"0.7362422",
"0.7307857",
"0.7286723",
"0.723541",
"0.7133234",
"0.70570636",
"0.689014",
"0.68354964",
"0.6796782",
"0.67692673",
"0.67611754",
"0.6754883",
"0.67498904",
"0.6746348",
"0.67422545",
"0.6728153",
"0.67248994",
"0.6721776",
"0.671981",
"0.6711514",
... | 0.81836784 | 0 |
GET /users/inactive Already inactive but might need to activate | def inactive
@inactive_users = User.where(isActive:false).paginate(:page => params[:inactive_users_page], :per_page => 10)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deactivate\n\t @user.update(:active => false)\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def inactive\n\t\t\t\t\tfind(:all, :conditions => 'username = \"\"')\n\t\t\t\tend",
"def inactive\n end",
"def inactive_user?... | [
"0.7206873",
"0.71903163",
"0.7095578",
"0.68572736",
"0.6826995",
"0.6757509",
"0.67178786",
"0.67012936",
"0.66925687",
"0.668687",
"0.66400087",
"0.65934134",
"0.6576837",
"0.6557317",
"0.6553629",
"0.65305513",
"0.6522977",
"0.64929485",
"0.6433589",
"0.6430966",
"0.63977... | 0.80157053 | 0 |
Gets the connectorServerName property value. The name of the server hosting the Exchange Connector. | def connector_server_name
return @connector_server_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connector_server_name=(value)\n @connector_server_name = value\n end",
"def server_name\n return @server_name\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def get_server_domain\n @hostname ||= Socke... | [
"0.75333303",
"0.66325057",
"0.641065",
"0.62787217",
"0.62766993",
"0.6200551",
"0.6103176",
"0.6061351",
"0.6050976",
"0.6041542",
"0.6002608",
"0.5934337",
"0.58371997",
"0.58318084",
"0.5831322",
"0.57122046",
"0.56778574",
"0.5646732",
"0.5601481",
"0.5601481",
"0.559113... | 0.82456285 | 0 |
Sets the connectorServerName property value. The name of the server hosting the Exchange Connector. | def connector_server_name=(value)
@connector_server_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connector_server_name\n return @connector_server_name\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def server_name=(value)\n @server_name = value\n end",
"def set_server_name; self.name = domain; end... | [
"0.6518113",
"0.6077241",
"0.59330666",
"0.57179326",
"0.5488366",
"0.5433407",
"0.53477013",
"0.52949464",
"0.5247825",
"0.5247825",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.5192303",
"0.5189279",
"0.5... | 0.78974193 | 0 |
Gets the exchangeAlias property value. An alias assigned to the Exchange server | def exchange_alias
return @exchange_alias
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exchange_alias=(value)\n @exchange_alias = value\n end",
"def account_alias\n # Do not execute IAM API call unless the -s/--show_account_alias flag is specified\n # (to prevent excess API calls *and* errors if IAM rights are not allowed)\n return nil unless config[:show_acc... | [
"0.7781427",
"0.6615855",
"0.6029757",
"0.5985897",
"0.5963759",
"0.5910003",
"0.5723745",
"0.5688521",
"0.56475586",
"0.5631283",
"0.5586655",
"0.55285937",
"0.54696023",
"0.5428853",
"0.5396235",
"0.53853804",
"0.53252375",
"0.5300398",
"0.52484816",
"0.5247024",
"0.5247024... | 0.84080905 | 0 |
Sets the exchangeAlias property value. An alias assigned to the Exchange server | def exchange_alias=(value)
@exchange_alias = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_alias(aliass)\n @alias = aliass\n end",
"def exchange_alias\n return @exchange_alias\n end",
"def alias=(new_alias)\n @alias = new_alias[0..512]\n end",
"def aliases=(value)\n @aliases = value\n end",
"def set_alias\n author... | [
"0.7403764",
"0.6919509",
"0.6850116",
"0.6473481",
"0.6193789",
"0.61910206",
"0.6109198",
"0.60138744",
"0.6010907",
"0.59626985",
"0.592012",
"0.5900717",
"0.5890026",
"0.58588225",
"0.58505034",
"0.5846805",
"0.57322854",
"0.57203144",
"0.56839675",
"0.5672074",
"0.564703... | 0.8812395 | 0 |
Gets the exchangeConnectorType property value. The type of Exchange Connector. | def exchange_connector_type
return @exchange_connector_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exchange_connector_type=(value)\n @exchange_connector_type = value\n end",
"def connector_type\n cable.connector_types[self.end - 1]\n end",
"def connector_types\n [connector_type_1, connector_type_2]\n end",
"def set_connector_type\n @connector_type = ConnectorType... | [
"0.8352882",
"0.73998475",
"0.66187936",
"0.6482105",
"0.5900204",
"0.5871402",
"0.58123696",
"0.5768661",
"0.55711704",
"0.5468314",
"0.54392374",
"0.534367",
"0.5337705",
"0.53279424",
"0.53108776",
"0.52762246",
"0.52299786",
"0.5171082",
"0.51051456",
"0.50920904",
"0.509... | 0.85175353 | 0 |
Sets the exchangeConnectorType property value. The type of Exchange Connector. | def exchange_connector_type=(value)
@exchange_connector_type = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_connector_type\n @connector_type = ConnectorType.find(params[:id])\n end",
"def exchange_connector_type\n return @exchange_connector_type\n end",
"def set_ConnectionType(value)\n set_input(\"ConnectionType\", value)\n end",
"def connector_types\n [... | [
"0.74037313",
"0.70049137",
"0.62015235",
"0.5874123",
"0.5845511",
"0.582366",
"0.58053786",
"0.5801325",
"0.55816746",
"0.5580266",
"0.5562782",
"0.5562782",
"0.5452468",
"0.5444126",
"0.5427084",
"0.5415194",
"0.5402355",
"0.53673023",
"0.5359269",
"0.53424",
"0.5217491",
... | 0.8736384 | 0 |
Gets the exchangeOrganization property value. Exchange Organization to the Exchange server | def exchange_organization
return @exchange_organization
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exchange_organization=(value)\n @exchange_organization = value\n end",
"def organization\n self[:O]\n end",
"def organization\n return @organization if @organization\n @organization = Organization.find(organization_id)\n end",
"def organization\n if s... | [
"0.81190896",
"0.72671247",
"0.6933954",
"0.67686355",
"0.67095554",
"0.66691536",
"0.6637062",
"0.65152365",
"0.6490958",
"0.64788795",
"0.6449912",
"0.64390206",
"0.6357968",
"0.6357968",
"0.6341796",
"0.6329135",
"0.6327179",
"0.6258358",
"0.6149914",
"0.6028272",
"0.59961... | 0.85223866 | 0 |
Sets the exchangeOrganization property value. Exchange Organization to the Exchange server | def exchange_organization=(value)
@exchange_organization = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_organization\n @organization = ::Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Spree::Organization.find(params[:id])\n end",
"def set_organization\n # @... | [
"0.73825693",
"0.730599",
"0.7262671",
"0.7211844",
"0.71640366",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
... | 0.8676123 | 0 |
Gets the lastSyncDateTime property value. Last sync time for the Exchange Connector | def last_sync_date_time
return @last_sync_date_time
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_sync\n time_parser(self[:last_sync])\n end",
"def last_sync_date_time=(value)\n @last_sync_date_time = value\n end",
"def last_sync_date_time=(value)\n @last_sync_date_time = value\n end",
"def last_synchronize\n last_update\n ... | [
"0.7915699",
"0.7860247",
"0.7860247",
"0.6972501",
"0.6902577",
"0.6729315",
"0.67265815",
"0.6575168",
"0.6575168",
"0.6575168",
"0.6575168",
"0.6548952",
"0.6548952",
"0.6548952",
"0.6548952",
"0.6532987",
"0.6531283",
"0.6392493",
"0.6392342",
"0.6391455",
"0.6389689",
... | 0.867225 | 1 |
Sets the lastSyncDateTime property value. Last sync time for the Exchange Connector | def last_sync_date_time=(value)
@last_sync_date_time = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def touch_sync\n self.lastSyncAt = Time.now if self.respond_to?(:lastSyncAt=)\n end",
"def last_sync_date_time\n return @last_sync_date_time\n end",
"def last_sync_date_time\n return @last_sync_date_time\n end",
"def last_sync\n time_parser(s... | [
"0.7119943",
"0.7007755",
"0.7007755",
"0.68468606",
"0.6657463",
"0.6463483",
"0.6082793",
"0.6023053",
"0.6023053",
"0.6023053",
"0.6023053",
"0.59991693",
"0.5976521",
"0.5976521",
"0.5976521",
"0.5976521",
"0.5809811",
"0.5710855",
"0.55419606",
"0.5519664",
"0.54982364",... | 0.8358758 | 1 |
Gets the primarySmtpAddress property value. Email address used to configure the Service To Service Exchange Connector. | def primary_smtp_address
return @primary_smtp_address
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def primary_smtp_address=(value)\n @primary_smtp_address = value\n end",
"def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\... | [
"0.80906755",
"0.7948383",
"0.75476915",
"0.72918814",
"0.70493823",
"0.70493823",
"0.7038114",
"0.693751",
"0.6845316",
"0.67926806",
"0.6736705",
"0.6719018",
"0.6700408",
"0.6683979",
"0.66341615",
"0.65925944",
"0.65800893",
"0.65800893",
"0.6552944",
"0.6537063",
"0.6522... | 0.875464 | 0 |
Sets the primarySmtpAddress property value. Email address used to configure the Service To Service Exchange Connector. | def primary_smtp_address=(value)
@primary_smtp_address = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def primary_smtp_address\n return @primary_smtp_address\n end",
"def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end"... | [
"0.750432",
"0.64499885",
"0.62124324",
"0.6132119",
"0.6132119",
"0.60744953",
"0.60744953",
"0.6047984",
"0.60253495",
"0.5996007",
"0.59818506",
"0.5953608",
"0.59105766",
"0.59105766",
"0.5905456",
"0.5889484",
"0.5815529",
"0.57971144",
"0.57842875",
"0.565603",
"0.56281... | 0.87006336 | 0 |
Gets the serverName property value. The name of the Exchange server. | def server_name
return @server_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_name=(value)\n @server_name = value\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def ServerName()\r\n ret = _getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def ServerName()\r\n ... | [
"0.65909046",
"0.65906835",
"0.65477306",
"0.6527643",
"0.63938",
"0.63004965",
"0.626449",
"0.62582433",
"0.62366396",
"0.61862004",
"0.61633295",
"0.6134643",
"0.611036",
"0.60333216",
"0.6020067",
"0.60178334",
"0.5981996",
"0.5954758",
"0.59134156",
"0.58690923",
"0.58285... | 0.73446375 | 0 |
Sets the serverName property value. The name of the Exchange server. | def server_name=(value)
@server_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def server_name(name = nil)\n return @server_name if name.nil?\n @server_name = name.to_sym\n end",
"def set_server_name; self.name = domain; end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def connector_server_name=(value)\n ... | [
"0.6429083",
"0.6413013",
"0.6409067",
"0.6123249",
"0.59632206",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5851127",
"0.5851127",
"0.5583237",
"0.54949784",
"0.5376993",
"0.5296226",
"0.52869344",
"0.5259169",
... | 0.71652377 | 0 |
before_action :authenticate_user! GET /cords GET /cords.json | def index
@cords = Cord.all
@cords = Cord.user_cords(current_user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getdoctors\n #verify user in slug is logged in\n token_passed = params[:token] unless params[:token].nil?\n patient = Patient.find_by_slug!(params[:patient_id])\n if my_encrypt(patient.remember_token) != token_passed\n redirect_to signin_path\n else\n allows_cors\n clinic = Clinic... | [
"0.6623102",
"0.63390684",
"0.61292005",
"0.6005919",
"0.59343004",
"0.5913341",
"0.5909052",
"0.58687615",
"0.58687615",
"0.58682406",
"0.5783004",
"0.5757271",
"0.57194394",
"0.569875",
"0.5687333",
"0.5685529",
"0.56796706",
"0.5677577",
"0.56711394",
"0.5670517",
"0.56670... | 0.69375587 | 0 |
POST /cords POST /cords.json | def create
# @cord = Cord.new(cord_params)
@cord = @racquet.cords.new(cord_params)
@cord.user = current_user
respond_to do |format|
if @cord.save
format.html { redirect_to @cord, notice: t('cords.create.success') }
format.json { render :show, status: :created, location: @cord }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @aucrecord = Aucrecord.new(aucrecord_params)\n\n respond_to do |format|\n if @aucrecord.save\n format.html { redirect_to @aucrecord, notice: 'Aucrecord was successfully created.' }\n format.json { render action: 'show', status: :created, location: @aucrecord }\n else\n ... | [
"0.6071463",
"0.5900635",
"0.57675284",
"0.5660247",
"0.5635626",
"0.5607491",
"0.56025517",
"0.55710894",
"0.5524103",
"0.54735994",
"0.5470642",
"0.5372055",
"0.53504753",
"0.5346607",
"0.5324415",
"0.53165525",
"0.5264942",
"0.52073807",
"0.5206942",
"0.51935554",
"0.51877... | 0.741328 | 0 |
PATCH/PUT /cords/1 PATCH/PUT /cords/1.json | def update
respond_to do |format|
if @cord.update(cord_params)
format.html { redirect_to @cord, notice: t('cords.update.success') }
format.json { render :show, status: :ok, location: @cord }
else
format.html { render :edit }
format.json { render json: @cord.errors, status... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @clonet = Clonet.find(params[:id])\n\n respond_to do |format|\n if @clonet.update_attributes(params[:clonet])\n format.html { redirect_to @clonet, notice: 'Clonet was successfully u... | [
"0.6662169",
"0.61981195",
"0.61946225",
"0.6183679",
"0.613617",
"0.6061696",
"0.60593885",
"0.602346",
"0.6003275",
"0.59925306",
"0.597432",
"0.5956292",
"0.59457254",
"0.59287316",
"0.5891744",
"0.5873117",
"0.5867895",
"0.58673173",
"0.58598673",
"0.58540976",
"0.585066"... | 0.7007568 | 0 |
DELETE /cords/1 DELETE /cords/1.json | def destroy
@cord.destroy
respond_to do |format|
format.html { redirect_to cords_url, notice: t('cords.destroy.success') }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content... | [
"0.7154911",
"0.70884067",
"0.68288934",
"0.6817627",
"0.67835057",
"0.6726949",
"0.67020905",
"0.6690973",
"0.6690973",
"0.66839653",
"0.6681377",
"0.66765755",
"0.6670921",
"0.66430354",
"0.66335666",
"0.66227686",
"0.66227686",
"0.66227686",
"0.66227686",
"0.65747535",
"0.... | 0.7665841 | 0 |
POST /qa_games POST /qa_games.json | def create
@qa_game = QaGame.new(qa_game_params)
respond_to do |format|
if @qa_game.save
format.html { redirect_to @qa_game, notice: 'Qa game was successfully created.' }
format.json { render :show, status: :created, location: @qa_game }
else
format.html { render :new }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @game = current_or_guest_user.games.create\n render json: @game, status: 201\n end",
"def create\n game = @current_user.games.create!(game_params)\n render json: { game: game }\n end",
"def create\n @new_game = Game.create(game_params)\n render json: @new_game\n\n end",
"def... | [
"0.70323867",
"0.6831832",
"0.6684747",
"0.6599768",
"0.65332335",
"0.65134794",
"0.6467209",
"0.64558333",
"0.6430323",
"0.63851994",
"0.6361816",
"0.6312963",
"0.6295411",
"0.62876123",
"0.62810636",
"0.62694883",
"0.6268313",
"0.6266465",
"0.62457585",
"0.6244908",
"0.6210... | 0.7221785 | 0 |
PATCH/PUT /qa_games/1 PATCH/PUT /qa_games/1.json | def update
respond_to do |format|
if @qa_game.update(qa_game_params)
format.html { redirect_to @qa_game, notice: 'Qa game was successfully updated.' }
format.json { render :show, status: :ok, location: @qa_game }
else
format.html { render :edit }
format.json { render json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n #if game exists, pass here to update state\n @game = Game.find_by(id: params[:id])\n @game.update(game_params)\n render json: @game, status: 201\n end",
"def update\n @game = current_user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:... | [
"0.6742166",
"0.6504812",
"0.64587396",
"0.64483505",
"0.6415147",
"0.64147043",
"0.64145863",
"0.6413291",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.64125913",
"0.64105594",
"0.6401199",
"0.64005184",
"0.63832617",
"0.63714... | 0.6962431 | 0 |
DELETE /qa_games/1 DELETE /qa_games/1.json | def destroy
@qa_game.destroy
respond_to do |format|
format.html { redirect_to qa_games_url, notice: 'Qa game was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n # @game = Game.find(params[:id])\n # @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\... | [
"0.7260279",
"0.7142512",
"0.71007144",
"0.7076878",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7055134",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.7039... | 0.73978645 | 0 |
def long_question (quest_arr) result_arr = [] quest_arr.each do |x| if x.length > 15 result_arr << x end end return result_arr end method2 | def long_question (quest_arr)
quest_arr.select { |question| question.size > 15 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def long_strings(arr_long_string)\n #empty array\n more_five = []\n #iterate into how word and know its longitude\n arr_long_string.each do |string|\n if string.length >= 5\n #if its meets enter to the array\n more_five << string\n end\n end\n #return the array with the strings\n more_five\n... | [
"0.72972107",
"0.675591",
"0.6631978",
"0.6611339",
"0.64961314",
"0.6479526",
"0.6401144",
"0.6339382",
"0.6295579",
"0.6243623",
"0.6228695",
"0.6192196",
"0.61827904",
"0.6172448",
"0.6130867",
"0.6109938",
"0.6100403",
"0.6079306",
"0.60700035",
"0.6060247",
"0.6025026",
... | 0.86648375 | 0 |
GET /donation_lines/1 GET /donation_lines/1.json | def show
@donation_line = DonationLine.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @donation_line }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @donation_line = DonationLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def destroy\n @donation_line = DonationLine.find(params[:id])\n @donation_line.destroy\n\n respond_to do |format|\n fo... | [
"0.6941676",
"0.64443237",
"0.63708204",
"0.6100936",
"0.6055975",
"0.6035656",
"0.5873022",
"0.5801722",
"0.57899505",
"0.57490516",
"0.57054156",
"0.5700843",
"0.56779456",
"0.5642454",
"0.55720943",
"0.55626714",
"0.55609953",
"0.55422795",
"0.5538787",
"0.5529506",
"0.548... | 0.7397559 | 0 |
GET /donation_lines/new GET /donation_lines/new.json | def new
@donation_line = DonationLine.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @donation_line }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @line = Line.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end... | [
"0.68347263",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.63758355",
"0.63548493",
"0.6345284",
"0.63239485",
"0.6313589",
"0.62955207",
"0.6286841",
"0.6266587",
"0.6261535",
"0.62552613... | 0.75985366 | 0 |
POST /donation_lines POST /donation_lines.json | def create
@donation_line = DonationLine.new(params[:donation_line])
respond_to do |format|
if @donation_line.save
format.html { redirect_to @donation_line, notice: 'Donation line was successfully created.' }
format.json { render json: @donation_line, status: :created, location: @donation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @donation_line = DonationLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def create\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build(params[:payment_line]... | [
"0.64750856",
"0.632006",
"0.6051545",
"0.60339636",
"0.5987517",
"0.59839094",
"0.5923049",
"0.5918125",
"0.5899685",
"0.58789",
"0.58365554",
"0.5821895",
"0.57627636",
"0.5709857",
"0.56877893",
"0.5662043",
"0.56467557",
"0.56003034",
"0.557587",
"0.5559673",
"0.5559479",... | 0.73007226 | 0 |
PUT /donation_lines/1 PUT /donation_lines/1.json | def update
@donation_line = DonationLine.find(params[:id])
respond_to do |format|
if @donation_line.update_attributes(params[:donation_line])
format.html { redirect_to @donation_line, notice: 'Donation line was successfully updated.' }
format.json { head :ok }
else
format.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @line = Line.find_by_no(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to @line, notice: 'Line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit... | [
"0.66414714",
"0.6581012",
"0.647276",
"0.64682466",
"0.63875943",
"0.6385646",
"0.62469786",
"0.62111914",
"0.6165975",
"0.61416936",
"0.60915214",
"0.60760677",
"0.60757685",
"0.6061588",
"0.6053871",
"0.6051897",
"0.6043776",
"0.6018619",
"0.59601456",
"0.595917",
"0.59018... | 0.75554067 | 0 |
DELETE /donation_lines/1 DELETE /donation_lines/1.json | def destroy
@donation_line = DonationLine.find(params[:id])
@donation_line.destroy
respond_to do |format|
format.html { redirect_to donation_lines_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @line = Line.find_by_no(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n fo... | [
"0.69119835",
"0.68276685",
"0.67853093",
"0.67767644",
"0.6707717",
"0.662782",
"0.6620618",
"0.6599085",
"0.65455747",
"0.65115637",
"0.6490036",
"0.64838433",
"0.6477999",
"0.6477999",
"0.6477806",
"0.64775133",
"0.6454877",
"0.6431016",
"0.64274913",
"0.6417593",
"0.64175... | 0.7681722 | 0 |
Returns true if this type is always going to have at least as many bytes as another type on all systems we care about. If you use this fact, you should probably emit an assumption to test it. | def as_many_bytes_as?(other)
type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def more_bytes_than?(other)\n possible_byte_sizes.min > other.possible_byte_sizes.max\n end",
"def bytes?\n type == \"BYTES\"\n end",
"def have?(length)\n return length <= @buffer.bytesize \n end",
"def expected_length?(length)\n expected == length\n end",
"def s... | [
"0.7531907",
"0.6999198",
"0.647988",
"0.61659956",
"0.6070356",
"0.60588706",
"0.60588706",
"0.6053423",
"0.6031307",
"0.5974973",
"0.5964287",
"0.5945918",
"0.59433",
"0.592715",
"0.59269476",
"0.5919197",
"0.5911733",
"0.5868767",
"0.5847259",
"0.5841985",
"0.5833964",
"... | 0.74876845 | 1 |
Returns true if this type is always guaranteed to have more bytes than another. | def more_bytes_than?(other)
possible_byte_sizes.min > other.possible_byte_sizes.max
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_many_bytes_as?(other)\n type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes\n end",
"def have?(length)\n return length <= @buffer.bytesize \n end",
"def bytes?\n type == \"BYTES\"\n end",
"def full?\n self.count == self.max_space\n end",
"def complet... | [
"0.7481658",
"0.7219244",
"0.68251836",
"0.65684104",
"0.6475707",
"0.6470982",
"0.64309883",
"0.64221394",
"0.63825625",
"0.6377506",
"0.6364627",
"0.6349592",
"0.62525284",
"0.62525284",
"0.6211756",
"0.6146094",
"0.6114929",
"0.6095934",
"0.60868585",
"0.60708416",
"0.6066... | 0.7862521 | 0 |
Generates a format string that will perform an arbitrary write using two separate short values | def generate_fmt_two_shorts(num_printed, write_to, write_what, targ = target)
arr = Array.new
arr << [ write_what & 0xffff, write_to ]
arr << [ write_what >> 16, write_to + 2 ]
stuff = fmtstr_gen_from_array(num_printed, arr, targ)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_short(file, short, md)\n short = [short].pack('n')\n md << short\n file.write(short)\n end",
"def write_raw_short(val)\n buffer << [val].pack(\"S>\")\n end",
"def short(*shorts)\n format = ( little_endian? ? 'v*' : 'n*') \n return string(shorts.pack(format)) \n end",... | [
"0.68767995",
"0.6874793",
"0.6735081",
"0.66097164",
"0.6192629",
"0.6080826",
"0.6077174",
"0.6045795",
"0.5999063",
"0.593463",
"0.5823784",
"0.57817584",
"0.5774021",
"0.57727826",
"0.572933",
"0.57265",
"0.57073355",
"0.56661266",
"0.5638022",
"0.56130415",
"0.56066006",... | 0.7700514 | 0 |
Generates and returns an array of what/where pairs from the supplied buffer | def fmtstr_gen_array_from_buf(write_to, buffer, targ = target)
# break buffer into shorts
arr = Array.new
off = 0
if ((buffer.length % 2) == 1)
buffer << rand_text(1)
end
while off < buffer.length
# convert short to number
tb = buffer[off,2].unpack('v')[0].to_i
#print_status("%d %d %d" % [off... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash_char_positions\n [].tap do |results|\n @lines.each.with_index do |line, line_idx|\n line.enum_for(:scan, /#/).each do\n results << [line_idx, Regexp.last_match.begin(0)]\n end\n end\n end\n end",
"def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGI... | [
"0.5310896",
"0.5162252",
"0.50626576",
"0.5044187",
"0.50394404",
"0.4982704",
"0.49811113",
"0.49726617",
"0.49483457",
"0.4943652",
"0.4901647",
"0.48821443",
"0.48735344",
"0.4807303",
"0.47692928",
"0.4762327",
"0.4762327",
"0.47306114",
"0.47189638",
"0.4718065",
"0.469... | 0.5389917 | 0 |
Generates a format string from an array of value/address pairs | def fmtstr_gen_from_array(num_printed, arr, targ = target)
num_pops = targ['NumPops']
num_pad = targ['PadBytes'] || 0
# sort the array -- for optimization
arr = arr.sort { |x,y| x[0] <=> y[0] }
# build up the addrs and fmts buffers
fmts = ""
addrs = ""
num = fmtstr_count_printed(num_printed, num_pad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format(*args)\n to_s % [*args]\n end",
"def c_build_format_string(mne, tokens, field_format)\n fmt_a = []\n\n tokens.each{|t|\n if (field_format.include?(t))\n fmt_a << field_format[t][0]\n else\n fmt_a << t\n end\n }\n\n fmt_s = mne\n\n if (!... | [
"0.6226499",
"0.6218415",
"0.6189225",
"0.6137018",
"0.6111246",
"0.6018633",
"0.5963938",
"0.59409386",
"0.58927363",
"0.58864427",
"0.5882832",
"0.5866531",
"0.5849652",
"0.58438903",
"0.57885486",
"0.57813406",
"0.5779763",
"0.5761693",
"0.5739681",
"0.57395655",
"0.573534... | 0.63502395 | 0 |
Generate a fmt that will advance the printed count by the specified amount | def fmtstr_advance_count(prec)
# no need to advance :)
return "" if prec == 0
# asumming %x max normal length is 8...
if prec >= 8
return "%0" + prec.to_s + "x"
end
# anything else, we just put some chars in...
return rand_text(prec)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_separator(repetitions = 18)\n puts '-' * repetitions\nend",
"def formatted_count item, key_count\n key_count_str = number_with_delimiter(key_count.to_i, :delimiter => ',')\n \"%-25s\\t%12s\" % [item, key_count_str]\n end",
"def horizontalSpacer(n , text)\n n.times {print \" \"}\n puts... | [
"0.6342596",
"0.6232745",
"0.61554515",
"0.61487836",
"0.61064434",
"0.60587054",
"0.6053139",
"0.60148823",
"0.597747",
"0.5969168",
"0.59689826",
"0.59668905",
"0.594463",
"0.59252626",
"0.58896005",
"0.5864212",
"0.58584535",
"0.5845453",
"0.581423",
"0.5812157",
"0.580785... | 0.71255386 | 0 |
Returns the index of any bad characters found in the supplied buffer. (NOTE: copied from encoder.rb) | def has_badchars?(buf, badchars)
badchars.each_byte { |badchar|
idx = buf.index(badchar.chr)
if (idx != nil)
return idx
end
}
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_eow\n\t\t\ti = buffer.index\n\t\t\ti += 1 while ((buffer[i] != nil) && buffer[i].match(/\\w/))\n\t\t\treturn i-1\n\t\tend",
"def char_index(length:, string:)\n i = 0\n char_count = 0\n while i < string.bytesize && char_count < length\n ordinal = string[i].ord\n ... | [
"0.6443524",
"0.5901925",
"0.57040524",
"0.546958",
"0.5403545",
"0.53708297",
"0.5349726",
"0.53490645",
"0.5318333",
"0.5298924",
"0.5295317",
"0.5262416",
"0.52576387",
"0.5239765",
"0.5235829",
"0.5233681",
"0.52101606",
"0.51936334",
"0.51900554",
"0.518139",
"0.5173821"... | 0.7529303 | 0 |
GET /recycling_sites/1 GET /recycling_sites/1.xml | def show
@recycling_site = RecyclingSite.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @recycling_site }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n fo... | [
"0.6616882",
"0.64540225",
"0.64540225",
"0.64540225",
"0.64540225",
"0.64540225",
"0.62944096",
"0.628981",
"0.62276584",
"0.60674304",
"0.6047998",
"0.60441995",
"0.6043742",
"0.6033635",
"0.60291874",
"0.60231566",
"0.60231566",
"0.5998183",
"0.59870636",
"0.5940904",
"0.5... | 0.67162883 | 0 |
GET /recycling_sites/new GET /recycling_sites/new.xml | def new
@recycling_site = RecyclingSite.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @recycling_site }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
... | [
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.71811664",
"0.69606143",
"0.6922176",
"0.6917113",
"0.6903965",
"0.6884183",
"0.6847495",
"0.6784215",
"0.67677593",
"0.67599463",
"0.67177415",
"0.66767865",
"0.66691786",
"0... | 0.73496795 | 0 |
POST /recycling_sites POST /recycling_sites.xml | def create
@recycling_site = RecyclingSite.new(params[:recycling_site])
respond_to do |format|
if @recycling_site.save
flash[:notice] = 'RecyclingSite was successfully created.'
format.html { redirect_to(@recycling_site) }
format.xml { render :xml => @recycling_site, :status => :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_trial_sites_from_xml(trial_xml)\n sites = []\n trial_xml.xpath(\"//location\").each do |site|\n status = site.at(\"status\").text if site.at(\"status\")\n country = site.at(\"country\").text if site.at(\"country\")\n if status == \"Recruiting\" && (country == \"United States\" || country == \... | [
"0.6061592",
"0.574245",
"0.5727222",
"0.56636345",
"0.556715",
"0.5460426",
"0.54054874",
"0.5374863",
"0.5331316",
"0.5296133",
"0.5281006",
"0.5262247",
"0.5231971",
"0.51727146",
"0.5155486",
"0.5155486",
"0.5155486",
"0.514781",
"0.5140979",
"0.51290315",
"0.5101981",
... | 0.61353314 | 0 |
DELETE /recycling_sites/1 DELETE /recycling_sites/1.xml | def destroy
@recycling_site = RecyclingSite.find(params[:id])
@recycling_site.destroy
respond_to do |format|
format.html { redirect_to(recycling_sites_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete()\n response = send_post_request(@xml_api_del... | [
"0.68143076",
"0.67091054",
"0.65693593",
"0.64779985",
"0.6469167",
"0.6416617",
"0.6318999",
"0.63155437",
"0.6294079",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.6282725",
"0.62450415",
"0.62146086",
"... | 0.6918289 | 0 |
Returns a found (or new) collection based on the collection fields and the submitter's email. | def collection
Rails.logger.info "XXXXX COLLECTION NAME #{collection_hash['collection name']}"
@collection ||= CollectionCreator.find_or_create_collection(
collection_hash['collection name'],
collection_hash['unit name'],
collection_hash['collection description'],
submitter_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collection\n instance_variable_get(collection_name) || set_collection(find_collection)\n end",
"def new_collection\n Models::Collection.new\n end",
"def find_collections_for_form\n Hyrax::CollectionsService.new(self).search_results(:edit)\n end",
"def collection\n return ni... | [
"0.6240948",
"0.6120814",
"0.5939363",
"0.5914665",
"0.58525014",
"0.5810176",
"0.57872456",
"0.5777817",
"0.5763885",
"0.5759058",
"0.5741854",
"0.57389927",
"0.5694836",
"0.5689586",
"0.5661559",
"0.56497306",
"0.5636249",
"0.5614387",
"0.5588594",
"0.5584143",
"0.55807054"... | 0.64682585 | 0 |
Converts collection fields into a hash. Similar to fields_to_hash, but collection fields do not have corresponding api field names, nor are any of them multivalued. | def collection_hash
collection_field_pairs = collection_fields.map do |field|
[ normalize_header(field.header), field.value ]
end
Hash[ collection_field_pairs ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_hash\n @fields\n end",
"def to_field_hash\n to_values_hash.flatten\n end",
"def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end",
"def fields_to_hash(these_fields)\n c... | [
"0.7413053",
"0.7403475",
"0.7239803",
"0.7211861",
"0.6972866",
"0.6972866",
"0.684725",
"0.6798657",
"0.67146283",
"0.6679869",
"0.6574547",
"0.6454038",
"0.6437063",
"0.6373835",
"0.63686794",
"0.63551486",
"0.6331356",
"0.63179076",
"0.63114387",
"0.6245294",
"0.6235421",... | 0.8299534 | 0 |
Converts media object fields into a hash. | def media_object_hash
fields_to_hash media_object_fields
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_hash\n { :file => file, :format => format, :media => media }\n end",
"def media_object_fields\n fields.select { |field| media_object_header?(field.header) }\n end",
"def to_h\n @to_h ||= ordered_values.map { |v|\n v = v.dup\n media_type = v.delete(:media_type)\n ... | [
"0.72452724",
"0.6815012",
"0.6692091",
"0.65072256",
"0.632415",
"0.629993",
"0.6236522",
"0.6197641",
"0.61825895",
"0.61747473",
"0.61635965",
"0.6127165",
"0.6040415",
"0.60112405",
"0.6004191",
"0.59897846",
"0.59880704",
"0.5982795",
"0.598253",
"0.5968871",
"0.5965097"... | 0.88228303 | 0 |
Selects media object fields. | def media_object_fields
fields.select { |field| media_object_header?(field.header) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mediaitem_fields()\n @restv9.get_mediaItems_fields()\n end",
"def selected_fields\n return @selected_fields unless @selected_fields.nil?\n\n fields = [*options[:select]].map { |f| f.split(',') }.flatten\n fields.concat(required_fields) if @fasta && !fields.empty?\n @selected_f... | [
"0.61091495",
"0.57129896",
"0.56841606",
"0.561558",
"0.55738354",
"0.5540678",
"0.55393416",
"0.55228186",
"0.5502072",
"0.54613996",
"0.5449359",
"0.54477906",
"0.54424",
"0.5436861",
"0.5436861",
"0.5436861",
"0.54325134",
"0.5378631",
"0.5345942",
"0.532367",
"0.53160053... | 0.73547685 | 0 |
Converts files/instantiation fields into hashes. | def file_hashes
@file_hashes ||= file_field_sets.map do |file_field_set|
instantiation_fields, file_fields = file_field_set.partition do |field|
instantiation_header?(field.header)
end
file_hash = fields_to_hash(file_fields)
file_hash['files'] = [fields_to_hash(instantia... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def fields_hash\n each_pair.to_h\n end",
"def hash\n fields.map { |field| instance_variable_get(field[:name]) }.hash\n end",
"def attachment_fields_hash\n @attachment... | [
"0.68815535",
"0.66171765",
"0.66137236",
"0.6370307",
"0.63305247",
"0.6243864",
"0.624211",
"0.624211",
"0.62055373",
"0.61612356",
"0.615149",
"0.61412805",
"0.61412805",
"0.61412805",
"0.6136768",
"0.6131085",
"0.61055374",
"0.6096622",
"0.6095227",
"0.60737175",
"0.60704... | 0.6945483 | 0 |
Returns an array of arrays: groups of file/instantiation fields. | def file_field_sets
@file_field_sets ||= begin
# Select only file and instantiation fields.
file_and_instantiation_fields = fields.select { |field| file_header?(field.header) || instantiation_header?(field.header) }
# Slice the selected fields into field sets for each file.
file_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_fields\n self.fields.select { |field| field.type == :file }\n end",
"def file_hashes\n @file_hashes ||= file_field_sets.map do |file_field_set|\n instantiation_fields, file_fields = file_field_set.partition do |field|\n instantiation_header?(field.header)\n en... | [
"0.60684514",
"0.59799325",
"0.5970233",
"0.5941821",
"0.5922665",
"0.58902395",
"0.5828262",
"0.57525283",
"0.57467675",
"0.57176",
"0.57021755",
"0.56850225",
"0.5673023",
"0.5671235",
"0.56552106",
"0.5641165",
"0.56304413",
"0.56157595",
"0.5615438",
"0.56067586",
"0.5603... | 0.63544273 | 0 |
Checks for multivalued fields, turns them into arrays, and combines all the values for the repeatable header. | def combine_multivalued_fields(uncombined_fields)
combined_fields = {}
uncombined_fields.each do |field|
normalized_header = normalize_header(field.header)
if multivalued?(normalized_header)
combined_fields[normalized_header] ||= Field.new(field.header, [])
combined_field... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multiple_fields_to_one multfields, prefix=false\n vals = []\n multfields.each do |field, anotherval|\n if anotherval and not anotherval.empty? \n anotherval = anotherval.strip\n anotherval = field + \": #{anotherval}\" if prefix\n vals << anotherval\n end... | [
"0.6174231",
"0.58449346",
"0.5778309",
"0.56037545",
"0.5589498",
"0.5524742",
"0.55157167",
"0.5432429",
"0.540262",
"0.540262",
"0.54020363",
"0.5379739",
"0.53390354",
"0.53290915",
"0.5322947",
"0.531397",
"0.5293062",
"0.5260944",
"0.52455777",
"0.52386403",
"0.5224557"... | 0.69141644 | 0 |
quick check to see if this looks like a dotmation config file | def is_config?(data)
data.match(/dot|xdg/)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_config_filename\n \"path to a valid config file\"\n end",
"def check_config_format(config_path)\n $config = YAML::load(File.open(config_path))\n \n if !$config\n p \"Nothing in configuration. Exiting...\"\n exit 2\n elsif !$config['apps']\n p \"No applications in configuration. Exi... | [
"0.73369086",
"0.70864165",
"0.70606035",
"0.686761",
"0.68008894",
"0.67525357",
"0.6727321",
"0.66040415",
"0.6554731",
"0.6509361",
"0.648607",
"0.64283407",
"0.64094245",
"0.63725823",
"0.63665044",
"0.63643384",
"0.63350236",
"0.63327134",
"0.63140386",
"0.6308351",
"0.6... | 0.7345876 | 0 |
given a filename, a url, or a github name, will read the config file. returns self | def set_from_config!(arg)
@config_data =
if arg.include?("://")
open(arg) {|io| io.read }
elsif File.exist?(arg)
@config_filename = arg
IO.read(arg)
else
url = "https://raw.github.com/#{arg}/#{DEFAULT_CONFIG_GITHUB_REPO}/master/#{DEFAULT_CONFIG_GITHUB_PATH}"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_config_file(file); end",
"def read_config_file; end",
"def initialize\n @config = config_from_file || empty_config\n end",
"def config_file\n @config_file\n end",
"def initialize(file_name, config = Crossref::Config)\n @file_name = file_name\n @config = config.load_config... | [
"0.67986375",
"0.66661227",
"0.64985013",
"0.6364298",
"0.63393503",
"0.6318858",
"0.6314006",
"0.628132",
"0.62802494",
"0.62562203",
"0.62440175",
"0.62334657",
"0.62129724",
"0.62113583",
"0.62111723",
"0.62046295",
"0.6188979",
"0.61832756",
"0.61553156",
"0.6140488",
"0.... | 0.7685288 | 0 |
Find the median of two sorted arrays | def find_median(arr1, arr2)
# determine index value of median element
median_index = ((arr1.length + arr2.length) / 2.0).round
stitched = []
# merge in order until length of the merged and sorted array is enough to
# calculate the median
while arr1.length > 0 and arr2.length > 0 and stitched.length < med... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def median_sorted_arrays_dc(arr1, arr2)\n size = arr1.size\n return -1 if size <= 0\n return (arr1.first+arr2.first)/2 if size == 1\n return ([arr1.first, arr2.first].max + [arr1[1], arr2[1]].min)/2 if size == 2\n pos_med1 = arr1.size/2\n pos_med2 = arr2.size/2\n # If both are equal even though we form a ne... | [
"0.8358604",
"0.83355564",
"0.8266037",
"0.7651489",
"0.70722634",
"0.70464146",
"0.7044583",
"0.7026644",
"0.70022833",
"0.69793415",
"0.697342",
"0.6967107",
"0.69570243",
"0.6911792",
"0.6910163",
"0.69100744",
"0.6909307",
"0.6906097",
"0.69055784",
"0.69042623",
"0.69036... | 0.8347991 | 1 |
if it is not a mti_class do what you do else let the primary shard do the saving come back and cleanup | def create
return super unless mti_class?
shard_wrangler.cascade_save
ActiveRecord::IdentityMap.add(self) if ActiveRecord::IdentityMap.enabled?
@new_record = false
self.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _sync\n # Reset the stash map to ensure that it's reset before the next\n # transaction is being started.\n @_stash_map = nil\n\n db_obj = {\n 'class_id' => @store.class_map.class_to_id(self.class.to_s),\n 'data' => _serialize\n }\n @store.db.put_object(db_obj, @_id)... | [
"0.5826379",
"0.5673144",
"0.5557971",
"0.55197066",
"0.5501623",
"0.54532266",
"0.54152966",
"0.53763133",
"0.53615886",
"0.53386056",
"0.53035116",
"0.52685183",
"0.52661794",
"0.5264755",
"0.5241011",
"0.52393705",
"0.52325785",
"0.5213133",
"0.5213133",
"0.5213133",
"0.52... | 0.6373751 | 0 |
if it is not a mti_class do what you do else let the primary shard do the destruction come back and cleanup | def destroy
return super unless mti_class?
shard_wrangler.destroy
if ActiveRecord::IdentityMap.enabled? and persisted?
ActiveRecord::IdentityMap.remove(self)
end
@destroyed = true
freeze
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n return super unless mti_class?\n shard_wrangler.class.cascade_delete_all(:id => id)\n if ActiveRecord::IdentityMap.enabled? and persisted?\n ActiveRecord::IdentityMap.remove(self)\n end\n @destroyed = true\n freeze\n end",
"def finalize()\n # below function... | [
"0.62744975",
"0.55911255",
"0.55807793",
"0.55019563",
"0.5481457",
"0.5481457",
"0.5481457",
"0.5481457",
"0.5479273",
"0.5475279",
"0.5421617",
"0.53866553",
"0.536539",
"0.5353782",
"0.5343694",
"0.5343694",
"0.53373057",
"0.5336828",
"0.5321232",
"0.53058505",
"0.5301606... | 0.6620269 | 0 |
if it is not a mti_class do what you do else let the primary shard do the deletion come back and cleanup | def delete
return super unless mti_class?
shard_wrangler.class.cascade_delete_all(:id => id)
if ActiveRecord::IdentityMap.enabled? and persisted?
ActiveRecord::IdentityMap.remove(self)
end
@destroyed = true
freeze
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n return super unless mti_class?\n shard_wrangler.destroy\n if ActiveRecord::IdentityMap.enabled? and persisted?\n ActiveRecord::IdentityMap.remove(self)\n end\n @destroyed = true\n freeze\n end",
"def delete_class o_class\n cl = classname(o_class)\n logg... | [
"0.6335179",
"0.5841632",
"0.5833209",
"0.57810926",
"0.5780316",
"0.5668683",
"0.5668683",
"0.56190246",
"0.56106365",
"0.5601296",
"0.5518485",
"0.5473844",
"0.5435063",
"0.5433932",
"0.539326",
"0.5380965",
"0.53754777",
"0.5354353",
"0.5353075",
"0.5353075",
"0.5317528",
... | 0.66031605 | 0 |
multi array ops on ruby arrays with same sizes | def multi_array_op(func, *args)
elem = args[0]
if elem.is_a?(Array)
elem.each_with_index.collect do |_item, index|
indexed_args = args.collect { |a| a = a.is_a?(Array) ? a : [a]; a[index] }
multi_array_op(func, *indexed_args)
end
else
func.ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def double_array(array)\n array + array\nend",
"def double_array(array)\n array*2\nend",
"def mutliplied(array)\nend",
"def double_array(array)\n array.concat(array)\nend",
"def cross_array(*enumerables)\n # return to_a.product(*enumerables.map{|e| e.to_a})\n enumerables.unshift self\n result... | [
"0.68821985",
"0.66907203",
"0.6639874",
"0.6609849",
"0.6472788",
"0.64336085",
"0.6425901",
"0.6424392",
"0.6404394",
"0.6332263",
"0.63119227",
"0.62647986",
"0.6223592",
"0.6214414",
"0.62041587",
"0.62035066",
"0.6198502",
"0.619283",
"0.6170268",
"0.6161464",
"0.6144432... | 0.69382524 | 0 |
SF OpenData don't have rating for food trucks. We give random ratings for display purposes. | def rating
rand(40..140).to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_rating\n ratings = [\n ['Low Unsatisfactory', 2], \n ['High Unsatisfactory', 3], \n ['Low Satisfactory', 10], \n ['Mid Satisfactory', 15], \n ['High Satisfactory', 20], \n ['Low Advanced', 25], \n ['High Advanced', 25]\n ]\n wChooseUsingRand(@rand, ratings... | [
"0.7331151",
"0.6829501",
"0.6675677",
"0.661202",
"0.6558206",
"0.64459854",
"0.6426603",
"0.62336653",
"0.6217112",
"0.6152719",
"0.6148448",
"0.6116917",
"0.6105556",
"0.6097569",
"0.60747373",
"0.6062242",
"0.6044514",
"0.6039364",
"0.603809",
"0.60060555",
"0.5965579",
... | 0.7123666 | 1 |
GET /book_editions/1 GET /book_editions/1.json | def show
@book_edition = BookEdition.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @book_edition }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_editions(params = {})\n get_json(get_editions_url(params))\n end",
"def show\n @ebook = Ebook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ebook }\n end\n end",
"def show\n @bookwork = Bookwork.find(params[:id])\n ... | [
"0.75861424",
"0.63522375",
"0.6336166",
"0.6311693",
"0.6262766",
"0.6220065",
"0.6185017",
"0.61807644",
"0.61670285",
"0.6116654",
"0.5896409",
"0.58800846",
"0.5848406",
"0.5824201",
"0.5811929",
"0.5804929",
"0.5795652",
"0.5782079",
"0.5782079",
"0.57789487",
"0.5771109... | 0.69758075 | 1 |
GET /book_editions/new GET /book_editions/new.json | def new
@book_edition = BookEdition.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @book_edition }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @ebook = Ebook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ebook }\n end\n end",
"def new\n @book_step = BookStep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_step }\n ... | [
"0.6673376",
"0.6649164",
"0.66380847",
"0.6552363",
"0.6552363",
"0.6551553",
"0.64930576",
"0.646029",
"0.6452665",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.64522296",
"0.6... | 0.72223675 | 0 |
POST /book_editions POST /book_editions.json | def create
@book_edition = BookEdition.new(params[:book_edition])
respond_to do |format|
if @book_edition.save
format.html { redirect_to @book_edition, notice: 'Book edition was successfully created.' }
format.json { render json: @book_edition, status: :created, location: @book_edition }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_editions(params = {})\n get_json(get_editions_url(params))\n end",
"def new\n @book_edition = BookEdition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book_edition }\n end\n end",
"def index\n set_sort_params(params, params[:editio... | [
"0.6483485",
"0.5559471",
"0.5534786",
"0.5522819",
"0.5461252",
"0.54524195",
"0.5435738",
"0.5397763",
"0.5324665",
"0.5295557",
"0.52609503",
"0.5211759",
"0.5158263",
"0.5131353",
"0.5089978",
"0.5073321",
"0.50497204",
"0.5042247",
"0.5015296",
"0.49752697",
"0.49639487"... | 0.6236308 | 1 |
PUT /book_editions/1 PUT /book_editions/1.json | def update
@book_edition = BookEdition.find(params[:id])
respond_to do |format|
if @book_edition.update_attributes(params[:book_edition])
format.html { redirect_to @book_edition, notice: 'Book edition was successfully updated.' }
format.json { head :no_content }
else
format.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @book_step = BookStep.find(params[:id])\n\n respond_to do |format|\n if @book_step.update_attributes(params[:book_step])\n format.html { redirect_to @book_step, notice: 'Book step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html ... | [
"0.6286758",
"0.6152691",
"0.61249655",
"0.6065369",
"0.6051807",
"0.5939199",
"0.5919881",
"0.5862974",
"0.5779976",
"0.5743298",
"0.5725421",
"0.5720114",
"0.5708054",
"0.5695846",
"0.5677846",
"0.56751186",
"0.56719136",
"0.56503654",
"0.56502616",
"0.5645794",
"0.5643389"... | 0.670074 | 0 |
DELETE /book_editions/1 DELETE /book_editions/1.json | def destroy
@book_edition = BookEdition.find(params[:id])
@book_edition.destroy
respond_to do |format|
format.html { redirect_to book_editions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @book_step = BookStep.find(params[:id])\n @book_step.destroy\n\n respond_to do |format|\n format.html { redirect_to book_steps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ebooks.destroy :id\n respond_to do |format|\n format.html { redirec... | [
"0.7028683",
"0.69519824",
"0.67939264",
"0.6776585",
"0.67064196",
"0.66786176",
"0.6643948",
"0.6634539",
"0.6586968",
"0.65838796",
"0.64897543",
"0.6487982",
"0.64759845",
"0.6473655",
"0.64643717",
"0.6455547",
"0.64515024",
"0.64497",
"0.6442694",
"0.6442694",
"0.644269... | 0.75303924 | 0 |
POST /injurylocations POST /injurylocations.json | def create
@injurylocation = Injurylocation.new(injurylocation_params)
respond_to do |format|
if @injurylocation.save
format.html { redirect_to injurylocations_path, notice: 'Injurylocation was successfully created.' }
format.json { render :show, status: :created, location: @injurylocatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @investigationinjurylocation = Investigationinjurylocation.new(investigationinjurylocation_params)\n\n respond_to do |format|\n if @investigationinjurylocation.save\n format.html { redirect_to @investigationinjurylocation.investigation, notice: 'Investigationinjurylocation was succes... | [
"0.70700353",
"0.6621055",
"0.6541455",
"0.64135724",
"0.63652897",
"0.6237003",
"0.60907704",
"0.6078286",
"0.60781884",
"0.60401905",
"0.60296065",
"0.60133",
"0.5990164",
"0.5979837",
"0.5975455",
"0.59443134",
"0.5914143",
"0.5912503",
"0.59022427",
"0.589973",
"0.5888254... | 0.7735785 | 0 |
PATCH/PUT /injurylocations/1 PATCH/PUT /injurylocations/1.json | def update
respond_to do |format|
if @injurylocation.update(injurylocation_params)
format.html { redirect_to @injurylocation, notice: 'Injurylocation was successfully updated.' }
format.json { render :show, status: :ok, location: @injurylocation }
else
format.html { render :edit ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end",
"def update\r\n @location = Location.find(params[:id])\r\n \r\n respond_to do |format|\r\n if @location.update_attributes(params[:location])\r\n format.json { head :no_content }\r\n else\r\n ... | [
"0.6928675",
"0.6590127",
"0.6535516",
"0.63895977",
"0.636359",
"0.6359285",
"0.6354006",
"0.6349617",
"0.6347368",
"0.63206893",
"0.6289312",
"0.62445134",
"0.62128",
"0.62029785",
"0.6196315",
"0.6193008",
"0.6151019",
"0.615026",
"0.6142713",
"0.61333203",
"0.6132148",
... | 0.7007172 | 0 |
DELETE /injurylocations/1 DELETE /injurylocations/1.json | def destroy
@injurylocation.destroy
respond_to do |format|
format.html { redirect_to injurylocations_url, notice: 'Injurylocation was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Location.delete(params[\"id\"])\n end",
"def destroy\n @investigationinjurylocation.destroy\n respond_to do |format|\n format.html { redirect_to investigationinjurylocations_url, notice: 'Investigationinjurylocation was successfully destroyed.' }\n format.json { head... | [
"0.7169746",
"0.70201606",
"0.69014966",
"0.6846182",
"0.683516",
"0.6805017",
"0.6783422",
"0.6693135",
"0.6686494",
"0.6681633",
"0.66808337",
"0.6662069",
"0.66606796",
"0.6659907",
"0.66580576",
"0.66580576",
"0.665664",
"0.6656152",
"0.6656152",
"0.6656152",
"0.6656152",... | 0.7359374 | 0 |
GET /run_types GET /run_types.json | def index
@run_types = RunType.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @run_types = RunType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @run_types }\n end\n end",
"def show\n @run_type = RunType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { ren... | [
"0.7558277",
"0.67575896",
"0.66501176",
"0.66438615",
"0.6630948",
"0.63753474",
"0.62775445",
"0.6260427",
"0.6234029",
"0.6180226",
"0.61403346",
"0.60907465",
"0.6076732",
"0.6044926",
"0.6044163",
"0.60315347",
"0.59881127",
"0.59881127",
"0.59749556",
"0.59468913",
"0.5... | 0.74328816 | 1 |
POST /run_types POST /run_types.json | def create
@run_type = RunType.new(run_type_params)
respond_to do |format|
if @run_type.save
format.html { redirect_to @run_type, notice: 'Run type was successfully created.' }
format.json { render :show, status: :created, location: @run_type }
else
format.html { render :new... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @run_type = RunType.new(params[:run_type])\n\n respond_to do |format|\n if @run_type.save\n format.html { redirect_to @run_type, notice: 'Run type was successfully created.' }\n format.json { render json: @run_type, status: :created, location: @run_type }\n else\n ... | [
"0.6818408",
"0.679146",
"0.6748303",
"0.6630122",
"0.6617919",
"0.64316225",
"0.62767184",
"0.6260892",
"0.6205599",
"0.61164045",
"0.6111814",
"0.6111814",
"0.6069159",
"0.6016958",
"0.5966407",
"0.5964771",
"0.5902644",
"0.5824565",
"0.5824565",
"0.5823609",
"0.5823609",
... | 0.6901437 | 0 |
PATCH/PUT /run_types/1 PATCH/PUT /run_types/1.json | def update
respond_to do |format|
if @run_type.update(run_type_params)
format.html { redirect_to @run_type, notice: 'Run type was successfully updated.' }
format.json { render :show, status: :ok, location: @run_type }
else
format.html { render :edit }
format.json { render... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @run_type = RunType.find(params[:id])\n\n respond_to do |format|\n if @run_type.update_attributes(params[:run_type])\n format.html { redirect_to @run_type, notice: 'Run type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { rend... | [
"0.71815574",
"0.6975401",
"0.632426",
"0.628634",
"0.6165148",
"0.6105321",
"0.6105321",
"0.610498",
"0.61010486",
"0.608783",
"0.60799575",
"0.6071219",
"0.6069354",
"0.6068691",
"0.6068691",
"0.6068691",
"0.6068691",
"0.6068691",
"0.6068691",
"0.6068691",
"0.6068691",
"0... | 0.72308123 | 0 |
DELETE /run_types/1 DELETE /run_types/1.json | def destroy
@run_type.destroy
respond_to do |format|
format.html { redirect_to run_types_url, notice: 'Run type was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @run_type = RunType.find(params[:id])\n @run_type.destroy\n\n respond_to do |format|\n format.html { redirect_to run_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @run_type.remove_action_set_new_default\n\n respond_to do |format|\n if ... | [
"0.75388706",
"0.6970893",
"0.68634564",
"0.67474186",
"0.6655298",
"0.6654021",
"0.6549378",
"0.64984417",
"0.6465846",
"0.6456955",
"0.64284295",
"0.64201725",
"0.640605",
"0.6396923",
"0.6394494",
"0.6391869",
"0.6390206",
"0.6363904",
"0.63532853",
"0.6353162",
"0.6346058... | 0.74347365 | 1 |
Make a request to the transaction search endpoint of the API | def transaction_search(transaction_type, location)
result = transaction_request(transaction_type, location)
Responses::Transaction.new(JSON.parse(result.body))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transaction_request(transaction_type, location)\n result = @client.connection.get (PATH +\n ERB::Util.url_encode(transaction_type) + '/search'), location\n Error.check_for_error(result)\n result\n end",
"def search_request(params)\n result = @client.connect... | [
"0.7584854",
"0.7413088",
"0.71697396",
"0.7103187",
"0.70791155",
"0.6963362",
"0.689927",
"0.686924",
"0.6684079",
"0.6673873",
"0.6670443",
"0.6656846",
"0.66339236",
"0.6610096",
"0.6567763",
"0.64440227",
"0.64122164",
"0.6392311",
"0.63895357",
"0.6381804",
"0.6381804",... | 0.75911456 | 0 |
Make a request to the transaction endpoint of the API The endpoint requires a format of /v3/transaction_search so the primary request parameter is concatenated. After getting the response back it's checked to see if there are any API errors and raises the relevant one if there is. | def transaction_request(transaction_type, location)
result = @client.connection.get (PATH +
ERB::Util.url_encode(transaction_type) + '/search'), location
Error.check_for_error(result)
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transaction_search(transaction_type, location)\n result = transaction_request(transaction_type, location)\n Responses::Transaction.new(JSON.parse(result.body))\n end",
"def search_with_http_info(space_id, query, opts = {})\n if @api_client.config.debugging\n @api_client.c... | [
"0.70431465",
"0.6969769",
"0.6944244",
"0.6600387",
"0.642537",
"0.64236534",
"0.64223266",
"0.64206314",
"0.64206314",
"0.64198583",
"0.63627535",
"0.6361853",
"0.63490045",
"0.63490045",
"0.6319004",
"0.62986666",
"0.6293366",
"0.6283354",
"0.6263393",
"0.6258303",
"0.6238... | 0.74454635 | 0 |
Get the list of target branches | def get_target_branches
unless @target_branches
fetch_all
base = @config['branches']['production']
allowed_branches = @config['branches'].values
allowed_branches << @config['prefixes']['release'] if @config['prefixes']['release']
banned_branches = ['HEAD']
target_br... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def branch_targets\n []\n end",
"def branch_list\n raw_branches = `cd #{project_repo_path} && git branch -r`\n branches = raw_branches.split(/\\n/)\n return branches\n end",
"def ls_branches\n working_branches = get_branches\n if working_branches.empty?\n $stdout.puts \"No branches\"... | [
"0.81760216",
"0.77343994",
"0.7691612",
"0.7672455",
"0.7603706",
"0.7532292",
"0.7505481",
"0.7361787",
"0.7361787",
"0.7281029",
"0.7242032",
"0.71532995",
"0.71283394",
"0.7102128",
"0.70990485",
"0.7092226",
"0.709189",
"0.7063478",
"0.7028348",
"0.70251083",
"0.69988316... | 0.84020025 | 0 |
Waits for the variable called +name+ to be modified. | def variable(name)
Tk.execute_only(:tkwait, :variable, name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name\n# Input string\n# Return datatype: string\n# String interpolation and Ruby method sleep\n puts \"name your monster\"\n @name = gets.chomp.upcase\n puts \"The Gods are considering your request please wait 3 seconds\"\n sleep 3\n puts \"Congratulations: The Gods have granted your wish, they... | [
"0.6025988",
"0.5931591",
"0.59147143",
"0.5891724",
"0.57934916",
"0.57591355",
"0.575749",
"0.5754974",
"0.5754974",
"0.57400393",
"0.5721122",
"0.56909597",
"0.5629232",
"0.5629232",
"0.5595312",
"0.55924565",
"0.55825025",
"0.55825025",
"0.5580426",
"0.55797863",
"0.55713... | 0.6696047 | 0 |
Takes the +name+ of a window and waits for a change in its visibility state (as indicated by the arrival of a VisibilityNotify event). Typically used to wait for a newlycreated window to appear on the screen before taking some action. | def visibility(name)
Tk.execute_only(:tkwait, :visibility, name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end",
"def create_name_window\n @edit_window = Window_NameEdit.new(@actor, 10)\n @input_window = Window_NameInput.new(@edit_window)\n @input_window.set_handler(:ok, method(:on_input_ok))\n @edit_window.hide\n @input_window.hide\n... | [
"0.7509172",
"0.59860957",
"0.5871165",
"0.5866606",
"0.5835126",
"0.57493335",
"0.5722333",
"0.56358814",
"0.5586113",
"0.5583724",
"0.5578906",
"0.5553645",
"0.545271",
"0.5403329",
"0.5400555",
"0.5363628",
"0.5352441",
"0.5351471",
"0.53335834",
"0.5332441",
"0.5328992",
... | 0.73564255 | 1 |
This method takes the name of a window as argument and waits until the window is destroyed. It is typically used to wait for a user to finish interacting with a dialog box before using the result of that interaction. | def window(name)
Tk.execute_only(:tkwait, :window, name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_dialog(dialog_name)\n wait_start\n opera_desktop_action(\"Cancel\")\n wait_for_window_close(dialog_name)\n end",
"def close_dialog(dialog_name)\n wait_start\n opera_desktop_action(\"Cancel\")\n wait_for_window_close(dialog_name)\n end",
"def wait_for_popup window_i... | [
"0.6529077",
"0.6529077",
"0.63900715",
"0.63900715",
"0.6167899",
"0.61269265",
"0.6011314",
"0.59972215",
"0.59348774",
"0.5908893",
"0.5896044",
"0.5846541",
"0.5822378",
"0.5799336",
"0.578633",
"0.57769644",
"0.5776008",
"0.57602465",
"0.5691111",
"0.5643618",
"0.5623003... | 0.7175282 | 0 |
grue_room : string player_room : string edges : array of arrays each element has the form [room1, room2, direction] | def grue_path(grue_room, player_room, edges)
shortest_path = []
edges_to_check = edges.select do |arr|
arr.first == grue_room
end
unchecked_edges = edges - edges_to_check
edges_to_check.each do |e|
path = [e]
if e[1] != player_room
ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spawn(player_room)\n # get all possible paths and create a hash indexed by size\n paths_to_player = self.rooms.inject({}) do |hsh, room|\n path = self.class.grue_path(room, player_room, self.edges)\n hsh[path.size] = path\n hsh\n end\n\n # get the longest of the shortes... | [
"0.62335527",
"0.609226",
"0.584873",
"0.5763222",
"0.57085866",
"0.5682897",
"0.55582434",
"0.54677194",
"0.544372",
"0.544372",
"0.53926706",
"0.53339165",
"0.5329858",
"0.52780896",
"0.52700406",
"0.52458787",
"0.52248937",
"0.52089703",
"0.5196735",
"0.51926434",
"0.51824... | 0.7357046 | 0 |
Returns the link tags for the css | def css_tags
css.map do |url|
"<link href=\"#{url}\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />"
end.join("\n")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stylesheet_link_tag(*sources)\n html = []\n sources.each do |stylesheet|\n if is_uri?(stylesheet)\n path = stylesheet\n else\n path = url(\"/css/#{stylesheet}.css\")\n end\n html << \"<link href=\\\"#{path}\\\" type=\\\"text/css\\\" rel=\\... | [
"0.6864819",
"0.6677279",
"0.66765517",
"0.66765517",
"0.66089404",
"0.6608529",
"0.65576434",
"0.6450691",
"0.6450691",
"0.64465535",
"0.64293253",
"0.6426241",
"0.6404482",
"0.63617927",
"0.6314443",
"0.6308768",
"0.6300712",
"0.6297919",
"0.62951744",
"0.6294637",
"0.62919... | 0.8004113 | 0 |
Returns an array of all css files that should be included. | def css
css_files = []
@assets.each do |type, path|
case type
when :folder
# Don't import any css/scss files that start with an underscore, so scss partials
# aren't imported by default:
# http://sass-lang.com/guide
css_files += Dir["#{path}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stylesheets\n Dir[Dir.pwd + '/*.css'].map { |path| File.read(path) }\n end",
"def stylesheets\n Dir[Dir.pwd + '/*.css'].map { |path| File.read(path) }\n end",
"def all_stylesheet_paths\n all_paths = []\n all_paths += @stylesheets\n all_paths += @content_scripts.map { |cs| cs.styleshe... | [
"0.7286023",
"0.7286023",
"0.7279719",
"0.7190145",
"0.7125807",
"0.68153167",
"0.68043405",
"0.66962385",
"0.64743495",
"0.6439536",
"0.63381994",
"0.6333574",
"0.63240546",
"0.6251412",
"0.62375724",
"0.6231865",
"0.61180663",
"0.6083035",
"0.60699725",
"0.60644925",
"0.604... | 0.7496662 | 0 |
are we in the development environment? | def development?
env == 'development'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dev_env?\n env == 'development'\n end",
"def development?\n self.environment == ENV_DEV\n end",
"def dev?\n Rails.env == 'development'\n end",
"def development?\n environment == 'development'\n end",
"def development? ; @app.options[:env] == :development ; end",
"def developme... | [
"0.8386098",
"0.8336098",
"0.8248356",
"0.82409084",
"0.8180134",
"0.81496793",
"0.80109537",
"0.7994709",
"0.78839225",
"0.78470504",
"0.7831569",
"0.7772603",
"0.7676056",
"0.76184464",
"0.75766873",
"0.7560572",
"0.75370014",
"0.75306714",
"0.74144775",
"0.73504907",
"0.73... | 0.83794415 | 1 |
Returns true if environment is development? or test? | def dev_or_test?
development? || test?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def development?\n env == 'development'\n end",
"def dev_env?\n env == 'development'\n end",
"def development?\n self.environment == ENV_DEV\n end",
"def development?\n environment == 'development'\n end",
"def development?\n environment == :development\nend",
"def test?\n s... | [
"0.86751854",
"0.86735874",
"0.86732763",
"0.8673128",
"0.84796625",
"0.8343251",
"0.8250853",
"0.8207119",
"0.8196234",
"0.8175681",
"0.8170555",
"0.8160151",
"0.8153777",
"0.8112107",
"0.80798095",
"0.8047786",
"0.804529",
"0.80203384",
"0.79971206",
"0.7926902",
"0.7921483... | 0.90946126 | 0 |
add custom configs before other things start | def setup(configs = nil)
return if @setup
@setup = true
@custom_configs = configs || []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_config\n # To be Extended\n end",
"def post_configure\n # noop\n end",
"def configure\n load_all_configs \n end",
"def configure; end",
"def before_configuration(&block); end",
"def preconfigure(&block)\n @preconfigure ||= block\n end",
"def startup_hook... | [
"0.7228922",
"0.67720205",
"0.67710435",
"0.67485243",
"0.6706806",
"0.6627635",
"0.6590881",
"0.65618175",
"0.6489989",
"0.6478255",
"0.6409258",
"0.63975376",
"0.63944656",
"0.63705426",
"0.63701934",
"0.6366857",
"0.6334453",
"0.628768",
"0.62800384",
"0.62677824",
"0.6261... | 0.7018678 | 1 |
Obtain hash with access_token and refresh_token | def hash
return {} unless access_token && refresh_token
return {
'access_token' => access_token,
'refresh_token' => refresh_token
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n [grant_type, code, refresh_token, redirect_uri, client_id, client_secret].hash\n end",
"def build_token_hash\n { 'access_token' => access_token }\n end",
"def fetch_token_from_hash(refresh_token)\n @access_token_obj = OAuth2::AccessToken.from_hash(@auth_client,\n ... | [
"0.77518904",
"0.7053428",
"0.6891941",
"0.6822592",
"0.66937613",
"0.6689462",
"0.6669668",
"0.666153",
"0.66542876",
"0.6616804",
"0.6567058",
"0.65151054",
"0.6498517",
"0.6467488",
"0.64602053",
"0.6447396",
"0.6437423",
"0.64197814",
"0.638882",
"0.6365381",
"0.63502955"... | 0.747697 | 1 |
GET /joineds GET /joineds.json | def index
@joineds = Joined.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users\n channel = Channel.find(params[:id])\n users = ChannelJoined.where(channel_id: params[:id])\n return json_response({\n users: users.map{|j| j.user}\n })\n end",
"def user_joined\n user = User.find_by!(id: params[:user_id])\n return json_response(... | [
"0.61768925",
"0.61329937",
"0.59698355",
"0.59334886",
"0.5906871",
"0.5827686",
"0.581064",
"0.5772694",
"0.57302773",
"0.57184124",
"0.5696679",
"0.569448",
"0.56850386",
"0.5662305",
"0.5612134",
"0.5599845",
"0.5598919",
"0.5598491",
"0.55726105",
"0.5572074",
"0.5567531... | 0.7064796 | 0 |
POST /joineds POST /joineds.json | def create
@joined = Joined.new(joined_params)
respond_to do |format|
if @joined.save
format.html { redirect_to @joined, notice: 'Joined was successfully created.' }
format.json { render :show, status: :created, location: @joined }
else
format.html { render :new }
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @joined_user = JoinedUser.new(joined_user_params)\n\n respond_to do |format|\n if @joined_user.save\n format.html { redirect_to @joined_user, notice: 'Joined user was successfully created.' }\n format.json { render :show, status: :created, location: @joined_user }\n else\... | [
"0.6444366",
"0.61074233",
"0.6028494",
"0.5714968",
"0.5658462",
"0.55792785",
"0.55047023",
"0.5489245",
"0.5450283",
"0.54474396",
"0.53643554",
"0.5343089",
"0.53148615",
"0.5305037",
"0.5304981",
"0.53048575",
"0.530181",
"0.52460873",
"0.52226734",
"0.52113134",
"0.5203... | 0.71221226 | 0 |
PATCH/PUT /joineds/1 PATCH/PUT /joineds/1.json | def update
respond_to do |format|
if @joined.update(joined_params)
format.html { redirect_to @joined, notice: 'Joined was successfully updated.' }
format.json { render :show, status: :ok, location: @joined }
else
format.html { render :edit }
format.json { render json: @jo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_many\n if @users.update_all(user_params)\n render json: @users, status: :ok, location: users_url\n else\n render json: @users.errors, status: :unprocessable_entity\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"... | [
"0.5877153",
"0.5859266",
"0.5837319",
"0.58131534",
"0.5788771",
"0.577431",
"0.57514715",
"0.5746399",
"0.5690212",
"0.5656355",
"0.56281143",
"0.5618896",
"0.56096923",
"0.5593497",
"0.557431",
"0.5567187",
"0.5562077",
"0.5548357",
"0.5514905",
"0.5498466",
"0.5492607",
... | 0.64423686 | 0 |
DELETE /joineds/1 DELETE /joineds/1.json | def destroy
@joined.destroy
respond_to do |format|
format.html { redirect_to joineds_url, notice: 'Joined was successfully destroyed.' }
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 @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n relationship = Relationships.find(params[:id])\n relationship.destro... | [
"0.65177274",
"0.642456",
"0.636255",
"0.634181",
"0.63154453",
"0.6282337",
"0.627812",
"0.622095",
"0.6188782",
"0.61783826",
"0.6159404",
"0.6153933",
"0.61359674",
"0.6122363",
"0.6118371",
"0.61158764",
"0.6099251",
"0.60958564",
"0.6086497",
"0.6072789",
"0.60579747",
... | 0.7089706 | 0 |
POST /sales_forecasts POST /sales_forecasts.json | def create
@sales_forecast = SalesForecast.new(sales_forecast_params)
respond_to do |format|
if @sales_forecast.save
format.html { redirect_to @sales_forecast, notice: 'Sales forecast was successfully created.' }
format.json { render :show, status: :created, location: @sales_forecast }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @forecast = Forecast.new(params[:forecast])\n\n respond_to do |format|\n if @forecast.save\n format.html { redirect_to @forecast, notice: 'Forecast was successfully created.' }\n format.json { render json: @forecast, status: :created, location: @forecast }\n else\n ... | [
"0.69442296",
"0.68253803",
"0.6629742",
"0.6359097",
"0.61735255",
"0.6083963",
"0.60762334",
"0.6058022",
"0.5992738",
"0.5916345",
"0.5916345",
"0.59101844",
"0.5834936",
"0.5818286",
"0.5809778",
"0.5800901",
"0.5776947",
"0.57012445",
"0.56845057",
"0.5681311",
"0.567284... | 0.7500896 | 0 |
PATCH/PUT /sales_forecasts/1 PATCH/PUT /sales_forecasts/1.json | def update
respond_to do |format|
if @sales_forecast.update(sales_forecast_params)
format.html { redirect_to @sales_forecast, notice: 'Sales forecast was successfully updated.' }
format.json { render :show, status: :ok, location: @sales_forecast }
else
format.html { render :edit ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @forecast = Forecast.find(params[:id])\n\n respond_to do |format|\n if @forecast.update_attributes(params[:forecast])\n format.html { redirect_to @forecast, notice: 'Forecast was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render acti... | [
"0.6864185",
"0.68214816",
"0.66747314",
"0.646551",
"0.6364731",
"0.6133831",
"0.6068756",
"0.6066065",
"0.59763414",
"0.59639233",
"0.590987",
"0.590987",
"0.58810806",
"0.58525234",
"0.5852201",
"0.583067",
"0.5807908",
"0.57937044",
"0.5747408",
"0.5747408",
"0.57401156",... | 0.73310417 | 0 |
DELETE /sales_forecasts/1 DELETE /sales_forecasts/1.json | def destroy
@sales_forecast.destroy
respond_to do |format|
format.html { redirect_to sales_forecasts_url, notice: 'Sales forecast was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @forecast = Forecast.find(params[:id])\n @forecast.destroy\n\n respond_to do |format|\n format.html { redirect_to forecasts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @forecast_72.destroy\n respond_to do |format|\n format.html { redirect_to forec... | [
"0.7497344",
"0.73701215",
"0.7358787",
"0.6998041",
"0.6994285",
"0.6930154",
"0.669101",
"0.6631623",
"0.66190374",
"0.66118467",
"0.6590123",
"0.65862006",
"0.65787464",
"0.657814",
"0.6571346",
"0.6561142",
"0.6542617",
"0.6515782",
"0.65096706",
"0.65055996",
"0.6499015"... | 0.7614303 | 0 |
The opposite of Arrayinclude i.e. return true if self appears in the array splatted into +first+ and +rest+. | def in? first, *rest
(first.is_a?(Array) ? first : [first].concat(rest)).include? self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_include?(array, target)\n return false if array.empty?\n return true if array.first == target\n my_include?(array.drop(1), target)\nend",
"def includes?(array, target)\n if array.empty?\n false\n elsif array.first == target\n true\n else\n includes?(array.drop(1),target)\n end\nend",
"de... | [
"0.7352883",
"0.7275701",
"0.725362",
"0.7145677",
"0.712652",
"0.7106624",
"0.7047529",
"0.69749135",
"0.69622946",
"0.6862535",
"0.68409693",
"0.68224657",
"0.68108904",
"0.6761371",
"0.6692932",
"0.6681192",
"0.6680476",
"0.6668103",
"0.6651931",
"0.6624857",
"0.6623291",
... | 0.8168852 | 0 |
Return self unmodified after logging the output of inspect, along with the point at which +tapp+ was called. | def tapp
tap { puts "#{File.basename caller[4]}: #{self.inspect}" }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tapp\n Babushka::LogHelpers.deprecated! '2017-09-01'\n tap { STDOUT.puts \"#{File.basename caller[2]}: #{self.inspect}\" }\n end",
"def inspect!\n $stderr.puts(self.inspect)\n end",
"def inspect!\n $stderr.puts(self.inspect)\n end",
"def get\n super\n .tap { |result... | [
"0.6483636",
"0.5369693",
"0.5369693",
"0.52905303",
"0.52770275",
"0.5134703",
"0.50808525",
"0.50808525",
"0.502376",
"0.49886099",
"0.49886099",
"0.49886099",
"0.4965967",
"0.49399868",
"0.49362803",
"0.48896167",
"0.4859325",
"0.48477146",
"0.4812033",
"0.4812033",
"0.479... | 0.6342416 | 1 |
Log and return unmodified in the same manner as tapp, but escape the output to be HTML safe and easily readable. For example, becomes <Object:0x00000100bda208> | def taph
tap {
puts "<pre>" +
"#{File.basename caller[2]}: #{self.inspect}".gsub('&', '&').gsub('<', '<') +
"</pre>"
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def debug(object)\n puts \"<pre>\"\n puts object.pretty_inspect.gsub('<', '<').gsub('>', '>')\n puts \"</pre>\"\nend",
"def ru_debug(object)\n begin\n \"<pre class='debug_dump'>#{object.to_yaml}</pre> <p><em>Raw dump</em></p>\".html_safe\n rescue Exception => e # errors from Marshal or YAML\n... | [
"0.6483437",
"0.62061334",
"0.6087314",
"0.594068",
"0.58671564",
"0.5843327",
"0.5815329",
"0.57354784",
"0.5728294",
"0.5641781",
"0.563286",
"0.563286",
"0.56151956",
"0.56121206",
"0.5595415",
"0.55726415",
"0.55717295",
"0.5569038",
"0.5550239",
"0.5534598",
"0.5534598",... | 0.62805504 | 1 |
The absolute path to the artifact's release directory. | def release_path
::File.join(install_path, artifact_name, artifact_version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_path\n @release_path ||= Pathname.new(source_dir).join(data['release_path'] || './release').to_s\n end",
"def filepath\n groupId = @groupId.gsub('.', '/')\n artifactId = @artifactId.gsub('.', '/')\n return \"#{groupId}/#{artifactId}/#{@version}/#{artifactId}-#{@version}\"\n... | [
"0.7805322",
"0.6771892",
"0.6750139",
"0.67314434",
"0.66772777",
"0.6619616",
"0.6613908",
"0.6569632",
"0.65583193",
"0.6538671",
"0.6538304",
"0.653421",
"0.64757997",
"0.6438014",
"0.64031345",
"0.63880557",
"0.63862365",
"0.63862365",
"0.63840806",
"0.63767666",
"0.6376... | 0.86605835 | 0 |
GET /image_paths/new GET /image_paths/new.xml | def new
@image_path = ImagePath.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @image_path }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @uploaded_image = UpdatedImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uploaded_image }\n end\n end",
"def new\n @img = Img.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => ... | [
"0.6165053",
"0.6133824",
"0.5990479",
"0.5975609",
"0.5970181",
"0.59514606",
"0.593504",
"0.5910915",
"0.5905742",
"0.5843028",
"0.5842058",
"0.58256274",
"0.5822929",
"0.57385665",
"0.5719524",
"0.5719442",
"0.56936336",
"0.5641516",
"0.56367075",
"0.5625314",
"0.5615091",... | 0.69418824 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.