query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
3d78fd016a172c6120e06a4d51febea6 | Returns the current activepage on a perpage basis | [
{
"docid": "5c3b6b66223a7e4650c1f72b50e35493",
"score": "0.0",
"text": "def aboutusActive?(page_title)\n 'class=\"active\"' if page_title == \"About Us\"\n end",
"title": ""
}
] | [
{
"docid": "725aaa08888ed9ea92034b39bd285200",
"score": "0.75204027",
"text": "def current_page\n params[:page] && params[:page].match(/\\d+/) ? params[:page].to_i : 1\n end",
"title": ""
},
{
"docid": "29117fed60d10a66e380638181390671",
"score": "0.7486905",
"text": "def... |
5965e6bd867943148294d971291cf763 | DELETE /study_sessions/1 DELETE /study_sessions/1.json | [
{
"docid": "0768e7ff53e0b1fc2f3abaa8135373db",
"score": "0.74485284",
"text": "def destroy\n @study_session.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'study_session was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "94f7544e0a439eda0632172ad25902c5",
"score": "0.7724551",
"text": "def destroy\n @studysession.destroy\n respond_to do |format|\n format.html { redirect_to studysessions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7eff1596e... |
9af0880aabcf5396d930d8b1b244cd1f | with rule set in merchant account to skip 3DS for cards of this brand | [
{
"docid": "72b7bb705acc7e138327c1459d4336e7",
"score": "0.5694743",
"text": "def test_successful_authorize_with_3ds_dynamic_rule_broken\n mastercard_threed = credit_card(\n '5212345678901234',\n month: 3,\n year: 2030,\n first_name: 'John',\n last_name: 'Smith',\n verif... | [
{
"docid": "ffe90103e36fd30c6d4341bb525c1179",
"score": "0.574548",
"text": "def skip_company\n @attributes[:skip_company]\n end",
"title": ""
},
{
"docid": "f99b550f0ea2544ae8038c71b162384c",
"score": "0.5604567",
"text": "def receivership_skip?(entity)\n entity.c... |
dbadf61d2a72486f3211e6e74b4f0dd1 | Read a 'niatelemetry.ApicTransceiverDetails' resource. | [
{
"docid": "a2be13559239b6aec12a84a55bab42a4",
"score": "0.57758415",
"text": "def get_niatelemetry_apic_transceiver_details_list(opts = {})\n data, _status_code, _headers = get_niatelemetry_apic_transceiver_details_list_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "8c82322d9cac691c53b2e89080642fa6",
"score": "0.556031",
"text": "def info\n readers_length_ptr = FFILib::WordPtr.new\n state_ptr = FFILib::WordPtr.new\n protocol_ptr = FFILib::WordPtr.new\n atr_ptr = FFI::MemoryPointer.new FFILib::Consts::MAX_ATR_SIZE\n atr_length_ptr = FFILib... |
866f919e983c199f873f9b871885d0b0 | The intersect method is used to compute the boolean intersection of two groups representing manifold solid volumes (this & arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails. | [
{
"docid": "143ab976ca61787650ef9a8a316d2161",
"score": "0.69522166",
"text": "def intersect(group)\n end",
"title": ""
}
] | [
{
"docid": "adaebc3ac9dd7f54e0745d7921209104",
"score": "0.64610124",
"text": "def __intersect__(object)\n object.__intersect_from_object__(self)\n end",
"title": ""
},
{
"docid": "58e821800e55a3b5bba9798d3d72de96",
"score": "0.64552844",
"text": "def intersect(*a... |
de7c8cbf19048088ca7f5245c512ab83 | output: nil, 'X', 'O', or 'DRAW' | [
{
"docid": "3fc3df9f4d0406b7b6254ccfd5e77c8a",
"score": "0.0",
"text": "def winner?\n\t\t@winner\n\tend",
"title": ""
}
] | [
{
"docid": "3d89374fe78a7d65c6d9d3c5f83a1947",
"score": "0.6511026",
"text": "def get_print_char x,y, leer = nil, one = 'X', two = 'O'\n\n #return \"@\" if @field[x][y].winner\n\n case @field[x][y].player\n when 1 then one\n when 2 then two\n else\n if leer.nil? then\n $keymap... |
73c4dcd06671db9242d331c31e076d7e | NOTE: We extend the subject with additional methods that may be useful only when building the payload. This is possible by using the Proxy TODO: Warn if method is already defined on subject.__getobj__ | [
{
"docid": "756075078798fe75b38e00a0457af9c2",
"score": "0.0",
"text": "def helper(name, &block)\n delegation_obj = subject.__getobj__\n subject.define_singleton_method(name.to_sym) do\n instance_exec(delegation_obj, &block)\n end\n end",
"title": ""
}
] | [
{
"docid": "1d3cfe056fd649ee3af4b8b961ef2d8c",
"score": "0.6802776",
"text": "def method_missing(method)\n subject.send method\n end",
"title": ""
},
{
"docid": "b22139428cbee33618cec54d7367302d",
"score": "0.6273146",
"text": "def initialize(obj)\n super\n if @... |
c441342de34ccad66bc755812d8e33d5 | ============================================================================== status_fail?() ============================================================================== Is the 'status' field set to 'fail'? | [
{
"docid": "06a615b3a2f6fae02be179096e9639fd",
"score": "0.71718705",
"text": "def status_fail?()\n return true if (@status == TAC_PLUS_AUTHOR_STATUS_FAIL)\n return false\n end",
"title": ""
}
] | [
{
"docid": "3e6669ce8c1f16f32226596572d1df9f",
"score": "0.8527235",
"text": "def failed?; @status == 'failed' end",
"title": ""
},
{
"docid": "d76b215cab1fb3516e28460eb5c15c86",
"score": "0.83310246",
"text": "def failed?\n status == 'FAIL'\n end",
"title": ""
},... |
558eb013ee955ad2a7cc65e71bc7fd81 | Construct all the commands for the changed file | [
{
"docid": "60486e01418093c27de950937b1fddf3",
"score": "0.7851553",
"text": "def construct_commands_for_changed_files(files)\n ConstructCommand.new(:files_to_run => files).create.command\n end",
"title": ""
}
] | [
{
"docid": "1e8b131bd7bde147d34fdfd48c66d268",
"score": "0.69237345",
"text": "def commands\n # commands are executed in the directory containing the \"from\" files\n\n commands = []\n if action == 'mv'\n args = [action.to_s, '-v']\n\n if files.count == 1\n # for renaming a sin... |
71d4692e23a9a96ace980518e5b2732b | Return the first key in the command arguments. Currently we just return argv[1], that is, the first argument after the command name. This is indeed the key for most commands, and when it is not true the cluster redirection will point us to the right node anyway. For commands we want to explicitly bad as they don't make... | [
{
"docid": "79111c515a3d072e64a3833a1015eb3f",
"score": "0.83405936",
"text": "def get_key_from_command(argv)\n case argv[0].to_s.downcase\n when \"info\",\"multi\",\"exec\",\"slaveof\",\"config\",\"shutdown\"\n return nil\n when \"bitop\"\n return argv[2]\n else\n # Unknown c... | [
{
"docid": "a6fa930f8893ad9bf7d6dc2078b3c1b2",
"score": "0.8375654",
"text": "def get_key_from_command(argv)\n case argv[0].to_s.downcase\n when \"info\",\"multi\",\"exec\",\"slaveof\",\"config\",\"shutdown\"\n return nil\n when \"bitop\"\n return argv[2]\n ... |
4085bc0b7e3305545fbd7805d855c8b0 | GET /vagas/1 GET /vagas/1.json | [
{
"docid": "f64bdd14f2e779103e1cbd87d83e6605",
"score": "0.0",
"text": "def show\n\n estado_civil = \"AND C.ESTADO_CIVIL = #{@vaga.estado_civil.to_i}\" unless @vaga.estado_civil.to_i == 2 \n veiculo = \"AND C.VEICULO_PROPRIO = #{@vaga.veiculo_proprio}\" if @vaga.veiculo_proprio.to_s == 't' \n f... | [
{
"docid": "ed1dbe1132895bdd370d034cb454a1dd",
"score": "0.6974952",
"text": "def show\n vaga = Vaga.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded vaga', data:vaga},status: :ok\n end",
"title": ""
},
{
"docid": "1af4878dbf11015a5ee14d898911... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "b30a45553513ad2fb3b1289ed9f96f9e",
"score": "0.0",
"text": "def update!(**args)\n @label = args[:label] if args.key?(:label)\n @score = args[:score] if args.key?(:score)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
048ab7e1e65ed075dbf10ac719bc6764 | Score similarty, input merged ngram query lines array, ouput scores Hash | [
{
"docid": "7488f5fcbbac9ee7442a035e39a310ab",
"score": "0.64847964",
"text": "def FastCosineScore(queryi)\n\tqueryi_ngram_all = File.open(\"#{$dir_queryfile}/queries_converted/query#{queryi}_ngram.all\", \"r\").readlines\n\tscores = Hash.new{0} # Scores[N] 初始值 0\n\t# length_d = Hash.new{1} # Length[N] ... | [
{
"docid": "e22804648e9a0f125e8ff818710b31eb",
"score": "0.66955036",
"text": "def score_sentences(sentences)\n # sentence_scores = Hash.new\n sentences.each_with_index do |s,i|\n sids = s[2].collect{|a| Hash[a.collect{|b| b.split(':')}]}\n # [{\"0\"=>\"6\", \"1\"=>\"4\"}, {\"0\"=>\"2\", \"1\"=>... |
4f21aae2bb1730fc7e48e15883d7d6a9 | Overwriting the sign_out redirect path method | [
{
"docid": "865c73b03bcdc1943b27f0dc6bfd8d50",
"score": "0.0",
"text": "def after_sign_out_path_for(resource_or_scope)\n\t\tnew_user_session_path\n\tend",
"title": ""
}
] | [
{
"docid": "9f04e62b663f6477f6c1d68d1b288eeb",
"score": "0.82528174",
"text": "def after_sign_out_path_for(resource)\n super\n end",
"title": ""
},
{
"docid": "82427fe165aea1e420f5e1332636a243",
"score": "0.81517977",
"text": "def sign_out\n redirect_to root_path\n end",
... |
196c00b334f7c1f9cca45c745611eef6 | search some columns in passengers table this is not done.. | [
{
"docid": "e24a1bd56c558ac46eb821e5de80799b",
"score": "0.5537173",
"text": "def some_passengers_cont\n some_attributes = []\n attributes_to_exclude = [\n \"created_at\",\n \"updated_at\",\n \"id\"\n ]\n Passenger.column_names.each do |column_name|\n most_attributes << c... | [
{
"docid": "981be7f1d9fcd1afb1d86d802dbd3918",
"score": "0.6724191",
"text": "def extract_searchable(columns)\n\t\t\tsearchable = []\t\n\t\t\tcolumns.each do |key, val|\n\t\t\t\tname = val[:data].to_sym\n\t\t\t\tif val[:searchable] == \"true\"\n\t\t\t\t\tsearchable << name\n\t\t\t\tend\n\t\t\tend\n\t\t\... |
e4c70295d0b8a629f551c917805f1c5b | New method : Get next symbol (Outdated function in early ver. Not used) | [
{
"docid": "0c06f2f48a39ce2d8e7011f3b4da090a",
"score": "0.59558624",
"text": "def next_is?(symbol)\n next_ary = animation_array[@anim_index + 2]\n return next_ary[0] == symbol\n end",
"title": ""
}
] | [
{
"docid": "18645f77a8bb24a8e4df9f206815167d",
"score": "0.7946804",
"text": "def next_symbol\n nil # Default implementation\n end",
"title": ""
},
{
"docid": "045ca49d9fc9c7472e28c64858ac4f89",
"score": "0.7608",
"text": "def next_symbol\n vertex.next_symbol\n ... |
54f3aa38348f9fce24958d43ef79eeac | POST /app_statics POST /app_statics.json | [
{
"docid": "3871bc3fc5bfe7ba040fc84ffe4e8bad",
"score": "0.68540627",
"text": "def create\n @app_static = AppStatic.new(app_static_params)\n\n respond_to do |format|\n if @app_static.save\n format.html { redirect_to @app_static, notice: 'App static was successfully created.' }\n ... | [
{
"docid": "d7a8069bd49fef40719ddf6888de8273",
"score": "0.65541446",
"text": "def index\n @statics = Static.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @statics }\n end\n end",
"title": ""
},
{
"docid": "3c83499333465b90cb9b... |
c52c6c26ad693dd988a5f92cb716b5c4 | Creates a new task list. | [
{
"docid": "bf6929d924028f7621621baeae03d42c",
"score": "0.0",
"text": "def initialize\n @tasks = {}\n\n @compiled = false\n @stopped = false\n end",
"title": ""
}
] | [
{
"docid": "0277bc667a44ac5394462d4df8c29159",
"score": "0.86184806",
"text": "def create_task_list(opts={})\n @list.client.post(\"#{url}/task_lists\", opts)\n end",
"title": ""
},
{
"docid": "2226f0cbe35b595a3242f0f1f9873fbb",
"score": "0.8302268",
"text": "def new_task_list... |
deddc39915b583b29954eb101d5ca69c | /////////////////////////////////////////////////////// => CONVERTING FROM_BASE TO BASE10 THEN CONVERTING TO TO_BASE we take our values and reverse them for readability. Starting from the left hand => side, we multiply the value by the power of each base | [
{
"docid": "0daaec030040661484abfad167d31ee5",
"score": "0.57954097",
"text": "def convert_to_decimal_array(value_array_string, from_base)\r\n index = 0\r\n value_array_integer = value_array_string.map { |e| e.to_i }.reverse\r\n for element in value_array_integer\r\n value_array_integer[index] = e... | [
{
"docid": "4c18f9888f47ac2165d7241c7d016791",
"score": "0.77936924",
"text": "def convert_base(digits, from_base, to_base)\n bignum = 0\n digits.each { |digit| bignum = bignum * from_base + digit }\n converted = []\n until bignum.zero?\n bignum, digit = bignum.divmod(to_base)... |
8c67cdadaf4388072ceb0a5428550cbc | Search by Product ID or Title | [
{
"docid": "d08f6e3dfe58176eaec10a86f4f711ea",
"score": "0.0",
"text": "def search_product(item)\n wait_for_ajax\n fill_in 'search', with: item\n wait_for_ajax\n search_btn.click\n wait_for_ajax\n end",
"title": ""
}
] | [
{
"docid": "bbe5580163d3a9e19b80b2e3d4506331",
"score": "0.76533926",
"text": "def search\n # TODO use like operator\n @search_results = Product.where(title: params[:title])\n end",
"title": ""
},
{
"docid": "bc10e3be373986409ee16528e5cb708c",
"score": "0.73143536",
"text": "d... |
b5d239a1711d956d195eeec2cba74238 | Recusive procedure It should be called initially with a list of jobs and an empty distribution containing one empty press ( = [[]]). It will try to find the optimal distribution and store it in | [
{
"docid": "e7c3d6ed9fcf0c810784d43c058da9bd",
"score": "0.74799037",
"text": "def distribute_jobs distrib, jobs\n\n # we can stop, we have reached the maximum number of press\n if distrib.size == @number_of_presses\n\n # copy the remaining jobs in last press and empty jobs array\n while... | [
{
"docid": "2f5895b9b72005d255c9b06f71a532a2",
"score": "0.6422885",
"text": "def build_subsolutions\n @success_probability = Array.new(@size)\n @success_probability[@size-1] = 1.0/@size\n (@size-1).downto(1).each { |k|\n @success_probability[k-1] = 1.0/@size + @success_probability[k]*(k-1... |
b21516828e183ac1df5cbd1714e7ef58 | INSTANCE METHODS use GitHub api to pull `do1_test_source` for each module and set up test case commits if they don't exist | [
{
"docid": "0e2eb61df16f431b66abf1ff3a2cbf5f",
"score": "0.6703014",
"text": "def api_test_cases\n cases_present = {}\n TestCase.modules.each do |mod|\n source_file = \"/#{mod}/test_suite/do1_test_source\"\n begin\n contents = Base64.decode64(\n Commit.api.content(\n ... | [
{
"docid": "cfb75dda993f655efee3929d4e273fef",
"score": "0.5734657",
"text": "def load_test_source_data(mod: :all)\n # allow for brainless loading of all module data\n if mod == :all\n MesaTestCase.modules.each do |this_mod|\n load_test_source_data(mod: this_mod)\n end\n else\n... |
78e6cf6ad5d1465052ac4d55ce14b928 | Helper method for joining "groups" of lines Input is expected to be type Array> The outer array holds the various "groups" while the inner array holds code lines. All code lines are "joined" into the first line in their group. To preserve document size, empty lines are placed in the place of the lines that were "joined... | [
{
"docid": "f472914f0de5249417553c41c4db3e02",
"score": "0.7599375",
"text": "def join_groups(groups)\n groups.each do |lines|\n line = lines.first\n\n # Handle the case of multiple groups in a a row\n # if one is already replaced, move on\n next if @document[line.index]... | [
{
"docid": "767b9b5600f180efc78979260368c865",
"score": "0.6651949",
"text": "def join_consecutive!\n consecutive_groups = @document.select(&:ignore_newline_not_beg?).map do |code_line|\n take_while_including(code_line.index..-1) do |line|\n line.ignore_newline_not_beg?\n end... |
b5b838bd4a55b75482d06cd9ab4dda92 | => Validate Transaction Data | [
{
"docid": "a4026fd6fd09da27c33e252e24422902",
"score": "0.0",
"text": "def validate(data, attr_required)\n result = true\n # Merge input fields into array\n\t\tarr_att = Hash.new\n\t\tdata['generalData'].each do |key, value|\n \t\tarr_att[key] = value \n\t\tend\n\n\t\tdata['operationDa... | [
{
"docid": "00e661fe691b0e526a2942330ff354fd",
"score": "0.71134466",
"text": "def test_invalid_transactions\n\t @checker.do_transactions('000000>111111(10)', 0)\n\t refute @checker.check_addresses(0)\n end",
"title": ""
},
{
"docid": "3c82cdd0fd028650f485d00ae3a21ae4",
"score": "0.70... |
3bc4922ee536fc7df3c39c399b390e75 | Outputs modernizr script tags, with appropriate jquery path Scripts should be added as a page variable (array). External paths and paths prefixed with "!" are not altered. jQuery CDN path is automatically added on production for "jquery". | [
{
"docid": "3f56de7201c8d77a34f367ce34fbd7f6",
"score": "0.8171283",
"text": "def modernizr_scripts\n scripts = current_page.data.javascripts || data.global.javascripts\n\n if scripts.is_a?(Array)\n scripts = scripts.map do |script|\n if script[0,2] == \"//\" || script[0,7] == \"http:/... | [
{
"docid": "cf82daf12bf43588c84336e6867154b7",
"score": "0.65702957",
"text": "def javascripts\n out = []\n files = []\n if offline_mode?\n files << %w(jquery jquery-ui)\n else\n out << google_jquery(:version => '1.4.1')\n out << google_jqueryui\n end\n # files << %w(jqu... |
7ce9cd758186f4e79644abf308bf8e44 | Return read deadline for current read state | [
{
"docid": "a969fae6fee91284c89b1d0fa79ef335",
"score": "0.60395366",
"text": "def read_state_timeout\n case\n when opening? && @open_timeout\n [:open, @opening_at, @open_timeout]\n when pinging? && @ping_timeout\n [:pong, @ping_at, @ping_timeout]\n when closing? && @close_timeout\... | [
{
"docid": "991e504bdeda61c49b5c6143787f6023",
"score": "0.7446598",
"text": "def read_timeout\n @io.read_timeout\n end",
"title": ""
},
{
"docid": "a5e675d2c4733f15f6e94a3089015318",
"score": "0.72959703",
"text": "def read_timeout\n @read_timeout ||= READ_TIMEOUT\n ... |
1bdef7ae4f559cd8522454b3d6ab75d8 | The +new+ class method initializes Sambala. === Parameters :domain = the smb server domain, optionnal in most cases :host = the hostname of the smb server, may be IP or fully qualified domain name :user = the user name to log into the server :password = the password to log into the server === Example samba = Sambala.ne... | [
{
"docid": "a9cb2dcd2cc70c74b9bdd7990d23878c",
"score": "0.0",
"text": "def initialize(options={:domain => '', :host => '', :share => '', :user => '', :password => ''})\n $log_sambala = GlobaLog.logger(STDERR,:warn)\n\t\t@recurse = false\n\t\tbegin\n options[:init_timeout] = 1\n @options = ... | [
{
"docid": "733631a9e1860da8ba67f44257835232",
"score": "0.66427577",
"text": "def initialize(_host, _user, _password)\r\n @host = _host\r\n @user = _user\r\n @password = _password\r\n end",
"title": ""
},
{
"docid": "47639229f84f1058fa2f33f8ea519ef5",
"score": "0.6624949",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "08b538e780adc71842eb64cbe8bc5551",
"score": "0.0",
"text": "def portfolio_params\n #Map the number to the real property name\n params.require(:portfolio).permit(:tickers, :name, :description)\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... |
c596bb1b49af33e0a1e83be686be8a7c | GET /fake_dns_servers GET /fake_dns_servers.json | [
{
"docid": "9bf45d81288224435d5e14d5fdbd7aa9",
"score": "0.73480767",
"text": "def index\n @fake_dns_servers = FakeDnsServer.order('name')\n end",
"title": ""
}
] | [
{
"docid": "a329a046458371eb2e9f1c9bbbdf2c53",
"score": "0.693134",
"text": "def dns_servers\n @dns_servers\n end",
"title": ""
},
{
"docid": "a329a046458371eb2e9f1c9bbbdf2c53",
"score": "0.69307613",
"text": "def dns_servers\n @dns_servers\n end",
"title": ""
}... |
0a96d1239ced7ab70b27145a6cef8ff0 | Sat Feb 26 01:42:35 IST 2011, ramonrails | [
{
"docid": "9e557cd7e054bfa3f1f758684a4bf3cb",
"score": "0.0",
"text": "def before_save( event)\n # * remember the changes made to this model\n @_changes = event.changes\n end",
"title": ""
}
] | [
{
"docid": "93af71ad0983e4bf5a041705c48d1cca",
"score": "0.6925117",
"text": "def date_time; end",
"title": ""
},
{
"docid": "93af71ad0983e4bf5a041705c48d1cca",
"score": "0.6925117",
"text": "def date_time; end",
"title": ""
},
{
"docid": "93af71ad0983e4bf5a041705c48d1cca... |
a550d92bbfb746f38fe12c109a9f05a5 | new_caps_count_gt_100 returns the number of caps records that have pairs further than 1000 amino acids away | [
{
"docid": "7381049bc32f4523da8beba762854211",
"score": "0.8452618",
"text": "def new_caps_count_gt_1100\n NewCap.all(:seq_id => self.seq_id, :greater_than_1100_away => true).count\n end",
"title": ""
}
] | [
{
"docid": "f46dac22afd8ddac02e90e9fc085ad00",
"score": "0.87594783",
"text": "def new_caps_count_gt_1000\n NewCap.all(:seq_id => self.seq_id, :greater_than_1000_away => true).count\n end",
"title": ""
},
{
"docid": "46c8326815436756ec233bb9f5e77a9a",
"score": "0.8736133",
"text"... |
9fd9c98a48609b509e52bc6598add69d | PATCH/PUT /bpci_adjmnt_factor_rs/1 PATCH/PUT /bpci_adjmnt_factor_rs/1.json | [
{
"docid": "f37ec226d7cb740fc55b079c8496259e",
"score": "0.7298623",
"text": "def update\n respond_to do |format|\n if @bpci_adjmnt_factor_r.update(bpci_adjmnt_factor_r_params)\n format.html { redirect_to @bpci_adjmnt_factor_r, notice: 'Bpci adjmnt factor r was successfully updated.' }\n ... | [
{
"docid": "3b3b783406b88555760baabd0efe665e",
"score": "0.65199906",
"text": "def set_bpci_adjmnt_factor_r\n @bpci_adjmnt_factor_r = BpciAdjmntFactorR.find(params[:id])\n end",
"title": ""
},
{
"docid": "ae43bf63ec632b487451dd3da271862e",
"score": "0.60077786",
"text": "def ... |
b3dae74e133a689e0a09f526b22ca06e | sets options if we're creating a new row (+value.node?+ is true). since we need to set the authority first, our input needs to be readonly. | [
{
"docid": "0430a87d9e865b786cd2563f2fec24e2",
"score": "0.67539895",
"text": "def build_options_for_new_row(attribute_name, _index, options)\n super\n\n options[:readonly] = true\n options[:data] ||= {}\n options[:data][:autocomplete] = attribute_name\n end",
"title": ""
}
] | [
{
"docid": "1f430a90263f65f211cc455865e7abb1",
"score": "0.63096493",
"text": "def build_options_for_existing_row(_attribute_name, _index, value, options)\n options[:value] = \"#{value.rdf_label.first} (#{value.rdf_subject})\" || \"Unable to fetch label for #{value.rdf_subject}\"\n options[:readon... |
94cd7e1a973318fb78f241c3c5c72093 | Detect numeric data and denote it as a string: | [
{
"docid": "813879c414fd606b83f0ee56f40e775d",
"score": "0.58962214",
"text": "def is_literal_string(value)\n value !~ /^\\s*(\\.\\d+|\\d+[.\\d]*)\\s*$/\n end",
"title": ""
}
] | [
{
"docid": "f3a656c3dc4259d8dcc67e5ac2974bec",
"score": "0.69516736",
"text": "def get_data_type(data) # :nodoc:\n # Check for no data in the series.\n return 'none' unless data\n return 'none' if data.empty?\n\n # If the token isn't a number assume it is a string.\n data.each d... |
85f8b98c03810e264a957ccc7de5bc00 | append new user to credentials list | [
{
"docid": "cccbb570adec0e8ce099f263cc9afa6d",
"score": "0.0",
"text": "def write_user_credentials(username, password)\n File.open(credentials_path, 'a') do |users|\n users.write(Psych.dump(\"#{username}\": encrypt_password(password)))\n end\n clean_yaml\nend",
"title": ""
}
] | [
{
"docid": "15615f12ebb0d0452f615c789b4d77b5",
"score": "0.69405776",
"text": "def addToUserList\n $store << [@email,@username,@password]\n puts \"Added user to list\"\n print $store.to_s + \"\\n\"\n end",
"title": ""
},
{
"docid": "66a54de62501bb3da183aba00d6d0479",
... |
0ebf2f3a0044f4a92ca1a26cf5149994 | Increments stat by one, bucketing based on the timestamp. | [
{
"docid": "2313f923befb0b9fa0435c025aab94ee",
"score": "0.6303951",
"text": "def <<(stat, time_unit)\n incr stat, time_unit\n end",
"title": ""
}
] | [
{
"docid": "5f889d3e6177171241f182d20e985471",
"score": "0.7341635",
"text": "def increment(stat, sample_rate=1); count stat, 1, sample_rate end",
"title": ""
},
{
"docid": "6907fe5db9264dfdba6bb083efc6ad09",
"score": "0.73069364",
"text": "def increment(stat, sample_rate=1)\n ... |
502c9760ece8aed6b38b85a567d68980 | ADC A,d8 flags: Z 0 H C | [
{
"docid": "a3872874da12c5f876b70767046bca1d",
"score": "0.7966126",
"text": "def adc_a_d8\n end",
"title": ""
}
] | [
{
"docid": "7b95da77d8f2974adda0e68533dad83c",
"score": "0.69899887",
"text": "def adc_a_c\n end",
"title": ""
},
{
"docid": "e4c90d9e3f26e98751595a73392e085f",
"score": "0.68363297",
"text": "def adc_a_hl\n end",
"title": ""
},
{
"docid": "891a52c3cd65a507a4211... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "9be4a8473075ea324624b81cc2ae5ba1",
"score": "0.0",
"text": "def set_serasa\n @serasa = Serasa.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... |
50a42f80a12c90e7f690e961d08c0ca9 | include Google_places GET /users GET /users.json | [
{
"docid": "8b1dbac81472eff58cb602a4a1473ebb",
"score": "0.0",
"text": "def index\n @users = User.all\n end",
"title": ""
}
] | [
{
"docid": "543509c6588e2f79a8dbcd1cdcdaf7b9",
"score": "0.6915728",
"text": "def users\n try_json get('/user')\n end",
"title": ""
},
{
"docid": "d93b16473b577868d59cf95141aa5573",
"score": "0.68143004",
"text": "def google\n uri = \"https://www.googleapis.com/oauth2/v3/u... |
9918d0c34a1448ba641205fd5a6fecd8 | shows a given post based on its parameters, comments, and new comment field | [
{
"docid": "261bc0cc7141bab27ec34feca938b486",
"score": "0.68979704",
"text": "def show\n @post = Post.find(params[:id])\n @comments = @post.comments\n @comment = Comment.new if signed_in?\n end",
"title": ""
}
] | [
{
"docid": "a00e01052ab055530aa30cc15dbe1094",
"score": "0.7510447",
"text": "def show\n @comments = @post.comments\n @comment = Comment.new\n end",
"title": ""
},
{
"docid": "c676c7adca5c5808aa9a4553376415dd",
"score": "0.7404506",
"text": "def show\n @post = Post.find... |
63d693e7876c703504022dd76b58f65d | This Boardprint method is given for free and does not need to be modified It is used to make your game playable. | [
{
"docid": "3ab0eb0c81a2dffe327842b9ce795226",
"score": "0.0",
"text": "def print\n @grid.each { |row| p row }\n end",
"title": ""
}
] | [
{
"docid": "db19b159917b8ab68a35743477ca667b",
"score": "0.7555866",
"text": "def print_board\n\t\tputs \"GAME BOARD AT TIME: #{@current_turn}\"\n\t\tprint full_game_board.map{|c| c.join(\"\")}.join(\"\\n\")\n\tend",
"title": ""
},
{
"docid": "70e29f05861b0fb754bc074d0f190b16",
"score": ... |
d2055e8fa43325f28f677e2629d04329 | Write a header of a binary string whose size is _n_. Useful if you want to append large binary data without loading it into memory at once. For example, MessagePack::Packer.new(io).write_bin_header(12).flush io.write('chunk1') io.write('chunk2') is the same as write('chunk1chunk2'.encode(Encoding::BINARY)). | [
{
"docid": "10b84dc06c4f79c272f989dfee9d678f",
"score": "0.77475715",
"text": "def write_bin_header(n)\n end",
"title": ""
}
] | [
{
"docid": "6638e520c654d5e29948451b193eccb2",
"score": "0.6270642",
"text": "def write_header(f, block_size, blocks)\n f.seek(0)\n f.write([block_size, blocks].pack('N2'))\n end",
"title": ""
},
{
"docid": "e34d45a5728dc4c539690f56529036cb",
"score": "0.60733175",
"text... |
866367abfa6d4cc1a2cc3c7b8c410aac | Makes browsers not think site is sketchy when ssl turned off. Disable this when ssl back on | [
{
"docid": "9fd0928da9c14109ee650e1bb935256a",
"score": "0.0",
"text": "def expire_hsts\n response.headers[\"Strict-Transport-Security\"] = 'max-age=0' if\n Rails.env.production?\n end",
"title": ""
}
] | [
{
"docid": "eed6db95919573bc45cf7f72a507ad2e",
"score": "0.77507204",
"text": "def disable_ssl; end",
"title": ""
},
{
"docid": "4af03c8f9b8d5a2a3cc6fdd888e55abf",
"score": "0.7514594",
"text": "def force_ssl; end",
"title": ""
},
{
"docid": "4af03c8f9b8d5a2a3cc6fdd888e55... |
441ee69b2991482676c2b12008601aa0 | Prior to loading a page, this function will check if the enduser is logged in as a User. If they are not, it will redirect the to the Sign In page and require them to log in as a User. | [
{
"docid": "ccb49e7a33aee8339ade23bdae682447",
"score": "0.0",
"text": "def require_login\n unless signed_in?\n flash[:error] = \"You must be logged in to access this section\"\n redirect_to signin_url # halts request cycle\n end\n end",
"title": ""
}
] | [
{
"docid": "d973985f8873667bce051cf5e8fc06d3",
"score": "0.7798425",
"text": "def require_user\r\n if ##LOGIC##\r\n redirect_to '/user/sign_in'\r\n end\r\n end",
"title": ""
},
{
"docid": "2665fa79c69d9f920b270e19b030605e",
"score": "0.7780069",
"text": "def require_signi... |
c1f09587834be16d963343720ad15529 | POST /destinations POST /destinations.json | [
{
"docid": "f3d30628e7da41f10b8e51ffd0a8d7b4",
"score": "0.6823449",
"text": "def create\n @trip = Trip.find(params[:trip_id])\n @destination = @trip.destinations.new(destination_params)\n\n respond_to do |format|\n if @destination.save\n format.html { redirect_to trip_destination_p... | [
{
"docid": "0f0d64f95c51280925fd8526369e2046",
"score": "0.68324953",
"text": "def create\n @destination = Destination.new(params[:destination])\n\n if @destination.save\n render json: @destination, status: :created, location: @destination\n else\n render json: @destination.errors, st... |
8269e098828e0a0f0e5b59fe35d11ebb | Total Extent of Deaccessions | [
{
"docid": "1f028859460767943fc73de1ec129b05",
"score": "0.8118953",
"text": "def total_extent_of_deaccessions\n return @total_extent_of_deaccessions if @total_extent_of_deaccessions\n\n deaccessions = db[:deaccession].where(:accession_id => self.query.select(:id))\n deaccession_extents = db[:e... | [
{
"docid": "cfad2a48ab05b07330d1bacb2ef87f8b",
"score": "0.6585089",
"text": "def exabytes\n self * EXABYTE\n end",
"title": ""
},
{
"docid": "1b773618fe51ea5348bce2f35552ed1e",
"score": "0.6581664",
"text": "def extent_size\n pages_per_extent * page_size\n end",
"tit... |
a2ea09e5ab5e8d06d29e8583377a58ec | Given a class, try to extrapolate an appropriate queue based on a class instance variable or `queue` method. | [
{
"docid": "14c2955497b88b0314312246d7a48f66",
"score": "0.83217245",
"text": "def queue_from_class(klass)\n (klass.instance_variable_defined?(:@queue) && klass.instance_variable_get(:@queue)) ||\n (klass.respond_to?(:queue) and klass.queue)\n end",
"title": ""
}
] | [
{
"docid": "70215e4d4277ce9c1c33567213be1a07",
"score": "0.8246507",
"text": "def queue_from_class(klass)\n klass.instance_variable_get(:@queue) ||\n (klass.respond_to?(:queue) and klass.queue)\n end",
"title": ""
},
{
"docid": "70215e4d4277ce9c1c33567213be1a07",
"score": "0.824... |
e61587f5b60daa3ff551a196eb70056e | Get the Gravatar HTML for the value of Blog.email | [
{
"docid": "54513a451ca4770940ca78f8b9d50152",
"score": "0.72012913",
"text": "def gravatar_html(size = 140)\n style = {\n :height => \"#{size}px\",\n :width => \"#{size}px\",\n :background_image => \"url(#{gravatar_url(Blog.email, size)})\"\n }.to_a.map do |key,value|\n ... | [
{
"docid": "f7efedc65ce6e8bfe7ce3803dbe8af95",
"score": "0.7880807",
"text": "def gravatar\n mail = email || \"#{provider}_#{uid}\"\n hash = Digest::MD5.hexdigest(mail)\n \"http://www.gravatar.com/avatar/#{hash}?d=identicon\"\n end",
"title": ""
},
{
"docid": "e6525966bf81c2ed4aef0... |
43b50006f60534a24aae2b2fab824bbd | GET /option_sets/1 GET /option_sets/1.json | [
{
"docid": "78849a92e79eda0871294cebe7b163b0",
"score": "0.5962751",
"text": "def show\n authorize @option_set\n end",
"title": ""
}
] | [
{
"docid": "8e2e3c5359d82ba174703a6143c39e8b",
"score": "0.712095",
"text": "def index\n authorize OptionSet\n @option_sets = OptionSet.all\n end",
"title": ""
},
{
"docid": "0790f46eef64360abd77663fbcf97fd7",
"score": "0.67047864",
"text": "def index\n @options = Option.al... |
30ec1e60fb865f7c955936e818f48743 | Get a hash of new TorrentDataDelegate objects keyed by torrent infohash. This is the method to call to get information about the state of torrents being downloaded. | [
{
"docid": "3c4588db3e1dbd69a181067fde200866",
"score": "0.64672697",
"text": "def torrentData(infoHash = nil)\n # This will have to work by putting an event in the handler's queue, and blocking for a response.\n # The handler will build a response and return it.\n @handler.getDelegateTor... | [
{
"docid": "a6a3de33c1bfd0ef4dc2e39fcde2b052",
"score": "0.6440302",
"text": "def getDelegateTorrentData(infoHash = nil)\n # Use an immediate, non-recurring timer.\n result = {}\n return result if stopped?\n semaphore = Semaphore.new\n timer = @reactor.scheduleTimer(0, [:get_tor... |
3232d5ed4aad2904e7f24e9a498ff702 | Update audience name Update the name of the given audience created by a thirdparty integration. Sending a request to this endpoint does not trigger the rule engine. To update the audience&39;s members, use the [Update customer profile](tag/Customerprofiles/operation/updateCustomerProfileV2) endpoint. | [
{
"docid": "4aeba2491b799e8dfd3da30c31f5e377",
"score": "0.56734395",
"text": "def update_audience_v2_with_http_info(audience_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IntegrationApi.update_audience_v2 ...'\n end\n # veri... | [
{
"docid": "c87f1b7adc0a0257bed3af91a0de5d13",
"score": "0.6366258",
"text": "def audience= new_audience\n @audience = new_audience\n end",
"title": ""
},
{
"docid": "35d1bbf533fbeb23c3752686c159cf8f",
"score": "0.6287312",
"text": "def update_audience request_pb, options... |
43d76fd67a610f04e082141de5cc939a | PATCH/PUT /cards/1 PATCH/PUT /cards/1.json | [
{
"docid": "594d38662e36a95f13efe45f88b8233d",
"score": "0.7009726",
"text": "def update\n respond_to do |format|\n if @card.update(card_params)\n format.html { redirect_to @card, notice: 'Card was successfully updated.' }\n format.json { render :show, status: :ok, location: @card ... | [
{
"docid": "d8d0b4b63c9b4439627ebe60ea30f388",
"score": "0.74140495",
"text": "def update\n # @card = Card.find(params[:id])\n # @card.update(card_params)\n # render json: @card\n end",
"title": ""
},
{
"docid": "6a5dceefca34a24e4ef4235ad3bf489f",
"score": "0.7363... |
69a24d33f27e0bc02cb026145bd74003 | Returns the average marking time of the staff. | [
{
"docid": "cdbdfddde99f7df5bf4dda392447c1db",
"score": "0.7162025",
"text": "def average_marking_time\n @average_marking_time ||=\n if valid_submissions.empty?\n nil\n else\n valid_submissions.sum { |s| s[:published_at] - s[:submitted_at] } / valid_submissions.size\n end... | [
{
"docid": "0f7833db54bfb68039f8328d491af2b9",
"score": "0.64462286",
"text": "def average\n return @@average_times.inject(:+).to_f / @@average_times.size\n end",
"title": ""
},
{
"docid": "57abe669398b7a1841d153366da5328f",
"score": "0.643548",
"text": "def avg_time_spent\n\t\tt... |
8073ccf0ca3e0d74fbdcb60dd302f048 | Overriden method to fill key registery No returned code here because this is handled by getPCStub as key generation for RDA is done by bruteforce | [
{
"docid": "5a9532c95be9ff36a97400d904af4276",
"score": "0.6502472",
"text": "def fillKeyReg(keyReg, keyVal)\n @@keyReg = keyReg\n return \"\"\n end",
"title": ""
}
] | [
{
"docid": "c7aefa3d788236934c93369115a5154e",
"score": "0.64705735",
"text": "def generate_registration_key\n self.registration_key = 'C'.freeze + SecureRandom.base64(8)\n end",
"title": ""
},
{
"docid": "aae0dd62c8a3641ac05f651f6337a177",
"score": "0.63504493",
"text": "def gen... |
ecaefdf4b61a793e93cc5f80327df7e8 | Returns a percentile interval, i.e. the lower bound and the upper bound of the values that represent the x%interval for the bucketized dataset. A 90% interval means that 5% of the values would have been lower than the lower bound and 5% would have been higher than the upper bound, leaving 90% of the values within the b... | [
{
"docid": "ca9586b64e4febffab459484ce7ed33b",
"score": "0.79929364",
"text": "def percentile_interval(category, x)\n case x\n when Range\n lower, upper = percentile_indices(category, x.begin, x.end)\n Range.new(bucket_lower_bound(lower), bucket_upper_bound(upper))\n when Nu... | [
{
"docid": "913761793e411f1469ad76cc805eef4d",
"score": "0.6866369",
"text": "def percentile bin, rank\n ((count_less_than(bin,rank) + 0.5*frequency_of(bin,rank))/ total_num(bin) )*100.0 \n end",
"title": ""
},
{
"docid": "1bb4ab3d0290d8c782a1961c471d9295",
"score": "0.66054904",
... |
0db2d3f9c934b744251f1630d4ab743c | DELETE /dormitory_categories/1 DELETE /dormitory_categories/1.json | [
{
"docid": "ad214a3af3968f6eec367a5eb914c310",
"score": "0.7655954",
"text": "def destroy\n @dormitory_category = DormitoryCategory.find(params[:id])\n @dormitory_category.destroy\n\n respond_to do |format|\n format.html { redirect_to dormitory_categories_url }\n format.json { head :n... | [
{
"docid": "6b623e65133b8ddd83f927b20c7278d9",
"score": "0.75747734",
"text": "def destroy\n EconomicCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to economic_categories_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "46006e5c43a01d04f6e58fa0fd910734",
"score": "0.0",
"text": "def review_params\n params.require(:review).permit(:content, :rating)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
65452ce2a06235acc3c36f2346716491 | Append aliasing expression to SQL string. | [
{
"docid": "f72bbb94304886ad6211a449aec83f9f",
"score": "0.68790805",
"text": "def as_sql_append(sql, aliaz, column_aliases=nil)\n sql << ' AS '\n quote_identifier_append(sql, aliaz)\n if column_aliases\n raise Error, \"#{db.database_type} does not support derived column lists\" un... | [
{
"docid": "069c91aa6e8c55da9c67d247a71c2954",
"score": "0.8258795",
"text": "def aliased_expression_sql_append(sql, ae)\n literal_append(sql, ae.expression)\n as_sql_append(sql, ae.alias, ae.columns)\n end",
"title": ""
},
{
"docid": "a0e8f663e2162e8b6fa1406013f1f6f9",
"sco... |
3c86450bab7f827738f3826a1895bb2a | Raise one number to the power of another number | [
{
"docid": "2ac36574ff4dfb98baf819f33fe353bd",
"score": "0.7280186",
"text": "def power(a, b)\n return a**b\nend",
"title": ""
}
] | [
{
"docid": "ecfa643e45f01a6645143b5c684e47a7",
"score": "0.7970786",
"text": "def raise_to_power(x, y)\n #every shift left is like a * 2\n #11000\nend",
"title": ""
},
{
"docid": "c8a70f4eeb0e7d82b5dac3928e20a33b",
"score": "0.78095144",
"text": "def power(curr_value, to_power)\n ... |
c020376e1bfa1dc0b82125dc146ead2a | Check Input From Keyboard | [
{
"docid": "8575828564590c08536fe07b6260d3f1",
"score": "0.58715904",
"text": "def process_keyboard\n ACCEPTED_KEYS.each {|key|\n if Input.repeat?(key[0])\n c = (key[0] != :kSPACE) ? Keyboard.add_char(Ascii::SYM[key[0]]) : \" \"\n process_add(c)\n #Sound.play_ok\n pla... | [
{
"docid": "e4694707cff212e27f151383850c0e98",
"score": "0.69716513",
"text": "def get_key_down(char)\n STDIN.echo = false\n STDIN.raw!\n begin\n #reads input without blocking the thread\n #returns a string of pressed keys\n input = STDIN.read_nonblock(3)\n #check if the key was pressed\n... |
d9055a79a765f298da33918b93270eb0 | POST /doctors POST /doctors.json | [
{
"docid": "7705e6f9bf492c13a07fc41bb3e5c618",
"score": "0.58922845",
"text": "def create\n @doctor = Doctor.new(doctor_params)\n #@doctor = Doctor.new(params[:doctor])\n\n respond_to do |format|\n if @doctor.save\n log_in @doctor\n flash[:success] = \"Welcome to the NHS rota... | [
{
"docid": "3f7411fcb849219fdf74ee56e1acc21f",
"score": "0.7009636",
"text": "def create\n @doctor = Doctor.new(params[:doctor])\n\n if @doctor.save\n render json: @doctor, status: :created, location: @doctor\n else\n render json: @doctor.errors, status: :unprocessable_entity\n end... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "c185ed47a60d985c65611053ee48e075",
"score": "0.0",
"text": "def update!(**args)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
dde4ecf270f55eed0e221d5cfe0d4798 | patch new? to be the opposite of persisted | [
{
"docid": "c300d24cb338004fcaedd8eb9f22f14f",
"score": "0.7351662",
"text": "def new?\n !persisted?\n end",
"title": ""
}
] | [
{
"docid": "23dbf6642280c416d77197b6d9b4d7a7",
"score": "0.75855917",
"text": "def new?\n\t\t\t!@saved\n\t\tend",
"title": ""
},
{
"docid": "f4f2970c357a37fc0cb19d04c366a91b",
"score": "0.7538631",
"text": "def persisted?\n !new?\n end",
"title": ""
},
{
"docid": ... |
b72cded5b6ea270bdaaff3eb506680c3 | Returns array of molecule objects referring to substituents | [
{
"docid": "e5104b4944c063c69bb2de1eb1175d40",
"score": "0.7340022",
"text": "def getSubstituents(atom, parents)\n retAry = []\n @atoms[atom].each do | bond |\n if !parents.include? bond then\n retAry.push(copyMolecule(bond, atom))\n end\n end\n ... | [
{
"docid": "118bd807db70ff34a5253a428e101288",
"score": "0.5570473",
"text": "def species\n species = Array.new\n\n mobs.each do |mob|\n species << mob.specie\n end\n\n return species.uniq\n end",
"title": ""
},
{
"docid": "6f125e09114daedf82cfa484158d9e89",
"score": "0... |
f6f49c9242d2e1f658cd2957f4d5f0b1 | song should be able to know who its artist is | [
{
"docid": "8773048b420132ac8c459a7d9f8c2199",
"score": "0.0",
"text": "def artist_name\n if self.artist == nil\n nil\n else \n self.artist.name\n end\n end",
"title": ""
}
] | [
{
"docid": "02046ba3653aeed0fa71cb957d206fa7",
"score": "0.78862697",
"text": "def artist_name\n #if the song's artist exists, return the artist's name\n self.artist ? self.artist.name : nil\n end",
"title": ""
},
{
"docid": "dbe3164997b891d5fbb622804f494895",
"score": "0.77033275... |
89532513157af7a33276dca12c30b6c0 | Get Number of Lines to Show | [
{
"docid": "4f91a8e23c3485e7f3cdc5c39511c09b",
"score": "0.0",
"text": "def visible_line_number\n return 6\n end",
"title": ""
}
] | [
{
"docid": "49f65537b49df7cc98d92fa71ad60145",
"score": "0.8250345",
"text": "def count_lines\n @lines.length\n end",
"title": ""
},
{
"docid": "c712546771ed2f10aae674663659c708",
"score": "0.8116362",
"text": "def line_number\n @lines.size\n end",
"title": ""
},
... |
fe0be2908c7d7a98cbabbd02effec7c7 | DELETE /out_repertories/1 DELETE /out_repertories/1.json | [
{
"docid": "f65a99724615dfae92b97f9a84296af5",
"score": "0.74494845",
"text": "def destroy\n @out_repertory.destroy\n respond_to do |format|\n format.html { redirect_to out_repertories_url, notice: 'Out repertory was successfully destroyed.' }\n format.json { head :no_content }\n end\... | [
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.7071043",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "eda499d9336418ca2796b82b9f7d4935",
"score": "0.69631135",
"text": "def destroy\n @repertory.destroy\n respond... |
045074da0afc7934340ffce0fdffd95f | Add a static label to the screen | [
{
"docid": "b8b60d4b3fbb75e6a1d10e3aa5bd72ea",
"score": "0.570624",
"text": "def label(text, options = {})\n opts = {\n rgb: [255, 255, 255],\n loc: [0,0]\n }.merge(options)\n\n @curr_font.draw_blended_utf8(\n @buff, \n text, \n opts[:loc][0], opts[:loc]... | [
{
"docid": "0779042a20dbc9a932a26e14a7f5955e",
"score": "0.739148",
"text": "def add_a_label\n @label = UILabel.alloc.initWithFrame(CGRectZero)\n @label.text = \"Find the weather in:\"\n @label.color = BW.rgb_color(255, 255, 255)\n @label.sizeToFit\n @label.center = CGPointMake(@view_widt... |
80153edd1138276a64d40469224690c7 | Sleep until some 'str' String is sent to the output, | [
{
"docid": "49135a396cb65892ea101cfd8d8742fa",
"score": "0.8131648",
"text": "def sleep_until(str)\n @queue << \"sleep #{str}\"\n end",
"title": ""
}
] | [
{
"docid": "7e28782f37219f1210caf91b0066b566",
"score": "0.6972237",
"text": "def wait(str='Press ENTER to continue.')\n puts\n self.warning(str)\n STDIN.gets\n end",
"title": ""
},
{
"docid": "8a8072a312cf696efc2c3e364e8a4d7d",
"score": "0.6815673",
"text": "def wa... |
f8e079edc9e9c7eba8ec347c8d369a46 | A helper method to make the recursion work. | [
{
"docid": "50b378c2c6ee1199315affc821ada42f",
"score": "0.0",
"text": "def write_entries(entries, path, zipfile)\r\n entries.each do |e|\r\n zipfile_path = path == '' ? e : File.join(path, e)\r\n disk_file_path = File.join(@input_dir, zipfile_path)\r\n\r\n if File.dire... | [
{
"docid": "de76bcc464d7faf4d87154622495557a",
"score": "0.78770757",
"text": "def recursive => nil",
"title": ""
},
{
"docid": "cec8cdd07b9ddbe218324e492d764349",
"score": "0.6938556",
"text": "def recursive_solution\n\n end",
"title": ""
},
{
"docid": "bfcf730d9133d167... |
28a65ba5cfef89236e391196577c5669 | Find the existant document and returns the document object mapped to this class. ==== Examples Document.find(1) Document.find("abceef") Document.find(1, 2, 3) Document.find([1,2,3]) Document.find(1,:rev => 123456) Note that when the first argument is one of :first, :last or :all, this finder method requests a view name... | [
{
"docid": "91c2f44bc76cf20edb40814b409fb441",
"score": "0.6414833",
"text": "def find(*args)\n options = args.extract_options!\n case args.first\n when :first, :last, :all\n raise ArgumentError.new(\"Design name must be specified. \") unless args[1]\n raise Argume... | [
{
"docid": "7609a10b7b4633f3610a8e4db8e0a62b",
"score": "0.7600527",
"text": "def find_document(options)\n id = options[:id]\n name = options[:name]\n \n self.documents.find do |document|\n if id.not_nil?\n document.id == id\n elsif name.not_nil?\n doc... |
b1720cc5c6ffeda84718042e83be451a | GET /dataunits GET /dataunits.json | [
{
"docid": "e13b3a5e6225ced15fdced76940020d9",
"score": "0.67984027",
"text": "def index\n @dataunits = Dataunit.all\n end",
"title": ""
}
] | [
{
"docid": "fc7c68e5bca78316e4acf7a60b0eb56f",
"score": "0.7748599",
"text": "def foods_units\n get('/foods/units.json')\n end",
"title": ""
},
{
"docid": "78d2ec54867c1fe4cc267fbdfd791a1f",
"score": "0.72970974",
"text": "def index\n response = HTTParty.get(\"https://casa... |
1e8f76beb2f7ad3b6bc6580671bb4c83 | Require that the user is authenticated. | [
{
"docid": "d61b7732116a21fefa7538f421e2da63",
"score": "0.73602164",
"text": "def require_authentication\n\n if current_user.blank?\n redirect_to new_session_path\n return false\n end\n\n true\n\n end",
"title": ""
}
] | [
{
"docid": "f477ff7197f2f950f5a3722d119bccb0",
"score": "0.83042514",
"text": "def require_authenticated_user!\n unless signed_in?\n raise NotAuthenticatedError\n end\n end",
"title": ""
},
{
"docid": "1fa382e32c672bdea5a24e8b77fa7ecd",
"score": "0.81296945",
"text": "def... |
b25491aea6c49ba92300f77c3808a1c1 | PUT /folders/1 PUT /folders/1.json | [
{
"docid": "41fbfa4da33fb572f9c2014c86dd0f43",
"score": "0.6446047",
"text": "def update\n @folder = Folder.find(params[:id])\n if params[:folder_content_bookmarks].present?\n bms = params[:folder_content_bookmarks].split(/,/).map do |str|\n str.gsub(/bm_/, '').to_i\n end\n @... | [
{
"docid": "e02222f7effc4ddcdc1d02696685d0b9",
"score": "0.70633316",
"text": "def rename_folder(id,folder_name)\n self.class.put(\"#{url}/api/filesystem/folders/#{ERB::Util.url_encode(id)}/name\", basic_auth: @auth, body: {:name => folder_name}.to_json, headers: {'Content-Type' => 'application/json'... |
e00f2cb00fead85e975e42345a391e48 | save photo from "url" to "path" | [
{
"docid": "0cb513baa0d353c4f15df62e4c68ce29",
"score": "0.6783308",
"text": "def save_photo(file_path, url, agent = nil)\n begin\n File.open(file_path, 'w') do |output|\n if agent.nil?\n open(url) do |input|\n output << input.read\n ... | [
{
"docid": "d31c06409a6d7e68ee1e83eba0e72d9d",
"score": "0.8521905",
"text": "def save_photo(file_path, url)\n File.open(file_path, 'w') do |output|\n open(url) do |input|\n output << input.read\n end\n end\nend",
"title": ""
},
{
"docid": "bb1a6b98ca4dbc798a838153804a... |
eb545a2981b7fba107c455c149dd35d8 | rspec ./spec/conference_badges_spec.rb:58 conference_badges badge_maker should return a formatted badge rspec ./spec/conference_badges_spec.rb:68 conference_badges batch_badge_creator should return a list of badge messages rspec ./spec/conference_badges_spec.rb:71 conference_badges batch_badge_creator should not hardco... | [
{
"docid": "1ea7fc469642af50538856b29c0fcd1b",
"score": "0.0",
"text": "def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"title": ""
}
] | [
{
"docid": "7e052bfa0f334e1603e11156e96a0138",
"score": "0.6301124",
"text": "def test_compliance\n errors = []\n compliance = JSON.load(File.open \"./test_resources/compliance_suite.json\")\n compliance[\"group\"].each do |group|\n group[\"requests\"].each do |request|\n reqjson = ... |
727aa0035631117a3fb125594a2375d5 | allow a AASM::Base subclass to be used for state machine | [
{
"docid": "a3a5986cd85a3cbfa21a7450b27cfd7b",
"score": "0.0",
"text": "def with_klass=(_arg0); end",
"title": ""
}
] | [
{
"docid": "121c5d8ec0aec6c4568d80fdf7f832b7",
"score": "0.6401368",
"text": "def next_state_class\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "a2f4583041942b349af722a61e7a820f",
"score": "0.63031584",
"text": "def inherited(subclass)\n subclass.inh... |
03e8544c1121e466cb74486e4298d278 | Doesn't work right now | [
{
"docid": "e39531dae1fd95d2c4801951d072e5d4",
"score": "0.0",
"text": "def strip_numbers_of_characters\n company.office_phone = office_phone.to_s.gsub(/\\D/, '')\n company.fax_phone = fax_phone.to_s.gsub(/\\D/, '')\n end",
"title": ""
}
] | [
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.6533951",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.649507",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "04e074efc99de627... |
ef8420295e8b5bece6dfd2f6799f41a8 | Params: database: AddressBook::Database file_path: string path to a .csv file | [
{
"docid": "a771fea8b88a44b6ba97e509cb607852",
"score": "0.66712284",
"text": "def initialize(database, file_path)\n @file_path = file_path\n @entries = database.entries\n validate_csv_header\n end",
"title": ""
}
] | [
{
"docid": "1e344ca5eb46c4caa971336e861a1aeb",
"score": "0.6765682",
"text": "def import_from_csv(file)\n entries = Keybox::Convert::CSV.from_file(file)\n entries.each do |entry|\n @db << entry\n end\n hsay \"Imported #{entries.size} records from #{file}.\", :information\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0c5e11bb7156f59164c1965eb7b6ecee",
"score": "0.0",
"text": "def cta_cte_params\n params.require(:cta_cte).permit(:matriculacion_id, :nro_cta_cte)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6981269",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783559",
"text": "def strong_params\n params.requi... |
61bc79006be00d259f33b2059e9f9a5f | Returns true if the piece is black. | [
{
"docid": "00cfee9914e09c2817f60910520df26c",
"score": "0.79379207",
"text": "def black?\n color == :black\n end",
"title": ""
}
] | [
{
"docid": "5e4b754cb71f6f88ba36b5cb00453aab",
"score": "0.81386006",
"text": "def black?\r\n BLACK == @colour\r\n end",
"title": ""
},
{
"docid": "ef7e8302707283336ed8c762e9fe3e98",
"score": "0.8024763",
"text": "def piece_is_black?(piece)\n\tpiece === piece.downcase\nend",
... |
98a55dc7bfa460d4a36d3f5179300d29 | returns array of migration paths | [
{
"docid": "597cce9533d6dbb13ffac229edb81f30",
"score": "0.0",
"text": "def load_input_manifest(manifest_path)\n manifest, version = load_manifest(manifest_path, false)\n return manifest\n end",
"title": ""
}
] | [
{
"docid": "561012fc953d41dfcf3a33c807d2c21d",
"score": "0.80394477",
"text": "def migrations_paths; end",
"title": ""
},
{
"docid": "561012fc953d41dfcf3a33c807d2c21d",
"score": "0.80394477",
"text": "def migrations_paths; end",
"title": ""
},
{
"docid": "561012fc953d41df... |
98ae471d8008e3b91a4ea500da5d4f91 | Get one organization field Returns data about a specific organization field. | [
{
"docid": "12bafc7c7fec7e9b44c56c93da24501a",
"score": "0.56020904",
"text": "def organization_fields_id_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OrganizationFieldsApi.organization_fields_id_get ...\"\n end\n ... | [
{
"docid": "c6f3180a963d1e1e89152500ba99ac96",
"score": "0.7863929",
"text": "def organization_field(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"organizationFields/#{id}\", params)\n end",
"title": ""
},
{
"docid": ... |
42c03d49662b754ba6ffee637a108451 | Test getting comments for an ID returns JSON. | [
{
"docid": "84290182dd74df18711bfa9c59fd12eb",
"score": "0.66955084",
"text": "def test_get\n get \"/comments/foo\"\n assert_equal( 200, last_response.status, \"We got a 200 response\" )\n\n assert( last_response.body =~ /^comments\\(\\[/, \"The result looked like JSON\" )\n end",
"title":... | [
{
"docid": "02345f4cc2cd87903e94238ba458b5a5",
"score": "0.78732425",
"text": "def fetch_comments(id)\n @test_comments[id]['comments']\n end",
"title": ""
},
{
"docid": "7d8975f1896760dd2b18e1c0681abe86",
"score": "0.7596835",
"text": "def get_comment(id)\n object_from_res... |
a52e491a7b8d3e5aa5d211c5f552be86 | Get the text of the token | [
{
"docid": "f45dc3fc5eebdcc8325a5f98389dea5e",
"score": "0.6265969",
"text": "def get_text\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "f08f0be90329dcdeadb1fb03a3b525d3",
"score": "0.9156246",
"text": "def getTokenText()\r\n return @curr_token.text\r\n end",
"title": ""
},
{
"docid": "55642666f215662b8936a12d2a09de7a",
"score": "0.7889426",
"text": "def extracted_text\n tokenstream.text\n end"... |
414e24af33e30176f3b47651c6257b33 | Execute code that requires a FDW server/user mapping The server name is given by the method `server_name` | [
{
"docid": "ea0b04573747f0804031bb4e7eaf7d42",
"score": "0.57439405",
"text": "def with_server\n # Currently we create temporary server and user mapings when we need them,\n # and drop them after use.\n log \"Creating Server\"\n fdw_create_server server_name\n log \"Cr... | [
{
"docid": "8c4a07e95110ff73e7b23ef523e235d9",
"score": "0.5696666",
"text": "def usermap_exploit\n\t\tprint_status(\"Exploit Samba 'username map script' Command Execution (3.0.20 through 3.0.25rc3)\")\n\t\tprint_caution(\"Provide Target IP: \")\n\t\tzIP=gets.chomp\n\n\t\tpayloadz=[ '1' => 'cmd/unix/bin... |
1b0b31dc9c903dbaa95c401711c268e0 | Return information about the room or room instance if it is active. | [
{
"docid": "3d47c205ebb2fb11f52574a97dc4dcaa",
"score": "0.66066015",
"text": "def getRoomInfo(room)\n if room.include? '/'\n instance = room\n else\n instance = @roomInstance.gsub(/#room#/, room)\n end\n data = RTC::http_get(\"#{@baseURL}app/account?instanc... | [
{
"docid": "c508b4666f80cee208133d51b428ce87",
"score": "0.71838766",
"text": "def room\r\n return @room || Room.inactive_room\r\n end",
"title": ""
},
{
"docid": "d0eb015736b89270172f99b2ac918eee",
"score": "0.6665807",
"text": "def current_room\n room\n end",
"tit... |
5154b0de4d71ac4322be40fe0e5dca88 | GET /contents/new GET /contents/new.xml | [
{
"docid": "4bf0cd07db89da43032f919d9bfb94fa",
"score": "0.68719894",
"text": "def new\n @content = Content.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @content }\n end\n end",
"title": ""
}
] | [
{
"docid": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.69407374",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"title": ""
},
{
"docid": "463c06f6aa54bc289b5ecbc4050013c6",
"score": "0.... |
b724ca343c6b7c4c4a8206661d6dab70 | GET /posts GET /posts.json | [
{
"docid": "cc81a3db00fec919fc6c2c900fc18c23",
"score": "0.0",
"text": "def index\n @posts = Post.all.order(created_at: :desc)\n end",
"title": ""
}
] | [
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.78659517",
"text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"title": ""
},
{
"docid": "9e4bfaa87507d05255fbaeadc1ecb1d6",
"score": "0.74962544",
"text": "def index\n @posts = Post.al... |
58c898ea807badd790196eb42cf7003a | GET /recurring_tasks/1 GET /recurring_tasks/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "5a1b8d72d8ba92a4fa4255b53dbe02f2",
"score": "0.75315917",
"text": "def index\n @recurring_tasks = RecurringTask.all\n end",
"title": ""
},
{
"docid": "b3ed1a9d969aaaafbb6db5c3e5becb6e",
"score": "0.7189134",
"text": "def set_recurring_task\n @recurring_task = Rec... |
7712c18e92e5b92490329b4d1bd56a63 | GET /cryptocurrencies or /cryptocurrencies.json | [
{
"docid": "fa4ef8914e6a2ae9f1f65378c7290043",
"score": "0.6617004",
"text": "def index\n @cryptocurrencies = Cryptocurrency.all\n require 'net/http'\n require 'json'\n @url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=100&CMC_PRO_API_KEY=8e364003-38f2... | [
{
"docid": "3349022ac48527bf07a5c0b06822da6b",
"score": "0.73078305",
"text": "def list_coins\n endpoint = \"#{HOST}/v1/cryptocurrency/map\"\n get(endpoint)\n end",
"title": ""
},
{
"docid": "dc6645ed0f0577a4a97feaeb23e3cb1d",
"score": "0.72700304",
"text": "def get_currencies... |
580b1623a08a1485523048d0b0af2944 | DELETE /system_site_maps/1 DELETE /system_site_maps/1.json | [
{
"docid": "c30ab0441a06baf1a22ffc22efe54728",
"score": "0.7905609",
"text": "def destroy\n @system_site_map = SystemSiteMap.find(params[:id])\n @system_site_map.destroy\n\n respond_to do |format|\n format.html { redirect_to system_site_maps_url }\n format.json { head :no_content }\n ... | [
{
"docid": "c021ebec4a8d99b10bd5dbfcfe32b974",
"score": "0.7229023",
"text": "def destroy\n @map.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f763f7278035471287a1179fa070c63b",
"score": "0.72063464",
"te... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ecb84a702843c976e20f5a2fbcf4805b",
"score": "0.0",
"text": "def set_topic_quiz\n @topic_quiz = TopicQuiz.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... |
4221e7c73490ef9a7c6ed9c27f830ebc | We need to define our initialize method to take in a hash of named, or keyword, arguments. Here, we define our method to take in an argument of options, which defaults to an empty hash. We expect new to be called with a hash, so when we refer to options inside the initialize method, we expect to be operating on a hash.... | [
{
"docid": "723c1a5f891e78f838f70df6af997fc4",
"score": "0.76878774",
"text": "def initialize(options={})\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n end",
"title": ""
}
] | [
{
"docid": "547d76ed391f8c19ba55636009868f4d",
"score": "0.8446004",
"text": "def initialize(options={})\n options.each do |property, value| # We iterate over the options hash and use #send method to interpolate the name of\n # each hash key as a method that we set equal to that key's value.\n ... |
4b3389b6e2fcf3ff4c63d828b546af3d | this accepts subuser array | [
{
"docid": "df319cf66cf49f8395c11c26481abfbc",
"score": "0.5707018",
"text": "def create_sub_user_account(apikey, users)\n users.each do |user, data|\n #load users\n run_sendgrid_query(apikey) do\n @client.sub_user.management.add(data[:account].merge!(:username => user))\n end\n... | [
{
"docid": "41ba3b7ee837281abd2150f7822bae6c",
"score": "0.62653524",
"text": "def subuser # name and position\n if (session[:current_proj] == \"-1\")\n render json: \"\"\n return\n end\n @project = Project.find(session[:current_proj])\n @subtask = Subtask.find(params[:... |
dc19671711e958264a831659366c13b8 | Select which tokens survive in a phrase. Also passes each token though norm_term. Tokens matching lparen and rparen are dropped. | [
{
"docid": "758df69dad230c090008e1ccada3782e",
"score": "0.7405503",
"text": "def norm_phrase_tokens( tokens )\n tokens.\n reject { |t| @lparen === t || @rparen === t }.\n map { |t| norm_term( t ) }\n end",
"title": ""
}
] | [
{
"docid": "a25d0f52fc3aebf6e493df1b55759495",
"score": "0.57820433",
"text": "def tokenize\nterms = self.gsub(/(\\s|\\d|\\W)+/u,' ').rstrip.strip.downcase.split(' ')\nterms.reject!{|term| @@stop_words.include?(term) || term.length < 3}\nterms\nend",
"title": ""
},
{
"docid": "ed1be5f99329fa... |
430b79ef7a077593078e232470bb9c49 | POST /uploaded_files POST /uploaded_files.xml | [
{
"docid": "1d2c3ddac5bc239607b35b3999c9e03f",
"score": "0.0",
"text": "def create\n return error_status(true, :cannot_create_uploaded_file) unless (UploadedFile.can_be_created_by(@logged_user, @page))\n \n calculate_position\n \n # Make the darn note\n @uploaded_file = @page.uploaded_... | [
{
"docid": "df75a317cad035d14f16da40bde4f5a9",
"score": "0.7024415",
"text": "def upload_xml_file(file_name, xml)\n # Creates directory if it doesn't exist\n create_upload_dir\n # Save file to server's uploads dir\n file_to_upload = File.open(Rails.root.join('public', 'uploads', file_name), ... |
767e796dbd59640e1337d94439bc3319 | shamelessly riped from authlogic | [
{
"docid": "63b8b2bc6754d4f6f44b6ab2aaa17423",
"score": "0.0",
"text": "def db_setup?\n begin\n column_names\n true\n rescue Exception\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "04e65379635e1f61d3b229b5726ee84f",
"score": "0.72828954",
"text": "def auth; end",
"title": ""
},
{
"docid": "40b17ba3964f4ba4f442bae38facb4df",
"score": "0.71158993",
"text": "def auth; {}; end",
"title": ""
},
{
"docid": "6abf0f78c22a87a9aec78ac6b0ddcf5f",
... |
6e69d3becd7dd4a57899c9808b1e988c | DELETE /groups/1 or /groups/1.json | [
{
"docid": "12883a1bfdfcba20a6abeb31f56fc0d9",
"score": "0.0",
"text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html { redirect_to groups_url, notice: \"Group was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "6bcedfe965043af5e8a2fb7e281d0626",
"score": "0.7957243",
"text": "def destroy\n @group = @dataset.groups.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to dataset_groups_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj =>... |
bdbf3ebdfbd02d630d1ee296feb96664 | Adjust the X placement by dodge offset | [
{
"docid": "f5f7316306dccbd3d50f42987435e9f1",
"score": "0.7837021",
"text": "def apply_x_dodge_offset(val)\n @offset = 0 if @offset.nil?\n val += (get_direction == 8 ? @offset : get_direction == 6 ? -(@offset) : 0)\n return val\n end",
"title": ""
}
] | [
{
"docid": "6621efdc82eb62be9c0892862d43cdd0",
"score": "0.77530813",
"text": "def update_dodge_offsets\n self.x = apply_x_dodge_offset(self.x)\n self.y = apply_y_dodge_offset(self.y)\n end",
"title": ""
},
{
"docid": "1eb96409ec5d0ab3a7a0be8df5394c0e",
"score": "0.62086725",
... |