query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
45bd76fb38e16c3f74df24cb69c3afb3
This method has been copied from lib/preview_auth_bypass for perpetuity in a migration, it provides a transformation algorithm used to predictably convert a string to a UUID to provide obfuscation.
[ { "docid": "18d178cf04564616dbff7bbadf29b351", "score": "0.60373753", "text": "def generate_uuid_for_string(string)\n ary = Digest::SHA256.hexdigest(string).unpack(\"NnnnnN\")\n ary[2] = (ary[2] & 0x0fff) | 0x4000\n ary[3] = (ary[3] & 0x3fff) | 0x8000\n sprintf \"%08x-%04x-%04x-%04x-%04x%08x...
[ { "docid": "b11c11ecc04a0669351c4b907efa6d2a", "score": "0.67902625", "text": "def obfuscated_id\n Cryptography.obfuscate(self.id)\n end", "title": "" }, { "docid": "0e3afce55b8d7779df236523a2d0003d", "score": "0.66315377", "text": "def from_uuid_old_to_csharp_legacy_uuid(hex)\n ...
d2497cc3936d51fc45b5ffaf751dc6b9
returns the error output for the command
[ { "docid": "90be0e7fb2fd573594618200c09d8cd4", "score": "0.6337684", "text": "def error\r\n #initialize nil values to something meaningful\r\n @error||=\"\"\r\n return @error\r\n end", "title": "" } ]
[ { "docid": "ead99a04f603adb55144913001ad3af8", "score": "0.7365848", "text": "def try_err cmd\n execute cmd, \"try_err\"\n end", "title": "" }, { "docid": "ead99a04f603adb55144913001ad3af8", "score": "0.7365848", "text": "def try_err cmd\n execute cmd, \"try_err\"\n ...
6a763e1d59d5879e00e7776d65197ee1
gets all node pools' oauthscopes
[ { "docid": "be13d2c661eac3f6a9f07874b3457f36", "score": "0.68993425", "text": "def nps_oauthscopes \n @output['nps_oauthscopes']['value']\n end", "title": "" } ]
[ { "docid": "8254508c62ac4235c5784c894300f2c6", "score": "0.6522376", "text": "def scopes_for(token)\n token = token.github_oauth_token if token.respond_to? :github_oauth_token\n scopes = GH.with(token: token.to_s) { GH.head('user') }.headers['x-oauth-scopes'] if token.present?\n sc...
e07e3d024fcdcefc932760ed2f2cd93a
Get input for an equation
[ { "docid": "720866d8db97cdc74661f96de0cbefb7", "score": "0.6979395", "text": "def input_equation()\n\tputs \"Hello I'm a calculator\"\n\twhile true\n\t\tputs \"Please input a math equation that has + - * or / (ex. 3 * 5)\"\n\t\tuser_input = gets.strip\n\t\t# remove all spaces from input\n\t\tuser_input ...
[ { "docid": "f9548d15fb852ea407d289baa21a9531", "score": "0.7327949", "text": "def read_and_calculate\n puts 'Insert the equation'\n entry = gets.chomp\n result = calculate(entry)\n puts result\n end", "title": "" }, { "docid": "9f5ce030cdcc163e3a442ff53eb82701"...
abcc84cdb7f1892bb47625a1760c56bd
the preloader also tries to replace the key, with the source code from the tree node, but it's a noop see ActiveRecord::Associations::BelongsToAssociationreplace_keys
[ { "docid": "07ee37ec863a3f795ee6d9d8b7e9901a", "score": "0.0", "text": "def []=(attr_name, value)\n super unless SYNTHETIC_KEYS.include?(attr_name)\n end", "title": "" } ]
[ { "docid": "3f663a174b8290a20a4427aca1622aba", "score": "0.56438196", "text": "def preorder(tree)\n if tree\n p tree.key\n preorder(tree.leftChild)\n preorder(tree.rightChild)\n end\nend", "title": "" }, { "docid": "1d44b2f90653b6922b3237ed232007a4", "score": "0.552509", "text":...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4fa2316fc4e37513e33e996b61dfcd52", "score": "0.0", "text": "def set_expense\n @expense = Expense.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
65ae767a44baef8be3d48ef9bd358336
GET /symboles GET /symboles.json
[ { "docid": "02f6b95fa1f740d88a531e7f8d494559", "score": "0.72147644", "text": "def index\n @symboles = Symbole.all\n end", "title": "" } ]
[ { "docid": "5d267d7e394063f094e324a407c9858a", "score": "0.6017258", "text": "def index\n @symptoms = Symptom.all\n\n render json: @symptoms\n end", "title": "" }, { "docid": "785895bc47c50c348499a0f2e6a65eba", "score": "0.5830984", "text": "def show\n @biomechanical_symmet...
d382ffb24166269c82479803bbd71e53
GET /elements or /elements.json def index
[ { "docid": "e7d6e099824343511c9c911190e5f31a", "score": "0.0", "text": "def create\n @element = @post.elements.build(element_params)\n \n if @element.save\n notice = nil\n else\n notice = @element.errors.full_messages.join(\". \") << \".\"\n end\n ...
[ { "docid": "26dbbeff2f146b457c39e36d441cb342", "score": "0.8114336", "text": "def index\n @elements = Element.all\n render json: @elements\n end", "title": "" }, { "docid": "a8e7de780f2dc583406d52b8d450f5d4", "score": "0.81081784", "text": "def index\n @elements = Eleme...
5ee6c56ab5d9f632d6a09a620137257b
DELETE /trips/1 DELETE /trips/1.json
[ { "docid": "3935d09e48ca8261442f6718568cf0b8", "score": "0.72173893", "text": "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8d7974daec8f84834884a9982cfda923", "score": "0.7665815", "text": "def destroy\n @trip.destroy\n\n respond_to do |format|\n format.any(:trips_json, :json) do\n head :no_content\n end\n end\n end", "title": "" }, { "docid": "450279cf721c70c6...
d40f5bbe1ed42097d0a33638f0802780
retrieve only text in 'lyricbox div'
[ { "docid": "aab593b40df6367a1e2bd86a1f944036", "score": "0.669338", "text": "def get_lyrics\n\t\t\tlyric = \"\"\n\t\t\tget_page.css('div.lyricbox').children.each do |node|\n\t\t\t\tlyric << node.content if node.text?\n\t\t\t\tlyric << \"\\n\" if node.name == \"br\"\n\t\t\tend\n\t\t\tlyric\n\t\tend", ...
[ { "docid": "4186f898def642a58d9b2485310473e6", "score": "0.6573184", "text": "def text_descbikeLight\n driver.find_element(:css, 'div.inventory_list > div:nth-child(2) div.inventory_item_label > div')\n end", "title": "" }, { "docid": "d506fa7a8f9812d565b608daa6c12c...
12a33a15b07c1df9f8a6511a625f1bbb
Select the individual from the population using the Tournament method.
[ { "docid": "10c08d30bc5c270d93546f3f5bfcd1e7", "score": "0.76325643", "text": "def select_one population=self.population\n raise \"Tournament: empty population\" if population.empty?\n raise \"Tournament: tournament_size bigger than population.size\" if @tournament_size > population.size \n ...
[ { "docid": "08bcec1d679f60b0f04822e207da51d0", "score": "0.6741529", "text": "def select_one population=self.population\n select( 1, population ).first\n end", "title": "" }, { "docid": "08bcec1d679f60b0f04822e207da51d0", "score": "0.6741529", "text": "def select_one populati...
f8fc4f0954bf86dfa50f6d0e8118db0b
check if my twitter account is linked to Sportlobster
[ { "docid": "f8a5e84ede09cc060a0f9ec90b2f4a51", "score": "0.67697835", "text": "def check_if_tw_account_is_linked_to_sl_account\n\n page.execute_script(TW_JAVA_SCRIPT_CONNECTED_ACCOUNT)\n\n return page.evaluate_script(TW_USER_ID)\n\n end", "title": "" } ]
[ { "docid": "d54ea09bbcf6889520fca1f739b710e1", "score": "0.7702651", "text": "def twitter?\n false\n end", "title": "" }, { "docid": "4466ba4179a36f03a5fe0548fd87e167", "score": "0.76647156", "text": "def connected_to_twitter?\n twitter_token && twitter_secret\n end", "ti...
f31c5dfb527681c4b20e5bedfb40aa19
Similar to find except that it negates the criteria.
[ { "docid": "0a168fb427e9b30f5a20e944f595cb4f", "score": "0.0", "text": "def except(options)\n source, target = find_source(options, :-)\n apply(:sdiffstore, key, source, target)\n end", "title": "" } ]
[ { "docid": "9b3bd5d25315b38cf36e4a779489d074", "score": "0.66534317", "text": "def ~@; Filter.new :not, self, nil; end", "title": "" }, { "docid": "9b3bd5d25315b38cf36e4a779489d074", "score": "0.66534317", "text": "def ~@; Filter.new :not, self, nil; end", "title": "" }, { ...
66ff712c29ed52dec13cc07027742e32
Shorthand for accessing the country part of the desired attributes
[ { "docid": "81c2dd7daf57c30afb1ab55a955cb8e8", "score": "0.8078534", "text": "def country_iso\n desired_attributes[:country_iso]\n end", "title": "" } ]
[ { "docid": "75685239c1b7298093d6eb9d8fbfe6e7", "score": "0.7872955", "text": "def billing_country\n @attributes[:billing_country]\n end", "title": "" }, { "docid": "59068290546910001ddf630ebe40fcf2", "score": "0.7819488", "text": "def country\n fetch('address.country')...
e1840a4c1efaef6d849399245970de4e
Returns user's task Returns true if the given token matches the digest.
[ { "docid": "7d5caeab7f31a515495c19359b27f308", "score": "0.0", "text": "def authenticated?(attribute, token)\n digest = send(\"#{attribute}_digest\")\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end", "title": "" } ]
[ { "docid": "9e854261e13509b56a6bdd7480cceffa", "score": "0.61729085", "text": "def authenticated?(digest, token)\n digest = send(\"#{digest}_digest\")\n # Use metaprogramming to select the appropriate token attribute based on\n # the parameter digest.\n return false if digest.nil? # Digest d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "00ba1f326112df6f959562769e07b19e", "score": "0.0", "text": "def set_special\n @special = Special.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...
db90db79c36c2c92f15918ba1ff596ee
Makes sure the current App ID exists. If not, it will show an appropriate error message
[ { "docid": "fb74d05a206609333d57b942fc93cfb1", "score": "0.775175", "text": "def ensure_app_exists!\n return if app\n UI.user_error!(\"Could not find app with App Identifier '#{Precheck.config[:app_identifier]}'\")\n end", "title": "" } ]
[ { "docid": "3a9f4a566a68888e1b18c3c9a3abad63", "score": "0.78785276", "text": "def check_application_id\n return if application_id\n @logger.display('application_id_missing')\n exit 1\n end", "title": "" }, { "docid": "e38adcd2cb7a08f2b7ea2b048144791f", "score": "0.7119194", ...
77975522a8dcf8a4a0c9295660d99b26
Returns +Result+ wrapping +Nokogiri::XML::Document+
[ { "docid": "f185529fa81dcdf2f295c4a18c830998", "score": "0.0", "text": "def fetch(code)\n unless SUPPORTED_DATA.include?(code)\n return Result.error(:unknown_code, \"Avantio supports only next files: #{SUPPORTED_DATA}\")\n end\n zip = client.get(url(code))\n return zip unless ...
[ { "docid": "e00f5f2bc685be09554e579a5afb7001", "score": "0.7443753", "text": "def get_xml_document\n Nokogiri::XML(self.body)\n end", "title": "" }, { "docid": "bc9f28a4ba6eb8261c0a8b07de753bce", "score": "0.7349825", "text": "def nokogiri_document \n\t\t\t@nokogiri_document ||= ...
16cee31918d1a7e454990823c6731e74
GET /cruises/1 GET /cruises/1.json
[ { "docid": "4f710279c3887df7af70038fff6cb86c", "score": "0.0", "text": "def show\n if @cruise.approved? or can?(:read, @cruise)\n respond_to do |format|\n format.html\n format.geojson\n #~ format.json\n #~ format.csv\n format.csv { send_data build_csv, filename...
[ { "docid": "2288e9dbd09388fbe550d067a06da628", "score": "0.6480258", "text": "def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n end\n end", "title": "" }, { "docid": "87486555a41d4c...
0dcd299be524ec0864935d2ca8e05239
def destroy update(user: nil, body: nil, rate: nil) end
[ { "docid": "bfc29e178ec1fa6b26e03dacfc87a679", "score": "0.0", "text": "def deleted?\n user.nil?\n end", "title": "" } ]
[ { "docid": "027aae8a8c4f73908c01e583d64f649c", "score": "0.6634771", "text": "def destroy\n @rate.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "707f184a474f1460942b1915e58b05f3", "score": "0.6609567", "text...
39762c8fd1ab000b3e05de5f199e7732
PATCH|PUT /admin/contacts/:id generally update the contact info
[ { "docid": "5cc9ea1e1566ec13c21231f7aa89ded0", "score": "0.75108695", "text": "def update\n if !params.has_key?(:ur_contact) then\n head :internal_server_error\n return\n end\n\n #really update the contacts\n contact = UrContact.find(params[:id])\n\n #can't dlete contact you don...
[ { "docid": "6da9db523ed019dc6e32d1338dbcf36f", "score": "0.7937909", "text": "def update\n respond_to do |format|\n if @admin_contact.update(admin_contact_params)\n format.html { redirect_to admin_contacts_path, notice: mk_notice(@admin_contact, :id, 'Contact', :update) }\n format....
2b176e372adf34e903202936208c2c43
Users of the workspace with the defined role This method retrieves the users of the given role in that workspace. Usage : workspace.users_by_role('ws_admin') Parameters : role_name: String defining the role name (ex : 'superadmin', 'reader', ...)
[ { "docid": "cb176fdb483a8e9ab007aa23f6939768", "score": "0.73390585", "text": "def users_by_role role_name\n role = self.roles.find_by_name(role_name)\n res = []\n if role\n uc = UsersContainer.find(:all, :conditions => { :role_id => role.id, :containerable_id => self.id, :...
[ { "docid": "a6c892d93d4063f2c5a4109554db909c", "score": "0.707692", "text": "def list_users(role_id)\n get(\"roles/#{role_id}/users\")['users']\n end", "title": "" }, { "docid": "90d12e493cc6d88bf16352a825b2de9b", "score": "0.70318544", "text": "def get_user_in_role(r...
5a70c134ea06579a50bc6bb45d7545d5
This function undefines/removes the definition by removing the directoy with definition_name under env.definition_dir
[ { "docid": "1d68d0bab74d2cbd1f0890f99a7ac623", "score": "0.818195", "text": "def undefine(definition_name, options = {})\n definition = env.definitions[definition_name]\n unless definition.nil?\n\n #TODO: Needs to be more defensive!!\n env.logger.debug(\"[Undefine] About to remov...
[ { "docid": "c3780428a8888ae1729fea18355cde34", "score": "0.6667801", "text": "def remove_definition_set\n\t\t\t#self.log.debug \"Removing definition set from stack of %d frames\" %\n\t\t\t#\t@definitions.nitems\n\t\t\tdefs = @definitions.pop\n\t\t\t#self.log.debug \"Removing defs: %p, %d frames left\" %...
45cf71f2a2d1fa0574de77df0e05e4f2
POST /furnitures or /furnitures.json
[ { "docid": "263d43c9d931bd8e20488e276e0b0c95", "score": "0.6166166", "text": "def create\n @furniture = Furniture.new(furniture_params)\n respond_to do |format|\n if @furniture.save\n format.html { redirect_to @furniture, notice: \"Furniture was successfully created.\" }\n forma...
[ { "docid": "6687d26d31309b93847904dc89263d3d", "score": "0.620209", "text": "def create\n origin = params[:fare][:origin]\n destination = params[:fare][:destination]\n\n \tuber = calculate_uber(origin, destination)\n lyft = calculate_lyft(origin, destination)\n\n if uber and lyft\n ren...
67576b14718454bb3e13593e540d05f5
Extract the string of expression.
[ { "docid": "2391142e455e63a045d5442c975f31f1", "score": "0.0", "text": "def extract_string(label, parser_name, tree_name)\n return nil if label.nil?\n\n parsed = Parser.new.send(parser_name).parse(label)\n offset = find_head_character_position(parsed[tree_name])\n tai...
[ { "docid": "27a1195769a80091bfc0326e2d4d4bab", "score": "0.78219783", "text": "def get_expression(expression)\n return get_string(\"getExpression\", [expression,])\n end", "title": "" }, { "docid": "0cd1eab2280951442ac4ae23704356f4", "score": "0.7455847", "text": "d...
ed2b61d13a55e17a4520f1116e8ecf39
Format a picked color
[ { "docid": "5d23f620baae0d1777283f9ff0fc7297", "score": "0.0", "text": "def color(pigment)\n \"\\e[#{COLORS[pigment.to_sym]}m\"\n end", "title": "" } ]
[ { "docid": "7fc72e097bf4ab1d858afe2a894ede08", "score": "0.73895234", "text": "def colorize(val, color, isatty); end", "title": "" }, { "docid": "35a90a7575687723f2f713930220d4cd", "score": "0.71773195", "text": "def color_fmt\n case self\n when /\\dB?$/\n self.blue\n w...
76ad9f012874e59a20ba7ad7a24c585a
this method is a replacement for ruby's native map
[ { "docid": "b88c260133a7558ae2e39101c60e8215", "score": "0.0", "text": "def my_map(proc = nil)\n mapped = []\n my_each do |value|\n if proc == nil\n mapped << yield(value)\n else\n mapped << proc.call(value)\n end\n end\n puts \"#{mapped}\"\n mapped\nend", "title": "" } ]
[ { "docid": "e4f1c5cd5cb25f5636988b4799d66724", "score": "0.7885285", "text": "def map; end", "title": "" }, { "docid": "a4d099a69cd23ad8cb03536a21d866c5", "score": "0.7337031", "text": "def map(hash); end", "title": "" }, { "docid": "a4d099a69cd23ad8cb03536a21d866c5", ...
b6651d0459a5a305257116bcec145de1
Increment the integer value of a key by one. O(1).
[ { "docid": "64f0a404d58730b21af1d9a81f97cd42", "score": "0.7544328", "text": "def incr(key)\n\t\t\t\t\tcall('INCR', key)\n\t\t\t\tend", "title": "" } ]
[ { "docid": "a6d264e1b803ea05ab06bddd3d02e5f0", "score": "0.8124939", "text": "def increment(key, value)\n entries[key] ||= 0\n entries[key] += value\n self[key]\n end", "title": "" }, { "docid": "b46705b0e6871c1c74e86ecafccc84b4", "score": "0.8117719", "text": "def incremen...
056da1b1acb60ffa2b5260c86898939a
given a hash, load that hash as the configuration
[ { "docid": "33490d0cf029d357f78b38f25863ee91", "score": "0.78063625", "text": "def load_configuration(hash)\n marshal_load prepare_configuration(hash)\n end", "title": "" } ]
[ { "docid": "13aeea71d9ccb860b2960d4d58e5b3e5", "score": "0.78354424", "text": "def load_hash(hash)\n config = SlimLint::Configuration.new(hash)\n\n default_configuration.merge(config)\n end", "title": "" }, { "docid": "f063c4da2b6de9f23b5c5b90e89d54b6", "score": "0.780...
00e6af74b3a6348c2e2388fed089b47e
Removes a single callsite
[ { "docid": "e29ed5eb52fb865989641adea14cf410", "score": "0.7027017", "text": "def scrooge_unlink_callsite!( callsite_signature )\n ScroogeMutex.synchronize do\n @@scrooge_callsites.delete(callsite_signature)\n end\n end", "title": "" } ]
[ { "docid": "241183a8f041445126cd4d3931c7ccea", "score": "0.67372435", "text": "def remove_site\n frm.link(:text, \"Remove Site\").click\n RemoveSite.new(@browser)\n end", "title": "" }, { "docid": "fd1a41b8b872aa48b8b340d00ed06d92", "score": "0.64050126", "text": "def destroy_...
7894dac605df3abb625256385ac80e31
PUT /groups/1 PUT /groups/1.json
[ { "docid": "93ab4c7639d0a44788005f79739f649d", "score": "0.659675", "text": "def update\n @group = Group.find(params[:id])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n ...
[ { "docid": "f9c8de2078908a6ff810abe52a191928", "score": "0.7675293", "text": "def update\n logger.info \"Put parameters: #{params.to_json}\"\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n head :no_content\n else\n render json: @group.errors, st...
dae219d4605b81cd2bc52846e21dc9dd
given ('abcdefg','c.?e') returns ['ab','cde','fg'] so you can manipulate the head, match and tail seperately, and potentially rejoin
[ { "docid": "5091ce9d1612e841fcaa4c92dad9eea7", "score": "0.0", "text": "def split3(aPattern,aOccurence=0)\n\t\t\taString = self\n\t\t\tmatches = aString.scan_md(aPattern)\n\t\t\tmatch = matches[aOccurence]\n\t\t\tparts = (match ? [match.pre_match,match.to_s,match.post_match] : [aString,nil,''])\n\n\t\t\...
[ { "docid": "0e1ac96d69a01ffc6a00ee652f0bceae", "score": "0.5670081", "text": "def rec_split_combiner(names, match_chars)\n\n #if names is a string on the first pass make it an array\n names = [names] if names.is_a?(String)\n\n #zero case, return the recursive function\n if match_chars.empty?\n re...
1fa294786cb18ece13f610f5de3065f0
Confirms a loggedin person.
[ { "docid": "3672eef62432f1d4da2be1f2d133f363", "score": "0.64543766", "text": "def logged_in_person\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "e103e698117c91bfa91cfab0eabce8dd", "score": "0.6724704", "text": "def check_logged_in #:doc:\n # Does the @whoami variable get set to something sane?\n unless @whoami ||= whoami\n # Notify\n flash[:notice] = \"Please log in\"\n redirect_to new_participant_url\n end\n ...
1451196990f47534c599192e08c484c2
Provide a default URL as a default if there hasn't been a file uploaded:
[ { "docid": "93cd438548f3378cd4b1da13cb966da8", "score": "0.69242746", "text": "def default_url\n \"/images/fallback/\" + [model.class.to_s.underscore, version_name, \"blank.png\"].compact.join('_')\n end", "title": "" } ]
[ { "docid": "b60fd9da936d3a3a2ede5b89d2cb78a3", "score": "0.8194169", "text": "def default_url\n '/no_file'\n end", "title": "" }, { "docid": "7e0c7efbe20c579ceeafc492e36148cb", "score": "0.7490405", "text": "def default_url\n ''\n end", "title": "" }, { "docid": "...
af05fad756e25f67e7648a5ac0250f1f
Quick sort implementation written by Andrew Mayne Input: 35 8 11 1 68 0 3 Output: 8 0 1 3 11 35 68 1. Pick a pivot (I chose 0) 2. Reorder elements to the left & right partitions of pivot based on value 3. Recursively apply till size = 1 and the merge result
[ { "docid": "fb1171efc262d10542a39ef3830d2fcd", "score": "0.0", "text": "def read_line\n gets.strip.split(' ').map(&:to_i)\nend", "title": "" } ]
[ { "docid": "22a6936c5f7ff4e13a771a6cafaad085", "score": "0.78085107", "text": "def quick_sort(arr)\n \n if arr.length <= 1\n return arr\n end \n\n pivot = arr[0]\n left = []\n right = []\n\n #seperate into left and right \n arr[1..-1].each do |num|\n if num < pivot\n left.push(num)\n ...
ba524f330c5a7e2b4a6b3bb08b5eec5d
Move the players (and insults)
[ { "docid": "ba22e50ee9c338b6bfc48a185be45885", "score": "0.0", "text": "def move increment\n\t\tnew_text = Array.new\n\t\tif increment > 0\n\t\t\t@text_spacer += \" \" * increment\n\t\telse\n\t\t\t@text_spacer = @text_spacer[1..increment]\n\t\tend\n\t\t@text.split(\"\\n\").each do |line|\n if incre...
[ { "docid": "00460947610d9955eb3730bb5090e9a9", "score": "0.7527997", "text": "def second_players_move(current_player)\n player = second_player(current_player)\n player_move(player)\n end", "title": "" }, { "docid": "f2bc122c21b1b2e93b4043358003797b", "score": "0.7340428", "tex...
4b461ff972bcd4b06234abd01be135ba
MES Update the salt in the DB and return the salt. This effectively invalidates any existing password!
[ { "docid": "3845a52b2c7559794a92416f128b23b5", "score": "0.8269517", "text": "def update_salt\r\n write_attribute('salt', self.class.hashed(\"salt-#{Time.now}\"))\r\n return self.salt\r\n end", "title": "" } ]
[ { "docid": "311218011af457149921b1345f9663e6", "score": "0.80847156", "text": "def password_salt; salt; end", "title": "" }, { "docid": "50dd59da3c2cb00d2dec5adc2ef80f93", "score": "0.7817465", "text": "def password_salt\n self.legacy_password_salt || \"MakeThisBCryptASAP\"\n end...
3184fc0d10f213e9912b8a3ce3c51f65
sort_array_char_count sorts in descending order
[ { "docid": "3dd890d5f9777d7e4ba4d47edcdbd77d", "score": "0.0", "text": "def sort_array_desc(array)\n return array.sort{ |a, b| b <=> a }\nend", "title": "" } ]
[ { "docid": "935a8694f32411e5eb19b2c603fbb63f", "score": "0.86557376", "text": "def sort_array_char_count(a)\n a.sort_by {|b| b.length}\nend", "title": "" }, { "docid": "277256999b9180055136617dbbc6ff56", "score": "0.8646675", "text": "def sort_array_char_count(array)\n array.sort_b...
05f61072616f7e119ace03df19735577
migrate all packages under account, project
[ { "docid": "71a1a160fcfe42074592844b3eb5130e", "score": "0.0", "text": "def get_d1_ieids(account, project)\n ieids = Array.new\n\tact_prj = DataMapper.repository(:daitss1) { ACCOUNT_PROJECT.first(:ACCOUNT => account, :PROJECT => project) } \n\toids = DataMapper.repository(:daitss1).adapter.select(\"sel...
[ { "docid": "271d2cba68d112ab2f8ab2c9fdc3058f", "score": "0.6865633", "text": "def migrate\n status 'Migrating ...'\n\n project.migrate!(options[:environment])\n\n status 'Migrated'\n end", "title": "" }, { "docid": "05359e288d85952a7bcaec2958246de0", "score": "0.6724836...
8029c21a18bdfb55fd9f1e1271b0f6c1
End of Method (typeFindFreelancerSearchBox) Click on search icon
[ { "docid": "7b9ace6eae70276dde20818931238f5b", "score": "0.7107995", "text": "def clickOnSearchIconForFindFreelancer()\n @utills.click(SEARCH_ICON)\n return ProfileSearchPage.new(@driver)\n end", "title": "" } ]
[ { "docid": "2973d02d99bd72d65949540c3fca618a", "score": "0.74471295", "text": "def click_search_icon\n puts \"Step 5: Click on magnifying glass button\"\n homepage = HomePage.new\n homepage.get_search_icon.click\n puts \"Keyword searched successfully\"\n end", "title": "" }, { "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "573a7859e42be03f618538c4f28e19f6", "score": "0.0", "text": "def addmission_params\n params.require(:addmission).permit(:visit_id, :doctor_id, :patient_id, :addmission_date, :discharge_date)\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...
3a9bd462df219b7a71f3517a7c410752
AnnoJ request method, returns data formatted as per request parameters for particular view
[ { "docid": "795efcdbc9ad1091413d416c4cc7346f", "score": "0.0", "text": "def range(assembly, left, right, experiment_id, bases, pixels)\n zoom_factor = bases.to_i / pixels.to_i\n response = new_response\n exp = Experiment.find(experiment_id)\n reference = Reference.find(:first, :conditions =>...
[ { "docid": "53f4e916543287403fdf3c10d3e708e5", "score": "0.6173776", "text": "def show\n render json: @requestinfo\n end", "title": "" }, { "docid": "82558a5b9782070b3ebfd0fae98ebf19", "score": "0.6150369", "text": "def query ; @request.params ; end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a9e7fddced2b6e58b643f2c191faef32", "score": "0.0", "text": "def set_want\n @want = Want.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
924872f76e580c9cd9ed40ca1f94dfec
Post a comment on a posted item or on another comment.
[ { "docid": "d51f11f19a664bd33735b40355623f9f", "score": "0.5735305", "text": "def comment(id, text)\n require_login!\n fnid = get(ITEM_URL % id).match(/<input type=hidden name=\"fnid\" value=\"([^\"]+)\"/)[1]\n post(COMMENT_SUBMIT_URL, 'fnid' => fnid, 'text' => text)\n end", "title": "" ...
[ { "docid": "b9d59d99d3cd08252b77a91cf079f2b0", "score": "0.69585556", "text": "def comment_item(item, text)\n item.comment(self, text)\n Activity.log(self, \"comment_item\", item, item.owner)\n end", "title": "" }, { "docid": "8a67a8a342e18f905442de8a55832762", "score": "0.6...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "c185ed47a60d985c65611053ee48e075", "score": "0.0", "text": "def update!(**args)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
c3871d5222723b5d7f73ef24ab11e035
Add more helper methods to be used by all tests here...
[ { "docid": "2ca825d5715c14440993e1359aa7433e", "score": "0.0", "text": "def init_omniauth_data\n OmniAuth.config.test_mode = true\n OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({\n provider: 'facebook',\n uid: '123545',\n info: {email: \"test-from-facebook@test.com\...
[ { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.7019334", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.7019334", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", ...
b95ef4d81e2bdb89c3f759b53b5e1dc1
The web url where subscriptions to this list may be created, nil if this is not supported.
[ { "docid": "b669625d2cad326c285e83e05d07bdfe", "score": "0.78338474", "text": "def subscribe_url\n nil\n end", "title": "" } ]
[ { "docid": "83a71cfbfd9056e1d5cc9bb7a9337c4e", "score": "0.7060695", "text": "def unsubscribe_url\n nil\n end", "title": "" }, { "docid": "77ee05992c4d274db89e30f0cf6bfc5f", "score": "0.66843307", "text": "def web_url\n return @web_url\n end", "t...
28dad104d8cb6cc137354779e4c5cb59
same as tile.spiral_search, but search starting with center of each side first
[ { "docid": "00ece0c97288a910261d398badfde710", "score": "0.6970983", "text": "def spiral_search(tile, max=100, min=0, step=1)\n (min..max).step(step) { |rng|\n if rng != 0\n [[rng, 0], [0, rng], [-rng, 0], [0, -rng]].each { |dx, dy|\n n...
[ { "docid": "0f2e1d222f2b5678beae7d8a13ebeeb0", "score": "0.6347863", "text": "def solution \n row_search \n columns_search \n diagonal_search\n end", "title": "" }, { "docid": "1d0cd184c40602e83efd611c73f87b7c", "score": "0.62995154", "text": "def spiral_location(build...
5692d55e9a9d83fac59bd590de94252a
Has the no_master_association setting changed, often based on the dynamic model foreign key being blank
[ { "docid": "04f82f130a6ac47ef561f2e2d6caf386", "score": "0.82041836", "text": "def no_master_association_changed\n prev_no_master_association = !master_fk?\n prev_no_master_association != !!no_master_association\n end", "title": "" } ]
[ { "docid": "544848afe8b7922c984d29c01c198722", "score": "0.7614857", "text": "def no_master_association\n false\n end", "title": "" }, { "docid": "f897a9eb7f94ecee08f671604b44841e", "score": "0.7544755", "text": "def implementation_no_master_association\n defined?(foreig...
23eb506fd2bdb259779a22eff86922d8
The ID of the job.
[ { "docid": "cf52795db0dd4b2df3eaa63838d55425", "score": "0.86000615", "text": "def job_id\n @gapi.job_reference.job_id\n end", "title": "" } ]
[ { "docid": "3be5301131dd357959fbaf30e0f3b0c8", "score": "0.86664486", "text": "def job_id\n return @job_id\n end", "title": "" }, { "docid": "400b1fed869849d126d1e3d4fb115610", "score": "0.86437684", "text": "def id\n worker.job_id\n end", "t...
6c9c63a46765e7845c341348bb617a91
Generates and saves the Info.plist to the given path.
[ { "docid": "33fb4927eece3f0ddb2dc8d77025b936", "score": "0.58686733", "text": "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "title": "" } ]
[ { "docid": "5c53c001b801bcbec3c393aaf1533b1e", "score": "0.74864644", "text": "def write_info_plist_file\n File.open(info_plist_file, 'w') do |file|\n file.write info_plist\n end\n end", "title": "" }, { "docid": "49d52789b85d66277aea6f34145c0b2a", "score": "0.745862"...
86022591f089f1d3a038d806848264d6
Allows a user to create a workout and log it(Works!)
[ { "docid": "ba78dd1f8d6ae04e93993291d207d4ea", "score": "0.6241895", "text": "def addWorkout\n prompt = TTY::Prompt.new(active_color: :cyan)\n puts \"\"\n user_selection = prompt.select(\"Which part of the body do you want to focus on?\".red, %w(UpperBody LowerBody))\n puts \"\"\n userWor...
[ { "docid": "5b789aa9f5b1563226eaf928a05390a5", "score": "0.7814628", "text": "def create\n @workout_session = WorkoutSession.new workout_session_params\n @workout_session.user = current_user\n if @workout_session.save\n flash[:success] = \"Workout Session #{@workout_session.name} logged!\"...
70b67a0f5135573129b3feb1f8c1d2be
Created by Brent Rowland on 20080126. Copyright (c) 2008 Eidetic Software. All rights reserved. Eidetic RML Test Helpers
[ { "docid": "de0a4113e9c10e45ac0bcd2a9ab32ea8", "score": "0.0", "text": "def assert_array_in_delta(expected_floats, actual_floats, delta)\n expected_floats.each_with_index { |e, i| assert_in_delta(e, actual_floats[i], delta) }\nend", "title": "" } ]
[ { "docid": "36d6426b60095cdd1428a9f39841eb63", "score": "0.65045774", "text": "def expected; end", "title": "" }, { "docid": "812c8859aa03378bb6c5a8b7cb328a89", "score": "0.6376869", "text": "def test_003_xe_fl\n multitest_003('xe_fl', 1)\n end", "title": "" }, { "doc...
d55ae22e991cad32b7e342478ac78d2d
array1 Any array. array2 Any array. Examples concat([1,2], [3,4]) => [1,2,3,4] Returns the concatinated array.
[ { "docid": "3c00d764730fac3e9738ce08801bc1ed", "score": "0.8341056", "text": "def concat(array1, array2)\n return array1 + array2\nend", "title": "" } ]
[ { "docid": "d9be016cbefd81ca2a61bb15c1447fd2", "score": "0.8869342", "text": "def array_concat(array_1, array_2)\n\n\tarray_1.concat(array_2)\nend", "title": "" }, { "docid": "e649a808374ea04f8a5bf12e846fa0ff", "score": "0.88189626", "text": "def array_concat(array_1, array_2)\n\tret...
0f5608bc611572ee3fdbf96bb1b1f575
Returns all open files in a hash indexed by pid, where the related file names are sorted lexicographically (since all filenames with the same pid have the same length, this is the same as numeric sorting)
[ { "docid": "465c72d80397bfa9593f5d11cd2039f8", "score": "0.6711178", "text": "def get_pid_to_sorted_file_names(event_logs_path)\n result = {}\n opened_event_log_files(event_logs_path).each do |log_file_name|\n pid, timestamp = extract_pid_and_timestamp_from_path(log_file_name)\n (result[pid] ||=...
[ { "docid": "1b91e266d5497f713b0bb3365ed86bef", "score": "0.6184988", "text": "def master_files_pids\n self.master_files.sort_by {|mf| mf.filename}.map(&:pid)\n end", "title": "" }, { "docid": "83f19784a8306e2b41dbc61d6db1521c", "score": "0.6069618", "text": "def filelist\n ...
4b3891edf3f1ff57afd394e060ff258c
Determines whether to continue generating test cases
[ { "docid": "b6d0547a5d807f356b412c6875b320fc", "score": "0.0", "text": "def needs_work?(stats)\n stats.invalid < self.max_invalid && stats.pass < self.max_pass\n end", "title": "" } ]
[ { "docid": "1a13c0cfff4c33c360efcb80fd35fa1b", "score": "0.7066695", "text": "def test_continue_truthy\n turns_remaining_miner = Prospector.new(0, @dummy_location, num_turns = 1)\n assert turns_remaining_miner.continue?\n end", "title": "" }, { "docid": "7209024735b0737d29ac9cb762c556...
36cad799250c49af61dd0328e5ad9d6c
GET /meals/1 GET /meals/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "6e91fd3f22d8fd2cc36c586968f9f3ec", "score": "0.795184", "text": "def index\n @meals = Meal.all\n render json: @meals, status: 200\n end", "title": "" }, { "docid": "6cc2be40675fd581b6ad4c0e51e16008", "score": "0.7933411", "text": "def index\n @meals = Meal.all\n...
24b7bd3cef8aa505a6c9332fb31e87ef
DELETE /couleurs/1 DELETE /couleurs/1.json
[ { "docid": "28ae5e67413e3bc5cbece3c13cfdf7d6", "score": "0.72834045", "text": "def destroy\n @couleur.destroy\n respond_to do |format|\n format.html { redirect_to couleurs_url, notice: 'Couleur was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "9267213148298847f1c575e8e4b958b9", "score": "0.7006182", "text": "def destroy\n @colore.destroy\n respond_to do |format|\n format.html { redirect_to colores_url, notice: 'Colore was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
e2dc165efb5ecc2e9f4ab56b4c2c107c
ansible provisioner from configuration
[ { "docid": "168cf239a62078ab8b5cf0581fc806f3", "score": "0.7097985", "text": "def provision_ansible(box, key, ansible_config, vm_config)\n box.vm.provision :ansible_local do |ansible|\n properties = [\n 'ask_become_pass',\n 'ask_sudo_pass',\n 'ask_vault_pass',\n 'force_remote_use...
[ { "docid": "f85241c5e97a7a7f2ba11ab0a324f698", "score": "0.7390251", "text": "def ansible_provision c\n c.vm.provision \"ansible\" do |ansible|\n ansible.verbose = \"v\"\n ansible.playbook = \"playbook.yml\"\n end\n end", "title": "" }, { "docid": "2edfd475ac66e4f0fd405cf2e2...
5084ecba7ae3b8b49459dd262205d02c
POST /member_categories POST /member_categories.json
[ { "docid": "480b11d94108ab14e426395ed6020e7b", "score": "0.71360993", "text": "def create\n @member_category = MemberCategory.new(params[:member_category])\n if @member_category.save\n #@member_categories = MemberCategory.all\n respond_with({:status => \"success\"}, :location => \"nil\")...
[ { "docid": "aab7166f4548c63b1c7732e4070da477", "score": "0.654758", "text": "def create\n @category = Category.new(category_params)\n if @category.save\n @category.sub_categories.build\n else\n render json: @category.errors\n end\n end", "title": "" }, { "docid": "efcb...
f075a3d01008a742aa6c0f24c37f436e
Delegates missing methods to to_a
[ { "docid": "e49b4426afaf36ac50d849f965cb77e8", "score": "0.6247855", "text": "def method_missing(m, *args, &block)\n to_a.__send__(m, *args, &block)\n end", "title": "" } ]
[ { "docid": "9dadffa4b07200aba29da4b43dc51d2e", "score": "0.72832", "text": "def to_a(*) end", "title": "" }, { "docid": "876b963c40598a360335b36629211cd7", "score": "0.7014666", "text": "def to_a() end", "title": "" }, { "docid": "876b963c40598a360335b36629211cd7", "s...
cbe63536b1cc83fe5943b4edc6f0565d
GET /calificaciones/1 GET /calificaciones/1.xml
[ { "docid": "751881ab7dc56a26b736c949f8b743c7", "score": "0.7134622", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calificacion }\n end\n end", "title": "" } ]
[ { "docid": "6017273ee6acec3bf973990de8428de9", "score": "0.6964188", "text": "def index\n @feria2010calificaciones = Feria2010calificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010calificaciones }\n end\n end", "title"...
913bb522aeeed06e71ebaa822a7ad669
Instance methods for blacklight_config, so get a deep copy of the classlevel config.
[ { "docid": "a8fa2fc813be52a8f5841103281f0100", "score": "0.63542426", "text": "def blacklight_config(name = nil)\n if name\n blacklight_config_for(name)\n elsif @blacklight_config\n @blacklight_config\n else\n Log.warn(__method__, '@blacklight_config unset')\n @blacklight_co...
[ { "docid": "fe33427ae9fc067cf386381221eccb65", "score": "0.73695636", "text": "def grifter_configuration\n @config.clone\n end", "title": "" }, { "docid": "f98c72ac9784f13f30e96a8c726d5124", "score": "0.67969716", "text": "def initialize_copy(orig)\n super\n @config = Confi...
54bc08cfd7bd3101e8cdba3922620b55
Record a lint for reporting back to the user.
[ { "docid": "85b08c5aba85b782883176cea79b8181", "score": "0.7301448", "text": "def record_lint(line, message, severity, corrected:)\n # TODO: actual handling for RuboCop's new :info severity\n return if severity == :info\n\n @lints << HamlLint::Lint.new(self, @document.file, line, message,...
[ { "docid": "0990ce2990a2f4bcd5b0f4639ca02a55", "score": "0.6969431", "text": "def add_lint(lint)\n lints << lint\n @reporter.added_lint(lint, self)\n end", "title": "" }, { "docid": "e5db1e72958c792c7ba8e7ef338470a7", "score": "0.6488688", "text": "def record_lint(node, ...
a2cc907318c137dc8e7489c85fc20d29
Ideally, this class should implement "fake methods" consistently, including :methods, :public_methods, etc.
[ { "docid": "05972df6b992d27ac02edd49d403f2a2", "score": "0.0", "text": "def method_missing(method_name, *args, &block)\n if delegates?(method_name)\n @delegate.send method_name, *args, &block\n else\n super\n end\n end", "title": "" } ]
[ { "docid": "8066424707eba14e3646012b49ce55b8", "score": "0.74393237", "text": "def mimic_methods\n Array.new.public_methods(false).each do |method|\n # Don't mimic methods we specifically declare or methods that don't make sense for the class\n if !self.respond_to?(method)\n self.cla...
71bf10800e4c688aec0f839ac481d8e2
return the opaque ref of the task that was run by a task record if it succeded. else it returns nil
[ { "docid": "88a484ec49f14ca29454736fbc08a7be", "score": "0.765641", "text": "def get_task_ref(task)\n wait_on_task(task)\n case xapi.task.get_status(task) \n when \"success\"\n # xapi task record returns result as <value>OpaqueRef:....</value> \n # we want the ref. this wa...
[ { "docid": "fe6e6a20f657d53443346e4f2dc53994", "score": "0.73109525", "text": "def get_task_ref(task)\n Chef::Log.debug \"Waiting on task #{task}\"\n wait_on_task(task)\n status_ = xapi.task.get_status(task)\n\n case status_\n when 'success'\n puts \"#{h.color \"#{status_...
4fe6b814b61cb64d22286ada59614335
Returns data ready for injesting into Highcharts
[ { "docid": "706ca61318f0ca61afb1996a5a499d91", "score": "0.68627536", "text": "def all_data\n self.series_names.map do |this_name|\n [self[this_name].display_name, self[this_name].data_series]\n end\n end", "title": "" } ]
[ { "docid": "a747c8a12c51451afde861be37393d3c", "score": "0.7221024", "text": "def json_data_for_highcharts\n self.to_json.html_safe\n end", "title": "" }, { "docid": "7d75778910741aeefbc736514d01bd6f", "score": "0.6931028", "text": "def chart_data\n unless @data\n ...
4c50de96f112dddac2f415c419fa0a84
an empty array accessible to all methods
[ { "docid": "7ab2d526df5a15aa8997d936942dc711", "score": "0.0", "text": "def interactive_menu\n loop do\n print_menu\n process(STDIN.gets.chomp)\n end\nend", "title": "" } ]
[ { "docid": "5ce8381bb8c21395e1a80fdba9a3cedf", "score": "0.7548412", "text": "def create_an_empty_array\n []\nend", "title": "" }, { "docid": "5ce8381bb8c21395e1a80fdba9a3cedf", "score": "0.7548412", "text": "def create_an_empty_array\n []\nend", "title": "" }, { "docid...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ad55c4b4b17e92085f5ded6c05f07f23", "score": "0.0", "text": "def set_cake_category\n @cake_categories = CakeCategory.all\n @cake_category = CakeCategory.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...
04d8b16cffdf822be68c6b9b10d8a711
GET /skill_profiles/new GET /skill_profiles/new.xml
[ { "docid": "56aec5fc0dea96930830467e9189e207", "score": "0.76342547", "text": "def new\n @skill_profile = SkillProfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @skill_profile }\n end\n end", "title": "" } ]
[ { "docid": "756cac593929e45b654e1337a051be7f", "score": "0.7463252", "text": "def create\n @skill_profile = SkillProfile.new(params[:skill_profile])\n\n respond_to do |format|\n if @skill_profile.save\n format.html { redirect_to(@skill_profile, :notice => 'Skill profile was successfull...
069ca7201c2b98a47299392a0a7de606
Generates an URI for a given process and its contents. +process+:: process instance +kind+:: kind of the URI that should be generated, for example, whether the URI should represent the name, date, etc.
[ { "docid": "414c44831eb1f016aab452050325f12e", "score": "0.79037064", "text": "def process_uri(process, kind)\n base_uri = 'biointerchange://textmining/process'\n case kind\n when :process\n RDF::URI.new(\"#{base_uri}/self/#{process.uri.sub(/^.*?:\\/\\//, '')}\")\n when :name\n RDF...
[ { "docid": "2f102c8b6f5a108dfb96578f205c3e2f", "score": "0.5872324", "text": "def serialize_process(graph, document_uri, content_uri, process)\n process_uri = process_uri(process, :process)\n create_triple(content_uri, BioInterchange::SIO.is_direct_part_of, process_uri)\n # If this is an email ...
0147cdf0185ff45d184427b3d77589fa
This might want to be included in a Color subclass instead of being a normal method
[ { "docid": "625b193d08ac1c87ab8fd04489533254", "score": "0.0", "text": "def color_name_to_rgb(name)\n return $gimp_iface.ggimp_rgb_parse(name)[0]\nend", "title": "" } ]
[ { "docid": "05897485e5c451786eb318c28eea977f", "score": "0.75766903", "text": "def color(color); end", "title": "" }, { "docid": "262346afe58e0a7aaee42eaec14e8634", "score": "0.7499583", "text": "def color_methods; end", "title": "" }, { "docid": "1e1c1538dcf5d0dc00d6e944...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "d1ec1c21e19cef46335e7cbd0f218f7c", "score": "0.0", "text": "def update!(**args)\n @incoming_any_circle_count = args[:incoming_any_circle_count] if args.key?(:incoming_any_circle_count)\n @view_count = args[:view_count] if args.key?(:view_count)\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1b6064695eb4cc7e939a6a7874da676b", "score": "0.0", "text": "def set_university\n @university = University.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165094", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60450804", "text": "def action_hook...
f0a56f220e0e8180359dd6a3ed24ef6c
POST /form_field_values POST /form_field_values.json
[ { "docid": "f5d7906437cd5578d3dfd7cc758a7c17", "score": "0.68536514", "text": "def create\n @form_field_value = FormFieldValue.new(form_field_value_params)\n\n respond_to do |format|\n if @form_field_value.save\n format.html { redirect_to @form_field_value, notice: 'Form field value wa...
[ { "docid": "af0d72f550d3c070cd2905e4956c46ce", "score": "0.67624766", "text": "def create\n @field_value = FieldValue.new(params[:field_value])\n\n respond_to do |format|\n if @field_value.save\n format.html { redirect_to @field_value, notice: 'Field value was successfully created.' }\...
ce468e15860cfa6e5eb9ef2bc11f6d57
GET /moto3s/1 GET /moto3s/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0f06dafe632c942dddf4c35587dfa8c4", "score": "0.6960505", "text": "def index\n @moto3s = Moto3.order('match_starts_at DESC').page(params[:page]).per(10)\n end", "title": "" }, { "docid": "f538c803becf092083606bc1db55e142", "score": "0.69425756", "text": "def get_files_...
0a6fd146f940b8a6e84603805699a14f
these really belong in Seeds::Intake but we put them here for now because they rely on Seeds::Facols
[ { "docid": "03e18f1285b60c74639edee376127c0e", "score": "0.0", "text": "def create_legacy_issues_eligible_for_opt_in\n # this vet number exists in local/vacols VBMS and BGS setup csv files.\n veteran_file_number_legacy_opt_in = \"872958715S\"\n legacy_vacols_id = \"LEGACYID\"\n\n ret...
[ { "docid": "431ee2917e51c26acadc1af09af87bf8", "score": "0.5924681", "text": "def requested_cols\n end", "title": "" }, { "docid": "f1ee3425256c689e2b4d4e79355d6566", "score": "0.59038883", "text": "def columns; end", "title": "" }, { "docid": "f1ee3425256c689e2b4d4e...
8f56f7d67b2191073b4dbb084aa5b830
Turns an xfdl file into an xml file Example >> XFDL.deconstruct_and_write_xml "myform.xfdl", "myform.xml" Arguments old_filename: (String) The xfdl file you want to convert new_filename: (String) The name of the xml file
[ { "docid": "17bd233700d044203b339f1ad8a15004", "score": "0.74506533", "text": "def deconstruct_and_write_xml(old_filename, new_filename)\r\n\r\n\t\t\tif File.exists?(old_filename)\r\n\t\t\t\tenc_file = ''\r\n\t\t\t\tenc_file = IO.read(old_filename).to_s\r\n\t\t\t\tcontent = get_xml enc_file\r\n\t\t\t\tF...
[ { "docid": "6529c721974e2199a9f8c36c66975f2a", "score": "0.6431006", "text": "def build_and_write_xfdl_from_xml(xmlfile, xfdlfile)\r\n\t\t\t# 1. Gzip\r\n\t\t\t# 2. Base64\r\n\t\t\t# 3. Write string with mime stuff on the fist line\r\n\t\t\t# 4. Save as XFDL\r\n\t\r\n\t\t\txml_file = ''\r\n\t\t\tb64_stri...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8a12ff5ee23217b285bfcd23d0be6d7b", "score": "0.0", "text": "def set_spares_category\n @spares_category = SparesCategory.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...
471eba0414d377aa7690e67bfc9d9ae8
PUT /appforms/1 PUT /appforms/1.json
[ { "docid": "a4243065383938031fa31b38af06e995", "score": "0.72454876", "text": "def update\n @appform = Appform.find(params[:id])\n\n respond_to do |format|\n if @appform.update_attributes(params[:appform])\n format.html { redirect_to root_url, notice: 'Your application was successfully...
[ { "docid": "7d1ede0705e6b6a2b0f61079ed26dd03", "score": "0.7059881", "text": "def update_form(form_id, request)\n start.uri('/api/form')\n .url_segment(form_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" ...
9055d004c4b51834c8add21b43ddc921
Set Item item : Skills and items etc.
[ { "docid": "6207714dfce9c317e0912c226244b9a3", "score": "0.72929716", "text": "def set_item(item)\r\n set_text(item ? item.description : \"\")\r\n end", "title": "" } ]
[ { "docid": "eb251ac8634980e3b441238f0ae02f2c", "score": "0.77802134", "text": "def set_item\n @item\n end", "title": "" }, { "docid": "c1a7dc4ff5dd19f79c6eb9ed3a857f09", "score": "0.77529716", "text": "def set_item(item)\n set_skill_type(item ? item.stype_id : 0)\n set_...
a16f0284131416a1b08429f0c7199029
Clicks the button to view all custom cohorts
[ { "docid": "d81bc0f5e77b1a3b0a9fe20707d923ca", "score": "0.79200435", "text": "def click_view_everyone_cohorts\n sleep 2\n wait_for_load_and_click view_everyone_cohorts_link_element\n wait_for_title 'All Cohorts'\n end", "title": "" } ]
[ { "docid": "92e4711275282b4778bcc5e68cd3bb8a", "score": "0.6615827", "text": "def index\n @cohorts = Cohort.all\n end", "title": "" }, { "docid": "1158458ba6ff6a5218535ff56da38786", "score": "0.6512294", "text": "def index \n @cohorts = Cohort.all\n \n end", ...
a1f8d4d3f83583fe60bba865ce5cfd06
Tests that nonnegative int value for num_prospector returns a 1. Then continues normal behavior and runs the simulation as expected.
[ { "docid": "25396fee63d55c71b06d0f7f383b72cd", "score": "0.51992947", "text": "def test_run_simulation_passes\n sim = Simulator.new(1, 2, 3)\n sim.set_map\n mock_prospector = Minitest::Mock.new('Mock Prospector')\n def mock_prospector.mine(_param, _param2, _param3)\n 1\n end\n\n d...
[ { "docid": "1a23672677f850d70e56d5ad64a6ab23", "score": "0.6818227", "text": "def see_results(prospector)\n prospector = prospector.to_i\n return nil if prospector <= 0\n\n puts \"After #{@days_mined} days, Rubyist #{prospector} found:\"\n if @ruby_total == 1\n puts \" #{@ruby_tota...
a3273eb52b63d31ff66538da0ae466b6
Delete PolicyUrlCategorizationConfig Delete PolicyUrlCategorizationConfig. If deleted, the URL categorization will be disabled for that edge cluster.
[ { "docid": "433b7d8d689326760426653ee5446d50", "score": "0.6259205", "text": "def delete_policy_url_categorization_config_0_with_http_info(site_id, enforcement_point_id, edge_cluster_id, url_categorization_config_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.de...
[ { "docid": "0bfd106f331b239ec064bccf4440faa4", "score": "0.7743182", "text": "def delete_policy_url_categorization_config(site_id, enforcement_point_id, edge_cluster_id, url_categorization_config_id, opts = {})\n delete_policy_url_categorization_config_with_http_info(site_id, enforcement_point_id, ...
b83c3b06eb4de88941ee3539800b2a44
methods Tell if the page is either the index page.
[ { "docid": "be04908771d24863f4fa5b44fd6e35bf", "score": "0.73024607", "text": "def index?\n self.depth == 0 && 'index' == self.slug\n end", "title": "" } ]
[ { "docid": "98d13b086acf87fe0dd4f1a7034e86ad", "score": "0.7563605", "text": "def index?\n\ttrue\n \n end", "title": "" }, { "docid": "24a3db1fd00da89194f097c1378eef04", "score": "0.74618995", "text": "def a_index?\n action_name == 'index'\n end", "title": "" }, { "...
5a1c89fa85908d7ccbe3c03f5c584e2f
Return the average value for the specified region
[ { "docid": "0235f20ba64abece4f517c3cc3cbfde3", "score": "0.5514935", "text": "def query_average(chr, start, stop)\n # Don't query off the ends of chromosomes\n raise WigError, \"BigWig does not contain data for the interval #{chr}:#{start}-#{stop}\" if not include?(chr, start, stop)\n UCS...
[ { "docid": "de7013387c64993d77f96fac57d51c3a", "score": "0.6604194", "text": "def avg(field)\n aggregates(field)[\"avg\"]\n end", "title": "" }, { "docid": "4879e3c86fec82cabdf35751e0312379", "score": "0.6461565", "text": "def average_population\n\n sum = 0\n co...
06ee42acf16206131eed15b3a23f5936
if the Claim has a resource that is inside of the queried resource (with the same verb), then this returns the next level of the resource e.g. claim "read:some.stuff.nested" `claim.query? read: 'some.stuff' => 'nested'` `claim.query? read: 'some' => 'stuff'` `claim.query? read: 'what' => nil` `claim.query? admin: 'some...
[ { "docid": "5156141910089e4cec5b659cad144543", "score": "0.0", "text": "def direct_descendant(query_hash)\n lookup_direct_descendant Claim.parse_query_hash(query_hash)\n end", "title": "" } ]
[ { "docid": "fc5a0e90052f5c441cb88eb9b9866edc", "score": "0.5371717", "text": "def query_chain(resource, query)\n top_remote_parent = query.parents.find { |p| p.resource.remote? }\n [].tap do |chain|\n query.parents.select { |p| p.resource.remote? }.each do |p|\n chain <...
354cc490329e6ef53acf64ae7c131ea0
Retrieve a MultiDocument transaction Get the current MultiDocument transaction identified by this URL. If this transaction was adjusted, the return value of this API will be the current transaction with this code. You may specify one or more of the following values in the `$include` parameter to fetch additional nested...
[ { "docid": "0b83a05f067c942e7ea4abe08923919a", "score": "0.7297111", "text": "def get_multi_document_transaction_by_code_and_type(code, type, options={}) path = \"/api/v2/transactions/multidocument/#{code}/type/#{type}\"\n get(path, options, AvaTax::VERSION) end", "title": "" } ...
[ { "docid": "260bd257307cc2699df3ea964713c415", "score": "0.74057865", "text": "def list_multi_document_transactions(options={}) path = \"/api/v2/transactions/multidocument\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "11c3e579e34e3303b7bc3ba81e15...
4d42119e8559cf5882b933a250264f30
GET /subletters GET /subletters.json
[ { "docid": "7df36952574feb7dfdf9f092f2d0c7e5", "score": "0.73181784", "text": "def index\n @subletters = Subletter.all\n end", "title": "" } ]
[ { "docid": "c0e5be70fe430638d414c4796b7812d6", "score": "0.6551761", "text": "def get_letters\n with_monitoring do\n raw_response = perform(:get, '')\n EVSS::Letters::LettersResponse.new(raw_response.status, raw_response)\n end\n rescue => e\n handle_error(e)\...
19c5fa8a9d2ab88d3543c4c4afe36a2e
Currently using the Resque's underlying Redis instance, but we likely would want something more durable like RabbitMQ for production.
[ { "docid": "0b897b044239f58bdf865b97fa5b20d2", "score": "0.0", "text": "def publish_result(message)\n # Example: RabbitMQ using `connection` from the gem \"Bunny\":\n # connection.create_channel.fanout('replication.results').publish(message)\n Resque.redis.redis.lpush('replication.results', mes...
[ { "docid": "720a4226c265e562630f13d97a8a58e3", "score": "0.76803195", "text": "def prepare_resque\n Resque.redis = redis\n end", "title": "" }, { "docid": "353a24c9a9600087f3fca51855cac948", "score": "0.7648326", "text": "def redis\n Resque.backend.store\n end", "...
c90f4d0d243c8680a3c63b6ed20a5dc9
Returns true if the moment begins after the other one ends. If given a numeric value it will be treated like instantaneous moment in time. other object that implements end, or a numeric value.
[ { "docid": "d1340f4101573a8c6aacf373599571b0", "score": "0.77604973", "text": "def after?(other)\n time = other.is_a?(Numeric) ? other : other.end\n self.begin >= time\n end", "title": "" } ]
[ { "docid": "f7b371db57cb30a427bda4c6f5604394", "score": "0.69329554", "text": "def before?(other)\n time = other.is_a?(Numeric) ? other : other.begin\n self.end <= time\n end", "title": "" }, { "docid": "62196831dd20698dab24c13dd01b4dcc", "score": "0.6912016", "text": "d...
784218fe9e6ce2df29004ff46af7285d
GET /estabelecimentos/1 GET /estabelecimentos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3a98fdb2e5775b24abd9b76b8f1e6eef", "score": "0.714443", "text": "def show\n @estudiante = Estudiante.find(params[:id])\n\n render json: @estudiante\n end", "title": "" }, { "docid": "0a1cba2ae963f1eb86fe11cc9cf44408", "score": "0.7085624", "text": "def get_enterpri...
631dd3a8a58da655dc482813e556a35b
POST /goals POST /goals.json
[ { "docid": "5c41ea0752702b0bbe1465226e925593", "score": "0.6545517", "text": "def create\n @goal = Goal.new(params[:goal])\n @user = User.find(session[:uid])\n @goal.user = @user #This associates the current user with their new goal. \n #After the goal is saved, the User I...
[ { "docid": "509107298fad661a8b3789eeec343f58", "score": "0.76725", "text": "def create\n @goal = Goal.new(goal_params)\n current_user.goals << @goal\n\n if @goal.save\n render json: @goal, status: :created\n else\n render json: @goal.errors, status: :unprocessable_entity\n end\n...
b19f33b00d38d3567ecfa77cffcfd659
Typecast the value to a Float
[ { "docid": "0b2f7f2a8b2d1e75daa85bf94908ebcb", "score": "0.89281", "text": "def typecast_value_float(value)\n Float(value)\n end", "title": "" } ]
[ { "docid": "1069d090c13686061dd5d5d72bb16d19", "score": "0.8558869", "text": "def typecast_to_float(value)\n typecast_to_numeric(value, :to_f)\n end", "title": "" }, { "docid": "6c7cd080bfac621ff188119d6af8c5b3", "score": "0.848174", "text": "def to_f\n Float(value)\n ...
5dfb72025a38c425617427c4ff0b3ca7
Add or update a time track of a user given the page and the time spent.
[ { "docid": "9888938b1c09224f3afd97ba511b4e7c", "score": "0.78274804", "text": "def add_track(page, time)\n track = self.time_track.find_by(page: page)\n if track.nil?\n track = TimeTrack.new\n track.time = time\n track.user = self\n track.page = page\n else\n track.time...
[ { "docid": "04b8d55eef66222cfbadd69d9fa4807a", "score": "0.5762882", "text": "def add_tracked_user(user_id, track_type)\n tracker.add([user_id, TrackTypes::USER, track_type])\n end", "title": "" }, { "docid": "f5a411b719c6bb4b5fc7823320cf21cc", "score": "0.5762312", "text...
2c5d7d1de5fe86543f64d67753d5a2d6
Get firstname of authoring user
[ { "docid": "4dec797fd2f00a13b3c473d383452ea9", "score": "0.7980883", "text": "def user_firstname\n return @message[:user][:name].split(' ').first\n end", "title": "" } ]
[ { "docid": "da50b0fff46d10d2a4bb8615b3840f00", "score": "0.8085957", "text": "def first_name # same as field name ;\n User.where(id: object.user_id)[0].first_name\n end", "title": "" }, { "docid": "433b8ee6288798cb29a9bc60068372bc", "score": "0.80534977", "text": "def getAuth...
06c052bd1d0afee8892b8c983d4a6fd3
def stereo_type self.delegate.stereo_type end
[ { "docid": "6b86aeb3a4985b95ab1208eb4007eec9", "score": "0.0", "text": "def master_if\n self.delegate.master_if\n end", "title": "" } ]
[ { "docid": "c5bdc247fc71d843a00167893ad349e3", "score": "0.70442", "text": "def stereo?\n @channels == 2\n end", "title": "" }, { "docid": "c5bdc247fc71d843a00167893ad349e3", "score": "0.70442", "text": "def stereo?\n @channels == 2\n end", "title": "" }, { ...
14975503f48c8842366875300c2379b5
All values get tested as strings
[ { "docid": "29c9836cebab7f4c24f098aaab220279", "score": "0.0", "text": "def values\n @fields.map { |field_name, field| field.values.map(&:to_s) }.transpose\n end", "title": "" } ]
[ { "docid": "264672dda73db2839a106e482d535752", "score": "0.68338746", "text": "def value?(value) value.is_a?(String) end", "title": "" }, { "docid": "eba19f97ca47ad35dc20b57a1f6ed460", "score": "0.6766721", "text": "def get_string_value\n\t\tend", "title": "" }, { "docid"...
ccb1ee4f1651ec5eb0b1f2d7a8c6c57e
GET /leads_as/1 GET /leads_as/1.json
[ { "docid": "c4b79bd7c6ee3660fbf9d07b09f4e8c6", "score": "0.7230466", "text": "def show\n @leads_a = LeadsA.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leads_a }\n end\n end", "title": "" } ]
[ { "docid": "99aeeb1120cd5e8013833f1527fbcd01", "score": "0.7184368", "text": "def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end", "title": "" }, { "docid": "99aeeb1120cd5e8013833f1527f...
4bdab9521981c648a6ab3fbbb5622e40
PUT /skus/1 PUT /skus/1.json
[ { "docid": "d61674a4b86f27d53440c809b074f44f", "score": "0.68868643", "text": "def update\n @sku = Sku.find(params[:id])\n \n respond_to do |format|\n if @sku.update_attributes(params[:sku])\n format.html { redirect_to @sku, notice: 'Sku was successfully updated.' }\n format....
[ { "docid": "5f59bc5ea3ae947cea66067ac1e8368d", "score": "0.6747246", "text": "def update\n respond_to do |format|\n if @sku.update(sku_params)\n format.html { redirect_to @sku, notice: 'Sku was successfully updated.' }\n format.json { render :show, status: :ok, location: @sku }\n ...