query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
5bbe5865b584c80ba909f7a0ddd6372a | GET /logincms/1 GET /logincms/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "849dd6c7f172e33c9f80e583ed72d3cc",
"score": "0.69324327",
"text": "def index\n @logincms = Logincm.all\n end",
"title": ""
},
{
"docid": "a3bf61d077b45cbf40784f8174f820c0",
"score": "0.64393204",
"text": "def show\n @login = Login.find(params[:id])\n\n respond_t... |
921775082c4fdfa066e6911080b9aa38 | create Create a new team from the fields passed in from the new form. | [
{
"docid": "d2e7a9fe812e8a424a23d91a19b56bb3",
"score": "0.72400653",
"text": "def create\n @team = Team.new(params[:team])\n if @team.save\n # the current user should join the team\n current_user.join!(@team)\n flash[:success] = \"New team created\"\n redirect_to @team\n el... | [
{
"docid": "5a4feda5e7f972b737dc2af475ba799f",
"score": "0.7622701",
"text": "def create(_team)\n # stub\n end",
"title": ""
},
{
"docid": "27aefb664c71978908e295b2d432968b",
"score": "0.7565443",
"text": "def create\n\t\tTeam.create(params[:team])\n\n\t\tredirect_to ... |
e0f194eff55297cbd406581fb95a4596 | Perform reverse dns lookup for an IP. Return the found 'hostname' if found, or the original IP if not | [
{
"docid": "6835c37c10544cb915971c65bc3b7387",
"score": "0.85536003",
"text": "def reverse_dns_lookup (ip)\n\t\tputs \"Retrieve the hostname by the reverse DNS lookup on IP: #{ip}\"\n\t\thostname = ip\n\t\tbegin\n\t\t\thostname = Socket.gethostbyaddr(ip.split('.').collect{ |x| x.to_i}.pack(\"CCCC\"))[0]... | [
{
"docid": "0ed13329661d3de74b881786f3a27c4f",
"score": "0.7332566",
"text": "def local_ip_2_host (ip)\n\t\tputs \"Reverse DNS lookup from the local host repository\" if @verbose\n\t\tip=ip.strip unless ip.nil?\n\t\tif @known_hosts.key?(ip)\n\t\t\treturn @known_hosts[ip]\n\t\telse\n\t\t\treturn nil\n\t\... |
1d8fd8b5bb39c74c784c4528f67a861a | GET /climb_leader_profiles GET /climb_leader_profiles.json | [
{
"docid": "f805467413a959fae05ae8390119a207",
"score": "0.6539772",
"text": "def index\n @climb_leader_profiles = ClimbLeaderProfile.joins(:user).order('users.first_name')\n\n end",
"title": ""
}
] | [
{
"docid": "93edd2ba7f3c41892d9400fad4224664",
"score": "0.7465612",
"text": "def list_profiles\n # /profiles returns a list of profiles.\n end",
"title": ""
},
{
"docid": "41e6a898e45587ccbde8141fc8f0021b",
"score": "0.6909257",
"text": "def set_climb_leader_profile\n @clim... |
e373b8fa26df59fd2f8b310999001517 | parameter getters and setters datastore params | [
{
"docid": "7656fc129b5793f54cf834f000630bfb",
"score": "0.0",
"text": "def datastore\n result = splunk_exec(\"show\",[\"datastore-dir\"])\n result = result.to_s.split(':')[1].strip\n return result\n end",
"title": ""
}
] | [
{
"docid": "f06a2cea3bf6ec53ec0eeb0a93375ace",
"score": "0.7297845",
"text": "def param(* args)\n if args.length == 2\n key, value = args\n new_params = get_params # get_params needs to return a dup and re-set it so DM knows it's dirty\n new_params[key.to_s] = value\n attribute_se... |
b6bda5892bd9baf5f42b2b99fc90ed2d | count occurrence of each word in string input is a string(phrase) print list of words with occurence of each word(case insensitive) | [
{
"docid": "c5bf0855bdcac5388f691892e83b1eaf",
"score": "0.74738884",
"text": "def count_words(phrase)\r\n words_hash = Hash.new(0)\r\n phrase.split(\" \").each do |word|\r\n words_hash[word.downcase]+=1\r\n end\r\n print_word_count(words_hash)\r\n return words_hash\r\nend",
"t... | [
{
"docid": "bfe7e140a71546d8bf368680813a8cdc",
"score": "0.7988236",
"text": "def count_words(string)\r\n string.scan(/\\w+/).each_with_object(Hash.new(0)){|w,h| h[w.downcase]+=1}\r\n end",
"title": ""
},
{
"docid": "3ff70be3a3b52363618884c61a7d8723",
"score": "0.78886807",
"text... |
2c24f24f5dbec90f78f118022386acd9 | Override with your own usage banner. | [
{
"docid": "05d5bfea9fc1d7b0a35c1def6cdbb660",
"score": "0.67648196",
"text": "def banner\n \"Usage: #{$0} #{spec.name} #{spec.name.camelize}Name [options]\"\n end",
"title": ""
}
] | [
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.77102196",
"text": "def usage; end",
"title": ""
},
{
"docid": "0b47c7bbf158a08945a18c5355a04daf",
"score": "0.77102196",
"text": "def usage; end",
"title": ""
},
{
"docid": "a5b02ff7c85505399597b2762541ed6c",
... |
67c5b277ad1a0a67b1fdd334f7001fec | We assign to 'id', even though it's bad | [
{
"docid": "3248f50250a0411abbbd656f47695071",
"score": "0.0",
"text": "def attributes_protected_by_default\n []\n end",
"title": ""
}
] | [
{
"docid": "958d36d0f146a527458ae4596a4b081c",
"score": "0.831131",
"text": "def id=(id); end",
"title": ""
},
{
"docid": "bd46d8a6ab5fa4dea1058712aa17b607",
"score": "0.7998588",
"text": "def fillId; end",
"title": ""
},
{
"docid": "cfc62c9a8a751db435dad5136be55e78",
... |
2c478ba983b6c24d77a10404224fba05 | Returns the command as a string that can be executed in a shell | [
{
"docid": "b31d0874bdb9d3a5749745be2fcccffc",
"score": "0.7409607",
"text": "def to_s\n @command.join(' ')\n end",
"title": ""
}
] | [
{
"docid": "c1ce90fceb491f2981f9f9758e2fca51",
"score": "0.77343863",
"text": "def exec_command_to_string command, *args\n string = nil\n if command.is_a? Array\n string = command[0]\n else\n string = command\n end\n string = string.dup\n unless args.empty?\n ... |
4d83c3993f4dc3126d59894f31f7dec0 | sum the two max number in an array | [
{
"docid": "9e84db640e30607dcfe2880adec8f5c9",
"score": "0.81552005",
"text": "def max_2_sum arr\n \tif arr.empty?\n\t\treturn 0\n\tend\n\tif arr.size == 1\n\t\treturn arr[0]\n\tend\n\tmax1 = [arr[0], arr[1]].max\n\tmax2 = [arr[0], arr[1]].min\n\tfor i in (2...arr.size)\n\t\tif arr[i]>max1\n\t\t\tmax2 ... | [
{
"docid": "57c6e06ad2a556f672dfbe327e89e2e3",
"score": "0.8558452",
"text": "def max_2_sum(array)\n\n array.max(2).reduce(0, :+)\nend",
"title": ""
},
{
"docid": "5a9ad1de3935c1f78e092d487e99a48f",
"score": "0.8508386",
"text": "def max_2_sum (array)\n\treturn 0 if array.length == ... |
2532e8131880895377cd1fadcf1d2120 | PUT /profiles/1 PUT /profiles/1.xml | [
{
"docid": "2df93083fb4ca6463ca6457049caa36f",
"score": "0.70375645",
"text": "def update\n @profile = @user.profile \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = t('profiles.new.success')\n format.html { redirect_to(@user) }\n... | [
{
"docid": "8a203ad44f96ef2b70c63d1e644a26f7",
"score": "0.6821103",
"text": "def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { red... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8093af2377b95a9b9f8a3b834447b086",
"score": "0.0",
"text": "def set_financial_report\n @financial_report = FinancialReport.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... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "d5d06702884a365bc91d6aabbeed3727",
"score": "0.0",
"text": "def set_province\n @province = Province.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.603186",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015241",
"text": "def ... |
70ab46eaafb714e753bd0553be557acc | =begin :rtype: Integer =end | [
{
"docid": "0b96e38f6a59b654c486e6e74235fd85",
"score": "0.0",
"text": "def get_min()\n \n end",
"title": ""
}
] | [
{
"docid": "b7e1ff3396b969f6e372018bb5754408",
"score": "0.72586733",
"text": "def to_i\n self.begin.to_i..self.end.to_i\n end",
"title": ""
},
{
"docid": "f7da97af017d9c9fe5892ce4ca476682",
"score": "0.68839365",
"text": "def range; end",
"title": ""
},
{
"docid": "f... |
06ea7b89a9508e8d8987e657f2011fca | Add the shortcut `nodes` field to this connection and its subclasses source://graphql//lib/graphql/types/relay/connection_behaviors.rb92 | [
{
"docid": "8338d29354d4b21c1b0b5a2122244214",
"score": "0.0",
"text": "def nodes_field(node_nullable: T.unsafe(nil), field_options: T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "253b93aec0806928a251453c8f7b1f61",
"score": "0.6572592",
"text": "def nodes_field\n define_nodes_field\n end",
"title": ""
},
{
"docid": "c1d6ecfddfb34d73ccfaa60cd175d578",
"score": "0.6476413",
"text": "def nodes=(nodes)\n @nodes = nodes\n end",
"... |
0f99fb2af3809dec91b71197d4f0587e | GET /rates/1 GET /rates/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "805ea2fef4c4704c651acdc4ad5f61bd",
"score": "0.7984309",
"text": "def get_rates(options={})\n post 'rates/full', options\n end",
"title": ""
},
{
"docid": "46ca5cf2259fac1374a744bf0cf096b1",
"score": "0.7515229",
"text": "def retrieve_rates(date)\n path = \"h... |
c4504b0fc9799632df4752c463cc7259 | Verify imported issues and issue comments | [
{
"docid": "a090ce1d662b747bce85c358dd30420a",
"score": "0.79813266",
"text": "def verify_issues_import\n logger.info(\"== Verifying issue import ==\")\n @issue_diff = verify_mrs_or_issues('issue')\n end",
"title": ""
}
] | [
{
"docid": "c93c327c17fa458543c89def6f6a1374",
"score": "0.6514116",
"text": "def check_consistency\n errors.add(:base, 'Need to specifiy a gist or code from github file!') if gist_id.blank? & content.blank?\n end",
"title": ""
},
{
"docid": "00f2e1a0217c233275c6906c6715a691",
"score... |
8884b5291f6757148c71b3e2cdcbea8c | POST /post_tokens POST /post_tokens.json | [
{
"docid": "05a59fe23ab785e8085cb7c77904cfe5",
"score": "0.61894673",
"text": "def create\n @post_token = PostToken.new(post_token_params)\n @post = Post.find(@post_token.post_id)\n\n respond_to do |format|\n if @post_token.save\n format.json { render :token_modal, post_token: @post... | [
{
"docid": "75b0cae1c2bd31c93337689d357814d4",
"score": "0.73038",
"text": "def post(token_form)\n HttpClient::Preconditions.assert_class('token_form', token_form, ::Io::Flow::V0::Models::TokenForm)\n r = @client.request(\"/tokens\").with_json(token_form.to_json).post\n ... |
aa5add81a03b34c64be92bec4507644b | Restart or shutdown node Restarts or shuts down the NSX appliance. | [
{
"docid": "208a79a5170c4a12888f7552380e1119",
"score": "0.6742216",
"text": "def restart_or_shutdown_node_restart(opts = {})\n restart_or_shutdown_node_restart_with_http_info(opts)\n nil\n end",
"title": ""
}
] | [
{
"docid": "e6bf5d67639abf2ea8e2cac9cde91f51",
"score": "0.675803",
"text": "def reboot\n do_request 'reboot'\n end",
"title": ""
},
{
"docid": "065103524be40e2bc45c32b375389ffb",
"score": "0.66392535",
"text": "def restart_all_node\n put '/cluster/restart'\n ... |
aa7f49e781934a33365d933928515908 | Incomplete Gamma function. The computation is based on approximations presented in Numerical Recipes, Chapter 6.2 (W.H. Press et al, 1992). | [
{
"docid": "996bb1d2485e04f796e33445733a7482",
"score": "0.79522455",
"text": "def incomplete_gamma(a, x)\n if x <= 0.0 || a <= 0.0 || a > LOG_GAMMA_X_MAX_VALUE\n return 0.0\n elsif x < (a + 1.0)\n return gamma_series_expansion(a, x)\n else\n return 1.0-gamma_fraction... | [
{
"docid": "27b008722ae71d827e825cf088a7c692",
"score": "0.7370542",
"text": "def gamma_fraction(a, x)\n b = x + 1.0 - a\n c = 1.0 / XMININ\n d = 1.0 / b\n h = d\n del= 0.0\n an = 0.0\n for i in (1...MAX_ITERATIONS)\n if (del-1.0).abs > PRECISION\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "bf47d4f0cf8c38636a6fb11eb98be0df",
"score": "0.0",
"text": "def connection_params\n params.require(:connection).permit(:subject, :interface1_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
3f3e00fb9eb7631274f58ce5c258494d | Get Basic Physical Defense | [
{
"docid": "4117f0f7e98912f2c8b9cd1023551f1f",
"score": "0.0",
"text": "def base_pdef\n n = 0\n for item in equips.compact do n += item.pdef end\n return n.to_i\n end",
"title": ""
}
] | [
{
"docid": "d0d95d957730fbf2ce6eb0f5b3862e1d",
"score": "0.6634951",
"text": "def defense\n @defense\n end",
"title": ""
},
{
"docid": "ea3dbf3c0aa3e61d4414828a62cf3ee0",
"score": "0.6435306",
"text": "def sinergic_defense; 0.0; end",
"title": ""
},
{
"docid": "98bc63... |
a88c3ae9c6577edfdef91258ebc3d338 | light incident form the left | [
{
"docid": "a417532070c84d67a8afb0133a388c3d",
"score": "0.0",
"text": "def interface_fields\n\t\t_mats=[@matm.reverse,@matp.reverse].transpose\n\t\t_left_fields=Matrix[[@t],[0]]\n\t\t_mats.map do |m_,p_|\n\t\t\t#fields to the right of the interface\n\t\t\t_right_fields=p_*_left_fields\n\t\t\t#fields at... | [
{
"docid": "38899619d8bdefd72a2b13bc4ed713ba",
"score": "0.6780841",
"text": "def redraw_left\n return 0 unless element_left\n element_left - width * 0.5 - style[:strokewidth].to_i\n end",
"title": ""
},
{
"docid": "3d0147fdbab88ff0d239789450684001",
"score": "0.65820813",
... |
eddd5c0dcfe4b70456e6c4dad335f2e7 | Define a method .multiplier_score that takes a multiplier as an argument and returns a multiplied value of the score. (Think double or triple word score.) | [
{
"docid": "af588374b504e45ba10b933941d78bf5",
"score": "0.9081367",
"text": "def multiplier_score(multiplier)\n return multiplier * score\n end",
"title": ""
}
] | [
{
"docid": "e64fc2cf2e04579d06fe5542c9f3bf1b",
"score": "0.8889025",
"text": "def multiplier_score(multiplier)\n return self.score * multiplier.to_i\n end",
"title": ""
},
{
"docid": "8461f5e1995aa58f6ae2cdbd1864ce22",
"score": "0.88265693",
"text": "def multiplier_score(multipli... |
98968d5b40766230511c4a5573550397 | =begin an else clause can be associated with a begin block code in an else clause will only execute if the begin block executes to completion without exception else comes after the rescue clause(s) =end | [
{
"docid": "0cac3d1838056b6e6f05de26595567ea",
"score": "0.0",
"text": "def bar a\r\n raise ArgumentError, \"no arguement passed\" if a == nil\r\n raise TypeError if !a.is_a? Fixnum\r\n raise ArgumentError if a > 10\r\nend",
"title": ""
}
] | [
{
"docid": "e0d0c6c9ff31d2791e7294276fe0ab7c",
"score": "0.74055696",
"text": "def on_bodystmt(statements, rescue_clause, else_clause, ensure_clause); end",
"title": ""
},
{
"docid": "0babe5786f1dc0b716cb7264ef804fca",
"score": "0.72759444",
"text": "def else_clause; end",
"title... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "490ec97be5daa09d4eb5631e1a4d9325",
"score": "0.0",
"text": "def set_baz76\n @baz76 = Baz76.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... |
754599141771779e19fb0365aa48dbc7 | GET /tutorial_medias/1 GET /tutorial_medias/1.xml | [
{
"docid": "94b273899271255d2981a6e66a48e193",
"score": "0.7522707",
"text": "def show\n @tutorial_media = TutorialMedia.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tutorial_media }\n end\n end",
"title": ""
}
] | [
{
"docid": "a17681b2d5a746388058c91b655d24fc",
"score": "0.7010773",
"text": "def new\n @tutorial_media = TutorialMedia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorial_media }\n end\n end",
"title": ""
},
{
"docid": "40... |
519f5b8bbb537ab0be72f28bfa066782 | handle when bulk update form is submitted | [
{
"docid": "87f5867d79784f12f1def1e8b9ada66d",
"score": "0.72153205",
"text": "def submit\n @bulk_update = BulkUpdate.new(params[:bu])\n @bulk_update.property = current_property\n if @bulk_update.valid?\n @bulk_update.do_update\n flash[:notice] = t('bulk_update.tool.message.success')\... | [
{
"docid": "b446400a5c41fdbfa6370495be4ec441",
"score": "0.66878814",
"text": "def update\n if @bulk_mail.update(bulk_mail_params)\n record_action_log\n redirect_to @bulk_mail, notice: t_success_action(@bulk_mail, :update) +\n t(:update, scope: [:mail, :... |
dda4d5d5cc7d38c2732da646329d6979 | creates a sorted list of users based on their distance to username Usage: computeNearestNeighbour('Hailey',database') > returns a list of similar users in descending order. the lower the number the more similar. | [
{
"docid": "c4e9ff98cc8691d893bc877994e6417e",
"score": "0.81900674",
"text": "def computeNearestNeighbour(username,users)\n\t\n\tdistances=[]\n\tusers.each do |key,value|\n\t\tif key != username\n\t\t\tdistance = manhattan(users[key], users[username])\n distances << [distance, key]\n\t\tend\... | [
{
"docid": "9465a67a121329327709dbfa9bcbc534",
"score": "0.7099916",
"text": "def nearest\n if self.persisted?\n def distance(user1, user2)\n ((user1.latitude - user2.latitude)**2 + (user1.longitude - user2.longitude)**2)**(1/2)\n end\n\n users = []\n User.all.each do |anot... |
cf887662e8301fee0003a0b74f351fdc | POST /library_infos POST /library_infos.json | [
{
"docid": "a382bea5cd37e4585e15a2af8d789c77",
"score": "0.76581943",
"text": "def create\n @library_info = LibraryInfo.new(params[:library_info])\n\n respond_to do |format|\n if @library_info.save\n format.html { redirect_to @library_info, notice: 'Library info was successfully create... | [
{
"docid": "28e78fc603d9364ee55884896d4fb6c7",
"score": "0.7111848",
"text": "def create\n @library = Library.new(library_params)\n\n respond_to do |format|\n if @library.save\n format.html { redirect_to api_ver_library_path(id: @library.red_id), notice: 'Library was successfully creat... |
509d53ec14d4b85b1b7d8939f300d1fb | GET /costumers GET /costumers.json | [
{
"docid": "b7aad4344ecffdf9709a7f748385aa41",
"score": "0.72263074",
"text": "def index\n @costumers = Costumer.all\n end",
"title": ""
}
] | [
{
"docid": "6aa4920b9125d94ce295eff11345ed62",
"score": "0.63606465",
"text": "def credit\n handle_response(get(\"/credit.json\"))\n end",
"title": ""
},
{
"docid": "c83ae93ebe7291c33379ebc74e956cdf",
"score": "0.6334735",
"text": "def index\n\t\trender :json => @items.to_jso... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5cfb763a1ee9eb795ac217c1a3ae23cb",
"score": "0.0",
"text": "def set_user\n #@user = params.try(:user_id) ? User.find(params.try(:user_id)) : User.first\n @user = User.find(params[:user_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... |
c2388849e310deae4756c8b350503001 | Move song at curr_pos to new_pos in the playlist. | [
{
"docid": "eae75ba09687e24c1e38fbd84ea998af",
"score": "0.6338445",
"text": "def move(curr_pos, new_pos)\n socket_puts(\"move #{curr_pos} #{new_pos}\")\n end",
"title": ""
}
] | [
{
"docid": "7c114ff6b6bf85147bc385a4140c4d2b",
"score": "0.7171998",
"text": "def move_from_local_playlist(old_index)\n new_index = payload_id\n request Codes::Playlist::MOVE_ITEM_IN_PLAYLIST, caller_id do\n uint32 old_index, new_index\n end\n end",... |
2b4ee5c230f4705163714a6beb288101 | Any model can define Class.attribute_conversion_for() to represent an attribute as whatever it likes to the outside world. initializers/activemodel.rb makes this possible. | [
{
"docid": "0992902ec04988925409a5acd562fcbf",
"score": "0.0",
"text": "def collect_object_error(errors)\n errors.empty? ? errors.shift[1] : nil\n end",
"title": ""
}
] | [
{
"docid": "20b9dad62ab414d8b039aee60d7919c3",
"score": "0.70643115",
"text": "def coerce_attribute(name, model = nil)\n coerced_attributes[name] = model\n end",
"title": ""
},
{
"docid": "628a1087f89175406ab4d875abe4c2d9",
"score": "0.6552898",
"text": "def attribute... |
e22dac464e7318a0c434fddbbd656892 | Solr index identifier, also used in item path items/coll123:999 < path id | [
{
"docid": "45f9d850167e6b79c1e58e8868346dc2",
"score": "0.7321417",
"text": "def index_id\n doc_hash.fetch('id')\n end",
"title": ""
}
] | [
{
"docid": "5bf8df95a8b3e6851ddc560b8e5d5d72",
"score": "0.68205166",
"text": "def solr_document_id\n \"#{self.class.class_name.underscore.downcase}-#{self.id}\"\n end",
"title": ""
},
{
"docid": "d80ac2715c44941db6c7593976237525",
"score": "0.6778084",
"text": "def i... |
2da6b2534f5c3c7c3fd2fa5abdfb93f9 | write a function of your own design and run it different ways | [
{
"docid": "acfc79c65417b615ac7c8d95c6da9c12",
"score": "0.0",
"text": "def projects(to_do, done)\n\tleft_to_do = to_do - done\n\t#puts \"You have #{to_do} projects to do.\"\n\tputs \"You have finished #{done} projects.\"\n\tputs \"#{left_to_do} more projects to go. \\n\"\nend",
"title": ""
}
] | [
{
"docid": "792be6eadacebdee265be975baeda2c7",
"score": "0.6911177",
"text": "def function; end",
"title": ""
},
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.6530622",
"text": "def call(*) end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
... |
50e10c1606ce572487ba34c0e9a9472d | POST admin/cotacaos POST admin/cotacaos.json | [
{
"docid": "e4b2fa5a4b62ab92cdcda626ada258b6",
"score": "0.69112873",
"text": "def create\n @cotacao = Cotacao.new(params[:cotacao])\n\n respond_to do |format|\n if @cotacao.save\n format.html { redirect_to [:admin, @cotacao], :notice => 'Exemplo was successfully created.' }\n f... | [
{
"docid": "104bcb8679859fde0c595d71592700c6",
"score": "0.706158",
"text": "def create\n @taco = Taco.new(taco_params)\n\n if @taco.save\n render json: @taco, status: :created, location: @taco\n else\n render json: @taco.errors, status: :unprocessable_entity\n end\n end",
"ti... |
b53253be27aa952f647c4d8e1f4ccea1 | POST /keyword_tweets POST /keyword_tweets.xml | [
{
"docid": "432bff2524c84866efd7379703407d98",
"score": "0.7019849",
"text": "def create\n @keyword_tweet = KeywordTweet.new(params[:keyword_tweet])\n\n respond_to do |format|\n if @keyword_tweet.save\n flash[:notice] = 'KeywordTweet was successfully created.'\n format.html { re... | [
{
"docid": "7babd598e03cbdeb59c3c06682cb70b0",
"score": "0.6488794",
"text": "def post(tweet=nil)\n @res = access_token.post(\n 'http://twitter.com/statuses/update.json',\n 'status'=> tweet\n )\n end",
"title": ""
},
{
"docid": "4ef8b8fd39d91da5142a88898c7df1ec",
"score"... |
817300ee4a3c4118e976c5066477f48f | ====Params None ====Returns Integer ==== Method Returns the score originally generated in score_script_hash method No further processing is done as this method accesses the score as a stored attribute | [
{
"docid": "f705a4918f6a0249b6bd6bc9395bcc3d",
"score": "0.76689094",
"text": "def script_score\n 0\n end",
"title": ""
}
] | [
{
"docid": "30bff91890ea5566a754e80f8b564601",
"score": "0.7401991",
"text": "def getScore()\n\t\treturn Integer(@score)\n\tend",
"title": ""
},
{
"docid": "4c4d75f88c422680f3f556d37ceab60e",
"score": "0.7334281",
"text": "def score\n return @score\n end",
... |
0f7d20e0e07907c259ba9365184c43d9 | DELETE /loveinstagrams/1 DELETE /loveinstagrams/1.json | [
{
"docid": "eddc3e8f595838c751b905fba86b6120",
"score": "0.69665533",
"text": "def destroy\n @loveinstagram.destroy\n respond_to do |format|\n format.html { redirect_to loveinstagrams_url, notice: 'Loveinstagram was successfully destroyed.' }\n format.json { head :no_content }\n end\n... | [
{
"docid": "09fc2820d9479cac0697e20c559268bf",
"score": "0.6819704",
"text": "def delete\n render json: Alien.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "835c46035f10a367f7e177a0a34f5992",
"score": "0.68048",
"text": "def delete\n render json: Like.delete(params[... |
daf50ae512bd37118e6ef0b2924b42ae | The list of all Receivables for a specific User The list of all Receivables for a specific User.Receivables include Income items and Cashouts.This API endpoint returns multiple model types; the Model.type field specifies what type a given model is.Note that currently this means that there are few common fields between ... | [
{
"docid": "5debd78e9f5618d3a93e785cd880f6f3",
"score": "0.46284685",
"text": "def receivables_user_api_get(user_pk, opts = {})\n data, _status_code, _headers = receivables_user_api_get_with_http_info(user_pk, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "376e40b6e85f3c808302f4b6fbd4e662",
"score": "0.6601587",
"text": "def index\n @account_receivables = AccountReceivable.all\n end",
"title": ""
},
{
"docid": "376e40b6e85f3c808302f4b6fbd4e662",
"score": "0.6601587",
"text": "def index\n @account_receivables = Accoun... |
43464fee474888d265ed35934690735c | DELETE /tags/1 DELETE /tags/1.json | [
{
"docid": "b014c8633b33229fcccc6e032a3beb91",
"score": "0.7471249",
"text": "def destroy\n @tag = Tag.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to tags_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.81822556",
"text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend",
"title": ""
},
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.81822556",
"text": "def tag... |
ffad016b49097e9b7770f6ca37bffb12 | Set sensible defaults for the +WaterDrop+ gem. rubocop:disable Metrics/AbcSize because of the configuration mapping | [
{
"docid": "d159b348d481312d8b9a7d75971bfb97",
"score": "0.6409618",
"text": "def configure_waterdrop\n # Skip WaterDrop configuration when no brokers/client id is available,\n # because it will raise. Its fine to have none available for situations\n # like Rails asset precompilatio... | [
{
"docid": "4f8ead504572f8c159abcb8f3b6d595a",
"score": "0.70415574",
"text": "def set_defaults\n end",
"title": ""
},
{
"docid": "0ffdccfc22d2b241df95018d80d3e630",
"score": "0.70207137",
"text": "def defaults\n settings.clear\n self.with_filename = false\n self.... |
faebc1e5c283d9d78a7eccacd7f63aa0 | dispatches operations to multiple subnets | [
{
"docid": "01536652fabb5a0707c7d78a15fad98a",
"score": "0.64794976",
"text": "def process_cloud_subnets(subnets, operation)\n return if subnets.empty?\n\n if operation == \"destroy\"\n subnets.each do |subnet|\n audit = {\n :event => \"cloud_subnet_record_delete_initia... | [
{
"docid": "1e421784d4bc493d957a349ff7ce77e9",
"score": "0.62107986",
"text": "def process_cloud_subnets(subnets, operation)\n return if subnets.empty?\n\n if operation == \"destroy\"\n subnets.each do |subnet|\n audit = {\n :event => \"cloud_subnet_record_delete_initia... |
ad33127af4f44173fd1ae50919581d54 | move a valid position for the computer to move | [
{
"docid": "174502f437a08723295ab1a637c241a2",
"score": "0.0",
"text": "def opposing_player(cur_player)\n cur_player == \"X\"? \"O\" : \"X\"\n end",
"title": ""
}
] | [
{
"docid": "abf98788990bdb7678dfde2e534c0292",
"score": "0.8099109",
"text": "def move\n return unless placed?\n # no need to use a loop since the length is only 2\n new_x = @pos_x + @direction[:x]\n new_y = @pos_y + @direction[:y]\n\n return unless valid_position?(new_x, new_y)... |
ccd28a5349a1a0dde4a792efa185fc66 | Task:Delete a node from the singly linked list given only a variable pointing to that node. | [
{
"docid": "1c8f42a9c12ada21c74ff3ab48a99139",
"score": "0.7111609",
"text": "def deleteLinkedlistNode(node)\n nextnode = node.next\n if node && nextnode\n node.next = nextnode.next\n node.value = nextnode.value\n end\nend",
"title": ""
}
] | [
{
"docid": "1cca9c8fdd838e6a0d9fed4d8177c3c1",
"score": "0.7097972",
"text": "def delete_node(node)\n\n node.val = node.next.val\n node.next = node.next.next\n nil\nend",
"title": ""
},
{
"docid": "48dd99e9fad92f8c7410f33df3ae7ca0",
"score": "0.7080779",
"text": "def delete(node)\... |
84e99a1eb315e8a293f82d7f3161c5e5 | Assign a slice of a tensor | [
{
"docid": "c147298e389fa1378f28403207438590",
"score": "0.54925364",
"text": "def []=(*args, value)\n return Functions::AssignSlice.new(*args).call(self, value)\n end",
"title": ""
}
] | [
{
"docid": "587834bf732ef7d861ee8ed5580fe7c4",
"score": "0.61497253",
"text": "def slice slice = nil\n @slice = slice if slice\n @slice\n end",
"title": ""
},
{
"docid": "bafec8ffe54830c6fb0cad39e4aa8d54",
"score": "0.60933626",
"text": "def slice=(args)\n case args[1... |
5d9d59019b6e3011fdf665997c90de70 | Write a `delete(el)` method to remove an item from the set. Return `true` if the item had been in the set, else return `false`. | [
{
"docid": "deb1705f9407a26db514d6844acd94e6",
"score": "0.6414032",
"text": "def delete(el)\n store.delete(el)\n end",
"title": ""
}
] | [
{
"docid": "c965f2b4788f7c34aa1af368d933013f",
"score": "0.64927053",
"text": "def remove(x)\r\n if (x.kind_of?(Hashable))\r\n pos = position(x)\r\n if @array[pos].remove(x) # if true\r\n @items -= 1 # subtract one item\r\n return true\r\n else\r\n return false\r\n... |
0585c3d2735f495022204088115311b2 | POST /courses POST /courses.json | [
{
"docid": "cf76b9f8dc01b144a4153bd7cc9dd9ae",
"score": "0.0",
"text": "def create\n @course = Course.new(course_params)\n @course.user_id = current_user.id\n @tags = params[:tags].split(',')\n @tagged = []\n\n respond_to do |format|\n if @course.save\n @activity = Activity.c... | [
{
"docid": "d1c0235d43e9f99d869262850dd4b256",
"score": "0.7447877",
"text": "def add_and_get_courses\n objects = JSON.parse(request.raw_post)\n result = []\n objects.each do |item|\n coursenumber = @unilib.course_normalize(item[\"number\"])\n course = find_by_number(coursenumber)\n ... |
3c8eb7854ca54abdfcbdf275ffc358f4 | Sets the contents of a file from the package | [
{
"docid": "79bc011e5849dcaea32e35f02374847d",
"score": "0.69392097",
"text": "def _set_file(name, contents)\n File.open(\"%s/%s\" % [uri, name], \"w\") { |io| io.write contents }\n end",
"title": ""
}
] | [
{
"docid": "1819a8a73cc43fb641ac714c93939e10",
"score": "0.6824039",
"text": "def set(file)\n self.file = file\n end",
"title": ""
},
{
"docid": "8e330ad7b81a6807a27de224cfa84647",
"score": "0.64926016",
"text": "def []=(file_name, content)\n path = absolute_path... |
31f63430eb9307fc775f7388a35bf751 | GET /hubs/new GET /hubs/new.json | [
{
"docid": "bfe7577909930682c5b27b105f5e681a",
"score": "0.81885034",
"text": "def new\n @hub = Hub.new\n respond_to do |format|\n format.html { redirect_to @hub, notice: 'Hub was successfully created.' }\n format.json { render json: @hub }\n end\n end",
"title": ""
}
] | [
{
"docid": "d83b7fdc2861658b48eb94aa741bc828",
"score": "0.7592871",
"text": "def new\n @hub = Hub.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hub }\n end\n end",
"title": ""
},
{
"docid": "d83b7fdc2861658b48eb94aa741bc828",... |
728c44f4cf1595096513339ff7cf2044 | p counted_characters("that's alright folks") ["t"] p counted_characters("mississippi") ["i", "s"] p counted_characters("hot potato soup please") ["o", "t", " ", "p"] p counted_characters("runtime") [] | [
{
"docid": "8df41944866ec523a4e3243ad076db5a",
"score": "0.0",
"text": "def triplet_true(string)\n (0...string.length - 2).each do |i|\n return true if string[i] == string[i + 1] && string[i + 1] == string[i + 2]\n end\n false\nend",
"title": ""
}
] | [
{
"docid": "33949a3714084c595c5f6a1f0dd970b0",
"score": "0.76896477",
"text": "def custom_count(string, search_characters)\n total_chars = 0\n #\n search_characters.each_char do |sc|\n # split the string and review letter & sc\n letters = string.each_char { |letter| letter == sc ?... |
fb7448609db5c16abc2b8f44eb3dd136 | Matrix > [Node] | nil | [
{
"docid": "5341f0b2f10d6a07b0c847e16da39042",
"score": "0.0",
"text": "def mincost_path\n return [] if length==0\n # calc cost\n self[0].each{|n|\n n.total_cost=n.word.cost\n n.nearest_prev=nil\n }\n (1...length).each{|i|\n prevs=@ends[i-1]\n curs=@b... | [
{
"docid": "798e33428c0ee1d31805ce2e331b0746",
"score": "0.737211",
"text": "def node_matrix\n node_matrix = Matrix.build(@graph.nodes.length) do |row, col|\n end\n node_matrix\n end",
"title": ""
},
{
"docid": "fb362ffb4295ed57642fef18a174e415",
"score": "0.722... |
8874f4eaa45d1dbc7a7c292447ebdaf7 | ensure this replaces the existing attr_reader password GETTER | [
{
"docid": "cf762de8b17af312c0e2857ad4495958",
"score": "0.69398874",
"text": "def password\n return self[:password]\n end",
"title": ""
}
] | [
{
"docid": "5d1f3700da3537a8cc058fd38bf8a9f1",
"score": "0.74051714",
"text": "def password\n # Not using superclass_delegating_reader. See +site+ for explanation\n if defined?(@password)\n @password\n elsif superclass != Object && superclass.password\n superclass.... |
7351dfa79adf93858007803fc98a769b | Takes a hand of cards (array (string)). Returns a score (number) for the hand of cards passed in | [
{
"docid": "5b928fba202a43f9371747ec5d5fa331",
"score": "0.7558498",
"text": "def get_score (cards)\n\t\tscore = 0\n\t\tcards.each do |card|\n\t\t\tmeasure = card[0]\n\t\t\tscore += @score[measure]\n\t\tend\n\t\tscore\n\tend",
"title": ""
}
] | [
{
"docid": "dfbb5495471f80097fdb29d0fa298c56",
"score": "0.8257994",
"text": "def hand_score(hand)\n\tcards= {\"A\"=>4, \"K\"=>3, \"Q\"=>2, \"J\"=>1}\n \tscore = 0\n \thand.each_char { |char| score += cards[char.upcase] }\n \treturn score\nend",
"title": ""
},
{
"docid": "38a700fb7ae88836... |
6275f139d939b27d17476861c64a9ab3 | Notifies the customer linked to the billing request, asking them to authorise it. Currently, the customer can only be notified by email. Example URL: /billing_requests/:identity/actions/notify | [
{
"docid": "e61eb730799341455e3b8c1beb300ff8",
"score": "0.70296717",
"text": "def notify(identity, options = {})\n path = sub_url('/billing_requests/:identity/actions/notify', 'identity' => identity)\n\n params = options.delete(:params) || {}\n options[:params] = {}\n option... | [
{
"docid": "f8b1b1a46cf98cbb88c145bf0cdcf4ea",
"score": "0.7244742",
"text": "def notify_request_to_customer\n\n if send_notifications?\n unless customer_email.empty?\n\n bcn_template = ContentManagerSystem::Template.first(:name => 'order_customer_req_notification')\n\n ... |
9c6bea86abfacce3f93545fac0c8524e | POST /item_attachments POST /item_attachments.json | [
{
"docid": "c47bef2f896a901403c9e8c350ea7a2e",
"score": "0.7300648",
"text": "def create\n @item_attachment = ItemAttachment.new(params[:item_attachment])\n\n respond_to do |format|\n if @item_attachment.save\n format.html { redirect_to @item_attachment, notice: 'Item attachment was su... | [
{
"docid": "60b853b66195a287724ffc7d2306b680",
"score": "0.74213237",
"text": "def upload_attachment_to_equipment(equipment, attachment_args)\n url = @base + \"/api/v1/attachments.json\"\n params = {\n item: {\n title: attachment_args[:title],\n description: attachment_args[:description] ||... |
1e4239f727146e49532037d07e72c5eb | Pauses for given time. | [
{
"docid": "b130dd627eabd202148f120feb84ae21",
"score": "0.64587486",
"text": "def pause(value = 1)\n sleep value\nend",
"title": ""
}
] | [
{
"docid": "023d90ee487cf03312cc2b2799ae400f",
"score": "0.7170673",
"text": "def pause(seconds)\n sleep seconds\n end",
"title": ""
},
{
"docid": "023d90ee487cf03312cc2b2799ae400f",
"score": "0.7170673",
"text": "def pause(seconds)\n sleep seconds\n end",
"title"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "2f9fb454bbdaafa70d66f3a5719ac8f9",
"score": "0.0",
"text": "def game_params\n params.require(:game).permit(:summoner_id, :game_num, :ip_earned, :ping, :time_in_queue, :champion_id, :queue_type, :create_date, :spell_one, :spell_two, :team_id, :neutral_minions_killed_enemy_jungle, :true_d... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497801",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957249",
"text": "def strong_params\n params.require(:request).permit(param_white... |
a585603232e5afd86d43cefe6d19c8b2 | move([0,2,7,0]) move([4,1,15,12,0,9,9,5,5,8,7,3,14,5,12,3]) Question 2 | [
{
"docid": "ea217c23fa96e800cfb07ed5551e13a2",
"score": "0.0",
"text": "def move2(memory_block)\n arr = memory_block.dup\n options_arr = []\n options_arr.push(memory_block)\n valid = true\n first_found = false\n first = \"\"\n count = 0\n while valid == true\n copy = arr.dup\n result = mov... | [
{
"docid": "a899c99c15fb5788e37ddecf5d16703b",
"score": "0.74513537",
"text": "def move\n move_by a, m\n end",
"title": ""
},
{
"docid": "9fd8375209b7aaf6c3d61965499a28a7",
"score": "0.73016953",
"text": "def moves\n # All pieces can stay in place\n [[0,0]]\n end",
... |
c2691abd835490963931a5b54921d42d | Runs the entire Connect Four game | [
{
"docid": "0e5d3b7a0f0c855bb6a7c5b314c2b631",
"score": "0.0",
"text": "def run\n while(!@game_over)\n valid_input = false\n input_column = -1\n \n display_board\n puts \">>> Player #{@player}'s turn.\"\n \n # Repeatedly prompts the user for input until valid input ... | [
{
"docid": "d49a383dc1215ca2ada541d841b0ad09",
"score": "0.7398679",
"text": "def start\n puts \"Connect Four! Try to get four pieces in a row before the other player.\"\n board.print_grid\n until over?\n board.place_piece( light_turn ? LIGHT : DARK, choose_column )\n board.print_grid... |
cbe152300327c687a350e95ddea2d693 | Get user by email/phone/uid | [
{
"docid": "62a914f694f755b4f1bb5ab2c9dc17d6",
"score": "0.0",
"text": "def get_user_by(key, value)\n params = {}\n params[key] = Array(value)\n response = post('v1/accounts:lookup', params)\n (response[:users] || []).first\n end",
"title": ""
}
] | [
{
"docid": "ca1d3ff9d9c4a72fff3c9b65dbf2b040",
"score": "0.77169406",
"text": "def retrieve_user_by_email(email)\n start.uri('/api/user')\n .url_parameter('email', email)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "0ad68bc7303a190ec6021e87901c5e9... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "bb37c34a2c386fba77959716df769dc0",
"score": "0.0",
"text": "def set_body_site\n @body_site = BodySite.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6165152",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60463154",
"text": "def action_hook... |
e77d4849d4c49c3926415c0dc521b1cf | commits all staged changes and pushes back to origin TODO: generate a better commit message TODO: add the ability to specify the remote and branch TODO: detect existance of origin instead of just dying | [
{
"docid": "0eb62e88b136f3a0532624019ea37dda",
"score": "0.0",
"text": "def apply(commit_message = DEFAULT_COMMIT_MSG)\n @gl_admin.commit_index(commit_message)\n @gl_admin.git.push({}, \"origin\", \"master\")\n end",
"title": ""
}
] | [
{
"docid": "8eebac745366e6c315c7c66a5a473c86",
"score": "0.72273195",
"text": "def commit_and_push\n begin\n @g.add('.')\n @g.commit_all(\"Assets precompilation\")\n rescue Git::GitExecuteError => e\n @logger.error(\"Could not commit. This can occur if there was nothing to commit. G... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "943b844dfdb8cc2fb909033a9f7e8138",
"score": "0.0",
"text": "def car_pooling_request_params\n params.require(:car_pooling_request).permit(:email, :password, :user_id, :travel_id, :prefer_from, :prefer_to)\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... |
33c97e9c07544601238c8df2e54c3ff1 | digits contains an array of digits in the problem rhs is the right hand side of the equation overlay is a string representation of operators and their position in available positions between digits | [
{
"docid": "5c26d4442af6fad41429f29ad942ecc0",
"score": "0.58624256",
"text": "def initialize(digits, rhs, overlay)\n\t\t@digits = digits\n\t\t@rhs = rhs\n\t\t@overlay = overlay\n\t\t@eqn = buildEquation\n\n\t\t@valid = isValid?\n\tend",
"title": ""
}
] | [
{
"docid": "4174a845c384d47e72c0c3284f27a0b2",
"score": "0.67098343",
"text": "def show_all digits, opers, target\n # validate arguments\n a_digs = digits.scan(/./).map{ |d| Integer( d ) }\n fail \"invalid operator, only [-, +, *, /] allowed\" unless %r|^[-+*/]+| =~ opers\n a_ops = opers.un... |
fa28fe7700fc536b024dd9214bfc45bd | Return true if IOP | [
{
"docid": "592a91703a3bc22cae7b4ef4580440e4",
"score": "0.7163352",
"text": "def iop?\n node['hadoop']['distribution'] == 'iop'\n end",
"title": ""
}
] | [
{
"docid": "715c9dc4d8951d30b9e067b1cb3fb8a1",
"score": "0.7254203",
"text": "def sysop?\n (status =~ /sysop/) != nil\n end",
"title": ""
},
{
"docid": "144723af84b7ede2e5216f2dcac51fd6",
"score": "0.66182035",
"text": "def using_cpu?\n return @status[ 'CPU' ][ 'Active' ]\... |
48996bf852f995f7b6561d3eff82fa42 | match '/m/auto_manufacturers.:format', :to => 'mobileauto_manufacturers' match '/m/auto_models/:auto_manufacturer_id.:format', :to => 'mobileauto_models' match '/m/auto_years/:auto_model_id.:format', :to => 'mobileauto_years' match '/m/auto_options/:auto_year_id.:format', :to => 'mobileauto_options' | [
{
"docid": "4d51859924c1d25f5cabde7b06605889",
"score": "0.5168366",
"text": "def auto_manufacturers\n @manu = AutoManufacturer.find(:all, :order => :name)\n \n respond_to do |format|\n format.json { render json: @manu }\n end\n end",
"title": ""
}
] | [
{
"docid": "b4fbc3f11640bc89a9b142c59cd79796",
"score": "0.59190047",
"text": "def uri_pattern; end",
"title": ""
},
{
"docid": "b4fbc3f11640bc89a9b142c59cd79796",
"score": "0.59190047",
"text": "def uri_pattern; end",
"title": ""
},
{
"docid": "e8736ea5a25a077bf0fbcfe098... |
72f526e61afbb049b3737c82af50687d | Build object for save_account | [
{
"docid": "e08e9c0aab920652674be6dddde20251",
"score": "0.0",
"text": "def build_object\n @object = UnifyMatchmaker.new\n @object.company_name = params[\"business_name\"]\n @object.biz_location = params[\"business_location\"]\n\n @object.phone = params[\"phone_number\"].to_s.gsub(/[^0-9]/,'... | [
{
"docid": "e7445cb7a6de84c33245494f3a06fce8",
"score": "0.7181849",
"text": "def build_account\n @folder = Folder.new(:user_id => self.id, :name => \"Inbox\")\n @folder.save \n @wall = Wall.new(:user_id => self.id, :title => \"Wall\")\n @wall.save\n @album = Album.new(:user_id => self.id... |
ce91d73debb60d7f9820704f6f0ac7d2 | Setup unpack the vars for the web page to be scraped csv an array w/ all of the page specific config has some key deets, where to save images, etc that the page has to know schema dynamic column headers | [
{
"docid": "483187844b80e9ba7043ba0349982c88",
"score": "0.5162599",
"text": "def setup(csv, config, schema, host, accepted_domain)\n #parse the csv\n @url, @path, @title = csv[0], csv[1], csv[2]\n @url = fix_oneoff @url\n @fields = []\n csv[3..-1].each do |field|\n unle... | [
{
"docid": "67ca32fdce266a1365d8bd8ae00454f6",
"score": "0.60916615",
"text": "def scrap\n\n page = Nokogiri::HTML(open(\"https://apkpure.co/\"))\n\n @text = []\n @images= []\n @download_button_name = []\n @download_links = []\n @all_website_urls = []\n\n # name\n\n page.css('div... |
44d3af8f72283927b8ad4d26231eb123 | read options from YAML config | [
{
"docid": "3de08d1dd0416cf872738ba537e3253e",
"score": "0.0",
"text": "def configure\n\n # config file default options\n configuration = {\n :options => {\n :verbose => false,\n :color => 'AUTO'\n ... | [
{
"docid": "42846fd924b4616b44a330f7d80026f8",
"score": "0.70201164",
"text": "def load_config!\n return unless options.empty?\n\n data = ::YAML.load_file(File.open(\"#{directory.path}/supernova.yml\", \"r\"))\n load_paths.push(*data.fetch(\"load_paths\", []))\n\n load_paths.map! do ... |
1867e2b1423ee881d286a283820d50b9 | add the place of production to the 264|a | [
{
"docid": "e934802f6dd82cc8a6917964fbeab63f",
"score": "0.4834513",
"text": "def handle_production_place(user_defined)\n if user_defined['string_1']\n df('264', '#', '0').with_sfs(['a', user_defined['string_1']])\n end\n end",
"title": ""
}
] | [
{
"docid": "e2f00e795f511dfa4dacbdd39d844324",
"score": "0.5766093",
"text": "def production\n @hectares * @production\n end",
"title": ""
},
{
"docid": "b4c75c617b8b6f19187a5eedb6b149f9",
"score": "0.5620525",
"text": "def add_production(aProduction)\n # TODO: remove output... |
2a1570d0fd6ce691fd66c53ba0116e47 | creates an array for all the variant_properties that are associated to the product of this variant | [
{
"docid": "a4838239213458710c4dee393738ba4f",
"score": "0.7895762",
"text": "def get_variant_properties_from_product\n vpv = []\n self.variant_variant_property_values.each do |vvpv|\n if !vvpv.variant_property_value.nil?\n vpv << vvpv.variant_property_value.variant_property_id... | [
{
"docid": "0e833ef8e99e6651b8ecb4760460b3ef",
"score": "0.7065667",
"text": "def index\n @properties = @products.map(&:properties).flatten.uniq\n end",
"title": ""
},
{
"docid": "35285dab454a1ef633c2efbe5a3caf10",
"score": "0.69140464",
"text": "def product_properties(produc... |
580057effa1cc7b3418ab6030530105c | Return the state of VirtualBox virtual machine by actually querying VBoxManage. | [
{
"docid": "89b40c36350504a197612337c50c4ba1",
"score": "0.0",
"text": "def state\n # XXX: What happens if we destroy the VM but the UUID is still\n # set here?\n return :not_created if !@driver.uuid\n state = @driver.read_state\n return :unknown if !state\n sta... | [
{
"docid": "817771478a3832628200d9d6843b12c2",
"score": "0.7244489",
"text": "def state(vm_name)\n `VBoxManage showvminfo #{vm_name}` =~ /^State:\\s+(.*)$/ ? $1 : 'unknown'\n end",
"title": ""
},
{
"docid": "061e3c2020d68ad0ef8e7c8194b945cc",
"score": "0.7047284",
"text":... |
0c0d03894a9e8e4617803dc1a097901f | returns the array of movies that user u has watched | [
{
"docid": "789f6808d4f8e1935ecd5f3fabe2e5a7",
"score": "0.8067292",
"text": "def movies(user)\n movie_list = Array.new\n user_table = @user_movie_rate[user]\n user_table.each do |m, _r|\n movie_list.push(m)\n end\n return movie_list\n end",
"title": ... | [
{
"docid": "30439b0decaaaf7653500c4623ef8e67",
"score": "0.87245774",
"text": "def movies(user)\n movies_he_watched = []\n @training_set.each do |record|\n if record.user == user.to_i\n movies_he_watched.push(record.movie)\n end\n end\n return movies_he_watched\n end",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "518b4fd6ab05bfdf31bf8932b6f7bb00",
"score": "0.0",
"text": "def set_user\n @user = User.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6165422",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60457647",
"text": "def action_hook... |
be0a5e381afc15e4d42ede736f54dbce | creates csv text based on current anonymization | [
{
"docid": "8f0498e302aea9617321b3665cf2c94f",
"score": "0.72237223",
"text": "def to_csv\n csv_contents = \"\"\n @anonymizations.each do |orig, anon|\n csv_contents += \"#{orig}, #{anon}\\n\"\n end\n return csv_contents\n end",
"title": ""
}
] | [
{
"docid": "e7c3d6efb741c56bbdb72e1d1216e3ab",
"score": "0.6272604",
"text": "def to_csv(mappings, questions, answers)\n\t\tCSV.generate do |csv|\n\t\t\tcsv << [\"Grader\", \"Grader Email\", \"Graded\", \"Graded Email\"] + questions.map{|question| \"#{question.content.split(\"@#!$\")[0]}\"}\n\t\t\tmappi... |
736ad3b1bf69b68ba8ccbf56e38edd57 | GET /stats_sheets GET /stats_sheets.xml | [
{
"docid": "3455c212d2b81519adb113480f8fb4d8",
"score": "0.78299785",
"text": "def index\n @stats_sheets = StatsSheet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stats_sheets }\n end\n end",
"title": ""
}
] | [
{
"docid": "4fbb80944ce2ff8db4b8d64bb65d5c81",
"score": "0.6593885",
"text": "def index\n @sheets = Sheet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sheets }\n end\n end",
"title": ""
},
{
"docid": "03c77019659522d6e28f946c... |
a8557c3c001162b7a8d70c41fa0d976b | dynamically creates a module for the model if it isn't already defined | [
{
"docid": "76cfc195d8bc1b2e4bb88391eb6a996f",
"score": "0.0",
"text": "def default_operation_class_for(model_name, verb)\n default_operation = SkinnyControllers::Operation::Default\n namespace = Lookup::Operation.default_operation_namespace_for(model_name)\n\n operation_class_name ... | [
{
"docid": "090e61419996b5f5990c8c1454c9ca8f",
"score": "0.68223774",
"text": "def create_module\n\t\t\t\t@routable = yes?(\"Should this module be routable? (y/n)\") ## double check to make sure we don't want this module to be routable\n\t\t\t\t@module = module_name_class ## should not use this ivar\n\t... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2e4b72bbf9ef49976fb577c227f7c725",
"score": "0.0",
"text": "def set_setv\n @setv = Setv.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
fc744370808b1e99de16cf767da7abcf | Returns a single payment card | [
{
"docid": "ada3e822baf4e4c4ed4c5455fbf1cded",
"score": "0.77451485",
"text": "def payment_card(card_id)\n params = { query: card_id }\n\n data = endpoint(name: 'PaymentCards', params: params).do_get\n\n resource 'PaymentCard', data\n end",
"title": ""
}
] | [
{
"docid": "8e876723c695a02efeb27dcd00515f9d",
"score": "0.7642933",
"text": "def retrieve_card_payment(payment_id, options={})\n commit(:get, :retrieve_card_payment, { payment_id: payment_id }, options)\n end",
"title": ""
},
{
"docid": "e5bfe1f887e6058b735841578cb59d01",
"s... |
9c6b91a6ea09aed43859073a6e3497c7 | If you specify a distribution domain (i.e. a cloudfront domain, or even an S3 domain with a prefix), that distribution domain is used. Otherwise the default canonical S3 url is used. | [
{
"docid": "ea39e9e630f8b25877757f0ba524244b",
"score": "0.7733425",
"text": "def url(file = @original)\n if self.class.s3_distribution_domain\n \"#{self.class.s3_distribution_domain}#{super}\"\n else\n \"#{self.class.s3_host}/#{self.class.s3_bucket}#{super}\"\n end\n end... | [
{
"docid": "f0a753c8d7dcfeb63441461d36c6e04f",
"score": "0.7240176",
"text": "def cloudfront_domain_prefix\n \"#{GlobalConstant::Aws::Common.client_assets_cdn_url}/\"\n end",
"title": ""
},
{
"docid": "d256c006b63ab1c14be1e48ba8749062",
"score": "0.7180439",
"text": "def ... |
4d7f883cd6cf1f690056b9c9216e9c7e | PUT /ext_codes/1 PUT /ext_codes/1.json | [
{
"docid": "be359f678f584b6fb994bcef6981ea45",
"score": "0.7260646",
"text": "def update\n @ext_code = ExtCode.find(params[:id])\n\n respond_to do |format|\n if @ext_code.update_attributes(params[:ext_code])\n format.html { redirect_to @ext_code, notice: 'Ext code was successfully upda... | [
{
"docid": "8d9f6b153340f1f95c4620708ed48d4f",
"score": "0.65080345",
"text": "def update\n @code = Code.find(params[:id])\n\n respond_to do |format|\n if @code.update_attributes(params[:code])\n format.html { redirect_to(@code, :notice => 'Code was successfully updated.') }\n f... |
07b0fe339a5fb05eb827efb734c77807 | returns the number of 5 matched consecutive character sequences | [
{
"docid": "7cb0dbfe594fb6095cdff9f288f11f53",
"score": "0.0",
"text": "def character_matching(first, second)\n i=0; j=4; p=0\n for j in 4..first.length()-1\n k=0; l=4\n for l in 4..second.length()-1\n x = first[i..j]\n y = second[k..l]\n if (x.eql? y) && (!x.include... | [
{
"docid": "5443023374b12bbae6557185745e2f86",
"score": "0.67322314",
"text": "def count_code(string) # return the number of times 'co'+any_char+'e' appears\n # return string.scan(/co.e/).length #easy way with regex\n code_count = 0\n (string.size-3).times do |i|\n if string[i..i+1] == '... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "ae6c1a075a59020b2de133160a9b4238",
"score": "0.0",
"text": "def user_params\n params.require(:user).permit(:email, :name, :middle, :useraa)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6981269",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783559",
"text": "def strong_params\n params.requi... |
6252a9857e7f73d601760da5774532e5 | Get the base URL for the client. If set manually for the instance, that URL will be returned. Otherwise, it will be deferred to +Client.base_url+. | [
{
"docid": "82d0629a56c7231907b0c6d62c93cc25",
"score": "0.7722436",
"text": "def base_url\n @base_url || self.class.base_url\n end",
"title": ""
}
] | [
{
"docid": "0be73ceef0435be217e38c22c093fc5b",
"score": "0.7524406",
"text": "def base_url\n @base_url || DEFAULT_BASE_URL\n end",
"title": ""
},
{
"docid": "87a0f843238e321d276d19afbc7033e2",
"score": "0.7493338",
"text": "def base_url\n self.class.options[:base_url]\... |
207f5758c0bb5d7fbd88991f91f1ec56 | GET /home/show/1 GET /home/show/1.xml | [
{
"docid": "77a3326e68d4ce19dd7fb660a2fa9e38",
"score": "0.0",
"text": "def show\n @page_name = 'Year'\n @year = Form1120.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @patient }\n end\n end",
"title": ""
}
] | [
{
"docid": "f2f8039ffbdcedbc60bb69ee66fc281b",
"score": "0.70302325",
"text": "def show\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scrap_xml }\n end\n end",
"title": ""
},
{
"docid": "... |
b4699f5fd8ed3efd88a006efdfa28bbd | DELETE /admin/categories/1 DELETE /admin/categories/1.xml | [
{
"docid": "d631b13ce0da0028a64d2ea31a214c87",
"score": "0.7155015",
"text": "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_categories_url) }\n format.xml { head :ok }\n end\n end",
"title... | [
{
"docid": "e5e2de71c234d17eaa48224e97ef8a3e",
"score": "0.72043735",
"text": "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_categories_path) }\n format.xml { head :ok }\n end\n end",
"tit... |
0d1d123d0335a3afbad0c1b8a2969c58 | we don't want our tests to spew the same logging info that our production runs do | [
{
"docid": "823085191a74b2e164752285af7efad1",
"score": "0.0",
"text": "def null_logger(input) end",
"title": ""
}
] | [
{
"docid": "136f6c43988b1b151cb20d858802f241",
"score": "0.7482638",
"text": "def setup_logging\n # NOP\n end",
"title": ""
},
{
"docid": "16030e45a38232d1b9eefe13dd0d8bf8",
"score": "0.73357916",
"text": "def noisy_logger\n logger.info 'some very noisy logging'\n end... |
90be4930ac67ee4a5c1a300582fb8ad1 | Ajax Create Designs based on user image uploads, creating images, thumbs, filenames Params (through rails params): +design_images+:: Returns | [
{
"docid": "04dae78666c9fcf8d95ab003171c6b71",
"score": "0.7364772",
"text": "def create\n\n require 'RMagick'\n @images_added = []\n\n # params[:design_images] is set by a js library (Dropzone.js) and defined on dynamic_pages.js paramName\n params[:design_images].each do |array_file|\n\n ... | [
{
"docid": "d1e32108ed698dbace687202876f47aa",
"score": "0.752893",
"text": "def create\n #@design = Design.new(design_params)\n\n @designer = Designer.find(params[:designer_id])\n @design = @designer.designs.create(design_params)\n\n respond_to do |format|\n if @design.save\n\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b66f8d12e3f52570a795d4b60e44346c",
"score": "0.0",
"text": "def set_freelance_proposal\n @freelance_proposal = FreelanceProposal.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;... |
f7be85ac01fabf46a321fe636ddc0dc5 | return integer reprasent percent of position | [
{
"docid": "c8a359812ba2587b31d833d3ff208b65",
"score": "0.8270378",
"text": "def percent_position\n total_count = GamePlayer.where( [ \"game_round_id=? \", game_round_id]).count\n (current_position.to_f/total_count * 100).to_i\n end",
"title": ""
}
] | [
{
"docid": "ad20746c9e573d5af87a229d62c891cd",
"score": "0.775761",
"text": "def pos_percentage(pos_symbol)\n (send(pos_symbol.to_s + '_count').to_f / word_count * 100).round(2)\n end",
"title": ""
},
{
"docid": "8054be0efbfe3ce271f68f00ec2d4027",
"score": "0.7746618",
"text": "d... |
1fa6d5d71165c2b66b10552362365bf8 | Returns the Faraday HTTP connection | [
{
"docid": "0a2f19142d3c923b14f412a576cab4e5",
"score": "0.0",
"text": "def connection\n @connection = ::Faraday.new(:url => 'http://ow.ly') do |faraday|\n faraday.request :multipart\n faraday.adapter Faraday.default_adapter\n faraday.response :json\n end\n end",
"t... | [
{
"docid": "cefb061daed2a51198f70d937501bd12",
"score": "0.82948875",
"text": "def connection\n Faraday.new(base_url)\n end",
"title": ""
},
{
"docid": "6f5ab00b0d45f946f4b0c19894d80dfb",
"score": "0.8226728",
"text": "def connection\n @connection ||= Faraday.new(url, {heade... |
a25065e63f53431e3d2f63b9255c176f | All SFX things are readonly! | [
{
"docid": "b27874f389dd8d64a5899f50515442ad",
"score": "0.61763734",
"text": "def readonly?() \n return true\n end",
"title": ""
}
] | [
{
"docid": "e330d416d451ea11caf23f0f7217e545",
"score": "0.73203987",
"text": "def readonly! #:nodoc:\n @readonly = true\n end",
"title": ""
},
{
"docid": "1a553dbd96f74cdc1909b119e5e3ed45",
"score": "0.7132627",
"text": "def readonly!\n @readonly = true\n end",
... |
7bed42e3aef4a9a0b66f83eb27c37a5d | set default role for user | [
{
"docid": "2de4071e4c7236bb18ba93d1bbe080a0",
"score": "0.8507394",
"text": "def set_default_role\n \tself.role ||= :normal\n end",
"title": ""
}
] | [
{
"docid": "98f2251e48678c712a32b51c9337caf7",
"score": "0.8847352",
"text": "def set_default_role\n self.role ||= :user\n end",
"title": ""
},
{
"docid": "c20486a89beb143405bad6c36a60e26d",
"score": "0.8814058",
"text": "def set_default_role\n self.role ||= Role.find_by_n... |
09998c6792a3d2c491df97351fbff3fb | load_and_authorize_resource :offer load_and_authorize_resource :offer, through: :offer | [
{
"docid": "0fbb1f0d21df7b722709644bb9bdbc0e",
"score": "0.0",
"text": "def index\n @services = Service.all\n @services_hash = @services.map do |s|\n {service: s, medium: s.medium.map { |media|\n media.as_json.merge({ media: url_for(media) })\n }, user: s.user.username, categories... | [
{
"docid": "efd8a1f53cca7068013a767e46919eb6",
"score": "0.75621015",
"text": "def set_offer\n @offer = Offer.find(params[:id])\n authorize @offer\n end",
"title": ""
},
{
"docid": "1abf99daede4299104e14bb855c2bce2",
"score": "0.715295",
"text": "def show\n authorize @offer... |
a586e30cebc39b7299bd9180f54399e5 | This method is called to validate a queue message's signature | [
{
"docid": "8a3b9ee3b1bddda1d09d97b765175151",
"score": "0.8101296",
"text": "def validate_signature(message:, queue:)\n valid = true\n\n if queue.require_signature == true && message.signature == nil\n valid = false\n elsif message.signature != nil\n provider = ge... | [
{
"docid": "d01f3565214f2b0e1d8c5a8ff0e05b31",
"score": "0.7756876",
"text": "def check_message_signature(message); end",
"title": ""
},
{
"docid": "48e96611989e015e9ada6dc00a2d47d7",
"score": "0.7214004",
"text": "def validate\n raise \"Invalid outbound signature\" unless val... |
e7828b59df2d96a4306da24082e48788 | GET /ruby_win_sources/1 GET /ruby_win_sources/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "8be24b9e64bc5783b5dc329922ec6fae",
"score": "0.75031406",
"text": "def index\n @ruby_win_sources = RubyWinSource.all\n end",
"title": ""
},
{
"docid": "7979823eddb5f7c3dd1e22d62e88187a",
"score": "0.6785008",
"text": "def sources\n \turl = URI.parse(\"#{@base_url}#... |
9dbdf87401d864866904115209b6cc4f | Returns the document as a string with line breaks if there is more than one line. | [
{
"docid": "f9262549f0c17566eebdfc71a11be4f8",
"score": "0.0",
"text": "def execute\n command = lines.map(&:to_s).join(\"\\n\")\n\n reset!\n\n clear\n\n Vedeu.trigger(:_command_, command)\n\n command\n end",
"title": ""
}
] | [
{
"docid": "1018f3cbb164239bde2b896a7552726d",
"score": "0.6249841",
"text": "def to_s\n doc_sep = Mhtml::DOUBLE_LINE_BREAK + BOUNDARY_PREFIX + @boundary + \n Mhtml::LINE_BREAK\n super + doc_sep + @sub_docs.join(doc_sep)\n end",
"title": ""
},
{
"docid": "15fda692f07dba28... |
4dc4914d5702534f4555ceef7f819110 | control comes here to check for virus.It returns an integer value 0 if it is not virus affected else returns a nonzero value. ClamAV is needed for this. def virus_scan(file_path) clam = ClamAV.instance clam.loaddb() value = clam.scanfile(file_path) return value end | [
{
"docid": "0045c88af47a691a7aff0458cbfc6cf3",
"score": "0.0",
"text": "def get_error_status\n error_file_path = \"public/data/E\" + current_user.id.to_s\n @error_status = File.read(error_file_path)\n end",
"title": ""
}
] | [
{
"docid": "f81fb286d76d751ba30df6dc8ca02f06",
"score": "0.76606107",
"text": "def detect_viruses\n return unless original_file && original_file.new_record?\n\n path = original_file.is_a?(String) ? original_file : local_path_for_file(original_file)\n unless defined?(ClamAV)\n warni... |