query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d80c958cad748e6e8774b5978ab8ca9e
Create a Scribdstyle PageView. See
[ { "docid": "86f903bd5d34342a4889ca8d90c50005", "score": "0.5408691", "text": "def create_page_view\n PageView.create(:person_id => session[:person_id],\n :request_url => request.request_uri,\n :ip_address => request.remote_ip,\n :refere...
[ { "docid": "66fa225d8f3bfef9865be06777b98a38", "score": "0.6082716", "text": "def new_page(w = nil, h = nil, extra = {})\n w ||= self.w\n h ||= self.h\n page = Page.new(self, w, h, extra)\n return self.add_page(page)\n end", "title": "" }, { "docid": "...
a39449b8ef872395a0ea5a5511fe5ddd
before_action :authenticate_admin!, only: [:index]
[ { "docid": "63eb7933e7794592cd0782f0e4422e0d", "score": "0.0", "text": "def index\n @q = Company.ransack(params[:q])\n @companies = @q.result.includes(:industry).page(params[:page]).per(10)\n\n if params[:hide_archived] == 'true'\n @companies = @companies.unarchived.page(params[:page]).per...
[ { "docid": "424cef8dd025b3cf5dd57b5347158995", "score": "0.81504595", "text": "def admin\n authenticate_admin!\n end", "title": "" }, { "docid": "bd910a05b67abb401ad4e8ecbda59e3a", "score": "0.81330055", "text": "def authenticate_admin\n\t\tredirect_to root_path, notice: \"You ar...
ff8a8ecdabbd1abf646a7b64614d4aa1
GET /state_products GET /state_products.json
[ { "docid": "fb3cd89847f7834a7657fba8e52013d2", "score": "0.77143604", "text": "def index\n @state_products = StateProduct.all\n end", "title": "" } ]
[ { "docid": "69ca37a8eb677554e5032eda73e0c510", "score": "0.7622529", "text": "def show\n @product_state = ProductState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_state }\n end\n end", "title": "" }, { "...
602aaf3fb2046989e553c98c72772686
Call_Battle:: Reset the Idle/Run sprite if entering battle
[ { "docid": "c6d7edbe24353debd27d41f69cc787e5", "score": "0.69867676", "text": "def call_battle\n call_idle($game_player.old_character_name, false)\n syn_map_battle\n end", "title": "" } ]
[ { "docid": "bf2b947ba465ef4f990053f968ba75fb", "score": "0.68841785", "text": "def call_idle(sprite, anime)\n $game_player.set_step_anime(anime)\n $game_player.set_graphic(sprite)\n end", "title": "" }, { "docid": "f33f25aaa1df803fe5fa6bd250554f7d", "score": "0.681665", "text"...
a5a9e3378e281419fbe4c1c7b75dacde
Function for a user to unfollow the other_user
[ { "docid": "5ecf163113062ff4b6dab59ce5009957", "score": "0.8907478", "text": "def unfollow!(other_user)\n\t\trelationships.find_by(followed_id: other_user.id).destroy\n\tend", "title": "" } ]
[ { "docid": "ebc8850df9f6224d249fdeaeba1978c9", "score": "0.9028952", "text": "def unfollow(other_user)\n following.delete(other_user)\n end", "title": "" }, { "docid": "ebc8850df9f6224d249fdeaeba1978c9", "score": "0.9028952", "text": "def unfollow(other_user)\n following.delet...
ac3e6ed79eb70ab4b4fcc38fbc911d93
Calls succeed on deferrable object. When job (or it's callbacks) fails, errbacks are launched. If errbacks fails job will be relaunched. You can see custom exception 'CancelJob''. You can use it to change normal execution.
[ { "docid": "54a359dd62023b830db4152b1355544b", "score": "0.5839106", "text": "def do_job(job)\n job['run_at'] = Time.now\n job['status'] = 'in progress'\n job['attempt'] += 1\n storage.save(job) do |job|\n begin\n args = job['args'].merge(JR.config[:merge_job_itself_t...
[ { "docid": "0815b6275facd6128bc9c23c4bad2eff", "score": "0.67348915", "text": "def try_perform_later(...)\n job = job_or_instantiate(...)\n\n result = job.enqueue\n\n yield job if block_given?\n\n return Failure(job) if result == false\n\n Success(job)\n ...
63c9bde8fff45e14f2632104beefff07
scrub_external_ids() This method scrubs all _external_id's posted and resolves them to the actual id of the object in the databse. Does not return anything as it is meant to be part of before_filter
[ { "docid": "727bd07d6f84e7d39b6b07a46fed9082", "score": "0.7132505", "text": "def scrub_external_ids\n unless params[:criteria][:external_user_id].blank?\n id = ext_id params[:criteria][:external_user_id]\n user = User.where('external_id = ?', id)\n if user.count == 0\n @response =...
[ { "docid": "15df7b98610ac3335d846e1159b89bc1", "score": "0.6179246", "text": "def reset_external_id_matching_fields!\n @external_id_definitions_access_by = nil\n @external_id_definitions = nil\n end", "title": "" }, { "docid": "66cf2d325b0be390954d88b339560d6f", "score": "0....
26392360525a8dfe5ee19702cb7b2874
GET /events GET /events.json
[ { "docid": "3dbe7d1a7862ebbcf85612c69c1e112b", "score": "0.0", "text": "def index\n @search = Event.ransack(params[:q])\n @events = @search.result.order(created_at: :desc).page(params[:page])\n @event = Event.new\n respond_to do |format|\n format.html\n format.js\n end\n end", ...
[ { "docid": "5febda362ddaf472b8c6c6319cecc36f", "score": "0.8337294", "text": "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "title": "" }, { "docid": "6dfa825090a0345739db26145778532e", "score": "0....
65b9ae19d7eca524ea828757f1032725
could use function ARGV to create array and call ARGV[0]
[ { "docid": "9364463c08ab54242147a935c24c631a", "score": "0.0", "text": "def get_lines(filename)\n puts IO.readlines(filename).length #or can use .size\n end", "title": "" } ]
[ { "docid": "70d0a719fba7da46e9d0beb92cf614b8", "score": "0.74277437", "text": "def arg\n ARGV[0].to_s\nend", "title": "" }, { "docid": "868e25f7035a57123cf1f671d7bfc09c", "score": "0.71992236", "text": "def cmd_to_run\n\tarr = ARGV.dup\n\tarr = default_cmd if arr.empty?\n\tarr\nend"...
85e527c491bbda25d7d4d7b801770ff0
Gets the currently selected enemy.
[ { "docid": "d143c63b0117e18f3d389c8846acad82", "score": "0.67788416", "text": "def item() $data_enemies[SES::Bestiary.get_enemy_list[@index]] end", "title": "" } ]
[ { "docid": "b7bc82ed6167c0cf370c54d3ce2b8629", "score": "0.66665983", "text": "def get_enemy(id)\n # get enemies\n enemies = get_enemies(id)\n # return result\n return enemies[0].battler\n end", "title": "" }, { "docid": "78549815500f448905e5e554d02f507f", "score":...
d80e3825d34c78b79d6eea5e7ab8d45e
Define presentationspecific methods here. Helpers are accessed through `helpers` (aka `h`). You can override attributes, for example: def created_at helpers.content_tag :span, class: 'time' do object.created_at.strftime("%a %m/%d/%y") end end
[ { "docid": "40a339bfcb4b782c2bd10be9e3a15a4b", "score": "0.0", "text": "def game_link\n h.link_to object.title, object\n end", "title": "" } ]
[ { "docid": "d996ab73f8a6bd218752989f709597c3", "score": "0.6099943", "text": "def created_at\n helpers.content_tag :span, class: 'time' do\n object.created_at.strftime(\"%a %m/%d/%y\")\n end\n end", "title": "" }, { "docid": "7bbdaa8e8b2ebfef11cfb6781cf7c3a6", "score": "0.603...
1ac012d6c2da8fd2e5521d63bafdd9a9
delete_consumer deletes a consumer.
[ { "docid": "28dea2431013798ff207a72ef922b17b", "score": "0.6574287", "text": "def delete_consumer(stream, consumer, params={})\n raise JetStream::Error::InvalidStreamName.new(\"nats: invalid stream name\") if stream.nil? or stream.empty?\n raise JetStream::Error::InvalidConsumerName.new(\"...
[ { "docid": "b95b6c8a54f3fe4268e93a280519b992", "score": "0.7791261", "text": "def del_consumer(name)\n @log.info(\"Controller: Deleting Consumer #{name}\")\n @consumers.delete(name)\n end", "title": "" }, { "docid": "c18da89d9314d088fc484954a6d1fda1", "score": "0.75392663", ...
09f91b1f126d2e064387b776d48b5da7
Initialises a state machine object.
[ { "docid": "6f6ced5cbe3c0086ee9b79232c08a4fd", "score": "0.0", "text": "def initialize(final_states, transitions)\n @transitions = transitions\n @final_states = final_states\n end", "title": "" } ]
[ { "docid": "4f3169101863009584e04f3c0f84738a", "score": "0.74798983", "text": "def initialize_fsm\n @fsm_initialized = true\n @state = self.class.start_state\n @mutex = ::Mutex.new\n @state_changed = ::ConditionVariable.new\n end", "title": "" }, { "docid": "9fbdb84af1...
427e3568c9f14cf5dbce718524fc650b
method named 'assign_rooms' method takes a lit of speakers and assigns each speaker to a room method ensures that each room only has one speaker method returns a list of room assignments
[ { "docid": "ecc7eb78d97a7179096e759693ec82d2", "score": "0.7029193", "text": "def assign_rooms(speakers)\n room_assignments = []\n \n speakers.each_with_index do |name, index|\n room_assignments << \"Hello, #{name}! You'll be assigned to room #{(index+1)}!\"\n end\n \n room_assignments\nend", ...
[ { "docid": "3f99991f66e2fa2a0ceb8af3e14cd4e2", "score": "0.733185", "text": "def assign_rooms(speakers)\n speaker_with_room = []\n speakers.each_with_index do |name, index|\n room_number = index + 1\n speaker_with_room << \"Hello, #{name}! You'll be assigned to room #{room_number}!\"\n end\n s...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9c435cb6cf39dec54264c5330b8d142e", "score": "0.0", "text": "def set_db_job_status\n @db_job_status = DbJobStatus.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
4626c76949bfc900ceaa7345276aa094
Substitutes the supplied target documents for the existing document in the relation.
[ { "docid": "30efec9432e7579f80a8094a8079445b", "score": "0.5170329", "text": "def substitute(new_target, options = {})\n old_target = target\n tap do |relation|\n relation.target = new_target\n if new_target\n bind(options)\n else\n ...
[ { "docid": "47a37656eff7bcba6938cf99b3cbe876", "score": "0.70408255", "text": "def substitute(docs)\n batch_replace(docs)\n update_attributes_hash\n self\n end", "title": "" }, { "docid": "e4e75d0f2cfd2e56c52496cd26523da3", "score": "0.6647761", ...
0c6c6a4e95e616c9d0cdd59491fececb
returns the login name and email
[ { "docid": "43f8dcc644c79479900cb4cfd32e22e3", "score": "0.0", "text": "def name\n self.person.name if self.person\n end", "title": "" } ]
[ { "docid": "6ab7f9bce8d07b23140dbe70b3c5b11f", "score": "0.7810879", "text": "def get_userlogin()\n email = get_useremail()\n unless email\n puts \"Cannot continue without login information. Please define the git email address.\"\n exit 1\n end\n login = email.split('@'...
b478a5a1d79128c56abc056518074f73
Get the type of application executing the current code This is usually used to represent if you are running in a Rails server, Sidekiq job, Rake task etc... Bugsnag will automatically detect most application types for you
[ { "docid": "1eac579e158a729e7108890073893cf5", "score": "0.6716225", "text": "def app_type; end", "title": "" } ]
[ { "docid": "00a605e8b5ea06cf9b9d3a469a485524", "score": "0.76882243", "text": "def application_type\n ApplicationTypes.each do |type,block| \n @@application_type = type if block.call\n end if (@@application_type ||=nil).nil?\n \n @@application_type\n end", "title": "" ...
fac771bab83c059233d1f2fbc2485a1f
Overriding to_solr here seems cleaner than using :index_as on eventMetadata OM terminology.
[ { "docid": "49f7fc217090f05d25b0b6484ca54eb1", "score": "0.7744548", "text": "def to_solr(solr_doc=Hash.new, opts={})\n solr_doc = super(solr_doc, opts)\n solr_doc.merge!(ActiveFedora::SolrService.solr_name(:event_date_time, :date) => event_date_time,\n ActiveFedora::SolrService...
[ { "docid": "e3c18b7f18621c4bcc3d67077b1bf1f7", "score": "0.7945986", "text": "def to_solr\n as_index_document\n end", "title": "" }, { "docid": "5e7b6a79d3fb87f79d0ffee12c101cb9", "score": "0.75409937", "text": "def to_solr(solr_doc={}, opts={})\n super(solr_doc, opts)\n so...
24bf652091f11c070a95addc8280f8d6
Posts to '/api/unfriend'. This method exists because there are a ton of things that use this.
[ { "docid": "e3df3607f86302a66d047b954b3ed14c", "score": "0.7476613", "text": "def unfriend_wrapper opts = {}\n logged_in?\n params = { uh: @modhash, api_type: 'json'}\n params.merge! opts\n post('/api/unfriend', body: params)\n end", "title": "" } ]
[ { "docid": "285fdb3173d18ab8782aeb5015838157", "score": "0.74813694", "text": "def unfriend(id)\n post(\"users/#{id}/unfriend\").user\n end", "title": "" }, { "docid": "a5de94ff9d5ab65df803cb2e3e986039", "score": "0.7245657", "text": "def unfriend\n request_respons...
d0f6d9c778eae0abd38ef6c1096e2a48
Instantiate a new HookEvent object
[ { "docid": "352914ce3f527de15df7d300a4cee930", "score": "0.0", "text": "def initialize(name, event_name, from)\n @name = name\n @type = self.class\n @event_name = event_name\n @from = from\n freeze\n end", "title": "" } ]
[ { "docid": "433f67080373238853b82190661a3758", "score": "0.68542814", "text": "def initialize(hook)\n @hook = hook\n end", "title": "" }, { "docid": "ad8857ae8952e9ba75e1c1ca04f4cfe0", "score": "0.6798628", "text": "def new_event()\n Event.new(self)\n end", "t...
c79504cf5e6c72317e6162fc97fef3bd
PUT /participacao_eventos/1 PUT /participacao_eventos/1.json
[ { "docid": "a5b3c5bbe4b4a9ba7ab72c21c768c355", "score": "0.72387314", "text": "def update\n @participacao_evento = ParticipacaoEvento.find(params[:id])\n\n respond_to do |format|\n if @participacao_evento.update_attributes(params[:participacao_evento])\n format.html { redirect_to @part...
[ { "docid": "c1e91edfe4a0b5c098fb83a06d3cccfc", "score": "0.6987826", "text": "def update\n @event.update(event_params)\n head :no_content\n end", "title": "" }, { "docid": "53ecfc0ed574180a87c438318046f6f0", "score": "0.6907313", "text": "def update\n respond_to do |format|...
e9b181eb40e7a3640225d106aae28a4a
DELETE /todo_items/1 DELETE /todo_items/1.json
[ { "docid": "cca7c1214e6053ffab756f0584e3c25a", "score": "0.7444087", "text": "def destroy\n @todo_item.destroy\n respond_to do |format|\n format.html { redirect_to todo_items_url, notice: 'Todo item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "...
[ { "docid": "8dfc2e6c4022e9f425706baaa47881c8", "score": "0.78912485", "text": "def destroy\n @todo_item.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9a5d46fff8ebe54a07716de75c9f865", "score...
4ecd96d9241e46d6091986d2b56ee797
POST /blueprints POST /blueprints.xml
[ { "docid": "a276a413d3a9d43baa59a93588534c6e", "score": "0.75523466", "text": "def create\n @blueprint = Blueprint.new(params[:blueprint])\n\n respond_to do |format|\n if @blueprint.save\n format.html { redirect_to(@blueprint, :notice => 'Blueprint was successfully created.') }\n ...
[ { "docid": "067829048d8151f60309d3977ec9ea3c", "score": "0.7352576", "text": "def create\n @blueprint = Blueprint.new(blueprint_params)\n\n respond_to do |format|\n if @blueprint.save\n format.html { redirect_to @blueprint, notice: 'Blueprint was successfully created.' }\n forma...
17a93d440f19434e74b19fd825a3fa3f
PATCH/PUT /seam_stitch_branches/1 PATCH/PUT /seam_stitch_branches/1.json
[ { "docid": "aa16aa09ac3aeda4b9859c1274d68544", "score": "0.7032938", "text": "def update\n respond_to do |format|\n if @seam_stitch_branch.update(seam_stitch_branch_params)\n format.html { redirect_to @seam_stitch_branch, notice: 'Seam stitch branch was successfully updated.' }\n f...
[ { "docid": "0a968ac8d66a6978d82d509a3877a65b", "score": "0.65269655", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.json { render json: @branch, status: :ok }\n else\n format.json { render json: @branch.errors, status: :unprocessable...
16c68b6d0a34af0207deaa0e76a9d3dd
GET /postavshiks/new GET /postavshiks/new.json
[ { "docid": "56e71161840bf8124dc36a1c75bd6e94", "score": "0.78657424", "text": "def new\n @postavshik = Postavshik.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @postavshik }\n end\n end", "title": "" } ]
[ { "docid": "e7af6026fa18d3db50e29984a8fa0cb4", "score": "0.73406136", "text": "def new\n @postit = Postit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @postit }\n end\n end", "title": "" }, { "docid": "6b4453afc80296bdfd8388ce4b...
786ca860efd21691145fadc784d45096
Validate that the parent model of this blog post is defined, and that its a blog.
[ { "docid": "47c16d9c5948164ad3daaa445d963630", "score": "0.8344241", "text": "def validate_blog_post_ownership\n if parent.blank? || !parent.is_a?(Blog)\n errors.add(:parent_id, 'must be a blog')\n end\n end", "title": "" } ]
[ { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": "0.6455239", "text": "def parent?\n !parent_model_name.nil?\n end", "title": "" }, { "docid": "1916d1d0f97a46c2354a041dd5e7095b", "score": "0.6455239", "text": "def parent?\n !parent_model_name.nil?\n ...
4b11511c0427eb787c73b0a1d87f15d8
fsgetr get a value from a reference facet in a frameset requires that name[sname,ref] exists modifies nothing
[ { "docid": "aa7ba33d68df0cb707bc95d4f26ce7c3", "score": "0.48469028", "text": "def fsgetr(name, sname)\n if fexistr name sname\n r = fgetr name sname\n return r\n else\n return \"\"\n end\nend", "title": "" } ]
[ { "docid": "d94fbf00045dfc0b8ea7bf8944b5f95e", "score": "0.6370273", "text": "def fgetv(fname,sname)\n pname = \"\"\n if fexists fname, sname\n if eval \"$#{fname}['#{sname},facets'].include? 'ref'\"\n fname2 = eval \"$#{fname}['#{sname},ref']\"\n if eval \"$#{fname}['#{sname},facet...
546745a6a832318b61b562d3be08c1bf
Call the given block periodically at the given interval
[ { "docid": "23cf17f95096a75187f60717fe1e272f", "score": "0.7300156", "text": "def every(interval, &block)\n Timer.new(self, interval, true, &block)\n end", "title": "" } ]
[ { "docid": "764bd423df4559a7b1c2444538be8003", "score": "0.7602257", "text": "def after(interval, &block)\n spin do\n self.sleep interval\n block.()\n end\n end", "title": "" }, { "docid": "2595814314f3358a43c6096ecd55559b", "score": "0.7441548", "text": "d...
495c7fe4d5f712f98089072a935a5c8b
Print the name of the toy
[ { "docid": "613bfd765154d287787c33a3d78d06d3", "score": "0.73452526", "text": "def toy_name toy\n\t$toy_name = toy[\"title\"]\nend", "title": "" } ]
[ { "docid": "df57bcda1f21b6c4a4a7b5191f8f52e4", "score": "0.71869266", "text": "def name\n\t\t\t\"twitt\"\n\t\tend", "title": "" }, { "docid": "8957e15d8e09a541a7b3a5982322ef0b", "score": "0.7186704", "text": "def name\n\t\t\t\t\"twitt\"\n\t\t\tend", "title": "" }, { "doci...
8c871cde5ef695383175fb9eb5992614
Get the list of locations for an organization from the filters.
[ { "docid": "57488634986b4498ef91af393ad83db9", "score": "0.0", "text": "def org_id\n @org_id ||= filters&.fetch(:organization, nil)\n end", "title": "" } ]
[ { "docid": "028f875b0d98e8f94792f1af40d3c6e8", "score": "0.72795177", "text": "def list_locations\n list_groups(list_organizational_units.select { |g| g.match?(/^OU=Location/) }.first)\n end", "title": "" }, { "docid": "026a7e847760bdbf8f7a95b69ad6baae", "score": "0.6543751", "te...
b7e326011c014441feaf0ca1e80989c4
Returns the value of attribute request_pattern. source://webmock//lib/webmock/request_stub.rb6
[ { "docid": "314826d05f5a007c6b385376449919d9", "score": "0.76058024", "text": "def request_pattern; end", "title": "" } ]
[ { "docid": "6b096c51e05dd814e64610d1e02bae13", "score": "0.71830046", "text": "def request_pattern=(_arg0); end", "title": "" }, { "docid": "6b096c51e05dd814e64610d1e02bae13", "score": "0.71830046", "text": "def request_pattern=(_arg0); end", "title": "" }, { "docid": "6b...
256bfa1dd43e646b03c071e003379966
update the event description field for a given event for a user
[ { "docid": "dc2a565b9259e04fbf83c65e3f3c2b02", "score": "0.71506464", "text": "def update_event_description\n\t flash.keep(:url)\n\t\t\n\t\t#find the event \n\t @event = Event.find(:first, :conditions => [\"userid = ? AND eventid = ?\", session[\"timeline_id\"], params[:event][:update_eventid]])\...
[ { "docid": "a1fe61be183d24797869844d53908d9e", "score": "0.68666804", "text": "def set_EventDescription(value)\n set_input(\"EventDescription\", value)\n end", "title": "" }, { "docid": "0fbfaf11ee925eff831db893dd9dcd04", "score": "0.64606506", "text": "def update_des...
1864f3a196d0f60a2390a25eb7f842aa
Compose 3 elements into a Korean character String
[ { "docid": "9fc81d18147ef5484756ed8801dfa169", "score": "0.64712816", "text": "def compose chosung, jungsung = nil, jongsung = nil\n if chosung.nil? && jungsung.nil?\n \"\"\n elsif chosung && jungsung\n n1, n2, n3 =\n n1 = chosungs.index(chosung) || 0\n n2 = jungsungs.index(jun...
[ { "docid": "1c83b72b39fb7682d09f18ad48af9dea", "score": "0.629015", "text": "def encoding_characters\n [component, repeat, escape, subcomponent].compact.join\n end", "title": "" }, { "docid": "5a003795c73b16c843d72cfd909ae49c", "score": "0.626648", "text": "def for_tategaki\n...
91e5cc9333c2769fa4fc8a4b29ddee52
Minting a UUID creates a uuid for the record to use as a stable URL.
[ { "docid": "20997f96bb99f5e9100fbf2d3ff65cce", "score": "0.73970217", "text": "def mint_uuid\n self.url_uuid ||= Time.now.to_i\n end", "title": "" } ]
[ { "docid": "1a6af4d0dccc62fa112f7864b75910c8", "score": "0.7151515", "text": "def assign_uuid\n self.id = UUIDTools::UUID.timestamp_create().to_s\n end", "title": "" }, { "docid": "4de73ab1ee77773e60ff319425082af8", "score": "0.7116209", "text": "def olduuid uuid\n\trf = uuid\n\t...
0e5d39866c8a56bac36ffb3f0a852688
GET /work_item_types/1 GET /work_item_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "25cd282ff1755bcdc074766fc85cafef", "score": "0.77238095", "text": "def index\n @work_item_types = WorkItemType.all\n end", "title": "" }, { "docid": "c6978e6e17dd17678cb48565912d4434", "score": "0.69402456", "text": "def set_work_item_type\n @work_item_type = Wor...
6ca8d55b0770f8474ca9fb74ecb1cb7e
sentence.split.map(&:reverse).join(" ") end LOWPROCESS VERSION
[ { "docid": "7a9a391ae10c239e4c15b1488cdac24a", "score": "0.62930727", "text": "def reverse_words(sentence)\n arr_of_words = split_sentence(sentence)\n arr_of_reversed_words = reverse_array(arr_of_words)\n join_array(arr_of_reversed_words)\nend", "title": "" } ]
[ { "docid": "3998c26cea4ab709a18250206a03c2f7", "score": "0.715693", "text": "def solution(sentence)\n sentence.split.reverse.join(\" \")\nend", "title": "" }, { "docid": "b7e1bbc602b73e3deaf04ec604d21a0d", "score": "0.7047744", "text": "def solution(sentence)\n return sentence.spli...
0adf7134fb29c949f8dfb1284e424aa7
Administrator will return true if the logged in user has system role of Administrator('admin')
[ { "docid": "0014d2787e098bc79972f9f43b00e254", "score": "0.0", "text": "def is_admin?\n\t\tno_permission_redirection unless self.current_user && self.current_user.has_system_role('admin')\n end", "title": "" } ]
[ { "docid": "efd3f0909f9161f43bf0526eace3ab82", "score": "0.86048543", "text": "def admin?\n has_role?('administrator')\n end", "title": "" }, { "docid": "7b3eb23576affaeeb4d98cab0dfcfc65", "score": "0.85720915", "text": "def administrator?\n has_role? \"administrator\"\n ...
c069e5b12faa6362de04b9e6d31b2eef
GET /bets/1 GET /bets/1.json
[ { "docid": "a1e8ff6da1d5a12658faecb4ceeff848", "score": "0.0", "text": "def show\n redirect_to home_path, notice: 'Bet not found' unless @bet.present?\n end", "title": "" } ]
[ { "docid": "e5c0d9512dfcd9195faf48e1177653d6", "score": "0.7088522", "text": "def get_bets\n if loggedin?\n return get_request('GetBets')\n else\n #raise NotLoggedIn\n end\n end", "title": "" }, { "docid": "68d920b8f87fc92435c7da1e34d2d1cf", "score": "0.70...
3c82209546e33f1db6a893aacb7491ba
PATCH/PUT /protocolos/1 PATCH/PUT /protocolos/1.json
[ { "docid": "49d396aaa7df693d5a72059794dbeffb", "score": "0.6472184", "text": "def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n format.html { redirect_to @protocolo, notice: 'Protocolo was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "ad62c9eff9cf2f095f17850674354d72", "score": "0.6653646", "text": "def update\n respond_to do |format|\n if @protokol.update(protokol_params)\n format.html { redirect_to @protokol, notice: 'Protokol was successfully updated.' }\n format.json { render :show, status: :ok, ...
dfb638e47d49fb3f77d20af1ca1b9bbc
required, pattern, min, max, step, maxlength, disabled autocomplete, autofocus, placeholder Bootstrap: helptext TODO: All parameters share the same validations...
[ { "docid": "6fc1d53a76dfb348a4c0f098ffdd480e", "score": "0.0", "text": "def html_options\n @options\n end", "title": "" } ]
[ { "docid": "c8618d507c99f17d59f529aaf20cfcc6", "score": "0.63896495", "text": "def input_description(f, name, id = nil)\n f.input name, as: :text, input_html: { 'data-parsley-trigger': 'keyup',\n 'data-parsley-minlength': 3,\n ...
793a3671e07bbec64a199f26bbbc17b1
Remaps the input of the daemon into a format that's easy to use for the worker.
[ { "docid": "1cbfd1bc7180dbf37e0347249b43980d", "score": "0.58869106", "text": "def map_input(input)\n return input\n end", "title": "" } ]
[ { "docid": "fef1681812a2f0c01467c3fa1d1a833a", "score": "0.567244", "text": "def run\n get_input\n convert_commands\n create_map\n process_commands\n print_results\n end", "title": "" }, { "docid": "c83b3034a0fdb270b96d2cc8785448d9", "score": "0.5626847", "text": "def...
06a0db341847ce0d16a28dde74186497
Break up collective and let the ants go their individual way
[ { "docid": "186e972ec73a37ddcffbcb3ff4e3c4c6", "score": "0.5788985", "text": "def disband\n\t\t$logger.info \"Disbanding #{ self }\"\n\t\tleader = nil\n\t\t@ants.each do |a|\n\t\t\tif leader.nil?\n\t\t\t\tleader = a\n\t\t\t\ta.clear_orders\n\t\t\t\ta.collective = nil\n\t\t\telse\n\t\t\t\ta.collective = ...
[ { "docid": "bd5713de7cb0bf9bf0929807bd48484f", "score": "0.57297075", "text": "def moveAnts()\n # each ant follows trails ... .\n while (@currentIndex < @n - 1)\n @ants.each do |a|\n a.visitPoint(selectNextPoint(a), @currentIndex)\n end\n @currentIndex += 1\n end\n @ant...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2be2e67c4526c5a73cc250486d34c5f1", "score": "0.0", "text": "def instagram_user_params\n params.require(:instagram_user).permit(:name, :user_id, :instagram_user_id, :profile_image_url)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6978086", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6780264", "text": "def strong_params\n params.requi...
8affd7f3c3f6d08a0075d03756a0cc06
Returns the direct message if given, otherwise uses the default error message.
[ { "docid": "6f6714d2b8dfa9c2eacb1c90a8dfec6e", "score": "0.6523794", "text": "def error_message(type, message, object)\n message ||= self.class.default_validation_messages.fetch(type)\n message.is_a?(String) ? message : message.call(object)\n end", "title": "" } ]
[ { "docid": "edb040f1a97a0385d092b4a6b67e3073", "score": "0.7236108", "text": "def message_for_this_error\n ''\n end", "title": "" }, { "docid": "819ab1d819919d339bd36ca9634917bb", "score": "0.6942712", "text": "def message\n error.message || 'Unknown error'\n end", ...
1000cfc854dd0006fdd1b26872adf4ae
Wraps a collection of hashes from the API to a collection of the given model
[ { "docid": "2298b82d74a2dafc825803dcd09b941d", "score": "0.0", "text": "def has_many(name, options = {})\n self._associations = self._associations.merge({name => :has_many})\n\n self.send(:define_method, name) do\n klass = klass_for_association(options)\n instances = self...
[ { "docid": "68edaf743005d6caefa1612678c930ef", "score": "0.5985987", "text": "def instantiate_collection(result)\n hash = JSON.parse(result)\n hash['rows'].collect { |row| self.new(row['value'].merge('_id' => row['id'])) }\n end", "title": "" }, { "docid": "5f6379316...
7b329fdb1ed3d9bc489a911a083ed835
=============================================================================== Method to get Regional Dexes data. ===============================================================================
[ { "docid": "82646584c1f77ee4fdf640ca2fa801c4", "score": "0.0", "text": "def pbLoadRegionalDexes\r\n $PokemonTemp = PokemonTemp.new if !$PokemonTemp\r\n if !$PokemonTemp.regionalDexes\r\n $PokemonTemp.regionalDexes = load_data(\"Data/regional_dexes.dat\")\r\n end\r\n return $PokemonTemp.regionalDe...
[ { "docid": "4bb1eaff438740060ee0d18bd01f7fa3", "score": "0.6326285", "text": "def geographic_regions\n self.dig_for_array(\"geographicRegions\")\n end", "title": "" }, { "docid": "81cd7a90b9cacfac51b0558e3b82fbb8", "score": "0.5956352", "text": "def regions\n #@nationwide = Lo...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "b95cfd69cc7a8e2012ec547e6cb93b85", "score": "0.0", "text": "def update!(**args)\n @locations = args[:locations] if args.key?(:locations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\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...
5e829af5766770e0066b640bc6abc1c4
Do not use DateTime.parse, but parse the timestamp ourselves to return a integer to speed up parsing.
[ { "docid": "d936537d8ac6fc2fc6cc93a5ace8505c", "score": "0.0", "text": "def convert_timestamp(value, definition)\n \"#{value[7,4]}#{MONTHS[value[3,3]]}#{value[0,2]}#{value[12,2]}#{value[15,2]}#{value[18,2]}\".to_i\n end", "title": "" } ]
[ { "docid": "1d3702c814676dbf0ff147397754699b", "score": "0.7588258", "text": "def timestamp_parse(timestamp)\n timestamp\n end", "title": "" }, { "docid": "047b3d5d430548edb4eace03c475dbe9", "score": "0.73091954", "text": "def parse_time(time)\n DateTime.iso8601(time).to_time.to...
80ec1bfe76f722445b0f7d9835ac2547
True if the given user owns the opportunity
[ { "docid": "6d08601596a002b2d32656533f0de7e0", "score": "0.74118745", "text": "def owned_by?(user)\n if user.nil?\n false\n else\n organization == user.organization\n end\n end", "title": "" } ]
[ { "docid": "207c36f885a9568aeafc43d849f75e81", "score": "0.7829857", "text": "def owns?\n current_user && current_user == @user\n end", "title": "" }, { "docid": "179778f928aa4470f1b3b9834f6b5c6f", "score": "0.7392247", "text": "def owns? object\n case object.class.name\n w...
37dc88860419b2dfbe3dfe3566ba374a
Helps the command define methods to not use method missing on every instance. The original idea was to encourage to use uses for a small performance boost when running their commands since the methods would be created at load time. This idea has been since scrapped since it would make the commands look very convoluted ...
[ { "docid": "7a50c85b857c4c49d87e425efb514a70", "score": "0.0", "text": "def uses(*args)\n uses = limiters[:uses]\n return uses if args.empty?\n\n missing = args - uses\n attr_accessor(*missing) if missing.any?\n\n limiters[:uses] |= args\n end", "title": "" ...
[ { "docid": "a531ea0ab754b28ff2fe083f467522bc", "score": "0.70591223", "text": "def each_commands_methods\n Checker.documented_methods =\n Checker.commands.select {|i| raw_methods.include?(i)}\n Checker.undocumented_methods = Checker.commands - Checker.raw_methods\n Checker.u...
a643c5993b7d1939056b956bd93d5bd0
Get the map to the west
[ { "docid": "cfd45f6fcb5e216058c2262cc4cf42bb", "score": "0.8518863", "text": "def west_map\n Map.new(west) if west\n end", "title": "" } ]
[ { "docid": "1ac3651cc355fc8a71cc98c13173846c", "score": "0.8351624", "text": "def west\n map.at(x: x - 1, y:)\n end", "title": "" }, { "docid": "3841fa739bdbbdcd283e96225073b9fb", "score": "0.72382253", "text": "def north\n map.at(x:, y: y - 1)\n end", "title": ""...
245db5a1bdbdfea7a12ff9212b1875ce
Convert to string. Invokes to_s from wrapped matrix.
[ { "docid": "0497245fff36b3f2f63e11e1798f0aa9", "score": "0.0", "text": "def to_s\r\n Backend.active.to_s(@m) \r\n end", "title": "" } ]
[ { "docid": "97bda819a04c134e0247d53eeace8507", "score": "0.8119689", "text": "def to_s\n to_matrix.to_s\n end", "title": "" }, { "docid": "e37d35486e14970a58e22b2f1beb23f2", "score": "0.807493", "text": "def to_s\n @matrix.to_s\n end", "title": "" }, { "docid"...
ff79e8d4a8b3a56d51d405a186552289
GET /landscapers/new GET /landscapers/new.json
[ { "docid": "c7133fab09f24a5548f745deab4e32a6", "score": "0.65160006", "text": "def new\n @landscaper = Landscaper.new\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" } ]
[ { "docid": "72a763c41afef87a8631f45efb6ac310", "score": "0.6788369", "text": "def new\n @landlord = Landlord.find_by_id(session[:uid])\n @listing = @landlord.listings.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @listing }\n end\n end"...
4c9f377928ead82ae144a8c585d68da4
GET /squares GET /squares.json
[ { "docid": "7beadffc1682d46b8e73641b92a0a2b8", "score": "0.0", "text": "def index\n #school admin. Only list that schools students\n @squares = Square.where(school_id: current_teacher.school_id)\n \n # Paginate those squares and order by screen_name\n @squares = @squares.order('LOWER(scre...
[ { "docid": "918b24cae810d13de0f208c7638912f6", "score": "0.6898437", "text": "def index\n @squares = Square.all\n end", "title": "" }, { "docid": "918b24cae810d13de0f208c7638912f6", "score": "0.6898437", "text": "def index\n @squares = Square.all\n end", "title": "" }, ...
acf7779b26bff900bc1a7c8ab5493e2b
chages active tab to yellow
[ { "docid": "2e96302b5893b28f6fc454458e930ece", "score": "0.0", "text": "def chosen_rating?(rating)\n chosen_ratings = session[:ratings]\n return true if chosen_ratings.nil?\n chosen_ratings.include? rating\nend", "title": "" } ]
[ { "docid": "f062964b64c12fcc62aca815a10a787f", "score": "0.69285136", "text": "def am_i_active_tab (t)\n if t == $active_tab\n \"active\"\n else\n \"non-active\"\n end \n end", "title": "" }, { "docid": "5a4cd7fc7eed9eaf9e177658e7e6042a", "score": "0.68051225", ...
f11e3a1159b61a8d881236eca74cf798
Codes used to make another request if similars is found
[ { "docid": "4ac0fd56c2fcb23d24cda8444cc94704", "score": "0.5993943", "text": "def get_similars_codes\n if self.similars?\n transaction_number = @response['Products']['PremierProfile']['InputSummary']['InquiryTransactionNumber']\n experian_file_number = @response['Products']['Pre...
[ { "docid": "a3c259d8ea4465adb380b4774dfeed32", "score": "0.6794147", "text": "def find_similar\n\t params = {\n\t }\n\t @client.post(\"/findsimilars\", params)\n\tend", "title": "" }, { "docid": "5e1b70386a1352e11dbad18763bd515f", "score": "0.65746975", "text": "def find_similar\n...
c050839e26c108c991d74b16c98382dc
DELETE /projects/1 DELETE /projects/1.json
[ { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.7730425", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2395db8e8b2d56dc1e97347626464cb3", "score": "0.78948873", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d7a1cc2cfd84c0e660f50d58157424f", "score": "0.7859238", "...
efb8c25b447a9e8e830fefa3d3e7ef14
This method will return an array of all campuses associated to a given region_id
[ { "docid": "b8d5e2abc1d8c35f244a4d2a0f7541e3", "score": "0.7156553", "text": "def find_campuses_by_region(region_id)\n find(:all, :joins => :region, :conditions => {\"#{_(:id, :region)}\" => region_id}, :select => _(:short_desc), :order => _(:desc)).collect{ |c| [c.short_desc]}\n end...
[ { "docid": "2e402a5ae39262524c03d861763f447a", "score": "0.6903885", "text": "def regions\n self.campus.map {|x| x.city.region_id}\n end", "title": "" }, { "docid": "2e402a5ae39262524c03d861763f447a", "score": "0.6903885", "text": "def regions\n self.campus.map {|x| x.city.reg...
db75cbb02d7747c5d73c1c20bed93900
Sets quarantine flag for job
[ { "docid": "6b6a8a0ac400e16ef44957dee5410a33", "score": "0.7058616", "text": "def quarantine!(msg:)\n return if self.quarantined\n self.quarantined = true\n self.save\n create_log_entry(\"QUARANTINE\", msg)\n end", "title": "" } ]
[ { "docid": "c528be1eec24fab0319b73eb05ea51a1", "score": "0.7106971", "text": "def quarantine=(value)\n @quarantine = value\n end", "title": "" }, { "docid": "765813010f05fae2c553aea46061d8f9", "score": "0.7086625", "text": "def quarantine!(msg:)\n return ...
4873fe3d9afff32ad4e623602fc3e08d
Set the target position of the stepper motor
[ { "docid": "c064fb161219d18ed8ba57bdae3d460c", "score": "0.7472471", "text": "def stepper_target=(position)\n\t\t\t\traise ArgumentError.new \"Position must be an integer\" unless position.is_a? Fixnum\n\n\t\t\t\twrite(0x41, [position].pack(\"l>\"))\n\t\t\tend", "title": "" } ]
[ { "docid": "e6b2a48ca9cc010574098a4606eabfed", "score": "0.70186454", "text": "def set_target_position(position)\n send_request(FUNCTION_SET_TARGET_POSITION, [position], 'l', 0, '')\n end", "title": "" }, { "docid": "56a7e98f739b591ba59a6633f4766a63", "score": "0.6892585", "t...
ce791f978f022657627a1e997db272c4
Private: Checks for the stash/bitbucketserver post receive hook plugin headers.
[ { "docid": "daeb3a0fb42ea9cfdcae9e78d9bec394", "score": "0.6861229", "text": "def stash_webhook?\n # This payload is the `Web Post Hooks for Bitbucket Server` hook plugin.\n # https://marketplace.atlassian.com/apps/1211539/web-post-hooks-for-bitbucket-server?hosting=server&tab=overview\n ...
[ { "docid": "19452db295eaeccebceffbc7f8ee6c01", "score": "0.665276", "text": "def bitbucket_server_webhook?\n # https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html\n @headers.key?('HTTP_X_EVENT_KEY') && @headers.key?('HTTP_X_REQUEST_ID')\n end", "title": "...
9f08846cecca86acc602f677c54d06b3
extended returns the Mask32 in extended format (eg. x.x.x.x)
[ { "docid": "5314cf5abbcf392cc5516a52a503ce0a", "score": "0.7742835", "text": "def extended()\n\t\t\tUtil.int_to_IPv4(@mask)\n\t\tend", "title": "" } ]
[ { "docid": "daba67e62d778c6e25181c5983162162", "score": "0.7208561", "text": "def netmask_ext()\n return(NetAddr.ip_int_to_str(@netmask, 4))\n end", "title": "" }, { "docid": "8f65575b2d17bf6aed2cc4c755d28960", "score": "0.7200827", "text": "def hostmask_ext()\n retu...
4b74f9eac24a815f44fa3e34cc7a0a4b
def redirect respond_to do |format| format.js end end
[ { "docid": "c9b34b858c19840fe178c66207812805", "score": "0.0", "text": "def google_callback\n\t\t@user_info = request.env['omniauth.auth']\n\t\tx = User.find_by(name: @user_info['info']['name'])\n\t\tif x == nil\n\t\t\t@user = User.new\n\t\t\t@user.name = @user_info['info']['name']\n\t\t\t@user.picture ...
[ { "docid": "02ffaac1fb95ba7297786ac92074ba68", "score": "0.81008667", "text": "def index\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "a6ba8a6fe309b9d52354b2790c58be6b", "score": "0.80932164", "text": "def index\n respond_to do |forma...
b700ec88f7db3a0cbeb565a090b37a18
DELETE /skillsets/1 DELETE /skillsets/1.json
[ { "docid": "d170c715aed8797cbd516d31c9003eae", "score": "0.82080066", "text": "def destroy\n @skillset.destroy\n respond_to do |format|\n format.html { redirect_to skillsets_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2cb29ec5aa05e30fe2e2fd5b7401b92b", "score": "0.823043", "text": "def destroy\n @skill_set = SkillSet.find(params[:id])\n @skill_set.destroy\n\n respond_to do |format|\n format.html { redirect_to skill_sets_url }\n format.json { head :no_content }\n end\n end", "tit...
8145a8f3128f25d4572f7f77d7c68394
Override with an implementation that sets the cached value for many keys using the given key_value_map hash. Pass the :expires_in option to specify an expiration time (seconds). Others options should forwarded to the backend.
[ { "docid": "61566ed776ad070808f02e7776e0d924", "score": "0.0", "text": "def set_multi(key_value_map, options={})\n key_value_map.each do |key, value|\n set(key, value)\n end\n end", "title": "" } ]
[ { "docid": "ad8cdfd771132ee9322add23b41ddab2", "score": "0.7351937", "text": "def set(key, value, expires_in = 0)\n end", "title": "" }, { "docid": "482d0db9ad2afa0d1c064e98005c67b9", "score": "0.7064902", "text": "def set(key, value, opts = nil)\n if opts && opts[:expires_...
0f51a9b8a386094dc1ffcc7097ef396c
Returns [SemanticLogger::Formatters::Default] default formatter for this subscriber.
[ { "docid": "82108c12f5101710fb1f0ffd7595ec4c", "score": "0.84939146", "text": "def default_formatter\n SemanticLogger::Formatters::Default.new\n end", "title": "" } ]
[ { "docid": "68769dfc89fc2cbc24ed3d7a7d828719", "score": "0.80115557", "text": "def default_formatter\n Sapience::Formatters::Default.new\n end", "title": "" }, { "docid": "5ddc73e44babd648fd0855af857cd306", "score": "0.7827074", "text": "def default_formatter\n if prot...
855d998abf5d911292c3cf9ac6a899a1
=begin rdoc List ModelItem class instances contained in this list. Note: this is passed to the proxied class, as it is just a list of idents. Instantiating and adding an ident is handled by this class. =end
[ { "docid": "93b9b838ccfac7cc7751cebc8c6c1245", "score": "0.0", "text": "def list_in_path(model, path)\n @true_class.list_in_path(model, path)\n end", "title": "" } ]
[ { "docid": "6e518dd173a41d85b9d5582e19b38bbe", "score": "0.5953601", "text": "def make_item_list\n end", "title": "" }, { "docid": "adafd752501cc070c2bcaeeb47b6824b", "score": "0.57990026", "text": "def items\n reload unless attributes[\"items\"]\n\n @_items ||= Array(attr...
e92c785b10f8a104aa8ac4c0278e8378
GET /second_blogs GET /second_blogs.json
[ { "docid": "10b2e4db52dee4232c38bd56caead509", "score": "0.7630359", "text": "def index\n @second_blogs = SecondBlog.all\n end", "title": "" } ]
[ { "docid": "db5ec2e5c905e4d4094678fc6889c355", "score": "0.6741491", "text": "def set_second_blog\n @second_blog = SecondBlog.find(params[:id])\n end", "title": "" }, { "docid": "5dea84b18dd26997d80ed5abe57af1ba", "score": "0.67400247", "text": "def index\n @blogs = Blog.a...
b3f0a06371347d84125f03914221e016
GET /ss_classes/new GET /ss_classes/new.json
[ { "docid": "09a73244c0f5a3d351f37b79a66d1da2", "score": "0.8027317", "text": "def new\n @ss_class = SsClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ss_class }\n end\n end", "title": "" } ]
[ { "docid": "d755b91d67f0fac2dc7cb98267c0cd61", "score": "0.7561004", "text": "def new\n @klass = Klass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @klass }\n end\n end", "title": "" }, { "docid": "bb98127c133f2d6f01d9a2420ec4f3...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0355aa593d0b508b372143c2355bfab1", "score": "0.0", "text": "def set_seguimiento\n @seguimiento = Seguimiento.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...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "5fdcc3c3902f9cede9bf28d68fce0180", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateReadingResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "scor...
1d38a959364ce43e8137bc97b94403c7
A reference for a design is the issue reference, indexed by the filename with an optional infix when full. e.g. 123[homescreen.png] otherproject72[sidebar.jpg] 38/designs[transition.gif] 12["filename with [] in it.jpg"]
[ { "docid": "5af2a39d8371cb720434e9b9e94048f8", "score": "0.6754631", "text": "def to_reference(from = nil, full: false)\n infix = full ? '/designs' : ''\n safe_name = Sanitize.fragment(filename)\n\n \"#{issue.to_reference(from, full: full)}#{infix}[#{safe_name}]\"\n end", "title": ...
[ { "docid": "987f7b232a15681aac883052f5cde6d1", "score": "0.5755495", "text": "def ref_into_url(base, project, ref)\n\t\tcase ref\n\t\t\twhen /\\[(\\b[0-9a-f]{5,40}\\b)\\]/:\n\t\t\t\t[rev_url(base, project, $1), :changeset]\n\n\t\t\twhen /r(\\d+)/:\n\t\t\t\t[rev_url(base, project, $1), :changeset]\n\n ...
a4e60c447db05771fc45f5fe75a4c92f
Calls handle on the current implementation
[ { "docid": "023323b65f244e380ee01d57634b4a97", "score": "0.801841", "text": "def handle\n current_implementation.handle\n end", "title": "" } ]
[ { "docid": "dd607f844ad7fb5ed71da5d33f0f8a13", "score": "0.7951789", "text": "def method_missing(method, *args, &block)\n return super unless @handle.respond_to?(method)\n @handle.send(method, *args, &block)\n end", "title": "" }, { "docid": "dd607f844ad7fb5ed71da5d33f0f8a13", ...
7fbc8f302fe5db11af3f0701ec667b10
PATCH/PUT /translated_lines/1 PATCH/PUT /translated_lines/1.json
[ { "docid": "88cb5ba2db2a636e263a2dec38840d44", "score": "0.76529455", "text": "def update\n respond_to do |format|\n if @translated_line.update(translated_line_params)\n format.html { redirect_to @translated_line, notice: 'Translated line was successfully updated.' }\n format.json ...
[ { "docid": "2566a4319e0fe10316df72523d559527", "score": "0.6875655", "text": "def update\n @line = Line.find(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(line_params)\n format.html { redirect_to new_line_path, notice: 'Line was successfully updated.' }\n ...
1b33387a6f6a3efd08145f7ddc693bea
Accessor for all_seen_words hash
[ { "docid": "59957c9e7f7022dee60747b535d7bf1f", "score": "0.8327281", "text": "def all_seen_words\n @all_seen_words.keys\n end", "title": "" } ]
[ { "docid": "c2f8a9e44af15f770e2f7913b23b4602", "score": "0.7393394", "text": "def words\n @words_cache ||= @frequency.keys.flatten.uniq\n end", "title": "" }, { "docid": "cf82dab6cf3910313cc276831f8c47e8", "score": "0.6782432", "text": "def unique_words\r\n @frequencies.ke...
d1f623c16d4f6d14e5ba8e5a7cb14e54
Are the timestamps in reverse chronological order? (Duplicate timestamps are OK)
[ { "docid": "08226908c7efd29c9aaf5a38a422f255", "score": "0.69700295", "text": "def monotonic?\n prev_time = nil # argh name\n items.each do |i|\n if prev_time and prev_time < i.timestamp\n return false\n end\n prev_time = i.timestamp\n end\n true\n end", ...
[ { "docid": "eb04a7d9170da3dd87dbce428556ed1b", "score": "0.6448065", "text": "def check_timestamp(prev_time, curr_time, _b_num)\n prev_time1 = prev_time.split('.')[0].to_i\n prev_time2 = prev_time.split('.')[1].to_i\n curr_time1 = curr_time.split('.')[0].to_i\n curr_time2 = curr_time.split('...
7dc915616456635786b422fd701ad259
The absolute path to the GuestAdditions installer script. The iso file has to be mounted on +mount_point+.
[ { "docid": "5eb9a8781779c01c06890d7ba20a9cbf", "score": "0.6881014", "text": "def installer\n @installer ||= File.join(mount_point, 'VBoxLinuxAdditions.run')\n end", "title": "" } ]
[ { "docid": "e60ca6915001e93ee6b3b87a60a459d8", "score": "0.6653128", "text": "def windows_path\n if (p = ENV[\"VBOX_INSTALL_PATH\"]) && !p.empty?\n File.join(p, \"VBoxGuestAdditions.iso\")\n elsif (p = ENV[\"PROGRAM_FILES\"] || ENV[\"ProgramW6432\"] || ENV[\"PROGRAMFILES\"])...
359ebc95f49e9167298783eecfcad11b
Returns true if the current instance is followed by the passed record.
[ { "docid": "16b19bb3bcf0d6b15220032b25cf3973", "score": "0.61976904", "text": "def followed_by?(follower)\n Follow.unblocked.find(:first, :conditions => [\"followable_id = ? AND followable_type = ? AND follower_id = ? AND follower_type = ?\", self.id, parent_class_name(self), follower.id, paren...
[ { "docid": "b1aa9eff29601e552090c4a4a2b4e947", "score": "0.7155531", "text": "def followed_by?(resource)\n resource.following?(self)\n end", "title": "" }, { "docid": "97c13e05977f88900348f67769ff1ca9", "score": "0.6565245", "text": "def followed_by?(person)\n follow_relat...
ce4bbc6cb09acca96820caa2a2ea9247
Removes an Awarding from an awardable. It will also will double check if this removal invalidates awardings of parent awards.
[ { "docid": "5a2a85ff80460c5e15c8e956355396d1", "score": "0.8263268", "text": "def remove_awarding!(awardable, awarding)\n current_award = awarding.award\n awardable = awarding.awardable\n awardable_id = awarding.awardable_id\n awardable_type = awarding.awardable_type\n awarding....
[ { "docid": "365672388d9c5064b7b45200c783e293", "score": "0.5784269", "text": "def destroy\n\t\t@award = Award.find(params[:id])\n\t\t@award.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(awards_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend", "title": "" }, { ...
baaeeaf86599258e425b7a2bf791bf87
Connect to DDE Web Service using either a configuration file or an old Connection.
[ { "docid": "da6ced904f2c0c534b7ecdde93dfee3f", "score": "0.54347026", "text": "def connect(url:, username:, password:)\n @connection = establish_connection(url: url, username: username, password: password)\n end", "title": "" } ]
[ { "docid": "fb53b6573e8216d94d23a249b50502d0", "score": "0.6665251", "text": "def establish_connection(url:, username:, password:)\n LOGGER.debug 'Establishing new connection to DDE from configuration'\n\n # Block any automatic logins when processing request to avoid infinite loop\n # in reques...
48864c74c391517a115eed5bea2a294d
Duplicate internal data structures
[ { "docid": "6c05b4a564dce85aeb761b835ef0e853", "score": "0.0", "text": "def initialize_copy(other)\n super\n @initial_values = other.initial_values.dup\n @missing_initial_values = other.send(:missing_initial_values).dup\n @previous_changes = other.previous_changes.dup if other.previo...
[ { "docid": "3aa25d96536088252008ace87d426b09", "score": "0.76023674", "text": "def deep_dup; end", "title": "" }, { "docid": "e29ee3f4650335b1dfd8de79c8afc171", "score": "0.7447203", "text": "def deep_dup\n Marshal.load(Marshal.dump(self))\n end", "title": "" }, { "do...
5976224f372457a868e6e5e744dd30b4
reduce original distribution on whole genome to a motifspecific ensemble of site with different context distribution
[ { "docid": "ec5c929a541ae6b9d2a7af0dc6eaf8e4", "score": "0.51329404", "text": "def renormalize_at_reduced_set(total_ctx_freqs, reduced_ctx_freqs)\n norm = 1.0 / site_exposure(total_ctx_freqs, reduced_ctx_freqs)\n result = MutationProcess.empty_mutation_in_context_hsh\n ((0...4).to_a).repeated_p...
[ { "docid": "f814731fe8d83bde2bb66ccf55430a88", "score": "0.5633187", "text": "def clean_dataset!(job)\n # Remove useless proteins (no ID).\n #proteins = job.proteins.select { |p| p.protein_id }.uniq { |p| p.protein_id }\n proteins = []\n job.genes.each do |gene|\n ge...
e9f54ee9396f59e04178a5e596e4defa
When using prune_bundler, if extra runtime dependencies need to be loaded to initialize your app, then this setting can be used. This includes any Puma plugins. Before bundler is pruned, the gem names supplied will be looked up in the bundler context and then loaded again after bundler is pruned. Only applies if prune_...
[ { "docid": "04e4b80ccc9cf492d627ccb8816fee4e", "score": "0.0", "text": "def extra_runtime_dependencies(answer = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "dba459d2dc3db2c086d41ba191ad24b0", "score": "0.5641323", "text": "def prefetch gems\n end", "title": "" }, { "docid": "7e19e0b3b27b4a88bd1a8748b408e542", "score": "0.5601014", "text": "def no_bundler\n @bundler = false\n end", "title": "" }, { "docid"...
5399d76f53f3094ae5e8ac7ba376e1e5
GET /gizmo_type_groups/1 GET /gizmo_type_groups/1.xml
[ { "docid": "0dc1369ee6bf39009b70dc4e1acf22ed", "score": "0.70551515", "text": "def show\n @gizmo_type_group = GizmoTypeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gizmo_type_group }\n end\n end", "title": "" }...
[ { "docid": "8a4b1e42e003c37995b22c5519a597c3", "score": "0.7523103", "text": "def index\n @gizmo_type_groups = GizmoTypeGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @gizmo_type_groups }\n end\n end", "title": "" }, { "...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "7613734c7c4bb91fd837ca4ca94bfc34", "score": "0.0", "text": "def update!(**args)\n @canonical_finding_name = args[:canonical_finding_name] if args.key?(:canonical_finding_name)\n @finding_category = args[:finding_category] if args.key?(:finding_category)\n @name = a...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
86e827a23f493a48275422f533e989e2
Create a new question set\n
[ { "docid": "8967e2d95b9836acb1be87bcb2d4a266", "score": "0.6481765", "text": "def create_question_set(channel_uid, body)\n # checks if all required parameters are set\n \n raise ArgumentError, 'Missing required parameter \"channel_uid\"' if channel_uid.nil?\n \n raise ...
[ { "docid": "d2b8969e4852f01eaae1adc7ceb623f6", "score": "0.6605019", "text": "def equip_with_questions(set=nil)\n set = [\"now_how_happy\",\"now_how_alert\",\"now_how_purposeful\",\"self_reflection\"] if set.nil?\n set.each do |name|\n q = Question.find_by_name(name)\n Answer.create({sur...
318e150fe14230cb3c49df483dd5ff09
PUT /se_use_production_datas/1 PUT /se_use_production_datas/1.xml
[ { "docid": "7cba4491fa078bf46f3851e96bd825ab", "score": "0.68024796", "text": "def update\n @se_use_production_data = SeUseProductionData.find(params[:id])\n\n respond_to do |format|\n if @se_use_production_data.update_attributes(params[:se_use_production_data])\n format.html { redirec...
[ { "docid": "ce8f372167bc139eb18b988da9b21ffd", "score": "0.6433065", "text": "def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e....
b21eb220e6176946b38eafba1537401a
Does the given extension match this converter's list of acceptable extensions? Takes one argument: the file's extension (including the dot). ext The String extension to check. Returns true if it matches, false otherwise. source://jekyll4.2.2/lib/jekyll/converters/markdown.rb:65
[ { "docid": "b1cffaeaec238e6d06f2d6e8d48973e9", "score": "0.651062", "text": "def matches(ext); end", "title": "" } ]
[ { "docid": "90ccdbf1d739a60246b2456fbcfca85d", "score": "0.76888275", "text": "def matches(ext)\n ext =~ /^\\.(md|markdown)$/i\n end", "title": "" }, { "docid": "186ac29e7c017046ec2162b6465836e3", "score": "0.7255561", "text": "def known_extension?(ext)\n ext_to_mime(e...
dd201e97384e935c3d256e47855c884e
Base64 encoded object containing the user's ICN as the value
[ { "docid": "2bb5fcd789c3241b8641c23fb3e66662", "score": "0.7237804", "text": "def base64_encoded_launch\n json_obj = Oj.dump({ patient: user&.icn })\n\n Base64.encode64(json_obj)\n end", "title": "" } ]
[ { "docid": "82e63509b761b2417f2d629515a6202a", "score": "0.6644244", "text": "def to_s\n Base62.encode_bytes(uid)\n end", "title": "" }, { "docid": "9a56b46b867dc8c97e47cafb5fe10cc9", "score": "0.6441605", "text": "def encode_user_data(user_data)\n Base64.encode64(\"...
4046354cda98f94e351312423878a0ab
Converts the player to a hash. Renames parent to 'current_room'
[ { "docid": "5b3be465a30f24e5339396e6e3d23573", "score": "0.57612866", "text": "def to_resource\n\t\t\tr = super\n\t\t\tr[\"current room\"] = r.delete(:parent)\n\t\t\tr\n\t\tend", "title": "" } ]
[ { "docid": "422978d196d56cfcbbe5d8493c8e3125", "score": "0.6700167", "text": "def current_player\n { name: @game.cur_player.name, home_base: @game.cur_player.home_base }\n end", "title": "" }, { "docid": "1edc29889ce2c7ba679d0eb43361774c", "score": "0.5516124", "text": "def playe...
9a7808ea390d7659c511f44c7af4e287
POST /accountability_log_details POST /accountability_log_details.json
[ { "docid": "1436bc9187a64772dde16ad911e5147d", "score": "0.7771179", "text": "def create\n @accountability_log_detail = AccountabilityLogDetail.new(params[:accountability_log_detail])\n\n respond_to do |format|\n if @accountability_log_detail.save\n format.html { redirect_to @accountab...
[ { "docid": "b337f54d599b2ce27d06e211fbdba66b", "score": "0.7502219", "text": "def create\n @accountability_log = AccountabilityLog.new(params[:accountability_log])\n\n respond_to do |format|\n if @accountability_log.save\n format.html { redirect_to @accountability_log, notice: 'Account...
cd96502d31cd6a2672fdf3ce0af85b8d
Marks the water mode to one of +nil+, +:shore+, or +:sea+. If an invalid argument is provided, the water mode is not set.
[ { "docid": "81a00d16c894a7d08eee092e629d402f", "score": "0.8418737", "text": "def mark_water(water_mode)\n case water_mode\n when nil then mark_as_dry\n when :shore then mark_as_shore\n when :sea then mark_as_sea\n end\n end", "title": "" } ]
[ { "docid": "9c1ac6e6c129718f6c0772951758b394", "score": "0.8192641", "text": "def mark_as_sea\n @water_mode = :sea\n end", "title": "" }, { "docid": "7dd36ba329fbd19f3df3828f27a0d37a", "score": "0.71934885", "text": "def mark_as_shore\n @water_mode = :shore\n end", "title...
fd5f5a3505153b0616b1bd52bf1d4f57
Get an array of last weeks' start dates
[ { "docid": "0568ac8a8eb72045b2cded219bda26f3", "score": "0.0", "text": "def get_last_periods_date(num_times, end_date, date_function)\n last_periods_dates = []\n current_date = end_date\n num_times.times do\n last_periods_dates.push(current_date.send(date_function))\n current_date = c...
[ { "docid": "241048b02cd9dbe1a33289e22b82b066", "score": "0.7934479", "text": "def last_week(start_date)\n\n \tlast_week_start_date = start_date - 7.days\n \tlast_week_end_date = 6.days.since(last_week_start_date)\n\n \treturn (last_week_start_date..last_week_end_date).to_a\n end", "title": "" ...
2b6e2723fe9c6b945c3b2d64496634ac
iterate over the response hash to find the collection of `films` for the given `character` collect those film API urls, make a web request to each URL to get the info for that film return value of this method should be collection of info about each film. i.e. an array of hashes in which each hash reps a given film this...
[ { "docid": "0dae7b6e87a1ed03b94264d02c0f5b73", "score": "0.59213793", "text": "def print_movies(films)\n films.each do |single_film| #films is a hash, single_fiml is an array\n puts \"The movie name is #{single_film[\"title\"]} and the director of this movie is #{single_film[\"director\"]}.\"\n end...
[ { "docid": "2c014243982880a61d1743180e135f8b", "score": "0.8195072", "text": "def get_character_movies_from_api(character_name)\n #make the web request\n\n response_string = RestClient.get('http://www.swapi.co/api/people/')\n response_hash = JSON.parse(response_string)\n\n counter = 1\n films = []\...
06f3278cd21ebf6f5bc41b13670e1a32
Decode Method og_text = "theswiftfoxjumpedoverthelazydog"
[ { "docid": "0f054671a72a7220781ff59aff38e743", "score": "0.0", "text": "def decode(ciphertext, key)\n cipher = key.chars.uniq + (('a'..'z').to_a - key.chars)\n # p cipher\n plaintext_chars =\n ciphertext.chars.map do |char| \n # p char\n cipher[char.ord - 65]\n end\n plaintext_char...
[ { "docid": "ee3ae3c11d4d94141a0404d360f74044", "score": "0.6800851", "text": "def decode_railroad(encoded_phrase)\n # if hi my name is ryan becomes\n # hi name ryan\n # my is\n # how would you decode this?\nend", "title": "" }, { "docid": "0b19088768257090827ccc4c86c1d57b", "...
9c652975953a3990900730693fb25432
Parses links from executed request
[ { "docid": "bf351bc702b3f76583bb925a135182d0", "score": "0.0", "text": "def initialize(response_headers)\n link_header = response_headers[HEADER_LINK]\n if link_header && link_header =~ /(next|first|last|prev)/\n extract_links(link_header)\n else\n # When on the first page\n...
[ { "docid": "05e7ae75c8d67bad1396e7ddfd18ee6d", "score": "0.73463887", "text": "def parse_link; end", "title": "" }, { "docid": "ccb3556de8988fb502a0ed9fcb136914", "score": "0.7043262", "text": "def parse_links\n @body.scan(@@link_re) do |x|\n m = Regexp.last_match\n type...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "76a143981720abfa4ee9bb0988a68b7a", "score": "0.0", "text": "def onetimetoken_params\n params.require(:onetimetoken).permit(:title, :content)\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...
6a9e197a6c8bd0791ccc70b3c83873a2
Validate inputs and return error if invalid characters are passed. Standardize characters for easier processing in lexer
[ { "docid": "edbe0ec95dd150099ceebf75e617a60d", "score": "0.5780778", "text": "def regexp(raw)\n input = raw\n regexp = Regexp.new('\\A[A-Zv\\^\\&\\!\\~\\|\\-\\>\\<\\(\\)\\ \\[\\]\\{\\}\\,\\+]*\\z')\n if input.validate(regexp)\n input.gsub!(/v/, \"|\")\n input.gsub!(/\\^/, \"&\")\n ...
[ { "docid": "abe9f5495f751fee70c22846dc78bd0c", "score": "0.7149915", "text": "def valid_character; end", "title": "" }, { "docid": "4e536d2bb84abbbaafe013b1babc660a", "score": "0.6906134", "text": "def handle_cannot_use_special_characters\n # errors.add(:handle, \"field must only ...
e1d5241bd3a186d22c836f6f60dedf83
Exercise 2 Build a program that asks a user for the length and width of a room in meters and then displays the area of the room in both square meters and square feet. Note: 1 square meter == 10.7639 square feet
[ { "docid": "152efd9555e9e96cd07b20ad9be83f72", "score": "0.6707345", "text": "def meter_area(width, length)\n length * width\nend", "title": "" } ]
[ { "docid": "6afa669bd863218fb15c073f30deae7b", "score": "0.8423922", "text": "def length_room\n \n puts \"Enter the length of the room in meters:\"\n length_of_room = gets.chomp.to_i\n \n puts \"Enter the width of the room in meters:\"\n width_of_room = gets.chomp.to_f\n \n \n area = length_of_...