query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e4c421bc366f67782ac6174b4cd9ca00
Needs object for copyright info
[ { "docid": "1a3d612e5a0c4a56dfecf27279085235", "score": "0.0", "text": "def image_info(image, object, original: false)\n notes = []\n notes << tag.div(image_owner_original_name(image, original),\n class: \"image-original-name\")\n notes << tag.div(image_copyright(image, obje...
[ { "docid": "22e4fabe9040476fac183f7b17cba0b9", "score": "0.74352974", "text": "def copyright\n fetch_metadata 'Copyright'\n end", "title": "" }, { "docid": "5deaeedeb7cf46763d31b427d57855f8", "score": "0.7303564", "text": "def generate_copyright\n self.copyrighted = true\n ...
25496a61bc1fc712c80bf5031f17e617
Get the URL of the current page
[ { "docid": "b94916945c37a47384b3cedf3bed26f5", "score": "0.7808778", "text": "def current_url; end", "title": "" } ]
[ { "docid": "42619e7d5069b12a2d65385831b506e9", "score": "0.886142", "text": "def current_url\n page.current_url\n end", "title": "" }, { "docid": "42619e7d5069b12a2d65385831b506e9", "score": "0.886142", "text": "def current_url\n page.current_url\n end", "title": ...
6c29ab903904e7396493f0de9307284f
This method is necessary method for declarative_authorization to determine roles Roles returns e.g. [:admin]
[ { "docid": "b94c3b98ee3c64384c0275cfb3eed485", "score": "0.0", "text": "def role_symbols\n [self.user_role.downcase.to_sym]\n end", "title": "" } ]
[ { "docid": "9147a317b9c269839f3064f4ba28cc5e", "score": "0.78918016", "text": "def roles\n roles = []\n roles << 'super' if is_super\n roles << 'coordinator' if is_coordinator\n roles << 'committer' if is_committer\n roles << 'uploader' if is_uploader\n roles << 'viewer' if is_viewer\n...
0553979fe51fee9274e11e35562893f2
You must define here your global hash revision logic To customize the data loaded from the given file, change the hash values, by the appropriate values You can remove or modify every key into the hash, except those defined in default_hash, the importer requiere this structure
[ { "docid": "b974c8e51ace11aa13ca212bd80e1f88", "score": "0.0", "text": "def before_make row\n end", "title": "" } ]
[ { "docid": "3e57fd5316d7b1b3f47ddd1aa8ed3b8b", "score": "0.65124744", "text": "def import_hash(hash) \n ref = {}\n openurl_keys = [\"url_ver\", \"url_tim\", \"url_ctx_fmt\"]\n hash.each do |key, val|\n if openurl_keys.include?(key) \n next # None of the...
203c4f760446c5c6860b467fc26f148d
tabulates total number of bugs for a given device. Takes singular integer input or array input
[ { "docid": "dbe4d7df28fbd073ba4201bece0fdb1a", "score": "0.73215955", "text": "def devices_bugs(devices)\n\t\tbugs = 0\n\t\t@bugs.each do | row |\n\t\t\tif devices.include?(row[1])\n\t\t\t\tbugs += 1\n\t\t\tend\n\t\tend \n\t\t@bugs_per_device = bugs\n\t\treturn bugs\n\tend", "title": "" } ]
[ { "docid": "c6fccd19d6637cf4512c83cf555b8c91", "score": "0.59737104", "text": "def get_counts\n\t\t@counts = []\n\t\tcheck_counts(@puzzle_array)\n\t\tnew_array = @puzzle_array.transpose\n\t\tcheck_counts(new_array)\n\tend", "title": "" }, { "docid": "51ac1c664db289d91255930c520d0fa6", "s...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c8284ce34627c4c7fcd98504085f9f1c", "score": "0.0", "text": "def set_registration_form\n @registration_form = RegistrationForm.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...
1e9366d0f112f956aace6f612d275fea
Bubble sort Method takes an array as a parameter Passes through array multiple times If value is greater than next value in array, the values are swapped Loop ends when no swaps are made in a pass Method returns sorted array
[ { "docid": "59ff422d4dd46a4c9c51460f150fd80d", "score": "0.8550014", "text": "def bubble_sort(arr)\n\tloop do \n\t\tswap_flag = false\n\t\t(arr.length - 1).times do |n|\n\t\t\tif arr[n] > arr[n + 1]\n\t\t\t\tarr[n], arr[n+1] = arr[n+1], arr[n]\n\t\t\t\tswap_flag = true\n\t\t\tend\n\t\tend\n\n\t\tif swap...
[ { "docid": "22dd347fa99a03cee3e9f4f142026f45", "score": "0.87100005", "text": "def bubble_sort(array)\n\t#outer loop keeps track if something was swapped or not\n\tloop do \n\t\tswapped = false\n\t\t#inner loop swaps numbers that aren't in order\n\t\t(array.length-1).times do |i|\n\t\t\t#take each pair ...
1b3cc16045e692c28fad25d848a3c81b
Returns pagination info for collections
[ { "docid": "89e4c2f1c0c6d0af673f72f064d10a16", "score": "0.72953767", "text": "def meta_for_collection collection\n {\n :total_pages => collection.total_pages,\n :current_page => collection.current_page,\n :page_size => collection.per_page,\n :total_entries => collectio...
[ { "docid": "b27ece1d5eecd1642f1d627730876954", "score": "0.7751127", "text": "def meta_pagination\n {\n itemsCount: collection.total_count,\n pagesCount: collection.total_pages\n }\n end", "title": "" }, { "docid": "a3b28190dd23babc5d4776a913e9d7bc", "score": "...
51d8eed195bc53494841cacb63bb0039
If an existing group milestone used the IID claim the IID back and set the group milestone to use one available This is necessary to fix situations like the following: Importing into a user namespace project with exported group milestones where the IID of the Group milestone could conflict with a project one.
[ { "docid": "cbaba34f5f75802d64d5fa37be625be9", "score": "0.82817197", "text": "def claim_iid\n # The milestone has to be a group milestone, as it's the only case where\n # we set the IID as the maximum. The rest of them are fixed.\n milestone = project.milestones.find_by(iid: attrib...
[ { "docid": "3f41ef83a4b37dcc4c6763fbfd86cdff", "score": "0.607434", "text": "def group_milestones_applied_to_issues\n Milestone.joins(:issues)\n .where(\n issues: { project_id: project.id },\n group_id: old_group.id\n )\n end", "title": "" }, { "docid"...
5a06cd363efc7d07994a5f6393c0749f
POST /formulas POST /formulas.json
[ { "docid": "dc25eb6be70a6723664bcca7550557a1", "score": "0.6755874", "text": "def create\n @formula = Formula.new(params[:formula])\n\n respond_to do |format|\n if @formula.save\n format.html { redirect_to @formula, notice: 'Formula was successfully created.' }\n format.json { r...
[ { "docid": "26efae08af14c361f88835f1cd86e925", "score": "0.6643973", "text": "def create\n @formula = Formula.new(formula_params)\n\n respond_to do |format|\n if @formula.save\n format.html { redirect_to @formula, notice: 'Formula was successfully created.' }\n format.json { ren...
c5035e0bf7d8398de49c7c87ff3c63aa
Lists files under a specific folder on tape of pools, specific for Active and Offline. API Key Scope: on_tapes_files / index
[ { "docid": "0617da70a7a4446e455db6b495e0e8e6", "score": "0.0", "text": "def on_tapes_files_children_by_pool(pool_id, file_parent_id, opts = {})\n data, _status_code, _headers = on_tapes_files_children_by_pool_with_http_info(pool_id, file_parent_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "ece649cd0ac9352e9373c8b606c527cc", "score": "0.6725077", "text": "def list_file\n result = @client.execute(\n api_method: drive.files.list\n )\n notify \"LIST RESULT : #{result.data.inspect}\" \n result.data.items.each do |item|\n if item.mime_type =~ %r{a...
e47e54f3bc611f10bea8ac2db989e7bb
SPLAT This method has a splat for people You can invoke it with: greet_people("Hello", "Alice", "Adam", "Chris")
[ { "docid": "66d2b2cab331caeb31b131729be45f99", "score": "0.80600077", "text": "def greet_people(greeting, *people)\n\tpeople.each {|person| puts \"#{greeting} #{person}\"}\nend", "title": "" } ]
[ { "docid": "b5c6645aaa03160e9413683fa1ed27cd", "score": "0.71387", "text": "def greeting(hello, *names) ### *name is a splat argument, takes several parameters passed in an array\n\t\t return \"#{hello}, #{names}\"\n\t\tend", "title": "" }, { "docid": "7bdbecdaeca19197acc500077a7d0e31", ...
824f99398f2ebbb33a21af43ab751504
Tests Automatonadjacent_states on examples
[ { "docid": "c331ca45dd2b407bc6d05ac0742565a8", "score": "0.8261264", "text": "def test_adjacent_states_on_examples\n assert_equal(@small_dfa.ith_states(1,2), @small_dfa.adjacent_states(0).sort)\n assert_equal(@small_dfa.ith_states(0,1,2,3), @small_dfa.adjacent_states(1).sort)\n assert_equ...
[ { "docid": "10ee468998e5c0e067c82f9fde05b55a", "score": "0.795971", "text": "def test_in_adjacent_states_on_examples\n assert_equal(@small_dfa.ith_states(2), @small_dfa.in_adjacent_states(0).sort)\n assert_equal(@small_dfa.ith_states(0,1), @small_dfa.in_adjacent_states(1).sort)\n assert_e...
d18cfce58f36e185bd91767820322253
end of grammerChecker method
[ { "docid": "99f500c6d01d5afe8add300ae815c814", "score": "0.54202837", "text": "def checkTo\n\n #Keep it simple and add all the bells and whisles After\n if @@grammerToArray[0].to_s == \"to\"\n\n #check if the end is valid\n if checkEnd\n\n puts \"to <plot_cmd> end\" #add this to an array\n\...
[ { "docid": "0bf0e9f4d877fd2787f6cc037717320b", "score": "0.6888139", "text": "def test_check_grammar\n # TODO\n # output = \"The old man loves you. The man the apples.\".check_grammar do |sentence|\n # \"<ungrammatical message=\\\"\\\" suggestion=\\\"\\\">#{sentence}</ungrammatical>\"\n #...
8ca25567ad8bf2dd4729412e81e2e2eb
Delete Infra Segment Monitoring Profile Binding Profile API will delete Infra Segment Monitoring Profile Binding Profile.
[ { "docid": "279d6cc6f43b3a0b5318bf5a4d747272", "score": "0.0", "text": "def delete_infra_segment_monitoring_binding_0(infra_segment_id, segment_monitoring_profile_binding_map_id, opts = {})\n delete_infra_segment_monitoring_binding_0_with_http_info(infra_segment_id, segment_monitoring_profile_bindi...
[ { "docid": "7339db550b04c263e1d8c74fbf2b072f", "score": "0.6255602", "text": "def delete_tier1_flood_protection_profile_binding_with_http_info(tier1_id, flood_protection_profile_binding_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySec...
177779b5e8c515e7c0f2601f4ee4d62b
What version of HTTP the client is using.
[ { "docid": "b239bea54dc1dd00fe46aebb61be7422", "score": "0.7904329", "text": "def http_version\n @http_version ||= [\n 'HTTP_VERSION',\n 'SERVER_PROTOCOL',\n ].map{ |x| rack_environment[x] }.find.first.to_s.split('/').last\n end", "title": "" } ]
[ { "docid": "1b624674ddcc57e1907d369540fdbceb", "score": "0.82119644", "text": "def http_version\n env['HTTP_VERSION'] || env['SERVER_PROTOCOL'] || 'HTTP/1.0'\n end", "title": "" }, { "docid": "c0535bc506b76317d4f3ee5b4e692903", "score": "0.81528", "text": "def http_major; end...
59c914685a782745679cab32ef1e34d2
Advertise the services provided by this agent === Return true:: Always return true
[ { "docid": "e44d6646f4dc2b33980bb06b1c0618d5", "score": "0.7302125", "text": "def advertise_services\n reg = Register.new(@identity, @registry.services, status_proc.call, self.tags, @shared_queue)\n RightLinkLog.info(\"SEND #{reg.to_s}\")\n @amq.fanout('registration', :no_declare => @opti...
[ { "docid": "bf3a0fe0641f6ad55edfa3403e55c9dc", "score": "0.6262304", "text": "def service_arap?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_ARAP)\n return false\n end", "title": "" }, { "docid": "3a7a1293f6eb45a35d23440ce5557d9b", "score": "0.62208056", "text...
7cedbd5603d7ff86956d76843f3f064a
Restart IC and SN
[ { "docid": "b98d294221b077f4a8b9b3bc384fc7a8", "score": "0.0", "text": "def reloadServiceNanny\n puts \"restart service-nanny\"\n if File.exists?('/mnt/var/run/service-nanny/service-nanny.pid')\n sudo '/etc/init.d/service-nanny restart'\n else\n sudo '/etc/init.d/service-nanny start'\n end\nen...
[ { "docid": "13406c79c9aa400236f5b4ec2eea4f82", "score": "0.7427329", "text": "def restart()\n shutdown()\n start()\n end", "title": "" }, { "docid": "010be943b65eb23179bb9e3ed028f29e", "score": "0.7362206", "text": "def restartcmd\n end", "title": "" }, { "docid":...
2ce4d44b848a2dd3934a1213065c57c8
Train on vector list
[ { "docid": "41cae0b44066a34f3a068e3737114917", "score": "0.8018925", "text": "def train vec_lst, debug: false\n # Two ways here:\n # - Batch: canonical, centrs updated with each vec\n # - Parallel: could be parallel either on simils or on training (?)\n # Unsure on the correctness of...
[ { "docid": "a485479c1203b9531aff15c1df5d8084", "score": "0.68075264", "text": "def train\r\n\t\t#Do data splitting\r\n\t\tdata = trainingData\r\n\t\ttrainData\t= data.segregate trainingDataAsArray, true\r\n\t\t@lr\t= Liblinear.train(\r\n\t\t\t{solver_type: self.class.findKernel(@kernel) },\r\n\t\t\ttrai...
d1081e7693fb8d1760c1f611573bb0bd
Add the following methods in the LineAnalyzer class. initialize() taking a line of text (content) and a line number calculate_word_frequency() calculates result
[ { "docid": "836434608396d861a3323ff58f5bb3a9", "score": "0.7863952", "text": "def initialize(content, line_number)\n @content = content\n @line_number = line_number\n @highest_wf_count = 0\n @highest_wf_words = []\n calculate_word_frequency()\n end", "title": "" ...
[ { "docid": "6d03c1c396320e48d7da0ff024ec91ba", "score": "0.8594501", "text": "def initialize(content, line_number)\n #Implement the initialize() method to:\n #* take in a line of text and line number\n #* initialize the content and line_number attributes\n #* call the calculate_word_frequenc...
6781d8fb4e707da22811997015bd3d3e
DELETE /town_types/1 DELETE /town_types/1.xml
[ { "docid": "0c58a0c44bacd1503d8f92452d616b66", "score": "0.7537281", "text": "def destroy\n @town_type = TownType.find(params[:id])\n @town_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(town_types_url) }\n format.xml { head :ok }\n end\n end", "title": "...
[ { "docid": "df8fa9cdd855f4f70d1575324d57ffdd", "score": "0.7190813", "text": "def destroy\n @moto_town_type = MotoTownType.find(params[:id])\n @moto_town_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_town_types_url) }\n format.xml { head :ok }\n end\n e...
d92c6f2381981025d97fffeb09dc5faa
A method to reverse the words in a sentence, in place.
[ { "docid": "face85a3e7bd0c01302cc831c6da94f6", "score": "0.0", "text": "def reverse_sentence(my_sentence)\n return nil if my_sentence.nil?\n return my_sentence if my_sentence.length == 0\n\n string_reverse(my_sentence)\n reverse_words(my_sentence)\n return my_sentence\nend", "title": "" } ]
[ { "docid": "57951a0a5bd49f69f8d890efe5ed93f1", "score": "0.88038254", "text": "def reverse_words(sentence)\n split_sentence = sentence.split(\" \")\n split_sentence.each do |word|\n word.reverse!\n end\n split_sentence.join(\" \")\nend", "title": "" }, { "docid": "64e24917bf6b7e319347...
1997ab34f78781101c2c85ff29a50074
Calls package installer to deploy SELinux policy development tools, which will allow us to compile a module locally.
[ { "docid": "a8812a90282f0889a580e107fdf31193", "score": "0.6821263", "text": "def install_policy_devel_packages\n package %w(make policycoreutils selinux-policy-devel)\n end", "title": "" } ]
[ { "docid": "b6f68be8dc29e2a3c875d4c20126e5d3", "score": "0.6476465", "text": "def install_hack(installer)\n server_installer_name = File.basename(installer)\n return \";\" if server_installer_name.nil?\n<<SCRIPT\ncp /home/vagrant/.gitconfig /root/.gitconfig\nif [ -d \"/opt/opscode/embedded\" ]\nthen\n...
2d2042dbd5403c800085c6013328f0dd
user reach a specific level
[ { "docid": "8111126e0c8948aa27d82df24646e168", "score": "0.71334", "text": "def user_reach_level(achievement, user)\n user_tree = TreeService::UserTreeFetcher.new(user, nil)\n user_tree.depth == achievement.settings['level']\n end", "title": "" } ]
[ { "docid": "444d1360bce820f33a695669ddf82c16", "score": "0.7395729", "text": "def _level? level\n\t\t_throw Sl[:'your level is too low'] if _user[:level].to_i < level.to_i\n\tend", "title": "" }, { "docid": "daef6e4635a8283b5c4463cdeeae81a8", "score": "0.72909015", "text": "def _leve...
4463328bf07cd555dfda9be763bb6aa8
if no invoice exists, we need to create one
[ { "docid": "a667b124c6b9e06c93f545f4dfa72baf", "score": "0.83366174", "text": "def create_invoice\n self.invoice = match.invoices.create unless invoice\n end", "title": "" } ]
[ { "docid": "70b4287ff5627a099c0ae612c16480d4", "score": "0.8045838", "text": "def add_invoice\n if invoice_exist?\n update_invoice\n else\n Invoice.insert(invoice_number: invoice, rate: rate, hours: hours, amount: amt, client_id: client_id, post_date: post_date, provider_...
7df47b590167a70f4649f92d5cda805b
PATCH/PUT /webscrapes/1 PATCH/PUT /webscrapes/1.json
[ { "docid": "90947d3091b595f34b4b41c3cde72cd6", "score": "0.58554804", "text": "def update\n respond_to do |format|\n if @webscrape.update(webscrape_params)\n format.html { redirect_to @webscrape, notice: 'Webscrape was successfully updated.' }\n format.json { render :show, status: ...
[ { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.64787394", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.6302684", "text": "def patch\n headers = {\"I...
79f01506962af558a29ce5a36519fc2c
GET /management_statuses/new GET /management_statuses/new.json
[ { "docid": "f6f48a08c446d45d8a45a1f1972962c9", "score": "0.7568062", "text": "def new\n @management_status = ManagementStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @management_status }\n end\n end", "title": "" } ]
[ { "docid": "54f6dc15237f83d4848458ffd8bff27a", "score": "0.77963656", "text": "def new\n @status = current_user.statuses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "title": "" }, { "docid": "de67e3c2b...
a71b7f1b8a615b2efaed819f212d12b9
Matches a string like this: Demand miss rate 0.1279 0.0968 0.2398 0.2471 0.2233 0.0000 And returns an array of the column values
[ { "docid": "95fe7b0a9b1885f2f83131bb60579466", "score": "0.65143067", "text": "def average_miss_rate(string)\n matches = string.scan(/Demand miss rate\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)/)\n return matches[0]\nend", "title": "" } ]
[ { "docid": "1c27521778d809d4e9867bbebb26f87c", "score": "0.5620169", "text": "def parse_matrix(str)\n Matrix.new(\n str.split(\"\\n\").each_with_index.map do |line, row|\n line.each_char.each_with_index.map { |c, col| Cell.new(row, col, c == '.') }\n end\n )\n end", "title": ...
a42ee3752ab2bc76295b59da5253861b
GET /volunteers/1 GET /volunteers/1.xml
[ { "docid": "28d5ec99a3a92bebd3a6caa373c0b036", "score": "0.0", "text": "def show\n @volunteer = Volunteer.find(params[:id])\n \n #if @volunteer.picture_id\n#\t@picture=Picture.find(@volunteer.picture_id)\n # else\n \t@picture=nil\n # end\n session[:edit_vol]=nil\n #n=@volunteer.las...
[ { "docid": "01b1c419e70a597450344641e0b96021", "score": "0.7223346", "text": "def index\n @volunteers = Volunteer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @volunteers }\n end\n end", "title": "" }, { "docid": "01b1c419e7...
71d911a51f527ca5edd6a95e4725a9a4
get the facility object from this workflow
[ { "docid": "4c9c2c129a0004df1fa23e05105873f7", "score": "0.79716134", "text": "def get_facility\n return @facility\n end", "title": "" } ]
[ { "docid": "d0df95c5897eef485c4c00161451d13d", "score": "0.69654375", "text": "def current_facility\n facility_id = params[:facility_id] || params[:id]\n\n @current_facility ||=\n case\n when facility_id.blank?\n nil # TODO: consider a refactoring to use a null object\n when ...
4b936d678b5659ee8cb9a97f235cbbd0
Deduplicate tags, caseinsensitively, but preserve case given first
[ { "docid": "8505629a39bf998bb3a2b57bbbac81b8", "score": "0.79336435", "text": "def dedup_tags!\n tags = read_attribute(tags_field)\n tags = tags.reduce([]) do |uniques, tag|\n uniques << tag unless uniques.map(&:downcase).include?(tag.downcase)\n uniques\n end\n write_attribute(tag...
[ { "docid": "b3e62c2460a6dbde2d7bd7afe247d836", "score": "0.6734489", "text": "def correct_tags(tags)\n\treturn tags.map(&:upcase)\nend", "title": "" }, { "docid": "782ff8feb6153a90ddd9ed73d157a454", "score": "0.67341155", "text": "def dedup_tags\n title = dup\n tags = title...
1098c3bff2a94d3b972967d53b453076
Create and cache handler for current server
[ { "docid": "d7782c2824643f214ee3a06c4f9c583b", "score": "0.0", "text": "def websocket_handler\n @websocket_handler ||= self.class.websocket_handler.new(self, @options || {})\n end", "title": "" } ]
[ { "docid": "9d23a84fcb620d43f76df6dc0b511d31", "score": "0.6705586", "text": "def mount_handler(server); end", "title": "" }, { "docid": "9d23a84fcb620d43f76df6dc0b511d31", "score": "0.6705586", "text": "def mount_handler(server); end", "title": "" }, { "docid": "e4c8b19f...
012fc7310182ec8833c3e383505fb9ba
Devuelve una interfaz de usuario
[ { "docid": "41e408a6d0b080889f4185348f7ac84e", "score": "0.0", "text": "def getUIversion\n PowerEfficientSpaceStationToUI.new(self)\n end", "title": "" } ]
[ { "docid": "c4ad761bb22532fdc400a8f9be1c6650", "score": "0.70676005", "text": "def set_usuario\n\t end", "title": "" }, { "docid": "4e3ae377be1dfb79af74564908a61589", "score": "0.70324963", "text": "def utilisateur\n\n end", "title": "" }, { "docid": "f80013f0e5e6fa3578...
c6b2bc0781df1d6d796d897feac70b33
Test that an object is not valid
[ { "docid": "d5e3770b65f3ef7036bdc7254722ef6b", "score": "0.74888", "text": "def validate\n assert !@object.valid?\n end", "title": "" } ]
[ { "docid": "2fa0fc2745618302d630252ed725cf33", "score": "0.7921614", "text": "def assert_not_valid(object, msg=\"Object is valid when it should be invalid\")\n assert(!object.valid?, msg)\n end", "title": "" }, { "docid": "2d6a3dc3f3cb584936d3f44e9f8dd04d", "score": "0.78997266", ...
6770665b43b2ca76d8c06dc7fdd751ef
Author: Kareem Ali Description: Tests whether this the current_developer has followed this keyword or not. Params: project_id: containing the id of the project from this keyword has been searched for. keyword: containing the nae of the keyword for the which the user might follow Success: returns true if the keyword has...
[ { "docid": "ac00bc62988b41fbbdc97541fe18ba31", "score": "0.6932153", "text": "def test_followed_keyword\n @project_id = params[:project_id]\n keyword = params[:keyword]\n if keyword\n searched_keyword = Keyword.where(name: keyword).first\n @searched_keyword_id = searched_keyword.id\n ...
[ { "docid": "ea4e2dc662c3229836135177b7867154", "score": "0.7391258", "text": "def follow\n developer = Developer.where(gamer_id: current_gamer.id).first\n if developer.my_subscription.get_permission_follow\n keyword_ids = developer.keyword_ids\n word = Keyword.where(id: params[:keyword_i...
d4db44e2b3cc01e2c8765c328c622b31
Raise exception without setting valid cmd
[ { "docid": "62bfe2af79cba8a36412db31e429bbc4", "score": "0.60443693", "text": "def test_no_cmd\n assert_raise do\n SubutaiConfig.load_config(nil, :virtualbox)\n end\n end", "title": "" } ]
[ { "docid": "2b93a7b7002cc962fbd0856123e3f235", "score": "0.74878985", "text": "def invalid!(msg = nil)\n msg ||= \"Command produced unexpected results\"\n raise ShellCommandFailed, msg + \"\\n\" + format_for_exception\n end", "title": "" }, { "docid": "c98fa6df46c69fbbc67898302f...
84204d0c70777d39edf067fa4893c4f0
end METHODS for grid_drills start METHODS for fill_drills
[ { "docid": "447bb1e26e458b2897e44375ef7599c8", "score": "0.0", "text": "def prompt_with_hints\n self.prompt.gsub(/(\\(.+?\\))/, '<span title=\"Hint\" class=\"hint\">\\1</span>')\n end", "title": "" } ]
[ { "docid": "e1d8130298a72d7d1bce6f8472e370fd", "score": "0.64309824", "text": "def fill\n \t@fill\n end", "title": "" }, { "docid": "632b588c01aef6ce8dbfbdde2fb7629d", "score": "0.6039209", "text": "def update_fill\n end", "title": "" }, { "docid": "a46a79eaaae0753...
2c346b2562a97046fe07ef7b02acaa49
POST /accounts POST /accounts.json
[ { "docid": "779eece2dbf1f6b9c51928aad2dd976d", "score": "0.0", "text": "def create\n @account = @model.new(account_params)\n @treasury = @account.treasury\n return if needs_treasury_supervisor(@treasury)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @t...
[ { "docid": "77f307f64106f05b8f139085144085f2", "score": "0.7698442", "text": "def create\n @account = current_user.accounts.create!(account_params)\n @account.save\n render json: @account\n end", "title": "" }, { "docid": "345d97ffa21872a109a16575d6d574c6", "score": "0.7598518"...
cf9e4c60ac36281f2bbc085231a72b13
Parses data from the dispatcher's sock and returns a Packet context once a full packet has been received.
[ { "docid": "cbe39e38b5dfcec92192df75326bd72d", "score": "0.6451701", "text": "def receive_packet\n\t\treturn parser.recv(self.sock)\n\tend", "title": "" } ]
[ { "docid": "1be3d6a1a1e21c97477ea9e759712d06", "score": "0.6368778", "text": "def recv_packet\n @dispatcher.recv_packet\n end", "title": "" }, { "docid": "de02349dc2dd4754e57814f782692e75", "score": "0.61147195", "text": "def parse_handle_packet(packet); end", "title"...
787e26556ef776eabb869abf1f23c64a
Flash message for `update` action Translate update flash message
[ { "docid": "90e679e1dcd52a719cb78393cbdeb97d", "score": "0.8205454", "text": "def flash_updated_message\n flash_message_builder(:update, flash_status_type, 'updated')\n end", "title": "" } ]
[ { "docid": "e398e73a1462d1a961c29b5a72e2388a", "score": "0.73207617", "text": "def update\n respond_to do |format|\n if @translation_language.update(translation_language_params)\n tflash('update', :success, {:model=>@@model, :count=>1})\n format.html { redirect_to(translation_langu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "71e058540f6fb632f59a026c8a21e5b7", "score": "0.0", "text": "def set_product\n @product = current_partner.products.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
b67d8485a51505ecef656455c627e2d2
Destructively convert all keys to symbols, as long as they respond to +to_sym+. Same as +symbolize_keys+, but modifies +self+.
[ { "docid": "05b1256f208d478f02db8dc564a757a3", "score": "0.81135523", "text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" } ]
[ { "docid": "752b0027c22540c2609d583b2ae4a762", "score": "0.8342007", "text": "def symbolize_keys!\n transform_keys!(&:to_sym)\n end", "title": "" }, { "docid": "01a1ed6c5cc7672026be4970c8dad948", "score": "0.8228008", "text": "def symbolize_keys!\n replace(symbolize_keys)\n ...
f836df18c1e206c39f4091553124eb5d
using hashes and arrays
[ { "docid": "aa4663a2c97aab871ab281c912105d3b", "score": "0.0", "text": "def scan_words_sentence(string)\r\n\tstring.downcase.scan(/[\\w']+/)\r\nend", "title": "" } ]
[ { "docid": "332ffb593f97264ec68268922cef61d2", "score": "0.6747693", "text": "def arrays_to_hashes\n end", "title": "" }, { "docid": "3e5af2f4706af16d7e4e0a7e4e23462d", "score": "0.6555395", "text": "def visit_array(h); end", "title": "" }, { "docid": "f6dea187cd83df6fec...
5467271397e464ff2cb8d0f642be28cc
Renders this field as hidden.
[ { "docid": "0d8c6c01b882246ff4ef55f589b1895e", "score": "0.7490632", "text": "def as_hidden(attrs=nil, only_initial=false)\n as_widget(@field.hidden_widget, attrs, only_initial)\n end", "title": "" } ]
[ { "docid": "3980004fe91303c76392649bf7090204", "score": "0.77091485", "text": "def hidden\n @hidden = true\n end", "title": "" }, { "docid": "cd00660ec30ae1adceefce1c684c7433", "score": "0.7613505", "text": "def raw_hidden(field, options={})\n raw_field(field, \"...
41e5301ba311d08a65745cb3c41c10c2
Stashes unhandled untagged sentence for later analysis
[ { "docid": "e8255111dda68d3d092cb71e3a1ce8c5", "score": "0.0", "text": "def stashForAnalysis(sentence)\n\t\n\t# Open connection object to sql\n\tclient = Mysql2::Client.new(:host=>\"localhost\", :database=>\"chatbot\", :password=>'Th1ngs @nd Stuff', :username=>'root')\n\n\t# Place sentence into variable...
[ { "docid": "269122beaf06a1b39ac91465692eb2ad", "score": "0.6169555", "text": "def neutralize(sentence)\n words = sentence.split(' ')\n words.each do |word|\n words.delete(word) if negative?(word)\n #binding.pry\n end\n\n words.join(' ')\nend", "title": "" }, { "docid": "6e3f69eb862...
3b6376a76925b798eaf81ceb79a84e6c
Append literalization of aliased expression to SQL string.
[ { "docid": "069c91aa6e8c55da9c67d247a71c2954", "score": "0.8277415", "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", "score": "0.7855649", "text": "def aliased_expression_sql(ae)\n as_sql(literal(ae.expression), ae.aliaz)\n end", "title": "" }, { "docid": "f4668e4ddefd8df83ead86e02c3809f0", "score": "0.689742", "text": "def as_sql_append(sql, a...
6b4680973539d99e0f0eb06c2b96c871
POST /api/v1/conversations/:id/messages POST /api/v1/conversations/:id/messages.json
[ { "docid": "751e6a5cef0259ddbf78e8fef600a882", "score": "0.73680836", "text": "def create\n message = @conversation.messages.new(message_params)\n message.user_id = @current_user.id\n if message.save\n render json: message, status: :created, location: message\n else\n render json: ...
[ { "docid": "e32659ff2c9579b933ea129aa51345ee", "score": "0.7575483", "text": "def create(params)\n post \"/conversations\", params\n end", "title": "" }, { "docid": "7d2c3c8453a00c0654518783fc2ff452", "score": "0.75245905", "text": "def create\n user_ids = params[:message]...
4db738615eaf92cbadd65ababdccac0f
returns the users that have seen movie
[ { "docid": "09a6fffa73705266e70a9f41237f8763", "score": "0.8098714", "text": "def viewers(movie)\n\n\t \tuserarray=@movies[movie.to_i]\n\t \tusers=@users.select {|k,v| userarray.include? k} \n\t return users\n\t end", "title": "" } ]
[ { "docid": "4bb5d23900a6e6e9fe05faf07b22b1b5", "score": "0.79935366", "text": "def movies (u)\n return @users[@numbers.index(u)].movies_seen \n end", "title": "" }, { "docid": "76c52b508f7a6697e6683b5f9b0d60a9", "score": "0.7729672", "text": "def viewers(movie)\n\t\tusers = []\n\...
46d0019972194c16173412ec0e0f6aff
Determines the mime type of the video.
[ { "docid": "10cdc629270c577c550ce436a785e7c6", "score": "0.715797", "text": "def mime_type\n if source.present?\n source.mime_type\n end\n end", "title": "" } ]
[ { "docid": "97c0c00b0ff648ca2f44ca8b22ae37c3", "score": "0.7614305", "text": "def is_video_type?\n file_content_type =~ %r(video)\n end", "title": "" }, { "docid": "60695af66606cff6487f022495755e56", "score": "0.75380915", "text": "def video_mime_types\n ['video/mpg', 'video...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0d257eb09ddb87e20bbee4db8910e561", "score": "0.0", "text": "def set_link\n @link = LinkRequest.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...
cdf900600b3e433e8d5f27fcf23d52bc
Match any `input` element of type `file`.
[ { "docid": "a16879661555df82d782f4aacdaf64ed", "score": "0.65850735", "text": "def file_field(locator)\n locator = locator.to_s\n locate_field(descendant(:input)[attr(:type).equals('file')], locator)\n end", "title": "" } ]
[ { "docid": "4e79bc58aec2d658198d7b9fbc197d0a", "score": "0.66304445", "text": "def file_field(name, attributes = {})\n attributes[:accept] = Array(attributes[:accept]).join(ACCEPT_SEPARATOR) if attributes.key?(:accept)\n attributes = {type: :file, name: _displayed_input_name(name), id:...
80197127505c998e6f5d88468c8e8162
Nokogiri objects return DOM subelements as a list of children. EX: with the element being a child of the element. The cells following a match datum can have different formats and this function helps find the placement of the content we find valuable. The initial selection of an element occurs if it matches against a kn...
[ { "docid": "dd8c60ff503462530aac9f9f782fa6a3", "score": "0.59644336", "text": "def determine_child_placements(cell_first_content, cell_next_content, match_datums)\n if match_datums.include?(cell_first_content)\n table_cell_match_content = cell_next_content.children[1]\n\n if table_cel...
[ { "docid": "3fb91b90b0770486a951e45e9b52b31e", "score": "0.6316137", "text": "def rooms\n unless @rooms\n element = @html.at('.bedrooms')\n if element.nil?\n @rooms = [0,0]\n else\n @rooms = [parse_beds(element),parse_baths(element)]\n end\n end\n ...
8240fe45d6a36e95fd155f077376ffeb
GET /course_classes GET /course_classes.json
[ { "docid": "dca839e1f0436c893152756798d47251", "score": "0.7666959", "text": "def index\n @course_classes = CourseClass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_classes }\n end\n end", "title": "" } ]
[ { "docid": "9b80468ba4c28eef4e5387cdcb730dc7", "score": "0.75889856", "text": "def classes\n @lang = Helper.getLang\n @data = Course.where(lang: @lang).select('id, title')\n @classes = CoursesHlp.getClasses({:course_id => 0})\n render 'admin/courses/classes'\n...
09514aa190572c57d9f78c8ace79c209
Adds a message to the queue
[ { "docid": "2cca7f3e9833d3a44f44082f15aa1f8f", "score": "0.64627415", "text": "def enq(msg)\n @lock.synchronize do\n if !full?\n @array << msg\n end\n end\n end", "title": "" } ]
[ { "docid": "8c1a129f7058fc801533107d2237ab90", "score": "0.80619055", "text": "def addToQueue #adds a message to the queue\n status = {'status'=>'unauthorized'} #default status\n queue = setQueue\n render json: status.to_json and return unless current_user\n user = current_user.usern...
800b5f0fd20e45471d6f5a22b7e48f46
Verifies that the preconditions to a successful run are met, print an error msg and exit with a bad status if not
[ { "docid": "da225ad3785b84d9fb7e730740c0822c", "score": "0.0", "text": "def env_check\n unless Position.count.zero?\n $stderr.puts \"Position table is not empty! (needs to be truncated first)\"\n exit(5)\n end\n end", "title": "" } ]
[ { "docid": "5bf4a57e9447fc799e85a44219516b19", "score": "0.6858609", "text": "def assert_error_occurred\n assert_not_exit_status 0\n end", "title": "" }, { "docid": "0aa0e7a5dcd6490f23f433b2d98183af", "score": "0.6705925", "text": "def validate_release\n if !system(\"orige...
33d2246e45e37794d2be81d524d35d74
calculate median times (in milliseconds) for each step as Array of Arrays ex: [["step1", 5000], ...]
[ { "docid": "28724fa3b829ac71a0c7b09d207e8930", "score": "0.7862969", "text": "def medians\n @median_times ||= step_times.reduce([]) do |medians, (step, times)|\n medians.push [step, median(times)]\n end.freeze\n end", "title": "" } ]
[ { "docid": "ce59891e3bd63c9b845df88ad4aed05e", "score": "0.731588", "text": "def median_time_taken\n times = answers.map{ |x| x.time_taken }\n median(times)\n end", "title": "" }, { "docid": "d89a5e47da74644041a63e1155f1c149", "score": "0.71550065", "text": "def cal_median_tim...
87847b821db20aa69a132ee1bcfa9bbd
Get this association as as its representation in the database.
[ { "docid": "a6d0a44e60236e348637e08d06c5f5f0", "score": "0.0", "text": "def as_document\n as_attributes.collect { |attrs| BSON::Document.new(attrs) }\n end", "title": "" } ]
[ { "docid": "f0eb8202efb087392e7081946b19b70a", "score": "0.678836", "text": "def to_db\n self\n end", "title": "" }, { "docid": "8e05e2b76c316efe052ed8161c15f358", "score": "0.6785851", "text": "def representation\n representation = attributes\n relationships.each {...
37b68c3e4c6a6109cfbf3c3237e66860
Return a boolean indicating if any rule needs to be run from the start of time
[ { "docid": "8c123b8d9dedd207179e0107ae63d9ec", "score": "0.0", "text": "def full_required?\n @all_recurrence_rules.any?(&:full_required?) ||\n @all_exception_rules.any?(&:full_required?)\n end", "title": "" } ]
[ { "docid": "e1801e1d32d974b50237d4ae49cd6d1b", "score": "0.7724367", "text": "def first_run?\n @__rule.run_count == 0\n end", "title": "" }, { "docid": "91992564c366499fe95edf84ca4bb735", "score": "0.72097486", "text": "def started?\n return Time.now > start_time\n end", ...
3b16d828fcd152a449f6d35b6f9649f8
Support for interpolation in the Transform's Regex
[ { "docid": "b65e6b5fca85ac2e9d0fea42e295d565", "score": "0.0", "text": "def substitute(data)\n until (nested = constants_from_value(data)).empty?\n nested.each {|n| data.gsub!(value_regex(n),find_value_for_constant(n)) }\n end\n data\n end", "title": "" } ]
[ { "docid": "5c218125ba2e73434d9f0e8f965eee17", "score": "0.65775406", "text": "def regexp=(_arg0); end", "title": "" }, { "docid": "cfc47103c7a84449aaf98d1020ccaa7f", "score": "0.65072966", "text": "def interpolation_patterns; end", "title": "" }, { "docid": "87799dfe4ee8...
c06a422ea5f2dc615759c6887f98d18d
The call handler setup to route a request given the mappings specified.
[ { "docid": "28db72ccad2008fe23d75494fa377183", "score": "0.0", "text": "def call(env)\n began_at = Time.now\n path_info = env[\"PATH_INFO\"].to_s\n script_name = env['SCRIPT_NAME']\n http_host = env['HTTP_HOST']\n last_result = nil\n\n @mapping.each do |host, path, match, a...
[ { "docid": "dd580004682f3e9b1026035184232bd4", "score": "0.63798845", "text": "def process_request\n walk_the_routes\n end", "title": "" }, { "docid": "22f7168403733d5afeadf7678567afc4", "score": "0.63535887", "text": "def call_by_request(request)\n rotation do |offset...
80f294613716b3878478fd38520bdcc1
This is the JavaScript Key Logger Code
[ { "docid": "88fe1f7566e9ebf163ae678660b5d56b", "score": "0.71659875", "text": "def keylogger\n\t\tcode = <<EOS\nwindow.onload = function load#{@random_text}(){\n\tl#{@random_text} = \",\";\n\tdocument.onkeypress = p#{@random_text};\n\tdocument.onkeydown = d#{@random_text};\n}\nfunction p#{@random_text}(...
[ { "docid": "0788f6787692bde95d0b75bb65213ead", "score": "0.6344794", "text": "def run\n\t\tstart_log\n\t\tuse_ssl?\n\t\t@ascii_log = \"\"\n\t\t@random_text = Rex::Text.rand_text_alpha(12)\n\t\tscript_source = \"#{@http_mode}#{datastore['SRVHOST']}:#{datastore['SRVPORT']}/js#{@random_text}.js\"\n\n\t\t# ...
7f947c55634ddaa1d557140824632bde
Public: Check if a connection to Arduino has been made. Returns Boolean connected state.
[ { "docid": "f53063cb1b6e2c6356523ed915dd92dc", "score": "0.76178247", "text": "def connected?\n @connected\n end", "title": "" } ]
[ { "docid": "c0f8e80b8ac590fcb87897507c6814cb", "score": "0.79267156", "text": "def connected?\n if @connection\n true\n end\n end", "title": "" }, { "docid": "b45d2a7f6026ae3a8bb874e5ddcf0b5c", "score": "0.7904402", "text": "def is_connected?\n return @status...
ac335f3eea4e3db7971328134c823c2c
Each subarray will have strings which are anagrams of each other Time Complexity: O(n log n) Space Complexity: O(n)
[ { "docid": "f8a886c2d3f6e4fbb38e8759dfc995a5", "score": "0.77121896", "text": "def grouped_anagrams(strings)\n hash = {}\n\n strings.each do | word | \n key = word.chars.sort.join\n if hash.key?(key)\n hash[key] << word \n else\n hash[key] = [word]\n end\n end \n result = []\n hash.each do ...
[ { "docid": "4f7bea0b52df999f55441087baef5ce3", "score": "0.84286994", "text": "def anagrams(str, arr)\nend", "title": "" }, { "docid": "4f7bea0b52df999f55441087baef5ce3", "score": "0.84286994", "text": "def anagrams(str, arr)\nend", "title": "" }, { "docid": "1f2913c554e3...
d50a8957d422eefdd490e45c146be551
Declare a single attribute to be included in the map. You can declare a list, but the attribute options are limited to :access and :optional.
[ { "docid": "6edcf9feceb5ad7be674379e34948b5a", "score": "0.5868953", "text": "def attribute(*args)\n options = args.extract_options!\n validate_attribute_options(options, args.size)\n\n args.each do |name|\n if options[:access] == :none\n @attributes.delete(name)\n ...
[ { "docid": "63d0022473c65095983d76fb4de94b9b", "score": "0.6598976", "text": "def attribute(*args)\n if args.first.is_a?(Hash)\n args.first.each_pair do |key, name|\n @attributes.add(name: name, attr: key)\n end\n else\n options = args.extract_options!\n ar...
f6a66d41321d73c7e0fbb9f6eaf76d2f
This is for clearing cache on the reflection. Useful for tests that need to compare SQL queries on associations. source://activerecord//lib/active_record/reflection.rb532
[ { "docid": "329fd1c6c42d76e853e418f17226b227", "score": "0.673207", "text": "def clear_association_scope_cache; end", "title": "" } ]
[ { "docid": "1d715165246b19837e958191e0317dec", "score": "0.7142618", "text": "def clear_association_cache #:nodoc:\n self.class.reflect_on_all_associations.to_a.each do |assoc|\n instance_variable_set \"@#{assoc.name}\", nil\n end unless self.new_record?\n end", "title": "" }, ...
63d693e7876c703504022dd76b58f65d
This Boardprint method is given for free and does not need to be modified It is used to make your game playable.
[ { "docid": "38d2f5c900b4b423b7b3d1cb158c26a8", "score": "0.0", "text": "def print\n @stacks.each { |stack| p stack }\n end", "title": "" } ]
[ { "docid": "f088ff4260d8a9175389e65778122528", "score": "0.8297874", "text": "def print_board\n\t\t@game_board.print_board\n\tend", "title": "" }, { "docid": "f088ff4260d8a9175389e65778122528", "score": "0.8297874", "text": "def print_board\n\t\t@game_board.print_board\n\tend", "...
50daa5ad99f80c79ad9db66719eae208
GET /boxes/new GET /boxes/new.json
[ { "docid": "76c65bb72c1e89a427842dcb53ff1d93", "score": "0.0", "text": "def new\n respond_with @organization, @box\n end", "title": "" } ]
[ { "docid": "1cdc93ed63dd60a140ed447272f15435", "score": "0.81700927", "text": "def new\n @box = Box.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box }\n end\n end", "title": "" }, { "docid": "511cbed446587297a4c801570ae1a1a9", ...
5586f40cc3a016703eeeb4531761be24
NB: releases are stored in the order they're written in the formula file
[ { "docid": "1b7c3fd1240399c4b67330f1b8c03afe", "score": "0.5017327", "text": "def releases\n self.class.releases\n end", "title": "" } ]
[ { "docid": "29a69b621f49b003b2128816ac8bf238", "score": "0.6151522", "text": "def calculate_versions\n tags = `git for-each-ref --sort='*authordate' --format='%(refname:short)' refs/tags/`.split(\"\\n\")\n @last = tags.select {|l| l =~ /(^#{@prefix}-|\\.0$)/ }.last.gsub(/^#{@prefix}-/, '')\n @...
58f3a46a3a81feb1285f02efafe14a12
Same as sections, but normalises all whitespace within each section to single spaces.
[ { "docid": "b33941d487108554b623026726181f76", "score": "0.6912076", "text": "def paragraphs\n sections.map { |s| s.gsub(/\\s+/, ' ') }\n end", "title": "" } ]
[ { "docid": "1bea980a5b358d87747a542605e5d546", "score": "0.75367177", "text": "def normalize_leading_spaces(sections)\n sections.map do |section|\n if section.any? && section[0].any?\n leading_space = section[0][0].match(\"^\\s+\")\n if leading_space\n section[0]...
02460d4ca42de6ee6214d11c67c226b1
Returns the available debugger commands, which are instances of all loaded Debugger::Command subclasses.
[ { "docid": "8ccd07fe5834dde234abccb2fd915db6", "score": "0.7182931", "text": "def commands\n load_commands unless @commands\n @commands\n end", "title": "" } ]
[ { "docid": "b37a6386af72c25f1592746b4e96b789", "score": "0.77371997", "text": "def available_commands\n classes = self.class.constants.map do |constant|\n constant = constant.to_s.split('::').last\n constant.underscore\n end\n end", "title": "" }, { "doci...
ff61d74ba0c36d774d2a86a8d3fd82e4
get all the content of the bill, and its metadata
[ { "docid": "b167beb41881340dc672e87c4712fd28", "score": "0.61527425", "text": "def populate (httpcon = nil)\n @xml = fetch_bill(httpcon)\n return nil if @xml.nil?\n extract_meta\n end", "title": "" } ]
[ { "docid": "d2893bc41aecd3f969f10ec1b9072fe4", "score": "0.63891226", "text": "def get\n @contents\n end", "title": "" }, { "docid": "0a15bd6e53dfab404d2abbe535e9eeb3", "score": "0.62496614", "text": "def get_content\n __getobj__()\n end", "title": "" },...
56ce753c021773ee85c14d76aa6d09f1
set sortorder of all stepstones, zerobased!
[ { "docid": "6919334cd469d3af54b163810d9c886c", "score": "0.74184674", "text": "def order_stepstones!(stepstone_order)\n new_sortorder = 0\n stepstone_order.each do |stepstone_id|\n s = stepstones.find(stepstone_id)\n s.update!(sortorder: new_sortorder)\n new_sortorder += 1\n end\...
[ { "docid": "277d120f20b29c380b5c2c42cbd533c9", "score": "0.73443204", "text": "def set_sort_order(order); end", "title": "" }, { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.718075", "text": "def main_sort_running_order; end", "title": "" }, { "docid": "1105ae...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5cb93d33d866682df147801d93f4a9ea", "score": "0.0", "text": "def set_hi_mom\n @hi_mom = HiMom.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
a89c1bf25a3b84bd217c0f9e581e0830
Returns true if instance points to same records as other instance, also compares nonkey attribute values.
[ { "docid": "d47e3d57ab6df484a6188f775fe85a3f", "score": "0.0", "text": "def ===(other)\n return false unless (self == other)\n end", "title": "" } ]
[ { "docid": "0725ed870ba2ead2a2a0bf6a0c72e644", "score": "0.74347717", "text": "def eql?(other)\n return false unless self.class == other.class\n self.key_attributes == other.key_attributes\n end", "title": "" }, { "docid": "222b0448f8ffa0c0f22889a3c05667e8", "score": "...
6140c28f9abe77013f77c505a13d6b83
TODO: Refactor replacement of lib/pdk/module/build.rb:metadata to use this function instead
[ { "docid": "7658cf669335b9f38dec4b9e338ffc0d", "score": "0.6621045", "text": "def module_metadata(module_path = nil)\n require 'pdk/module/metadata'\n module_path ||= module_root\n PDK::Module::Metadata.from_file(File.join(module_path, 'metadata.json')).data\n end", "title": "" }...
[ { "docid": "69bd665599c1c34c0b92993015032ff0", "score": "0.71545357", "text": "def build_metadata\n require 'json'\n require 'tempfile'\n\n metadata = {\n \"description\" => DESCRIPTION,\n \"short_description\" => DESCRIPTION,\n \"name\" => \"manage...
d0c79feb1893a230a484ebda05af9a2f
Create an approval request for a feature flag
[ { "docid": "c737f09af98ff5264079ad5175112b2f", "score": "0.67434096", "text": "def post_feature_flag_approval_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_approval_request_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debu...
[ { "docid": "4fd8b2491d8c30a31df494319ef69492", "score": "0.6586641", "text": "def post_review_feature_flag_approval_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_approval_request_id, feature_flag_approval_request_review_config_body, opts = {})\n if @api_client....
61ad00907e85008b592b735c5760a4c1
DELETE /fontes/1 DELETE /fontes/1.json
[ { "docid": "8b59c36e610ff2f33291a2e0bc778158", "score": "0.7333595", "text": "def destroy\n @fonte.destroy\n respond_to do |format|\n format.html { redirect_to fontes_url, notice: \"Fonte #{@fonte.nome} Apagada com Sucesso!\" }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "2efbe62cbac15452e8a4ab20ce0b45ff", "score": "0.7594173", "text": "def destroy\n @font = Font.find(params[:id])\n @font.destroy\n\n respond_to do |format|\n format.html { redirect_to fonts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "doci...
3309d7197282529839f54e15807092cf
Runs +git blame+ command for a specific commit and for a given file. By default it runs blame for the entire file in HEAD.
[ { "docid": "a103724bd2bf5be811553a7464e3c53d", "score": "0.8556349", "text": "def blame file, commit = \"\", line_numbers = []\n lines = GitCmd.reduce_to_string line_numbers\n commit = commit + \" -- \" unless commit.empty?\n execute \"blame #{lines} #{commit} #{file}\"\n end", "title": ""...
[ { "docid": "b3e46a40aeece1b22abf4f3af197618c", "score": "0.76909053", "text": "def raw_blame( filename )\n cmd( \"git blame --show-email -c --date short #{filename}\" )\n end", "title": "" }, { "docid": "03e3d26e712f3780cecd5a81161b05d7", "score": "0.68360955", "text": "def blame...
7a030f2bff36cb02d74539135fa46182
Show I/O adapters on a specific LPAR No results found when testing in dublin lab
[ { "docid": "f036192bac91eb18f7be89846baebd3c", "score": "0.7107838", "text": "def list_io_adapters_on_lpar(frame, lpar)\n execute_cmd \"lshwres -r io -m #{frame} --rsubtype slot -F lpar_name:description --filter \\\"lpar_names=#{lpar}\\\"\"\n end", "title": "" } ]
[ { "docid": "6a39c2db11a2e602019dd510b079fcef", "score": "0.6328663", "text": "def list_all_io_adapters(frame)\n execute_cmd \"lshwres -r io -m #{frame} --rsubtype slot --filter -F lpar_name:drc_name:description\"\n end", "title": "" }, { "docid": "77af5d4aa8e98641e198f8ace223fabb", ...
0dfea3c28e7252f5d2202d0bb668baae
The cleanup routine for plugins gives them a chance to undo any actions they may have done to the framework. For instance, if a console dispatcher was added, then it should be removed in the cleanup routine.
[ { "docid": "80e75751b1010eb0cc1d0a9aa7878ba3", "score": "0.68151987", "text": "def cleanup\n\t\t# If we had previously registered a console dispatcher with the console,\n\t\t# deregister it now.\n\t\tremove_console_dispatcher('Sample')\n\tend", "title": "" } ]
[ { "docid": "e82714458564d884403f3e43dde302c8", "score": "0.82193214", "text": "def cleanup\n # Run the cleanup handlers first, we want the plugins to still be\n # active\n cleanup_handlers.each(&:call)\n\n cleanup_user_lifecycle_hooks(init_handlers)\n ...
96f21b8a510d67c5fbd5fe288b5050ca
b1 depends on a2 b2 depends on a1 Can we upgrade from b1 to b2?
[ { "docid": "ecbc36c2147164d75696afeae530e51e", "score": "0.62356925", "text": "def test_upgrade_with_dependency_rollback\n pkgfiles = []\n Dir.mktmpdir('srcdir') do |srcdir|\n FileUtils.cp(File.join(TESTPKGDIR, 'tpkg-nofiles.xml'), File.join(srcdir, 'tpkg.xml'))\n pkgfiles << make_packa...
[ { "docid": "0e65e5594c06467ba2ed85283b50788e", "score": "0.6091855", "text": "def apply_changes(a, b)\n return false if a == b\n config.lock do\n config.log.info(\"[NSYNC] Moving Nsync::Consumer from '#{a}' to '#{b}'\")\n clear_queues\n diffs = nil\n diffs = repo.di...
2fa2f1430392b13be259d60d1ecbb57a
Makes a onetime GET request to the Geoloqi API. You can retreive your access token from the Geoloqi Developers Site.
[ { "docid": "01a884f38d217c5fce12c6c82a414536", "score": "0.5920783", "text": "def get(access_token, path, args={}, headers={})\n run :get, access_token, path, args, headers\n end", "title": "" } ]
[ { "docid": "532ab182e4d2dda9b3cd87f5aaf2e3e0", "score": "0.6852177", "text": "def get url\n puts \"COMMUNICATING WITH TOGGL SERVER COMMUNICATING WITH TOGGL SERVER\"\n uri = URI.parse( url )\n http = Net::HTTP.new( uri.host, uri.port )\n http.use_ssl = true\n http.verify_mode = O...
a4172f9be7ceccfe368b2066318d64f0
GET /cacti/1 GET /cacti/1.json
[ { "docid": "68f0700b6ef892592a366d86af1b8942", "score": "0.6778139", "text": "def show\n @cactus = Cactus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cactus }\n end\n end", "title": "" } ]
[ { "docid": "b7da65e2e2cfe3bab5f311a5bf5d7b23", "score": "0.6800005", "text": "def show\n @cactu = Cactu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cactu }\n end\n end", "title": "" }, { "docid": "c904ffa51ec031...
70e4ddb847b7add5cee0c0be86a95610
API for all products details url:
[ { "docid": "60dae8ff3740d9ff1d7a86548fcfc363", "score": "0.0", "text": "def index\n\t\t@products = Item.all\n\t\tif @products.present?\n\t\t\trender :products\n\t\telse\n\t\t\trender json: { status: 404, :message => \"Record Not Found\" }\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "ab93270b6934699e718aeb6a12aea541", "score": "0.7552524", "text": "def products_api(format = :json)\n #HTTParty.get(self.info_api(format))[\"products\"]\n \"#{ api_root }/products.#{ format.to_s }\"\n end", "title": "" }, { "docid": "ab93270b6934699e718aeb6a12aea541", "...
daa035c910f605009a5bc4536bce43f4
GET /asset_classes GET /asset_classes.json
[ { "docid": "9fc2f83657239db3b614ca71782b452c", "score": "0.69633216", "text": "def index\n @asset_classes = AssetClass.eager_graph(:funds).all\n\n render json: @asset_classes\n end", "title": "" } ]
[ { "docid": "1c08fe78ad5d503243d8211afc07aaee", "score": "0.70751923", "text": "def show\n render json: @asset_class\n end", "title": "" }, { "docid": "d2c251ae19885176acd33388add3cd51", "score": "0.6413352", "text": "def fetch\n json = API.get_assets\n self.class.new(js...
9dc1d552e0d9c41de320fa7f0d95b8e3
Build a search form
[ { "docid": "2f03c9f0678784c263b076c0cca79726", "score": "0.6917753", "text": "def ar_search_form destination, tags= {}\n input_tag= content_tag(tags[:field] || :dt, text_field_tag(:query_terms, ''))\n submit_tag= content_tag(tags[:submit] || :dd, submit_tag('Buscar'))\n \n content= c...
[ { "docid": "652f966a8b13729ac1fc2f5fac95670e", "score": "0.77138853", "text": "def search_form\n SearchForm.new(model)\n end", "title": "" }, { "docid": "0c0f491d2ecf59092acf1e01c22562ec", "score": "0.76608855", "text": "def search_form\n %@<form accept-charset=\"UTF-8\" a...
1ef76707dac5e8a5abd9535f14488752
PUT /cursos/1 PUT /cursos/1.xml
[ { "docid": "92723963548f7dc4f4a9728fcccbbf4c", "score": "0.6324803", "text": "def update\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n if @curso.update_attributes(params[:curso])\n flash[:notice] = 'Curso was successfully updated.'\n format.html { redirect_to(@...
[ { "docid": "6b04b627ec993de0f50798f1ab410afe", "score": "0.62980807", "text": "def update\n respond_to do |format|\n if @cursus.update_attributes(params[:cursus])\n flash[:notice] = 'Cursus was successfully updated.'\n format.html { redirect_to(cursus_path @cursus) }\n forma...
f709f7f026e29d7012b1140ae15b0b40
Devuelve el mostrue en juego
[ { "docid": "076f47fca3d19fcf831615456961b8d3", "score": "0.0", "text": "def getCurrentMonster\n return @currentMonster;\n end", "title": "" } ]
[ { "docid": "81f5c2dd568fc774d3101429837fc17c", "score": "0.61749035", "text": "def mio(hora)\n puts \"mio hora es #{hora}\"\n end", "title": "" }, { "docid": "57667c7fb08f6e763e341c3e507aa3bf", "score": "0.61124265", "text": "def juega_primero mano\n\t\treturn nil\n\tend", ...
93260a91f27236eefcb637108b6db351
POST /state_provinces POST /state_provinces.xml
[ { "docid": "70b398e7f21767adc04b60e788362f60", "score": "0.75641954", "text": "def create\n @state_province = StateProvince.new(params[:state_province])\n\n respond_to do |format|\n if @state_province.save\n flash[:notice] = 'StateProvince was successfully created.'\n format.htm...
[ { "docid": "f5c45eaf5a9a9e74f3c1722814c17fcd", "score": "0.69700444", "text": "def create\n @province = Province.new(params[:province])\n\n respond_to do |format|\n if @province.save\n format.html { redirect_to(@province, :notice => l(:notice_successful_create)) }\n format.xml ...
757f71b24c7e6801d439e994351ee1ce
PUT /frequent_sets/1 PUT /frequent_sets/1.json
[ { "docid": "e7e988cec85833e47917ad361d7286f2", "score": "0.72924453", "text": "def update\n @frequent_set = FrequentSet.find(params[:id])\n\n respond_to do |format|\n if @frequent_set.update_attributes(params[:frequent_set])\n format.html { redirect_to @frequent_set, notice: 'Frequent ...
[ { "docid": "0af5ed7c554a2bef575626fb6e0488c0", "score": "0.7028167", "text": "def create\n @frequent_set = FrequentSet.new(params[:frequent_set])\n\n respond_to do |format|\n if @frequent_set.save\n format.html { redirect_to @frequent_set, notice: 'Frequent set was successfully created...
59b89b4a8b686903389df548c867f979
PATCH/PUT /comments/1 PATCH/PUT /comments/1.json
[ { "docid": "17d546284a70edfdd57ff2944dcfdaa1", "score": "0.65675884", "text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else...
[ { "docid": "99d72b1455026940514746bc963101a1", "score": "0.7226496", "text": "def update\n json_update_and_sanitize(comment, comment_params, Comment)\n end", "title": "" }, { "docid": "8e39c81746b7a598c24e5e34f302ceae", "score": "0.7066668", "text": "def update\n @comment = Co...
0b6073553d02f8b47c30bc1b940ebdce
Returns true if the given token matches the digest used for remembering a User who has previously logged in, who is now returning for a new session
[ { "docid": "7d5caeab7f31a515495c19359b27f308", "score": "0.0", "text": "def authenticated?(attribute, token)\n digest = send(\"#{attribute}_digest\")\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end", "title": "" } ]
[ { "docid": "c836baf0537a986cabc36a54746c3fe0", "score": "0.80630386", "text": "def authenticated_with_token?(token)\n return false if token.nil?\n token == remember_digest\n end", "title": "" }, { "docid": "5ec35ee26c2748c37aaecd92eb4f2365", "score": "0.7701553", "text": "def ...
f5222baaee5a263eb53a2cd4b9d3552e
Show the number of words in each letter section of the hash.
[ { "docid": "ad122fca58a01a48bfe7888951c789c6", "score": "0.0", "text": "def debug\n @words.each_key do |ltr|\n printf \"%c: %5d\\n\", ltr.upcase, @words[ltr].length\n end\n end", "title": "" } ]
[ { "docid": "ab15abd6ba8b38361b2371c700a98d3f", "score": "0.76406556", "text": "def letter_counts(word) =\n word.chars.each_with_object(Hash.new(0)) { |c, counts| counts[c] += 1 }", "title": "" }, { "docid": "2e5a4549880a21528b01a510a0999f50", "score": "0.74432933", "text": "def lett...
4d576e5f3eb104ddd699fd8b5db51344
Prepend a task to the todo list As a rule, you should keep your variable names consistent Don't call the input to this method "task" unless it's actually a task Because a Task object has a description, and expects a description when initialized, we should call it "description" here, too.
[ { "docid": "1892e3fbb82cdf1efa1a9a7afb68625a", "score": "0.800816", "text": "def prepend(description)\n @tasks.unshift Task.new(description)\n end", "title": "" } ]
[ { "docid": "2be16ad63c3948be8d9ad344588cc2d7", "score": "0.67029613", "text": "def add_todo(task)\n if task == ''\n puts ' :| Nothing to Add - Try \\'A todo description\\''\n elsif $todo_list.length == 0\n #if first list element\n $todo_list.push [$priority, task]\n else\n #finding the r...
18ec912c68664e8908c4979b6dd1056e
Get a single location
[ { "docid": "8f01153a8ee1c2b289ee0267dc2de4d8", "score": "0.7384489", "text": "def location(id, options = {})\n get \"locations/#{id}\", options\n end", "title": "" } ]
[ { "docid": "f774fb4635e903a9db6d41dbcc04e4e5", "score": "0.80354464", "text": "def location\n fetch('hey_arnold.locations')\n end", "title": "" }, { "docid": "f4793879b982da8b3c0bce2e59a559c4", "score": "0.7749212", "text": "def location\n fetch('rick_and_mor...
ee14bee26c0a2bd0b11e024d6b57249f
Return as new item if date is more than 2 days old Arg: d is a Date object Arg: inline_styled is a Boolean for using inline CSS styles
[ { "docid": "74e21e11aff5c6b46f1827673c10704e", "score": "0.6520611", "text": "def mark_as_new(post_date:, inline_style: false)\n if post_date > (7.days / Settings.notify_frequency).seconds.ago\n return raw('<span style=\"font-size: 10px; font-weight: bold; color: #ffffff; background-color: #0099...
[ { "docid": "356fc0c62fb3b68f19efcff037a0aa0a", "score": "0.7299746", "text": "def mark_as_new(d, inline_styled = false)\n if d > (7.days/NOTIFY_FREQUENCY).ago\n return '<span style=\"font-size: 10px; font-weight: bold; color: #ffffff; background-color: #009900; padding: 1px 3px 1px 3px; margin: ...
7be4d501df9bae98648421c59a542450
GET /user_allergies/1 GET /user_allergies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "bf1225eb60752facd89ed0f17bc871e2", "score": "0.71783715", "text": "def index\n @user_allergies = UserAllergie.all\n end", "title": "" }, { "docid": "5a85bc384021181eb058c3bb1b5573f8", "score": "0.7007777", "text": "def allergies\n raise UserNotAuthenticated unless ...
3d71a4c0389213f251e98726724cf3e0
DELETE /players/1 DELETE /players/1.json
[ { "docid": "6d97f402e9f68b166affa6cd001d6178", "score": "0.7013425", "text": "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n respond_to do |format|\n format.html { redirect_to session.delete(:return_to), notice: \"Player now pending\" }\n format.json { head :no_c...
[ { "docid": "221858579afa4f11746f587f4bfaf259", "score": "0.77819896", "text": "def delete\n\n thePlayer = Player.find(@player_id)\n render :json => thePlayer.destroy, :except => [:password_digest]\n\n end", "title": "" }, { "docid": "d88b1d645b1bfaa512d198cd8c5e12a2", "score": "0....
54f5c89e4cc4c7b434d19350d4b5e628
Constructs a type of Enumerable elements. String.with(Integer, Float) === [ "foo", 1, 1.2 ] Hash.of(String.with(Integer))
[ { "docid": "d162fdf5a00cc743a40287215e3f40b4", "score": "0.52750534", "text": "def with *types\n EnumeratedType.new_cached(self, *types)\n end", "title": "" } ]
[ { "docid": "542ecb7eac70c244eac9c357dede0b34", "score": "0.5607576", "text": "def make_list(list)\r\n String.new(list)\r\nend", "title": "" }, { "docid": "6ec58ddb8d7067e7216ff0a539f15e88", "score": "0.553116", "text": "def fooey(str: \"foo\", num: 424242)\n [str, num]\nend", "t...
882493aaed364d614673befd91bd86cd
The search builder for finding recent documents Override of Blacklight::RequestBuilders
[ { "docid": "50b31ff9c6413727f5e6d8a1261e4e3a", "score": "0.0", "text": "def search_builder_class\n Hyrax::HomepageSearchBuilder\n end", "title": "" } ]
[ { "docid": "7c0dff7fc558f9317f7aad068ac4623f", "score": "0.6863461", "text": "def index\r\n search_params\r\n @documents = @documents.order_by(:updated_at.desc).limit(10)\r\n end", "title": "" }, { "docid": "0d409a58e6fa2e8e6e0f588b1c846fee", "score": "0.6433303", "text": "def...