query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
The cumulative score up to this point | def game_score
previous_hands = self.game_player.hand_players.joins(:hand).where(
"hands.position <= ?", self.hand.position
)
gs = 0
for h in previous_hands
gs += h.hand_score
end
return gs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumulative\n return @cumulative\n end",
"def cumulative\n return @cumulative\n end",
"def score\n populate_frames.inject(0) {|a,v| a+ v.frame_total}\n end"... | [
"0.7598774",
"0.7598774",
"0.7016018",
"0.6835261",
"0.68092823",
"0.6770185",
"0.6713469",
"0.6668118",
"0.6667957",
"0.66292",
"0.66147524",
"0.6612897",
"0.660974",
"0.66006184",
"0.6579994",
"0.65395516",
"0.6502935",
"0.64596987",
"0.64559686",
"0.64388",
"0.6423252",
... | 0.60655224 | 81 |
A spaceship operator used to easily sort an array | def <=>(node) #:nodoc:
cost <=> node.cost
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort1(array)\n\nend",
"def bar arr\n arr.sort!\nend",
"def qsort(arr)\nend",
"def two(array)\n array.sort\nend",
"def foo arr\n arr.sort\nend",
"def del_sort(array)\n end",
"def using_sort(array)\narray.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def mothrah_sort (an_array)\n\tde... | [
"0.70653754",
"0.7053267",
"0.700868",
"0.69459575",
"0.68573505",
"0.68249255",
"0.67707664",
"0.67707664",
"0.6689981",
"0.6656238",
"0.66473943",
"0.66300565",
"0.6620141",
"0.65829307",
"0.6572471",
"0.6572238",
"0.6561332",
"0.6557607",
"0.65413564",
"0.65413564",
"0.654... | 0.0 | -1 |
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")
country=process_path(xml, "//affiliation[@afid=\"#{afid}\"]/country")
country||=x.attribute("country").value
end
{:id => afid, :name => name, :city => city, :country => country,:type=>:scopus}
end | {
"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 |
We have to find doi on | def search_doi
if xml.at_xpath("//source").text=~/^\s*http:\/\/dx\.doi\.org\/([^\s]+)/
return $1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def doi\n multiple_dois = dois\n multiple_dois.empty? ? nil : multiple_dois.first\n end",
"def doi\n doi_regex = %r{10\\.\\d{4,9}\\/[-._;()\\/:A-Z0-9]+}i\n doi = extract_from_identifier(doi_regex)\n doi&.join\n end",
"def doi\n doi_regex = %r{10\\.\\d{4,9}\\/[-._;()\\/... | [
"0.6485324",
"0.61680067",
"0.61680067",
"0.6060004",
"0.5910328",
"0.57447666",
"0.5689464",
"0.567634",
"0.56634",
"0.56480044",
"0.5642986",
"0.5639806",
"0.5599755",
"0.55870616",
"0.5582495",
"0.5578304",
"0.55764955",
"0.5569101",
"0.5537298",
"0.5524617",
"0.5512387",
... | 0.55603623 | 18 |
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_groups.push(ag) unless ag[:authors].any? {|author| authors_list.include? author}
# authors_list=authors_list | ag[:authors]
# end
end | {
"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 GET /users.json | def index
@users = User.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def GetUsers params = {}\n\n para... | [
"0.82109934",
"0.7873764",
"0.7860689",
"0.78108346",
"0.78067017",
"0.7678852",
"0.76586664",
"0.76318866",
"0.7582366",
"0.75291824",
"0.7487637",
"0.74485743",
"0.7439024",
"0.7437192",
"0.7427442",
"0.73978853",
"0.73978853",
"0.73978853",
"0.73978853",
"0.7377353",
"0.73... | 0.0 | -1 |
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 |
GET /users/admin Manage all admin users/remove admin rights | def admin
@admin_users = User.where(isAdmin:true).where(isApproved:true).paginate(:page => params[:admin_users_page], :per_page => 10)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n return unless authenticated_admin?\n @users = User.all\n end",
"def index # ☑️ will get all users\n if current_user.admin == true \n render json: User.all\n else \n render json: {message: \"Authorized access denied. Admin status: #{current_user.admin}\"} \n end\n end",
... | [
"0.7300169",
"0.72757185",
"0.7194949",
"0.7190606",
"0.7166025",
"0.71204466",
"0.7068661",
"0.70673007",
"0.70541024",
"0.70527",
"0.7027545",
"0.6992733",
"0.6992733",
"0.6987305",
"0.6976507",
"0.6975517",
"0.6962281",
"0.6960012",
"0.6955561",
"0.69530016",
"0.6952987",
... | 0.7117699 | 6 |
GET /users/1 GET /users/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n ... | [
"0.81049806",
"0.77023244",
"0.77010894",
"0.7625595",
"0.75821865",
"0.74811673",
"0.74603444",
"0.7446582",
"0.7305236",
"0.72992796",
"0.72888285",
"0.72772574",
"0.72345036",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
... | 0.0 | -1 |
POST /users POST /users.json | def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
@user.new_user_registration_email
format.html { redirect_to login_path, notice: 'User was successfully created. Please see email for Instructions.'
}
format.json { render :show, status: :created, location: @user }
else
format.html { render :new, notice: 'Fix the errors.'}
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"def post b... | [
"0.7717161",
"0.7520086",
"0.73836344",
"0.72409415",
"0.71978736",
"0.7141429",
"0.7104657",
"0.70591146",
"0.7041025",
"0.70248866",
"0.7003643",
"0.7002613",
"0.7002613",
"0.7002613",
"0.69928265",
"0.69907886",
"0.69809496",
"0.69801414",
"0.69791436",
"0.69791436",
"0.69... | 0.0 | -1 |
PATCH/PUT /users/1 PATCH/PUT /users/1.json | def update
respond_to do |format|
if @user.update(user_params)
format.html { redirect_to user_home_path(@current_user), notice: 'User (' + @user.full_name + ') was successfully updated.' }
format.json { render :show, status: :ok, location: @user }
else
format.html { render :edit }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"de... | [
"0.7225089",
"0.71287596",
"0.70036054",
"0.6903269",
"0.68219566",
"0.68156385",
"0.67085004",
"0.66934854",
"0.6681138",
"0.66734326",
"0.6672101",
"0.6664205",
"0.6664205",
"0.6659583",
"0.6659583",
"0.6655003",
"0.6648765",
"0.66436005",
"0.66416174",
"0.6635357",
"0.6618... | 0.0 | -1 |
DELETE /users/1 DELETE /users/1.json | def destroy
@user.destroy
respond_to do |format|
format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def delete\n render json: Users.delete(params[\"id\... | [
"0.78750724",
"0.77518034",
"0.7713981",
"0.7610077",
"0.747295",
"0.74073994",
"0.74073994",
"0.7369968",
"0.7346072",
"0.7340465",
"0.7328618",
"0.7309635",
"0.73095363",
"0.7306841",
"0.7297868",
"0.72917855",
"0.7291585",
"0.7289111",
"0.7284347",
"0.7250935",
"0.7250935"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_user
if params[:id].present?
@user = User.find(params[:id])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def user_params
params.require(:user).permit(:email, :password, :password_confirmation, :full_name, :contact_number, :team_id, :supervisor_id, :isSupervisor, :supervisorNameNotAUser, :isActive, :isAdmin, :isApproved, :isDenied, :isBlinded)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289... | 0.0 | -1 |
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 |
Instantiates a new deviceManagementExchangeConnector and sets the default values. | def initialize()
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize options = {}\n raise \"Token exchange endpoint can not be nil\" if options[:token_exchange_endpoint].nil?\n self.default_connection = options[:connection]\n @token_exchange_endpoint = options[:token_exchange_endpoint]\n end",
"def initialize(consumer, channel, exc... | [
"0.5361575",
"0.5351051",
"0.5264691",
"0.517555",
"0.51436186",
"0.5110963",
"0.5110963",
"0.5109132",
"0.5005166",
"0.49931514",
"0.4929608",
"0.49034342",
"0.49019668",
"0.48672757",
"0.48648226",
"0.48633227",
"0.48231158",
"0.4823052",
"0.48228842",
"0.48064592",
"0.4791... | 0.0 | -1 |
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 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"connectorServerName" => lambda {|n| @connector_server_name = n.get_string_value() },
"exchangeAlias" => lambda {|n| @exchange_alias = n.get_string_value() },
"exchangeConnectorType" => lambda {|n| @exchange_connector_type = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorType) },
"exchangeOrganization" => lambda {|n| @exchange_organization = n.get_string_value() },
"lastSyncDateTime" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },
"primarySmtpAddress" => lambda {|n| @primary_smtp_address = n.get_string_value() },
"serverName" => lambda {|n| @server_name = n.get_string_value() },
"status" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorStatus) },
"version" => lambda {|n| @version = n.get_string_value() },
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.0 | -1 |
Gets the 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 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_string_value("connectorServerName", @connector_server_name)
writer.write_string_value("exchangeAlias", @exchange_alias)
writer.write_enum_value("exchangeConnectorType", @exchange_connector_type)
writer.write_string_value("exchangeOrganization", @exchange_organization)
writer.write_date_time_value("lastSyncDateTime", @last_sync_date_time)
writer.write_string_value("primarySmtpAddress", @primary_smtp_address)
writer.write_string_value("serverName", @server_name)
writer.write_enum_value("status", @status)
writer.write_string_value("version", @version)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.79519033",
"0.76465106",
"0.75808734",
"0.75808734",
"0.7441225",
"0.7209669",
"0.7209669",
"0.720668",
"0.701747",
"0.7002693",
"0.69936407",
"0.6983181",
"0.6972398",
"0.69675887",
"0.69675887",
"0.6942931",
"0.69420123",
"0.6935524",
"0.69145155",
"0.6891068",
"0.688034... | 0.0 | -1 |
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 |
Gets the status property value. The current status of the Exchange Connector. | def status
return @status
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_status\n return @m_status\n end",
"def getStatus\n @status\n end",
"def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend",
"def status\n @status\n end",
"def status\n @status\n end",
"def status\n value_for('status')\n end",
"def status\n ... | [
"0.8169675",
"0.80962175",
"0.8016841",
"0.79114133",
"0.79114133",
"0.78084016",
"0.77797014",
"0.77214074",
"0.77214074",
"0.7696865",
"0.7684165",
"0.7683428",
"0.76381135",
"0.7552464",
"0.7552464",
"0.75477564",
"0.7542809",
"0.75380236",
"0.7528273",
"0.7482252",
"0.746... | 0.79487854 | 25 |
Sets the status property value. The current status of the Exchange Connector. | def status=(value)
@status = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_status(val)\n self.status = val\n self\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def set_status\n self.status = 1\n end",
... | [
"0.8200798",
"0.81794983",
"0.81794983",
"0.7898023",
"0.7736102",
"0.74658614",
"0.743635",
"0.7434354",
"0.74202317",
"0.7414956",
"0.74126625",
"0.740307",
"0.73856175",
"0.7356474",
"0.73487365",
"0.734825",
"0.73405594",
"0.73226446",
"0.7311442",
"0.73106784",
"0.730906... | 0.8044673 | 25 |
Gets the version property value. The version of the ExchangeConnectorAgent | def version
return @version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version\n version_property ? version_property.ruby_value : nil\n end",
"def version\n @version ||= ExchangeVersion.valueOf(\"Exchange#{self.config['version'].upcase}\")\n end",
"def version\n read_property 'Version'\n end",
"def version_number\n @version\n end",
"def... | [
"0.73818445",
"0.73678887",
"0.7155018",
"0.7141813",
"0.708529",
"0.7011522",
"0.6986342",
"0.68738574",
"0.68738574",
"0.6842649",
"0.68284804",
"0.682711",
"0.6820512",
"0.6785588",
"0.67834103",
"0.67807394",
"0.67694116",
"0.6766478",
"0.6742956",
"0.66871566",
"0.668558... | 0.699925 | 13 |
Sets the version property value. The version of the ExchangeConnectorAgent | def version=(value)
@version = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version=(version)\n @version = version\n end",
"def version=(v)\n @version = v\n end",
"def setVersion(version)\r\n\t\t\t\t\t@version = version\r\n\t\t\t\tend",
"def set(new_version)\n self.version = new_version\n end",
"def version=(version)\n mutate_config(:version) { version... | [
"0.7432586",
"0.74170595",
"0.7366617",
"0.7204515",
"0.7011514",
"0.69915575",
"0.69399834",
"0.686335",
"0.670585",
"0.6638825",
"0.6638825",
"0.6603063",
"0.65917075",
"0.65309393",
"0.6511422",
"0.64768213",
"0.64768213",
"0.64602435",
"0.64277893",
"0.64277893",
"0.64041... | 0.76449525 | 8 |
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 |
GET /cords/1 GET /cords/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @cords = Cord.all\n @cords = Cord.user_cords(current_user)\n end",
"def set_cord\n @cord = Cord.find(params[:id])\n end",
"def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n e... | [
"0.70462674",
"0.6381992",
"0.6066628",
"0.6027903",
"0.59282076",
"0.5880955",
"0.5832428",
"0.58158404",
"0.58031183",
"0.5742837",
"0.57321876",
"0.5705382",
"0.5693554",
"0.56656504",
"0.56561625",
"0.56531286",
"0.56491244",
"0.56437165",
"0.5620294",
"0.5620294",
"0.560... | 0.0 | -1 |
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 }
else
format.html { render :new }
format.json { render json: @cord.errors, status: :unprocessable_entity }
end
end
end | {
"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: :unprocessable_entity }
end
end
end | {
"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 |
Use callbacks to share common setup or constraints between actions. | def set_cord
@cord = Cord.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
Only allow a list of trusted parameters through. | def cord_params
params.require(:cord).permit(:racquet_id, :name, :colour)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.69485277",
"0.6813547",
"0.6799911",
"0.6796169",
"0.6745757",
"0.6741778",
"0.6527065",
"0.65204644",
"0.64925444",
"0.64314413",
"0.64314413",
"0.64314413",
"0.6398711",
"0.6355623",
"0.6355327",
"0.6345812",
"0.6343951",
"0.6338371",
"0.6327366",
"0.6327366",
"0.6327366... | 0.0 | -1 |
GET /qa_games GET /qa_games.json | def index
@qa_games = QaGame.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n render json: @games\n end",
"def index\n game = Game.all\n\n render json: game, include: :teams\n ... | [
"0.73606706",
"0.7263978",
"0.7141979",
"0.7111316",
"0.70508915",
"0.70505524",
"0.70505524",
"0.70505524",
"0.7007634",
"0.69324654",
"0.68992317",
"0.68891084",
"0.6868704",
"0.6857978",
"0.68434566",
"0.67646885",
"0.6754229",
"0.6716776",
"0.6709283",
"0.669391",
"0.6693... | 0.72571254 | 2 |
GET /qa_games/1 GET /qa_games/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n render json: @games\n end",
"def index\n @qa_games = QaGame.all\n end",
"def index\n @games = cu... | [
"0.7166742",
"0.7131815",
"0.69554263",
"0.6936055",
"0.69303036",
"0.6930153",
"0.69301254",
"0.69301254",
"0.69301254",
"0.6916955",
"0.69074756",
"0.68980235",
"0.68433213",
"0.67699003",
"0.6756346",
"0.67544955",
"0.6735974",
"0.6669092",
"0.66435474",
"0.6631597",
"0.66... | 0.0 | -1 |
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 }
format.json { render json: @qa_game.errors, status: :unprocessable_entity }
end
end
end | {
"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: @qa_game.errors, status: :unprocessable_entity }
end
end
end | {
"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 |
Use callbacks to share common setup or constraints between actions. | def set_qa_game
@qa_game = QaGame.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def qa_game_params
params.require(:qa_game).permit(:name, :layout)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62... | 0.0 | -1 |
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 |
Use callbacks to share common setup or constraints between actions. | def set_contact
@contact = Contact.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def contact_params
params.require(:contact).permit!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
For details on the DSL available within this file, see | def create
post = Post.new
post.title = params[:title]
post.description = params[:description]
post.save
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parser\n dsl.parser\n end",
"def initialize(_dsl)\n @dsl = _dsl\n end",
"def dsl_eval(dsl, *args, **_arg2, &block); end",
"def definition_builder; end",
"def definition_builder; end",
"def include_dsl_modules\nend",
"def builder; end",
"def builder; end",
"def builder; end",
"... | [
"0.67658156",
"0.64109945",
"0.63840574",
"0.63551563",
"0.63551563",
"0.63110185",
"0.62342376",
"0.62342376",
"0.62342376",
"0.61601335",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0... | 0.0 | -1 |
this is a workaround for jdbc postgres adapter hiding exceptions | def record_internal_exception
yield
rescue => e
@internal_exception = e
raise
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jdbc_exception; @jdbc_exception end",
"def recoverable?; jdbc_exception.is_a?(Java::JavaSql::SQLRecoverableException) end",
"def transient?; jdbc_exception.is_a?(Java::JavaSql::SQLTransientException) end",
"def sql_state; jdbc_exception ? jdbc_exception.getSQLState : nil end",
"def safe_rescue_exceptio... | [
"0.7802357",
"0.7327724",
"0.7076503",
"0.66844606",
"0.6499574",
"0.64048886",
"0.63983285",
"0.63972676",
"0.63218653",
"0.62573534",
"0.6249169",
"0.62398547",
"0.62343484",
"0.5983456",
"0.5956501",
"0.5956501",
"0.5956501",
"0.5956501",
"0.5956501",
"0.59356886",
"0.5916... | 0.0 | -1 |
def count(node) if node.nil? 0 else 1 end recursive | def count(node = head) # how does one know that node is supposed to go here?;
# i think: nodes are the only thing that can be in the list, therefore
# they're the only thing that can be counted and passed as an argument
# node must default to head because head node is the only node that is
# required for a linked list to exists. if it isn't assigned a count
# it can only be head
if node.nil? # if nothing exists in node then a linked lists doesn't exist and any data
# pushed into it, creates the list
0
else
1 + count(node.next_node) # node is a new instance of Node class and thus any methods called
# on it can only exist in the Node class. That's why there isn't
# a next_node method in the LinkedLists class. That's also why
# next_node is set as an attr_accessor, so instances of LinkedLists
# can change its state/value
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count(node = head)\n if node.nil?\n 0\n else\n 1 + count(node.next_node)\n end\n end",
"def child_count(node, count = 0)\n return count if node.nil?\n if !node.is_a? Node\n child_count(find(node))\n else\n count += 1 if !node.left.nil?\n count += 1 if !node.right.n... | [
"0.8581159",
"0.7922216",
"0.7868882",
"0.7852614",
"0.7791577",
"0.77377355",
"0.77111685",
"0.7542047",
"0.753363",
"0.75239974",
"0.74870884",
"0.7389302",
"0.7286762",
"0.7277509",
"0.7137706",
"0.7110924",
"0.7061172",
"0.7010953",
"0.694168",
"0.69261456",
"0.69155866",... | 0.7407691 | 11 |
Quick Bug does a puts to the quick bug output file passing it the args that it was passed. | def qb(*args)
$qb.puts(*args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def usage\n puts 'Usage: %s.rb [--fix]' % NAME\n puts ' fix Try to fixup meta issues'\n puts 'Script checks consistency of the .META. table. It reports if .META. has missing entries.'\n puts 'If you pass \"--fix\", it will try looking in the filesystem for the dropped region and if it'\n puts 'finds a like... | [
"0.5442991",
"0.5393633",
"0.5364498",
"0.5339902",
"0.52652013",
"0.5254471",
"0.5191228",
"0.51716805",
"0.5159031",
"0.51338804",
"0.5127667",
"0.51218545",
"0.5079293",
"0.5073229",
"0.50719804",
"0.5070416",
"0.50651485",
"0.5065085",
"0.5053815",
"0.50405365",
"0.503398... | 0.0 | -1 |
the sum of the absolute value of each of the number's decimal digits. =begin input:number output: sum of the each digit in the absolute value form of number EX: 10 => 1 99=> 18 32 => |32| => 5 process convert number to string so we can examine each char convert each char to int and sum in new value, new value will equal solution =end | def sumDigits(number)
sol = 0
number.abs.to_s.each_char do |x|
sol += x.to_i
end
print sol
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sumDigits(number)\n number.to_s.chars.map(&:to_i).reduce { |accum, n| accum.abs + n.abs }\nend",
"def sumDigits(number)\n sum = 0\n number.to_s.split(\"\").each {|digit| sum+=digit.to_i.abs}\n sum\nend",
"def sum(number)\n sum = 0\n str_digits = number.to_s.chars\n\n str_digits.each do |str_di... | [
"0.8110155",
"0.7927152",
"0.7423225",
"0.7339825",
"0.728929",
"0.7282996",
"0.72603375",
"0.72540134",
"0.72540134",
"0.72477764",
"0.72258633",
"0.7217085",
"0.7134727",
"0.7079307",
"0.7057833",
"0.7044004",
"0.70288587",
"0.7027454",
"0.7018795",
"0.7017343",
"0.7017343"... | 0.788323 | 2 |
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_line }
else
format.html { render action: "new" }
format.json { render json: @donation_line.errors, status: :unprocessable_entity }
end
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 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.html { render action: "edit" }
format.json { render json: @donation_line.errors, status: :unprocessable_entity }
end
end
end | {
"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 |
Dive down and try to find an array of regular values that could construct the left side of a concatination. This is used to minimize the splat doing a send. | def peel_lhs
case @array
when ConcatArgs
@array.peel_lhs
when ArrayLiteral
ary = @array.body
@array = nil
ary
else
nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def concat(p0) end",
"def concat(p0) end",
"def f6; return *['a','b'] &['a','Y','Z'] end",
"def test_0910_collect_concat\n @@log.debug \"test_0910_collect_concat starts\" if @@log.debug?\n assert_respond_to(@list, :collect_concat, \"test_0910_collect_concat_respond\")\n # Need some arrays for this t... | [
"0.5730106",
"0.5730106",
"0.55782104",
"0.5529614",
"0.54826456",
"0.545956",
"0.5444197",
"0.5410616",
"0.540616",
"0.5386105",
"0.53745484",
"0.5369115",
"0.53345084",
"0.530982",
"0.5296657",
"0.52901864",
"0.5286392",
"0.5264868",
"0.5262225",
"0.5262225",
"0.5262225",
... | 0.5089298 | 73 |
def User.new_token SecureRandom.urlsafe_base64 end def remember self.remember_token = ... update_attribute(:remember_digest, ...) end | def to_s
"#{imie} #{nazwisko}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remember\n self.remember_token = User.new_token \n update_attribute(:remember_digest, User.digest(remember_token)) \n end",
"def remember\nself.remember_token = User.new_token\nupdate_attribute(:remember_digest, User.digest(remember_token))\nend",
"def remember\nself.remember_token = User.new_toke... | [
"0.92444545",
"0.9211045",
"0.9211045",
"0.91980106",
"0.91959894",
"0.9177927",
"0.915029",
"0.915029",
"0.91297615",
"0.91229194",
"0.9120655",
"0.9118347",
"0.9118347",
"0.9118347",
"0.9118347",
"0.9114695",
"0.9111821",
"0.91075927",
"0.9104054",
"0.9102374",
"0.91023505"... | 0.0 | -1 |
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 |
can use .size or .length | def pet_count
return @pets.count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size?() end",
"def size(*) end",
"def size(*) end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
... | [
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8426337",
"0.8141363",
"0.8141363",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"... | 0.0 | -1 |
Allow caller to override the capabilities | def fmtstr_set_caps(fpu, dpa)
@use_fpu = fpu
@use_dpa = dpa
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capabilities; end",
"def capabilities; end",
"def capabilities; end",
"def client_capabilities=(_arg0); end",
"def default_capabilities\n {\n :browserName => \"Chrome\",\n :version => nil,\n :platform => \"Linux\"\n }\n end",
"def register_capabilities(methods)... | [
"0.83256024",
"0.83256024",
"0.83256024",
"0.7442773",
"0.68214697",
"0.6818294",
"0.6763387",
"0.6721922",
"0.6720516",
"0.6720516",
"0.6685665",
"0.6557588",
"0.6547156",
"0.6488966",
"0.632029",
"0.6294481",
"0.6285364",
"0.625645",
"0.6199144",
"0.6156093",
"0.61351794",
... | 0.0 | -1 |
Detect the capabilities (only works for nonblind) | def fmtstr_detect_caps
@use_dpa = fmtstr_detect_cap_dpa
@use_fpu = fmtstr_detect_cap_fpu
#print_status("support dpa:#{@use_dpa.to_s}, fpu:#{@use_fpu.to_s}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capabilities; end",
"def capabilities; end",
"def capabilities; end",
"def capabilities\n data[:capabilities]\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def capabilities\n ... | [
"0.7780192",
"0.7780192",
"0.7780192",
"0.70855683",
"0.67589474",
"0.67589474",
"0.6755632",
"0.66943836",
"0.6646791",
"0.6582498",
"0.6496605",
"0.6482937",
"0.6402995",
"0.63329273",
"0.631555",
"0.6244675",
"0.6188158",
"0.6150402",
"0.6101861",
"0.59783614",
"0.5972525"... | 0.6232095 | 16 |
NOTE: This will likely crash the target process | def fmtstr_detect_exploitable
begin
res = trigger_fmt("|" + ("%n" * 16) + "|")
rescue ::Exception
res = nil
end
return true if not res
res = extract_fmt_output(res)
if res =~ /^\|\|$/
return true
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pausable; end",
"def check_process\n super\n end",
"def crash\n exit!\n end",
"def refork; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def run_interrupt... | [
"0.6498429",
"0.61109644",
"0.6075771",
"0.6068685",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.58848274",
"0.58769816",
"0.5836043",
"0.5831598",
"0.58155376",
"0.57944685",
"0.5734258",
"0.5734258",
"0.5734258"... | 0.0 | -1 |
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 a format string that will perform an arbitrary write using two separate short values | def generate_fmtstr_from_buf(num_printed, write_to, buffer, targ = target)
# break buffer into shorts
arr = fmtstr_gen_array_from_buf(write_to, buffer, targ)
# now build the format string in its entirety
stuff = fmtstr_gen_from_array(num_printed, arr, targ)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_fmt_two_shorts(num_printed, write_to, write_what, targ = target)\n\t\t\n\t\tarr = Array.new\n\t\tarr << [ write_what & 0xffff, write_to ]\n\t\tarr << [ write_what >> 16, write_to + 2 ]\n\t\t\n\t\tstuff = fmtstr_gen_from_array(num_printed, arr, targ)\n\tend",
"def write_short(file, short, md)\n ... | [
"0.77017176",
"0.68730545",
"0.6871862",
"0.6731931",
"0.66059905",
"0.61906",
"0.60821843",
"0.60754824",
"0.60441643",
"0.5997174",
"0.5933728",
"0.58222175",
"0.57790107",
"0.57720774",
"0.5771673",
"0.57262915",
"0.5724654",
"0.57045734",
"0.5665244",
"0.56384885",
"0.560... | 0.5609994 | 20 |
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,buffer.length,tb])
addr = write_to + off
arr << [ tb, addr ]
off += 2
end
return arr
end | {
"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, num_pops, arr)
arr.each do |el|
# find out how much to advance the column value
prec = fmtstr_target_short(el[0], num)
# for non-dpa, if the prec is more than 8, we need something to pop
if not @use_dpa and prec >= 8
addrs << rand_text(4)
end
# write here!
addrs << [el[1]].pack('V')
# put our advancement fmt (or bytes)
fmts << fmtstr_advance_count(prec)
# fmt to cause the write :)
if @use_dpa
fmts << "%" + num_pops.to_s + "$hn"
num_pops += 1
else
fmts << "%hn"
end
# update written count
num = el[0]
end
# make sure we dont have bad characters ...
if (bad_idx = has_badchars?(addrs, payload_badchars))
raise BadcharError.new(addrs, bad_idx, addrs.length, addrs[bad_idx]),
"The format string address area contains invalid characters.",
caller
end
# put it all together
stuff = rand_text(num_pad)
stuff << addrs
if not @use_dpa
stuff << "%8x" * num_pops
end
stuff << fmts
return stuff
end | {
"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 |
Count how many bytes will print before we reach the writing.. | def fmtstr_count_printed(num_printed, num_pad, num_pops, arr)
num = num_printed + num_pad
if not @use_dpa
num += (8 * num_pops)
end
npr = num
arr.each do |el|
prec = fmtstr_target_short(el[0], npr)
# this gets popped in order to advance the column (dpa doesn't need these)
if not @use_dpa and prec >= 8
num += 4
end
# account for the addr to write to
num += 4
npr = el[0]
end
return num
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size; @_io.size; end",
"def num_bytes\n return @num_bytes\n end",
"def total_out\n\t\t@output_buffer.length\n\tend",
"def total_out\n\t\t\t@output_buffer.length\n\t\tend",
"def size_fil_trailer\n 4 + 4\n end",
"def io_lengt... | [
"0.66613513",
"0.6586725",
"0.6556572",
"0.6516755",
"0.645351",
"0.63355196",
"0.6309745",
"0.6188988",
"0.61407083",
"0.60783786",
"0.60361",
"0.6007269",
"0.59840417",
"0.59840417",
"0.5963927",
"0.5902254",
"0.5899624",
"0.5899595",
"0.58895606",
"0.58857006",
"0.58798164... | 0.0 | -1 |
Generate the number to be used for precision that will create the specified value to write | def fmtstr_target_short(value, num_printed)
if value < num_printed
return (0x10000 - num_printed) + value
end
return value - num_printed
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_random()\n begin\n r = Kernel.rand()\n end while r == 0.0\n \n if use_flt?\n BigDecimal(r.to_s)\n else\n r\n end\n end",
"def rnd( val )\n\t\traise 'Trouble' if val == 0.0\n\t\tp = 10**(Math.log10(val.abs).floor)\n\t\tp = val < 0 ? -p : p\n\t\tre... | [
"0.6581044",
"0.6438937",
"0.6438937",
"0.64244",
"0.63345504",
"0.6157965",
"0.6054976",
"0.6009149",
"0.59844977",
"0.597695",
"0.5973231",
"0.5924661",
"0.59075433",
"0.58723795",
"0.5846775",
"0.5846775",
"0.58444357",
"0.58401924",
"0.58401924",
"0.58390725",
"0.5828013"... | 0.0 | -1 |
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 |
Read a single 32bit integer from the stack at the specified offset | def fmtstr_stack_read(offset, extra = '')
# cant read offset 0!
return nil if offset < 1
fmt = ''
fmt << extra
if @use_dpa
fmt << "|%" + offset.to_s + "$x"
else
x = offset
if @use_fpu and x >= 2
fmt << "%g" * (x/2)
x %= 2;
end
fmt << "%x" * (x-1)
fmt << "|"
fmt << "%x"
end
res = trigger_fmt(fmt)
return res if not res
numstr = extract_fmt_output(res)
dw = numstr.split('|')[1].to_i(16)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_int(offset, stream = @index)\n stream.seek(offset)\n stream.read(4).unpack('L')[0]\n end",
"def read_uint32\n read(4).unpack(UINT32).first\n end",
"def read_int32\n read('N', 4)\n end",
"def get_int(offset)\n \n @contents.pos = offset\n # convert the... | [
"0.74301505",
"0.6981613",
"0.69502175",
"0.6916021",
"0.68579113",
"0.6744683",
"0.66947025",
"0.6418955",
"0.6242265",
"0.6192362",
"0.604565",
"0.6031513",
"0.60202396",
"0.59921587",
"0.58863777",
"0.5886111",
"0.587661",
"0.58682275",
"0.58503026",
"0.58500963",
"0.58016... | 0.5802876 | 20 |
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 => :created, :location => @recycling_site }
else
format.html { render :action => "new" }
format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }
end
end
end | {
"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 |
PUT /recycling_sites/1 PUT /recycling_sites/1.xml | def update
@recycling_site = RecyclingSite.find(params[:id])
respond_to do |format|
if @recycling_site.update_attributes(params[:recycling_site])
flash[:notice] = 'RecyclingSite was successfully updated.'
format.html { redirect_to(@recycling_site) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def res... | [
"0.64140916",
"0.62248504",
"0.5954437",
"0.5658692",
"0.5638921",
"0.56213474",
"0.5614808",
"0.5606015",
"0.5606015",
"0.5606015",
"0.5606015",
"0.56044286",
"0.56044286",
"0.5520647",
"0.5518775",
"0.5504721",
"0.54927874",
"0.5482446",
"0.54736596",
"0.54487926",
"0.54439... | 0.6166085 | 2 |
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 |
Bind parameters and variables in the code to parse results in +scope+ | def bind(scope)
bind_in body, scope
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scope() binding end",
"def scope=(_arg0); end",
"def scope=(_arg0); end",
"def scope=(_arg0); end",
"def scope(*args); end",
"def put_var_scope\nend",
"def evaluate(scope, locals, &block); end",
"def scope=(_); end",
"def scope() yield end",
"def evaluate(scope)\n end",
"def process_scope ... | [
"0.7122562",
"0.69045687",
"0.69045687",
"0.69045687",
"0.6841776",
"0.6786824",
"0.65935844",
"0.6380951",
"0.63734394",
"0.6348859",
"0.6297727",
"0.624043",
"0.6222012",
"0.61449885",
"0.6121778",
"0.60628957",
"0.60628957",
"0.6048088",
"0.601297",
"0.5958103",
"0.5930223... | 0.60746956 | 15 |
Metodo para salvar mensaje de contacto | def create
@contacto = Contacto.new(params[:contacto])
if @contacto.save
flash[:success] = "Se ha enviado su mensaje correctamente."
redirect_to root_path
else
flash[:success] = "Error. No se ha podido enviar su mensaje."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mensaje_info(mensaje)\n\t\tmostrar_mensaje 34, mensaje\n\tend",
"def send_to_single(pars)\n @message = Message.new(pars)\n @message.sender = current_user\n if @message.save\n flash[:info] = \"Your message has been sent to #{@message.receiver.full_name}\"\n else\n flash[:error] = \"Your... | [
"0.63805",
"0.6345687",
"0.62183297",
"0.6152524",
"0.6127131",
"0.61169046",
"0.6069226",
"0.6062197",
"0.60478425",
"0.6029438",
"0.601051",
"0.59997165",
"0.5995821",
"0.5990779",
"0.59847224",
"0.59835726",
"0.5945739",
"0.5939544",
"0.59334695",
"0.5928658",
"0.59217465"... | 0.60201025 | 10 |
Input: a number n Returns: Nothing Prints: a pyramid consisting of "" characters that is "n" characters tall at its tallest For example, print_horizontal_pyramid(4) should print | def print_horizontal_pyramid(height)
n = 1
h = height
(1..height).each do |i|
space = " "
star = "*"
print space * h + star * n
n = n+2
h = h-1
print "\n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend",
"def pyramid(height)\n height.times do |n|\n print ' ' * (height - n)\n puts '#' * (2 * n + 1)\n end\n\nend",
"def print_horizontal_pyramid(height)\ni=1\nk=height\nt=height\n\ni.upt... | [
"0.8211096",
"0.78011477",
"0.75496167",
"0.74561214",
"0.73982084",
"0.7257838",
"0.7203613",
"0.7136274",
"0.71276754",
"0.70082766",
"0.6992628",
"0.6895677",
"0.68736786",
"0.6869643",
"0.6845945",
"0.6832819",
"0.68116635",
"0.67972666",
"0.6780788",
"0.67569506",
"0.673... | 0.75031114 | 3 |
prevents method from being invoked by a route | def set_current_user
# we exploit the fact that the below query may return nil
@current_user ||= Moviegoer.find_by(:id => session[:user_id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def no_routes\n end",
"def no_routes\n # no need to do anything here either.\n end",
"def `(*args); forbidden(__method__); end",
"def undefined_route\n routing_error!\n end",
"def cancel\n __log_activity\n __debug_route\n __debug_request\n super\n rescue => error\n auth_failu... | [
"0.684974",
"0.64332175",
"0.63333493",
"0.6174595",
"0.6099277",
"0.6072127",
"0.6065973",
"0.6009345",
"0.5993435",
"0.5989465",
"0.5936756",
"0.5929394",
"0.5862227",
"0.5860001",
"0.58521897",
"0.58478904",
"0.5846941",
"0.58460385",
"0.58438456",
"0.58427393",
"0.5840499... | 0.0 | -1 |
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_user_key
)
end | {
"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 |
Combines headers/value pairs into a single struct for easier handling. | def fields
@fields = headers.map.with_index do |header, index|
Field.new(header, row_data[index])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_headers(*headers)\r\n hdr = {}\r\n headers.each do |h|\r\n hdr.merge!(h) do |k,v1,v2|\r\n v1.merge!(v2) if k == :attributes!\r\n end\r\n end\r\n hdr\r\n end",
"def merge_headers(*headers)\n hdr = {}\n headers.each do |h|\n hdr.merge!(h) do ... | [
"0.6471593",
"0.64623356",
"0.64618134",
"0.62762666",
"0.61681825",
"0.61663663",
"0.60723513",
"0.59504277",
"0.5904123",
"0.58703166",
"0.5821301",
"0.5809715",
"0.57958263",
"0.5759309",
"0.57372373",
"0.57364005",
"0.57231206",
"0.5651339",
"0.564033",
"0.5630153",
"0.55... | 0.0 | -1 |
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(instantiation_fields)]
file_hash
end
end | {
"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_and_instantiation_fields.slice_when do |prev_field, field|
initial_file_header?(field.header) && !initial_file_header?(prev_field.header)
end
end
end | {
"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 |
Converts these fields into a hash for the payload. | def fields_to_hash(these_fields)
combined_fields = combine_multivalued_fields(these_fields)
combined_pairs = combined_fields.map do |field|
# does the normalize_ case ever happen?
key = api_field_name_for(field.header) || normalize_header(field.header)
[ key, encode_values(field.value) ]
end
Hash[ combined_pairs ]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_hash\n @fields\n end",
"def to_h\n FieldsToHash.call(self)\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_hash\n each_pair.to_h\n ... | [
"0.73391426",
"0.71361554",
"0.69639176",
"0.69332045",
"0.69123054",
"0.68998337",
"0.6895101",
"0.68694097",
"0.68244773",
"0.6761689",
"0.67035925",
"0.66412026",
"0.6614358",
"0.6602742",
"0.65816575",
"0.6560691",
"0.6543602",
"0.65328777",
"0.65308064",
"0.652314",
"0.6... | 0.67869824 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.