query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
36164220fea329778b817957573f4f5e | GET /cognitive_distortions/1 GET /cognitive_distortions/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "f63f71177236abbbbb0fe77cd1a39218",
"score": "0.7620559",
"text": "def index\n @cognitive_distortions = CognitiveDistortion.all\n end",
"title": ""
},
{
"docid": "9c655b0d1b66bddcbdc143555197113c",
"score": "0.6553698",
"text": "def set_cognitive_distortion\n @cog... |
19dfd731c4342737186445160a62a478 | Public: Get the insufficient data actions that will be added Returns an array of arns to add | [
{
"docid": "cd30ed919276b70009d62eb7a46511b3",
"score": "0.7276434",
"text": "def insufficient_actions_to_add\n local_actions(\"insufficient-data\") - @aws.insufficient_data_actions\n end",
"title": ""
}
] | [
{
"docid": "1a4cafd72025fdad951f94752a5752c4",
"score": "0.6897996",
"text": "def insufficient_data_actions\n data[:insufficient_data_actions]\n end",
"title": ""
},
{
"docid": "94fc38d6ca3338d11bae70dffeb6a3d2",
"score": "0.68446577",
"text": "def insufficient_data_actions\n... |
71048703f9d3eeb0084e55de38abb4d5 | solr will search by conditions specified in conditions_for_solr_search it will return the ids of the documents and i will search by those ids in Database I do his because the ids will come paginated from solr > see paginate(pagination_parameters) This functions returns something as documents.id IN (1,2,3) or as documen... | [
{
"docid": "906b45e64f4825afb4d5575bab1c7f06",
"score": "0.60676914",
"text": "def sunspot_solr_condition(query)\n begin\n current = self\n search = active_scaffold_config.model.search() do\n current.send :conditions_for_solr_search, self, query \n paginate(... | [
{
"docid": "ea6ac49e5a30c96823a7cc845eb354c8",
"score": "0.7501043",
"text": "def get_solr_response_for_document_ids(ids=[], *args)\n # user_params = params || {}, extra_controller_params = {}\n if args.length == 1\n user_params = params\n extra_controller_params = args.first || {}\n ... |
77f36daf1ab632a824b31605724ee8a2 | Update Update a user defined association definition | [
{
"docid": "6de7d3d7c334485c3395a8a3c3eb2e77",
"score": "0.5471333",
"text": "def update_with_http_info(from_object_type, to_object_type, public_association_definition_update_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API:... | [
{
"docid": "cda8311240b90460d32ce53fcb4515d6",
"score": "0.7534069",
"text": "def update!(**args)\n @association = args[:association] if args.key?(:association)\n end",
"title": ""
},
{
"docid": "cda8311240b90460d32ce53fcb4515d6",
"score": "0.7534069",
"text": "def up... |
63cc580ed4e158f8d599e7a0c39cff6a | GET /elongations GET /elongations.json | [
{
"docid": "9cba5d6f09901de25eb3705bd71c6460",
"score": "0.7114652",
"text": "def index\n @elongations = Elongation.all\n end",
"title": ""
}
] | [
{
"docid": "48f83654346119809b8279a54b89f988",
"score": "0.69186",
"text": "def set_elongation\n @elongation = Elongation.find(params[:id])\n end",
"title": ""
},
{
"docid": "e415f21c49ad89d65376635831c40e1b",
"score": "0.5563135",
"text": "def get_edorgs(links,collection)\n ... |
186438418a7c793169f9b08b189e97a5 | If the value is nil, return `default` converted to either 'yes' or 'no'. If the value is set, return its value converted to 'yes' or 'no'. | [
{
"docid": "e5c361df30dc9fde5ae718284d3eaaf8",
"score": "0.8318517",
"text": "def yes_or_no_with_default(value, default)\n yes_or_no(value.nil? ? default : value)\n end",
"title": ""
}
] | [
{
"docid": "8b2f84351e99c8b0bc70c7a29db8c7d0",
"score": "0.78416735",
"text": "def yes_or_no(value=false)\n value ? \"Yes\" : \"No\"\n end",
"title": ""
},
{
"docid": "4864675d6d2ff5441813273e08f68f4a",
"score": "0.76262295",
"text": "def to_yes_no(value)\n value && \"yes\" ||... |
19b712218e45ab55776db3af55c728eb | reads a specific SMS parameters: 1 index 2 CMGF mode (PDU / ASCII) | [
{
"docid": "f4ea79781d319f8ce9ef13bfbfdc042e",
"score": "0.6906847",
"text": "def read_sms(index,encoding=:ascii)\n #logger.info \"Reading message %i in %s mode\" % [index, encoding.to_s]\n cmgf=set_cmgf(encoding)\n msg = meta([index,cmgf],this_method).first\n begin\n SMS.new(... | [
{
"docid": "1a38cb10342af9d3adaddb5349cfd0ac",
"score": "0.58396226",
"text": "def sms_params\n\n end",
"title": ""
},
{
"docid": "a1793380b96d217ceaeae59298901097",
"score": "0.54716617",
"text": "def readParam (phrase, index)\n\tif phrase.include?(\"\\n\") then\n\t \tlast = phrase... |
cc902603440caf97bdfa896bd78dee1a | GET /country_teams/new GET /country_teams/new.json | [
{
"docid": "0edae137afa628c24d32eb0523f1acf8",
"score": "0.7964519",
"text": "def new\n #@country_team = CountryTeam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country_team }\n end\n end",
"title": ""
}
] | [
{
"docid": "aa012a3e262aceab8e01679e6c7a2e55",
"score": "0.76137763",
"text": "def create\n #@country_team = CountryTeam.new(params[:country_team])\n\n respond_to do |format|\n if @country_team.save\n format.html { redirect_to @country_team, notice: 'Country team was successfully creat... |
cdf7ee624ebbaba74cfa92ef3d113783 | 1.1 Read albums, album, tracks and track < 1 Menu Read Album File | [
{
"docid": "060aa234ac3c123e4179c606f01e68f9",
"score": "0.0",
"text": "def read_track music_file\r\n\tname = music_file.gets.chomp\r\n location = music_file.gets\r\n track = Track.new(name, location)\r\n return track\r\nend",
"title": ""
}
] | [
{
"docid": "fd42e7b9745647d6a74f1c945871e45a",
"score": "0.79665434",
"text": "def load_albums\n \tmusic_file = File.new(\"album.txt\",\"r\")\n albums = read_albums(music_file)\n albums\n end",
"title": ""
},
{
"docid": "92794ec0bc66957ecd79d62101c3c311",
"score": "0.79233307",
... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "7089dc0b429521e09d82fe870cce2c4e",
"score": "0.0",
"text": "def show\n #@user = User.find(params[:id])\n #verifica se exite algum id no link\n @user = !params[:id].nil? ? User.find(params[:id]) : current_user\n \n respond_to do |format|\n format.html # show.html.erb\n ... | [
{
"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... |
d4a1edaae4d92d004632cf64501ce2e7 | DELETE /users/1 DELETE /users/1.json | [
{
"docid": "632adee588b431b4b9dc2608ab42f9b7",
"score": "0.0",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n if @user.id == session[:user_id]\n reset_session\n end\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { h... | [
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.75906104",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_na... |
49da1f866ad149ad8015b219e795e3d7 | Custom attribute writer method with validation | [
{
"docid": "79707015438859419ca12904f11201d8",
"score": "0.0",
"text": "def title=(title)\n\n if !title.nil? && title.to_s.length > 255\n fail ArgumentError, \"invalid value for 'title', the character length must be smaller than or equal to 255.\"\n end\n\n @title = title\n end"... | [
{
"docid": "5a0bcdaca95c21b13aacca36f9fad742",
"score": "0.6955513",
"text": "def _write_attribute(attr_name, value); end",
"title": ""
},
{
"docid": "5812dd7a37c0eccc3d9481c23d74c649",
"score": "0.69278884",
"text": "def write_attribute(attr_name, value); end",
"title": ""
},
... |
ad4f6a04b49c09c6e19f082b8eb30fa4 | Delete entry if it fits conditional block. | [
{
"docid": "70760a27aa692970fb64c8c88b996f78",
"score": "0.59474635",
"text": "def delete_if\n order.clone.each { |k| delete k if yield(k,@hash[k]) }\n self\n end",
"title": ""
}
] | [
{
"docid": "05fd3e54a02c26a9f79f51021768976d",
"score": "0.7070439",
"text": "def delete_if(&block); end",
"title": ""
},
{
"docid": "9131ce2e4e854f9df315599aca97e1ff",
"score": "0.7016883",
"text": "def delete_if(&block)\n to_hash.delete_if(&block)\n end",
"title": ""
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3892254622e6c369927149fb2fe49fcb",
"score": "0.0",
"text": "def comment_params\n params.require(:comment).permit(:content, :attach).merge(user_id: current_user.id)\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... |
b8c9f86676f92d9e2fbdaa5066f2fc33 | Convenience method to fetch account title should be in PicasaReader class but that code is in backupd repo for now. Move to Gem? | [
{
"docid": "57b73aa029ec8ea0fac1f7d01ba6a1c1",
"score": "0.76376116",
"text": "def account_title\n xml = client.get('http://picasaweb.google.com/data/feed/api/user/default').to_xml\n title = xml.elements['author'].elements['uri'].text\n end",
"title": ""
}
] | [
{
"docid": "25be334df9b0cb5e7957ab846e82a617",
"score": "0.6577703",
"text": "def get_title_names\n self.account.get_title_names()\n end",
"title": ""
},
{
"docid": "f8bad57cd98f8e1f886eea1082d4f155",
"score": "0.62039065",
"text": "def get_full_name\n title\n end",
"titl... |
d17ae831c20cabb159edfc47f06190c1 | refresh all attributes. All attributes wil be loaded, so all digests will be calculated. You will most probably never need this method. | [
{
"docid": "1db3558e8944ca675b176c4a5dc80265",
"score": "0.6736263",
"text": "def refresh_all_digests!\n Richfile::Digests::each_digest_symbols do |d_bang, d_var|\n send d_bang\n end\n self\n end",
"title": ""
}
] | [
{
"docid": "4dda282717cd340117ae94cdee5c6e17",
"score": "0.7784229",
"text": "def refresh_attributes\n initialize_attributes\n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.77272546",
"text": "def refresh\n set_attributes\n end",
... |
2ef4cdd02f2c13d42165ceff28239926 | DELETE segment security profile API will delete segment security profile with the given id. | [
{
"docid": "e842a95b5eb328cef3f64bd2b0b73b40",
"score": "0.72528815",
"text": "def delete_segment_security_profile_0_with_http_info(segment_security_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSe... | [
{
"docid": "17d011e2f101920d7e2625de0c5be742",
"score": "0.7531428",
"text": "def delete_segment_security_profile_0(segment_security_profile_id, opts = {})\n delete_segment_security_profile_0_with_http_info(segment_security_profile_id, opts)\n nil\n end",
"title": ""
},
{
"docid... |
cb4c24b2778225415d2f044c60f3dc22 | The use of identical data interchange control numbers in the associated functional group header and trailer is designed to maximize functional group integrity. The control number is the same as that used in the corresponding header. | [
{
"docid": "456ec495801adbaad0be87a8c62a37d4",
"score": "0.49599418",
"text": "def functional_group_trailer(batch_id)\n ge_elements = []\n ge_elements << 'GE'\n ge_elements << checks_in_functional_group(batch_id)\n ge_elements << '1'\n ge_elements.join(@element_seperator)\n end",
"ti... | [
{
"docid": "c8c3c2bc0f4c521a94dfa78dfe8fd96c",
"score": "0.59715265",
"text": "def interchange_control_header\n empty_str = ''\n isa_elements = []\n isa_elements << 'ISA'\n isa_elements << '00'\n isa_elements << trim(empty_str,10)\n isa_elements << '00'\n isa_elements << trim(empty_... |
f853d3a2ae7cc66686b8c1871db6d087 | Returns true if the user is friends with provided user. | [
{
"docid": "eee7b6f542c0ff8e2ce88a9ed5387c96",
"score": "0.8128985",
"text": "def friends_with?(user)\n friends.include?(user)\n end",
"title": ""
}
] | [
{
"docid": "7daa14b9b6a7d53187a6c31339e96bd3",
"score": "0.8484938",
"text": "def friend_with?(user)\n friends.include?(user)\n end",
"title": ""
},
{
"docid": "7daa14b9b6a7d53187a6c31339e96bd3",
"score": "0.8484938",
"text": "def friend_with?(user)\n friends.include?(us... |
622bf06d70ec2c4d7835991a7b56c880 | returns 3 digit string according to | [
{
"docid": "614088d8a3ffa24726999cbf766d8977",
"score": "0.0",
"text": "def currency\n \"840\"\n end",
"title": ""
}
] | [
{
"docid": "f9a174707e56d38f51cc8c11a2ddc578",
"score": "0.78631085",
"text": "def three_digit_format(n)\n # your code here\n # assume length of string (converted from int) id less than 3\n # add \"0\"'s to make its length 3\n \"0\"*(3 - n.to_s.length) + n.to_s\nend",
"title": ""
},
{
"... |
b5d4ac33019063e66bad33c6dc258fe8 | this endpoint to be used to test exception notifier | [
{
"docid": "9b47c65bc623baf944635e1a258ff15b",
"score": "0.6593232",
"text": "def test_exception_notifier\n raise 'This is a test. This is only a test.'\n end",
"title": ""
}
] | [
{
"docid": "a339365a01292d32c1df0deeead77284",
"score": "0.70478594",
"text": "def test_check_endpoint_level_exception()\n\n # Perform the API call through the SDK function\n assert_raises('CustomErrorResponseException'){ \n result = @controller.receive_endpoint_level_exception()\n }\n\n ... |
9028751a38b5420537ad5617f59e8609 | We may need to know very early on in the middleware if an auth token exists, to optimise caching | [
{
"docid": "afc391bfbd51304fb2eb849a2862a3a5",
"score": "0.6485092",
"text": "def has_auth_cookie?\n cookie = @request.cookies[TOKEN_COOKIE]\n !cookie.nil? && cookie.length == 32\n end",
"title": ""
}
] | [
{
"docid": "ee00312d633b2a35dcc7fc452cd47e76",
"score": "0.7239219",
"text": "def check_token\n input_token = request.headers['X-Auth-Token'] || params[:token]\n return unless input_token\n\n token = AuthenticationToken.find_by(token: input_token)\n return unless token\n\n # Count token u... |
b3d19d991a523000cc6fb6fedd1dabdc | Sets the attribute checkout_timeout | [
{
"docid": "bfa8ab9c793b5b47b078ab1fac58160a",
"score": "0.7576929",
"text": "def checkout_timeout=(_arg0); end",
"title": ""
}
] | [
{
"docid": "05ae572f9e2eb66a51cab87911ff2551",
"score": "0.7566917",
"text": "def checkout_timeout; end",
"title": ""
},
{
"docid": "5c548c97c4ac9e8d4cf052cf302d18e1",
"score": "0.68488276",
"text": "def timeout=(timeout)\n @attrs[:timeout] = timeout\n end",
"title": ... |
378e368feeb5e4e4d9ca96bb7108aa94 | If the work includes our default processable terms | [
{
"docid": "cd221a45c91a27c01f318ffae505688a",
"score": "0.0",
"text": "def perform\n Hyrax::Orcid::WorkOrcidExtractor.new(@work).extract.each { |orcid| delegate(orcid) }\n end",
"title": ""
}
] | [
{
"docid": "04c1028c349804d46256f6bb67897a8f",
"score": "0.5899775",
"text": "def accept_terms\n\t\tself.terms\n\tend",
"title": ""
},
{
"docid": "2f0281e7b00c4b7b899b43cfd55a2155",
"score": "0.5836651",
"text": "def apply(terms)\n if @allowed == :all\n terms\n ... |
4493360d4793c0883ed673f4a2c33e6d | GET /subprograms GET /subprograms.json | [
{
"docid": "1fec80f2191af7524b0d31df8ecee8bc",
"score": "0.74341524",
"text": "def index\n @subprograms = Subprogram.all\n end",
"title": ""
}
] | [
{
"docid": "091a7da104807c63ef61eebeb32c3b5d",
"score": "0.7496151",
"text": "def subprograms\n @subprograms ||= list_subprograms.to_a\n end",
"title": ""
},
{
"docid": "c14da2a0c6efb274a1781e742bfdd1d4",
"score": "0.71303225",
"text": "def list_subprograms\n __par... |
9e834c4909cd07231dc5b050788a8f25 | array of DesignComponent objects | [
{
"docid": "97d7129605ec64cbe7e0f7452af5bd79",
"score": "0.7745393",
"text": "def initialize\n @design_components = Array.new\n end",
"title": ""
}
] | [
{
"docid": "9e20509b31f014bfed43cb583523ccb0",
"score": "0.72403604",
"text": "def components\n\t\t\t@components ||= []\n\t\tend",
"title": ""
},
{
"docid": "b2ef3f1362ab5588284b57de6c185102",
"score": "0.6852284",
"text": "def components\n arr = Arrays.new(@nb) { [] }\n ... |
ae7a5b8c817727b7dd20da8cd143f470 | Return a single character token. Prerequisite: lexeme attribute contains the single character. | [
{
"docid": "a62740ded93cec1f537b14e102e5580d",
"score": "0.8083994",
"text": "def scan_single_char()\n\t\tresult = if metachar?(lexeme)\n\t\t\t# A Meta-character...\n\t\t\tenqueue_token(lexeme.dup)\n\t\telse\n\t\t\tenqueue_token(:T_CHARLIT)\n\t\tend\n\t\t\n\t\treturn result\n\tend",
"title": ""
}
... | [
{
"docid": "d8dbed145ada87f7b6e91c21d2be58c8",
"score": "0.7004984",
"text": "def lex_en_character=(_arg0); end",
"title": ""
},
{
"docid": "32634faacb173b0f667027532b96a5ba",
"score": "0.67095494",
"text": "def read_character\n lit = read_literal\n\n return \" \" if lit.em... |
a4bac6d05547d01fd95f5fc1d8b0e47d | PUT /app_versions/1 PUT /app_versions/1.xml | [
{
"docid": "21335a3885280f895fdb0dc6c5b44da3",
"score": "0.6810689",
"text": "def update\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n if @app_version.update_attributes(params[:app_version])\n format... | [
{
"docid": "837a716130bd03d8c8a7e9e15a519003",
"score": "0.64231396",
"text": "def set_appversion\n @appversion = Appversion.find(params[:id])\n end",
"title": ""
},
{
"docid": "106be781e9d5619a00e708d72e0ca2e4",
"score": "0.6211409",
"text": "def create\n @version = @app.vers... |
8d2c8ab70be2135f59bc2fa082746898 | END TEMP FIX ADDING REFILLS COMPONENTS | [
{
"docid": "025c2035dc762e9aad88c1378a87caad",
"score": "0.0",
"text": "def generate_refills\n if @@accept_defaults || agree?('Would you like to install default Refill components? (Y/n)')\n @@add_refills = true\n\n bundle_command 'exec rails generate refills:import navigation'\n ... | [
{
"docid": "361ef41739f1cf754d99b174b23c34d5",
"score": "0.6710302",
"text": "def references; end",
"title": ""
},
{
"docid": "361ef41739f1cf754d99b174b23c34d5",
"score": "0.6710302",
"text": "def references; end",
"title": ""
},
{
"docid": "361ef41739f1cf754d99b174b23c34... |
30af7df05b4d96b9d32b0720de4a642e | don't try to process each frame of a gif, it will end in tears | [
{
"docid": "5f30df2eb8823dd7bbfd9a948bf2290b",
"score": "0.681358",
"text": "def only_first_frame\n\t\tmanipulate! do |img|\n \n\t\t\tif img.mime_type.match /gif/\n\t\t\t\timg.collapse!\n\t\t\tend\n\t\t\timg\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "307d26bdf0b17cc884907264d97c545b",
"score": "0.6878709",
"text": "def gifToPng\n return if !Dir.safe?(\"ToGIF\")\n # gets a list of all GIF files\n files = Dir.get(\"ToGIF\", \"*.gif\")\n time = Time.now\n # processes each file\n for file in files\n # loads GIF to bitmap\n bmp = ... |
6295924da80f07c6481499266c7d5468 | Gets the columns property value. The collection of column definitions for this contentType. | [
{
"docid": "2f657ddd0697ddee32b380c4bb584c6e",
"score": "0.69036186",
"text": "def columns\n return @columns\n end",
"title": ""
}
] | [
{
"docid": "01c19ef7607314da09b3557cae42a872",
"score": "0.69806975",
"text": "def columns\n @columns ||= list_columns.to_a\n end",
"title": ""
},
{
"docid": "01c19ef7607314da09b3557cae42a872",
"score": "0.69806975",
"text": "def columns\n @columns ||= list_columns... |
1e5cd386289804d53502a1d7034ffe71 | GET /courses/1 GET /courses/1.json | [
{
"docid": "4ff95c6345db2facb07e0e8c2ebba791",
"score": "0.69948006",
"text": "def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end",
"title": ""
}
] | [
{
"docid": "6f81305a012b6fee82e2bca53798cb22",
"score": "0.7639248",
"text": "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3ca604c092fdc8952e08fa129e639cbe",
"score": "0.7600732",
"tex... |
734cda0a492dbc57ae5477a35629cc0f | get the number input then use the input_chk_loop to verify that the input is a number | [
{
"docid": "192fbd19db7d5d48d39f56fabbd88b51",
"score": "0.766434",
"text": "def get_number\n input = gets.chomp\n # continue to ask for a number until you get one. check_input checks for a number and if it isn't a number or calculate it returns error\n while check_input(input) == \"error\" ... | [
{
"docid": "5fe33162350f023186c328be2c710670",
"score": "0.7779335",
"text": "def checkif_valid_num(input)\n valid_num = false\n # puts \"Input was: #{input}, type: #{input.class}\"\n until valid_num == true do\n if input == input.to_i.to_s\n input = input.to_i\n valid_num = true\n el... |
baed9158d9c6fadbb8df198e9025695c | Render all stickies in a unified block | [
{
"docid": "c970a0c9168ff7e474d0ce46ca0f4a15",
"score": "0.53785586",
"text": "def render_stickies_unified (messages, options)\n return \"\" if messages.empty?\n \n html = %Q(<div id=\"unified_stickies\"><div>)\n message_html = %Q(<ol>)\n close_js = ''\n\n messa... | [
{
"docid": "124a808ef2f5e0f85ac961c55652d370",
"score": "0.62896156",
"text": "def render_all(sx, sy, ws, hs, &block)\n render sx, sy, ws, hs do |r, l|\n yield r, l\n prect = apply_content_paddings(r, ws, hs)\n @children.each do |itm|\n itm.render_all(prect.x, prect.y,... |
75ba0ee204d857d49411c43398ebd6e6 | returns json response with 401 message | [
{
"docid": "626b86d5dd2b07ffa8f89782dec669a9",
"score": "0.7710508",
"text": "def return_unauthorized(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
}
] | [
{
"docid": "b596570b888d654b35160b2a8c5e0341",
"score": "0.8415813",
"text": "def render_unauthorized\n render json: {errors: ['Bad credentials']}, status: 401\n end",
"title": ""
},
{
"docid": "03c4a861b0b4f512415f79cf6b10423a",
"score": "0.82739747",
"text": "def authentication... |
2679d4e5a17b7ed6c2beb42ebf5801b3 | Returns the webhook settings for a channel | [
{
"docid": "a785c622eac9a963bf4a94f87480bd74",
"score": "0.81997937",
"text": "def get_channel_and_webhook_and_settings_by_channel(channel)\n HttpClient::Preconditions.assert_class('channel', channel, String)\n r = @client.request(\"/channel/#{CGI.escape(channel)}/webhook/settings\... | [
{
"docid": "5021bb61ecaaf09887fff3d244b6ead1",
"score": "0.6805195",
"text": "def get_channel_and_webhooks_by_channel(channel, incoming={})\n HttpClient::Preconditions.assert_class('channel', channel, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query =... |
0f664d02becc8807226fbfbc1673b83e | DELETE /contents/1 or /contents/1.json | [
{
"docid": "98fb856a0968c91ba693130f74126a48",
"score": "0.6898908",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_path, notice: \"Content was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"tit... | [
{
"docid": "0bc5932e2b65f2e196f23eefb830fdd6",
"score": "0.7255247",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bc5932e2b65f2e196f... |
66e21a458b23cce0f48c359b9d8b7d7d | Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context | [
{
"docid": "3c9a2f9467473b08a6faf9ca83c7a0e5",
"score": "0.0",
"text": "def context\n unless @instance_context\n @instance_context = PlayerStreamerContext.new(@version , @params['sid'])\n end\n @instance_cont... | [
{
"docid": "1000791e0ba8e96e55a94da3f03ac616",
"score": "0.68374115",
"text": "def context\n unless @instance_context\n @instance_context = ApplicationContext.new(@version , @params['account_sid'], @params['sid'])\n end\n ... |
3f52973818698070d105a2c20fdb77a5 | Serializes information the current object | [
{
"docid": "cdfea2cf05e491ae19444e5628107dd2",
"score": "0.6658493",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n ... | [
{
"docid": "d162e297d0f84ca205afa381c3f6a428",
"score": "0.7830697",
"text": "def serialize\n Marshal.dump(self)\n end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.7645999",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "f70822e4496ba81ada54d6c25b6aed92",
"score": "0.0",
"text": "def tipopostre_params\n params.require(:tipopostre).permit(:nombre, :descripcion)\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... |
c6b454e70852a22f9473e266e6c1829e | insert JSON object(Hash type) in the collection | [
{
"docid": "99ff92cec161129546b13e58e4ed6ff7",
"score": "0.0",
"text": "def insert(doc, tbName)\n coll = db.collection(tbName)\n return coll.insert(doc)\n end",
"title": ""
}
] | [
{
"docid": "eff7b5a25ba375b484d1ede5dd08cc64",
"score": "0.6776966",
"text": "def insert!(hash)\n coll.insert(hash)\n hash['_id'] = hash.delete(:_id) if hash[:_id]\n Model.new(hash, coll)\n end",
"title": ""
},
{
"docid": "29bdb1957612979a6102086e29073b0a",
"score": "0.... |
40aac4bcc06cc5cbec228a73d2ba7f8f | POST /transactions POST /transactions.json | [
{
"docid": "d5762df781ffd9a30f329aa6651acd15",
"score": "0.0",
"text": "def create\n if params[:checkout_datetime]\n selected_date = DateTime.new(\n params[:checkout_datetime].values[0].to_i,\n params[:checkout_datetime].values[1].to_i,\n params[:checkout_datetime].values[2]... | [
{
"docid": "47fc681642444d30890e58615a2d071b",
"score": "0.7465573",
"text": "def create\n @transaction = @current_user.transactions.build(transaction_params)\n \n if @transaction.save\n render json: @transaction, status: :created, location: @transaction\n else\n render json: @tran... |
c493646dc97840235f13614bee0d5f46 | the new action is generally used to display the form to create the record in this case. The new action displays the form to create a quiz. | [
{
"docid": "bbd948949f4c1d46bfe011d2992acd94",
"score": "0.82565755",
"text": "def new\n # defining an new Quiz instnace variable to help us generate the\n # form needed to create the quiz\n @quiz = Quiz.new\n # This will render app/views/quizzes/new.html.erb (by convention)\n end",
"ti... | [
{
"docid": "12989cdcf8177c3f0c9bfb359c983a5b",
"score": "0.8088857",
"text": "def new\n\t\t\n\t\t# This renders new.html.erb by default.\n\t\t\n\t\t# We instantiate an instance variable of the object we'd like to create in order\n\t\t# to use the form_for helper method in Rails to eality generate a form... |
be536f31fd9ccb079ca685f287e64705 | Returns true if the current user is following the other user. | [
{
"docid": "2c3a8d7e0a760ba09b6c4441346dc2f0",
"score": "0.0",
"text": "def following?(band)\n following.include?(band.id)\n end",
"title": ""
}
] | [
{
"docid": "847d038ef56237f552fafaf3647b5a2c",
"score": "0.8531212",
"text": "def following?(other_user)\n following.include?(other_user)\n end",
"title": ""
},
{
"docid": "6c6730e4e340ef3149d415c530cb54e7",
"score": "0.8511795",
"text": "def following?(other_user)\n ... |
f0cf39680adb86e34303ce21966769c9 | 3. Create a method to see if a particular item (string) is in the zombie_apocalypse_supplies. Do not use any special builtin methods. For instance: are boots in your list of supplies? | [
{
"docid": "280e0154e35414392280ad1dce5f9ae6",
"score": "0.6712748",
"text": "def check_list(input)\n zombie_apocalypse_supplies = ['hatchet', 'rations', 'water jug', 'binoculars',\n 'shotgun', 'compass', 'CB radio', 'batteries']\n\n zombie_apocalypse_supplies.each do |x... | [
{
"docid": "926cbce7715c51be42adb4850fde6177",
"score": "0.7656998",
"text": "def check_item(string)\n zombie_apocalypse_supplies = [\"hatchet\", \"rations\", \"water jug\", \"binoculars\",\n \"shotgun\", \"compass\", \"CB radio\", \"batteries\"]\n\n i = 0\n is_supply = f... |
b488c2b1c5273bf9b51a2f7f3eb7ab72 | If our sweeper detects that a Item was created call this | [
{
"docid": "cb78a63c7e766564ad91c1b3e38236c7",
"score": "0.55085444",
"text": "def after_create(item) \n expire_cache_for(item) \n end",
"title": ""
}
] | [
{
"docid": "985575fdf62b2a296e28b1d19cfa67b2",
"score": "0.6645537",
"text": "def created()\n self.setup(@@item)\n end",
"title": ""
},
{
"docid": "985575fdf62b2a296e28b1d19cfa67b2",
"score": "0.6645537",
"text": "def created()\n self.setup(@@item)\n end",
"title": ""
}... |
5e964f9b4e37d7faafc0e25c936efe5d | Stores the changes to the SZPM file. | [
{
"docid": "5e69bc7e806d58846b158c4558b7cf8f",
"score": "0.6369051",
"text": "def store\n\n File.open(@szpm_file, 'w') { |file|\n file.write( JSON.pretty_generate(@structure) )\n }\n\n parse\n end",
"title": ""
}
] | [
{
"docid": "ae6d9946748469e0a73e6a9b15627532",
"score": "0.6288133",
"text": "def save\n File.binwrite(file, JSON.pretty_generate(@cache))\n end",
"title": ""
},
{
"docid": "7d977b4ba1de0f47ecccc14ce35eefe5",
"score": "0.62504417",
"text": "def save\n entries = []\n ent... |
e4a2b74eecc5994416c35d10c8ef9f11 | GET /ninos GET /ninos.json | [
{
"docid": "98afc20381f6796c5da8dbe9fe61441e",
"score": "0.0",
"text": "def index\n respond_to do |format|\n format.html{ nullify_session }\n format.json{render json: NinosDatatable.new(view_context,session)}\n end\n end",
"title": ""
}
] | [
{
"docid": "ad33b1d5a795f61dfd82b6b33c0b46bb",
"score": "0.6702593",
"text": "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end",
"title": ""
},
{
"docid": "07ce4ac9088b2cd31f9c34f720eaef2c",
"score": "0.6523881",
"text": "def index\n @nippous = Nippou.all\n e... |
a764bb838eb69879b7047ea96c0b243a | Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/preview/marketplace/available_add_on.rb194 | [
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.0",
"text": "def to_s; end",
"title": ""
}
] | [
{
"docid": "3a87129ee1f0debd7cef93ea785ed922",
"score": "0.60404295",
"text": "def add_ons\n \"\"\n end",
"title": ""
},
{
"docid": "8bc683db031c80a303ac2412043f0e65",
"score": "0.573619",
"text": "def api_usage_available\n @attributes[:api_usage_available]\n end",
... |
23b313f9823c86b19b3bbb319b4e3a73 | POST /entity_defs POST /entity_defs.json | [
{
"docid": "9c8ad7c09a84ad89da77db58e6122f29",
"score": "0.645539",
"text": "def create\n @entity_def = EntityDef.new(params[:databaseformalizer_entity_def])\n if @entity_def.label == \"\"\n @entity_def.label = @entity_def.entity_def_name\n end\n respond_to do |format|\n ... | [
{
"docid": "a57fc72c6f87313e722d55d5a3801254",
"score": "0.6167015",
"text": "def create\n @options[:body] = @entity.attrs\n @options[:headers]['Content-Type'] = 'application/json'\n url = @url_helper.entity_collection_url\n request(:post, url)\n end",
"title": ""
},
{
... |
d00c570c83ddfd916d5110ed9851972b | Gets the acquiredByPrinter property value. True if the job was acquired by a printer; false otherwise. Readonly. | [
{
"docid": "dd19e11695d816f251a469a677b323c0",
"score": "0.7995818",
"text": "def acquired_by_printer\n return @acquired_by_printer\n end",
"title": ""
}
] | [
{
"docid": "8fd27247f42354fb7477d86e515c1043",
"score": "0.7339637",
"text": "def acquired_by_printer=(value)\n @acquired_by_printer = value\n end",
"title": ""
},
{
"docid": "4b5a9b99c100dd4058b8312f5551d5eb",
"score": "0.5418961",
"text": "def is_delivery_... |
36332e1e2fb7b0d35b340cb6603cfe7a | Internal: Cache Environmentstat source://sprockets//lib/sprockets/cached_environment.rb38 | [
{
"docid": "bb5e450114fb14db3ee446b4faaddd8b",
"score": "0.0",
"text": "def stat(path); end",
"title": ""
}
] | [
{
"docid": "9a1f36ec9a0df253320b067b0d1fe55e",
"score": "0.7021356",
"text": "def sprockets_environment; end",
"title": ""
},
{
"docid": "9a1f36ec9a0df253320b067b0d1fe55e",
"score": "0.7021356",
"text": "def sprockets_environment; end",
"title": ""
},
{
"docid": "c1f77489... |
c06f3de03162bf85dde74320806cdc02 | used for identifying a user is valid on third party api calls | [
{
"docid": "d79cc5c60bb688089ac7251e5025129b",
"score": "0.0",
"text": "def generate_state_token\n self.state_token = Sysrandom.urlsafe_base64(32)\n self.save\n return self.state_token\n end",
"title": ""
}
] | [
{
"docid": "dab92c9840e3f211533e397910a20637",
"score": "0.73963964",
"text": "def valid_user\n unless (@user && @user.activated? && @user.reset_digest == User.digest(params[:id]))\n render json: { message: \"unauthorized\"}, status: :forbidden\n end\n end",
"title": ""
},
{
... |
9fe134e1aa28255a313aad2c1b8ed1c0 | Kept for testing purposes. | [
{
"docid": "5b4d5b036c25a5b60e058a22ef9a7166",
"score": "0.0",
"text": "def index\n render json: [\"hello world\"]\n end",
"title": ""
}
] | [
{
"docid": "ac89abb35d13f20839c506413a0bb73c",
"score": "0.6554895",
"text": "def dry_run; end",
"title": ""
},
{
"docid": "200e344d98d28a4b746e91cd61c7350f",
"score": "0.65212476",
"text": "def halted=(_); end",
"title": ""
},
{
"docid": "db2b4ca006e46e93f3d127167b59e8be... |
d9fef5e840aabb71fd385e4d5db71cf4 | Retrieve a paginated list of load balancer rules Retrieve a paginated list of load balancer rules. | [
{
"docid": "1eff63c40081721797fb44a44d63d87c",
"score": "0.6649086",
"text": "def list_load_balancer_rules(opts = {})\n data, _status_code, _headers = list_load_balancer_rules_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "11dbd35ecff97e8787bebbc27419cbc0",
"score": "0.6688267",
"text": "def list_load_balancer_rules(opts = {})\n data, _status_code, _headers = list_load_balancer_rules_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "64ae89b00118f610e3dff1aa9d4c2249",
"... |
9690086ff001891bc4cb0c7a814da1de | returns the index of the left child of i if | [
{
"docid": "d592ae84ecea3a73a770d4000a3e12bd",
"score": "0.8483586",
"text": "def left_child(i)\n left = (2 * i) + 1\n if left >= @size\n return -1\n else\n return left\n end\n end",
"title": ""
}
] | [
{
"docid": "563acc237ec4f7a991eefa90e3c9adde",
"score": "0.8623843",
"text": "def left_child_idx(i)\n 2 * i + 1\n end",
"title": ""
},
{
"docid": "28bf31f8129bc60f62f0da0966fd2f50",
"score": "0.80699074",
"text": "def left_child_idx i\n i*2 + 1\nend",
"title": ""
},
{
... |
78af1007088f9847d57daa016ec0704e | Visit an Imaginary node. source://syntax_tree//lib/syntax_tree/basic_visitor.rb113 | [
{
"docid": "d4b9245b4385e674b01fb0e78e021496",
"score": "0.83684033",
"text": "def visit_imaginary(node); end",
"title": ""
}
] | [
{
"docid": "2e7f5dbd11d78680c5c9f94d3ee93c56",
"score": "0.7563201",
"text": "def visit_imaginary(node)\n node.copy\n end",
"title": ""
},
{
"docid": "30ffef375e19358ad25c5d1300bfd6aa",
"score": "0.70419574",
"text": "def visit_imaginary(node)\n s(\n :... |
1492b1c4d0456e1ecef06f35ca183ced | Reset the license count (System API) | [
{
"docid": "6fab04e253cf511038d78200b113718c",
"score": "0.8576336",
"text": "def reset_license_count(headers=default_headers)\n info(\"Resetting License Count\")\n put(\"#{@api_url}/license/reset\", {}, headers)\n end",
"title": ""
}
] | [
{
"docid": "67d4901fda7c7a0d11272d3de10ba36e",
"score": "0.71574986",
"text": "def used_license_count=(value)\n @used_license_count = value\n end",
"title": ""
},
{
"docid": "67d4901fda7c7a0d11272d3de10ba36e",
"score": "0.71574986",
"text": "def used_license... |
589adca7974fe5a6ffc9e8ad06aa8267 | make note to evernote | [
{
"docid": "8ddd63d5d72bb62279156367c0d44cc0",
"score": "0.65682036",
"text": "def make_note(note_store, note_title, note_body, parent_notebook=nil)\n # read the image, to make hash key in MD5\n file_path = save_image(@book.image)\n file_url = @book.image\n mime_type = MIME::Types.t... | [
{
"docid": "e766dc6baebe0c131a3b66c8a51d1386",
"score": "0.7171139",
"text": "def note(note)\n\t\t@note = note\n\tend",
"title": ""
},
{
"docid": "c43da8679050faed1e4b6317514a1770",
"score": "0.71581614",
"text": "def new_notes=(note)\n\t\tif !note.blank? then\n\t\t\ttime = Time.now.... |
43567cea1bf8cf9517d77817066bcf30 | taking in the listing user is seeing now and make a reservation for that particular listing | [
{
"docid": "f897d4773292e3f674b9472ba0343aa4",
"score": "0.684934",
"text": "def new\n\t\t@listing = Listing.find(params[:listing_id])\n\t\t@reservation = @listing.reservations.new\n\tend",
"title": ""
}
] | [
{
"docid": "9b6c0fcbfd44518650ace0a675ae1d04",
"score": "0.7842083",
"text": "def reserved\n @listing = Listing.find(params[:listing_id])\n @reservation = @listing.reservations\n end",
"title": ""
},
{
"docid": "cf861a912c376442c115666a8adce9c9",
"score": "0.72760266",
"text":... |
2cbc1ca1cb77d50343fb4f5d5ffa3c89 | GET /new_relic_reports GET /new_relic_reports.json | [
{
"docid": "ab24d38a75dae1bf7a132a338a897376",
"score": "0.71220213",
"text": "def index\n @new_relic_reports = NewRelicReport.all\n @new_relic_configs = NewRelicConfig.all\n @new_relic_applications = NewRelicApplication.all\n @business_units = BusinessUnit.all\n end",
"title": ""
}
] | [
{
"docid": "94b3f8df6e2c821e13edd851b5425d47",
"score": "0.7181349",
"text": "def set_new_relic_report\n @new_relic_report = NewRelicReport.find(params[:id])\n end",
"title": ""
},
{
"docid": "f0e2c67c9533b6164162cdcb72fa9173",
"score": "0.64259446",
"text": "def reports\n c... |
bb23b291e82d46cff7441e501999007f | Determine the default ip address, taken from packetfu's utils.rb | [
{
"docid": "cff19a1219e69acde3b553ba2770821a",
"score": "0.79051507",
"text": "def default_ip\n begin\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily\n UDPSocket.open do |s|\n s.connect rand_routable_dad... | [
{
"docid": "f36e3217510fa1dcf45c5da9b8fce8f2",
"score": "0.86102873",
"text": "def default_ip_address\n ifconfig = `ifconfig`\n entries = ifconfig.split(/inet (addr:)?/)\n entries = entries.map do |e|\n match = e.match(IP_REGEX)\n match && match[1]\n end\n entries.... |
ebe4a4a593b5bde304397dde51dfb52f | POST /assets POST /assets.json Creates and attemps to save an Asset | [
{
"docid": "8774203e0c30f33ccbabcff17aa48f63",
"score": "0.64357907",
"text": "def create\n @asset = current_user.assets.new(asset_params)\n \n #Check if the current user has enough storage to upload the asset\n if(@asset.asset.size + calculate_storage(current_user) > (1024*1024*5))\n f... | [
{
"docid": "b97aec6200f6da361799edd8c1eb8634",
"score": "0.7675491",
"text": "def create\n @asset = Asset.new(params[:asset])\n\n respond_to do |format|\n if @asset.save\n format.html { redirect_to assets_url, notice: 'Asset was successfully created.' }\n format.json { render js... |
0995390c4a6147f740e1c3751b08c43f | GET /userns/1 GET /userns/1.json | [
{
"docid": "ea4f7aee7bd55e632c37ade629917909",
"score": "0.61803377",
"text": "def show\n @usern = Usern.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usern }\n end\n end",
"title": ""
}
] | [
{
"docid": "98c57ad27b551ae12b8f2610d2b4db2b",
"score": "0.7078501",
"text": "def usern\n user = User.username(params[:usern])\n render json: user, status: 200\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.67248094",
"text": "def user\n... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "c185ed47a60d985c65611053ee48e075",
"score": "0.0",
"text": "def update!(**args)\n end",
"title": ""
}
] | [
{
"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... |
57cd456d3352b595f312a19f0faab2a8 | Cribbed from Ruby on Rails: File activesupport/lib/active_support/core_ext/hash/deep_merge.rb, line 21 | [
{
"docid": "b62e847324de15994f49e548d2bfcfc1",
"score": "0.0",
"text": "def deep_merge!(other_hash, &block)\n other_hash.each_pair do |current_key, other_value|\n this_value = self[current_key]\n\n self[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)\n this_value.... | [
{
"docid": "dbafa806502a7a4613b8ab544ffb5b6e",
"score": "0.7993942",
"text": "def _deep_merge(hash, other_hash); end",
"title": ""
},
{
"docid": "d44b455b6460f4d5dd6033df3dc6b9db",
"score": "0.78891885",
"text": "def deep_merge(source, hash); end",
"title": ""
},
{
"docid... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "ecd108aaef1a37eb5ce34f23236a5662",
"score": "0.0",
"text": "def upload_params\n params.require(:upload).permit(:file)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74939764",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6955084",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
002b1269496b09b115e5137ebf06e71c | NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place? time complicity O(n^2) | [
{
"docid": "807f21f7837c39af14e88cc1c5998802",
"score": "0.6526389",
"text": "def rotate_matrix(matrix)\n arr = []\n matrix.length.times do |i|\n sub = []\n\n matrix.each do |array|\n sub << array[i]\n end\n\n arr << sub.reverse\n end\n arr\nend",
"title": ""
}
] | [
{
"docid": "3068988ed7bfdae094963bcc5e2d03c8",
"score": "0.7585255",
"text": "def rotate_matrix(matrix)\n \nend",
"title": ""
},
{
"docid": "fd545107dda1573f1b7501ad761b8b83",
"score": "0.7530687",
"text": "def rotateImage(a)\n count = 0\n new_image = Array.new(a.size){ Array.... |
a396b69a57fe39be14850b7d984dfe50 | Send status when state changes, when state becomes busy, or every minute (even if there is no state change). | [
{
"docid": "2f6b5a8378d34979774bf650c263bcba",
"score": "0.68570316",
"text": "def set_state(new_state)\n if new_state != @state ||\n new_state == \"busy\" ||\n @last_status_time + 60 < Time.now\n @state = new_state\n send_status_message(new_state)\n ... | [
{
"docid": "5be4800890720c062ff42381e5b65482",
"score": "0.6879102",
"text": "def change_status!\n if status\n update(status: false)\n else\n update(status: true)\n end\n end",
"title": ""
},
{
"docid": "989e93b895ea777346df5522459fc013",
"score": "0.68697995",
"t... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "18d99feec93d0dd7ee7a84ea15dd2e75",
"score": "0.0",
"text": "def bill_address_params\n params.require(:bill_address).permit(:address, :zipcode, :city, :phone, :country_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74964964",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957765",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a1110567c46225ad134bf4cd47001d63",
"score": "0.0",
"text": "def set_realtor\n @realtor = Realtor.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;... |
658047d33e83754ecbc756eb673eadf7 | By: Bryce Allen cs 214 Calvin College 3/27/18 | [
{
"docid": "23ae4e23ddcc7ee535272f86f3540448",
"score": "0.0",
"text": "def writeValues(anArray)\n for i in 0...anArray.size\n anArray[i] = gets.chomp.to_f\n end\nend",
"title": ""
}
] | [
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63887954",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.63887954",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3... |
338f22281622b39f02355ef50f13bfd6 | Uses advanced search request handler to find Nodes matching the request. Currently only searches against attribute values. Does not search against associations (though associations in the create request will be applied to the Node if created.) | [
{
"docid": "2e34e2c8a2c70a3e1f069028f7a73694",
"score": "0.0",
"text": "def find_or_create\n authorize! :create, Node\n begin\n model = @pool.models.find(params[:node][:model_id])\n rescue ActiveRecord::RecordNotFound\n #User didn't have access to the model they were trying to set.\n ... | [
{
"docid": "b09e7e3f83860b203b5ff1aacf8fbe24",
"score": "0.65998787",
"text": "def enable_search_on(*attributes)\n self.instance_eval do\n get SEARCH_ROUTE do\n retrieve_resources '' do |resource|\n\n pass if !involved? || params[:q].blank? || params[:q].size > 10... |
f6da7e82109fb58ecb9c15d611195715 | Stop ALL applications in the group | [
{
"docid": "a9e006a7a20102ca271998356db28314",
"score": "0.79712933",
"text": "def stopApplications\n if self.app_contexts.empty?\n warn \"No applications defined in group #{self.name}. Nothing to stop\"\n else\n resources[type: 'application'].state = :stopped\n end\n end... | [
{
"docid": "0f635a40b255c02c0ecd1b21eedaa739",
"score": "0.8933513",
"text": "def stopApplications\n debug(\"Stop all applications\")\n super\n groups.each { |g|\n debug(\".... Stop applications in #{g}\")\n g.stopApplications\n }\n end",
"title": ""
},
{
"docid": "15b... |
d54e63953d8d68af1f2bce6586f42ebe | TODO: Make RecenRoutes modules that handles exceptions, only etc. | [
{
"docid": "bc6787f91eb87509e1fe384e098560df",
"score": "0.0",
"text": "def log_user_recent_route\n @sessions_current_user.add_page_to_recent(request.fullpath) if @sessions_current_user\n end",
"title": ""
}
] | [
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.76188135",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.76188135",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
... |
ebbca40f15ea17fbc0e0f5f707d17454 | GET /attachments/new GET /attachments/new.xml | [
{
"docid": "fae147e88a538bd95c350227d72e7f67",
"score": "0.7214803",
"text": "def new\n #raise params.to_yaml\n @attachment = Attachment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attachment }\n ... | [
{
"docid": "fadcdf282a5779d30b20f6fd9151b316",
"score": "0.7497073",
"text": "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @attachment }\n end\n end",
"title": ""
... |
8362cac4dae5fde5bac44d14c84a36bd | Format the currently matched filename to be more human readable | [
{
"docid": "60ba40b5a7ef1fdd26a576d9b713d29b",
"score": "0.70974773",
"text": "def format_filename_for_output\n \"app/\" + current_filename.split(\"/app/\")[1]\n end",
"title": ""
}
] | [
{
"docid": "f864c61da5d6b057e9f5d76c4d6dc8c3",
"score": "0.76643306",
"text": "def correct_filename\n res = @format\n matches = res.match(/.*(%(.+)%).*/)\n \n while !matches.nil?\n tag_name = matches[2]\n val = (tag_name == 'extension') ? @extension : tag(tag_name)\n val = val... |
04c64d26325334eefaf414b2b55d8d77 | Determines if we are in a particular environment | [
{
"docid": "40e9515d1df33e5697398cacba4ca409",
"score": "0.7592567",
"text": "def env?(e)\n env == e.to_sym\n end",
"title": ""
}
] | [
{
"docid": "56d5fa6c33729e8337fc1db2a66065ed",
"score": "0.79818887",
"text": "def is?(environment_name)\n environment_name.to_s.upcase == environment.name\n end",
"title": ""
},
{
"docid": "56d5fa6c33729e8337fc1db2a66065ed",
"score": "0.79818887",
"text": "def is?(environment_na... |
5bc5e8eeef1e6bcbba0df89e684e258f | Set the value of the Plan input for this Choreo. | [
{
"docid": "22f3e0174449fb3c16b68686f5418bcc",
"score": "0.7667243",
"text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end",
"title": ""
}
] | [
{
"docid": "a7351a097ad152b6f4245857d91aac41",
"score": "0.7890126",
"text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end",
"title": ""
},
{
"docid": "a7351a097ad152b6f4245857d91aac41",
"score": "0.7890126",
"text": "def set_Plan(value)\n set_input(\"Pla... |
ab52e09fd5fd7a89dbca1557d2584fbf | scrape_table function: gets passed an individual page to scrape | [
{
"docid": "12cf7e32858f7b8db0e9744a3d27c1a7",
"score": "0.0",
"text": "def scrape_page2(page2)\n \n record = {}\n\n record['Hours'] = 'not listed'\n record['Categories'] = 'not listed'\n record['In Business Since'] = 'not listed'\n record['General Info'] = 'not listed'\n record['Accreditations']... | [
{
"docid": "c93ec0cf92cab06cb573011b20774ea9",
"score": "0.7634231",
"text": "def scrape_table(page)\n data_table = page.css('table.data tr').collect {|x| x.css('td')}.reject{ |x| x.length == 0}.collect do |row|\n record = {\n Product: row.css('h1')[0].inner_text,\n Price: row.css('.detail... |
76075731cd130c3cf35ffd6a669c4afe | bind a single parameter to a particular position | [
{
"docid": "be881242e63648b235e7c7891207bdea",
"score": "0.73205566",
"text": "def bind_parameter_to( position, value )\n bind_type = db.type_map.bind_type_of( value ) \n case bind_type\n when DataType::FLOAT\n @stmt_api.bind_double( position, value )\n when DataType::INTEGER\... | [
{
"docid": "3dde23dd81cdc61c05d9a4e082736d19",
"score": "0.7036375",
"text": "def visit_Arel_Nodes_BindParam(x)\n @binds.shift[1]\n end",
"title": ""
},
{
"docid": "3e964ec5037922f6bfcfce507de037ff",
"score": "0.6903447",
"text": "def bind_positional_parameters( params )\n ... |
acb916d9e768f05cf184fa450c6961db | Either (a) return a Rack response (shortcircuiting the Rack stack), or (b) alter env as necessary and return true | [
{
"docid": "0debdb137ef9803f42252c6c3ff94a93",
"score": "0.0",
"text": "def apply!(env) #:nodoc:\n interpreted_to = self.interpret_to(env)\n additional_headers = {}\n if @options[:headers]\n if @options[:headers].respond_to?(:call)\n additional_headers = @options... | [
{
"docid": "ca871a7ee70e62a66fa1b8dc9ac5f32b",
"score": "0.67659223",
"text": "def support_rack?(key)\n key == :env\n end",
"title": ""
},
{
"docid": "7929443787d6fafae8094dc289bc982a",
"score": "0.64963573",
"text": "def rack_env; end",
"title": ""
},
{
"docid": ... |
59de214e99508b80624e9023de0c9fa3 | Baseline implementation for the delete_partition REST call | [
{
"docid": "59a29c9b4441aa4b88190c6dc4efa5e5",
"score": "0.7622338",
"text": "def delete_partition request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_part... | [
{
"docid": "faadfb1d37d25cfebbe87112d41dee04",
"score": "0.75279456",
"text": "def delete_partition(opts)\n opts = check_params(opts,[:partition_names])\n super(opts)\n end",
"title": ""
},
{
"docid": "31c3ea10a32fad07e4ab82ad9f5e2888",
"score": "0.72971493",
"text": "de... |
fb63e36177f97554716a32868a55ebda | Do we have all data in raw form | [
{
"docid": "58f698c66af43f48e967cf2d0c5821dd",
"score": "0.0",
"text": "def ready?; @ready; end",
"title": ""
}
] | [
{
"docid": "d23f58de7df31d112408c8f9cf413f96",
"score": "0.7462221",
"text": "def raw?\n @raw\n end",
"title": ""
},
{
"docid": "d0f94271a910c9264f21b20e59bd1409",
"score": "0.73445106",
"text": "def raw?\n !!@raw\n end",
"title": ""
},
{
"docid": "95e9b8f... |
dedd28dc7c62a80445e19f31b5876eef | Send welcome email to user | [
{
"docid": "16e9095c44e4334292d3ab9336d7f94b",
"score": "0.85685235",
"text": "def send_welcome_email\n UserMailer.welcome_email(self).deliver\n end",
"title": ""
}
] | [
{
"docid": "5f99c04d5fe21c7b7fa5454ef0c02492",
"score": "0.8816134",
"text": "def welcome\n mail(to: 'user@example.com')\n end",
"title": ""
},
{
"docid": "7146b5e646e07a4662d03122d563d203",
"score": "0.8738244",
"text": "def send_welcome_email_to_user\n UserMailer.welcome... |
42af071fd4854a6182795e8f4f726fa9 | Generate the path to the iamge to be displayed. | [
{
"docid": "874fe7b55b28ee9960510eda85f28ee7",
"score": "0.0",
"text": "def render_details\n {path: \"#{url_helpers.frontend_screen_field_content_path(self.screen, self.field, self)}\"}\n end",
"title": ""
}
] | [
{
"docid": "a80ec852749554796a8ec35bad1d2062",
"score": "0.67431563",
"text": "def path\n @path ||= \"/icons/#{filename}\"\n end",
"title": ""
},
{
"docid": "66468490beeb2db338f874666b3e1ab8",
"score": "0.6699049",
"text": "def path\n to_s\n end",
"title": ""
},
... |
a84ddd7dd450e9ca79c76250704536f0 | GET /disclosures/1 GET /disclosures/1.json | [
{
"docid": "e4f4209f959f1046cfbc98435200451a",
"score": "0.67452836",
"text": "def show\n respond_to do |format|\n format.html { redirect_to :index}\n format.json { render json: Disclosure.find(params[:id]) }\n end\n end",
"title": ""
}
] | [
{
"docid": "89c5f700fb39d7c4cc33626ac73c6295",
"score": "0.72528833",
"text": "def index\n @disclosures = Disclosure.order(:id).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @disclosures }\n end\n end",
"title": ""
},
{
"docid"... |
8de814560050602dc640c719ba66c7a1 | If integer value max is passed, it should not return max This is very important because simulator program heavily depends on random value i.e move to random city, get random amount of gold and silver EDGE CASE | [
{
"docid": "eba740b60541900a18a8e898063966be",
"score": "0.71950495",
"text": "def test_random_num_max\n\t\tmax = 1\n\t\toutput = @test_sim.random_num(max)\n \t\trefute_equal max, output\n\tend",
"title": ""
}
] | [
{
"docid": "edff2a01ed7cbe84e80c31756ee49aa7",
"score": "0.7177534",
"text": "def rand(max); end",
"title": ""
},
{
"docid": "00242b8915122b58cb14399217802eae",
"score": "0.7146031",
"text": "def get_random_number(max_value = 10)\n rand(max_value)\n end",
"title": ""
},
{... |
5938593b65d3a7a5914cf3fcc672c14f | load the league names belonging to this federation. The leagues themselves can be loaded later | [
{
"docid": "4ba13325137897fd167dfd74359b130f",
"score": "0.74841875",
"text": "def partial_load\n if @loader\n names = @loader.get_league_names\n @league_names = names unless names.empty?\n end\n end",
"title": ""
}
] | [
{
"docid": "f7b5c90f4b97b9f88fbf6fe935856120",
"score": "0.7496341",
"text": "def get_league_names\n res = []\n\n if @league_names\n # league names were downloaded before\n @league_names.each do |l|\n res.push(l.name)\n end\n\n else\n # league names were not downloade... |
a917a7566f009bbdb59eb66a3d71fede | def check_user_blocked_show room = DirectRoom.find_by(id: params[:id]) if current_user == room.user dude = User.all.find(room.dude_id) else dude = room.user end p 'dasdsagsdjdjfsdjhajfsdjfdhsdhfhsdhsdfhsdshf' p dude redirect_to rooms_path, alert: "User is blocked" if current_user.is_blocked?(dude) blocked_users = curre... | [
{
"docid": "dc7d8a5cd27a0094e15d77f755e74a4a",
"score": "0.8315905",
"text": "def check_if_blocked\n\t\trecord = BlockedUser.find_by(user_id: current_user.id, blocked_id: params[:user_id])\n\t\tredirect_to rooms_path, alert: \"User is blocked!\" if record\n\tend",
"title": ""
}
] | [
{
"docid": "e21588774701b84887c87e0f8f4f583c",
"score": "0.7673592",
"text": "def blocked\n @user = User.find(params[:id])\n @user.block!\n redirect_to dashboard_listing_path\n end",
"title": ""
},
{
"docid": "52d22e6235f4ad17d684ca4d955211bf",
"score": "0.7519918",
"text":... |
015340e4136f8db99b45cbc825006bc0 | PATCH/PUT /intermediaries/1 PATCH/PUT /intermediaries/1.json | [
{
"docid": "6a748430cdf90a41e8e41dfd6ee32b60",
"score": "0.61000675",
"text": "def update\n respond_to do |format|\n if @intermediary.update(intermediary_params)\n format.html { redirect_to @intermediary, notice: 'Intermediary was successfully updated.' }\n format.json { render :sh... | [
{
"docid": "7b909f148897744150a27d6a95090033",
"score": "0.5828301",
"text": "def patch_update_consumption_detail_id\n id_array = JSON.parse(params[:ids])\n consumption_detail_id = params[:consumption_detail_id]\n UserAttachment.find_by_ids(id_array).update(consumption_detail_id: consumption_de... |
ca014175f77233924a109c734997fa01 | GET /songs/new GET /songs/new.json | [
{
"docid": "7a3883413125f92dbc19d0c3dbdc2315",
"score": "0.8149225",
"text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end",
"title": ""
}
] | [
{
"docid": "e34b5055c1365ffc40bec7a4462fcb36",
"score": "0.8152672",
"text": "def new\n @song = Song.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @song }\n end\n end",
"title": ""
},
{
"docid": "aab5ff2d8550909d3a9f7d1b82762a53",
... |
1b6d67b1682f3547b48fe28292429b5f | DELETE /recurs/1 DELETE /recurs/1.json | [
{
"docid": "b78dfac28a55395416381583bc2d2a5e",
"score": "0.64840466",
"text": "def destroy\n @recur.destroy\n respond_to do |format|\n format.html { redirect_to recurs_url, notice: 'Recur was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "dbf77526ef53ae407a21ad5298eaec5c",
"score": "0.6635381",
"text": "def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to recursos_url }\n format.json { head :no_content }\n end\n end",
"title": "... |
6066e66c909d3b67532ae6dc1667ce6b | 'Kernel' and method parentheses included throughout code as training tool | [
{
"docid": "740470a2405d414d188fc855061d1479",
"score": "0.0",
"text": "def prompt(message)\n Kernel.puts(\"=> #{message}\")\nend",
"title": ""
}
] | [
{
"docid": "85708f887b29ffe8d05ca5456515193f",
"score": "0.7424895",
"text": "def kernel(arg)\n regular(arg).kernel\n end",
"title": ""
},
{
"docid": "19cf94a4025e3fa3ec161e02d4ca1cbb",
"score": "0.681314",
"text": "def kernel\r\n\t\t@@kernels[@kernel]\r\n\tend",
"tit... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ... | [
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7243395",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ... |
c497eb652c6d248f37beed78252882f2 | Returns a set of all of the script names used in rule conditions. | [
{
"docid": "988a1e6041a0355c8697332d40496593",
"score": "0.70882386",
"text": "def script_names\n property_values('script_name')\n end",
"title": ""
}
] | [
{
"docid": "07b23b2d250fede9f911f0175fb656a1",
"score": "0.648608",
"text": "def get_script_list\n @scripts = Dir.glob(\"#{@config[:scripts_directory]}/*.rb\")\n @scripts.map { |filename|\n filename[0...-3]\n }\n end",
"title": ""
},
{
"docid": "93288d7acfb0828e20574... |
e9c135dcda9be5f07b707f2df807b515 | commercialCompanyName : String commercialCompanyName of the company | [
{
"docid": "1de9941a58f2aa21fd415425786c6ac8",
"score": "0.8620627",
"text": "def commercial_company_name\n self.dig_for_string(\"companySummary\", \"commercialCompanyName\")\n end",
"title": ""
}
] | [
{
"docid": "513d7b74198a1bfe50e3cce614ff8e68",
"score": "0.7678594",
"text": "def company_name\n return @company_name\n end",
"title": ""
},
{
"docid": "513d7b74198a1bfe50e3cce614ff8e68",
"score": "0.7678594",
"text": "def company_name\n retur... |
bed2ac5f8ed634367bb4dfa2d18a34ee | Usamos essa funcao para escolher um novo pid para o proximo processo que chegar no sistema, pegamos o ultimo pid no dicionario e incrementamos seu valor | [
{
"docid": "a2b47da4832136b9cc1e40c989f18ddf",
"score": "0.63765335",
"text": "def assign_pid(pid_dictionary)\n pid = pid_dictionary.keys.max.to_i + 1\n pid_dictionary[pid] = @process_name\n return pid\n end",
"title": ""
}
] | [
{
"docid": "efcaf28400106e5c7d782753da4bf746",
"score": "0.67237896",
"text": "def assign_pid\n start = Setting.starting_pid\n\n self.pid = if Pilot.exists?\n last = Pilot.order(pid: :asc).last\n (last.pid >= start ? last.pid + 1 : start)\n else\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "82226a3a67adc3be3fc0ffd03a55104a",
"score": "0.0",
"text": "def set_course\n @course = Course.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... |
e0698981138a5b5ef4129a5856e61f68 | Check if user have access | [
{
"docid": "4dd7f8eb2d0afb8c259af7719d46d928",
"score": "0.0",
"text": "def check_if_user_access\n if current_user && current_user.admin?\n @transactions = Transaction.paginate(page: params[:page])\n elsif current_user && current_user.role == \"Store\"\n redirect_to root_path\n flas... | [
{
"docid": "9798cd3d1321a00bd6f8069b6762f791",
"score": "0.83544827",
"text": "def check_access\n render_no_permission unless @sir_log.user_is_owner_or_deputy?( current_user.id )\n end",
"title": ""
},
{
"docid": "3bc8d29eb8f601ef606eb4a9f94e3e12",
"score": "0.82146126",
"tex... |