query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
532294c13e5a1e87b45a39a8146de4de
config tab link def config; tab.image(:id, 'imgConfigure'); end
[ { "docid": "78c96788dc71073571e3a61ec87c91cd", "score": "0.878368", "text": "def config\n obj_retry(\"tab\") do; tab.image(:id, 'imgConfigure'); end\n end", "title": "" } ]
[ { "docid": "80c2af2d4e4088f943fc55dc605c59a3", "score": "0.74523693", "text": "def config\n $ie.frame(:index, 2).image(:id, 'imgConfigure')\nend", "title": "" }, { "docid": "8e167bb1b422f0dc61965faa60e2b2e6", "score": "0.6476056", "text": "def evtlog; tab.image(:id, 'imgEventLog'); ...
a84d3ae5530d1149d186d3ec78e9d78c
Similar work, but for sizes
[ { "docid": "d3acd5c447ab62c9adeff6058d4f6536", "score": "0.0", "text": "def movable_size(width, height, speed = 0)\n\n # Always set the target size\n @movable_target_w = width\n @movable_target_h = height\n\n # If the speed is zero, set it direct\n if speed.zero?\n\n @w =...
[ { "docid": "14603e52bfe29d7de1443d723a4db3ef", "score": "0.7989287", "text": "def interpret_size(size); end", "title": "" }, { "docid": "1bbdbeeb86c30df1db17ba8d20199805", "score": "0.74686205", "text": "def human_size(*args); end", "title": "" }, { "docid": "dfa6f81c7f2e...
4c2d3ae17ee1211bb59b5dfca4df2349
Read Tier1 configuration Read Tier1 configuration
[ { "docid": "90ce4cfe6f318d72a3718c7247d60f7c", "score": "0.53444463", "text": "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n...
[ { "docid": "97c10267eae8b783e0f794785369eb36", "score": "0.6312236", "text": "def read_config_file; end", "title": "" }, { "docid": "49b0e6ee1d434f7fdec5afd912a33549", "score": "0.60515267", "text": "def get_config\n\t\tend", "title": "" }, { "docid": "17d2bfd8a14ace267be...
77ba6ddbafe423a09a92e64c83e0de84
GET /exemplaresprodutos/1 GET /exemplaresprodutos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1cd5dfafdbefd1dfa40eaa4853204598", "score": "0.69515705", "text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "title": "" }, { "docid": "1cb4f1fa62cde8577a8769242912a8d2", "score": "0.69298655", "text": "def index\n @...
0685b09c70dfa2bd4534029cb1ac738d
Simple to start with, can move 1 in each direction every step
[ { "docid": "41af4d54c9f6766dfe60d38cace802b3", "score": "0.0", "text": "def step\n [\"x\",\"y\",\"z\"].each do |loc|\n sym = \"@#{loc}\".to_sym\n thing = @thing.location.instance_variable_get(sym)\n end_point = @end_location.location.instance_variable_get(sym)\n if thing...
[ { "docid": "c35467a718edf51956bced163a9181a4", "score": "0.70228606", "text": "def move_one_floor\n sleep 0.5\n @direction == :up ? @current_floor += 1 : @current_floor -= 1\n end", "title": "" }, { "docid": "d0f4258979009bfafd893dfd649d1153", "score": "0.6987312", "text": "de...
7d810cb7dc77de4fc581c9a6805eebfe
e(sub:ij) = (r(sub:i)/N) (c(sub:j))
[ { "docid": "1baed50095799a9dc32380e5c7bc736f", "score": "0.0", "text": "def expected(i, j)\n (row_sum(i).to_f / table_sum_all) * column_sum(j)\n end", "title": "" } ]
[ { "docid": "a34f71c166a9839c9410814056a29f8a", "score": "0.66381973", "text": "def eval_A(i,j)\n return 1.0/((i+j)*(i+j+1)/2+i+1)\nend", "title": "" }, { "docid": "e0c8cb27cd5bb5fc05846520e0a8b76f", "score": "0.59101564", "text": "def compute_e(t)\n r = 2\n Utils.each_...
14e153a339e1459fe53086c426d03498
PATCH/PUT /doubts/1 PATCH/PUT /doubts/1.json
[ { "docid": "87fe395c9e6c7c5abdc142b2d5cbf8de", "score": "0.68913084", "text": "def update\n respond_to do |format|\n if @doubt.update(doubt_params)\n format.html { redirect_to @doubt, notice: 'Doubt was successfully updated.' }\n format.json { render :show, status: :ok, location: @...
[ { "docid": "39ca4d8999620eb578f7325ebf003b46", "score": "0.68805194", "text": "def update\n if @doubt.update(doubt_params)\n render :show, status: :ok, location: @doubt\n else\n render json: @doubt.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "doci...
ebfd6e755557086a1101e5a2125eb697
Trips/new not needed as own route because form has been incorporated into users/show page def new if params[:user_id] && !User.exists?(params[:user_id]) redirect_to users_path else
[ { "docid": "a01fd1cd6d1852e7db1d73be92f20ab9", "score": "0.0", "text": "def create\n @trip = Trip.new(trip_params)\n @trip.user = current_user\n # If :trip :country is blank then a country was selected from the countries already present. Otherwise it is a new country being added to the database...
[ { "docid": "9d81a92d346a8b679ba90b72b74b5274", "score": "0.73227483", "text": "def new\n # empty check\n redirect_to controller: :users, action: :new and return unless User::any?\n # set variables\n @user = User.new\n end", "title": "" }, { "docid": "50a82e4a1df7d327f78812700bcb...
93ae8b8730a41529cde14be1f39b0d33
GET /physical_locations/1 GET /physical_locations/1.json
[ { "docid": "a86654ecef8b26f8491acf9ffa475859", "score": "0.75151944", "text": "def show\n @physical_location = PhysicalLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physical_location }\n end\n end", "title": "" ...
[ { "docid": "50d4bb571f1bae72455ccb20b0055e6c", "score": "0.7168437", "text": "def index\n @physical_locations = PhysicalLocation.all\n end", "title": "" }, { "docid": "3bf475699bfa29462aadd813b207818d", "score": "0.68665993", "text": "def locations\n customer = Customer.find_b...
f08301c5f1084d5b8dfea24ad3769554
returns an array of complementary colors
[ { "docid": "db8a59af43573d178e8196cfad0354e8", "score": "0.7671879", "text": "def complementary(n = 2)\n output = [self]\n h, s, l = @hsl\n hi = 1.0 / n\n (n - 1).times do |i|\n ht = h + hi * (i + 1)\n ht -= 1 if ht > 1\n output << Color.new(hsl_to_rgb(ht, s, l))...
[ { "docid": "73c8c9fb4861cd78cb61593f9cf5479f", "score": "0.8103939", "text": "def complementary\n colors = []\n\n # A contrasting color: much darker or lighter than the original.\n colors.push(self)\n c = self.copy\n if self.brightness > 0.4\n c.brightness(0.1 + c.brightn...
7a14df8bf92816bc27269374b2cb8998
POST /kokuins POST /kokuins.json
[ { "docid": "84d07b773251325acf6ee44676a02ec0", "score": "0.6329567", "text": "def create\n @kokuin = Kokuin.new(kokuin_params)\n\n respond_to do |format|\n if @kokuin.save\n format.html { redirect_to admin_kokuin_path(@kokuin), notice: 'Kokuin was successfully created.' }\n form...
[ { "docid": "e3cd59e7a20c4fa62bae5e04fec3ccb6", "score": "0.5666586", "text": "def kokuin_params\n params.require(:kokuin).permit(:thumbnail, :known_users, :description, :shortDesc, :descJse, :shortDescJse, :ktype, :ktype2, :strokes, photo_ids: [], kokuin_match_ids: [])\n end", "title": "" ...
be0ab8b3910e4267a55f9e622cf4f466
Takes an IO object and sets the body. You'll need to explicity set the file_name afterwards.
[ { "docid": "45cb387711668c0f1a544cc7eaf3e6df", "score": "0.7172", "text": "def add_io(io)\n self.body = io.read\n end", "title": "" } ]
[ { "docid": "7c1b3b3dde3b7c33778742051c54b95e", "score": "0.67290616", "text": "def write\n begin\n file = File.open(self.filespec, 'w')\n file.write( self.body )\n rescue Errno::ENOENT => e\n\terrors.add(:filename, e.message.inspect)\n ensure\n file.close\n end\nend"...
4c17c23603c8f44cb54aac93696a8623
GET /plays GET /plays.json
[ { "docid": "0dc0d8967d763ac78536755e97b89b2f", "score": "0.0", "text": "def index\n redirect_to controller: 'compatibilities', action: 'new'\n end", "title": "" } ]
[ { "docid": "5d970b4556cc89fe865678330b332f76", "score": "0.7648431", "text": "def index\n @plays = Play.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plays }\n end\n end", "title": "" }, { "docid": "1a0bf31357abf099e6ea8d8f002...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "14d15a9e50e56947667c99ec65202d6d", "score": "0.0", "text": "def set_documento\n @documento = Documento.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
e5ad4d19406f09020df848ca1b6f365b
Returns the AccessToken users contact details. Note this requests all fields from provider Returns an PortableContacts::Person object
[ { "docid": "eda1932c1951501b2d2d33808a2dea4c", "score": "0.0", "text": "def me(options={})\n single(get(\"/@me/@self\",options.reverse_merge(:fields=>:all)))\n end", "title": "" } ]
[ { "docid": "a4f89e33412a4fc9d936c8c8805c944f", "score": "0.691119", "text": "def fetch_contact_info\n lambda {\n user.vet360_contact_info\n }\n end", "title": "" }, { "docid": "735c2daa634a42775334a8e7acee996f", "score": "0.67698336", "text": "def contacts...
c7cf1bac4c3df721afe41598298960fe
DELETE /gives/1 DELETE /gives/1.json
[ { "docid": "06551ce86b6fdead5adda543d6749831", "score": "0.68832815", "text": "def destroy\n @gife = Give.find(params[:id])\n @gife.destroy\n\n respond_to do |format|\n format.html { redirect_to gives_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70418656", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
0fc1ce2299932208e60ad936c937c856
AFTER CREATE this is the action
[ { "docid": "c31957beee4d74bbdbdce7398b32a02f", "score": "0.0", "text": "def check_for_badge\n new_badge = Badge.generate_for(self)\n if new_badge && !user.all_earned_badges.include?(new_badge)\n # create a new action -> earn badge\n Action.create(user: user, count: 1, name: 'earn_badge',...
[ { "docid": "ab094a2cd2b737386de9fd943fc4d630", "score": "0.8350811", "text": "def after_create\n end", "title": "" }, { "docid": "c5d33e3b6109c7e2512a23cd9b519369", "score": "0.8337988", "text": "def after_create_action; end", "title": "" }, { "docid": "5f4c05a989c84...
96a15fc85d7748d0c17d2fc68b307846
following function includes name and id given by the different functions into the hash matching_map outputparser lambda
[ { "docid": "2f7e3f1c24cbc3b853fe154860eb3472", "score": "0.6144904", "text": "def output_parser(line, matching_map)\n s = line.split(\"\\t\") \n query_id = s[0]\n if query_id.nil?\n STDERR.puts \"No id found\"\n exit 1\n end\n database_id = s[1]\n if database_id.nil?\n STDERR.puts \"No nam...
[ { "docid": "97b3ad1529ad4b883b0678d5ddff8d4d", "score": "0.62608093", "text": "def map_in_parse_result(&f)\n parser { |input| self[input].map &f }.describe(self.to_s)\n end", "title": "" }, { "docid": "1a0bb1961a2898b21175ca59e633e452", "score": "0.6136684", "text": "...
8bc59ad70e4a3376592412cede5a8c08
completed_assignment_count Description: Returns the total number of completed assignments for the instruction. Parameters: None Return value: An integer representing the number of completed assignments for the instruction.
[ { "docid": "dcea8ab27f0e7c770504bc04be09beb2", "score": "0.7597389", "text": "def completed_assignment_count\n total = 0\n #self.oi_assignments.each { |assignment| total += 1 if assignment.complete? }\n self.oi_assignments.each { |assignment| \n total += 1 if assignment.complete ==OiAssign...
[ { "docid": "b68b68d1aa21f85cc5a206cb88657526", "score": "0.7985378", "text": "def completed_assignment_count\n total = 0\n self.oi_instructions.each { |inst| total += inst.completed_assignment_count }\n total\n end", "title": "" }, { "docid": "fe41f0ced2f0ad1e3cbda351bafdcaad", ...
5e026f44e5f83ddb86c6258bf0548508
This sends back freeform data about the agent or host that Hastur is running on. Sample uses include what libraries or packages are installed and available, the total installed memory Any number of these can be sent as information changes or is superceded. However, if information changes constantly or needs to be graph...
[ { "docid": "9a0fd6ffb3a0bdfad3a4954d421a995d", "score": "0.6267524", "text": "def info_agent(tag, data = {}, timestamp = :now, labels = {})\n send_to_udp :type => :info_agent,\n :tag => tag,\n :data => data,\n :timestamp => epoch_usec(times...
[ { "docid": "46649b28f73157bfd333182786e3538a", "score": "0.6271372", "text": "def send_agentinfo_request\r\n # Connect and send fake auth\r\n vprint_status('Connecting to RSCD agent and sending fake auth.')\r\n connect_to_rscd\r\n send_fake_agentinfo_auth\r\n\r\n # Send agentinfo request,...
2f4c681e9961088a68396f98a2b7f9f7
Dessine la grille des items
[ { "docid": "4c95df8532026fe62906602d7c2bbb30", "score": "0.0", "text": "def draw_gridItems\n bitmap_itemBoard = Bitmap.new(\"Graphics/Pictures/boardGame\")\n self.contents.blt(2, 45, bitmap_itemBoard, Rect.new(0, 0, 216, 216))\n end", "title": "" } ]
[ { "docid": "04fc799fedf7fbde92c98d79b83089f0", "score": "0.64607036", "text": "def sulfuras(item); end", "title": "" }, { "docid": "98830294a7533f483ba36a2e0d31824a", "score": "0.592537", "text": "def draw_litem\n # set current variable\n @items_left = $game_party.item_number(@...
569b6393deee16184750ee05ccdd8a3a
GET /rateclasses GET /rateclasses.json
[ { "docid": "3b2fb264cd8d2e2d9e97c06a747e424b", "score": "0.7171892", "text": "def index\n @rateclasses = Rateclass.all\n end", "title": "" } ]
[ { "docid": "b49bad513e624ff21bb59a51ee04e012", "score": "0.6343575", "text": "def set_rateclass\n @rateclass = Rateclass.find(params[:id])\n end", "title": "" }, { "docid": "7941ffb352281ab6cc571b0c61554aa6", "score": "0.63117164", "text": "def index\n @rateclasses=Ratecl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "362c21d3e08f7251277ae322b0558d2a", "score": "0.0", "text": "def set_sign_up\n @sign_up = SignUp.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
c201f2993d5eb8807c67a0090a87081a
Steps: 1. User sign up/register via api This is a prerequisite We create the user first to mimic the existing user behavior 2. A visitor, adds a shortcut to my book 3. Visitor should have a shortcut in my book 4. User logs in with grant_type = 'authorization_code' via api oauth 5. Confirm merged data 6. Visitor should ...
[ { "docid": "2ae3b0ac3b11b015f06e3a7c10336ed4", "score": "0.66872734", "text": "def test_my_book_merge_with_user_login\n # Step 1\n @user = TurtleUser.new({ 'external_client' => true })\n\n turtle_response = @user.register(false)\n assert_response(turtle_response, :success)\n assert(@user....
[ { "docid": "1451f24aeb429dbee3f16698f24db680", "score": "0.65734106", "text": "def test_merge_with_new_user\n # Step 1\n params = {\n 'type' => { 'shortcuts' => ['gas'] },\n 'vrid' => @user.vrid\n }\n\n post '/mb/preferences', params\n assert_response(@response, :success)\n\...
c008964c5abd6981b89065ca85365a95
PATCH/PUT /ground_tracks/1 PATCH/PUT /ground_tracks/1.json
[ { "docid": "a4ce587bb319fbab73be544a843bc789", "score": "0.74965507", "text": "def update\n respond_to do |format|\n if @ground_track.set(ground_track_params)\n format.html { redirect_to @ground_track, notice: 'Ground track was successfully updated.' }\n format.json { head :no_cont...
[ { "docid": "c7faf8c55127145d7f3645fb1d60b6e0", "score": "0.6818355", "text": "def update\n @track = Track.find(params[:id])\n\n if @track.update(track_params)\n head :no_content\n else\n render json: @track.errors, status: :unprocessable_entity\n end\n end", "title": "" }, ...
a409b3bdbc4599c76f9121790e2b887b
Executes the command. Braodcasts these events: :ok when everything is valid. :invalid if the form wasn't valid and we couldn't proceed. Returns nothing.
[ { "docid": "e87b4e10d56338a5a71f3aa648e7e55c", "score": "0.5868796", "text": "def call\n return broadcast(:invalid) if form.invalid?\n\n transaction do\n save_organization\n end\n\n broadcast(:ok)\n rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUniq...
[ { "docid": "78c20a21971884aa9b09a7040c5c0e80", "score": "0.67559355", "text": "def call\n return broadcast(:invalid) if form.invalid?\n\n update_admin\n broadcast(:ok)\n end", "title": "" }, { "docid": "1f12907b9104825a788a50d9313b7ecf", "score": "0.67152417", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ea44439c8f7275d4b78a7123c9b6cd79", "score": "0.0", "text": "def mei_params\n params.require(:mei).permit(:cnpj, :razao_social, :cpf, :rg, :nome, :sexo, :descricao_atividade, :email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
b1dde7769675add8c8e22393ca4b64c1
Currently current_user is a placeholder Under normal circumstances it would return the currently authenticated user
[ { "docid": "0d141f833a91dfea987a61be72739880", "score": "0.82604474", "text": "def current_user\n @current_user ||= User.new\n end", "title": "" } ]
[ { "docid": "00a0ff50993e8bc352ae2570789b10a4", "score": "0.8898219", "text": "def current_user\n authenticate_request unless @current_user\n @current_user\n end", "title": "" }, { "docid": "6c119e3597d708dab59b3dc5f2749605", "score": "0.87014294", "text": "def current_user\n ...
0e2e23127d47949628cd8623cacd28d2
GET /markups/new GET /markups/new.xml
[ { "docid": "343a5e002024b34b0c622a345ad77635", "score": "0.6353326", "text": "def new\n @markup = Markup.new\n @markup.markings.build\n\n respond_to do |format|\n format.js\n format.html # new.html.erb\n format.xml { render :xml => @markup }\n end\n end", "title": "" }...
[ { "docid": "c4a4a9d250e1a392362bf5b75f06803a", "score": "0.7145062", "text": "def new\n @mark = Mark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mark }\n end\n end", "title": "" }, { "docid": "ec9bba36022df8ce3ef175af0a3af07...
b9a35e26827ae54b5c939e1a53e23686
PATCH/PUT /professorships/1 PATCH/PUT /professorships/1.json
[ { "docid": "03b49fa8df5565488a4c3ae865a2fd70", "score": "0.72776204", "text": "def update\n respond_to do |format|\n if @professorship.update(professorship_params)\n format.html { redirect_to @professorship, notice: 'Professorship was successfully updated.' }\n format.json { render...
[ { "docid": "088d4fa290cd84cc74376eaef1c56dfc", "score": "0.6874928", "text": "def update\n\trespond_to do |format|\n\t if @professor.update(professor_params)\n\t\tformat.html { redirect_to @professor, notice: 'Professor was successfully updated.' }\n\t\tformat.json { render :show, status: :ok, locati...
f5999445f43563d68d973fdd4473265f
def average_rating bar = self Review.bar_reviews(bar).average(:rating) end
[ { "docid": "bf491ecd0037490f416e3cbba64052fd", "score": "0.0", "text": "def bar_reviews\n # self.events.map(&:reviews).flatten.select { |rev| rev.user_id != self.id }\n self.events.map(&:reviews).flatten.reject { |rev| rev.user_id == self.user.id }\n end", "title": "" } ]
[ { "docid": "b208e6585ef06cb31bf28da44acfcc2b", "score": "0.9104025", "text": "def average_rating \n reviews.average(:rating)\n end", "title": "" }, { "docid": "175ac1ac7481113a8a37101c641da906", "score": "0.90841", "text": "def average_rating\n reviews.average(:rating)\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "09c009b9d0c5c5bb65bf878869f74f65", "score": "0.0", "text": "def set_source_linkset\n @source_linkset = SourceLinkset.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
6f2446de9f0b997a59fed319f547176f
can't send a payment for less than 1 would schema have been a better place? after_create :send_notification
[ { "docid": "705098ccaa3a65e8d1be12be5d27bc61", "score": "0.0", "text": "def send_notification #when a new transaction is paid notify every user\n @users = User.all\n @users.each do |user| #there MUST be a better way to add one to a whole column than iterating over it but I can't find one\n us...
[ { "docid": "a08a3c6bfa0377140899e0cc242bcab4", "score": "0.7044195", "text": "def notify\n\t\t\t\t\t\t\n\t\t\t\t\t\t# Create payment object\n\t\t\t\t\t\tpayment = @backend.payment_from_params(params)\n\n\t\t\t\t\t\t# Check if payment found\n\t\t\t\t\t\tif !payment.nil?\n\n\t\t\t\t\t\t\t# Verify if retur...
f30753692e7280fba87102366b3c8361
DELETE /card_templates/1 DELETE /card_templates/1.json
[ { "docid": "58cfa2302a59861de1ea39843550e1cb", "score": "0.80205077", "text": "def destroy\n @card_template = CardTemplate.find(params[:id])\n @card_template.destroy\n\n respond_to do |format|\n format.html { redirect_to card_templates_url }\n format.json { head :no_content }\n end...
[ { "docid": "0f3e36c00d4249c7abae7e7e1c1b5383", "score": "0.72187185", "text": "def delete\n template.delete if template?\n end", "title": "" }, { "docid": "45389d27333e7482806e2ce98aac3c1b", "score": "0.71989155", "text": "def destroy\n @item_template.destroy\n respond_...
1f5386ebcd53b4bc4d28b8b71c2be44f
Sets the value of the `auto_converge` attribute.
[ { "docid": "0aaa9fd0cbe70db691f6ad6e9f2f5180", "score": "0.900576", "text": "def auto_converge=(value)\n @auto_converge = value\n end", "title": "" } ]
[ { "docid": "3052019a34b5cd067118f2e2cc1a162f", "score": "0.6519062", "text": "def auto_activate=(auto_activate)\n @auto_activate = auto_activate\n end", "title": "" }, { "docid": "8cd6e9b817c9c2be65690a5bcbe60d70", "score": "0.60017395", "text": "def auto=(v) Axlsx::valid...
ce576d5cc3da53961aff1c370a632754
POST /customers POST /customers.json
[ { "docid": "82575995e3137e298cdf3682b311f6aa", "score": "0.6537413", "text": "def create\n @customer = Customer.where(:fullname => params[:customer][:fullname], :phone => params[:customer][:phone]).first\n\n if @customer\n respond_to do |format|\n #format.html { redirect_to :back }\n ...
[ { "docid": "2bc0c4cfda46ae65a802cffa63f71368", "score": "0.7583026", "text": "def create\n @customer = @user.customers.build(customer_params)\n if @customer.save\n render json: @customer, status: :created\n else\n render ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bb943458a48ca94f6ed27cea4dfafd09", "score": "0.0", "text": "def team_params\n params.require(:team).permit(:id, :description)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
9d5a7c61ca01144d8125d3568a3003b7
updating asiigned to user id based on conditions
[ { "docid": "818ccc3a14dabfc19a7f3cef165ead3a", "score": "0.60893816", "text": "def update_user_params(params)\n if params[:reassign_user].present?\n if (params[:user_type] == \"CommonPoolAgent\" or params[:user_type] == \"ClusterUsers\") and params[:task][:assigned_to_user_id] ==\"\"\n pa...
[ { "docid": "f7cc0c7ef80d80602f1948e19a9cf1cf", "score": "0.7283637", "text": "def update_identity_user(identity, user)\n identity.update_attributes(user_id: user.id) if identity.user != user \n end", "title": "" }, { "docid": "73d223a5e692496070e43b87424aad17", "score": "0.6986252", ...
192b80761eabb82170f90632d0e46d7b
get available storage for create by size and local item path
[ { "docid": "a5d42a716515ae1cbb762b296d8b32de", "score": "0.7780438", "text": "def get_proper_storage_for_create(size, local_path = nil)\n FC::Storage.select_proper_storage_for_create(get_create_storages, size) do |storages|\n local_storages = storages.select{|storage| FC::Storage.curr_host =...
[ { "docid": "61dd3206ddb43d022a88f5aa0473a1b9", "score": "0.6673553", "text": "def get_proper_storage_for_copy(size, exclude = [])\n FC::Storage.select_proper_storage_for_create(get_copy_storages, size, exclude)\n end", "title": "" }, { "docid": "61dd3206ddb43d022a88f5aa0473a1b9", ...
fbc85695fdcb89255bb9c0e864775907
fetch the albums I like
[ { "docid": "ae97344f197df1eec76b593c36a12a72", "score": "0.6611776", "text": "def liked_albums_json\n return unless require_same_user_json\n liked_albums_json_common(false)\n end", "title": "" } ]
[ { "docid": "35e630f51c63476645f27c40ecdf39fc", "score": "0.7375241", "text": "def albums\n @albums ||= fetch_albums\n end", "title": "" }, { "docid": "81f6cc05acf763767527262e99f1b8d1", "score": "0.7206505", "text": "def flickr_albums\n flickr.photosets.getList\n end", ...
610f4421da40b4b1fc8e26c9c007aa4a
if it's nil, just make it an empty hash instead
[ { "docid": "09001d712126eba3d2de61ef795dc8b4", "score": "0.0", "text": "def denil(object)\n if object.nil?\n return {}\n else\n return object\n end\nend", "title": "" } ]
[ { "docid": "89dffca9b25a2ff09350637d6b98d0fe", "score": "0.7294153", "text": "def empty\n @empty && @empty.clone || hash_type.new\n end", "title": "" }, { "docid": "89dffca9b25a2ff09350637d6b98d0fe", "score": "0.7294153", "text": "def empty\n @empty && @empty...
add84053a135bc2d8f349079097e47f9
POST /repositories POST /repositories.xml
[ { "docid": "22e1ff955977ad897aa208b2e46c30e0", "score": "0.61551714", "text": "def create\n @repository = Repository.new(params[:repository])\n\n respond_to do |format|\n if @repository.save\n flash[:notice] = 'Repository was successfully created.'\n format.html { redirect_to(@r...
[ { "docid": "1437a096225fefcc08e6e8456657268b", "score": "0.6219848", "text": "def index\n @repositories = @project.repositories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @repositories }\n end\n end", "title": "" }, { "do...
fa4356f024d94229838510ae16b86b7a
Retrieve the first noun from the array of words given.
[ { "docid": "b8fb36d6211ac04a6924000788088a60", "score": "0.65685844", "text": "def find_noun(words)\n words.find { |w| lemma = Dict.find(w); lemma && !lemma.nouns.empty? }\n end", "title": "" } ]
[ { "docid": "bfaa38f393b41e39545cd3398953884c", "score": "0.71401995", "text": "def headNoun\n words = @phrase.split(/\\s+/)\n return words[words.length-1]\n end", "title": "" }, { "docid": "6436d1084ee0006bfb96b89a94a72f54", "score": "0.6990696", "text": "def find_first_word(t...
fe17ed8e8b00f54bbedc669b51197691
display_moves Prints out the moves made so far in a userfriendly format
[ { "docid": "6e9f9bbc5928d7d8341244fb6ac25703", "score": "0.7346502", "text": "def display_moves(move_list)\r\n\tturns = (move_list.length + 1) / 2\r\n\tif turns > 0\r\n\t\tfor count in 1..turns\r\n\t\t\tprint \" #{count}.\"\r\n\t\t\tprint \" #{move_list[2*count - 2]}\"\r\n\t\t\tif 2*count <= move_list.l...
[ { "docid": "6fb8ca61b124071b3b02a3a8e4848bfd", "score": "0.8222611", "text": "def format_moves(moves)\n output = \"\"\n if moves.empty?\n output += \"None.\"\n else\n moves.each_index do |index|\n output += \"#{index}) \" + format_move(moves[index]) + \"\\n\"\n end\n en...
76b906fd52c5e54069b994cf5e0f7568
PUT /questions/1 PUT /questions/1.xml
[ { "docid": "35ec328e1b7078d9d856a33f029d6418", "score": "0.6064578", "text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params.require(:question).permit(:text))\n format.html { redirect_to(@question, notice: 'Questio...
[ { "docid": "6e2612e562749d74a9ae623e96014d97", "score": "0.69386095", "text": "def save_question(uin, xml)\n uri = File.join(@base_url, \"api/qais/questions\", uin)\n issue_request(:put, uri, xml)\n end", "title": "" }, { "docid": "a91213a81bb9835043d9ecf8ed7cc4f6", "score":...
fff082dd6308786a58a26d342c122aa9
A method that will remove items from a data structure until the condition in the block evaluates to false >>>>>>>>
[ { "docid": "518c126780c5461bf1505cd6c2b9642a", "score": "0.0", "text": "def delete_num_until_2 \n numbers = [1,3,5,7,9,10,13,15,20,21,23,24,25]\n # puts \"The original array is #{numbers}\"\n numbers.each do |num|\n while numbers.length > 2\n puts \"These are our numbers #{numbers}\"\n n...
[ { "docid": "223db28e4a9887743ebee8031087fcd5", "score": "0.7187259", "text": "def drop_while # :yields: obj\n return self unless block_given?\n\n DeferredEnumerator.new do |yielder|\n keep = false\n each do |entry|\n keep ||= !yield(entry)\n\n yielder << entry if keep\n ...
06e0dbf916dfca631208d459aed04a0b
to show all the users not in use at present
[ { "docid": "8b1dbac81472eff58cb602a4a1473ebb", "score": "0.0", "text": "def index\n @users = User.all\n end", "title": "" } ]
[ { "docid": "cf12a7deda34676ed029da85259b4737", "score": "0.7484498", "text": "def visible_users\n User.where.not(type: :AutotestUser)\n end", "title": "" }, { "docid": "7b4a2702dbcccb2073d48fc60e0191c7", "score": "0.73552644", "text": "def non_registered_ad_users\n all_act...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "69dc63cdf876ab600f94efa0c1a32d42", "score": "0.0", "text": "def set_metro\n @metro = Metro.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
caa1180dc425c3b5db5970b793e303cf
Returns a new (unsaved) subject, for creating a new subject
[ { "docid": "db2504286d05a88ec6bffafb4636c5a0", "score": "0.0", "text": "def new\n redirect_to(root_url) && return unless current_user.can_create_patient?\n\n @patient = Patient.new(jurisdiction_id: current_user.jurisdiction_id)\n end", "title": "" } ]
[ { "docid": "3998192077878dc89b2c7b0c4bfb0c30", "score": "0.7721618", "text": "def new\n @subject = Subject.new\n end", "title": "" }, { "docid": "d18231217006d43b95a653ae147042e9", "score": "0.76930255", "text": "def new\n @subject = Subject.new(:name => 'default')\n end", ...
e1e31d1fd673a999f00a056a23c73373
GET /sales_ppo_email_alerts/1 GET /sales_ppo_email_alerts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5a672ab9eb4f5db9c22cc55c79c9057f", "score": "0.74755454", "text": "def issue_alerts\n JSON.parse RestClient.get $api_service+'/send_mails/email_notification'\n end", "title": "" }, { "docid": "eb862f5b3bd1bfedbb29154eb9fdcfa9", "score": "0.7441306", "text": "def issue...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9d9c89747d5c5e801fcb2f3ff2dcc0ea", "score": "0.0", "text": "def set_vote\n @vote = Vote.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
c94bcde7dcdcad4baf046f9b92445e80
Check for a specific version within the PHP source repository
[ { "docid": "8a9719973def24145a58eb2c6fa3f564", "score": "0.6756263", "text": "def version_present_in_cache?\n tag = %x( cd #{@resource[:phpenv_root]}/php-src/ && git tag -l \"php-#{@resource[:php_version]}\" )\n tag.strip == \"php-#{@resource[:php_version]}\"\n end", "title": "" } ]
[ { "docid": "a0a3d374f012684217f9f24529cce351", "score": "0.736704", "text": "def confirm_cached_source(version)\n raise \"Source repository is not present\" if !File.directory?(\"#{@resource[:phpenv_root]}/php-src/.git\")\n\n # Check if tag exists in current repo, if not fetch & recheck\n if !v...
8cbbf2d096bdcd20d9de82761965eb49
Returns an Array of tasks names that have not been completed on the claim.
[ { "docid": "5b41ebf1e599b95536fba1b022d2a6a7", "score": "0.8054418", "text": "def incomplete_task_names\n applicable_task_names - task_names_for_claim\n end", "title": "" } ]
[ { "docid": "cbd4b8bc34497e1ba28c4de0c44e8fca", "score": "0.74943435", "text": "def get_incomplete\n a = []\n @tasks.each do |task|\n if !task.completed?\n a << task\n end\n end\n a\n end", "title": "" }, { "docid": "d6ad5bbfbcf549c81d97b0143bef837f", "score"...
e013fee8a7d6986a1f4e0ca310c9c711
Count total length of RR "Value" included in changes See also: Batchslice_operations
[ { "docid": "ade10b948d0855e6d55dad2200b91f52", "score": "0.6923409", "text": "def value_size\n changes.map do |change|\n upsert_multiplier = change[:action] == 'UPSERT' ? 2 : 1\n rrset = change[:resource_record_set]\n next 0 unless rrset\n rrs = rrset[:resource...
[ { "docid": "e0142f1a421b2be6d31923ad34e71fe5", "score": "0.6833194", "text": "def count\n values.inject(0){|m, v| m += v.length}\n end", "title": "" }, { "docid": "5d2047efcb290ae800eaecf73328c036", "score": "0.6802377", "text": "def length\n length = 0\n [@...
028ac49875b54175306608320ef1bf43
GET /binaries/1 GET /binaries/1.xml
[ { "docid": "71e9b3e5584614b4904daef5d5e3c722", "score": "0.60356355", "text": "def show\n @binary = Binary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @binary }\n end\n end", "title": "" } ]
[ { "docid": "c3c943344cce3b8fea67284daffc9749", "score": "0.66966385", "text": "def index\n @binaries = Binary.all\n end", "title": "" }, { "docid": "316b2dbcf58b3e831877df15be77a50e", "score": "0.63835454", "text": "def get_binary(url, query_params = nil)\n perform('get', ur...
ab9ddecacf6eba8a6ae1431f895be0cd
before_action :authenticate, except: [:new, :create]
[ { "docid": "92f3ec34b275d70cdb6a211701a8a34f", "score": "0.0", "text": "def index\n @requests = Request.all\n end", "title": "" } ]
[ { "docid": "abf3ac3d1ab4efece0d94bb89d840e74", "score": "0.75708395", "text": "def authenticate\n redirect_to :login unless user_signed_in?\n end", "title": "" }, { "docid": "adcbc92111cfa217845048a15f2d8ae3", "score": "0.75298923", "text": "def authenticate!\n unless current_us...
aff450660bfeec95fa0b129fec2121c2
Returns the value of the `user` attribute.
[ { "docid": "13babdd958e1a7e568c65c6d3c42db34", "score": "0.6825115", "text": "def user\n @user\n end", "title": "" } ]
[ { "docid": "b79293d7bc3a6b99dd237024c65b576d", "score": "0.80720174", "text": "def user\n @attributes[:user]\n end", "title": "" }, { "docid": "b79293d7bc3a6b99dd237024c65b576d", "score": "0.80720174", "text": "def user\n @attributes[:user]\n end", "title": "" }...
eb13660b19b9f3c29b602ec7724bc309
Test the availability of the required tools
[ { "docid": "4b301a057246463c43c69c9e1f74d027", "score": "0.64288294", "text": "def tool_exists(tool_name)\n `which #{tool_name} > /dev/null 2>&1`\n if $?.to_i != 0 then\n printf(\"Error: the required '%s' executable is not found in PATH\\n\", tool_name)\n return false\n else\n ...
[ { "docid": "d955c0b87c48204a5ad52659ba8495ae", "score": "0.726562", "text": "def check_tools\n rSuccess = true\n\n begin\n require 'net/ssh'\n rescue Exception\n log_err 'Missing net/ssh library. gem install net-ssh.'\n rSuccess = false\n end\n ...
d54116f8ede85c9ecaa94f909ee9cca5
pipeline The `Ci::Pipeline` to create the environment variables for.
[ { "docid": "b83755918e1599381f5e0af47b6509bf", "score": "0.7335641", "text": "def build_environment_variables(pipeline)\n pipeline.variables.build(\n [{ key: 'CHAT_INPUT', value: arguments },\n { key: 'CHAT_CHANNEL', value: channel }]\n )\n end", "title": "" }...
[ { "docid": "b80a2b16d5161b14d32a38f4063d072e", "score": "0.6157744", "text": "def setup_pipeline\n end", "title": "" }, { "docid": "1edb8499172deab9188b492ee336593d", "score": "0.56935656", "text": "def create_pipeline_object(actions:, environment:, resources:, timeout: nil)\n ...
2cb0590cc8021351bd085411bf063297
manage users admin can create and delete user, assign role to them
[ { "docid": "e8737df4daabfd32ad9f96bb92404908", "score": "0.0", "text": "def manage_users\n @users = User.all\n end", "title": "" } ]
[ { "docid": "0ef49722f2ed34c245d6794e82aa2f99", "score": "0.78349954", "text": "def make_admin\n authorize! @user\n @user.roles = @user.roles + [\"admin\"]\n @user.save\n redirect_to @user, notice: t(\"user.made_admin\", name: @user.username)\n end", "title": "" }, { "docid": "a0...
a0dac828e12d88de5a2f344912ba9012
Public: upload the file to remote server
[ { "docid": "e5b2b0433d4288c712df3e6ef9400b5f", "score": "0.7312928", "text": "def upload(local_path, remote_path)\n Net::SCP.start(HOST, USER, :password => PASSWORD, :host_key => \"ssh-rsa\") do |scp|\n scp.upload(local_path, remote_path)\n end\n end", "title": "" } ]
[ { "docid": "eb72e690b51a2a16511fbf0f855a5cb6", "score": "0.82837796", "text": "def upload_remote_file!\n args = [filename, remote_filename]\n args << { :via => configuration[:copy_via] } if configuration[:copy_via]\n\n upload(*args)\n end", "title": "" }, { ...
88cdaf1272d3293c88b10ebd4b310b2c
removes records that are clear?
[ { "docid": "6050b28c1b2baf87912958a1c83a4542", "score": "0.0", "text": "def _compact(ary)\n ary.reject {|ir| ir.clear? }\n end", "title": "" } ]
[ { "docid": "a72a9d5c979b33b87d372fa4a28659f3", "score": "0.75956273", "text": "def clear_records!\n @records = []\n end", "title": "" }, { "docid": "047d7de885fcad6e1234bf0cdda1137f", "score": "0.74252486", "text": "def delete_all\n records.clear\n end", "titl...
9ffa27076e3edeb183294318b657f848
Identifies a socket.io path with a session id.
[ { "docid": "1479392ffb89e58ff57c47e32194fe37", "score": "0.47408196", "text": "def test_application_with_socket_and_session\n assert_pattern_match [ \"/\", \"index.vwf\", \"0000000000000000\", \"websocket/session\" ], \"/0000000000000000/websocket/session\"\n assert_pattern_match [ \"/\", \"compon...
[ { "docid": "97f22a5e27ee6750915c9fc5a394dbb3", "score": "0.5911804", "text": "def find_session(env, sid); end", "title": "" }, { "docid": "9ce6b542ce9a955328f1b08eca6837d3", "score": "0.5822219", "text": "def chat_session\n\t\t#/user/chat_session/4\n\t\t#/user/chat_session\n\t\t#redi...
02b4551ffb853977026a4fb6bb0c8e18
executes the rest call with parameters
[ { "docid": "a7eeb66f0f55868a679cd81ca5a337c3", "score": "0.7277875", "text": "def execute_rest(rest_url, params)\n log(:info, \"Running execute_rest...\")\n\n # log the parameters we are using for the rest call\n log(:info, \"Inspecting REST params: #{params.inspect}\") if @debug == true\n\n ...
[ { "docid": "84a8976e4ffefdef36b46198684d618f", "score": "0.69609934", "text": "def execute(parameters)\n url = build_url(parameters)\n response = get_response(url)\n handle_errors(response[0]).body\n end", "title": "" }, { "docid": "7eddae9f084adf1b29f810589551344f"...
96e1d28622cae355b64b042f02f71ed7
TODO remove this method (use only the attrs['last_message_at'] value) if/when we update it on all existing messages
[ { "docid": "277c12b17d6d51d60e3a0cf32a78d306", "score": "0.7772755", "text": "def last_message_at\n @fetched_last_message_at ||= begin\n if @last_message_at.present?\n @last_message_at.to_i\n else\...
[ { "docid": "0e98f79ad276e8416d9762177a0a6183", "score": "0.71091294", "text": "def last_message_time\n\t\tself.messages.last.created_at\n\tend", "title": "" }, { "docid": "c71aa97929270bc6358a1a374b64f2dc", "score": "0.665113", "text": "def last_message\n self.messages.max_by{...
34333931bc6e3aa820e1db4e7945782a
Draw the second chart
[ { "docid": "3c08529f63aaacb744d2a49963dad336", "score": "0.6633525", "text": "def getchart2()\n # Retrieve the data from the query parameters\n selectedYear = params[\"year\"].to_i\n software = params[\"software\"].split(\",\").map! {|a| a.to_f }\n hardware = params[\"hardwar...
[ { "docid": "1eb34e7b06153d248060a549f54a5655", "score": "0.6970406", "text": "def getchart()\n # The data for the chart\n data0 = [0.05, 0.06, 0.48, 0.1, 0.01, 0.05]\n data1 = [100, 125, 265, 147, 67, 105]\n labels = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\"]\n\n ...
818b5b16d34e9a8b3d2d0395b3aeb777
POST /dispensible_generics POST /dispensible_generics.json
[ { "docid": "1f80afc3374d18d272a6c0dfe77601fb", "score": "0.61766183", "text": "def create\n @dispensible_generic = DispensibleGeneric.new(dispensible_generic_params)\n\n respond_to do |format|\n if @dispensible_generic.save\n format.html { redirect_to @dispensible_generic, notice: 'Dis...
[ { "docid": "6437fe5be9ff9feed4f64554809148a2", "score": "0.63449246", "text": "def index\n @dispensible_generics = DispensibleGeneric.all\n end", "title": "" }, { "docid": "047b49172a860a2393b0f185bfe0b247", "score": "0.5943484", "text": "def generics\r\n GenericsController....
1f667a6d00a350dfd808813557d06449
Retrieve all winning nomination category names for (name)
[ { "docid": "018f5c7530f254363561a61b8f94b366", "score": "0.87083334", "text": "def m_all_wins_categories(name)\n win_nom_cats = m_all_wins(name).map {|nomination| nomination.category_name}\nend", "title": "" } ]
[ { "docid": "e1e95e690a9b1d02656862040ae4efa8", "score": "0.8394611", "text": "def n_all_wins_categories(name)\n win_nom_cats = n_all_wins(name).map {|nomination| nomination.category_name}\nend", "title": "" }, { "docid": "2596c01d48bbac254b7e9ddd603a3479", "score": "0.6805842", "tex...
4b102babe73ec0b36363dc6b40f05300
DELETE /cupons/1 DELETE /cupons/1.json
[ { "docid": "372760d7bbe392c0c9594a745cf341d7", "score": "0.6816232", "text": "def destroy\n @cupon = Cupon.find(params[:id])\n @cupon.destroy\n\n respond_to do |format|\n format.html { redirect_to cupons_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "4051899670af0ea2c53bd238a920aaa6", "score": "0.72047204", "text": "def destroy\n @cup = Cup.find(params[:id])\n @cup.destroy\n\n respond_to do |format|\n format.html { redirect_to cups_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid":...
70019a3babff082ecbdc7fc8f42313f0
determines if the search term is part of boolean column
[ { "docid": "43d6a53120c61ad2e397b276992bc42a", "score": "0.83324987", "text": "def is_boolean?\n column = NUMBER_TO_OBJECT_MAP[@object].columns.find { |col| col.name == @search_term }\n column && column.type == :boolean\n end", "title": "" } ]
[ { "docid": "17690186c40535c337f35112bf271e7c", "score": "0.6816151", "text": "def boolean?(column)\n column.type == :boolean\n end", "title": "" }, { "docid": "2e6488c2d0e81fbe9311cdf8e58d8e63", "score": "0.681154", "text": "def value_is_boolean?(string)\n return %w[true f...
191c0a1bd24804e80457436fff74c92c
Get the details of a single webhook
[ { "docid": "3badd152052c627183b5b4eae6cebbe1", "score": "0.0", "text": "def webhooks_id_get(id, opts = {})\n data, _status_code, _headers = webhooks_id_get_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "f34295de74bcc58c12a0aa9c6950f68f", "score": "0.7890721", "text": "def get_webhook_detail\n service_response = ClientManagement::GetWebhookDetail.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "43bfa7c9fabbb3b1ee9eb56416b02e63"...
34464ae2055e251fe97243a7c0c016b5
GET rsas/1/decrypt_messages/new def new
[ { "docid": "be314188f3cac93381d1e140dc5ef7b1", "score": "0.7019892", "text": "def create\n rsa = RSA.new(@rsa.n, @rsa.e, @rsa.d)\n @decrypt_message = @rsa.decrypt_messages.build({message: rsa.decrypt(params[:message])})\n\n @decrypt_message.save\n render json: @decrypt_message.id\n end", ...
[ { "docid": "24d41120aa8b054fca8a7638fef53acc", "score": "0.68811524", "text": "def new\n \t@message = Message.new\n end", "title": "" }, { "docid": "b867fffb899ee51be1dca3d059577555", "score": "0.6814303", "text": "def new\n @message = Message.new\n end", "title": "" }, ...
1145b19af58cc3736735e799e91c3fc6
DELETE /sustancia/1 DELETE /sustancia/1.json
[ { "docid": "c3c004b560da2f69036ccfd63eae0361", "score": "0.67922413", "text": "def destroy\n @sustancium.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7328737", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
65f16b50cfd894df28636bbdbed7be6e
===================================================================================================================== => generate_partitioner =====================================================================================================================
[ { "docid": "b98bc728f2ce570aed33591295b9f3ac", "score": "0.7421044", "text": "def generate_partitioner(graph,partitioners,numReduceTask)\r\n \r\n puts\"--- PARTITIONER ---\" \r\n \r\n @Jobs.each do |current_job| \r\n \r\n if partitioners.size == 0\r\n return\r\n ...
[ { "docid": "e8bf3eb6d782acd0ed89fc63bc44812e", "score": "0.74281156", "text": "def partition_list()\nend", "title": "" }, { "docid": "fc8f01223fecea0cc238a6acc19ca0ed", "score": "0.6822697", "text": "def partitions\n [6, 3, 0].map { |n| model.id / 10**n % 1000 }\n end", "titl...
7dc7335dbcdfd9a8b156a4984e6e67a3
Encoding a token is the same as creating a token Creates a token Renaming for easier understanding ```def encode_token(user_id)
[ { "docid": "5fe49dac7b0d6562723bd84058bffd6d", "score": "0.7837903", "text": "def create_token(user_id)\n payload = { user_id: user_id }\n # Creates a token. Encoding something just creates a token\n JWT.encode(payload, secret, 'HS256')\n end", "title": "" } ]
[ { "docid": "434cb435052a901fb54ca60f1d1796ef", "score": "0.7839987", "text": "def encode_token(payload) # arg is data identifying user — e.g., DB id and username\n \n JWT.encode(payload, secret,algorithm)\n end", "title": "" }, { "docid": "97de6948d8adffce9dd6112fd2dbaf6d", "score...
058cbe7d2682d3891803cc6a15772ded
GET /splits/new GET /splits/new.xml
[ { "docid": "ed0af632e57359458743adc88261f07f", "score": "0.6892124", "text": "def new\n @split = Split.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @split }\n end\n end", "title": "" } ]
[ { "docid": "f163f734ac30a5e8b13ed514c419d9dd", "score": "0.60575527", "text": "def new\n @slice = Xen::Slice.new\n @tarballs = Xen::Backup.find\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slice }\n end\n end", "title": "" }, { ...
12f8d5a48d57c326b8f6fb76b3a63d11
Returns a unique, deterministically reproducible index into an array We are hashing based on strings, let's use the ascii value of each string as a starting point.
[ { "docid": "faf320ea2f5ea1beb0dde725f02f2295", "score": "0.0", "text": "def index(key, size)\n total_sum = 0\n key.each_byte do |x|\n total_sum += x\n end\n return total_sum % size\n end", "title": "" } ]
[ { "docid": "183a1acb242bc8e6472308b31a3e8f16", "score": "0.63810235", "text": "def find_unique(array)\n unique_id = 0\n\n array.each do |num|\n unique_id ^= num\n end\n\n unique_id\nend", "title": "" }, { "docid": "16ff3b0bf7645f42591690d81d115630", "score": "0.6240878", "text...
e9733cbf359f3a316e51ee8b1545ec0b
Clones the git specrepo according to parameters passed to the command.
[ { "docid": "413ab71ee076cd99880235cde07a902d", "score": "0.63265765", "text": "def clone_repo\n changes = if @progress\n { :verbose => true }\n else\n {}\n end\n\n config.with_changes(changes) do\n Dir.chd...
[ { "docid": "eeb26217ca343a8af2a43dd2914b6be5", "score": "0.7186604", "text": "def clone(repository, name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "eeb26217ca343a8af2a43dd2914b6be5", "score": "0.7186604", "text": "def clone(repository, name, options = T.unsafe(nil));...
effc0f1006318986f1463be4f05efe95
Time complexity: O(n) Space complexity: O(n) (stack space)
[ { "docid": "38ad1b359a0ff7cb527e6090ec2c9a4d", "score": "0.0", "text": "def is_palindrome(s, start_index = 0, end_index = s.length - 1)\n raise ArgumentError if !s\n return true if end_index <= start_index\n \n if s[end_index] == s[start_index]\n return is_palindrome(s, start_index + 1, end_index...
[ { "docid": "a68f9f801ca8c43c9545eccbaf0030cd", "score": "0.6596914", "text": "def solution(a)\n stones = 0\n stack = []\n a.each do |height|\n stack.pop while stack.any? && stack.last > height\n next if stack.any? && stack.last == height\n stack << height\n stones += 1\n end\n stones\ne...
97c0fbbbc05a16959936031caa197b8d
Convenience method for defining a quorum named "default" with no needs, wants, or compliances.
[ { "docid": "5060a093541a9b94c372b7a198693e1c", "score": "0.82511336", "text": "def default(options = {}, &blk)\n quorum 'default', options, &blk\n end", "title": "" } ]
[ { "docid": "f72e0ce1b4150b75651195a77767f80f", "score": "0.63266945", "text": "def quorum(name, options = {}, &blk)\n @quorums << ::Leap::Quorum.new(name, options, blk)\n end", "title": "" }, { "docid": "bc91d6123e7671fac73c50ea2a94c4a2", "score": "0.59377134", "text": "def s...
ef3d4177d50353ad0389140b85b2d447
GET /image_comments GET /image_comments.xml
[ { "docid": "04283435b9a6676595f489f8ebb0cfab", "score": "0.74370676", "text": "def index\n @image_comments = ImageComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @image_comments }\n end\n end", "title": "" } ]
[ { "docid": "d968cced0c41b5684671260ee0d9ce21", "score": "0.6933745", "text": "def show\n @images = @image_content_nodes\n @comments = @weblog_post.node.comments.all(limit: 25, order: 'comments.created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.any(:r...
27e7ee28a83a2a96c8566de635ccf38b
Calls block once for each cookie, passing that cookie as a parameter.
[ { "docid": "6b098d1ad8f72aae04df6a804f166deb", "score": "0.69670945", "text": "def each\n\n @cookies.each { |c| yield c }\n\n end", "title": "" } ]
[ { "docid": "a74ff35368db269d3cf8045810b39a34", "score": "0.7429048", "text": "def each(&block)\n @cookies.each(&block)\n end", "title": "" }, { "docid": "c5510647c2772d0d4250e480c3e4543a", "score": "0.71285295", "text": "def each_cookie_for(uri); end", "title": "" }...
73fbca143b39f99b0f97278753b3eb54
PATCH/PUT /api/products/1 PATCH/PUT /api/products/1.json
[ { "docid": "744860ae04b387d2634777796dd905db", "score": "0.0", "text": "def update\n if @api_item.update(api_item_params)\n @api_items = Item.order(:name)\n render :index\n else\n render json: @api_item.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "306087ac201b8c728342c4a66d77b684", "score": "0.72833616", "text": "def update\n uri = \"#{API_BASE_URL}/products/#{params[:id]}\"\n payload = params.to_json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.put payload , :content_typ...
d22dd8f63972a0991422fa779653248b
define the arguments that the user will input
[ { "docid": "a248280497564789129e995799f9569c", "score": "0.0", "text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end", "title": "" } ]
[ { "docid": "49665d066ffcf52f2c37b2b1c268e6fd", "score": "0.73753476", "text": "def arguments; end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c268e6fd", "score": "0.73753476", "text": "def arguments; end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c268e6...
16098c8b9d7c7c0e82578286e9e40982
A list of fields that should be displayed in the SHOW action or detail view All fields are included in this list by default, unless the display_in_detail option is set to false in the field options.
[ { "docid": "acfb4c2db85549b375de5c6227db03b9", "score": "0.7369036", "text": "def detail_fields\n fields.each.select(&:show_in_details)\n end", "title": "" } ]
[ { "docid": "521aafbcf3d01d792024dd830eff24b9", "score": "0.7818294", "text": "def all_list_view_fields\n all_fields.select(&:display_in_list)\n end", "title": "" }, { "docid": "12d6c1a1ed6e7d354507ab153b07611a", "score": "0.76264244", "text": "def fields\n configuration.show...
e0f4739de70b4cef102cb59ec9754959
It works by partitioning the input array into 2 array separated by a single element, pivot. pivot is >= (respectively <=) to all the elements to its left (resp. right).
[ { "docid": "69699dbbe325541e4f0b4dd700f69bdd", "score": "0.0", "text": "def quick_sort(array)\n sort(array, 0, array.length-1)\nend", "title": "" } ]
[ { "docid": "e7d97ae0f6556d994090bc1897ed72f7", "score": "0.79132855", "text": "def partition(array, left, right)\n\n pivot = array[left]\n i = left + 1\n j = left + 1\n for x in j..right\n if array[j] < pivot\n array[j], array[i] = array[i], array[j]\n i += 1\n end\n ...
5297259e8017b82c86af460d1980299f
Check if the user is admin else redirects to root
[ { "docid": "9ef126a9b0a178e9811c9e9d6d795f2c", "score": "0.0", "text": "def check_admin_permission\n redirect_to root_path unless @current_user.is_admin?\n end", "title": "" } ]
[ { "docid": "a43d3c27fd214255a647742a1e15f6a3", "score": "0.9008177", "text": "def admin_user\n\t\t\tredirect_to(root_url) unless is_admin?\n\t\tend", "title": "" }, { "docid": "c233e605724e6bda95249842818add4b", "score": "0.8989649", "text": "def admin_user\n redirect_to(root_pa...
f61f09cee5d22f15cb3921d65e2d5dc1
GET /schools/1 GET /schools/1.json
[ { "docid": "e13ad86624c3461f1274d487b8d80287", "score": "0.0", "text": "def show\n redirect_to teachers_school_path(@school), status: :found\n end", "title": "" } ]
[ { "docid": "6c5fbec46d9b32fbdf253c90cb21d976", "score": "0.76176226", "text": "def show\n @school = ::Schools::School.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @school }\n end\n end", "title": "" }, { "docid": ...
fc7cc9d63a26648cb4c337137a51eb53
PATCH/PUT /admin/groups/1 PATCH/PUT /admin/groups/1.js PATCH/PUT /admin/groups/1.json
[ { "docid": "3c5ac46fe581739dfb5b62676bb60ff8", "score": "0.6598423", "text": "def update\n authorize_action_for @group, at: current_store\n\n respond_to do |format|\n if @group.update(group_params)\n track @group\n\n format.html { redirect_to edit_admin_group_path(@group), notic...
[ { "docid": "95ebe44bdba451b98b0dbd1556b3b24f", "score": "0.72392243", "text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n...
f48f77b1f9587bddd7af74c54d82ac82
, only: [:index, :show]
[ { "docid": "11c007572de62f6cbaee512fb8dcd653", "score": "0.0", "text": "def index\n render json: Playlist.all# , each_serializer: PlaylistIndexSerializer\n end", "title": "" } ]
[ { "docid": "fc3a910a496bb2fdb44d1aae6cc995f1", "score": "0.7911004", "text": "def index\n show\n end", "title": "" }, { "docid": "fc3a910a496bb2fdb44d1aae6cc995f1", "score": "0.7911004", "text": "def index\n show\n end", "title": "" }, { "docid": "fc3a910a496bb2fd...
61744a6319d53397fb6a7c7d10dc818f
When the mouse is pressed, the state of the button is toggled. Try moving this code to draw() like in the rollover example. What goes wrong? The following method uses Ruby ranges, which look like 1..10, and stand for the range of things between the start and end element. You can ask a range if it includes a value, in t...
[ { "docid": "435440a1967aff4d17a2448a0448e7b8", "score": "0.7269696", "text": "def mouse_pressed\n if (@x..@x+@w).include?(mouse_x) && (@y..@y+@h).include?(mouse_y)\n @button = !@button \n end\nend", "title": "" } ]
[ { "docid": "47291576d714908b5ce33a7fc8796d2c", "score": "0.7047596", "text": "def mouse_pressed\n rect mouse_x, mouse_y, 16, 16\nend", "title": "" }, { "docid": "a8dd873f67602b84ab1f2b76f81e09e4", "score": "0.6604914", "text": "def mouse_over_button(mouse_x, mouse_y)\n if ((mouse...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "a04c365fe72cd67fcc9be5a04d7cf48d", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n class_id == o.class_id &&\n object_type == o.object_type &&\n download_message == o.download_message &&\n download_...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
2a94926bb7a5df229b24bd27ead25eb2
Delegate missing methods to +change+.
[ { "docid": "098158ce173a62ced7f22b5d4461c63f", "score": "0.69160163", "text": "def method_missing(s,*a,&b)\n if @change.respond_to?(s)\n @change.send(s,*a,&b)\n else\np caller\n super(s,*a,&b)\n end\n end", "title": "" } ]
[ { "docid": "cb2bf745505243783ce025a983c43b58", "score": "0.68752295", "text": "def changed(_data)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "5a4607fc8aac63633476c3826fdcf3dd", "score": "0.68162686", "text": "def change!\n @_changed = true\n unsen...
3ce65b6de4529313998d225947647587
Notice how over the period of these 4 do blocks, the compressed the code from 7 lines in the block to just 1 line! == making a method to sort and print any array of numbers into odds and evens.
[ { "docid": "6834f3f221d78f54c80f35ca9fcbff74", "score": "0.7029879", "text": "def print_odds_and_evens(array)\n evens = []\n odds = []\n array.each {|number| number.even? ? evens << number : odds << number }\n p evens\n p odds\nend", "title": "" } ]
[ { "docid": "ce6933eaec2d0277e839b2d0241673ab", "score": "0.74027133", "text": "def oddlyOrdered (array)\n array.select! { |n| n.is_a?(Fixnum)}\n array.select! { |n| n%2==1 }\n array.sort!\n return array\n\nend", "title": "" }, { "docid": "9199edb552b5570706789083e4b3bc03", "s...
a27d461965dcee426701af93e680f54b
returns entry and shortened lines array
[ { "docid": "74e51fdd4681d92ba3d490fac0effe85", "score": "0.6447999", "text": "def get_next_entry(lines)\n entry_lines = lines.take_while {|line| line.size > 0 }\n newlines = lines[entry_lines.size..-1]\n newlines.shift # the space\n [entry_lines.join(\" \"), newlines]\nend", "title": "" } ]
[ { "docid": "ba83b509ae91e3e4b1ab5e80e323711b", "score": "0.67747766", "text": "def lines\n result = Array.new\n @theLines.each { |l| result << String.new(l) }\n return result\n end", "title": "" }, { "docid": "e42b05a3f83b99ebf9aa36f11ad1fce1", "score": "0.65359896", "text"...
caad67d00868ba0772552c88aaae9581
Acquire a machine, generally by provisioning it. Returns a Machine object pointing at the machine, allowing useful actions like setup, converge, execute, file and directory.
[ { "docid": "9ae2c3d7e22d201ecd4dd2062dbcf6a2", "score": "0.61541224", "text": "def allocate_machine(action_handler, machine_spec, machine_options)\n ensure_vagrant_cluster(action_handler)\n vm_name = machine_spec.name\n vm_file_path = File.join(cluster_path, \"#{machine_spec.n...
[ { "docid": "3b1149d66aca1698674d606f3a8d632d", "score": "0.726923", "text": "def acquire_machine(action_handler, node)\n # TODO verify that the existing provisioner_url in the node is the same as ours\n\n # Set up the modified node data\n provisioner_options = node['normal']['provisioner_...
7289da2630b27dfd8ec77fe256b10227
Start an agent using this client.
[ { "docid": "79bf42388d1834e779b479850d766057", "score": "0.8250919", "text": "def start_agent(*args)\n raise 'Agent has already started.' unless @agent.nil?\n\n @agent = @agent_class.new(self)\n\n @agent.start(*args)\n end", "title": "" } ]
[ { "docid": "6fdfe85e966a0ce7f3049885785dfcd3", "score": "0.75996715", "text": "def start(*args, &b)\n agent = new(*args, &b)\n return agent.start\n end", "title": "" }, { "docid": "e1bfa07a6dbe09e099785ea84825c7e2", "score": "0.64251065", "text": "def start\n ...
b306e3def760798222440b0dd507b623
Lets you move to a different node
[ { "docid": "669bba71792abc8496f2d91cc4b51d54", "score": "0.0", "text": "def next(num)\n @node = num\n @hour.number +=1\n end", "title": "" } ]
[ { "docid": "97441ea9b2ff72ecdf10325c01182225", "score": "0.7644022", "text": "def moved_node\n current_tree.find(node_2.id)\n end", "title": "" }, { "docid": "c8f5da0a0b10cd852c3ea4c09781647e", "score": "0.75696915", "text": "def move\n @node = Node.find(params[:id])\n...
6d9be378b419fb3d9f3e52a66cf6fa33
Complete the countTriplets function below.
[ { "docid": "4be74dfa1819bf977ebc97eb898fddfd", "score": "0.0", "text": "def countTriplets(arr, r)\n triple_count = 0\n # arr is sorted? not necessarily\n # keep two hashes for singles and pairs!!!\n singles = {}\n pairs = {}\n arr.reverse_each do |x|\n # check if this number forms a new triple\...
[ { "docid": "f330089b0b025f021871b29f2c265064", "score": "0.7292165", "text": "def trip_count()\n self.trips().length()\n end", "title": "" }, { "docid": "7f184493547ec64c7a2c0d02a60acde8", "score": "0.72847766", "text": "def trip_count\n trips.count\n end", "title":...
52cf00eeb441e0ff17b2f4aa5da54560
This code is no longer needed def change_my_age=(new_age)
[ { "docid": "26f6f58f134be87a9dcecb10401f35b9", "score": "0.0", "text": "def what_is_name\n @name\n end", "title": "" } ]
[ { "docid": "accdfda7bd71d82166950f1187969c2c", "score": "0.9171776", "text": "def change_my_age=(new_age)\r\n @age = new_age\r\n end", "title": "" }, { "docid": "c84e5b19d85da552e29cc975afe92c7d", "score": "0.9114675", "text": "def change_my_age=(new_age)\n @age = new_age\n e...