query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5e3946579dce0b619ad9efbb8d6870ce
Returns the end tag ("").
[ { "docid": "d4b798e531a5ce90feab82efc86103a9", "score": "0.6557689", "text": "def end_style\n \"</span>\"\n end", "title": "" } ]
[ { "docid": "5aceb4f03d158938bf236a3655531cf6", "score": "0.8123951", "text": "def end_tag\n \"</#{element.tag}>\"\n end", "title": "" }, { "docid": "ee3b921f675e701ee08650a877c5ed19", "score": "0.8121397", "text": "def closing tag\n \"</#{tag}>\"\n end", "titl...
a87b1fce3a7c8b4577df6dabe831c540
Returns a string representation of a time object suitable for consumption by add_zone.
[ { "docid": "4781f19cf189a41bda6d7b52e3ed28c1", "score": "0.0", "text": "def _change_zone(time)\n ActiveSupport::Deprecation.warn \"_change_zone will be made private in a future version.\"\n _add_zone(time.strftime(DATE_FORMAT))\n end", "title": "" } ]
[ { "docid": "cceaf0b041b871ab396c6a05cc5c2a4d", "score": "0.7539464", "text": "def to_s\n @string || @object.strftime('%H:%M:%S%Z').sub(/\\+00:00|UTC/, 'Z')\n end", "title": "" }, { "docid": "091a24ec0cce75df54d8267ac1e5c3fc", "score": "0.7497665", "text": "def to_string(time ...
2973024296bb18bc852b06c9a09efa2e
calculate the number of nights for a reservation (end date is not a night)
[ { "docid": "ca122dbcf41d859b701b1139d60b1dfd", "score": "0.7176375", "text": "def nights\n return @dates.length - 1\n end", "title": "" } ]
[ { "docid": "a39a9962337891b5bd097698807f4397", "score": "0.84076935", "text": "def nights\n return ((end_date - start_date) / 86400).to_i\n end", "title": "" }, { "docid": "e53437c3401c472d5130d4be9d7ca16d", "score": "0.832496", "text": "def nights\n \t(self.end_date - self....
79013f2bc211154bc1e31efa082be6ed
GET /user_services/1 GET /user_services/1.json
[ { "docid": "fc9f37879940fc5170f328d51e548540", "score": "0.5920019", "text": "def show\n @sell_list = Service.where(user_id: params[:id])\n @user_service = UserService.where(user_id: params[:id])\n end", "title": "" } ]
[ { "docid": "0d35546350d79f2374df78bca574df7c", "score": "0.7645653", "text": "def service\r\n service = Service.find_by(user_id:params[:user_id])\r\n if service\r\n render json: service\r\n else\r\n render json: {errors: ['Service no found.']}, status: 422\r\n end\r\n end", "t...
025bc44b5fe05d9f6bf550dd48bd7477
PATCH/PUT /statutories/1 PATCH/PUT /statutories/1.json
[ { "docid": "b3baa1eed20befaf564645f80e930621", "score": "0.70255965", "text": "def update\n respond_to do |format|\n if @statutory.update(statutory_params)\n format.html { redirect_to @statutory, notice: 'Statutory was successfully updated.' }\n format.json { render :show, status: ...
[ { "docid": "1c17fd3cf50112aac2b5a3d75265ead9", "score": "0.698936", "text": "def update\n @statut = get_statut\n\n respond_to do |format|\n if @statut.update_attributes(params[:statut])\n format.html { redirect_to @statut, notice: 'Statut was successfully updated.' }\n format.js...
b574783824d31ad7158918565989c7ce
callseq: ary.transpose > array Assumes that _ary_ contains only arrays of equal lengths and returns a new array with their rows and columns transposed. [[1,2],[3,4],[5,6]].transpose => [[1, 3, 5], [2, 4, 6]]
[ { "docid": "d9b6805835f483ea152b6ac7a1fb2c3c", "score": "0.7439628", "text": "def transpose\n `if(this.length==0){return [];}`\n `var result=[],a=this[0].length,n=this.length`\n `while(result.length<a){result.push([])}`\n `for(var i=0;i<a;++i){for(var j=0;j<n;++j){if(this[j].length!=this[0]....
[ { "docid": "32b51cb69650b1bab1e1d75c8ad21c67", "score": "0.8553519", "text": "def transpose(arr)\n rows = arr.map(&:size).max\n cols = arr.size\n\n (0...rows).to_a.map do |row|\n (0...cols).to_a.map do |col|\n arr[col][row]\n end\n e...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "4e91ab3947c8f6bf7615113c25f6c5d0", "score": "0.0", "text": "def meeting_confirmation\n ReservationMailer.meeting_confirmation\n end", "title": "" } ]
[ { "docid": "f4f01bf0c4f6341760a71d13d7b6cc72", "score": "0.7310511", "text": "def preview_email\n email = UserMailer.emailing(@emailing)\n mail_inliner = Roadie::Rails::MailInliner.new(email, Rails.application.config.roadie)\n mail = mail_inliner.execute\n\n mail.html_part.decoded.gsub /http...
d339ede14c61fde823dd664eb9e90b43
Checks there are already tagged specifications if the specification has a git source and doesn't specify a tag (i.e. rejects 0.0.1 specs if they are not admissible anymore).
[ { "docid": "a4b530a306d2fe25601efa863f839180", "score": "0.8114595", "text": "def check_if_untagged_version_is_acceptable(spec, previous_spec, errors)\n return if !spec.source[:git] || spec.source[:tag]\n return unless related_specifications(spec)\n return if previous_spec\n ...
[ { "docid": "8370df55231542c0407662f1b3bc6565", "score": "0.67077255", "text": "def check_commit_change_for_untagged_version(spec, previous_spec, errors)\n return unless previous_spec\n return unless spec.version == Version.new('0.0.1')\n unless spec.source[:commit] == previous_spec....
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8254ec44eee03dfe1c9cb48920354244", "score": "0.0", "text": "def set_task\n @task = Task.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
d576648ff650d7133ebae151b375811b
Returns the nth element of the powerset of this enumerable. == Example [1, 2, 3].nth_subset(1) => [1] [1, 2, 3].nth_subset(2) => [2] [1, 2, 3].nth_subset(3) => [1, 2]
[ { "docid": "98fe32704e7af4e75099326ecc7635b5", "score": "0.7393846", "text": "def nth_subset(n)\n # Ruby allows us to index integers as if they were arrays of bits,\n # so we can check if an element should be included in the result by testing if the ith bit of n is 1\n each_with_index.map { |e,...
[ { "docid": "1f955cca7c9bdf1213f6533fdec9b628", "score": "0.5906526", "text": "def powerset(array, index = nil)\n if index.nil?\n index = array.length - 1\n elsif index < 0\n return [[]]\n end\n\n ele = array[index]\n subsets = power(array, index - 1)\n (0..subsets.length - 1).each do |i|\n ...
60468620336128874343ddeba6d709ca
Create a &39;asset.DeviceClaim&39; resource.
[ { "docid": "5c4a791d5c50e2bfe5d4bd0519feb832", "score": "0.68975043", "text": "def create_asset_device_claim_with_http_info(asset_device_claim, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_device_claim ...'\n end\n ...
[ { "docid": "25b0486ad97a0c20572f1118e9c19a7c", "score": "0.6299627", "text": "def create_asset_device_claim(asset_device_claim, opts = {})\n data, _status_code, _headers = create_asset_device_claim_with_http_info(asset_device_claim, opts)\n data\n end", "title": "" }, { "docid":...
d0a4c108f92a9891de783f3082f8a119
TODO: move in presenter or helper code
[ { "docid": "05d5c4c2be154276197bd4412b15c4a5", "score": "0.0", "text": "def balance_btc_ui\n balance_btc.to_f * 10 ** -8\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7141384", "text": "def private; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.60479134", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", ...
71ac1fb20b39668e903c07736687fb58
refactored the fuck out of this thing like a boss lol god refactoring is good
[ { "docid": "639ce0f5f91e3c6eaf6076640cf6460e", "score": "0.0", "text": "def render\n @board.grid.each_with_index do |row, row_i|\n row.each_with_index do |col, col_i|\n if all_even?(row_i, col_i) || all_odd?(row_i, col_i) # this condition is for white # the two cases whe...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6684526", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6150505", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
4b764d80ff07f606664cc6397ade6bfa
Gets an azure group
[ { "docid": "3db29639272fcda5a16affab0b3946fa", "score": "0.6897958", "text": "def get(params, options = {})\n path = \"#{base_uri}/#{params[:id]}\"\n request(path, options).if_404_raise(Neutrino::Gateway::Exceptions::AzureAdGroupNotFoundError)\n .if_400_raise(Neutrino::Gatew...
[ { "docid": "831d8c806631d8f1838414fffbe83299", "score": "0.7678556", "text": "def get\n begin\n @resource_client.resource_groups.get(@rg_name)\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error getting resource group: #{e.body}\")\n rescue => ex\n OO...
a961bcf78a3d9f1ac53c0128b1ffb6e0
This function defines the location of the log files
[ { "docid": "aa27aa5ecdea6b27c19f5ca8cf98d05b", "score": "0.7172831", "text": "def find_files(location)\n @@logs = {:todo => File.join(location, \"todo.log\"), \n :metrics => File.join(location, \"metrics.log\"), \n\t:error => File.join(location, \"error.log\"),\n\t:working => File.join(locat...
[ { "docid": "c0530ee7540c24b554533f7f8c29b5df", "score": "0.7814072", "text": "def default_log_file_location\n File.join(::Rails.root, 'log', \"solr_\" + ::Rails.env + \".log\")\n end", "title": "" }, { "docid": "f608aa99d6fd2ea89c447685f9763c08", "score": "0.7558349", "te...
1ffb5483510d68e1c2be35241d04957d
prints external person tag
[ { "docid": "90bfc49da905c94c397eabc5beda66b3", "score": "0.5687865", "text": "def external_person_input(plan_subject)\n tag('input',\n {:type => 'text',\n :id => \"external_subject_detail_#{plan_subject.id}_person\",\n :name => \"external_subject_detail[#{plan_subject.id}][person]...
[ { "docid": "1ea4a94c969a54a248aaec4a527b619b", "score": "0.6477521", "text": "def person name, website, profile, mainAuthor = true\n if mainAuthor\n # Add person to global list of authors\n unless $authors\n $authors = []\n end\n $authors.push(name)\n end\n\n if not website\n h na...
729ccd3ec5ec2e48599db976705d4394
Deletes connection between _Game_ and _Player_. ==== Required params _id_:: id of connection that should be deleted. ==== Format HTML
[ { "docid": "c77167d385b3e633cc789152316cf5da", "score": "0.5701123", "text": "def destroy\n @game_player = GamePlayer.find(params[:id])\n @game = @game_player.game\n @game_player.destroy\n\n respond_to do |format|\n format.html { redirect_to @game }\n end\n end", "title": "" }...
[ { "docid": "b209a019c85ea0705401474447d88d38", "score": "0.714434", "text": "def delete_connection(id)\r\n # Prepare query url.\r\n _path_url = '/connections/{id}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'id' => id\r\n )\r\n ...
98a3f26f851e987a9c58fbe4a256907c
Get the OAuth2 authentication information. This call also stores the auth to the session automatically.
[ { "docid": "d98c953830cd58994be215e8fc69508a", "score": "0.0", "text": "def get_auth(code, redirect_uri=@config.redirect_uri)\n establish :grant_type => 'authorization_code', :code => code, :redirect_uri => redirect_uri\n end", "title": "" } ]
[ { "docid": "9c3154e9dc5f3f9ae1d808c5d42d7c9f", "score": "0.70023304", "text": "def auth\n url = build_auth_url\n link = get_acces_link(url)\n code = parse_url(link)\n get_token(code)\n get_me\n end", "title": "" }, { "docid": "4246d26e13a15767ee3c3238bbf864e7", "score": "...
4cb9473d1022ad1dc06b7560fba70f41
From Tableimport_cleanup, with column schema checks adapted to unregistered tables
[ { "docid": "13e4fba3111bcbb3a2579980ea081e96", "score": "0.6488452", "text": "def import_cleanup(schema_name, table_name)\n qualified_table_name = \"\\\"#{schema_name}\\\".#{table_name}\"\n\n user.db_service.in_database_direct_connection(statement_timeout: STATEMENT_TIMEOUT) do |user_datab...
[ { "docid": "e1f4b362c39965c5d7385b916af818da", "score": "0.6710149", "text": "def import_cleanup(schema_name, table_name)\n qualified_table_name = \"\\\"#{schema_name}\\\".#{table_name}\"\n\n user.db_service.in_database_direct_connection(statement_timeout: STATEMENT_TIMEOUT) do |user_datab...
f3363a74bfc4f526dba8cb373f8a4041
Returns the generated results json as a hash, only the figures part
[ { "docid": "451d28dbbcccf6af2f426d76b59959aa", "score": "0.0", "text": "def parse_response\n\t\tfile = File.read(\"#{@file_path}/#{@output_json}\")\n\t\tdata = JSON.parse(file)\n\t\tfigures_array = data[\"figures\"]\n\t\tfigures_array.each do |fig|\n\t\t\tfig[\"renderURL\"] = fig[\"renderURL\"]\n\t\t\t\...
[ { "docid": "7b80a5cd34b3ff10c045a4c7d8274bff", "score": "0.6965125", "text": "def output_hash; end", "title": "" }, { "docid": "89aee2919b1d62ebde442de4c14d2dbd", "score": "0.6540289", "text": "def generate_hash\n \n tmp_file = \"/tmp/zotero.xml\"\n \n File.op...
3f1aeb2c008bc48393f56e99f451f617
GET /ideas_presentadas/1 GET /ideas_presentadas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3b86a3fd8fdba8e58dbdb26a81c40596", "score": "0.7481559", "text": "def index\n @ideas = Idea.all\n\n render json: @ideas\n end", "title": "" }, { "docid": "6bcdddfa8b3e987db47a318f9eacacd3", "score": "0.7473475", "text": "def index\n @ideas = Idea.current_ideas_f...
2dc5b5683995a9f5692d6fd59daf5b7f
This is killing me here....
[ { "docid": "66a4d38b0c7f24c909fc3e1140341574", "score": "0.0", "text": "def print_client_total\n puts \"Total of all stocks held: \"\n # odd = stocks.select.each_with_index { |str, i| i.even? } \n # puts stocks.price\n # puts Hash[*stock_splits = stocks.map { |x| x.to_s.split(' ') }]\n # ...
[ { "docid": "07684950591166c8d855b94ecc016f0c", "score": "0.63533306", "text": "def big_bad; end", "title": "" }, { "docid": "4a9b0b6b563346ab0d6ba84dfe1ce888", "score": "0.6319288", "text": "def gen_washing\r\r\n end", "title": "" }, { "docid": "cf72502a4e2c0f68e18d647...
de1edfcc0d3b95af76ec37303a238549
customer can only cancel their own requests
[ { "docid": "265cf10c2d80c38072c2fdb43f12af35", "score": "0.0", "text": "def update\n h = @customer.pending_initiated_hail\n if h\n h.mark_customer_canceled!\n end\n\n # NJS - what to return back? just a success msg?\n respond_to do |format|\n format.json { render json: {hail_id:...
[ { "docid": "673ccf336ac03367e075dcb9c074b38c", "score": "0.7892295", "text": "def cancel_request\n @cancelled = true\n end", "title": "" }, { "docid": "f578b5226ddcc911ea341529b2fd52f6", "score": "0.78693545", "text": "def cancel!\n update(request_cancelled: true)\n end",...
17c6e204c84f644660ca1f8fc96c7b2e
Give the supplied |string| a grade for all the categories
[ { "docid": "b12ae18a0c63e15269bd7fc399badb83", "score": "0.7335259", "text": "def grade(string)\n result = {}\n @categories.each { |key,category|\n result[key] = category.grade(string)\n }\n result\n end", "title": "" } ]
[ { "docid": "043119d13a2f9476c7b7292d8f06a8ae", "score": "0.66853654", "text": "def grade_all\n column_id=self.create_or_search_for_category\n list_feed=@function.get_list_feed \n\t\t\tputs \"Grading Each Student\"\n list_feed.root.elements.each('entry') do |en...
69616a3cde97b36576b67a696605283a
Denotes whether the token is still "valid", per its (calculated) expiration timesstamp. Note that a 5second window is allotted for the request using the token to complete.
[ { "docid": "cdd4250bdb1ad74bc16d1b1e82207391", "score": "0.75545675", "text": "def valid?\n safety_window = 5.seconds\n Time.current <= (expires_at - safety_window)\n end", "title": "" } ]
[ { "docid": "e416c5485b3e4cabc35f74524ad5f426", "score": "0.75905806", "text": "def token_is_not_expired\n ((Time.now-self.login_link_sent) /60) < 2\n end", "title": "" }, { "docid": "eb3f3aeeb96892072433028c084ae03a", "score": "0.7492724", "text": "def check_token_expiration\n ...
673a56826b00a279d776161825a6e889
prepare node for insert we can set priority for testing the correct tree structure
[ { "docid": "4f88913986ca3be8b7849c28d9f5118f", "score": "0.0", "text": "def add(value, priority = nil)\n @tree = insert(@tree, Node.new(value, priority || generate_priority))\n @size += 1\n return value\n end", "title": "" } ]
[ { "docid": "9c94d9ba498b750153fd16b30948b59c", "score": "0.6839653", "text": "def create_or_insert_node(nodename, data)\n if instance_variable_get(nodename).nil?\n instance_variable_set(nodename, Tree.new(data))\n else\n instance_variable_get(nodename).insert(data)\n end\n end", ...
2188aa36b2df682935b1234afc7c5de2
Parse this plant's drawbacks. Format: drawback;drawback Possible Values: A, D, E, H, Ps, S, St, T P Examples: P;D, D, P;H;Ps, A;D Params:: drawbacks_string +String+ The parsed CSV data. Returns:: +Drawback[]+ An array of Drawbacks parsed from the string.
[ { "docid": "835e3a2f27b1280a2a976841d3a68c13", "score": "0.8291047", "text": "def parseDrawbacks(drawbacks_string)\n drawback_symbols = drawbacks_string.split(';').map { |string| string.strip.downcase }\n\n drawbacks = []\n # The names in our csv file won't match perfectly to the names in the\n...
[ { "docid": "be77f7a8208ce08f5161c7c80ac5ded2", "score": "0.45469797", "text": "def parse_backtrace(backtrace)\n Backtrace.parse(\n backtrace,\n filters: construct_backtrace_filters(opts),\n config: config,\n source_radius: config[:'exceptions.source_radius']\n ).to_...
381b9129002f6ad997b21dff5d772efe
F cumulative distribution function (cdf). Returns the integral of Fdistribution with k1 and k2 degrees of freedom over [0, x]. Distribution::F.cdf(20,3,2)
[ { "docid": "dbaad6fbdd38ddbd3978cb7e15247af3", "score": "0.7012017", "text": "def cdf(x, k1, k2)\n GSL::Cdf.fdist_P(x.to_f.to_f,k1,k2)\n end", "title": "" } ]
[ { "docid": "5e4eb6eb7fdca29fdf282ed3a04cfc36", "score": "0.7013467", "text": "def get_cdf(k)\n raise ArgumentError.new(\"Poisson pdf: k needs to be >= 0\") if k < 0\n sum = 0.0\n for i in (0 .. k) \n sum = sum + get_pdf(i)\n end\n return sum\n end", "title": "" }...
4f068ceed96eb991743ea8ca118c7993
looking at cltn path?
[ { "docid": "cc8d6072102b6c81d59b99c112429cc6", "score": "0.6497035", "text": "def cltn_path?( path )\n path.split( \"|\" ).size == 4\n end", "title": "" } ]
[ { "docid": "712818f014726aa011c5172f9622e740", "score": "0.59319156", "text": "def cltn_request?( path )\n path.size == 3\n end", "title": "" }, { "docid": "80010b763fb8a73ce9ff40d2563bcaf6", "score": "0.55100316", "text": "def cspsearchpath\n eval @paths_key\n en...
faca0c064d61b7c16fddb6de06cc780b
for now this is hard coded for 10 node networks
[ { "docid": "76f39bbe75602be262c57cfc1e884b06", "score": "0.0", "text": "def thirty_percent_perturbations(network)\n all_genes_affected_by_perts = 0\n first_pert = network[0].length - 5\n last_pert = network[0].length - 1\n last_gene = first_pert - 1\n for j in (first_pert)..(last_pert) do \n # ...
[ { "docid": "ed05dc8880289c437ff28c94762aeb70", "score": "0.65096086", "text": "def limited_nodes; end", "title": "" }, { "docid": "6497ab460b6b195909354c637099489a", "score": "0.63014144", "text": "def initialize_the_network #Kohonen Katmanındaki Proses Elemanlarının Oluşturulması.\n...
e143b433e6b40ea2965166e16c7c1d5c
Provide a hook for classes to optionally read/apply configurations. By default, this method does nothing, and is simply provided for convenience. When overridden by a class, this method should also ensure that all necessary configuration options are provided.
[ { "docid": "94b3a55df0f3134e44c89ce609bd820c", "score": "0.0", "text": "def read_configuration\n end", "title": "" } ]
[ { "docid": "b789d6642b7c9e61b88e64b3afe31a34", "score": "0.6576542", "text": "def method_missing(meth, *args, &block)\n Conf.respond_to?(meth) ? Conf.send(meth, *args, &block) : super\n end", "title": "" }, { "docid": "1af43883deec60723a08463d2c40cd66", "score": "0.652042", "text...
ed0cab06661c452c36ea404fd0cbfd60
write means we write the resulting address straight into the assembler stream object means the object of which we write the address
[ { "docid": "d2ccdf65c18b3709b733497174d986ab", "score": "0.591417", "text": "def write_ref_for object\n case object\n when nil\n @stream.write_signed_int_32(0)\n when ::Integer\n @stream.write_signed_int_32(object)\n else\n @stream.write_signed_int_32(Position.ge...
[ { "docid": "20cc64e2487c9bb4d040d524b8524a18", "score": "0.65421796", "text": "def _write(obj)\n obj.Write()\n end", "title": "" }, { "docid": "519504174d21c9f30cf34016e5c9c78d", "score": "0.6514499", "text": "def _write(obj)\n obj.Write()\n ...
f61574325b7d05ca11e8eee4cc41c21d
POST /status_shippings POST /status_shippings.json
[ { "docid": "85b6cef432c2af4d5df0f7598e194809", "score": "0.66960895", "text": "def create\n @status_shipping = StatusShipping.new(status_shipping_params)\n\n respond_to do |format|\n if @status_shipping.save\n format.html { redirect_to @status_shipping, notice: 'Status shipping was suc...
[ { "docid": "d272e30004278746c0027ae82f1ed087", "score": "0.6685578", "text": "def create\n @shiping = Shiping.new(shiping_params)\n @user = current_user\n\n respond_to do |format|\n if @shiping.save\n format.html { redirect_to @shiping, notice: 'Shiping was successfully created.' }\...
3c942fe962a16941d0a687d6dfae5e9b
It's impossible to submit invalid params through the regular HTML form, so just raise an error if they've been tinkering with it.
[ { "docid": "139b569640154521546bec7a8ec0ab5b", "score": "0.5827577", "text": "def raise_if_invalid_params!(_opts, params:, **)\n # I tried to build something fancy using dry-vbut couldn't figure out\n # how to validate that account.companion_first_name is present and\n # non-empty w...
[ { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.65949583", "text": "def valid_params?; end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6573573", "text": "def valid_params_request?; end", "title": "" }, { "docid": "ab08d31c86feb68...
8b257b32c7b19acc2642a73703777b38
Retrieves the room object with the id specified in the first argument.
[ { "docid": "cfc774a948b94cad3c455c67e7c8351a", "score": "0.7141806", "text": "def read_room(room_id)\n JSON.parse Rooms.read_room(@base_url, @headers, room_id)\n end", "title": "" } ]
[ { "docid": "70373d68cbc2777c9bb4e95b2cc6256a", "score": "0.8328509", "text": "def find_room(id)\n @rooms.find {|i| i.id == id}\n end", "title": "" }, { "docid": "911374abe33934cdf4effb265b1b5fea", "score": "0.80809563", "text": "def room(room_id)\n get(\"rooms/#{room_id}...
e26a64e16afe8082052c766a758527b3
Asserts that a command has been passed on the command line.
[ { "docid": "259418f755010c4999f2812a2cc226e6", "score": "0.6735599", "text": "def validate_command_line\n if ARGV.empty?\n puts \"Syntax is: #{$0} [options] command [command_options]\"\n print_help\n exit(-1)\n end\n end", "title": "" } ]
[ { "docid": "1d9e3c38c9e842a98775b9cc3ac758aa", "score": "0.74274516", "text": "def test_cmd_args_one\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check([1])\n end", "title": "" }, { "docid": "15aa050cda18356574f2eb667ac4919f", "score": "0.74015474", ...
e23f82ade40d894919c1861d2fcc70c0
Fetch an action for an ActionItem that's stored in the engine.
[ { "docid": "57a1059f96b3c123d8fa306f35af6720", "score": "0.6787332", "text": "def action_for_item(item_name, action_name)\n @item_actions[item_name] ? @item_actions[item_name][action_name] : nil\n end", "title": "" } ]
[ { "docid": "1bd4249046bddd2fd916d1e10aead2ee", "score": "0.6336794", "text": "def action(id, type)\n res = self.class.post(\"/rest/items/#{id}/actions/#{type}/invoke\", :headers => {\"Content-Type\" => \"application/json\"}, :basic_auth => @auth)\n return res.parsed_response[\"attributes\"][0][\"...
0dfbfbdc788dd3d0eb57b39b8941fb79
renders a menu to the terminal
[ { "docid": "8d979028c0e81fe388830cc240af1624", "score": "0.7679181", "text": "def render_menu(menu,invalid_input)\r\n system \"clear\"\r\n if invalid_input\r\n print \"Invalid Input: #{invalid_input}\\n\"\r\n print \"\\n\"\r\n end\r\n print \"Welcome to the #{menu[:name]} menu.\\n\...
[ { "docid": "dc396bff251699ec3ffcfc70469bfaa0", "score": "0.7970371", "text": "def menu\n # TODO: Add the menu\n puts \"There will be a menu here.\"\n end", "title": "" }, { "docid": "9bc7b81601cc78e5b338594d40592bf8", "score": "0.77709186", "text": "def create_print_menu\n\t\t...
a51393f0ee2eaf834b76de2a76c2c96a
Allows +tag+ to be decorated with additional information.
[ { "docid": "f3f0ffdfa4dba621e0683131a3fbc302", "score": "0.63797134", "text": "def annotate(tag)\n tag\n end", "title": "" } ]
[ { "docid": "106b332d08b9c4c73de851a04242a145", "score": "0.71106255", "text": "def annotate tag\n enable, attr = tag\n\n if enable then\n @res.attron attr\n else\n @res.attroff attr\n end\n\n nil\n end", "title": "" }, { "docid": "f937bf774fe6e59a7a6b4e0e6babdcb1", ...
c31023c1fa6b9f72dff38cf0b01425b2
It works a lot like Bundler. We provide some core modules by default. This ensures at least the ability to construct a basic environment.
[ { "docid": "bfdace2523f94ad88ae28fcda35c58b7", "score": "0.0", "text": "def github(name, version, options = nil)\n options ||= {}\n options[:repo] ||= \"boxen/puppet-#{name}\"\n mod name, version, :github_tarball => options[:repo]\nend", "title": "" } ]
[ { "docid": "be2cd0e74c576aff4494c9576bd167ea", "score": "0.6563376", "text": "def setup_ruby_environment\n return unless ruby?\n cd { run 'bundle', 'install', '--path', '.bundle', '--deployment' }\n end", "title": "" }, { "docid": "0fd909bfcb48dd8c69ce91e0e39fdaf9", "score":...
70f348c095c5c8fa2e1b7887a6782adc
PUT /current_skills/1 PUT /current_skills/1.json
[ { "docid": "4455fc30507edb7e04fe55ed13710458", "score": "0.7572493", "text": "def update\n @current_skill = CurrentSkill.find(params[:id])\n\n respond_to do |format|\n if @current_skill.update_attributes(params[:current_skill])\n format.html { redirect_to @current_skill, notice: 'Curre...
[ { "docid": "4569ec04b3e6caf99479bfac5cd39503", "score": "0.7642521", "text": "def update\n @skill = current_user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n format.html { redirect_to @skill, notice: 'Skill was successfully updated...
33a6588244718ee896744244fc62ded1
Uses CP (change platform) code
[ { "docid": "8ea9e736a460075d95ac317c0942031f", "score": "0.0", "text": "def cp_use_code(code, platform = @platform, id = @id)\n @client.request_session(\n {\n 'cp_use_code' => '',\n 'id_player' => id,\n 'code' => code,\n 'platform' => platform,\n ...
[ { "docid": "57ae38aac561275ac8c87745f63a92a2", "score": "0.69522536", "text": "def platform=(_arg0); end", "title": "" }, { "docid": "ed5ed1dc0dbbcf30d3360ffcb42d9b82", "score": "0.6760661", "text": "def platform; end", "title": "" }, { "docid": "ed5ed1dc0dbbcf30d3360ffcb...
db5738d9a4b5ad4cb36835e78d186445
Scales the vector by the supplied constant
[ { "docid": "d23e7baf81b11aa8b878dcd15f64f730", "score": "0.69047534", "text": "def scale c\n Vector.new(c*@x, c*@y)\n end", "title": "" } ]
[ { "docid": "5b2004d618d0723f42799cde61740616", "score": "0.72670215", "text": "def scale scalar\n Vector.new scalar * @x, scalar * @y, scalar * @z\n end", "title": "" }, { "docid": "d862816833acca8e121c8fcd4d80e48b", "score": "0.69439214", "text": "def scale_pos_vector(factor)\n ...
c244c6ec1f349d04d34488620444905f
POST /authors POST /authors.json
[ { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.6762638", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :s...
[ { "docid": "d34461d6f692b365197dee64ddd7b744", "score": "0.7250694", "text": "def create\n @author = Author.new(params[:author])\n\n render json: @author\n end", "title": "" }, { "docid": "8f4e0bf7c70c57152ad47a9e791dbfed", "score": "0.72374505", "text": "def create\n @auth...
4295cbd75a992df0e54f9c5d01168564
Returns the close link.
[ { "docid": "1c3a5f7ba76a7d6a0593a9cd68829d4f", "score": "0.7604322", "text": "def close_link\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.id(\"/lnkClosePopup$/\"), format_method(__method__))\n end", "title": "" } ]
[ { "docid": "2865f3349e3ba846cdf0ea535e772f0f", "score": "0.7641286", "text": "def close_fries_link\n fries_popup.find(:span_class, 'close').find(:link_href, '#')\n end", "title": "" }, { "docid": "753f97e8dcc6016e05eb12c5fba5aece", "score": "0.73344386", "text": "def close_popup_...
4edf1783696914ace515b200d0151236
DELETE api/v1/players/1 DELETE api/v1/players/1.json
[ { "docid": "388d6e9ba71d5d18a65e478efb04362a", "score": "0.7471247", "text": "def destroy\n @player.destroy\n render json: @player.as_json.merge(deleted_at: Time.now.utc.iso8601), status: 200\n end", "title": "" } ]
[ { "docid": "55a685c8ce5d438b90a288c5a39aff84", "score": "0.7945443", "text": "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_players_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, ...
7b7a4dd0a25fa2e9d852ba131d45b5e3
===complex_command(cmd) Private Function Determines whether to use the unpack mechanism or calls a function to parse the message.
[ { "docid": "3c9d61d71d5da1092b817fc72f3ffd08", "score": "0.7406076", "text": "def complex_command(command)\n if (!command.nil?)\n if (@from_analyzer)\n if command.key?(:FromServer)\n cmd=command[:FromServer]\n else\n raise ...
[ { "docid": "c2aeb4155544c6b32af4361f79e318bc", "score": "0.709256", "text": "def build_complex_command(command)\n if (!command.nil?)\n if (@from_analyzer)\n if command.key?(:FromServer)\n cmd=command[:FromServer]\n else\n @...
d72030346b4c430fc84ede4442542dd1
Returns true if events are queued.
[ { "docid": "f36206ea58f33fc19068005411424c8f", "score": "0.6564594", "text": "def events?\n !@events.empty? || !@errors.empty?\n end", "title": "" } ]
[ { "docid": "972d086adba8597899f9cd9c0ca90a53", "score": "0.83220303", "text": "def has_queued_events?\n !@propagation.empty?\n end", "title": "" }, { "docid": "97e82efe4100d8be199c46405e609281", "score": "0.8084649", "text": "def queued?\n ! queued_at.nil?\n ...
eb343c49b8e57c0f7d1740dd984728ea
only used by tests to avoid sleeping
[ { "docid": "f2aef1e4c63d0d2758c1715a1aa5d70d", "score": "0.0", "text": "def publish_with_confirm(message)\n channel = @exchange.channel\n channel.confirm_select unless channel.using_publisher_confirmations?\n\n publish(message)\n\n @exchange.wait_for_confirms\n end", ...
[ { "docid": "866082871559d80bc34263019e74a498", "score": "0.76825666", "text": "def pre_sleep; end", "title": "" }, { "docid": "e4514dd4c0571498e33c7ad106aeab5d", "score": "0.7607479", "text": "def sleepy_run; end", "title": "" }, { "docid": "0cc31f28862e071383b50dfab8efb4...
753a6c4ad646648313f93ff9777f544d
GET /orders/1 GET /orders/1.json
[ { "docid": "76e90d3b34050ded0ac36e18b7b564ff", "score": "0.0", "text": "def show\r\n end", "title": "" } ]
[ { "docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7", "score": "0.80004466", "text": "def orders\n client.get \"orders\"\n end", "title": "" }, { "docid": "0018a9a547b20cd7a770a6e2cd109f33", "score": "0.7984925", "text": "def orders\n get(\"orders\")\n end", "title": "" }, {...
e13145c9aeabd4071220a9bf2bf6177b
Returns the credit card year required label.
[ { "docid": "6247cb98ab4349ff9951b0873392eb04", "score": "0.0", "text": "def credit_card_date_invalid_label\n $tracer.trace(__method__)\n return ToolTag.new(span.id(\"/CCDateInvalidVal$/\"), __method__)\n end", "title": "" } ]
[ { "docid": "4bc5de844e82104e2299ed8513011bab", "score": "0.8099028", "text": "def credit_card_year_required_label\n $tracer.trace(__method__)\n return ToolTag.new(span.id(\"/ExpirationYear_Validator$/\"), __method__)\n end", "title": "" }, { "docid": "50e8cc1944b5476132bc05f...
e274ec706292f50f24344c2611e66a96
Populates a resource class with operations. These are extracted from the resource definition of actions and associations.
[ { "docid": "e47ab7adedbffb408e644d57fdc796f9", "score": "0.58658403", "text": "def define_operations(service)\n define_resource_operations(service, service, svc_definition)\n each_resource do |name, definition|\n define_resource_operations(service, @namespace.const_get(name), defi...
[ { "docid": "975952eeb78acf2c6ae697ab6f594ea1", "score": "0.7144586", "text": "def define_resource_operations(service, resource, definition)\n define_load(resource, definition['load'])\n define_actions(service, resource, definition['actions'] || {})\n define_waiters(service, resource...
46b21faa8bbb915752b5abb68f53ba82
=begin rdoc Automatic save of project. Invoked on Projectclose =end
[ { "docid": "da964d8b67289f1d578447e0b4815f78", "score": "0.7812074", "text": "def autosave\n save 'Project automatically saved by BGO'\n true\n end", "title": "" } ]
[ { "docid": "98e5d2a5b3d60b8447894dadb083d16c", "score": "0.72861516", "text": "def save_project\n unless @doc == nil\n file = File.new(\"#{@doc.root.attributes[\"name\"]}.cproj\",\"w\")\n @doc.write(file, 3, false)\n file.close\n else\n show_error(\"\\tThere is no a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ae89a2e3a29d7248fe2ae512315c48b0", "score": "0.0", "text": "def set_lightning_arrester\n @lightning_arrester = LightningArrester.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
554106e80caf156cf97d63c9b3d4868d
Search standard $LOAD_PATH. Activated gem versions are in here too.
[ { "docid": "a2a018a917ebf440e88c4bf2560b20ee", "score": "0.6093616", "text": "def find_loadpath(match, options={})\n plugins = []\n #directory = options[:directory] || DIRECTORY\n $LOAD_PATH.uniq.each do |path|\n path = File.expand_path(path)\n #list = Dir.glob(File.join(pat...
[ { "docid": "90ab6b94d17acc067373638e7fafd1a4", "score": "0.6772772", "text": "def lookup!\n $LOAD_PATH.each do |base|\n Dir[File.join(base, *file_lookup_paths)].each do |path|\n path = path.delete_prefix(\"#{base}/\")\n require path\n re...
e2f5b65de2228f2b450c91053c2c2632
test case for the function to get the total score
[ { "docid": "b7cc104281b67120b513b5bdb97633ac", "score": "0.7753043", "text": "def test_get_total_score\r\n total_score = 0\r\n\r\n\r\n @scores1 = Score.find_all_by_response_id(@response.id)\r\n @scores1.each {|a|\r\n total_score = a.score + total_score\r\n }\r\n # verifying whether t...
[ { "docid": "9619c18461c9ea7806687e7446453c28", "score": "0.772287", "text": "def print_total_score\n calculate_score\n end", "title": "" }, { "docid": "2bf020369b2e7c94634e4759d1176231", "score": "0.76111877", "text": "def test_scores(score)\n puts \"Student scored an #{score}...
7b4f2b52582008cbe7e0e7f807dc5f3d
route request based on path and query from the window location (URL)
[ { "docid": "83b3fd0892c3983d30864b02091b1c28", "score": "0.0", "text": "def route(path, query)\n @traversal = :agenda\n\n if path == 'search'\n item = {view: Search, query: query}\n elsif path == 'comments'\n item = {view: Comments}\n elsif path == 'queue'\n buttons = []\n ...
[ { "docid": "342f33ada9eb67733d815fee000c5390", "score": "0.657194", "text": "def handle(env, request)\n verb, path = route_args(request).values\n\n route = routes.find_route(verb, path)\n if route.nil?\n not_found(path)\n else\n param = \"&#{Rack::Utils.build_nested_que...
3cc3234bb6b2c23063f320b6f7a9e0de
PATCH/PUT /mixtures/1 or /mixtures/1.json
[ { "docid": "4c4cc2178915bcb7ca2cffd7a27ca92c", "score": "0.62442166", "text": "def update\n respond_to do |format|\n if @mixture.update(mixture_params)\n format.html { redirect_to @mixture, notice: \"Mixture was successfully updated.\" }\n format.json { render :show, status: :ok, l...
[ { "docid": "02d287ec571eb8b3a16ae3178ed19588", "score": "0.61226594", "text": "def set_mixture\n @mixture = Mixture.find(params[:id])\n end", "title": "" }, { "docid": "b7569c16b454674f73ee5cb383a3b1fc", "score": "0.58262604", "text": "def update\n @fixture = Fixture.find(...
3dc3aaf068b0255218062c5d45132f32
Byebug gem is used for debugging Search in
[ { "docid": "8f50e9fb6f79efb56074233c0fddf519", "score": "0.0", "text": "def search query\n # Typhoeus is a equivalent to use curl command in a terminal\n # Search directly on https://rubygems.org by sending the query as query_string parameters\n request = Typhoeus::Request.new 'https://rubygems.org/s...
[ { "docid": "4babacfa784ac8aa7133bf5e67202bce", "score": "0.71615475", "text": "def analyze_this\n byebug\n end", "title": "" }, { "docid": "9de24b3c5dea89b6f576ffdeff47c501", "score": "0.6813155", "text": "def show\n byebug\n end", "title": "" }, { "docid": "7b1f5...
8ba51184a81f0d91b5000a2a391b2688
GET /librerias/1 GET /librerias/1.json
[ { "docid": "3e68f8956b29e5e8556d766022a1f1c0", "score": "0.7189809", "text": "def show\n\tadd_breadcrumb \"Datos de la librería\", :librerias_path\n @libreria = Libreria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @libreria }...
[ { "docid": "2bc46712fac52c18d7095f88606f736d", "score": "0.7303269", "text": "def index\n\tadd_breadcrumb \"Listado de librerias\", :librerias_index_path\n @librerias = Libreria.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @librerias }\n ...
7f59efb9ebbff07f3ff0fbc3fa514029
Traverse the tree in postorder manner
[ { "docid": "a662bc9259e1374b3d3b214df0587e82", "score": "0.0", "text": "def post_order(node, arr)\n return if node.nil?\n left = node.left\n right = node.right\n\n post_order(left, arr) unless left.nil?\n post_order(right, arr) unless right.nil?\n arr << node.va...
[ { "docid": "6f50e10d2cbd598d2ddedad44654dd0e", "score": "0.825656", "text": "def postorder()\n postorderBST(@root)\n end", "title": "" }, { "docid": "6b8167648762a86e784aeef2f3215d4d", "score": "0.8198834", "text": "def postorder\n node = @root\n return postorder_recurssive...
18dc6f4c4ab8fed476c43cf9d4a07fae
TODO antileeching to make sure requests originate from refiddle.com
[ { "docid": "c52eabae5b384533f574da5b42efca0e", "score": "0.0", "text": "def replace\n render json: runner.replace( params[:pattern], params[:corpus_text], params[:replace_text] )\n end", "title": "" } ]
[ { "docid": "780ab222d816203ff517b1d69f352b7f", "score": "0.6965021", "text": "def requests; end", "title": "" }, { "docid": "780ab222d816203ff517b1d69f352b7f", "score": "0.6965021", "text": "def requests; end", "title": "" }, { "docid": "93f438df14c2637e378b085e92691d10",...
8b8324dfec276304f88c71b15e6cc8e9
Method to find alert ID
[ { "docid": "e3ab9a5860787b2e802e0e627eeab59f", "score": "0.6082186", "text": "def find_id?(alert)\n @redis.hgetall(@type).map do |k,v|\n # Parse each line returned within each field\n stored_alert = JSON.parse(v)\n # Convert stored_alert Hash keys to symbols, and return as array. This ...
[ { "docid": "fe5c2e5880c7bb4609df3156cb54365a", "score": "0.63809794", "text": "def get_string\n get_item ? get_item.alert.id : ''\n end", "title": "" }, { "docid": "9acac14aaef4a8781dc7b043dac827ec", "score": "0.6330761", "text": "def get_single_alert(alert_id)\n ret = http_...
9f3c95daca004c977125e85e4e1f7fb3
Called when Connection is waiting for an encryption request.
[ { "docid": "05ddf1a4a5a3601a5de717f1b27a217b", "score": "0.0", "text": "def connection_status_mcnet_request; end", "title": "" } ]
[ { "docid": "bd0295dea993d1d161d5a723ed112895", "score": "0.64514434", "text": "def connection_status_crypt_wait_response; end", "title": "" }, { "docid": "282e48e0651f7d459ede0461735fa484", "score": "0.6308832", "text": "def connection_completed\n # We aren't completely connec...
9bdff7dcd6d284ca96bee3c2dcd8ef5c
If the key provided is the name of an association or a nested attribute, we need to wait until all other attributes are set before processing these.
[ { "docid": "063b62cfad6dbef40eb67d6f9cabf95d", "score": "0.5679248", "text": "def pending_attribute?(key, value)\n name = key.to_s\n aliased = if aliased_associations.key?(name)\n aliased_associations[name]\n else\n name\n ...
[ { "docid": "4a126c112b1e36c6f0a9ca9a149df279", "score": "0.5928107", "text": "def wait(key, &cantwait_proc)\n yield(key) if block_given?\n end", "title": "" }, { "docid": "78d28ddfa1f414a30b62b178a87493a4", "score": "0.55337775", "text": "def nested_attributes_check_key_m...
2b59931724c767126558ee8f5da1eb00
DELETE /lesson/:id/logs/1 DELETE /lesson/:id/logs/1.json
[ { "docid": "d7705b59a94e5478617a2e109981374c", "score": "0.7493628", "text": "def destroy\n Log.transaction do\n @log.each do |log|\n log.destroy\n end\n end\n respond_to do |format|\n format.html { redirect_to lesson_logs_path, notice: 'Log was successfully destroyed.' }\...
[ { "docid": "6c6599c48ea96a3517682a07ebc20ffd", "score": "0.76572907", "text": "def destroy\n @activity_log = ActivityLog.find(params[:id])\n course = @activity_log.course\n lesson = @activity_log.lesson\n @activity_log.destroy\n\n respond_to do |format|\n format.html { redirect_to le...
94280f367e001357a03f5651cf670d3b
parse array of author strings into CSL format
[ { "docid": "d23c522a4813650590c1722cb58564b9", "score": "0.55313337", "text": "def get_authors(authors, options = {})\n Array(authors).map { |author| get_one_author(author, options) }\n end", "title": "" } ]
[ { "docid": "7e04b9553de1a8fd5a68808752270000", "score": "0.73541164", "text": "def parse_authors(author)\n authors = author.split(\", \")\n authors.each do |author|\n author.strip\n end\n return authors\n end", "title": "" }, { "docid": "35bf802b52f0c31c4630aedc38e632be", ...
008bb77359aa00acfa90132ceabb223f
Sets up the mocks for a VM
[ { "docid": "659b1f2fb0789b3e90cded22a1b37a93", "score": "0.6352674", "text": "def mock_vm(env=nil)\n env ||= vagrant_env\n vm = Vagrant::VM.new\n vm.stubs(:env).returns(env)\n vm.stubs(:ssh).returns(Vagrant::SSH.new(vm.env))\n vm\n end", "title": "" } ]
[ { "docid": "9133d0e735ec74f196f5f666b4ab9446", "score": "0.66276276", "text": "def setup\n MB::Test.mock(:setup) if MB.testing?\n MB::FileSystem.init\n end", "title": "" }, { "docid": "b90d1026086b915142774153fc727d0b", "score": "0.646924", "text": "def setup(app, ...
fc19f868a2ce506f031ca4cc9a77a6a5
true if current item list is modified
[ { "docid": "e7aefeaf713b055c5987ae372cd1e944", "score": "0.82078403", "text": "def modified?\n !items.nil? && items.any?{|item| item_modified?(0, item: item)}\n end", "title": "" } ]
[ { "docid": "b7d1be42bb9e23d8ab170dfa7f6c990f", "score": "0.7504846", "text": "def being_modified?(item)\n state_group(item) == :edit\n end", "title": "" }, { "docid": "4e30ed92689afdd87cd8935df42be2cd", "score": "0.7440224", "text": "def being_modified?(item = nil)\n # noins...
b2d0fd8e024be2618a7e1c263449db2f
Sets the global cache key version. Allows the logger to be dynamically determined at runtime if a blk is given.
[ { "docid": "65ce55e5d871861bccac6ea2028c9c83", "score": "0.73982984", "text": "def global_cache_key_version(&blk)\n # this method takes a block to be consistent with the inline memo_method\n # API\n if blk.nil?\n if !@global_cache_key_version.respond_to?(:call)\n return @global_cach...
[ { "docid": "f3437738ae713754a60810d3da318446", "score": "0.6837789", "text": "def versioned_key(cache_key, version)\n \"#{cache_key}v#{version.to_s}\".freeze\n end", "title": "" }, { "docid": "868714b80fe90724dfaa8d9b2109275d", "score": "0.6569276", "text": "def cache_key...
5e225c33878005bc6a1253f96d942f70
Each component renders clientside code.
[ { "docid": "fd505c18b13c520fd98e8b12b0d9cd98", "score": "0.0", "text": "def render_in\n # TODO.\n end", "title": "" } ]
[ { "docid": "1c3173df42713c4a2c2191f5aa032425", "score": "0.64474934", "text": "def render\n div[]\n end", "title": "" }, { "docid": "01d74b62f1abb5af9f683a76b098353e", "score": "0.6346218", "text": "def render\n render_buttons\n render_slider\n\n render_b...
d2ea1792b58f578f2a3741d73ee58784
test "the truth" do assert true end
[ { "docid": "5f7fec8b1e02f9eb3575a080342becaf", "score": "0.0", "text": "def test_twitter_api_for_success\n \n stub_request(:any, 'https://twitter.com/?refsrc=email').to_return { |request| {:body => request.body} }\n RestClient.get('https://twitter.com/?refsrc=email', 'shahrukh khan') # ===> \"abc\...
[ { "docid": "b74d7b6bb8d1879693051e77dc496654", "score": "0.91927177", "text": "def test_the_truth\n assert true\nend", "title": "" }, { "docid": "e048c7798bb543a8cff6d79c9f46474e", "score": "0.91227156", "text": "def test_the_truth\n assert true\n end", "title": "" }, { ...
af4a16e541135e13ebd295e4851c687b
Create a new instance of AccessToken.
[ { "docid": "b1c29c3b407fd8a76e2287d6a13c8a76", "score": "0.0", "text": "def initialize(token)\n @data = {}\n @data[:token] = token\n end", "title": "" } ]
[ { "docid": "c92a877150230e84a12f00e2843196a8", "score": "0.7583108", "text": "def access_token\n @access_token ||= AccessToken.new(self)\n end", "title": "" }, { "docid": "90d0cf6c688da0b6477fa563e95ad793", "score": "0.7450326", "text": "def access_token!(*args)\n ...
036f51ba167f38cd7361fd8bc324cc4b
set :something, "some value" This will also make a getter, so you can call Settings.something outside of this class.
[ { "docid": "d3db5cdf2fd2fafa068bfc4e6819cf37", "score": "0.69251984", "text": "def set(key, value)\n @settings[key] = value\n define_getter(key)\n end", "title": "" } ]
[ { "docid": "48b7a8ae0837190f07c0fdff8492cd3d", "score": "0.749859", "text": "def set(name, value)\n name = name.to_sym\n unless self.respond_to?(name)\n meta = class << self; self; end\n meta.send(:define_method, name) { settings[name] }\n end \n settings[na...
c10c216a1861e756428e1aa5a1a1f0c1
DELETE /pokemen/1 DELETE /pokemen/1.json
[ { "docid": "6d41880ed1ec7f9395ca4cc0e8cf4ed5", "score": "0.6820061", "text": "def destroy\n @pokeman.destroy\n respond_to do |format|\n format.html { redirect_to pokemen_url, notice: 'Pokeman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title":...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7307989", "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": "...
6570b222ffa7a8f898e78b52c2804a21
Verify if the requested http method is allowed to perform on the given endpoint.
[ { "docid": "0bbb29e787520204b0acfead30f99492", "score": "0.8038058", "text": "def valid_method(endpoint, http_method)\n allowed_list = {\n '/' => ['get'], \n '/token' => ['post']\n }\n return allowed_list[endpoint].include? http_method\nend", "title": "" } ]
[ { "docid": "d59a77061545c254102700ae5651fff5", "score": "0.7583208", "text": "def valid_http_method? method\n method.to_s.in? 'post', 'get'\n end", "title": "" }, { "docid": "9115aeaa878ff2783864f9763d1d85a3", "score": "0.74235576", "text": "def http_method_allowed?(verb=@bas...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d05c44a969eb4d34427e2bf9fb4134af", "score": "0.0", "text": "def set_studentinfo\n @studentinfo = Studentinfo.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;...
4db72f536d8522d87fa079a1d27bffc6
Reset user's password and send the user an email to generate a new one.
[ { "docid": "866c9ca174f6c37e23ee5ef20761bd8d", "score": "0.0", "text": "def reset_password(email)\n\t\t\tkparams = {}\n\t\t\t# The user's email address (login email)\n\t\t\tclient.add_param(kparams, 'email', email);\n\t\t\tclient.queue_service_action_call('user', 'resetPassword', kparams);\n\t\t\tif (cl...
[ { "docid": "7d91353ae9bf2aa7c23397e2461f7804", "score": "0.864472", "text": "def reset_password\n @user = User.last\n @user.password_reset_token = \"12345\"\n @user.password_reset_sent_at = Time.zone.now\n mail = UserMailer.reset_password(@user)\n end", "title": "" }, { ...
062a5c7f7b6de5df90fcae9f7d45fb3a
a proc, given a PB field (Pbr::Message::Field), returns a hash key get_target_key is used when the target type is a hash. get_target_field is used when the target type is not a hash.
[ { "docid": "648d55a428ab25dfb17eca348c6541c1", "score": "0.0", "text": "def initialize\n @get_target_type = ->t{t}\n @get_target_field = ->f{f.name}\n @get_target_key = ->f{f.name}\n yield(self) if block_given?\n end", "title": "" } ]
[ { "docid": "fe3e21ec5a40a4a0c04d46896f589c7a", "score": "0.55006", "text": "def hget(key, field); end", "title": "" }, { "docid": "fe3e21ec5a40a4a0c04d46896f589c7a", "score": "0.55006", "text": "def hget(key, field); end", "title": "" }, { "docid": "868e44cdada461e390541d...
1baed88eee97c69462f76f124f8661ae
++ Creates a new detail row given the parameters. This method updates also the internal SQL diff log file. == Returns: The specified MeetingEventReservation or MeetingRelayReservation instance, depending upon the type of the +event_id+. Returns +nil+ only in case of nooperations.
[ { "docid": "f2bff7505ba4774892a9e0168e12c82f", "score": "0.7423703", "text": "def create_new_detail_row!( meeting_id, badge, event, is_doing_this, suggested_timing = nil,\n notes = nil )\n# DEBUG\n# puts \"\\r\\ncreate_new_detail_row!( meeting_id: #{ meeting_id }, badge: ...
[ { "docid": "b744aff68532af357941d2997ec59c9b", "score": "0.6691171", "text": "def edit_existing_detail_row!( mres, event, is_doing_this, suggested_timing = nil, notes = nil )\n return nil unless event.instance_of?(MeetingEvent) && (mres.instance_of?(MeetingEventReservation) || mres.instance_of?(Meeti...
654b45ab9304327a15e0a4e114015087
ask the current player a question
[ { "docid": "a8183fc5e32f7105425f3d0988eb9e90", "score": "0.0", "text": "def question_text\n @number1 = rand(20)\n @number2 = rand(20)\n puts \"#{@current_player} : What is #{@number1} + #{@number2}\"\nend", "title": "" } ]
[ { "docid": "32a1af4e7e9301d733c14a5eba5ebcc7", "score": "0.87566614", "text": "def ask_question()\n puts \"#{@current_player.name}: #{@question_to_ask.question}\"\n answer = self.get_answer()\n self.isAnswer?(answer, @question_to_ask)\n end", "title": "" }, { "docid": "9d41080980a8...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0262891fa447da300eeb8980030888c9", "score": "0.0", "text": "def set_client\n @client = Client.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...
271fb5b3f7d48bc3c9a7a49ef1298a45
GET /partyrelationships/1 GET /partyrelationships/1.xml
[ { "docid": "c09b5eca5b7237f9065344266278e798", "score": "0.699003", "text": "def show\n @partyrelationship = Partyrelationship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partyrelationship }\n end\n end", "title": "" ...
[ { "docid": "e6eb2a126cdd41bdfacf98287ca96710", "score": "0.7179368", "text": "def index\n @partyrelationships = Partyrelationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @partyrelationships }\n end\n end", "title": "" }, { ...
069ffcd890a4ca161129d43cc1062851
Baseline implementation for the rollback_instance REST call
[ { "docid": "072bd86abbde2f945caa2137993d6a70", "score": "0.7133224", "text": "def rollback_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_rollback_i...
[ { "docid": "0a79c90fd441c243725cdbcc7f77d1d1", "score": "0.7582928", "text": "def rollback\n # implement in subclasses\n end", "title": "" }, { "docid": "09540d86e1d91447ef2e4533ef597742", "score": "0.73657817", "text": "def rollback\n end", "title": "" }, { "doc...
490a4c339395e545c543ea1f4941e2a4
Print the dealer's partial hand
[ { "docid": "28312edbb7fa2676dca4a3edcd3bc49d", "score": "0.85559714", "text": "def print_dealers_partial_hand(dealer)\n dealer_hand = dealer.get_hand\n cards = dealer_hand.get_hand_cards\n print \"Dealer: Hand: \"\n print \"#{cards[0].symbol}#{cards[0].suit} \"\n print \"XX\"\n puts \"...
[ { "docid": "9bbd596709bd6e806999f54f58d8e9da", "score": "0.7419423", "text": "def print_dealers_hand(dealer)\n dealer_hand = dealer.get_hand\n cards = dealer_hand.get_hand_cards\n print \"Dealer. Hand: \"\n cards.each { |card|\n print \"#{card.symbol}#{card.suit} \"\n }\n puts \"P...
1b8480cdd01a410162fff1e2cdce4cc1
Retrieve the metadata adapter for repository metadata
[ { "docid": "3312bf70e867913f35e6fb11e3c1785f", "score": "0.70782816", "text": "def metadata_adapter\n Valkyrie::MetadataAdapter.find(:indexing_persister)\n end", "title": "" } ]
[ { "docid": "643b4a5c33d5bf3a4fcf59ea83414642", "score": "0.7494115", "text": "def metadata_adapter\n Valkyrie.config.metadata_adapter\n end", "title": "" }, { "docid": "50992bd567f20530ffeedce6b49d491d", "score": "0.68810695", "text": "def get_metadata; end", "title":...
994d1594461fe954f68b9d53c7f160f2
Authenticate the user with token based authentication
[ { "docid": "71009429dfed3ad56f73b5de78deef8b", "score": "0.0", "text": "def current_user\n \t@current_user ||= Beneficiario.all.first\n # @current_user ||= if session[:usuario_id]\n # Usuario.find_by_id(session[:usuario_id])\n # end\n\n end", "title": "" } ]
[ { "docid": "1a046b01eda6af1bda53170db51dc486", "score": "0.8579128", "text": "def authenticate!\n user = User.find_by(login: login)\n\n if user && valid_token?(user&.authentication_token)\n success!(user)\n else\n fail!('strategies.token_auth.failed')\n end\n end", "title": ""...
22fe00a86e21dd5d68dee61e3b725981
Get Registration Flow This endpoint returns a registration flow&39;s context with, for example, error details and other information. More information can be found at [Ory Kratos User Login and User Registration Documentation](
[ { "docid": "b48b4014b8696782af072be93511cddb", "score": "0.0", "text": "def get_self_service_registration_flow_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PublicApi.get_self_service_registration_flow ...'\n end\n #...
[ { "docid": "68a8bcea60b5dd6657c925d839b28303", "score": "0.64159834", "text": "def get_registration\n path = self.api_root + '/register'\n process_firecloud_request(:get, path)\n end", "title": "" }, { "docid": "100471dcd0f6a63f98504a3fc3df735e", "score": "0.62893486", "text":...
2f4c3a80b294bb5b231b4acde54ce746
Find child nodes of this node with an attribute matching this node
[ { "docid": "885226bfbad59b8fc143bcee762b5731", "score": "0.6949981", "text": "def find( key, value )\n descendent_nodes.select do |node|\n if node.attributes[key]\n node.attributes[key] =~ /#{value}/\n else\n false\n end\n end\n end", ...
[ { "docid": "53def02e061e677a386d1d98e104389a", "score": "0.70485884", "text": "def search_descendents(node, attribute)\n return if node.children == []\n node.children.select do |child|\n @total_descendents_attributes << child if child.respond_to?(attribute)\n search_descendents(child, at...
85db5bfc2a28b4d03df67d7301985546
GET /leave_applies/1 GET /leave_applies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "adbfba6617745be4b7e29ba4555e5ac8", "score": "0.6767024", "text": "def index\n @leave_requests = LeaveRequest.all\n render json: @leave_requests\n end", "title": "" }, { "docid": "3d35755291a0df39c359f0d02d0c41a6", "score": "0.6691476", "text": "def index\n @leav...
54c756857a062e643efabea75244803d
login and signup pages have a different layout
[ { "docid": "6bb4e8e699393e2ce59cb0a999968ce7", "score": "0.0", "text": "def layout_by_resource\n\t\tcontroller = controller_name\n\t\taction = action_name\n\t\tif [\"sessions\", \"passwords\"].include?(controller) || \n\t\t\t(controller == \"registrations\" && action == \"new\") || \n\t\t\t(controller =...
[ { "docid": "4e1d7cbf656487587936d78a00fae389", "score": "0.75886464", "text": "def choose_layout\n 'users/login'\n end", "title": "" }, { "docid": "c11895db8cca21f1d9d406870c0accb8", "score": "0.73252434", "text": "def login\n render :login, layout: \"authpage\"\n end", "...
43e8811679eef8f09664611dd171b129
metaprogrraming method defines initialize to set specified values defines list of symbol names, so Action creation system knows what variables to pass in called on first tick
[ { "docid": "20a281939d3db4c27778b3bebeab4b6f", "score": "0.0", "text": "def press(point)\n\t\t\n\tend", "title": "" } ]
[ { "docid": "afcfb519033547b5983334e3d2069620", "score": "0.62095636", "text": "def initialize(name, color, sound)\n method(__method__).parameters.map do |p|\n instance_variable_set(\"@\" + p[1].to_s, binding.local_variable_get(p[1]))\n end\nend", "title": "" }, { "docid": "d158efd2fe0a9...
d61558ae6b2ab2227fea037222a62942
escape double quotes for interpolating values between double quotes in your terminal command arguments
[ { "docid": "f8638fbe77b2e41cdc3e83c95b69e825", "score": "0.77381104", "text": "def escape_arg(value)\n # escape double quotes\n value.to_s.gsub(\"\\\"\", \"\\\\\\\"\")\n end", "title": "" } ]
[ { "docid": "5b374de8ce52041a63e2d9aa2c240507", "score": "0.7935933", "text": "def command_arg(arg)\n \"'\" + arg.gsub(/[\\']/, \"'\\\\\\\\''\") + \"'\"\nend", "title": "" }, { "docid": "c497ccf9b7e04640bba2fe0ac9495e3f", "score": "0.7599424", "text": "def quote_arg(arg)\n ...
b8ba949bec305e9e3e70fb84b598b426
Produit la facture pour le paiement courant
[ { "docid": "a5a7ab9a180ffdbe4215fb6f3d24b24f", "score": "0.0", "text": "def facture\n <<-HTML\n <style type=\"text/css\">\n table#facture{border:2px solid}\n table#facture tr{border: 1px solid}\n table#facture td{padding: 1px}\n </style>\n <table id=\"facture\">\n <colsgroup>\n...
[ { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.6381582", "text": "def suivre; end", "title": "" }, { "docid": "7bb82f6790afea78c7ef863f2af01845", "score": "0.61393976", "text": "def create\n @facture = Facture.new(facture_params)\n @facture.user_id = session[:user][...
c9b2b2f019bb55e8ff18f5ec0e2f77f8
inserting new element in pq
[ { "docid": "2e65b4d9a832040a63599cdff83ef614", "score": "0.0", "text": "def max_heap_insert(key)\n\t\t@heap.push(-1)\n\t\theap_incease_key(@heap.length-1, key)\n\tend", "title": "" } ]
[ { "docid": "2fd29fa88cfcd9dbfd8819b5e18a7d14", "score": "0.67646146", "text": "def insert(p0, p1) end", "title": "" }, { "docid": "7f299a8aeca3552bdd8df49d04272788", "score": "0.64587474", "text": "def linsert(key, where, pivot, value); end", "title": "" }, { "docid": "7f...
3942f5337a3c88ab1275a4a0df007275
POST /error_types POST /error_types.xml
[ { "docid": "95c6c1640521f3a6c397185028b83580", "score": "0.6446495", "text": "def create\n @error_type = ErrorType.new(params[:error_type])\n\n respond_to do |format|\n if @error_type.save\n format.html { redirect_to(@error_type, :notice => 'Error type was successfully created.') }\n ...
[ { "docid": "244d8d168a4c322ef465f58f5ffc4713", "score": "0.61230093", "text": "def index\n @error_types = ErrorType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @error_types }\n end\n end", "title": "" }, { "docid": "9e0bb96...
66cf378214fe18f4aec7912748d0d1bf
Create the inbound and outbound dirs under the run dir
[ { "docid": "fe4a8315b8909aa359d412121d94b7d4", "score": "0.7879268", "text": "def create_dirs\n run_dir = query_property('run_dir')\n raise 'Run directory not found' unless Dir.exist?(run_dir)\n\n create_dir(\"#{run_dir}/messaging/in_pending\", 'in_pending')\n create_dir(\"#{run_dir}/messagi...
[ { "docid": "86fb86c20bcf58e20954e6840f2dbefe", "score": "0.67586404", "text": "def gen_sub_directories\n @outputdir.mkpath\n end", "title": "" }, { "docid": "685f0b66ce6436d8c8eea6d2ab6caa73", "score": "0.6670941", "text": "def gen_sub_directories\n\t\t@outputdir.mkpath\n\tend", ...
a74aa1264d02d5115cae68e776ab61de
Return a randomly chosen `[key, value]` pair from this `Hash`. If the hash is empty, return `nil`.
[ { "docid": "3a421f4dd930b844e564be6c7896c906", "score": "0.0", "text": "def sample\n @trie.at(rand(size))\n end", "title": "" } ]
[ { "docid": "58e982d552a503aa0165ac5cd88b4bb6", "score": "0.72298", "text": "def get_random()\n @hash.values.flatten.sample\n end", "title": "" }, { "docid": "4be9a6fc02cb3d3ce34c6607e6a77021", "score": "0.69680774", "text": "def get_random()\n @hash.keys.sample\n end"...
c598e30193117ca9ad3cd32cf7b8ca6e
Returns the human readable log message for this event.
[ { "docid": "ce503651665c371692375edb1d18f74f", "score": "0.0", "text": "def message\n if http_context\n \"#{http_context[:method]} #{http_context[:path]} sent #{status} #{status_description} \" \\\n \"in #{time_ms}ms\"\n else\n \"Completed #{status} #{status_de...
[ { "docid": "2c1ab7b408429940796118b437d74c33", "score": "0.72121423", "text": "def to_s\n log_message = message\n\n if !event.nil?\n event_hash = event.as_json\n event_type = event_hash.keys.first\n\n event_type = if event.is_a?(Events::Custom)\n \"#{event_type}.#...
1a8fb1b4cf4ca3970dd1f06e10309947
Add packages to a metapackage, creating the metapackage if it does not exist
[ { "docid": "bf1d0f98c3ee03b0d990146e2e04358f", "score": "0.68713105", "text": "def metapackage(name, *packages, &block)\n meta = (@metapackages[name.to_s] ||= Metapackage.new(name))\n packages.each do |pkg|\n if pkg.respond_to?(:to_str)\n package_n...
[ { "docid": "191d5f0f97699625e0fc8bb3649fcf83", "score": "0.7155121", "text": "def register_package_set(pkg_set)\n metapackage(pkg_set.name)\n metapackage(\"#{pkg_set.name}.all\")\n @package_sets << pkg_set\n end", "title": "" }, { "docid": "2ac16d509d0...