query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
eb4b0af30e98f7704ddf4420ea328379
GET /tweets/new GET /tweets/new.json
[ { "docid": "25c77e4e1bc12abab2a225f157a6bdce", "score": "0.79214805", "text": "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end", "title": "" } ]
[ { "docid": "2483b45e16788049512487cfc58dfad3", "score": "0.7846836", "text": "def new\n @gettweet = Gettweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gettweet }\n end\n end", "title": "" }, { "docid": "a239b2ca7f399f6da9a64...
786261441c3373a07f8af6f9469c0ee5
get a 3 digit year like 965 from the date array
[ { "docid": "0b9c6f016bd840b0203b93f18b44f8be", "score": "0.74933946", "text": "def get_three_digit_year(dates)\n dates.each do |f_date|\n matches = f_date.scan(/\\d{3}/)\n return matches.first unless matches.empty?\n end\n nil\n end", "title": "" } ]
[ { "docid": "f70a831ca6574e3fd6444503154cb169", "score": "0.7957415", "text": "def post_year\n chars = @date.split('')\n chars.pop(4).join('').to_i\n end", "title": "" }, { "docid": "a65722e5d31ba404622a1f4e1c4337fa", "score": "0.76246166", "text": "def year(date)\n y = da...
5037a1469d72ca5fdf61028913963c82
DELETE /notes/1 DELETE /notes/1.json
[ { "docid": "d8cf4ee3184fa97ed2c1f3a50b91cc75", "score": "0.68935496", "text": "def destroy\n #@note.destroy\n @note.update(status: 1)\n respond_to do |format|\n format.html { redirect_to notes_url, notice: 'Note was successfully destroyed.' }\n format.js { redirect_to root_path, notic...
[ { "docid": "b6898f57991dab97533b9ca0c7d58ac8", "score": "0.7653369", "text": "def destroy\n @note = Note.find(params[:id])\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to(notes_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "do...
edef0d47ba5e80b803be1b2e6000a86f
TODO(janek): refactor to Rack::Response
[ { "docid": "1d4100ce3e45e4a09478c1c568a258ac", "score": "0.0", "text": "def call(env)\n @req = Rack::Request.new(env)\n return [401, {}, []] unless secret_valid?\n amount = parse_amount\n return [200, {}, ['event skipped']] unless amount\n return [422, {}, ['notification failed'...
[ { "docid": "e5a217b8850eb3ebf856ac29387bf5eb", "score": "0.80667275", "text": "def rack_response; end", "title": "" }, { "docid": "24630eddea7e3a451e2dba564cb67795", "score": "0.75006294", "text": "def rack_response\n [status, headers, Merb::Rack::StreamWrapper.new(body)]\n end",...
7e19114d6c323c9ab65d1197c0bc05d2
Returns a deep copy of the object
[ { "docid": "ede82a943451f55bdca99074bf8abc78", "score": "0.0", "text": "def dup\n # TODO Shouldn't deep copy include @start?\n ret = Measure.new(self.name, self.start)\n ret << self.notes\n ret.score_attrs = self.score_attrs \n ret\n end", "title": "" } ]
[ { "docid": "419686a3f64d2fbdfe1a50fbba0b72a0", "score": "0.882", "text": "def deep_copy(obj); end", "title": "" }, { "docid": "f193fe09970660637e8ddd329b61517d", "score": "0.87556475", "text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "title": "" }, { ...
b9f67f51b53dadfb9e58fef5012703e1
GET /dictionary_searches/1 GET /dictionary_searches/1.xml
[ { "docid": "453168bd1e7c56db0c28769f11045a2e", "score": "0.0", "text": "def show #for browsing letters\n letter_id = params[:id]\n @language = ComplexScripts::Language.find(params[:language_id])\n @words = Word.where(:letter_id => letter_id, :language_id => @language).order('`order`').paginate(...
[ { "docid": "ca691a3da3ca6adab090584a990eb1e0", "score": "0.675259", "text": "def index\n @current_action = \"dictionary\"\n\n (@response, @document_list) = search_results(params)\n respond_to do |format|\n format.html {} # no longer store_preferred_view\n format.rss { render layout: f...
542e9dfd463f68ceee5492f6bb8ce762
initial logic to find the uncommon connections. NEEDS WORK
[ { "docid": "8164d6e3493d715e5a604963a8d17099", "score": "0.6524565", "text": "def match_connections(common_unique_connections, uncommon_unique_symbols)\n # we then match the uncommon unique connections to the @@routes[:connections] keys,\n # and take only the connections that are on our origin and...
[ { "docid": "110bf07cc5de33f9706f7f898bbfd49b", "score": "0.6918895", "text": "def doubly_single_contig_connections\n likelies = []\n\n already_seen_connections = Set.new\n\n @graph.vertices.each do |v|\n # If there is only 1 connection on both sides, then go with that\n neighbours = @...
ad8b58067f53d867c71ad13d5a969493
para mostrar el perfil del usuario
[ { "docid": "4941aab6730c5fb94c0cd981e7b4e0db", "score": "0.0", "text": "def show\n @post = Post.find(params[:id])\n @post_likes = @post.likes\n #@user_likes = Like.where(user: current_user)\n end", "title": "" } ]
[ { "docid": "8131fc8157cc6db58f02f3394214eafe", "score": "0.7463867", "text": "def perfil\n @usuario = usuario_actual\n @perfil = true\n end", "title": "" }, { "docid": "3f3d99dfed4a2903509a6424a7e4e01c", "score": "0.6594103", "text": "def set_usuario_perfil\n @usuario_per...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0c13e7a0fde524f0dc66af93125fa903", "score": "0.0", "text": "def escalation_rule_params\n params.require(:escalation_rule).permit(:name, :airplane_mode_on, :weekend_airplane_mode_on, :weekday_airplane_mode_on, :weekend_airplane_mode_start_time, :weekend_airplane_mode_end_time, :weekday_air...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
a413ef030d3232205851cf5ad47c8703
GET /users/1 GET /users/1.xml
[ { "docid": "2698fc1bfa90b9eb87dd47871ee7cf2f", "score": "0.0", "text": "def show\n @user = User.find(params[:id], :include => [:timesheets, :leave_requests])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" ...
[ { "docid": "156ffeeb9dfbc9b33c5e4e53037c1d05", "score": "0.7207758", "text": "def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end", "title": "" }, { "docid": "78c91061ae58b...
4c49f048f35666bd96d852341753e0fb
GET /party_types GET /party_types.json
[ { "docid": "68d59a272683a85d0cf721a74f5aa8f8", "score": "0.7094701", "text": "def index\n @party_types = PartyType.all\n end", "title": "" } ]
[ { "docid": "1b77431c6d1997cf5f09ac97fbe60589", "score": "0.6601929", "text": "def types\n @types = Tournament.tournament_types.keys.to_a\n respond_to do |format|\n format.json { render json: @types }\n end\n end", "title": "" }, { "docid": "d83c08f38d3e155a8797fdcb78c561cb", ...
d64d06eb79978831665dceecea0340c7
Scenario: same name Default: duplicate parameter name
[ { "docid": "734be880e2388c2ffe818133ff369427", "score": "0.0", "text": "def method a, b, a\r\n\t1\r\nend", "title": "" } ]
[ { "docid": "c8282a856016adc4b1b95e7c8ce25d4c", "score": "0.7243605", "text": "def default_params(name = 'AJ')\n puts \"this has a param of #{name}\"\nend", "title": "" }, { "docid": "3876c838cfb735d99c8f77b09a44e78f", "score": "0.69590884", "text": "def test_multiple_default_params\...
6ff40e4d5d14d7875d1ba78e6a2cdddc
to prevent undefined method when forms are involved
[ { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.0", "text": "def protect_against_forgery?\n false\n end", "title": "" } ]
[ { "docid": "4c5ddadeffb8658af85b4d31d78c26f0", "score": "0.7534891", "text": "def form; end", "title": "" }, { "docid": "ed80fd23bc50e115eaf3684844e2f451", "score": "0.7295134", "text": "def forms; end", "title": "" }, { "docid": "7f4062295ce1779b92f25a3123e93f85", "s...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "95c858e7a5ecae6053e5d9552a1057a6", "score": "0.0", "text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8270299", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "d730a9ea60df6695b2c6a153d7d3a8b7", "score": "0.794916", "text": "def hash\n as_hash.hash\n end", "title": "" }, { "docid":...
e2cc34b3132f507d7549193c326a4683
get events ordered by start time for index page
[ { "docid": "763387c0935a90caa6770b1bb02f4406", "score": "0.0", "text": "def index\n\t\t# simply call filter with category \"All\"\n\t\t@cat = \"All\"\n\t\tfilter\n end", "title": "" } ]
[ { "docid": "761e1dcaf3e0057e522275fc6b688d57", "score": "0.81812936", "text": "def index\n @events = Event.all.order('start_at ASC')\n end", "title": "" }, { "docid": "bf8231101db5000933c9b783c606d3dc", "score": "0.785142", "text": "def index_admin\n @events = Event.all.order(...
5542283453a62dd2c04b2cdd6fc109ae
Make sure you define the other required methods, too
[ { "docid": "96903e4cc3cbf48d93e9e1d35843d868", "score": "0.0", "text": "def guess(number)\n if number > @answer\n @solved = false\n return :high\n elsif number < @answer\n @solved = false\n return :low\n else\n @solved = true\n return :correct\n end\n end", ...
[ { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.7806481", "text": "def methods; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.72786516", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4...
e3587a310e4e51806393bfffcf187a8a
Deletes then creates a new session in the database.
[ { "docid": "2f8e62cf84c51eae5a5541080755f3ad", "score": "0.6560072", "text": "def delete_session(req, sid, _options)\n # Get the current database record for this session then delete it.\n find_session_model(req, sid).delete\n # Generate a new one and return it's ID\n find_ses...
[ { "docid": "3b620291e8523209c64666dce62cc8fd", "score": "0.659694", "text": "def create_session; end", "title": "" }, { "docid": "2d8bd6cf9cb71332858d9a6b10b15a22", "score": "0.65387374", "text": "def create!(*args)\n session = new(*args)\n session.save!\n ...
24c37496f9212f5b1ab4dcf71ce04538
name of ospfare node in ospfarea layer
[ { "docid": "a0f8d26a15f2ecfc40f1604f96ff8e71", "score": "0.72919935", "text": "def area_node_name(asn, area)\n \"as#{asn}-area#{area}\"\n end", "title": "" } ]
[ { "docid": "a627b103c48aa8904e4c9aeb307a1f7e", "score": "0.67223614", "text": "def name\n node.name\n end", "title": "" }, { "docid": "a627b103c48aa8904e4c9aeb307a1f7e", "score": "0.67223614", "text": "def name\n node.name\n end", "title": "" }, { "docid":...
e6fd9b8a0f6e1631b393746fdd0088f5
Check if command is place
[ { "docid": "2373596d72238144ade8145a400cb22b", "score": "0.8544757", "text": "def place_command?(cmd)\n cmd == 'PLACE'\n end", "title": "" } ]
[ { "docid": "ecd3f7596a9c6869fbe7a3c1a9403b9f", "score": "0.8555485", "text": "def place_command?\n command.eql? WHITE_LIST.first\n end", "title": "" }, { "docid": "7e430d34a81ef66bac39d530c08f33ba", "score": "0.83226144", "text": "def place_command?(command)\n !!(command =...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d2608f433e10bcd76b03e2907424d2e0", "score": "0.0", "text": "def set_review\n @review = Review.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...
f70c0202ed2e258922e207233861f6b7
The name of the directory to store the persistent store. Defaults to ~/.tenacious_g
[ { "docid": "bd6c837ed02b0435f676872f49a5e69d", "score": "0.7447416", "text": "def directory\n @directory ||= File.expand_path(File.join(ENV['HOME'], '.tenacious_g'))\n end", "title": "" } ]
[ { "docid": "3fb6e2264fc77e8263d20e9101bd45b2", "score": "0.803086", "text": "def store_dir\n \"manaca\"\n end", "title": "" }, { "docid": "108a64a542b8f36ad3db61d43b5fe6b8", "score": "0.7844157", "text": "def store_dir\n \"\"\n end", "title": "" }, { "docid": "11b...
00ec8b76b2596a13b1325d5c4ecabee5
orders tracks by "most recent", limit 15
[ { "docid": "d1962646c70946ecd989df4c9f066d84", "score": "0.7022017", "text": "def get_recent_tracks\n tracks = Track.order_by(created_at: 1).limit(15)\n render(json: tracks)\n end", "title": "" } ]
[ { "docid": "f00c8517ce882db6deb3ef33521759ec", "score": "0.63878167", "text": "def top_tracks\n call('artist.gettoptracks', :toptracks, Track, {:artist => @name})\n end", "title": "" }, { "docid": "bca25b6484464164a2be98f3eee8b0d1", "score": "0.63661677", "text": "def spotify...
f93b3f016e1e7fd2181168cf54c762ab
Returns true if the given token matches the digest.
[ { "docid": "e76d92a8fc1508b92953de3de5396faa", "score": "0.0", "text": "def authenticated?(remember_token)\n\t\treturn false if remember_digest.nil?\n \tBCrypt::Password.new(remember_digest).is_password?(remember_token)\n\tend", "title": "" } ]
[ { "docid": "8ddd0f11de4f651615620fb44c9e44e9", "score": "0.82018155", "text": "def matches_token?(digest, token)\n if digest.present?\n BCrypt::Password.new(digest).is_password?(token)\n else\n false\n end\n rescue BCrypt::Errors::InvalidHash\n false\n end", "...
cd6986b3bffd36db875c4898a1355451
DELETE /sorts/1 DELETE /sorts/1.json
[ { "docid": "87f36350db56b95a01a6dec18503b269", "score": "0.7536233", "text": "def destroy\n @sort = Sort.find(params[:id])\n @sort.destroy\n\n respond_to do |format|\n format.html { redirect_to sorts_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "467870c3964575a3951e2c54e8acf1ae", "score": "0.77136815", "text": "def destroy\n @sort.destroy\n respond_to do |format|\n format.html { redirect_to sorts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5899c032d5ef327403ff129c...
795d954db8c19a05670b9d3e830a2076
Create the admin role, or find it if it exists already
[ { "docid": "f77ffed2a7794c9a31b513ae41fd1db4", "score": "0.8395168", "text": "def admin_role\n Role.find_or_create_by(name: \"admin\")\n end", "title": "" } ]
[ { "docid": "f96adf4eb31888b2295de322cad49a47", "score": "0.7961668", "text": "def set_admin_role\n\t admin_role = Role.where(name: 'admin').first_or_create\n\t self.roles << admin_role unless self.roles.include? admin_role\n\tend", "title": "" }, { "docid": "99df15664d578b885151c13aaa9a13f...
7a40abf445d5b9e111eb7a2352c29869
GET /micrroposts/1 GET /micrroposts/1.json
[ { "docid": "66ce7c2e6c3aecf2a6c9f5004b95f658", "score": "0.7776771", "text": "def show\n @micrropost = Micrropost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @micrropost }\n end\n end", "title": "" } ]
[ { "docid": "ba4f6456458d6580a4e82cb7973bc7c4", "score": "0.7732385", "text": "def show\n @micropost = Micropost.find(params[:id])\n\t\t respond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render json: @micropost }\n\t\t end\n\n end", "title": "" }, { "doc...
370d60c86e8a5d14c5c34a3425dd130b
DELETE /packages/1 or /packages/1.json
[ { "docid": "68f0e58b5545ad4774bbbab98ef6c3d0", "score": "0.68540764", "text": "def destroy\n @package.destroy\n respond_to do |format|\n format.html { redirect_to packages_url, notice: \"Package was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "d604a401ceb7cdcfab5c142f8155ca46", "score": "0.70909977", "text": "def destroy\n @package = Package.find(params[:id])\n @package.destroy\n\n respond_to do |format|\n format.html { redirect_to packages_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
5f41e0cf23e7dffeafa159936e140960
returns parsed json from reddit api / json url Returns the link to the largest url on a given HTML page.
[ { "docid": "a7a8ab2a0268624ed454417586dafaf5", "score": "0.5972047", "text": "def findBiggestPhotoUrl(imagesURL)\n # @parsedJson['data']['children'].each { |dogurl| dogurl['data']['url'] NEED TO ADD CLOSING } \n \n #debug puts imagesURL\n \n response = RestClient.get(imagesURL)\n @doc ...
[ { "docid": "71b4003678cf397b5bcd89ca212a61e1", "score": "0.72293115", "text": "def GetRedditLinks(url)\n # Initialize array to store links to return\n links = []\n\n # Run reddit query and parse into json object\n while true\n begin\n results = JSON.parse(open(url).read)\n ...
1b13d6018f5ba977e201877e33c22e07
Creates a new Service instance.
[ { "docid": "6cd2d85459954bf96423aad2154a3d8f", "score": "0.0", "text": "def initialize project_id, credentials, retries: nil, timeout: nil, key: nil, host: nil\n @project_id = project_id\n @credentials = credentials\n @retries = retries\n @timeout = timeout\n ...
[ { "docid": "912497a609ae65bef6694972ee08640d", "score": "0.7934143", "text": "def create_service\n raise NotImplementedError\n end", "title": "" }, { "docid": "4e8188dc29b95326a8253dd0ccb51937", "score": "0.7907464", "text": "def create_service(options)\n require_r...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fe8208f29912cf6059634f82c58f5a51", "score": "0.0", "text": "def set_search_keyword\n @search_keyword = current_user.search_keywords.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
823d6ee00bcdb218c15f31131a2af34c
Read token value function
[ { "docid": "f6d2f0c5f241e5ce2668c273cdeb3bf6", "score": "0.0", "text": "def read_token(target_file)\n File.open(target_file, \"r\") do |file| \n file.read.delete!(\"\\n\")\n end\nend", "title": "" } ]
[ { "docid": "a80d32dd07e28183ca1b506ebefc9a78", "score": "0.7642836", "text": "def token\n read_token\n end", "title": "" }, { "docid": "ddd9428a44e841924bfceeb759ac893b", "score": "0.7562374", "text": "def value\n @token\n end", "title": "" }, { "docid": "6320...
02b623c54cb4535ae34d108a2530605e
GET /frotas/1 GET /frotas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e00d54ba7ae5c2ac5b5896c006b9c2ae", "score": "0.69716537", "text": "def show\n @faktura = Faktura.find(params[:id])\n\n render json: @faktura\n end", "title": "" }, { "docid": "f78cf9d18a5758fdda3b08fd22d3a2c9", "score": "0.6877624", "text": "def show\n @safra_br...
0241846ee16fc3aaffc6bf05710d8ec4
and returns the average of all numbers in the array. The array will never be empty and the numbers will always be positive integers. Your result should also be an integer.
[ { "docid": "596b8db1d6047f1e41718dbe9e78cb91", "score": "0.81931853", "text": "def average(arr)\n sum = 0\n arr.each { |n| sum += n }\n sum / arr.length # to return float, use sum.to_f for this step\nend", "title": "" } ]
[ { "docid": "a24273cc2a6cc6aaae48bd0f8aa3d9d1", "score": "0.86793804", "text": "def array_int_avg(array=nil)\n # If we didn't get an actual array, return 0\n return 0 if array.nil?\n # If the array has 0 elements in it, return 0\n return 0 if array.size < 1\n # Use some array inject magic to sum all...
c79aae47599fbe87bcf9b9b614fb9b7b
Determines the count of results in the set
[ { "docid": "e148b91ef77a05d67829f311452ce6d0", "score": "0.76431435", "text": "def count\n @results.size\n end", "title": "" } ]
[ { "docid": "10293659db156638502ae7ad6008efe6", "score": "0.8124642", "text": "def count\n set.count\n end", "title": "" }, { "docid": "10293659db156638502ae7ad6008efe6", "score": "0.8124642", "text": "def count\n set.count\n end", "title": "" }, { "docid":...
742d265e3504c399242ee45bcacaca86
Destroy all objects that match +conditions+. Warning: if +conditions+ is +nil+, all records in the collection will be destroyed.
[ { "docid": "0a32fef33744570c65846b7c317b4be5", "score": "0.86742765", "text": "def destroy_all(conditions = nil)\n all(:conditions => conditions).each { |object| object.destroy }\n end", "title": "" } ]
[ { "docid": "aa1a767e751ce597ae68ddd217447fce", "score": "0.86300373", "text": "def destroy_all(conditions = nil)\n find(:all, :conditions => conditions).each { |object| object.destroy }\n end", "title": "" }, { "docid": "aa1a767e751ce597ae68ddd217447fce", "score": "0.86300373...
07ef43b82099831c4d6578c78a60997e
Convert a number to bytes
[ { "docid": "945cf96112f6acf48797af884535edb4", "score": "0.7428066", "text": "def bytes_for number\n type = size = 0\n values = []\n if number < CONST and number >= -CONST\n type, size = 1, 2\n elsif number < LCONST and number >= -LCONST\n type, size = 2, 4\n else\n ...
[ { "docid": "25696a89317c08a3898e3ba07351c0bb", "score": "0.8268579", "text": "def num_to_bytes(val)\n val = val.to_i.to_s(16)\n val = \"0#{val}\" if val.length.odd?\n [val].pack('H*')\n end", "title": "" }, { "docid": "f11f65db9efc50151f64b2759a4ceb9b", "score": "0.7494...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fbe892f19eb8ec783aae1cea04e55556", "score": "0.0", "text": "def set_image\n @image = Image.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...
fced54f32e8891223b29300d94d1a742
Sets the meetingTimeSlot property value. A time period suggested for the meeting.
[ { "docid": "89ef9dd823bacfc27ef2a1494514a827", "score": "0.86420345", "text": "def meeting_time_slot=(value)\n @meeting_time_slot = value\n end", "title": "" } ]
[ { "docid": "cc10998abc9f4a6b28fe26a6712ab9b4", "score": "0.7021458", "text": "def set_time_slot\n @time_slot = TimeSlot.find(params[:id])\n end", "title": "" }, { "docid": "558d95087befd190250b51e2a7c0c9c1", "score": "0.68287677", "text": "def set_time_slot\n @time_s...
cfcd771e760cf53c84cd62f66f28643d
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity
[ { "docid": "719f04ef9c2e49ac802bd8f97ff6e9a9", "score": "0.0", "text": "def handle_submodels(temp_parts)\n @submodels.each do |submodel|\n count = 0\n store_lines = false\n\n @lines.each_with_index do |line, i|\n store_lines = true if (line.downcase == \"0 file #{submodel.downca...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.73606664", "text": "def private; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6086037", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4...
3784061a448f6b6898279c261a5f6f8f
GET /teachers GET /teachers.json
[ { "docid": "92c8b1ae2cbebe2dfe102e93b264ac58", "score": "0.0", "text": "def index\n @teachers = Teacher.all\n @branch_teachers = Teacher.where(branch_id: session[:licensee_branch_id])\n end", "title": "" } ]
[ { "docid": "6d609c69cc44a44c47ed6ca6078069f6", "score": "0.7910668", "text": "def index\n @teachers = Teacher.all\n render json: @teachers\n end", "title": "" }, { "docid": "519c0bbd9f8b2ff6b6c110453ef68a03", "score": "0.7761079", "text": "def index\n @teachers = Teacher.al...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d9f57f1530e2e1b3f8718d939bc2a1ef", "score": "0.0", "text": "def set_pop\n @pop = Pop.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "de...
b5b4b99bc12dcfc06f1cf346212246a4
POST /heat_cycles POST /heat_cycles.xml
[ { "docid": "a62976e1de41a26f6f86cc05fe9f292f", "score": "0.6044343", "text": "def create\n @heat_cycle = HeatCycle.new(params[:heat_cycle])\n @dames = Dame.find(:all)\n\n respond_to do |format|\n if @heat_cycle.save\n format.html { redirect_to(heat_cycles_path, :notice => 'Heat cycl...
[ { "docid": "7c5494b4c2b00d93a8897836afee1daf", "score": "0.56633365", "text": "def create\n @maintenance_cycle = MaintenanceCycle.new(params[:maintenance_cycle])\n\n respond_to do |format|\n if @maintenance_cycle.save\n format.html { redirect_to @maintenance_cycle, notice: 'Maintenance...
1f715959f5447e5ab3d00b31e0afaf81
Simple way to process commandline arguments Return [value1, ... valueK]; modifies args If remove, we remove the used arguments from args. Each element of names is either a string name or a tuple [name, type, default value, required, description].
[ { "docid": "c736504b209c6d0a9548fa396e48ba8e", "score": "0.71580297", "text": "def extractArgs(options)\n d = lambda { |x,y| x != nil ? x : y }\n args = options[:args] || ARGV\n remove = d.call(options[:remove], true)\n spec = options[:spec] || []\n recognizeAllOpts = d.call(options[:recognizeAllOp...
[ { "docid": "4642ee5a37ac0a0ffe6abc585b397b3f", "score": "0.7421492", "text": "def parse_args(args, names=[])\n options, args = args.partition {|e| e =~ /^-/ }\n options = options.inject({}) do |hash, flag|\n key, value = flag.split('=')\n name = key.sub(/^--?/,'')\n name =...
be9ec93ea0d2758de26c84513632de41
The Add method should throw an exception when called with an input starting with a separator or containing multiple separators following each other.
[ { "docid": "14b5b311338888b891e45a8080f92d27", "score": "0.0", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNext8\n # Arrange.\n @inputValue = '1;\\n2'\n @errorMessage = \"Number expected but '\\\\n' found at position 2.\"\n\n # A...
[ { "docid": "a4c7a94250afc931f5286d90fbd61f6d", "score": "0.7603663", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration108\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep21sep32'\n @errorMessage = \"...
833716960c44966234483aef956666d1
PATCH/PUT /bill_lists/1 PATCH/PUT /bill_lists/1.json
[ { "docid": "d33fc168bfbf8ddd391a709e3f424fab", "score": "0.7458151", "text": "def update\n respond_to do |format|\n if @bill_list.update(bill_list_params)\n format.html { redirect_to @bill_list, notice: 'Bill list was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "3bc8413505caf86f0b231bec70b6f220", "score": "0.71611106", "text": "def update_list(list_id, name)\n return base_uri('patch', 'lists/' + list_id, name)\n end", "title": "" }, { "docid": "1f65cb325808ecef40843e22e097f9c7", "score": "0.6923366", "text": "def update_list(...
230cc831d37f9b3a79324e75d807f72d
Creates a child, adds it to children, and returns the child
[ { "docid": "e6375894f51e7bae1d3e9e0e631819a9", "score": "0.7202443", "text": "def add_child(name)\n child = self.class.new(name, self)\n yield child if block_given?\n children << child\n child\n end", "title": "" } ]
[ { "docid": "660cd1ac1468a6fd604e50bf63a07acd", "score": "0.7699538", "text": "def add_child child\n @children << child\n end", "title": "" }, { "docid": "be3cb18a819b65d97c53f23a48990188", "score": "0.76480246", "text": "def add_child child\n @children << child\n...
fd0c4c8408b469863fb273606b883a2b
Put action initialisation code in here
[ { "docid": "426fab7637c88b9b8c4f592ae9c39d66", "score": "0.0", "text": "def before_perform\n \n @basename = File.join(job.job_dir, job.jobid)\n @seqfile = @basename+\".in\"\n params_to_file(@seqfile, 'sequence_input', 'sequence_file')\n @commands = []\n @informat = params['informat'] ?...
[ { "docid": "63e39c04cc2f1ac44f979040a22b6267", "score": "0.7588432", "text": "def initialize( name , action )\n super(name)\n\n @action = action\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.7264002", "text": "def init_actions\n ...
f809bab3e7f080af6af80f411a04b7e5
GET /fiddles/all GET /fiddles/all.json
[ { "docid": "69a903437ec231403d9de45d4f46604a", "score": "0.595376", "text": "def all\n @tree = Fiddle.tree( Fiddle.all )\n render :index\n end", "title": "" } ]
[ { "docid": "2f3a78b0a2a5d4c7b7308f9a33def1df", "score": "0.66575754", "text": "def show\n @fiddle = Fiddle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @fiddle }\n end\n end", "title": "" }, { "docid": "2a6d9ba...
c4dfc12985e6762abf9b1ad3b9422b2d
Public: Returns all the features that the adapter knows of.
[ { "docid": "06aba83e0cd2ed390b49e5d122075674", "score": "0.66482174", "text": "def features\n set_members(FeaturesKey)\n end", "title": "" } ]
[ { "docid": "8af18d28b6b2e39b2536924bc350bb7b", "score": "0.781146", "text": "def features\n return @discovery_document['features'] || []\n end", "title": "" }, { "docid": "0c50fc159789f07c14f5844939b13861", "score": "0.7733682", "text": "def features\n []\n en...
c5fc114283053bbf414980192f6b8d02
convert cvar assignments in controllers to self
[ { "docid": "f1689730e88a0c5df841eb2a91296937", "score": "0.54220265", "text": "def on_cvasgn(node)\n if @ngContext == :controller\n if node.children.length == 1\n process s(:attr, s(:self), \"#{node.children.first.to_s[2..-1]}\")\n else\n process s(:send, s...
[ { "docid": "3fa7c40adf59a3dafcd85b8c1c79ad35", "score": "0.6651597", "text": "def controller=(controller); end", "title": "" }, { "docid": "45afd4fb175d24afbafa4c4a421e4607", "score": "0.6439405", "text": "def assign_variables_from_controller\n @assigns.each { |key, value| ins...
ae86fe23f063c648837fd378e92a26df
Respond to messages sent in
[ { "docid": "db17fd7b31b888ea00c65e3241d9fd82", "score": "0.0", "text": "def responses\n @from = params[:From]\n u = User.find_by_phone(@from)\n b = params[:Body]\n\n if b.downcase.include?(\"yes\")\n @type = \"Yes\"\n # @yes = u.yes.build(:description => b)\n # @yes.save!\n render 'v...
[ { "docid": "7a6d0b23cfc828a99be42edc320742c0", "score": "0.70829153", "text": "def reply(request_msg, response_msg)\n\t\tend", "title": "" }, { "docid": "1da18fcaca6394b2168617c292ba3818", "score": "0.6870212", "text": "def handle_messages()\n ##\n end", "title"...
b6597acf6f06c33696cfdb04ae815cc7
Defines the player turn. 1. Asks users for a board position between 19. 2. Users input gets assigned to variable 'input' 3. input_to_index helper method is called to convert user input from str, to int and then to the equivalent array index value. This is assigned to variable 'position'. 4. Call valid_move? helper meth...
[ { "docid": "f940d80f29e62ca6b51de5a4aa67eacc", "score": "0.78862345", "text": "def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n position = input_to_index(input)\n \n if valid_move?(board, position) == true\n move(board, position, current_player(board))\n display_board(board...
[ { "docid": "cb428b2f42b9f86c5ffc99879013e134", "score": "0.8518845", "text": "def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip #get user input and store in variable 'input'\n index = input_to_index(input) #convert user response into an integer and subtract 1\n\n\n # m...
c3d9a6fb31d2991c1a34a9f4363a10c3
Defining print out to screen method
[ { "docid": "b7195b1ec1aa4b56bc102b9ed1bd987e", "score": "0.0", "text": "def print_double(array)\n width = array.flatten.max.to_s.size + 2\n puts puts array.map { |a| a.map { |i| i.to_s.rjust(width)}.join}\n print \" \" \nend", "title": "" } ]
[ { "docid": "173b321ff3b4e40f1a4ab7a9616a1a50", "score": "0.7690548", "text": "def print_screen\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "154eea0951d87ae9880cf3596bc78395", "score": "0.76448464", "text": "def print\n self.display_board\n e...
3aefa853604a5ec2143c42fc0ae0c2c7
lexer rule t__12! (T__12) (in Ga.g)
[ { "docid": "45b410b5cf16af44018c7bdec1448275", "score": "0.6701547", "text": "def t__12!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = T__12\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - ...
[ { "docid": "93fde6c044749d0a67baaceb673842f9", "score": "0.71701354", "text": "def t__30!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n\n\n type = T__30\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\...
0cf8df5f1430e3870ee84bfc20dc734b
Action to check that User account is approved by TMX Staff.
[ { "docid": "5a28edf9bf2ea3ab4d6ca4aac2415204", "score": "0.59851044", "text": "def check_user_account!\n if(current_user.present? && (current_user.service_type == 'pending' || !current_user.is_active?))\n service_type = current_user.service_type\n sign_out(current_user)\n redirect_to r...
[ { "docid": "6958e3530f94d21a5d6a19fde8ed441b", "score": "0.7024731", "text": "def approved?\n (status == ConfigCenter::User::APPROVED)\n end", "title": "" }, { "docid": "2916570ae22802791b311bc310a43314", "score": "0.6654551", "text": "def can_approve?(target)\n is_staff? && t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "17c43e93e119faade2f63a207c4703c6", "score": "0.0", "text": "def set_extra_task\n @extra_task = ExtraTask.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...
7026ef11feafcd2e21661e00a2852c9a
assigns the passed user_id as a reader for the project gives the user rights to read
[ { "docid": "f63fae062131f4ff314d203bc685e17e", "score": "0.73205256", "text": "def assign_reader(user_id)\n add_user(user_id)\n end", "title": "" } ]
[ { "docid": "49943356ef1a5f39c2bb63c999a6a3af", "score": "0.7429787", "text": "def assign_reader(user_id)\n\t\tadd_user(user_id)\n\tend", "title": "" }, { "docid": "fb505b690211ee5a5e108064c7569255", "score": "0.66494733", "text": "def permits_read_acccess_for(user)\n end", "ti...
f6dfd920a67eb7e99207bb062cc7e23f
Initial item being combined Object Initialization
[ { "docid": "0f3af32c539a9edf7c83263294a476ed", "score": "0.0", "text": "def initialize\n super(160, 64, 320, 416)\n @column_max = 1\n refresh\n self.index = 0\n @first_item = 0\n end", "title": "" } ]
[ { "docid": "73d8fd895a75b55a07597cbfe0ea1c7c", "score": "0.70699567", "text": "def init\n \n end", "title": "" }, { "docid": "73d8fd895a75b55a07597cbfe0ea1c7c", "score": "0.70699567", "text": "def init\n \n end", "title": "" }, { "docid": "70bf8cb295fd...
16ebd8fe8db5f7be5b451aac6a3450cb
Your solution should not mutate the input arrays.
[ { "docid": "7744fad64cd90738cc7bf0befae8e7bb", "score": "0.0", "text": "def merge(ar_1, ar_2)\n result = []\n until ar_1.empty? || ar_2.empty?\n if ar_1[0] < ar_2[0]\n result << ar_1[0]\n ar_1 = ar_1[1..-1]\n else\n result << ar_2[0]\n ar_2 = ar_2[1..-1]\n end\n end\n re...
[ { "docid": "0e1650c328df86055edc4bdc380a0512", "score": "0.6833931", "text": "def reduce_to_all_true(source_array)\nend", "title": "" }, { "docid": "da98a2a24fb94ead91c4d78f03c0df94", "score": "0.65797496", "text": "def mutliplied(array)\nend", "title": "" }, { "docid": "...
18977195644d4cd3c3d4195cb780559a
Returns the value of attribute kid_generator. source://jwt//lib/jwt/configuration/jwk_configuration.rb24
[ { "docid": "588e949eb54b736f7a7e964a07d7ef53", "score": "0.6941904", "text": "def kid_generator; end", "title": "" } ]
[ { "docid": "8c52b5cdf2da531c25a8e07198934019", "score": "0.6374542", "text": "def jwt_key\n 'ec6a8b69ae22049f900af9bd9f14ffb4dc6937f69575ab49b4df2d28364055b8'\n end", "title": "" }, { "docid": "aae0dd62c8a3641ac05f651f6337a177", "score": "0.6339932", "text": "def generate_key; en...
cba738059278e80ce2c88e096ef2e737
POST /rewards POST /rewards.json
[ { "docid": "04048b667f307144d33d322c206084f6", "score": "0.6175709", "text": "def create\n @reward = Reward.new(params[:reward])\n @reward.creator = current_user\n respond_to do |format|\n if @reward.save\n format.html { redirect_to @reward, :notice => 'Reward was successfully creat...
[ { "docid": "7a02fee11d62a308ef300ce9bb439e69", "score": "0.7289644", "text": "def create\n @reward = current_user.rewards.new(params[:reward])\n\n respond_to do |format|\n if @reward.save\n format.html { redirect_to @reward, notice: 'Reward was successfully created.' }\n format....
c4aeb222f48d9d8a6f0140cb88289ff2
make_dlist Creates a string of emails that can be added as b/cc field.
[ { "docid": "c8abca9f1252b3315434e46422e72b33", "score": "0.73475873", "text": "def make_dlist(cuds)\n emails = []\n\n cuds.each do |cud|\n emails << cud.user.email.to_s\n end\n\n emails.join(\",\")\n end", "title": "" } ]
[ { "docid": "501345bf674d47d2f9b9c94552527c40", "score": "0.5707204", "text": "def email_list\n @entries.collect do |line|\n name, email = line.split(\",\")\n format_email_address name, email.chomp\n end.join(\", \")\n end", "title": "" }, { "docid": "f2d77a9bf4850d1a842603f3...
90d21bd5a88214c0981eb3efd119edab
Initialize root object with params
[ { "docid": "bfdeee431ff54ce17b9caee3b9c1672e", "score": "0.0", "text": "def __root_object_initialize(h, value)\n return self.root = value unless value.is_a?(Hash)\n value.each do |key, val|\n root[key].__initialize_with(val)\n end\n end", "title": "" } ]
[ { "docid": "0d496e1887126b69b6d6aa4045da4f61", "score": "0.80697054", "text": "def init(params)\n end", "title": "" }, { "docid": "85f5843e102838e41578f93db75096fe", "score": "0.7408803", "text": "def initialize(params = {})\n end", "title": "" }, { "docid": "...
8324e8d0a7b317a2d280ca71bc95a18c
allow params to be read like a hash
[ { "docid": "35be18e842ddf8edaf26200e5387751d", "score": "0.0", "text": "def [](option)\n send(option)\n end", "title": "" } ]
[ { "docid": "fbb9f3d380a0c5c808032a4b81e39d3f", "score": "0.7480503", "text": "def params=(hash); end", "title": "" }, { "docid": "fbb9f3d380a0c5c808032a4b81e39d3f", "score": "0.7480503", "text": "def params=(hash); end", "title": "" }, { "docid": "fbb9f3d380a0c5c808032a4b...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1d45cd9e9f88bf31d06a81705e6c0ab5", "score": "0.0", "text": "def set_term\n @term = Term.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60322535", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6012846", "text": "de...
67b8b0cfda2cce4cad263735573ed349
WMAP Find a target matching this id
[ { "docid": "6ff562b19c70e080a4904cc7fd3ba362", "score": "0.7814065", "text": "def get_target(id)\n\t\ttarget = WmapTarget.find(:first, :conditions => [ \"id = ?\", id])\n\t\treturn target\n\tend", "title": "" } ]
[ { "docid": "61cda41b305eb56c1195c7910dfa820c", "score": "0.6854425", "text": "def get_target(id)\n\t\ttarget = Target.find(:first, :conditions => [ \"id = ?\", id])\n\t\treturn target\n\tend", "title": "" }, { "docid": "ce74822787d2ef85b7854baab36f92ba", "score": "0.63346165", "text"...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "79cadc51fbe8f7f18ad62fb5228e87b7", "score": "0.0", "text": "def show\n if current_user.is_admin?\n redirect_to users_path\n else\n redirect_to edit_user_path\n end\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.771752", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75107867", "text": "def user\n...
305ac72380412a4edd7fc5c5c681bb0c
Return the list of users
[ { "docid": "053b7beddf963c06788491f9c2c73e8e", "score": "0.0", "text": "def children\n fail Dav::Exception::MethodNotAllowed, 'Listing members of this collection is disabled' if @disable_listing\n\n children = []\n @principal_backend.principals_by_prefix(@principal_prefix).each do |...
[ { "docid": "64a5fabad6696b9341c55818473e710c", "score": "0.86708903", "text": "def list_users\n GoodData::Domain.list_users(name)\n end", "title": "" }, { "docid": "3083a609df43880c713006fb8b2f42de", "score": "0.8518037", "text": "def list\n @users = User.find(:all)\n end...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "acedeb166a3943d6c1861dfe0c7a1085", "score": "0.0", "text": "def booking_clerk_params\n params.require(:booking_clerk).permit(:first_name, :last_name, :address_line_1, :address_line_2, :town, :post_code, :tel_no, :email, :password, :password_confirmation, :type)\n end", "title": "...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
5c7b798e4f3c33fd8cfa14d6150645ea
Returns true if step has not been aborted
[ { "docid": "f128e5f3ec60bf52f1564c4f68b2b8a2", "score": "0.6685982", "text": "def is_active?\n aborted_at.nil?\n end", "title": "" } ]
[ { "docid": "c26f0d3f16960f346535bf7042f3e86d", "score": "0.79473686", "text": "def aborted?\n @aborted\n end", "title": "" }, { "docid": "d388aa6060923f97b601086cba743d28", "score": "0.72713315", "text": "def step_completed?\n !object.waiting_on.include?(scope)\n end", "t...
f8ef81088bbd4694135faadc30536f1d
Indicate whether the given log entry should be skipped if log output is going to AWS CloudWatch.
[ { "docid": "fd39cebe43f67b23f0453834bd6f02ec", "score": "0.0", "text": "def filter_out?(message)\n message.is_a?(String) && FILTER_OUT.any? { |expr| expr.match?(message) }\n end", "title": "" } ]
[ { "docid": "42f90b1b051b7117af5eb398432141e9", "score": "0.65287125", "text": "def skip_audit?\n @skip ||= false\n end", "title": "" }, { "docid": "8601f2af3e3c34e0d89146e5daf574b1", "score": "0.6434345", "text": "def skip_audit?\n @skip_audit\n end", "title": "" ...
e0c7f9b6f8e7635e74a047bda1a4abd1
Scenario: the second one has default value (positive) Default: pass
[ { "docid": "884b343be99af460e96130350f4b73b2", "score": "0.0", "text": "def method(a, b=-4)\r\n\ta + b\r\nend", "title": "" } ]
[ { "docid": "2839210063b11893908dd4040a28125c", "score": "0.6430022", "text": "def test_both_players_exceed_defcon\n scenario us: 4, ussr: 5, defcon: 3\n assert_no_award\n end", "title": "" }, { "docid": "129ba69e736bce44053d3473ebd2926c", "score": "0.6268735", "text": "def tes...
2a101e4d2991e6618cba623681f74816
Take a list of targets and return the list of objects that this GameObject can see.
[ { "docid": "33e5d1a4db51611c5bba9966319dae3f", "score": "0.6737933", "text": "def filter_visible_targets(targets, limit = nil)\n vis_targets = []\n if limit\n count = 0\n targets.each do |t|\n if can_see?(t)\n vis_targets.push(t)\n ...
[ { "docid": "2c7e49b0802002ea877ff0df849e2d3c", "score": "0.66928977", "text": "def targets()\n if @target then\n return [self]\n else\n return []\n end\n end", "title": "" }, { "docid": "438511c56119a740b410129dcc83a51f", "score": "0.656...
82e3ff252ffcc94f2939b91216064c58
Returns the gem author's name.
[ { "docid": "be4f0e7eeb76a8230e6fc35ec18e0a26", "score": "0.7183195", "text": "def author\n options[:author] || git_config('user.name')\n end", "title": "" } ]
[ { "docid": "53f00addfe5d22cd1499121a043af173", "score": "0.78436625", "text": "def author_name\n author.author_name\n end", "title": "" }, { "docid": "7d6140c57a5631e670047f8057360626", "score": "0.7735942", "text": "def author_name\n authorable.name\n end", "...
a62644a64fe488c5c4ca8542679271a8
create and populate pad
[ { "docid": "1c4dd432b080142e97997a3a0503f590", "score": "0.6772311", "text": "def populate_pad\n @_populate_needed = false\n # how can we make this more sensible ? FIXME\n @renderer ||= DefaultRubyRenderer.new if \".rb\" == @filetype\n @content_rows = @content.count\n @content_c...
[ { "docid": "7264ad49e5841d444f8649da8be93619", "score": "0.79516226", "text": "def padding=(pad); end", "title": "" }, { "docid": "5b1a156842c87684a4f14054d5aadeaf", "score": "0.7131766", "text": "def GenPad(x1, y1, x2, y2, name, number, flags)\n if x1 > x2\n x1, x2 = x2, x1\n e...
060c125ebedb8ca7bc789753a7ab1bd6
DELETE /pays/1 DELETE /pays/1.json
[ { "docid": "6d8b9670299bce4172726495038505a5", "score": "0.753044", "text": "def destroy\n @pay.destroy\n respond_to do |format|\n format.html { redirect_to pays_url, notice: 'Pay was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "55e7493b9289a4eec0b9bf5f62600e42", "score": "0.7801218", "text": "def destroy\n @pay = Pay.find(params[:id])\n @pay.destroy\n\n respond_to do |format|\n format.html { redirect_to pays_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "...
73b1a2989d4fc6f84a2875d82f9ffc19
Typecast the specified value using the column definition
[ { "docid": "3cee88bd9ae0c668a6c83dff6760e670", "score": "0.90273625", "text": "def type_cast(value)\r\n @column_definition.type_cast(value)\r\n end", "title": "" } ]
[ { "docid": "b638bbdf0bc2296dedfd522b262b64f2", "score": "0.7863808", "text": "def typecast_value(column, value)\n return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column])\n value = nil if '' == value and typecast_empty_string_to_nil and col_schema[:type] ...
a75324cb643a0ca0dd5ba5b3870ae71e
Exercise 3: Given an array of numbers, return the an array of numbers divisible by 5 and 3 Remember to use an enumerable
[ { "docid": "6a9899d849f579076fffa902d89fb148", "score": "0.78836197", "text": "def divisible_by_5_and_3\n numbers = (1..100).to_a # this will create an array from 1 to 100. Check the Range class from Ruby - https://ruby-doc.org/core-2.5.1/Range.html\nend", "title": "" } ]
[ { "docid": "ad0356d5dbd76c91a74b41713600d74b", "score": "0.7932906", "text": "def divisible\n\tarr = []\n\tfor x in 1..101 do\n\t\tif x % 2 == 0 || x % 3 == 0 || x % 5 == 0\n\t\t\tarr << x\n\t\tend\n\tend\n\treturn arr\nend", "title": "" }, { "docid": "65276bce02d62839010d63d8b3ed415c", ...
7ad6b5375e89ddb097dca8702b88a96d
PUT /tournaments/1 PUT /tournaments/1.json
[ { "docid": "f5fde8233d5dd65ac7d60f73e68dcf95", "score": "0.59939295", "text": "def update\n @tournament = Tournament.find(params[:id])\n\n respond_to do |format|\n if @tournament.update_attributes(params[:tournament])\n format.html { redirect_to @tournament, notice: 'Successfully updat...
[ { "docid": "21f5fb66a152d1075738141823964e43", "score": "0.64190006", "text": "def update\n respond_to do |format|\n if @tournoi.update(tournoi_params)\n @tournoi.create_activity :update, owner: current_user, read: false\n format.html { redirect_to @tournoi, notice: 'Tournoi was su...
ff333e204b1d607a1797f874e0f3c2ba
kill enemies by player's bomb
[ { "docid": "0989c94a09060b46cd29ea030a430488", "score": "0.79257864", "text": "def kill_enemies\n window.world.enemies.each do |e|\n if (Gosu::distance(x, y, e.x - 10, e.y + 5) <= 15) && e.drawing\n e.add_injury_by_bomb\n @drawing = false\n end\n end\n end", "title": "...
[ { "docid": "a400e1e45736b578263e3e8504a8fcfb", "score": "0.779833", "text": "def kill_enemies\n window.world.enemies.each do |e|\n if (Gosu::distance(window.mouse_x, window.mouse_y, e.x - 5.0, e.y) <= 10) && \n (window.button_down? Gosu::MsLeft) && @ammo > 0 &&\n window.mouse_x < x && ...
ec5dc78ea992cef74e7b1224af2a56e6
part of the lesson DSL, executes the page block
[ { "docid": "b8484111157b2b99f86da15234c94b52", "score": "0.0", "text": "def set_content &blk\n delete_event_connections\n @slot.clear { instance_eval &blk }\n end", "title": "" } ]
[ { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.71212023", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.71212023", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "...
9d18baf5cc29ec76aa076e95313ff1ee
DELETE /enumerations/1 DELETE /enumerations/1.json
[ { "docid": "98dd70d95707ef1f704c5fc7f92099d3", "score": "0.686799", "text": "def destroy\n @enumeration.destroy\n respond_to do |format|\n format.html { redirect_to enumerations_url, notice: 'Enumeration was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "a3048c5445248a859f898bd8b3af2af6", "score": "0.67006546", "text": "def destroy\n @status = Status.find_by_id(params[:id])\n @status.delete\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n\n end", "title": ...
5156d22c7a788572a37ebaf3ff9f61db
Cleans up after we're done
[ { "docid": "ba3f83586da300ca0bd9269dd534f6f9", "score": "0.0", "text": "def unbind\n log(\"Terminating connection to #{peer}\")\n @keep_alive_timer && @keep_alive_timer.cancel\n end", "title": "" } ]
[ { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.8232026", "text": "def cleanup\n end", "title": "" }, { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.8232026", "text": "def cleanup\n end", "title": "" }, { "docid": "caaa82b911d260b8ef5500f5...
b0b0be74d40972ce63cae60388efc018
override if you don't want to allow volumes to be unmounted at any time
[ { "docid": "baf3d951ab5abe5f9c1db78c16e6d88f", "score": "0.0", "text": "def unmountable?\n true\n end", "title": "" } ]
[ { "docid": "9de931bc252812f1660a02cd646a3026", "score": "0.7639137", "text": "def unmounted();end", "title": "" }, { "docid": "9de931bc252812f1660a02cd646a3026", "score": "0.7639137", "text": "def unmounted();end", "title": "" }, { "docid": "dcba227ecbc2040e0b6714b74c99d0...
45c0cd8767e4445400d241a61cf78cb9
GET /bootcamps/1 GET /bootcamps/1.json
[ { "docid": "752f939bb2fa503fe9d83174458027f0", "score": "0.79718274", "text": "def show\n @bootcamp = Bootcamp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bootcamp }\n end\n end", "title": "" } ]
[ { "docid": "37acc9baec3cc7e85e2a77f1d2e1693c", "score": "0.7385712", "text": "def new\n @bootcamp = Bootcamp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bootcamp }\n end\n end", "title": "" }, { "docid": "62e29853424f53a743015...
c1564021eff5a52b890091785e8cd198
Try not to use this. Use LoggedProcess instead. This is for "headless" jobs.
[ { "docid": "92937453c4aab3071d7ec75414cfe156", "score": "0.0", "text": "def log_error(message)\n process_log.tagged('ERR') { process_log.warn(\"[#{Time.now.strftime('%F %T')}][hdls] #{message}\") }\n end", "title": "" } ]
[ { "docid": "5f72cf4376a0371e390a9b41a619f5ac", "score": "0.63244784", "text": "def logged_process\n LoggedProcess.new(self)\n end", "title": "" }, { "docid": "345716768cbfb73ba70e8715e27d6163", "score": "0.6019411", "text": "def process\n platform_service(:process)\n end"...
30fc6a585025f3d2f25029d793417832
Get the cache key for the timestamp for the current object
[ { "docid": "603f799e165d357555116e9a99a5bd98", "score": "0.8662599", "text": "def timestamp_cache_key\n self.class.timestamp_cache_key(id)\n end", "title": "" } ]
[ { "docid": "3b9650199f7504d4f72569958ddc41fe", "score": "0.83031404", "text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\" }\n end", "title": "" }, { "docid": "d140c153a50276327707e15e9ec8a079", "s...
ecf0e20534313b156f4a2c9d51e04cce
Update a &39;iam.Certificate&39; resource.
[ { "docid": "f32497ce0312cdb98697153f71080818", "score": "0.0", "text": "def update_iam_certificate_with_http_info(moid, iam_certificate, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.update_iam_certificate ...'\n end\n # verify ...
[ { "docid": "e0948bfec179c96e51195ac7b1549663", "score": "0.7829012", "text": "def update_certificate(id, data)\n update(\"certificates\", id, data).first\n end", "title": "" }, { "docid": "7b36a10d2dcf86b9fe3375954706ec8a", "score": "0.7103061", "text": "def update\n @cert...
c2cc7b8ee708ab5c8e885b6b1a557435
GET /sames/1 GET /sames/1.json
[ { "docid": "d249571de033c25c51eb46f2aefd2adb", "score": "0.0", "text": "def show\n @limages = @same.limages\n end", "title": "" } ]
[ { "docid": "497c0a52dae5b96c28acd393791cefea", "score": "0.6137183", "text": "def create\n @same = Same.new(same_params)\n\n respond_to do |format|\n if @same.save\n format.html { redirect_to @same, notice: 'Same was successfully created.' }\n format.json { render :show, status:...
d07525a0a86e337d28ab23c27d00a0f7
Unlikes a post or comment
[ { "docid": "0eeb500b92fcd2a20e47f7e61d006c58", "score": "0.6931951", "text": "def unlike(likeable)\n like = likes.find_by(likeable: likeable)\n likes.destroy(like)\n end", "title": "" } ]
[ { "docid": "640b1fe70e19d4fb106422b3e2a828fb", "score": "0.77799565", "text": "def unlike!(post)\n like = self.likes.find_by(post_id: post.id)\n like.destroy!\n end", "title": "" }, { "docid": "c843693c664683efae1e869a9e40ddd4", "score": "0.7775593", "text": "def unlike!(post)...
9861f85b1927c83239bbe696b03fbae5
Reads output from a command. If no command is supplied, the default command is used.
[ { "docid": "d3b4a5520f1ad9fa1dfeaf02d3f2e631", "score": "0.63483715", "text": "def read_cmd(length = nil, cmd = nil)\n\tend", "title": "" } ]
[ { "docid": "6b74463feba6a6f4e1d089df56017dd7", "score": "0.7518658", "text": "def read_command_output( cmd, *args )\n\t\t\tself.log.debug \"Reading output from: %s\" % [ cmd, quotelist(cmd, *args) ]\n\t\t\toutput = IO.read( '|-' ) or exec cmd, *args\n\t\t\treturn output\n\t\tend", "title": "" }, ...
b6d5d714fc22e0e2062afb533fa45802
PATCH/PUT /task_nodes/1 PATCH/PUT /task_nodes/1.json
[ { "docid": "25050cf3080427e3acfe591120ddd6ee", "score": "0.6980393", "text": "def update\n respond_to do |format|\n if @task_node.update(task_node_params)\n format.html do\n redirect_to(\n task_queue_task_node_path(@task_queue, @task_node),\n notice: 'Task n...
[ { "docid": "cac9c96d9b119273d80222fef2554029", "score": "0.65692407", "text": "def update\n @task.update!(task_params)\n json_response(@task)\n end", "title": "" }, { "docid": "b58dcb674745e5d70f3957b6c801fb4a", "score": "0.6520887", "text": "def update\n id = params[:id]\n...
2a5b05a303611dd64ddd9fd8fc9b6b82
Reconstruct the command line from the pipeline actions returns (String) => Deserialized command line
[ { "docid": "b1953c3741ecd0ecf5d81c6e61816a22", "score": "0.72353274", "text": "def command_line\n command_line = \"\"\n metadata['pipeline']['actions'].each do |action|\n command_line += action['commands'].join(' ') + \"\\n\"\n end\n command_line.chomp(\"\\n\")\n end", "title": "" ...
[ { "docid": "722c1fe63d49869a0292d5054bace541", "score": "0.6230359", "text": "def to_cmd_ary(opts={arguments:[],separator:\"=\"})\n # [program, sub_program, normalize_params(opts[:separator]), opts[:arguments]].flatten.compact\n [program, sub_program, normalize_params(opts[:separator]), opts[...
9cb15af699dee9dafc73bd6912709044
before_update :set_status after_update :update_parent_status
[ { "docid": "c71a88efa565c3efe921ede088c58648", "score": "0.0", "text": "def to_api\n {\n id: id,\n inventory_id: inventory_id,\n inventory_task_id: inventory_task_id,\n status: status,\n sku_code: inventory.try(:sku_code),\n barcode: in...
[ { "docid": "b2d53723fc3daaea5844270d4cbd3679", "score": "0.6837633", "text": "def update_member_statuses\n if self.changed_attributes.has_key?('status_id')\n self.dependents.each {|m| m.update_attribute(:status, self.status)}\n end \n end", "title": "" }, { "docid": "8f66e9cc8d0...
53b146cd5e30fd4b66a6f9d870a95d16
Factory method for a threadspecific queue. === Parameters thread_name(String):: name of thread for queue being created continuation(Proc):: continuation run on thread termination === Return queue(BundleQueue):: a new threadspecific queue
[ { "docid": "20f400fa54c77fcb7247634123d4b56b", "score": "0.85074556", "text": "def create_thread_queue(thread_name, &continuation)\n return SingleThreadBundleQueue.new(thread_name, &continuation)\n end", "title": "" } ]
[ { "docid": "cb00963b767365926e24a7584b05fae9", "score": "0.6813796", "text": "def queue(queue_name)\n Queue.new self, queue_name\n end", "title": "" }, { "docid": "bea0127ab249d52175e70a78550ee88d", "score": "0.64183193", "text": "def get_queue(name=:default_queue)\n nam...
55ab2dfd2724fedf29131e14a20ddbad
this is only valid if not language_b
[ { "docid": "493e58bf3efa2e5e642e4d5130f22306", "score": "0.0", "text": "def myp_criteria\n #self.objectives.collect(&:criterion).uniq.collect(&:category).join(\", \")\n criterions.collect(&:category).join(\", \")\n end", "title": "" } ]
[ { "docid": "2a9c173b42cf41d50de983318d2bdf3e", "score": "0.6989316", "text": "def validate_language(params)\n if(params.to_s == \"english\" or params.to_s == \"spanish\")\n true\n else\n false\n end\n end", "title": "" }, { "docid": "80...
1ede64241f46ead3a12c88f7529b5d2e
POST /docs_histories POST /docs_histories.json
[ { "docid": "45d37da21211e3330335b7f8a8d14c53", "score": "0.67593884", "text": "def create\n @docs_history = DocsHistory.new(docs_history_params)\n\n respond_to do |format|\n if @docs_history.save\n format.html { redirect_to @docs_history, notice: 'Docs history was successfully created....
[ { "docid": "e903dd207e68af99a7d09b9a451f2852", "score": "0.6697034", "text": "def index\n @docs_histories = DocsHistory.all\n end", "title": "" }, { "docid": "9a6be4f06edf5579a1bfa5e6d060804b", "score": "0.61578584", "text": "def index\n @histories = History.all\n\n respond...
55590ea4218bcc5f4dd511144cc837a1
GET /crops/new GET /crops/new.xml
[ { "docid": "59d637559b97bbf46b00fdfa496c1a61", "score": "0.73732346", "text": "def new\n @crop = Crop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crop }\n end\n end", "title": "" } ]
[ { "docid": "87344294566b5f7a723d6759b1135f3b", "score": "0.7013401", "text": "def new\n @cropplan = Cropplan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cropplan }\n end\n end", "title": "" }, { "docid": "131d34cf770959a6145...
87d5029971812b3bd37644972b559687
Clearing: Clears current square, and also any obvious nearby squares, and any obvious squares near those, and so on and so forth
[ { "docid": "ca11b4d5c29d8f324dc48cafe5fb0d88", "score": "0.7401178", "text": "def clear(x,y)\n if getsq(x,y)[:mine]\n @game_over=true\n else\n reveal(x,y)\n end\n end", "title": "" } ]
[ { "docid": "25f55b65b6b6f5e061e8ae2b9d93332d", "score": "0.7746271", "text": "def clear(row, col)\n squares = adjacent_clear(row,col)\n squares.each { |position| uncover(position[0],position[1]) }\n end", "title": "" }, { "docid": "76d5e8cdd07eb099654ca7dc07766125", "score": "...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "90cfeeac244044e815eb96e9fdb8f9c2", "score": "0.0", "text": "def update!(**args)\n @location_names = args[:location_names] if args.key?(:location_names)\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...