query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fffd331e57f6e6935170996f647f14bc
Create a new PStruct with persistance +file+. The optional +hash+ will be passed on to the OpenStruct initializer.
[ { "docid": "858448c997f86f1011a21c749c62ee19", "score": "0.6386989", "text": "def initialize(file, hash = nil)\n @file = file\n super(hash)\n end", "title": "" } ]
[ { "docid": "d6f33ca8ec4334eddc3996a0a74814d9", "score": "0.61966383", "text": "def initialize(hash=nil)\n @store = Storage.new( symbol_hash(hash || {}) )\n @inner_hash = @store.octothorpe_store\n end", "title": "" }, { "docid": "1cd751395ee038dec268acefddec5345", "score": "0.61081...
4d765c0cbda938e8e1b14beb2989c72e
REQUIRES doorkeeper gem returns the latest unexpired token or nil
[ { "docid": "4c2dc4f5b563b2d24cbfe5a70a7cca62", "score": "0.6643858", "text": "def oauth_token\n sql = \"SELECT * FROM oauth_access_tokens WHERE resource_owner_id= #{self.id} ORDER BY created_at DESC LIMIT 1\"\n #not that ineffecient as there will only ever be 1 row\n ActiveRecord::Base.connecti...
[ { "docid": "ed4ab75ed78839c0f95ba562243e3427", "score": "0.7461248", "text": "def valid_token\n access_token = find_or_create_doorkeeper_access_token\n create_doorkeeper_access_token if access_token.expired? || access_token.revoked?\n access_token\n end", "title": "" }, { "docid": ...
5daa026cdfcbfbddedcb8f7a40f691b3
Get the version of the software result:: [String] or nil
[ { "docid": "f84b258831f5b879a04fa4cfe783425a", "score": "0.0", "text": "def version\n first_element_text('version')\n end", "title": "" } ]
[ { "docid": "08f2bd48218a7c6c005978788d569404", "score": "0.73453075", "text": "def software_version\n ref_call :get_software_version\n end", "title": "" }, { "docid": "c09b7e9451739751394867a1a9162b8f", "score": "0.725875", "text": "def get_version\n return @version unless...
53e07d8b7a52adf4017e1a707103b6ff
method which return type of user Vendor, Dealership or OEM
[ { "docid": "0380b614c6994f248a75a5d8ed689463", "score": "0.74805313", "text": "def user_type\n provider_match = \"oceanus\"\n if self.dsm?\n USER_TYPES[:dealership]\n elsif self.vendor_user?\n USER_TYPES[:vendor]\n # For oceanus users you need to return user\n elsif (!self.user_...
[ { "docid": "75cbaba262bd29c713c0064add48db25", "score": "0.7163225", "text": "def type_of_user\n \tself.person_type\n end", "title": "" }, { "docid": "dc1cf3fadb27155a468144d6d487d6e9", "score": "0.7104078", "text": "def human_user_type\n TYPES[self.user_type]\n end", "...
da8dc016f92a369dff5f6f2a6a5af832
Ordering is important because this ordering of the whole set is retained for each subset allocated to a reference usage. And we want the synonymns for any single ref. usage to appear in this order: 1. nonmisapps first, followed by misapps 2. namesort order within 3. year of the reference withing namesort order
[ { "docid": "abb1c93f8b51249be0acc0b18e240ffe", "score": "0.0", "text": "def xbunch_query\n Instance.where(\"instance.cited_by_id in (#{comma_separated_ids}) or instance.cites_id in (#{comma_separated_ids})\")\n .joins(:instance_type)\n .joins(name: :name_status)\n .jo...
[ { "docid": "585ac53bac14587c9e103ed9788e63c8", "score": "0.6624247", "text": "def acts_of_synonymy_for_ref\n syn = self.proj.sensus.by_ontology_class(self.ontology_class_id).by_ref(self.ref_id).ordered_by_label.collect{|s| s.label}.uniq\n syns = []\n syn.each_with_index do |s1,i|\n ...
d9132e4504f3649bff84448e0731fced
Returns the info for an addon webhook subscription. Can only be accessed by the addon partner providing this addon.
[ { "docid": "746fa86fe3844613160d015cb082c05e", "score": "0.7135853", "text": "def info(addon_id_or_addon_name, app_webhook_id)\n @client.addon_webhook.info(addon_id_or_addon_name, app_webhook_id)\n end", "title": "" } ]
[ { "docid": "8647b90e2401bef20f928d4f176f5d32", "score": "0.6990966", "text": "def info(addon_id_or_addon_name, app_webhook_event_id)\n @client.addon_webhook_event.info(addon_id_or_addon_name, app_webhook_event_id)\n end", "title": "" }, { "docid": "e26f35ab7374b599733c73f539d6c078", ...
c0ea760aab60867cf7f1fc1222285e3b
def word_id params.require(:word).permit(:id) end
[ { "docid": "69fa96cd821170268329bc304119f606", "score": "0.0", "text": "def check_commitment\n @required_commitment = -1\n if current_user.commitment < @required_commitment\n render 'not-enough-commitment',:layout => 'onsen'\n end\n end", "title": "" } ]
[ { "docid": "35cf3eec6a7353694b9bad8fb7f988d0", "score": "0.8665441", "text": "def related_word_params\n params.require(:related_word).permit(:related_word, :word_id)\n end", "title": "" }, { "docid": "156919591759464a0cf22270bd0834cf", "score": "0.8586857", "text": "def word_...
2caed4c2f28497764c0a25d52bdbbdfb
Submit solution and retry on failure. The return value is a hint for getting status and varys at different online judges.
[ { "docid": "4254157b9d124f6f6a8d72732af335bc", "score": "0.6800582", "text": "def submit!(pid, code, lang, retries = nil)\n retries ||= self.retries\n retries.times do\n begin\n ret = submit pid, code, lang\n return ret if ret\n rescue\n end\n end\n ...
[ { "docid": "db89b684581c9233c6e1ab72624d0ad1", "score": "0.68091756", "text": "def submit\n solution = @entry.text\n return self.retry() if solution.empty?\n self.solved(solution)\n end", "title": "" }, { "docid": "51f0f4e53c3cd33597b9bb375047a614", "score": "0.6445722", "t...
6daeba86dfd5a36d4797507619b845f5
PATCH/PUT /calllogs/1 PATCH/PUT /calllogs/1.json
[ { "docid": "17d5ea7975ed0462ecd2bf0ee340e334", "score": "0.6878716", "text": "def update\n respond_to do |format|\n if @calllog.update(calllog_params)\n format.html { redirect_to @calllog, notice: 'Calllog was successfully updated.' }\n format.json { head :no_content }\n else\...
[ { "docid": "ba21bcb00bca49dfab5bdaea1ec424de", "score": "0.6601752", "text": "def update\n @call_log = CallLog.find(params[:id])\n\n respond_to do |format|\n if @call_log.update_attributes(params[:call_log])\n format.html { redirect_to(@call_log, :notice => t(:call_log_updated)) }\n ...
a12dc83e923e3af41a12aacde35d07cc
Apply all settings to the active simulation.
[ { "docid": "a22c5491520bacb007c8fcbeda8ba206", "score": "0.61774933", "text": "def apply_settings\n sim = MSPhysics::Simulation.instance\n return false unless sim\n set_continuous_collision_state( get_continuous_collision_state )\n set_solver_model( get_solver_model )\n ...
[ { "docid": "14d5b38267fcedd0cfd6e5f83a52a8b7", "score": "0.6138381", "text": "def apply_settings\n return false unless MSPhysics::Simulation.active?\n self.continuous_collision_check_enabled = self.continuous_collision_check_enabled?\n self.solver_model = self.solver_model\n ...
95cd76deb56adaa735288a38c8cf0dac
Returns true if knight puts king into check, false if not.
[ { "docid": "b45afbec100fe8d2953f92824a89f930", "score": "0.75493", "text": "def knight_check?(piece, column, row)\n if piece.is_a?(Knight)\n c = piece.column\n r = piece.row\n possible = []\n possible_moves = [[c + 2, r + 1], [c + 2, r - 1], [c - 2, r + 1], [c - 2, r - 1],\n ...
[ { "docid": "c826f276fda8bcb5aa27d3f0775a2dae", "score": "0.8084559", "text": "def king_in_check?()\n GameStart::Check.king_in_check?( \n FindPieces::FindTeamPieces.\n find_king_piece( \n players_info.current_team, \n board ),\n FindPieces::FindTeamPieces.\n f...
2e81c091b97377f0f362ccb491b62c96
overwrite because we must use here always the LEM_STUB_NM_EXT
[ { "docid": "73ada5d21adf30e03a631c39d2865961", "score": "0.53442127", "text": "def dynamic_names\n [recipe.export_name.upcase << LEM_STUB_NM_EXT.upcase + '_BUILD_DLL']\n end", "title": "" } ]
[ { "docid": "218f4454183145fc6258f3eea460ac7d", "score": "0.54103005", "text": "def stub_forge\n stub_forge_on(default)\n end", "title": "" }, { "docid": "2c7659975c6256127b5eaaede8566837", "score": "0.5373462", "text": "def militia_name; igb_variable_get(:militia_name, \"...
22d52e3ae6c8931c496a2281a0726527
Split the pot up evenly between 'tied' players
[ { "docid": "0af57947aa92698c67d2d61b663857fc", "score": "0.8589229", "text": "def split_pot(tied)\r\n player_amt = tied.length # Num of players pot is being split between\r\n # Rounds up to nearest evenly divisible int from @pot and splits it into even portions\r\n split_amt = (@pot + player_a...
[ { "docid": "7abbe65e31c5e1cb577a450669244fcd", "score": "0.6595406", "text": "def pair_players\n if self.number_of_players % 2 == 0\n number_of_teams = self.number_of_players / 2\n teams = Array(1..number_of_teams)\n players = self.get_players\n\n while players.count > 0...
5352c6045550d9e57fafeb20bb347f97
JSON que despliega solo un nodo con sus hijos, para pegarlos en json ya construido con d3
[ { "docid": "5e997860cc2da9d22d44856a6608c35f", "score": "0.635589", "text": "def hojas_arbol_nodo\n children_array = []\n\n nivel_categoria = @especie.categoria_taxonomica.nivel1\n ancestry = @especie.is_root? ? @especie.id : \"#{@especie.ancestry_ascendente_directo}/%#{@especie.id}%\"\n\n t...
[ { "docid": "3e78885b571ada1f9cb57161f11c6281", "score": "0.67041177", "text": "def arbol_nodo\n @children_array = []\n\n taxones = Especie.select_basico(['ancestry_ascendente_directo', 'conteo', 'categorias_taxonomicas.nivel1']).datos_basicos.\n categoria_conteo_join.where(\"categoria='7_00...
98f8cfc412685c840a867048bf128ec8
if xml size is decent, this can replaced with Nokogiri::XML(file).xpath('//keywords//keyword').map(&:inner_text) This is performance compromise over SAX parser
[ { "docid": "4b45cc15192d517340423688fb8abd85", "score": "0.5650837", "text": "def import(file_path)\n File.open(file_path) do |file|\n Nokogiri::XML::Reader(file).each do |node|\n if node.name == 'keyword' && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT\n TopHits...
[ { "docid": "8971ca8aacbe4d69d8aa349b8349a911", "score": "0.72612435", "text": "def keywords\n xml.css('keyword').map{|c| Allorails::Keyword.new(c)}\n end", "title": "" }, { "docid": "791698ada49602dab581ced814795f3c", "score": "0.6426173", "text": "def get_keywords( descripti...
0faaa21ddd56166d04517928f8ff6983
Average call duration in seconds
[ { "docid": "dacb92f6eb4721c4a4576eaa574dce36", "score": "0.82912415", "text": "def average_call_duration\n average_duration(finished_contacts, 'answered', 'call_ended')\n end", "title": "" } ]
[ { "docid": "943890f87ae18829dc4460665fcb12ef", "score": "0.75581735", "text": "def average_missed_call_duration\n average_duration(missed_contacts, 'arrived', 'call_ended')\n end", "title": "" }, { "docid": "04d6abb63591c654f5fce63c7cd54b3f", "score": "0.7555985", "text": "def av...
bf1132a79c01039d0da43bd1ffd2d0b3
check the authentification on AUTH if any value returned, that will be used for ongoing processing otherwise the original value will be used for authorization_id
[ { "docid": "5f89f3981105246ee770d334d570389c", "score": "0.0", "text": "def on_auth_event(ctx, authorization_id, authentication_id, authentication)\n # if authentification is used, override this event\n # and implement your own user management.\n # otherwise all authentifications are bloc...
[ { "docid": "f93f770c9e0562a483a9d06be553cb2e", "score": "0.7205184", "text": "def auth\n auth_token || render_unauthorized\n end", "title": "" }, { "docid": "73af87262f574323a809c0e2eeaa013f", "score": "0.7085594", "text": "def normal_auth?\n self.result != \"1\"\n en...
96e6224640dc4b6974d36ae89e709564
Returns the status of the git repository.
[ { "docid": "ebfec13226edc3ca21435525b3ef39e4", "score": "0.7748729", "text": "def status\n GitStatus.new(self)\n end", "title": "" } ]
[ { "docid": "4d2bbb882a750e6352be9cca438c17df", "score": "0.88047975", "text": "def status\n Dir.chdir @repository\n status = `git status -s`\n verify_status($?, 'git status -s')\n status.lines\n end", "title": "" }, { "docid": "eb216c05b57c5f640733977f31c375f6", "score": "0....
d0147ea18c33866dfad33f8744d0053a
Reset a relay proxy configuration's secret key with an optional expiry time for the old key.
[ { "docid": "3415d7a66dcdc30850c73aeda11d7618", "score": "0.5298997", "text": "def reset_relay_proxy_config(id, opts = {})\n data, _status_code, _headers = reset_relay_proxy_config_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "b69e85f54f111b5ad1e60651fa117499", "score": "0.67935586", "text": "def reset_secret_key\n service_response = ClientManagement::WebhookSetting::ResetSecretKey.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "9095c9643b6cd9c08b6f...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a08a6de08b87179ffe77bfaa7c64838d", "score": "0.0", "text": "def training_group_params\n params.require(:training_group).permit(:name, :description, :department_id, :age_begin, :age_end, :ancient,\n :photo_id,\n :trainer_ids => [],\n :training_units_attributes => [:i...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
356cd4fa8b1ea5d99106f195d342d4f7
getting params ready to get 'stringed'
[ { "docid": "ef8df8e3e4b6e3ebf4c751353e282049", "score": "0.0", "text": "def process_params\n p = add_timestamp_to_params(@params)\n p = camelize_params(p)\n encode_params(p)\n end", "title": "" } ]
[ { "docid": "a9c7a26321aece97177c8759acb05ab5", "score": "0.740585", "text": "def params() request.params end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.72900885", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91...
4dc68344b2b630bf45c4bca724870435
added for ActiveAdmin select controls probably a more eloquent way to put this...
[ { "docid": "576d1bd52ca0b4e3edcf17fb6a1fb9ef", "score": "0.0", "text": "def to_s\n !human_name.empty? ? human_name : name.capitalize\n end", "title": "" } ]
[ { "docid": "1b03720ce75e8993fd6eb9a897620d61", "score": "0.7712113", "text": "def select_options; end", "title": "" }, { "docid": "8775d9d32dbf698427637c08b00d9c6d", "score": "0.71022874", "text": "def wiz_select_type\n \n end", "title": "" }, { "docid": "bc9eae...
440060a05fe88fca10e6367161842691
Returns an Array of all of this Name's ancestors, starting with its immediate parent, running back to Eukarya. It ignores misspellings. It chooses at random if there are more than one accepted parent taxa at a given level. (See comments for +parents+.) child = Name.find_by_text_name('Letharia vulpina') child.all_parent...
[ { "docid": "eacf9f2a205d4c62e707426af3ccf032", "score": "0.59969366", "text": "def all_parents\n parents(all: true)\n end", "title": "" } ]
[ { "docid": "9b01f6f3de713dfd8ef090ac394026ef", "score": "0.7218588", "text": "def ancestors\n \tif parent_name.blank?\n\t \tancestors = [] \n \telse\n \t\tp = Category.where(name: parent_name).first\n \t\tancestors = p.ancestors\n \t\tancestors << parent_name\n \tend\n \tancestors\n end", "...
eb55a0fa4c5d278af9090a26fc0f53ab
Set subject in I18n: en.mobile_download.download_email.subject
[ { "docid": "6e22705292663a129eebb4605b0d719c", "score": "0.0", "text": "def download_email email_address, download_link\n @download_link = download_link\n mail to: email_address\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.74865067", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7167342", "text": "def subject_for\n ActiveSuppor...
c2a729a1a8b7c3cb607e1dc2709d4be3
List event types Fetch all event type definitions for your account.
[ { "docid": "172efbb8ed1911c1f322ab8f8d044b46", "score": "0.0", "text": "def get_event_types_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_event_types ...'\n end\n if @api_client.config.client_side_valid...
[ { "docid": "e7f0d86fc19cb5dc0672a0abcf642c49", "score": "0.72028315", "text": "def get_event_types(opts = {})\n data, _status_code, _headers = get_event_types_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "367e3221f381ded8e342895a7d7cf84c", "score": "0.713781...
142a53758ffab7a5299ec1ee8b36b00f
Set the value of the RailTraction input for this Choreo.
[ { "docid": "97383621a1d2896b3ffa020ec187e908", "score": "0.71728873", "text": "def set_RailTraction(value)\n set_input(\"RailTraction\", value)\n end", "title": "" } ]
[ { "docid": "6241a584010f9d73b554b1a87d31cca4", "score": "0.47774166", "text": "def set_RailClass(value)\n set_input(\"RailClass\", value)\n end", "title": "" }, { "docid": "9ceb15de5eb96566a787d45e66930362", "score": "0.4599956", "text": "def set_Retirement(value)\n ...
ab58cf3f5d9e8adb54bce6d31565de15
Fully URLencode (including transforming '.' to '%2E') without escaping a string which is already escaped.
[ { "docid": "65232703338fd3c107e9d843beeeef84", "score": "0.78461266", "text": "def url_escape(s)\n s = s.to_s\n s = s.match?(/%[0-9a-fA-F]{2}/) ? s.tr(' ', '+') : CGI.escape(s)\n s.gsub('.', '%2E')\n end", "title": "" } ]
[ { "docid": "f0fc571d5e10459bf1510d4620179718", "score": "0.80954367", "text": "def url_encode(string)\n # It's kinda like CGI.escape, except CGI.escape is encoding a tilde when\n # it ought not to be, so we turn it back. Also space NEEDS to be %20 not +.\n return CGI.escape(string).gsub(\...
d07d5f9b801624c7f401f911d12f2458
PUT /hostelns/1 PUT /hostelns/1.json
[ { "docid": "55a25157cbcda2d8d6b8262183d6df09", "score": "0.5953831", "text": "def update\n @hosteln = Hosteln.find(params[:id])\n\n respond_to do |format|\n if @hosteln.update_attributes(params[:hosteln])\n format.html { redirect_to @hosteln, notice: 'Hosteln was successfully updated.'...
[ { "docid": "b58dcb674745e5d70f3957b6c801fb4a", "score": "0.629292", "text": "def update\n id = params[:id]\n p = {:servernode => {:name => params[:servernode][:name],\n :status=>params[:servernode][:status]}}\n @servernode = Servernode.find(params[:id])\n @servernode.update(servernode_p...
ef6ee0488b31b74db6b0fcecb0968524
Wait for changes to the supplied path Returns the next change to the supplied path
[ { "docid": "8fda27868d9df8b9baa203c4271f0be1", "score": "0.596328", "text": "def wait(path, rev=current_revision, timeout=-1)\n invoke(Request.new(:path => path, :rev => rev, :verb => Request::Verb::WAIT), true, timeout)\n end", "title": "" } ]
[ { "docid": "bb8cdea2825e22344b539679958db25f", "score": "0.70353794", "text": "def watch(path, rev=current_revision)\n loop do\n result = wait(path, rev, -1)\n yield result\n rev = result.rev + 1\n end\n end", "title": "" }, { "docid": "9db29f9147d2516e72243...
3197c6e248893e80a5f911ea3b11efc8
Define a converter data to ruby object.
[ { "docid": "e99314b6084b41d789b62621e9a6650f", "score": "0.0", "text": "def to_ruby(&b)\n @to_ruby = b\n end", "title": "" } ]
[ { "docid": "90c698977b04247c047f9b54e2022cd6", "score": "0.72035974", "text": "def convert(data=nil)\n @input = data if data\n @output = @input\n @output\n end", "title": "" }, { "docid": "bea9d77a3227e894c3d4b962d113b1ee", "score": "0.71804935", "text": "def conver...
d68dbd188436d7351d032688f7b6a8aa
Insert a new task
[ { "docid": "e0d2e58600eb80747c63962ef6639d9f", "score": "0.6831979", "text": "def new_task(task_list_id,**task_info)\n task_data = Google::Apis::TasksV1::Task.new\n task_info.keys.each do |key|\n task_data.instance_variable_set(\"@#{key.to_s}\".to_sym, task_info[key])\n end\n ...
[ { "docid": "c3f288dc433f1a6aee372f775dce2146", "score": "0.79562366", "text": "def new_task\n t = Task.new(get_next_id, @current_user_id) #Must change number\n t.create\n @db << t\n save_db\n end", "title": "" }, { "docid": "1d2daa50fda8c18e82daec4fdc78a7bf", ...
6c7628394e558c36c9979c9b0dc27f84
PATCH/PUT /strategies/1 PATCH/PUT /strategies/1.json
[ { "docid": "7e65643e91aa5d4787c66696515a730a", "score": "0.61122864", "text": "def update\n\n if current_user.admin?\n respond_to do |format|\n if @strategy.update(strategy_params)\n format.html { redirect_to @strategy, notice: 'Strategy was successfully updated.' }\n fo...
[ { "docid": "a63d1af318e9d2c993ec44205451b280", "score": "0.69006705", "text": "def update\n @strategy = Strategy.find(params[:id])\n\n respond_to do |format|\n if @strategy.update_attributes(params[:strategy])\n format.html { redirect_to @strategy, notice: 'Strategy was successfully up...
8df18ec8e7afe5d92675ead0f8bb6cc2
opts source Symbol | [Symbol] create Symbol allow_nil Symbol
[ { "docid": "b49e5d994edd62bf65e017208a1997ef", "score": "0.0", "text": "def key(name, *opts)\n hash_opts = opts.select { |v| v.kind_of?(Hash) }.inject(&:merge) || {}\n source = hash_opts[:source]\n then_block = hash_opts[:then]\n value = hash_opts[:eq]\n if_key = hash_opts.fetch...
[ { "docid": "564db4f72e799af56a5059aa409a76d7", "score": "0.6192772", "text": "def create(name, options = T.unsafe(nil)); end", "title": "" }, { "docid": "de02c395f08154282bbc14463eadd90c", "score": "0.5977635", "text": "def create(source)\n statement = Statement.new(source)\n ...
45c6cb09f69c3e78e442da830f882182
GET /scheduler_types/1 GET /scheduler_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "70a39f70bb2c8e7c003bb676807d6faa", "score": "0.77250636", "text": "def index\n @scheduler_types = SchedulerType.all\n end", "title": "" }, { "docid": "2d736b15926795ae7a3b3d1f99d1c1e9", "score": "0.71715945", "text": "def set_scheduler_type\n @scheduler_type = Sc...
f50292f14a47ede175d3ee56800db83a
Sets the attribute render_length_limit
[ { "docid": "df33e670709f61939b5e429d1e94129e", "score": "0.79348665", "text": "def render_length_limit=(_arg0); end", "title": "" } ]
[ { "docid": "a0e668abf89f3a32bd86390a886c7749", "score": "0.8146549", "text": "def render_length_limit; end", "title": "" }, { "docid": "e24d0d6637b67c4434f0cc216cd80fb8", "score": "0.7537066", "text": "def max_length=(value)\n @max_length = value\n end", ...
8d227e7a747881d4a1d4a6923fc051b7
Link Binary with Libraries
[ { "docid": "4210fb755aa544540a99ef326dae0329", "score": "0.6994032", "text": "def link_binary_with_libraries_phase(target)\n puts \"Link binary with libraryes\"\n phase = target.build_phases.find { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXFrameworksBuildPhase) }\n $frameworks.each do | fw |...
[ { "docid": "e25a85055d95f5ebb06d640b0ae528d0", "score": "0.71940154", "text": "def link_file (arch, target, libs, flags = nil)\n file target => libs do\n sh \"#{LD[arch]} #{join_args(flags)} -o #{target} #{join_args(libs)}\"\n end\nend", "title": "" }, { "docid": "10489c48e3b67d...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "741731865700783014654663ba7d9fe4", "score": "0.0", "text": "def tagging_params\n params.require(:tagging).permit(:entity_type, :entity_id, :tags)\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...
3a3499b1f84428ea05f4a680f788386c
modifies the args strings with the correct format
[ { "docid": "f062fbab26e5b2da79d8aa64df95c4b1", "score": "0.0", "text": "def process\n res = []\n @args.each_with_index do |s, index|\n index == 0 ? res << s.to_gtypist_first_line : res << s.to_gtypist\n end\n res\n end", "title": "" } ]
[ { "docid": "88ca2647d7d7298db79fcdbb051f58d3", "score": "0.69974786", "text": "def modify_args(args)\n if @command.default_option && @command.numerical_arg_size? &&\n @command.arg_size <= 1 &&\n !args[0].is_a?(Hash) && args[0].to_s[/./] != '-' && !args.join.empty?\n args[0] =...
ab2680679149dc7e05243094f0204862
An ephemeral app to review a set of changes
[ { "docid": "f6b45576230732404035c1c7716b150f", "score": "0.5510862", "text": "def review_app\n @review_app_resource ||= ReviewApp.new(@client)\n end", "title": "" } ]
[ { "docid": "1eb223cd7eb6c61137f9723c7f0c14d8", "score": "0.605537", "text": "def show\n @change_set.review! if current_user.content_approver? && !@change_set.being_reviewed? && !@change_set.accepted? && !@change_set.rejected?\n end", "title": "" }, { "docid": "b50f98691b2d5142a44e6bfd05f...
4f086c56de69595171109adcebe0c92d
DELETE /interests/1 DELETE /interests/1.xml
[ { "docid": "a7fe3e5141f16fe1c75c6d13e6e2c641", "score": "0.7526035", "text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
[ { "docid": "3082c1943e4ece3a4c27427082eb2de4", "score": "0.7428061", "text": "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_interests_url) }\n format.xml { head :ok }\n end\n end", "title"...
92ce5e04b8bcfb0bbce434d7bc1a7a03
executes the whole reboot process
[ { "docid": "3b26a74bb4ecbcfced5eec857193e66e", "score": "0.580093", "text": "def reboot!(vm, options)\n if reboot? vm, options\n vm.action(:reload, options)\n end\n end", "title": "" } ]
[ { "docid": "2a957ef0515a47cfbc8f1025f86e9a26", "score": "0.7153152", "text": "def reboot\r\n raise Shells::NotRunning unless running?\r\n raise Shells::PfSenseCommon::RestartNow\r\n end", "title": "" }, { "docid": "b5fc927236de7baea81678dfa540bf96", "score": "0.71445036", ...
80c7b003f0468a7305b8e602638fc3c6
definizione del metodo della stanza d'oro
[ { "docid": "d6d296b9d7710dce06403febec1a0b92", "score": "0.0", "text": "def stanza_oro()\n puts \"Questa stanza è piena d'oro. Quanto ne vuoi prendere?\"\n prompt; prossima_mossa = gets.chomp\n if prossima_mossa.include? \"0\" or prossima_mossa.include? \"1\"\n quantità = prossima_mossa.to_i()\n ...
[ { "docid": "b82f4e86c21836ebaeea736905710446", "score": "0.642833", "text": "def meta(viagem)\r\n viagem.trecho.meta\r\nend", "title": "" }, { "docid": "e3809b603ef23cd1adcd99fc70d2e64c", "score": "0.628576", "text": "def metodoProtegido1()\n puts super().reverse + ':Acabo de...
b56369940c0717f45f3daa740e5265f6
Rules about uploads: FLAC maximum 24bit, 192 kHz, minimum 16bit, 44.1 kHz Inconsistent bit rate must include release description with note about which tracks have which bit rate Lossy formats allowed: MP3, AAC, AC3, DTS Lossless formats allowed: FLAC Bit depth in bits. Not expected to be present on lossy formats, as th...
[ { "docid": "bee489ad217c8fe61eef3b90a376c606", "score": "0.5005216", "text": "def bit_depth\n mediainfo.audio.bitdepth\n end", "title": "" } ]
[ { "docid": "d8e8d8c6683226d9d76461274af18af3", "score": "0.6270322", "text": "def rescaling_required?\n flac_info.streaminfo[\"bits_per_sample\"] != 16\n end", "title": "" }, { "docid": "bfaf7d88d46516869017d3326c968d51", "score": "0.59151626", "text": "def validate_header_fi...
145214a1e1d81dabe9aaf3a078fbca91
invoked by MCast, data is string (ruby literal) ["move",id,time,[x,y],[vx,vy],[a,va]]
[ { "docid": "76084996fe389689ec2ce4571eda956f", "score": "0.48010805", "text": "def receive_data(data)\n\t\t\treturn if !(data && data[0,1]==\"[\")\n\t\t\tbdata=eval( data )\n\t\t\tlog(\"Received: #{bdata.inspect[0..100]} / length=#{data.size} bytes\") if @trace\n\t\t\tif Array===bdata && bdata.length>1\...
[ { "docid": "2d507a9ad6821a4de5e275a1500c8bd2", "score": "0.6351239", "text": "def parse_move(input)\n case input.size\n when 4\n from = convert_coordinates(input[0..1])\n to = convert_coordinates(input[2..3])\n [from, to]\n when 8\n from = convert_coordinates(input[0..1])\n ...
d1c6dae3eb8cc1a8ff02038a2934005f
we stat all the files in the Moab in hopes of preventing issues when reading metadata about files in the newly created Moab version. this addresses what we suspect to be interplay between Ceph backed storage and our use of hardlinking (instead of e.g. copying) to get content from the deposit bag to the new Moab version...
[ { "docid": "7f663307c1e61b19f95a233655b3bccc", "score": "0.0", "text": "def rm_deposit_bag_safely_for_ceph\n if deposit_bag_pathname.exist?\n deposit_bag_pathname.rmtree\n else\n Honeybadger.notify(\"Deposit bag was missing. This is unusual; it's likely that the w...
[ { "docid": "cc22085f509271bddd477d6b10e56fd2", "score": "0.6211103", "text": "def file_stats\n @stats = @ff.get_stats\n end", "title": "" }, { "docid": "766d3b5e82ae9d4ed1c7880aaaf0f96d", "score": "0.61890745", "text": "def check_files\n updated = []\n files...
f591b91e2fe12ccff5d72d4c22b3398a
Provides the type of the DB snapshot.
[ { "docid": "d0875ac4c148cb251130675365112945", "score": "0.85892767", "text": "def snapshot_type\n data[:snapshot_type]\n end", "title": "" } ]
[ { "docid": "c993e046adf828838aee86918c0a66b7", "score": "0.8690135", "text": "def snapshot_type\n @snapshot_type\n end", "title": "" }, { "docid": "6a809e6a009660ff8c9e7eec014237b6", "score": "0.7686207", "text": "def snapshot_type=(value)\n @snapshot_type = value\n e...
2d6b00e1be2576d6f31e9d738691fd23
boilerplate for checking that certain changesets exist in the output.
[ { "docid": "c68dd4e2bcf4cfc159bd5bb13f69fc17", "score": "0.6157902", "text": "def assert_changesets(changesets)\n assert_select \"osm>changeset\", changesets.size\n changesets.each do |changeset|\n assert_select \"osm>changeset[id='#{changeset.id}']\", 1\n end\n end", "title": "" } ...
[ { "docid": "0dfcda94b82a6c8208fe79cf624459fd", "score": "0.71287584", "text": "def has_changesets?\n return false unless valid?\n\n control_path = File.absolute_path(File.join(@path, 'SMIL'))\n ! Dir.glob(File.join(control_path, 'changes_branch_*.js')).empty?\n end", "title": "" }, { ...
a4ab696f197c0b22ad87351023763938
Output 'id, year, section, entity type, service, programme, concept, description, amount'
[ { "docid": "bb30f800bb513be727e01f7281a72679", "score": "0.5845058", "text": "def extract_expenses(bkdown, open_headings)\n bkdown.expenses.each do |row|\n uid = get_uid(bkdown.year, bkdown.section, bkdown.entity_type, row[:service], row[:programme], row[:expense_concept])\n expense_description =...
[ { "docid": "8de8f074917191229569385462df5b5c", "score": "0.60079706", "text": "def embargoed_csv(com)\n handle = 'handle'\n col = 'collection'\n klass = 'year'\n nAuthor = '#author'\n embargo = 'embargo'\n items = DSpace.findByMetadataValue('pu.embargo.terms', nil, nil)\n ihash = []\n items.each...
258f06ec90f66d6bd1ae98359ce1d1ba
GET /dafts/new GET /dafts/new.json
[ { "docid": "d93694f0c50a2f3353fbb69026bf671e", "score": "0.6175904", "text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draft }\n end\n end", "title": "" } ]
[ { "docid": "82af7ec9ea2f806d1e1f34f37769874b", "score": "0.668791", "text": "def new\n @todofuken = Todofuken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todofuken }\n end\n end", "title": "" }, { "docid": "cd6b6ba0b1b7a9aa3c6...
05fa363f9143d586bcdb767836aa2921
5.2.7. Section "toc" attribute
[ { "docid": "6b640ed89bd941a819a6086c622fed11", "score": "0.0", "text": "def toc_sections_check(xml)\n ret = []\n xml.xpath(\"//section[@toc = 'exclude']\").each do |s1|\n s1.xpath(\".//section[@toc = 'include']\").each do |s2|\n ret << \"Section #{label(s2)} with toc=in...
[ { "docid": "a5b73f8d9744f7c9b2fb1358f1246105", "score": "0.7781524", "text": "def toc\n\t\t@toc ||= create_string(\"standard_toc\")\n\tend", "title": "" }, { "docid": "e3c3c234ba9d5c555a203aea0cd8d69b", "score": "0.773874", "text": "def toc\n \"* \\n{:toc}\\n\"\n end", "t...
9a6812be926dc685c8a6801b9b35ca4a
Optional parameters are those that are either defined as optional or implicit.
[ { "docid": "1cba7196b9b631eafbab9f410c3f78b1", "score": "0.65109986", "text": "def optional?\n\t\t\t\t@options[:optional] || implicit? || default?\n\t\t\tend", "title": "" } ]
[ { "docid": "33dbf486de4572e6d4a615081c30009c", "score": "0.7774354", "text": "def optional_params\n\t\t\t@optional_params ||= {}\n\t\tend", "title": "" }, { "docid": "3fa5b7964d04761425531c8c0fff55db", "score": "0.75006074", "text": "def optional_params\n params.select{ |x| x.opti...
db2978988ee71d516c00573a90a08b02
Escapes single quotes in a string to be able to use it in an INSERT query.
[ { "docid": "333446e3990a6b246a17f27744570231", "score": "0.83727366", "text": "def escape_single_quotes(string)\n string.gsub(\"'\", \"\\\\\\\\'\")\n end", "title": "" } ]
[ { "docid": "b396f6e0a9feb4ed97b985996a324c0e", "score": "0.85246617", "text": "def escape_for_single_quotes(str)\n str.gsub \"'\", \"''\"\n end", "title": "" }, { "docid": "d295da8143e47705326b8a34cb054f0b", "score": "0.8376737", "text": "def quote_string(s)\n esca...
3b8dc390c40e862b0d7c4abf58a6c0c3
Returns the value of attribute hash. source://activerecord//lib/active_record/relation/merger.rb8
[ { "docid": "ef200ff818c310e9a179653879c9f2f1", "score": "0.0", "text": "def hash; end", "title": "" } ]
[ { "docid": "9626525c2628c250332dbc8d792e4cd3", "score": "0.6746213", "text": "def hash\n attributes['hash']\n end", "title": "" }, { "docid": "8a4c399d2f850a7a4f0b6b49022b5306", "score": "0.647549", "text": "def hash\n @hash ||= attributes.hash\n end", "ti...
741e2b5ba59aa5bdf8af2f9922f3858c
Html safe error messages of the current entry.
[ { "docid": "4f9608142c2ff537fa06ca26d79de91a", "score": "0.79006726", "text": "def error_messages\n escaped = entry.errors.full_messages.map { |m| ERB::Util.html_escape(m) }\n escaped.join('<br/>').html_safe\n end", "title": "" } ]
[ { "docid": "bbef6e92a0ee9f6336ddddc98ccb0de4", "score": "0.737645", "text": "def format_error ins\r\n ins.errors.nil?? \"\" : ins.errors.messages.map{|k,v| \"#{k}:#{v.uniq[0]}\"}.join(\"<br>\")\r\n end", "title": "" }, { "docid": "bbef6e92a0ee9f6336ddddc98ccb0de4", "score": "0.737645...
7f1b60e1e35643540efd65006660af5d
the purpose of this method is to return a single host for the backend connection which is determined by this operators method of loadbalancing
[ { "docid": "a1259eb04575372d34d2d8e5625ce421", "score": "0.0", "text": "def lookup_jack(data)\n addresses = []\n jack = nil\n \n @@mutex.synchronize {\n addresses = @address_book.lookup_addresses(data)\n }\n LOGGER.debug(\"Operator has #{addresses.size} choice(s) to pick from - se...
[ { "docid": "59035323590474b7e22ce5b2d3dd5772", "score": "0.77982885", "text": "def host\n active_backend.host\n end", "title": "" }, { "docid": "5f88a39f43f24099f36880ec9a297266", "score": "0.74683577", "text": "def host\n @manager.primary_pool.host\n end", ...
f888256c60ca7e6753cee684df838316
Get Width of Face Graphic
[ { "docid": "bdab0ce8b9eb8aa5b0b45dac4cfe3147", "score": "0.7815219", "text": "def face_width\n return 0\n end", "title": "" } ]
[ { "docid": "4329a60d9b85a14dc7f44bc7693a6c0e", "score": "0.79187095", "text": "def face_width\r\n return 96\r\n end", "title": "" }, { "docid": "494d8fd9aad0a74bcd28d39813e3413e", "score": "0.7821752", "text": "def face_width\n return 96\n end", "title": "" }, { "...
1335733f6d91f27f725f43975a4eed83
DELETE /pruebas/1 DELETE /pruebas/1.json
[ { "docid": "5f03046a668a05a3f7493c8bc89093b5", "score": "0.6909464", "text": "def destroy\n @prueba.destroy\n respond_to do |format|\n format.html { redirect_to pruebas_url, notice: 'Prueba was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.74451786", "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": ...
4aa6b3185706fbf27de6fd64b38f8156
POST /surveys POST /surveys.xml
[ { "docid": "966f6afcba128fe383a9f4fb51d887f8", "score": "0.6316184", "text": "def create\n if not (granted_for?('root') || granted_for('survey'))\n access_denied\n else\n \n @survey = Survey.new(params[:survey])\n \n respond_to do |format|\n if @survey.save\n ...
[ { "docid": "48de9c65aa26b58aa44368fd618602c7", "score": "0.66603315", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n flash[:notice] = 'Survey was successfully created.'\n format.html { redirect_to(@survey) }\n fo...
ebf74a7668d0e60209c22f0d0bc651f6
Set any kind of meta data needed for the options
[ { "docid": "038fd640cb9a2f5fc7c5e42b4c1decf9", "score": "0.0", "text": "def get_meta_data(meta = {})\r\n ret_meta = meta\r\n if request.headers['auth_failure']\r\n ret_meta[:authFailure] = true\r\n else\r\n if current_token.present?\r\n ret_meta[:jwt] = current_token\r\n e...
[ { "docid": "62372606b6ed45d1dc36c2cc8daebcea", "score": "0.77618754", "text": "def meta_options; end", "title": "" }, { "docid": "d7c7dddabcbf93690f6ae5e253e351d8", "score": "0.73047495", "text": "def set_meta_data(meta)\n @meta ||= {}\n @meta = @meta.merge(meta)\n end",...
f50bd9b90e6845607559a972a29fc771
Write a method caesar_cipher that takes in a string and a number. The method should return a new string where every character of the original is shifted num characters in the alphabet. input type : 1 string, 1 number output(to return) type : (new) string > num My solution Step 1 : alphabet with index Feel free to use t...
[ { "docid": "5aa162adb2939e0d0f3c1274dffef661", "score": "0.7292734", "text": "def caesar_cipher(str, num)\n\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n alphabet.each_char.with_index do |char, idx|\n puts char\n puts idx\n puts \"---\"\n end \n\nend", "title": "" } ]
[ { "docid": "bb77f6b59a969961ce2b9c405aea7c08", "score": "0.88040024", "text": "def caesar_cipher(str, num)\n alphabet = 'abcdefghijklmnopqrstuvwxyz'\n\n str.each_char.with_index do |char, i|\n shift = alphabet.index(char) + num # shifting num chars in the alphabet\n if shift > 26 # restart at 0 ...
4ca9391a49fb880de3c1262749e79659
Returns the single inner type or raises an error if this union type contains more than one inner type.
[ { "docid": "9bf0b30d37e429851292b0049bb9fc04", "score": "0.6413786", "text": "def singleton_type\n if !is_singleton?\n raise AssertionError.new(\n \"Union type is not singleton (found #{@types.size} types)\")\n end\n\n ...
[ { "docid": "fc2a31d7b4044f85dab8eb2cd8acad11", "score": "0.52443737", "text": "def get\n if either_value.right? then either_value.right_value else raise NoSuchElementError end\n end", "title": "" }, { "docid": "819144e146c35deab16ea1aaceb7da3f", "score": "0.4970398", "tex...
23de88cb7c3c2d2aa1678b2e92666612
ensure user account is active
[ { "docid": "36a0b0b6fd7b332b28aef6574d8e9be6", "score": "0.0", "text": "def active_for_authentication?\n super && !deleted_at\n end", "title": "" } ]
[ { "docid": "645b5be9fd22302a28e8e64a0ac2e825", "score": "0.7623216", "text": "def user_active!\n \t\tif current_user && current_user.active == false\n \t\t\tsign_out current_user\n \t\t\tredirect_to new_user_session_path, notice:\"You don't have permissions.\"\n \t\tend\n end", "title": "" }, {...
45a80cd09843037b859604fdb3d6a76d
POST /interiors POST /interiors.json
[ { "docid": "f250b65d5148abdd689b6eb17c7daeb7", "score": "0.57113785", "text": "def create\n @interior = Interior.new(params[:interior])\n\n respond_to do |format|\n if @interior.save\n format.html { redirect_to @interior, notice: 'Interior was successfully created.' }\n format.j...
[ { "docid": "c1cfd20aec061bfef28813a08608f22f", "score": "0.6134329", "text": "def create\n itinerary = current_user.itineraries.create!(itinerary_params)\n itinerary_id = current_user.itineraries.last\n \n events = params[:events]\n events.each do |event|\n itinerary_id = current_use...
81650408be19557acbe6ba6cea8d40d4
GET /vendedores GET /vendedores.xml
[ { "docid": "8aee765fdf7ee21f96dc06086d22067d", "score": "0.563117", "text": "def index\n @vendedores = Vendedor.paginate :per_page=>\"5\", :page=>params[:page], :order=>\"nome ASC\"\n @vendedor = Vendedor.new\n end", "title": "" } ]
[ { "docid": "79785c4549a07c7d7031c3a5904325f9", "score": "0.70442665", "text": "def index\n @vendedores = Vendedor.all\n end", "title": "" }, { "docid": "d2e41f93158703ab754a55921bd305a8", "score": "0.66282666", "text": "def index\n @ventes = Vente.find_by_saison(:all)\n res...
822dd92dca3f8c4fdba1aecfa804cf64
returns a group by uuid
[ { "docid": "aa6171c830221679703f1dc63bf594f0", "score": "0.66841215", "text": "def get_group group_uuid\n group_uuid = @everyone_group if group_uuid.blank?\n \n return group_uuid if group_uuid.is_a?(Group)\n\n tmp = @groups.find{|grp|grp.uuid == group_uuid}\n \n r...
[ { "docid": "c84f372196b5428c8322fa7ea28c3887", "score": "0.7046583", "text": "def get_group_by_id(id)\n $r.hgetall(\"group:#{id}\")\n end", "title": "" }, { "docid": "583c50761e69d77515a300836768f605", "score": "0.6679724", "text": "def group_uuid\n @os_aws.group_uuid\n ...
c40f551807fbd11ce05fd710c5a19769
GET /projects/1.json will be called every "eta" seconds (AJAX) until there is output associated with the open project.
[ { "docid": "c5c2bd91debfd40f72476bc891a7b9ed", "score": "0.597105", "text": "def show\n respond_to do |format|\n format.json { render json: @project, only: [:eta, :output, :id] }\n end\n end", "title": "" } ]
[ { "docid": "a2f1561ec622a3b527fb7513190ec135", "score": "0.6790745", "text": "def grab_project\n project_size = Project.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n form...
1a8d6d2a3874f86be23932180acd18c7
Set configuration options using a block
[ { "docid": "36d85685a666775dc5b89ad98914e8e5", "score": "0.0", "text": "def configure\n yield self\n end", "title": "" } ]
[ { "docid": "12eb3c1de3837dece778b97ab4fe0547", "score": "0.8248542", "text": "def configure(&block)\n Config.set(&block)\n end", "title": "" }, { "docid": "b5eeab411114e3a89dab27357a0f886c", "score": "0.78845453", "text": "def configure_with_block(&block)\n Configuration...
7b65b0f1c36185ff6ab76fdf7b363e47
We need this so that we can install rvm first!
[ { "docid": "8cbdd240bf548a6cfe571eb4cb33e163", "score": "0.0", "text": "def disable_rvm_shell(&block)\n default_shell = self[:default_shell]\n self[:default_shell] = nil\n yield\n self[:default_shell] = default_shell\nend", "title": "" } ]
[ { "docid": "d1bf0bd0fd47f3994ab5c116890ce35d", "score": "0.66533566", "text": "def perform_install!\n prompt_for_root_password!\n\n message \"Which Ruby would you like to install and use as your default Ruby Interpreter?\"\n ruby_version = choose_ruby_version!\n message \"Goi...
96e8a7309bc6bc2b8cb80008aed7165e
See if user is group member user: User object
[ { "docid": "312cf83c345b0a9ef5d8e0ffef70087c", "score": "0.78054637", "text": "def member?(user = nil)\n membership = Membership.find_by group_id: id, user_id: user.id\n return false if membership.nil?\n membership.user_id == user.id\n end", "title": "" } ]
[ { "docid": "84693c643238449deaf795b37bf751d6", "score": "0.79606616", "text": "def member_of(group)\n current_user.is_member?(group)\n end", "title": "" }, { "docid": "f546a88694690501e46aec112c172cbf", "score": "0.7957785", "text": "def user_in_group?(user, group)\n r...
190f425e55543514ac8e8e91f6dc5f0a
GET /envoices/1 GET /envoices/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9921564f544eb5afe828c9cd4c1f8498", "score": "0.6998163", "text": "def show\n @environnement = Environnement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @environnement }\n end\n end", "title": "" }, { ...
045f092eb40fd9858db1dcdc8c19dad5
funkcija za listanje liste
[ { "docid": "31ef5f5118b0324bb0c1214222daa9ae", "score": "0.0", "text": "def searchThroughRadioList(value)\n 14.times{Appium::TouchAction.new.swipe(start_x:0.5, start_y:0.2, end_x:0.5, end_y:0.8, duration:600 ).perform}\n current_screen = get_source\n previous_screen = \"\"\n\n until (exists{find_ele...
[ { "docid": "f0166467553ab2c473ed662a42736d60", "score": "0.75366205", "text": "def list \n end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", "score": "0.7367007", "text": "def list; end", "title": "" }, { "docid": "71cfcd54803e4afa7dc393a58260e746", ...
0ea1657bf99bb4918c52bf4eff6db14e
Create a new monome
[ { "docid": "6aa9767991876337e1853e929722915b", "score": "0.0", "text": "def initialize(opts={})\n opts.reverse_merge! :cable_placement => :top\n opts.reverse_merge! :name => opts[:io_file]\n\n unless opts[:io_file] then\n raise ArgumentError,\n \"Polynome::Monome#initialize ...
[ { "docid": "acb0ad5cc8fa9ef73e129feac6059dbf", "score": "0.6752121", "text": "def create_established_memetype(attributes = {})\n mt = create(:meme_type, attributes)\n puts \"[SETUP::Created MemeType]: #{mt.name}\"\n establish_memetype(mt)\n return mt\nend", "title": "" }, { "docid": "16e...
1af59855ce668f26ffdf40ccdefc58f0
Override of Blacklight method, provide advanced constraints if needed, otherwise call super.
[ { "docid": "ae052ed4948c272cf0d03f37aca413ef", "score": "0.0", "text": "def render_constraints_query(my_params = params)\n if advanced_query.nil? || advanced_query.keyword_queries.empty?\n super(my_params)\n else\n content = guided_search\n safe_join(content.flatten, \"\\n...
[ { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.7086169", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4eb195", "score": "0.7086169", "text": "def constraints; end", "title": "" }, { "docid": "b6bb70e33cc0233b4862ae280e4e...
f7fe9271a3d9e603396e7a5a1cecd251
POST /request_properties POST /request_properties.json
[ { "docid": "c65d7be5846797d2b752c83bd086d933", "score": "0.627175", "text": "def create\n @request_property = current_user.request_property.new(request_property_params)\n @request_property.sequence_request = @request_sequence_property.sequence\n @request_property.sequence_certificate = @propert...
[ { "docid": "a4283f786d09b62c1f0d1abde37adda0", "score": "0.7337293", "text": "def request_property_params\n params.require(:request_property).permit(:user_id, :certificate, :request_certificate, :other_type, :other_certificate, :comment, :sequence_request, :sequence_certificate)\n end", "tit...
4b447e46d4118e7d09967ca4ad1afec6
GET /user_sessions/1 GET /user_sessions/1.xml
[ { "docid": "26bc2f44b5a396d29fa98939ab605968", "score": "0.6822174", "text": "def show\n @user_session = UserSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_session }\n end\n end", "title": "" } ]
[ { "docid": "0df500a3b1468fc6f3e452b8c5134e67", "score": "0.6704263", "text": "def session_get\n nessus_rest_get(\"session\")\n end", "title": "" }, { "docid": "1c67bf827222698c9a825f52e7ce2fcb", "score": "0.653773", "text": "def list_sessions(user_id:)\n path = '/u...
3b4f55f9eed1733a191028a830e1eace
Count of parameter argumets
[ { "docid": "dc7461dbef9fbf8b6f138e01c5b6fa7b", "score": "0.78010046", "text": "def arguments_count\n 0\n end", "title": "" } ]
[ { "docid": "3b7ff7ab32c9eaff8bdf59c4985baf8a", "score": "0.82360506", "text": "def paramcount\n return -1 if @variable\n\n paramcount = 0\n @parameters.each do |param|\n paramcount = paramcount +1 unless param.respond_to?(\"value\")\n end\n\n return paramcount\n end", ...
68a4e3bbac7fbddfa0e6c015792023c1
Returns an array of numeric user ids the authenticating user is blocking
[ { "docid": "fb64010537eca70227b14cf038312d49", "score": "0.61014056", "text": "def blocked_ids(options={})\n response = get('blocks/blocking/ids', options)\n format.to_s.downcase == 'xml' ? response['ids']['id'].map{|id| id.to_i} : response\n end", "title": "" } ]
[ { "docid": "291ab88bcd12aef798ddb6f39f5933b6", "score": "0.707944", "text": "def user_ids\n return @user_ids\n end", "title": "" }, { "docid": "c423d0ddffce310943cc93f341e5d0b7", "score": "0.70291513", "text": "def user_ids\n\t\treturn @user_ids\n\tend", ...
be733b88882fdfeb1201aee8ebeef5a7
POST /documentos POST /documentos.xml
[ { "docid": "64251f4ec9198481b7f4bbd43ee92db0", "score": "0.0", "text": "def create\n @documento = Documento.new(params[:documento])\n \n respond_to do |format|\n if @documento.save\n format.html {\n responds_to_parent do\n actualizar_view\n end\n ...
[ { "docid": "be5e9f9b60b0669b81bda14ab8409026", "score": "0.7005426", "text": "def post_document\n check_document\n response = Defensor.post(Defensor.api_path(\"documents\"), :body => { :client => CLIENT }.merge(@options))\n status = response[ROOT_NODE][\"status\"]\n @signature = response[ROO...
02d778d03ddba89699a3d0addc2ae4d5
start with the simplest behavior Spec: Counts from 1 to a given number input : 7 Output : 1,2,3,4,5,6,7
[ { "docid": "5ca04b5c672851334b202882ec6a3de2", "score": "0.6482744", "text": "def number_count(number)\n x=0\n array = []\n while (x<number)\n x+=1\n array.push(x)\n end\n array\nend", "title": "" } ]
[ { "docid": "41f13bc01b0d269bfd94ccb0a73e8cd6", "score": "0.7056134", "text": "def count_to(n)\nend", "title": "" }, { "docid": "f1dd8c7fcf963f08f03b012c658652ca", "score": "0.6991993", "text": "def count(num)\n (1..num).to_a\nend", "title": "" }, { "docid": "1645d7cd66...
844b2ef17c33378be9be41b12d8f3d0b
GET /insumos_serigrafia_productos/1 GET /insumos_serigrafia_productos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "bf09138ee62e2b06dfff7cac82b59b5b", "score": "0.6981473", "text": "def index\n @establecimiento_productos = EstablecimientoProducto.all\n\n render json: @establecimiento_productos\n end", "title": "" }, { "docid": "9bce4f74874a78ad5f7c1c788c394438", "score": "0.6973312"...
dc08b2720b33e4106bf00883762679ff
def selected_city user user.present? ? (user.city.present? ? user.city.id : nil) : nil end
[ { "docid": "5f65383c710ac48d632d3cfb7572e7f3", "score": "0.0", "text": "def country_options\n Country.all.map{|country| [country.title, country.id]}\n end", "title": "" } ]
[ { "docid": "734d9175215fc6f28605d3250fa9ee34", "score": "0.73974663", "text": "def set_user_city\n @user_city = UserCity.find(params[:id])\n end", "title": "" }, { "docid": "a668ee03c6299e5111fca52ada230ee7", "score": "0.6967483", "text": "def set_mobile_user_city\n @mob...
4eeb485be5e5849540a725c22674db93
This method can be overriden by other classes
[ { "docid": "73ab0477e07c9810c589d0689a9e2656", "score": "0.0", "text": "def build_links_for_this_media_type(transition)\n link = if transition.templated?\n { href: transition.templated_uri, templated: true }\n else\n { href: transition.uri }\n end\n [:name,...
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.80488205", "text": "def override; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.73321444", "text": "def overrides; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1...
04f6d1856b3b33e6bd7e4c8ddc1c003c
The path used after sending reset password instructions
[ { "docid": "443138e8518fe290431930e2413049a8", "score": "0.6859601", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n new_session_path(resource_name)\n end", "title": "" } ]
[ { "docid": "bfbb10be8df667308140b38ce8b07689", "score": "0.7597539", "text": "def after_sending_reset_password_instructions_path_for\n root_path\n end", "title": "" }, { "docid": "85bf394fbd5399fd2604a763b93c5bd5", "score": "0.7575779", "text": "def error_path\n Rails.applic...
dccb50c2b6a73198ea504276aba6beb0
GET /anredes/1 GET /anredes/1.json
[ { "docid": "31a19d74e2c22e3bd8d93ab01973c160", "score": "0.7494166", "text": "def show\n @anrede = Anrede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anrede }\n end\n end", "title": "" } ]
[ { "docid": "24c80701b948aaeb4b7a73c3c5d849a1", "score": "0.68391967", "text": "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end", "title": "" }, { "docid": "b6e253138d9fe1e93f7df14...
01c2c5ad48315ac517cda1057c4ac6a9
Call to attempt to update chunk if changes to image have been made such that it is safe to copy the chunk to the updated png file. Returns true if successful, otherwise false.
[ { "docid": "1c5fc06514abc61b4620d20630816ba1", "score": "0.0", "text": "def make_safe!\n return false\n end", "title": "" } ]
[ { "docid": "1cfbb0552a257571c82ce8a316d935b0", "score": "0.5751319", "text": "def quick_equal?\n return nil unless old_file_exists?\n return true if new_file_size == old_file_size\n old_file, new_file = load_image_files(@old_file_name, @new_file_name)\n return true if...
f330ce4793945180c7d51444c9778928
If the data attribute is empty, we need to create a self closing node key. We also :clear_data! in the node.
[ { "docid": "67cb3888897ac34c8e9ea105f8b200a1", "score": "0.5811416", "text": "def process_empty_object\n clear_data!\n self.key = transform_to_empty_key(key)\n end", "title": "" } ]
[ { "docid": "8d852ebf9bcfd3abf27fef41ba63fc5c", "score": "0.6014992", "text": "def replace_data(node, data)\n node.data\n ensure\n node.data = data\n end", "title": "" }, { "docid": "aa515c2f2525099e4298faedbabf9efa", "score": "0.5977198", "text": "def associate_next_empty_gro...
0951591747ad2ad5ccb5b762d2d7a5d2
DELETE /anatomic_sites/1 DELETE /anatomic_sites/1.json
[ { "docid": "03c7f6e3e87a6131ede5a317069c8029", "score": "0.7232125", "text": "def destroy\n @anatomic_site.destroy\n respond_to do |format|\n format.html { redirect_to anatomic_sites_url, notice: 'Anatomic site was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "34264605c47edda6ffe32df87c7a7266", "score": "0.69233125", "text": "def delete\n delete_from_server single_url\n end", "title": "" }, { "docid": "02617ffdb39bec0808fea8f88e312167", "score": "0.6888771", "text": "def destroy\n @orbituarysite = Orbituarysite.find(...
ec32a618b8891e0aa3ec89ad5172146c
GET /api/nouns/1 GET /api/nouns/1.json
[ { "docid": "af3d897041efe854cfb5f71364d9c2da", "score": "0.7748342", "text": "def show\n @api_noun = Api::Noun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_noun }\n end\n end", "title": "" } ]
[ { "docid": "61586b66610502b764a155808444eee7", "score": "0.7282201", "text": "def new\n @api_noun = Api::Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_noun }\n end\n end", "title": "" }, { "docid": "6c6ca223e34a2776853d...
799d3f9a337d9f95a986e2b808a5653b
Make menu options more modular with this reused function
[ { "docid": "e47ae9799167312d9f7442e85231ea9f", "score": "0.0", "text": "def make_call(action, endpoint, job)\n response = HTTParty.post(\n \"http://localhost:3000/#{endpoint}\",\n :body => {\n \"#{action}\" => \"#{job}\",\n \"client\" => \"client_cert.pem\",\n }\n )\n...
[ { "docid": "c44e92f70ee80f7128582bad5dc93b24", "score": "0.71998256", "text": "def getMenu(menu)\n menu.add_item(\"Done\") {self.done}\n menu.add_item(\"Edit Camera...\") {self.edit}\n menu.add_item(\"Reset Tilt\") {self.reset_tilt}\nend", "title": "" }, { "docid": "779ea312c2af306f...
0b5fe6093a630f845adc18f599deca28
Generated download types from wxs services
[ { "docid": "c410861426dbc6fc18141207cf8f30d3", "score": "0.66348135", "text": "def download_types\n downloads_by_format\n end", "title": "" } ]
[ { "docid": "42cdd7e2b8ab74dd293270a33602f162", "score": "0.6440325", "text": "def service_types_generated\n # We generate full text and holdings types, right now.\n types = [ ServiceTypeValue[:fulltext], ServiceTypeValue[:holding], ServiceTypeValue[:table_of_contents] ]\n \n return types\n ...
14b63a061f77491fa9090789fc858f9e
Returns true if the relation was scheduled on the background thread pool.
[ { "docid": "01958ebdbe51220ae0a4c7f2a29664e5", "score": "0.6839264", "text": "def scheduled?\n !!@future_result\n end", "title": "" } ]
[ { "docid": "4fdbfd91528acd24d9cf463b615680da", "score": "0.7137162", "text": "def started?\n @thread_pool&.running?\n end", "title": "" }, { "docid": "4fdbfd91528acd24d9cf463b615680da", "score": "0.7137162", "text": "def started?\n @thread_pool&.running?\n ...
b9f040c49ac309717e3118b044eca0e7
INFO: 'base64/png' image data can be written to disk like this (python2.7): File.open('image_to_save.png', 'wb') do|f| f.write(Base64.decode64(image_data)) end
[ { "docid": "34dc6bce66f15bd7d07bc2b7b8d26b1a", "score": "0.0", "text": "def setup\n @client = RetinaSDK::FullClient.new(Conf::API_KEY, api_server: Conf::BASE_PATH, retina_name: Conf::RETINA_NAME)\n end", "title": "" } ]
[ { "docid": "a5343eecaf8fba5b054f227797afd54f", "score": "0.71531945", "text": "def save_image(data)\n hacker_id = checksum(data)\n filename = checksum(data) + '.jpg'\n unless File.exists?(filename)\n File.open(filename, 'w') do |f|\n f.write data\n debug 'wrote %d bytes to %s...
d798ed85b7322c7401863e572ff1ff3b
after a new signature is created, publish fresh data to the clients and also set the cache value that /fresh_data is based upon
[ { "docid": "deba5ddec50c0b31fae9dcfca2cde56a", "score": "0.7305911", "text": "def cache_signature_data_and_server\n invalidate_cache\n Rails.cache.write(\"topThreeStates\", self.class.top_three_states, expires_in: 10.minutes)\n Rails.cache.write(\"signatureCount\", self.class.count, expires_in:...
[ { "docid": "79a32a8c781af25d2bcb444107b6ec44", "score": "0.69581884", "text": "def after_create(signature)\n\t\tif signature.state == 1 \n\t\t\texpire_cache_for(signature)\n\t\tend\n end", "title": "" }, { "docid": "0679cdc02aa7080708e60e3db7a4b1e5", "score": "0.66423136", "text": "...
64c3b34abfe94c00d5c01afadfc5294a
Save all match skills in elasticsearch
[ { "docid": "f701aeba4f47aa5b0bb69c87e70d00a0", "score": "0.0", "text": "def matched_skill\n text = ''\n counter = 0.0\n skills = self.member.skills\n \n if self.job.present?\n self.job.skills.each do |s|\n if skills.include? s\n text += \"<span class='mb-5 label label...
[ { "docid": "6d40abd5d9b886b0a053fbffaa70a9d2", "score": "0.59656394", "text": "def create_search_index\n Tire.index Person.index_name do\n create(\n settings: {\n analysis: {\n filter: {\n name_ngrams: {\n 'side' => 'front',\...
76195ea9b6ff316932f1d2ff33253f43
POST /chirps POST /chirps.xml
[ { "docid": "f2dfbe0bd16a406380dfddb737d1ae48", "score": "0.0", "text": "def create\n @chirp = Chirp.new(params[:chirp])\n\n @chirp.user_id = current_user.id\n if @chirp.save\n flash[:notice] = 'Chirp was successfully created.'\n redirect_to :action => \"index\"\n end\n end...
[ { "docid": "c78e0b38d566040be49ce816aa8db91e", "score": "0.5568519", "text": "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "title": "" }, { "docid": "449fca18051de18a19a3ddb3a63b8bf9", "score": "0...
4db4af6bd3cf57350d7bad7fee7c2d37
Item alignment the center
[ { "docid": "5b2048944311c4c95a9eb5afca3e537f", "score": "0.0", "text": "def centralize?\n false\n end", "title": "" } ]
[ { "docid": "2495c4e40867dc8f6e7f3506bc02115d", "score": "0.69014025", "text": "def center\n {:align => 'center'}\nend", "title": "" }, { "docid": "ff83791c8af80bab07cea834b6ba09d7", "score": "0.6865164", "text": "def center_across!\n self.horizontal_align = :merge\n end", ...
eaa74372f910ebe4088d505918b70c06
Test whether percolation is interrupted
[ { "docid": "f42f3e6621bcf3f3b73ffc64c94f703b", "score": "0.6090488", "text": "def interrupted?\n @received_interrupt == true\n end", "title": "" } ]
[ { "docid": "7d0505ab9b5f36726fa324e256011376", "score": "0.6438681", "text": "def interrupted?\n !!@interrupted\n end", "title": "" }, { "docid": "7d0505ab9b5f36726fa324e256011376", "score": "0.6438681", "text": "def interrupted?\n !!@interrupted\n end", "...
7853a6c33088c5eac361a6816667306f
Return a trimmed version of the filename from where a LogEvent occurred
[ { "docid": "9e7f8b23ebd516792bbd0c131fd6ac4a", "score": "0.72100973", "text": "def event_filename(tracer)\n parts = tracer.match(/#{basedir}\\/(.*:[0-9]+).*:/)\n\n # If we get no matches back, we're probably in a jar file in which case\n # the format of the tracer is going to be abb...
[ { "docid": "fe1ffe9b6269baa29d27d59ed2cb8666", "score": "0.723762", "text": "def event_filename(tracer)\n if basedir.nil?\n parts = tracer.match(/(.*:[0-9]+).*:/)\n else\n parts = tracer.match(/#{basedir}\\/(.*:[0-9]+).*:/)\n end\n\n # If we get no matches b...
ea7645c18a0a67e8c55da6d4c02c99d2
accept strings accepted by self, followed by the strings accepted by newFA
[ { "docid": "a1afb79e86db431d7023a3ed3db77252", "score": "0.52690136", "text": "def concat! newFA\n @final.keys.each{ |fin|\n add_transition(fin, newFA.start, \"\")\n }\n \n @final.clear\n @final.update(newFA.final)\n @state.update(newFA.state)\n @transition.update(newFA.transit...
[ { "docid": "114c89d19d7c6c37876a0fbc8eea6bb3", "score": "0.5678822", "text": "def accept_entered_text\n \n end", "title": "" }, { "docid": "a24527f661017721bc69356b3eea6e91", "score": "0.5494224", "text": "def accepts?(string)\n @final_states.include?( self << string )\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c4893f6e14a64586f40b3189e08dc367", "score": "0.0", "text": "def set_applicant\n @applicant = Applicant.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "de...