query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
8ff7777b4f7fe9edb6971e9b8b8a4d7d
Obtiene todas las dudas del curso Returns : Devuelve un array con todas las dudas
[ { "docid": "103f27544c487101b7e45fd003574190", "score": "0.8392814", "text": "def dudas\n dudas_curso = []\n datos_dudas_curso = @@db[:dudas_curso].where(id_moodle_curso: @id_curso).select(:id_usuario_duda, :contenido_duda).to_a\n datos_dudas_curso.each { |datos_duda|\n dudas_curso << Duda...
[ { "docid": "60740f22800b85e9daaa5b61dc7584c1", "score": "0.68829024", "text": "def obtener_dudas_sin_resolver\n dudas_sin_resolver_curso = []\n datos_dudas_curso = @@db[:dudas_curso].where(id_moodle_curso: @id_curso).select(:id_usuario_duda, :contenido_duda).except(@@db[:dudas_resueltas]).to_a\n...
4e659acecfdf46fc2a4788ca67dff596
What is the time complexity? O(n) Fibonacci
[ { "docid": "c341374cd621bab73bb1d1d8ae377f2b", "score": "0.0", "text": "def fibos(num)\n return [0, 1].take(num) if num <= 2\n\n fibs = [0, 1]\n while fibs.length < num\n fibs << fibs[-1] + fibs[-2]\n end\n\n fibs\nend", "title": "" } ]
[ { "docid": "2962b129385aad8aecc5a5a9b131a617", "score": "0.794201", "text": "def fib(n)\n\t\t\tif n < 2\n\t\t\t\t1\n\t\t\telse\n\t\t\t\tfib(n - 1) + fib(n - 2)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "bf9f7b79d706e7e1c4fb0bbb5ec3f6eb", "score": "0.7941391", "text": "def fast_...
b866bd8c40a2a20fb52826feea82f245
Time complexity: O(n)? Space complexity: O(n)?
[ { "docid": "b170a7c19ee6e2841e22114dcbfeef19", "score": "0.0", "text": "def digit_match(n, m)\n n_dig = n.digits\n m_dig = m.digits\n \n min = [n_dig.length, m_dig.length].min\n \n return 0 if (n_dig.length == 1 || m_dig.length == 1) && (n_dig[0] != m_dig[0])\n return 1 if (n_dig.length...
[ { "docid": "5944c445a0d5d1383cd670cc84d3fc3b", "score": "0.6753821", "text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "0...
2b71f567993f2fb1ff698031783baf46
Create a new proxy instance, new real instance, and link them
[ { "docid": "d916108a1ff551fc15fce46f4230a1ae", "score": "0.0", "text": "def initialize(klass, *args, &block)\n @_build_args = [klass, args, block]\n @_lock = ::Mutex.new\n @_count_lock = ::Mutex.new\n @_accessing_threads = []\n @_locker = nil\n @_locker_count = ...
[ { "docid": "295afd59e125020d287a2274dab896c3", "score": "0.7393237", "text": "def new_proxy\n Proxeze.for __getobj__\n end", "title": "" }, { "docid": "2fee8b6952cb148fa313425c69dd580e", "score": "0.7214917", "text": "def proxy=(proxy); end", "title": "" }, { "doc...
ff2da1d79240779ab4f25f75a14cfb6a
GET /images/1 GET /images/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a830ab57c6055538be9c6c825680b7c1", "score": "0.79076755", "text": "def list params = {}\n @connection.get(build_path(\"/images/json\", params)) \n end", "title": "" }, { "docid": "9dac3d3d8052036617f7c40dd8026e1f", "score": "0.76163614", "text": "def show\n r...
2c09ef6a29c599fcc48ee32a12a13e24
New function dead with 1 argument "why". Prints the "why" and the string.
[ { "docid": "59283a561a0152ecbc9d958a9ac53bd9", "score": "0.6282188", "text": "def dead(why)\n puts why, \"Good job!\"\n#Exits the function with zero status.\n exit(0)\nend", "title": "" } ]
[ { "docid": "d53527060f96ac2343b13c7859ed7046", "score": "0.6643011", "text": "def dead(why)\n puts why, \"Good job! Bye bye!\"\n exit(0)\nend", "title": "" }, { "docid": "501121c06b255044815dc3b50427ebd0", "score": "0.63806814", "text": "def dead(why)\n puts why, \"Good job!\"\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f90922496b017066e4bf33050d3e927c", "score": "0.0", "text": "def bucket_list_params\n params.require(:bucket_list).permit(:title, :description)\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...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a5542c18db128839699c146aa31fe9c7", "score": "0.0", "text": "def admin_products_color_params\n params.require(:products_color).permit(:size_ids =>[] )\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
84882af85af3ed06afcb8fe201be2b48
Your code below this Generate a list of strings with the name and size (eg. "Alpha 30")
[ { "docid": "797577c4b7fefc70e65e8c0d0834d521", "score": "0.57175964", "text": "def company_information_strings companies\n companies.map { |company| \"#{company.name} - #{company.size}\"}\nend", "title": "" } ]
[ { "docid": "c9e9758402cc7a0c3c29b8cb04df6342", "score": "0.6678288", "text": "def generate_list(name, count); end", "title": "" }, { "docid": "10f479ceadea48be21813961602304ef", "score": "0.62730736", "text": "def pack_size_names\n return @pack_size_names if @pack_size_names\n ...
c0735337cc425e162568fd9d339e4cf8
Find the longest fish in O(n log n) time.
[ { "docid": "eaea1052ef68ec6ae87bff86aa288f99", "score": "0.0", "text": "def dominant(fishes)\n prc = Proc.new { |a, b| b.length <=> a.length }\n fishes.merge(&prc).first\nend", "title": "" } ]
[ { "docid": "a1b6d2838797ed811307c6f7afd51104", "score": "0.8433142", "text": "def linear_longest_fish(fishes)\n biggest = fishes.first\n fishes.each do |fish|\n biggest = fish if fish.length > biggest.length\n end\n biggest\nend", "title": "" }, { "docid": "f2af64c387d56af...
01da32c868d0e9c3358540a835907800
Overrides OAuth2::Clientget_token to pass in the omniauthslack AccessToken.
[ { "docid": "cd4492ba1d8e6b7896c32b3a790dd534", "score": "0.79495776", "text": "def get_token(params, access_token_opts = {}, access_token_class = OmniAuth::Slack::OAuth2::AccessToken) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n rslt = super(params, access_token_opts, access_token_...
[ { "docid": "b1233d5dfeeaabf814c624471fd043d4", "score": "0.6904561", "text": "def remote_oauth_token\n token = client_application.client_credentials.get_token(:scope => SCOPE_FOR_A_SERVICE_TO_TALK_TO_AUTHORIZATOR_SERVICE)\n raise Response::Error::AccessToken.new(data:(token && toke...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a51ebcf4269bd4f7a0380891aeda9fd7", "score": "0.0", "text": "def set_font_type\n @font_type = FontType.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...
710cd1b8102192c996b197ecf7d98eda
Note: these options serve an older API, as such they should probably never be updated.
[ { "docid": "0f03934f3005f09be4e37882d32e623e", "score": "0.0", "text": "def create_options_without_products\n {\n currency: currency,\n name: name,\n amount: amount,\n interval: interval,\n interval_count: interval_count,\n trial_period_days: ...
[ { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.77658486", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.77655315", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2",...
fd27c4fd6749f21f3ab022ea3380fd0b
Try and write the buffer to the file via non blocking file writes. If the write fails try again.
[ { "docid": "ffd601b285a4262902270491877174c1", "score": "0.69557744", "text": "def try_write(fd, buf)\n if defined?(Fcntl::O_NONBLOCK)\n s = fd.write_nonblock(buf)\n else\n s = fd.write(buf)\n end\n if s < buf.length\n buf = buf[s..-1] # didn't fini...
[ { "docid": "0c9ce7fa1db1cb42b3a756dadba619a5", "score": "0.69479716", "text": "def try_write(chunk)\n write(chunk)\n end", "title": "" }, { "docid": "375d9451799fa5f559f572cf36b1521a", "score": "0.6893729", "text": "def write_buffer_to_file(buffer, filename)\n ab...
79dd19ddd761edb6922b8616319cce62
Prepares for activity. Override this method if subclass should prepare before command activity.
[ { "docid": "e4735ca6555c1ea6b67b2c9628007879", "score": "0.0", "text": "def prepare\n Signal.trap(:INT) do\n begin\n terminate\n rescue DRb::ReplyReaderThreadError\n # ignore reply reader error\n end\n end\n end", "title": "" } ]
[ { "docid": "8bd972c951e64f70b0e459fe08cd1d03", "score": "0.6984396", "text": "def prepare()\n\t\t\t\t\t# to be overridden in subclasses\n\t\t\t\tend", "title": "" }, { "docid": "089e673b370d2f87c8923e70d28e7563", "score": "0.69267106", "text": "def prepare_command\n end", "t...
2a294e1e36219daff9d93f463387f723
POST /linetypes POST /linetypes.xml
[ { "docid": "64259ed297fce17e51d7291de3a0a11f", "score": "0.65959024", "text": "def create\n @linetype = Linetype.new(params[:linetype])\n\n respond_to do |format|\n if @linetype.save\n format.html { redirect_to(@linetype, :notice => 'Linetype was successfully created.') }\n form...
[ { "docid": "a3aeb95bf3db453d87cb99521eca1521", "score": "0.6216792", "text": "def create\n @line_type = LineType.new(line_type_params)\n\n if @line_type.save\n render json: @line_type, status: :created, location: @line_type\n else\n render json: @line_type.errors, status: :unprocessab...
7dee11e2b815e83f5448930b5af30440
GET /reviews/1/up GET /reviews/1/up.json
[ { "docid": "3def174415216596e58e1f46ae980a7a", "score": "0.0", "text": "def up\n @review = Review.find(params[:id])\n @vote = @review.votes.build(params[:vote])\n @vote.user = current_user\n @vote.point = 1\n\n @paths = @review.file\n @line = @review.line\n @project = @review.projec...
[ { "docid": "346bced07b4e691edf83f4ebac356016", "score": "0.65244603", "text": "def get_initial_reviews\n\n\t\t# return api call for just one review\n\tend", "title": "" }, { "docid": "91e761911fa4f6aab4faf4eb3fde4214", "score": "0.63734555", "text": "def upvote\n\t\t\t@review = Revie...
b3eaf32e22a9b80bfaaab2b80499a8dc
Create a new symlink
[ { "docid": "d500efe693115c6c58658ef5b33ee262", "score": "0.76954484", "text": "def create_symlink(file, link_path, backup_folder_path)\n source = \"#{Dir.pwd}/#{file}\"\n destination = \"#{link_path}/#{file}\"\n backup_file(destination, backup_folder_path)\n puts \"...symlinking from #{sourc...
[ { "docid": "53891801986564cd3a38a1b59f13c091", "score": "0.8860376", "text": "def create_symlink(dest_path); end", "title": "" }, { "docid": "d6706c5d9c24f06cb415bf56cbf1afde", "score": "0.8310286", "text": "def link(new_link_path, existing_path, symlink); end", "title": "" }, ...
2959a11b8378d9d8765c759203f5d376
GET /tipo_equipamentos GET /tipo_equipamentos.json
[ { "docid": "79d68b21e0c31168e6181b81674a581b", "score": "0.0", "text": "def index\n #@tipo_equipamentos = TipoEquipamento.all\n #@q = TipoEquipamento.ransack(params[:q])\n @tipo_equipamentos = TipoEquipamento.accessible_by(current_ability).order('tipo ASC')\n end", "title": "" } ]
[ { "docid": "d2ab76ec6ac00e5e50175b5aeac401da", "score": "0.6870426", "text": "def show\n @equipo = Equipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @equipo }\n end\n end", "title": "" }, { "docid": "6d5d9fd1864...
cdd6955333749337aa0083e01bcafeb1
rubocop:enable Metrics/AbcSize Generates a key value pair for a property depending on its type Valid options: first_level: Says if this is the first level being generated
[ { "docid": "2d45521fa691d4445cbdfb3f4c66abf8", "score": "0.46491146", "text": "def emit_manifest_assign(prop, seed, ctx, prop_field_name, opts = {})\n # Chef name field must use label_name\n if prop.name == 'name' && opts[:first_level]\n [@provider.label_name(prop.__resource),\n ...
[ { "docid": "3fa7acb3983652050aee98927e2918fc", "score": "0.577226", "text": "def property_type(**options)\n Property.derive(**options)\n end", "title": "" }, { "docid": "e88d0c15f4a0aa9eba8e691de7c0e83a", "score": "0.55633885", "text": "def generate_prop_type(key_name...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "472e7033bf6a83d1eef0376d0b2cd8b5", "score": "0.0", "text": "def orcamentoempresa_params\n params.require(:orcamentoempresa).permit(:orcamento_id, :empresa_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "ee7d8c38c0461609324815ef65b39a76", "score": "0.0", "text": "def event_params\n params.require(:event).permit(:start_date, :end_date, :duration, :name, :description, :location, :status)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
599e92d6cbf1b8bdd912dc66bfbbf7a9
true if the first name starts and ends with the same letter
[ { "docid": "836bd86a30077f8d0e811cde7e57eeda", "score": "0.86656034", "text": "def first_name_same_first_and_last_letter\n first_name[0] == first_name[-1]\n end", "title": "" } ]
[ { "docid": "672af9fc3d0d7a93a4bd9a58718ee7c2", "score": "0.7868259", "text": "def first_name_first_letter_is_a\n first_name[0] == 'a'\n end", "title": "" }, { "docid": "5dabafa5bbeb60b173aca03967fe1a5f", "score": "0.7676191", "text": "def has_middle_name\n @full_name.split(' '...
6324b382da11ed3adc5fa4d7903da8e7
Returns some internal stats about the dictionary.
[ { "docid": "e3f417af1eea84b2008c1f5f4e341499", "score": "0.7149436", "text": "def stats\n s = {}\n s['dictionary_size'] = @dict.size\n max = total = 0\n @dict.each do |n_gramm, ng_list|\n size = ng_list.length\n max = size if size > max\n total += size\n end...
[ { "docid": "efb3b4a5110b5eab3e873abc3989652b", "score": "0.7435171", "text": "def stats\n @stats ||= {}\n end", "title": "" }, { "docid": "5413c474154cd20a97915e4c1e03adb3", "score": "0.73497546", "text": "def stats\n self[:stats]\n end", "title": "" }, { "doc...
dd383a012d8779c2a634dafb49a889b1
Prepares a specific spell in a specific slot, WITHOUT ensuring that it's valid!
[ { "docid": "0952ddd87176a243c5f8e977ab2d5e42", "score": "0.6608813", "text": "def prepare_spell_in_slot_at_xy(spell_level, spell_row, spell_id)\r\r\n slot = get_spell_slot(spell_level, spell_row);\r\r\n slot[:level] = $VANCIAN_SPELL_LEVEL\r\r\n return prepare_spell_in_slot(slot, spell_id);\r\r\...
[ { "docid": "3cfba288b97e9e92d65ba1683f8f23b4", "score": "0.7066481", "text": "def prepare_spell(spell_id)\r\r\n row = get_row_by_spell_id(spell_id);\r\r\n return false unless row;\r\r\n \r\r\n ideal_slots = [];\r\r\n suboptimal_slots = [];\r\r\n row.each_with_index do |slot, i|\r\r\n ...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "183d7a0340fd2253cb5c7a183a8e1037", "score": "0.0", "text": "def update\n user = @current_user\n user.update user_params\n\n if params[:user][\"image\"].present?\n req = Cloudinary::Uploader.upload(params[:user][\"image\"])\n user.update(:image => req[\"url\"])\n end\n\n...
[ { "docid": "23a904e6ddd4b6b07c4b53353e78cf93", "score": "0.7225568", "text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "title": "" }, { "docid": "4781fa7337315133553edb54194e6202", "score": "0.7129473", "text": "def update\n render json: ...
9753d4fd56f3112b75d86e0f0510fed2
Finds the category with the given name. Returns nil if not found.
[ { "docid": "b43ec4540aac4db444b84953f994e9b8", "score": "0.64484495", "text": "def retrieve(name)\n pid = 0\n category = nil\n name.split(UseLog::SEPARATOR).each do |subcat|\n catname = subcat[0..49]\n category = UseLog.find(:first, :conditions => [\"name = :name and parent_...
[ { "docid": "a61738f256c0870b1428da75bd9249b3", "score": "0.82757187", "text": "def category(name)\n @categories.find { |c| c.name == name}\n end", "title": "" }, { "docid": "4d8772a5cc496953b88e6886d56387d3", "score": "0.8065372", "text": "def find_category(category_name, opt...
c5959a5d8c27549c341824c538a9045f
Vigenere Cipher Caesar's cipher takes a word and encrypts it by offsetting each letter in the word by a fixed number, the key. For a key of 3, for example: a > d, p > s, and y > b Vigenere's Cipher is a Caesar cipher, but instead of a single key, a sequence of keys is used. For example, if we encrypt "bananasinpajamas"...
[ { "docid": "87a0b66542b42bf350960d3e5af58725", "score": "0.74543", "text": "def vigenere_cipher(string, key_sequence, alphabet)\n #\n # your code goes here\n #\nend", "title": "" } ]
[ { "docid": "8f10907e9af2b7f98095392a278d718c", "score": "0.8304142", "text": "def caesar_cipher_encryptor(string, key)\n\talphabet = %w(a b c d e f g h i j k l m n o p q r s t u v w x y z)\n\tnew_alphabet = []\n\twrap_key = key % 26\n for char in string.split(\"\")\n new_index = alphabet.index...
1f5528c671a8e6de6047ea27ebd723a3
creates a When rule or block When blocks should return true or false whether the current resource matches what you expect: When /there (are|is an|is a|is) (.)/ do |resource, regex| resource.keys.first==regex[2] end When rules will group conditions and rules together: When there is a machine And already installed Then r...
[ { "docid": "8a3436db9ca81b2ce7fbcf6f96dfdeba", "score": "0.54106724", "text": "def When(concat, &block)\n if concat.respond_to? :content\n @condition = when_factory(concat)\n conditions << @condition\n else\n when_rules << [concat, block]\n end...
[ { "docid": "2cdef4e895fe4ed2fa04c86d11a1029c", "score": "0.62718576", "text": "def define_resource_matchers(actions, resource_types, name_attribute)\n actions.product(resource_types).flatten.each_slice(2) do |action, resource_type|\n RSpec::Matchers.define \"#{action}_#{resource_type}\".to_sym do |n...
76c4592e6450696afdca284db5e9ecf6
DELETE /physicians/1 DELETE /physicians/1.json
[ { "docid": "8d28d88eb1e9c872ea887a44df96abea", "score": "0.7784374", "text": "def destroy\n @physician = Physician.find(params[:id])\n @physician.destroy\n\n respond_to do |format|\n format.html { redirect_to physicians_url }\n format.json { head :no_content }\n end\n end", "t...
[ { "docid": "89d6dead86170adbed63c4cff4d8afda", "score": "0.7794091", "text": "def destroy\n @physician = Physician.find(params[:id])\n @physician.destroy\n\n respond_to do |format|\n format.html { redirect_to physicians_url }\n format.json { head :ok }\n end\n end", "title": "...
925285125f7dad828c249499931a7eaf
Returns an XML comment. comment("Hello, world") =>
[ { "docid": "debabaf3feff43d085b1412cd8488328", "score": "0.6636164", "text": "def comment(contents='', &block)\n contents = build(:blank, Context, &block) if block\n '<!-- %s -->' % indent(contents)\n end", "title": "" } ]
[ { "docid": "15c13b3dbb8ff87a2c269f3130f496ab", "score": "0.7965608", "text": "def comment(text)\n @xml << \"<!-- #{text} -->\"\n nil\n end", "title": "" }, { "docid": "d886e19fde6cdf2de1c31de38fb78d2d", "score": "0.7079276", "text": "def comment(text)\n @out << \"<!-- #{tex...
a3710128d8401604e4d30664b0fbbce2
Return the number of items on the stack
[ { "docid": "d5b214742d23f48f6d9a48bb30383991", "score": "0.0", "text": "def size\n @size\n end", "title": "" } ]
[ { "docid": "f3713a62ea68e7242ea22ea25f32d3a4", "score": "0.86790305", "text": "def size()\n @stack.count\n end", "title": "" }, { "docid": "4ca393aa83b624110eccf15dd3508080", "score": "0.85472274", "text": "def count\n return @stack.size\n end", "title": "" }, ...
049dd74e3022c87145fbea90b5304cc6
GET /customers/new GET /customers/new.json
[ { "docid": "4fe00685feae8dfd5b01320e7758ac88", "score": "0.7972084", "text": "def new\n @customer = Customer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" } ]
[ { "docid": "63fecd63146b9a37aaff6669de0ddb1e", "score": "0.8234244", "text": "def new\n @customer = Customer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: customers_path }\n end\n end", "title": "" }, { "docid": "ac0902c21a923b6a...
1543406d005d26ee6f7ce001718c38ba
Returns true if this student is an undergraduate at the University. A student is considered undergraduate if their +class_standing+ is <= 5.
[ { "docid": "5de216e3b018eab8e0e7e65f712281b9", "score": "0.7119379", "text": "def undergrad?\n sdb.class_standing <= 5\n end", "title": "" } ]
[ { "docid": "df996eaf4595e365dc4f4c0db5f81ac5", "score": "0.60206723", "text": "def student_only?(sfuid)\n result = roles sfuid\n if result.join(\"\").eql? \"undergrad\"\n return true\n end\n false\n end", "title": "" }, { "docid": "fc2a5d19659ff77f52...
05a4ea6c9f1621b5787a9dba92584eb3
valid? `params`: the params that were sent with the request. Validate the params sent with the request.
[ { "docid": "7c1ae7b8ba2fd8f51da1977ab51a3380", "score": "0.68829954", "text": "def valid?(params)\n # Make sure the website is a passed in param.\n unless params['website'] && given?(params['website'])\n return false\n end\n\n # Make sure the width is a passed in param.\n unless params['width'] ...
[ { "docid": "8aac0dd796a8aeda6fcf43778fbaf7fa", "score": "0.8235075", "text": "def validate_params(params)\n # This will be implemented by Validators which take parameters\n end", "title": "" }, { "docid": "67728d2aaceff6f0804ffaa0d8ae5149", "score": "0.8032505", "text...
6beb6d313ab5288a18e91bc668f67217
this test needs to be fixed by the developer and checked in
[ { "docid": "72b89a5c7a1d066530a025315f988b03", "score": "0.0", "text": "def ntest_job_condition\n assert_equal(true,@transformer.job_condition)\n end", "title": "" } ]
[ { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6795638", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6795638", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "sc...
19331d17399b741f9aa4726352f89123
Restrict with rows from another relation. Accepts only SQL relations and uses the EXISTS clause under the hood
[ { "docid": "399d3b0db958e000fc175dd2b70731f5", "score": "0.6338821", "text": "def exists(other, condition = nil)\n join_condition = condition || associations[other.name].join_keys\n where(other.where(join_condition).dataset.exists)\n end", "title": "" } ]
[ { "docid": "db05d71c67eaac0e7f35be79a301dd29", "score": "0.60512894", "text": "def having_rel(association_name, rel_properties = {})\n association = association_or_fail(association_name)\n where(\"(#{identity})#{association.arrow_cypher(nil, rel_properties)}()\")\n end", "ti...
8aae15a2522388e92dc76d0698f2c947
Gets a document from its ID.
[ { "docid": "978e01c1a4c8bdb49b90f1113efd24f4", "score": "0.82377476", "text": "def get_document(id, api, ref)\n documents = api.form(\"everything\")\n .query(\"[[:d = at(document.id, \\\"#{id}\\\")]]\")\n .submit(ref)\n\n documents.length == 0 ? nil : do...
[ { "docid": "ce2516edc40eb5f2419a0773d73cf516", "score": "0.8018258", "text": "def find(id)\n @document\n end", "title": "" }, { "docid": "6fbf72950fc2be7b5d17e88ca8ee9f55", "score": "0.7956304", "text": "def get_document_by_id(id)\n response = @client.get index: @index...
80e9e701f8053df4ad3bda48195b78fb
Actions under process Author: Pankaj Date: 15/05/2018 Reviewed By: Returns[Array] keys of action under process
[ { "docid": "76a6d65d8b98df9d3097763ac06e02be", "score": "0.0", "text": "def case_close_action_under_process(user_kyc_detail)\n return [] if user_kyc_detail.blank? || !user_kyc_detail.case_closed?\n data = []\n data << \"case_reopen_inprocess\" if @open_edit_cases.include?(user_kyc_d...
[ { "docid": "44e6ae96434d5180aff46f78d76da570", "score": "0.6710309", "text": "def current_action_names\n return @actions.find_all{|a| a.start_state == @current_state}.map{|a| a.name}\n end", "title": "" }, { "docid": "f76538b7a4825335f02ea523b8727f82", "score": "0.66210634", "tex...
5158a796523fa5a0d80b62889d36b998
probably not the best way to do it, but attempt was made before reading the LS way of doing it.
[ { "docid": "23d96a5380536140ba0339b8bbc155ee", "score": "0.0", "text": "def set_lang()\n lang = nil\n loop do\n puts \"Sprichst du Deutsch (DE)? Or do you speak English (EN)?\"\n lang = gets.chomp.downcase\n if lang.start_with?('e')\n lang = 'eng'\n break\n end\n if lang.start...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6372885", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.5549338", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
1a98c35d83c57d89cebc01fda04a46eb
CRM OBJECT_ = "Repayment_Transaction_Adjustment__c"
[ { "docid": "9330563ba0539fb061ae62153f3806eb", "score": "0.8390354", "text": "def getRepaymentTransactionAdjustmentObjName\r\n\t\t\treturn \"Repayment_Transaction_Adjustment__c\"\r\n\t\tend", "title": "" } ]
[ { "docid": "b945fd303298a724ed9e70a02e680b23", "score": "0.7304082", "text": "def getDisbursalAdjustmentObjName\r\n\t\t\treturn \"Disbursal_Adjustment__c\"\r\n\t\tend", "title": "" }, { "docid": "ccca0fe891fbb38986ec1ba5e7b6d8be", "score": "0.6623388", "text": "def getLoanPaymentTran...
f759b6ec8ea016a19c5d679eb481ee33
The long description of the bot. Can contain HTML and/or Markdown.
[ { "docid": "302e172cc53a48e04d0d2126e613eb89", "score": "0.7562774", "text": "def longdesc\n @data['longdesc']\n end", "title": "" } ]
[ { "docid": "89a3a77e90c29029e4931cd8852f9b34", "score": "0.81584007", "text": "def long_description\n text = @command.long_description\n return \"\" if text.nil? # empty description\n\n lines = text.split(\"\\n\")\n lines.map do |line|\n # In the CLI help, we use 2 spaces to d...
56e2d59c15ac955985713fe30245a32c
POST /iframe_games POST /iframe_games.json
[ { "docid": "0ca12e33c37f5b773cc3377b9d91585e", "score": "0.74608123", "text": "def create\n @iframe_game = IframeGame.new(iframe_game_params)\n\n respond_to do |format|\n if @iframe_game.save\n format.html { redirect_to @iframe_game, notice: 'Iframe game was successfully created.' }\n ...
[ { "docid": "4d908b312800186ab16b41c9aab0b3fd", "score": "0.6757502", "text": "def iframe_game_params\n params.require(:iframe_game).permit(:link, :title)\n end", "title": "" }, { "docid": "5cda7d69dd420e6014b563b98376e1f4", "score": "0.6531663", "text": "def index\n @ifram...
0d54a96126a75dca6399fd111572a983
When we search for conversations we search on the ConversationMember object This should match the updated_at variable for all users, so they are ordered correctly
[ { "docid": "e5ac36d5cb3cdfb0f07126fe13815fb4", "score": "0.6353645", "text": "def update_conversation_members\n conversation_members.each{|a| a.update_attribute(:updated_at, updated_at)}\n end", "title": "" } ]
[ { "docid": "3051476fbabc6e0ebe4e32cdde4b0ecc", "score": "0.61055183", "text": "def index\n conversations = Api::V1::Conversation.where('sender_id = ? OR recipient_id = ?', @current_user.id, @current_user.id).order('updated_at DESC').all\n \n paginate json: conversations\n end", "title": ""...
4210edf7c26e3646a4b4b363cd8f1259
GET /arbeitspaketvorgaengers GET /arbeitspaketvorgaengers.json
[ { "docid": "94afcd7d746ca73e85166670132cdeb5", "score": "0.6857685", "text": "def index\n @arbeitspaketvorgaengers = Arbeitspaketvorgaenger.all\n end", "title": "" } ]
[ { "docid": "fa1c0adcfc2b5b0a280b594b1bac8ed6", "score": "0.68106693", "text": "def index\n @egivings = Egiving.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @egivings }\n end\n end", "title": "" }, { "docid": "fc73f983604c4ea1b...
f2a412a9450c168bd557e60e6474233c
TODO detect if the old pager behavior of Pry is supported and use it through Pry.pager. If it's not then use the SimplePager.
[ { "docid": "ca589764cc7d40ed3b2e34a6c00504f7", "score": "0.77921456", "text": "def pager\n @pager ||= Pry::Pager::SimplePager.new($stdout)\n end", "title": "" } ]
[ { "docid": "52d5a3dfe1b6fb715e865a1acfa8da34", "score": "0.81550497", "text": "def pager; end", "title": "" }, { "docid": "52d5a3dfe1b6fb715e865a1acfa8da34", "score": "0.81550497", "text": "def pager; end", "title": "" }, { "docid": "52d5a3dfe1b6fb715e865a1acfa8da34", ...
9b3d0cc8c3a0df2bf140cd052cf9144d
GET /model_sections/new GET /model_sections/new.xml
[ { "docid": "e57a4188dc64d8d7d92d1d3315245cbb", "score": "0.7937748", "text": "def new\n @model_section = ModelSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @model_section }\n end\n end", "title": "" } ]
[ { "docid": "289652507b2b3201560ca987e15d5d80", "score": "0.7877456", "text": "def new\n @sections = Section.find(:all) # TODO: refactor so I don't have to repeat this all over the place\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { r...
841e983ae4589069bd0ae96f2a86cc69
POST /recurring_schedules POST /recurring_schedules.json
[ { "docid": "7cf33607aa345e1ec6db737ddc31d642", "score": "0.75811446", "text": "def create\n @recurring_schedule = RecurringSchedule.new(recurring_schedule_params)\n\n respond_to do |format|\n if @recurring_schedule.save\n format.html { redirect_to @recurring_schedule, notice: 'Recurrin...
[ { "docid": "490761003340191c1a9f660a394e1a01", "score": "0.6955073", "text": "def create\n @recurring_event = RecurringEvent.new(recurring_event_params)\n\n respond_to do |format|\n if @recurring_event.save\n @recurring_event.schedule_recurring_events.each do |event|\n @recurr...
9578b5b77fda7235b163515788e0466b
check if the hover class needs width and height if the hover class has the same width and height property with not hover class, then the hover class does not need width and height
[ { "docid": "49b9c975e338c6f69e83256f94ece9f5", "score": "0.4764645", "text": "def need_wh?(image, directory)\n\t#allways return true\t\n\t\t#name = get_image_name(image, directory)\n\t\t#if hover?(name) or active?(name)\n\t\t\t#not_file = image.filename.sub(/[_-](hover|active)\\./, '.').sub(/[_-](hover|...
[ { "docid": "597a715ddac94a8c4ab2d74befe8b4e8", "score": "0.62029785", "text": "def has_hover?(name)\n !image_for(\"#{name}_hover\").nil?\n end", "title": "" }, { "docid": "d456157242440cc0144cf74ea7345799", "score": "0.58598334", "text": "def hovered?\n end", ...
05a95074cbe172290c17d12dc1df7577
Instance Methods (Images) Provides a fallback Gravatar image based of the User email address
[ { "docid": "40f38ca0fc2c6c8e1f1ad03597a46eec", "score": "0.75780696", "text": "def gravatar_image(size = 128)\n Gravatar.gravatar_image_url(email, size)\n end", "title": "" } ]
[ { "docid": "53383a7dbfc4f46af05fb95234f1a50b", "score": "0.7969717", "text": "def gravatar_for(user)\n gravatar_id = Digest::MD5::hexdigest(user.email.downcase)\n gravatar_url = \"https://secure.gravatar.com/avatar/#{gravatar_id}\"\n image = image_tag(gravatar_url, alt: user.first_name, class: ...
b2135831ec0e164206cafd655e483de4
GET /groups/1 GET /groups/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7761dcbf8079fbe8d9838f059e843811", "score": "0.80157125", "text": "def groups\n @page = 'groups'\n respond_to do |format|\n format.html {\n @groups = Group.find(:all)\n }\n format.json { }\n end\n end", "title": "" }, { "docid": "1f843b01e13360c014...
17f05fa42e976c8f2fd67c10250f415c
INDIVIDUAL JOB LOCK CONVENIENCES A couple quickies to make our life easier when dealing with setting a lock for a job that is currently being processed.
[ { "docid": "052a73c1e0adcfe0b23c4af23b931ce6", "score": "0.0", "text": "def set_expiring_key(job)\n lock_key = job_lock_key(job)\n redis.setex(lock_key, job_lock_duration, \"\")\n end", "title": "" } ]
[ { "docid": "9015ce66607cdf21212cffd93ab5b8e3", "score": "0.69867903", "text": "def lock!(key = nil)\n lock = Digest::SHA1.hexdigest @options.to_json\n lock = key if key\n if locked?(lock)\n messages = [\"Waiting at #{Time.now} due to existing job\"]\n job_status('s...
6145f0b2ef42a0ff7010a35742664292
This method is called after config_params have read configuration parameters
[ { "docid": "0197ab03cb49d5e3b013187c2434798d", "score": "0.0", "text": "def configure(conf)\n super\n\n if conf['time_xpath'].nil?\n @time_xpath = nil\n else\n @time_xpath = json_parse(@time_xpath)\n end\n @time_parser = Fluent::TimeParser.new(@time_format)\n ...
[ { "docid": "305605901d893e36fe63bb24be282f72", "score": "0.6828409", "text": "def config=(config); end", "title": "" }, { "docid": "7f99389baa4f4f3bcc4bdd8f811c7db6", "score": "0.6779348", "text": "def after_config_update(*_)\n config[:parameters] ||= Smash.new\n config...
704bde683236e35b0f3db9c4514490e0
def count_sentences i = 0 self.split.each do |word| if word.sentence? || word.question? || word.exclamation? i += 1 end end i end def count_sentences self.split.each_with_object([]) do |word, sentence_arr| if word.sentence? || word.question? || word.exclamation? sentence_arr << word end end.count end OPTIMIZE :)
[ { "docid": "65a0bbf33ce25478da18c78fd894843e", "score": "0.85527354", "text": "def count_sentences\n self.split(/[.?!]\\s/).count\n end", "title": "" } ]
[ { "docid": "4fb21bb2f81c4064f809cae7d0aec694", "score": "0.9148612", "text": "def count_sentences\n counter = 0\n self.split(\" \").each do |word|\n if word.question? || word.sentence? || word.exclamation?\n counter +=1\n end\n end\n counter\n end", "title": "" }, { ...
c46703750a3e8c9216f47875aed2d717
POST /jobs POST /jobs.json
[ { "docid": "709f99a9728ebab627ef39f12528712b", "score": "0.0", "text": "def create\n @task = Task.new(task_state: TaskState.where(name: \"Pending\")[0] )\n\n if params[:all]\n # get task IDs from system, map to strings\n @task.concrete_package_versions << System.find(params[:system_id])....
[ { "docid": "2d09372c21c7a4259d28cc4d7e820739", "score": "0.74641937", "text": "def create\n @job = current_user.posted_jobs.build(job_params)\n if @job.save\n render json: @job\n else\n render json: @job.errors.full_messages, status: :unprocessable_entity\n end\n end", "title"...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.81046426", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0ed4d2cc4be09b091d4a7f087acd31be", "score": "0.0", "text": "def set_dummy1\n @dummy1 = Dummy1.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...
0650ac84a60ef809699dc036fef64420
new method to make all scene can call gab window
[ { "docid": "e96359aa15bbdf6b3eef3a45fa4f68ae", "score": "0.60879296", "text": "def setup_gab_window(text, graphic = nil, index = nil, mode = nil)\n @gab_window.setup(text, graphic, index, mode)\n end", "title": "" } ]
[ { "docid": "450ae9711226c9e274af47f3e0572ccb", "score": "0.67538995", "text": "def start_game\n @window.show_all\n Gtk.main\n end", "title": "" }, { "docid": "1fd0521b964945b310cddcbca3b5f485", "score": "0.6567896", "text": "def main\n # create spriteset\n @spriteset = S...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3af8902c0d757062c4a879f0d1633d15", "score": "0.0", "text": "def organization_charge_params\n params.require(:organization_charge).permit(:organization_charge_total_id, :organization_customer_id, :organization_id, :user_id, :price_shebao_base, :price_shebao_qiye, :price_shebao_geren, :pr...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980957", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783065", "text": "def strong_params\n params.requi...
c385c47630dbf9e6e23fadb244a4c765
Find a single QR Code chunk from this collection based on its ordinal position
[ { "docid": "0c14133e0edeae01e7b4bcdfb8683387", "score": "0.66486484", "text": "def code_by_ordinal(num)\n chunks.find { |ch| ch.ordinal == num }\n end", "title": "" } ]
[ { "docid": "0efe602db288c7c8197fa168ce1a76d8", "score": "0.5865913", "text": "def getCard(pos)\n @cardsShown[pos].get_code\n end", "title": "" }, { "docid": "cba2ac74622bc49fbd00a0d52adde4a7", "score": "0.55413574", "text": "def findPiece(pieceIndex)\n leftOffset = @pieceSiz...
1a3a7e779b0da943d61cf02b9630c367
A typical Puppet YAML fact file looks like this: ``` !ruby/object:Puppet::Node::Facts name: your.fqdn.com values: key1: val1 key2: val2 ``` To avoid loading in all of Puppet just to parse what is basically a plain YAML file, this method strips off the first line and unindents all of the remaining lines to make it a pla...
[ { "docid": "6c3ebc12dd624ca295b89b5e6f88908d", "score": "0.70130235", "text": "def modify_and_load_yamlfile(filepath)\n content = File.read(filepath).split(/[\\r\\n]+/)\n first_line = content.shift\n unless first_line == '--- !ruby/object:Puppet::Node::Facts'\n raise HieraS...
[ { "docid": "f0af9b160f55fdbc514fe95bf96892bb", "score": "0.6397388", "text": "def cli_helper_process_yaml(file_contents='')\n a_hash = YAML.load file_contents\n return a_hash\n end", "title": "" }, { "docid": "7625cf1c887f87f30db4c1b13c61e7ed", "score": "0.62240046", "text": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dff036199badc0d623bfc0845ee881a1", "score": "0.0", "text": "def set_beat\n @beat = Beat.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
f77126acb88d058d05c772793f012d46
GET /retailers/1 GET /retailers/1.json
[ { "docid": "faa0c86c122b19354ae28d4d825283f9", "score": "0.6435224", "text": "def show\n # @retailer = Retailer.find(params[:id], :include => [:deals, :advertisements, :account] )\n respond_to do |format|\n format.html # show.html.erb\n format.json # show.json.rabl\n end\n end", ...
[ { "docid": "c346452866b2e8cafc36373d09c79dec", "score": "0.76396954", "text": "def index\n @retailers = Retailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "title": "" }, { "docid": "fb0028b4b66d18...
b2688f8eefe85d3c0296967a53f6c95c
Returns all Nodes defined in a Line
[ { "docid": "7c6ca15e11129e0a9839e6715650723e", "score": "0.6514825", "text": "def collect_nodes(line)\n\t\tGpNode.add_nodes(line.split(\"#{line.split(' ')[1]}\")[1].strip.split(\",\"), @system)\n\t\treturn line.split(\"#{line.split(' ')[1]}\")[1].strip.split(\",\")\n\tend", "title": "" } ]
[ { "docid": "b6d88fe311fdbe9d3dab91bc68ff9751", "score": "0.64284086", "text": "def nodes\n @nodes ||= each_node.to_a\n end", "title": "" }, { "docid": "a0a38b8bd26540884cd790898baae7d2", "score": "0.6315707", "text": "def nodes\n []\n end", "title": ""...
a24ece4d64fb11cc259808328e5ee40e
Constructs the multipart/formdata required to sideload packages
[ { "docid": "303f9dbe4b78aaeb00391f68dcee3051", "score": "0.7297862", "text": "def generate_multipart_form_data(snap_name, action, options, path, content_length)\n snap_options = options.map do |k, v|\n <<~SNAP_OPTION\n Content-Disposition: form-data; name=\"#{k}\"\n\n ...
[ { "docid": "24e57f58616ee1ddf1352f49b65a7dbd", "score": "0.76396644", "text": "def request_data\n query_params = build_query()\n\n case @enctype.downcase\n when /^multipart\\/form-data/\n boundary = rand_string(20)\n @enctype = \"multipart/form-data; boundary=#{boundary}\"\n\n de...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a43900ef2568dfaba102434c7d9c4527", "score": "0.0", "text": "def set_list_item\n @list_item = ListItem.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...
5a96784e7c8e7b19f71c8be37e8e4e7a
List of interfaces that crowbar will not manage These interfaces are not part of any conduit for this node.
[ { "docid": "a085a9b80ea2fd1d9675899b67db07c4", "score": "0.77628213", "text": "def unmanaged_interfaces\n if_list = cr_ohai_network.map { |x| x[0] }\n\n conduit_to_if_map.each do |conduit_name, conduit_def|\n next unless conduit_def.key?(\"if_list\")\n\n conduit_def[\"if_list\"]....
[ { "docid": "e81e98a90b53242a8ec1eecae0f77874", "score": "0.77445555", "text": "def list_inactive_interfaces\n connection.list_defined_interfaces\n end", "title": "" }, { "docid": "1f2ead1c42f689af1e1bfa1db516ad24", "score": "0.72106075", "text": "def GetAllNonDialUpInterfaces...
8fea7d27b23e0a67c941dac7259b9187
Probability of bigram's occurance in the corpus.
[ { "docid": "a1e11dd4aa7e7f86d1ec92c7046a6ff8", "score": "0.6757227", "text": "def file_probability(word1, word2=nil)\n bigram = (Bigram === word1 ? word1 : get(word1, word2))\n BigDecimal.new(bigram.files.size) / analysis.files.size\n end", "title": "" } ]
[ { "docid": "c5f8e8db8052635bcb843ae98f94edcd", "score": "0.7525785", "text": "def probability(word1, word2=nil)\n bigram = (Bigram === word1 ? word1 : get(word1, word2))\n BigDecimal.new(bigram.count) / total #size\n end", "title": "" }, { "docid": "996366a3df1456305ce699d...
06557e61c0e22401f5f46e5ee4631479
Initializes the object state prior to attribute processing; this is called only from construct_document.
[ { "docid": "6bcc7de7e028ecfb3d447759196bbc3b", "score": "0.6599029", "text": "def prepare_to_process_attributes\n @new_record = true\n @attributes ||= {}\n apply_pre_processed_defaults\n apply_default_scoping\n end", "title": "" } ]
[ { "docid": "4b57fca5c0a368895d48b9d56636212c", "score": "0.7152199", "text": "def init_attr\r\n end", "title": "" }, { "docid": "991bee07aa9b9bf76f7c860030636367", "score": "0.71063316", "text": "def pre_initialize\n end", "title": "" }, { "docid": "b8054791e1af76...
7f376561f909519d005044211de4c5db
Sets the attribute public
[ { "docid": "7bd5356eeef756cc47f27fed2b48f984", "score": "0.61811304", "text": "def public=(_arg0); end", "title": "" } ]
[ { "docid": "95b74ccc3fcf401b277d361c5ff4fccb", "score": "0.7590517", "text": "def make_public\n update_attribute( :is_public, true )\n end", "title": "" }, { "docid": "64dc611755c8adf6ae2f0dc9b7b0d982", "score": "0.71637887", "text": "def is_public=( f )\n self.update_item_fla...
21e258ba117a29907dba1771812cbab1
The Following helper is used to generate links to specific commits. It uses the above helper.
[ { "docid": "7905b5d0dc47e2941ecfa299bbadfb41", "score": "0.6260652", "text": "def print_github_commit_link(this_project_title, my_sha)\n print_github_project_link this_project_title + \"/commit/\" + my_sha\n end", "title": "" } ]
[ { "docid": "7ed0f0df934ad52805d3dc9a773bad8d", "score": "0.6962517", "text": "def run(content, params={})\n link_to_commits = item[:link_to_commits] || false\n if !link_to_commits\n return content\n end\n\n warn \"Linking commits\"\n\n github_username = item[:github_username]\n re...
09489de536a279fcdcdd9e4d1d0ffb67
e^x taking into account the error thus far (I think) gsl_sf_exp_err_e
[ { "docid": "1ac4e785d88aa30456cc91bcf676d50c", "score": "0.65788114", "text": "def exp_err(x, dx)\n adx = dx.abs\n raise(\"Overflow Error in exp_err: x + adx > LOG_FLOAT_MAX\") if x + adx > LOG_FLOAT_MAX\n raise(\"Underflow Error in exp_err: x - adx < LOG_FLOAT_MIN\") if x - adx < LOG_FLO...
[ { "docid": "371433e43592f8aa3359aa05dbff5088", "score": "0.6317", "text": "def erfc_e(x, with_error = false)\n Erfc.evaluate(x, with_error)\n end", "title": "" }, { "docid": "c0db09f6764785a014b758650db14328", "score": "0.61507773", "text": "def exp(v); Math.exp(v); end", ...
679fedeff2872a2f62e6cdb23a7b5955
Returns the code for outputs linking. This code depends on dxpy package and needs to be run with python2.
[ { "docid": "fb1dca3b3b5f724a803dc8efe1146058", "score": "0.76826787", "text": "def link_outputs\n <<~CODE\n # Link CWL job outputs with pFDA outputs (using python2)\n PYTHONPATH=$DNANEXUS_HOME/lib/python2.7/site-packages python2 <<EOF\n import os\n im...
[ { "docid": "a58c8df1a73b80da1258ad9866b7469e", "score": "0.66290313", "text": "def linking\r\n linkcmd = ''\r\n objlist = ''\r\n\r\n # unroll objects list to string.\r\n FileList.new( @out[:obj] + '/*.o' ).each do |o|\r\n objlist += \" #{o}\"\r\n end\r\n \r\n ca...
3304072644c43eac96f878d32c670d13
Returns all response domains in order
[ { "docid": "f5c949d9e2d97875b85d2ecc302a27fb", "score": "0.7272568", "text": "def response_domains\n grid_rds_qs.map { |x| x.response_domain }\n end", "title": "" } ]
[ { "docid": "df59d722a73ebe332b5d4eb5e6e70958", "score": "0.76679957", "text": "def response_domains\n self.response_domain_datetimes.to_a + self.response_domain_numerics.to_a +\n self.response_domain_texts.to_a + self.response_domain_codes.to_a\n end", "title": "" }, { "docid": "d...
e11e525f26bea7a10ab46da2286d0907
Return the Treequel::Schema::MatchingRule that corresponds to the SUBSTR matchingRule of the receiving attributeType.
[ { "docid": "704ef29f1a013613bdcb46834ef8c363", "score": "0.71275675", "text": "def substr_matching_rule\n\t\tif oid = self.submatch_oid\n\t\t\treturn self.schema.matching_rules[ oid ]\n\t\telsif self.sup\n\t\t\treturn self.sup.substr_matching_rule\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "title...
[ { "docid": "132cdcdd26434eb7458f09f53fb45882", "score": "0.54769045", "text": "def rule_type; end", "title": "" }, { "docid": "3b67f204d296e7d0b15d80d4debb016b", "score": "0.54344803", "text": "def parse_rule(s, type); end", "title": "" }, { "docid": "53a84266b3665293064c...
59f9a3f81813919bff4cbb4a42809e1f
If element don't have anything in the corresponding previous key that means its head
[ { "docid": "de5d9aefb5f982a790ddbf29925b91c3", "score": "0.585707", "text": "def swap(_first_key_previous, _first_key_element, _second_key_previous, _second_key_element)\n if _first_key_element.present? and _second_key_element.present?\n if _first_key_previous.blank? #Frist key element is head e...
[ { "docid": "03e5493842d3cb0cea21bd430b704985", "score": "0.6737062", "text": "def prev node_or_key\n key = String.new\n case node_or_key\n when Node\n key = node_or_key.key\n when String\n key = node_or_key\n else\n p \"only accept String or Node...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "cbf26d3029eac3cce7867a39383ed5c8", "score": "0.0", "text": "def driver_params\n params.require(:driver).permit(\n :search,\n :updated_at,\n :reports,\n :first_name,\n :last_name,\n :latitude,\n :longitude,\n :current_city,\n :current_state,\n ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
01e68d5af46fd4b98e80cea5cd33e4e0
timer expired && no available posts
[ { "docid": "cdc38d0a4601ef1e5aacae51e30c8c3e", "score": "0.0", "text": "def output_5\n @button = false\n @small_message = \"Your response expired #{expiration} ago. \n There are currently no unanswered posts available. Get posting!!\"\n end", "title": "" } ]
[ { "docid": "e0d32062430f0fdd2f97565b1fbb93ba", "score": "0.70405024", "text": "def spam_free\n # order all the posts reverse chronologically\n # the latest post\n # get the posted time for the latest post\n last_post = Post.order(:created_at).last \n # latest_time = last_post.created_at\n\n #goal:...
b999095ac529a1de579a70eabc5387c0
quiery's player for a move or they may forfeit
[ { "docid": "1f68f7d09ae3f91b3c72b103ee2d96e6", "score": "0.0", "text": "def get_move(player)\n print \"#{player} select a piece to move :\"\n position1 = gets.chomp\n if position1 == 'forfeit'\n return false\n end\n print \"Where would you like to move?: \"\n position2 = gets.ch...
[ { "docid": "10962cd7a62058100e6a50c861e4ee24", "score": "0.7293551", "text": "def onalg_player_has_moved(player,move)\n if player != @alg_player\n \n end\n end", "title": "" }, { "docid": "46d1e4ae7142e25ef9d9996778d538c6", "score": "0.71029764", "text": "def player_moved...
0783d9126f0815d7e58a8f3bf616f63c
Merges the current context with other one, modifiying it. If the other context defines the same value, it will override the current value.
[ { "docid": "7f00757ee3c4095efd2f0108393bec89", "score": "0.7018932", "text": "def merge!(other_context)\n \n other_context.each_pair() do | key, value |\n if(value == nil)\n set_key(key, nil)\n elsif(get_key(key).respond_to?(:merge) and value.respond_to...
[ { "docid": "5417f43c9c2978efbe665f14a5f0365f", "score": "0.75183773", "text": "def merge(other_context)\n return dup().merge!(other_context)\n end", "title": "" }, { "docid": "7ae5ebcb2f497293e3c246660cfbff9f", "score": "0.6531701", "text": "def merge!(other)\n other...
2d30b7481813fa2c20db71434af17f6b
Renders the show page.
[ { "docid": "7afe78aa8fb1f1a4cc1a8183a6d389cd", "score": "0.0", "text": "def show\n\t\t@disabled\t= @course.disabled_assignments(@current_user)\n\t\t@upcoming \t= @course.upcoming_assignments(@current_user)\n\t\t@undated \t= @course.undated_assignments(@current_user)\n\t\t@past \t\t= @course.past_assignm...
[ { "docid": "89e2fd10db3b13d099c9cce94a94680b", "score": "0.773187", "text": "def show\n render:show\n end", "title": "" }, { "docid": "e79974c609a7aa7bd1ef77dca0df4d74", "score": "0.7685816", "text": "def show\n #render show\n end", "title": "" }, { "docid": "485c...
74f3eff2c5c1674b8c374edd579e6d37
Push the given id onto the bottom of the list.
[ { "docid": "c4fe0153502d3056e0dc7f62ea8c4de5", "score": "0.64564973", "text": "def push!(id)\n redis.multi do\n redis.rpop(@key)\n redis.rpush(@key, id)\n redis.rpush(@key, '*')\n end\n end", "title": "" } ]
[ { "docid": "c2ae68d1648339f51dc7d9332955d5f5", "score": "0.8035443", "text": "def move_to_bottom(id)\n redis.multi do\n remove(id)\n push!(id)\n end\n end", "title": "" }, { "docid": "52d4a435598412d3c3d3fe9113be8309", "score": "0.69025296", "text": "def pu...
abdbe5147a124d05e965458e737fd82f
View a specific pokemon's data
[ { "docid": "bc333aaf8cad44d0b43b763cd4bcaa63", "score": "0.674525", "text": "def view\n @pokemon = get_pokemon_from_request\n if @pokemon == nil\n render :json => {\n :error => \"Pokemon not found\"\n }, :status => 404\n return\n end\n\n render json: @pokemon, :status =...
[ { "docid": "95fd432e086e69ef5fbf3809fcc800b7", "score": "0.81454927", "text": "def show\n @pokemon = Pokemon.find(params[:id])\n end", "title": "" }, { "docid": "95fd432e086e69ef5fbf3809fcc800b7", "score": "0.81454927", "text": "def show\n @pokemon = Pokemon.find(params[:id])\...
d092d595c24964e8972e3922a470b405
we can also access a class variable w/i an instance method:
[ { "docid": "57cf684514ddbe66329fdf1144e80ece", "score": "0.0", "text": "def total_number_of_phones\n @@total_number_of_phones\n end", "title": "" } ]
[ { "docid": "41d7c8a84b2a096a33a31f5912ecec05", "score": "0.7459806", "text": "def instance_var\r\n @instance_var\r\n end", "title": "" }, { "docid": "9f05e06134c38bda583122ff542952a2", "score": "0.7368212", "text": "def instance_var\n @instance_var\n end", "title": "" }...
d5e88d7a681640d4a6d2102ecb3810b4
Instantiation and access. Get copy of parameter hash with parameters bound to this form.
[ { "docid": "172d96e896138ab6e17e79d2f09aac93", "score": "0.7362284", "text": "def bound_params\n hash = {}\n self.class.form_params.each{ |name, param| hash[ name ] = param.dup.bind( self ) }\n hash.freeze\n end", "title": "" } ]
[ { "docid": "1cd1b007c4691acb5a0c4c6fc2faf24d", "score": "0.72719836", "text": "def parameter_hash\n @parameter_hash\n end", "title": "" }, { "docid": "abe1fdd5b8983535f8316ad5f64cd27a", "score": "0.69444925", "text": "def hash\n @parameters.hash\n end", "t...
2f6aa11e48589025007e48faf9482503
GET /file_links GET /file_links.json
[ { "docid": "0c2bd24dbc85fb8786565aeec370d980", "score": "0.72756565", "text": "def index\n @file_links = FileLink.all\n end", "title": "" } ]
[ { "docid": "9678529c1b0c1aa61ea6aa88b325f1ca", "score": "0.7097361", "text": "def links\n {\n show: file_path(object),\n rename: api_file_path(object),\n }\n end", "title": "" }, { "docid": "e51e22ad04837dcbf22a59be734ee436", "score": "0.6541884", "text": "def link\n...
51ba5af5a2ba88c07ef699ada2c301fd
PATCH/PUT /cities/1 PATCH/PUT /cities/1.json
[ { "docid": "a713df1811fb089c7f9132d5f8242016", "score": "0.59824437", "text": "def update\n if @city.update city_params\n redirect_to cities_url\n else\n render 'edit'\n end\n end", "title": "" } ]
[ { "docid": "0c147569976df49c1fd916abf80f35ee", "score": "0.6734544", "text": "def update\n respond_to do |format|\n if @city.update(city_params)\n format.json { head :no_content }\n else\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n ...
0185fcdd57ef651d90f40b7a1d2588a7
GET /otrunk_example_otrunk_view_entries/1 GET /otrunk_example_otrunk_view_entries/1.xml
[ { "docid": "805a7e36cfa417c4080f9f909b92ac03", "score": "0.76765996", "text": "def show\n @otrunk_view_entry = OtrunkExample::OtrunkViewEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @otrunk_view_entry }\n end\n end", ...
[ { "docid": "05686dd0219b373c297ab4291c772b18", "score": "0.6957702", "text": "def show\n @otrunk_import = OtrunkExample::OtrunkImport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @otrunk_import }\n end\n end", "title": ...
6afc54f56742d49b0f5b0dabd2bfd7c2
return a random street address
[ { "docid": "ab166a11fdd4951d480f239463aec25c", "score": "0.7761546", "text": "def street_address\n Faker::Address.street_address\n end", "title": "" } ]
[ { "docid": "ec22de9714930b26e3f4730630903cca", "score": "0.8543571", "text": "def street_address\n number = rand(1..9000)\n street = Dictionary.animals.sample\n street = street.split(\" \").map! {|word| word.capitalize! }.join(\" \")\n \"#{number} #{street} #{Dictionary.addresses.sam...
ddcf63cfd59d9def473cd8f343b3d7f7
method that matches uploads to operations with a temporary[filename_key]
[ { "docid": "7d98af922b6da5d340268e080f89baf8", "score": "0.6878121", "text": "def match_upload_to_operations ops, filename_key, job_id=nil, uploads=nil\n def extract_basename filename\n ext = File.extname(filename)\n basename = File.basename(filename, ext)\n end\n ...
[ { "docid": "4d251a4906696b1f727c2736193095e7", "score": "0.7030484", "text": "def match_upload_to_operations ops, filename_key, job_id=nil, uploads=nil\n def extract_basename filename\n ext = File.extname(filename)\n basename = File.basename(filename, ext)\n end\n ...
7b6980cff5ceaee08fbdf81b4f7ecb43
Gets fill format of the ChartArea of a chart chart_index
[ { "docid": "132accc8e39aa4f58dd29f4a5ceb5714", "score": "0.7579569", "text": "def get_fill_format(chart_index)\n begin\n if(@filename=='')\n raise \"Base file not specified\"\n end\n if(@worksheetname=='')\n raise \"Worksheet is not specified\"\n end\n ...
[ { "docid": "3d48aead3782799a435d9381747410bf", "score": "0.6687851", "text": "def get_chart_area(chart_index)\n begin\n if(@filename=='')\n raise \"Base file not specified\"\n end\n if(@worksheetname=='')\n raise \"Worksheet is not specified\"\n end\n ...
3d4e2e69fadf37ef302d581ff855b33f
str Your string with desierd continent. char Character you want to know position of Examples index_of_char("hej hopp", "o") => 5 Returns position of character.
[ { "docid": "c54133817a517954b58020b3b4022f61", "score": "0.80079854", "text": "def index_of_char(str, char)\n output = 0\n i = 0\n while i < str.length\n if str[i] == char\n output = i\n return output\n end\n i += 1\n end\n return nil\nend", ...
[ { "docid": "e138da79fe65e6b22b3309b7162192cf", "score": "0.8539313", "text": "def index_of_char(str, char)\n\ti = 0\n\twhile i < str.length - 1\n\t\tif char == str[i]\n\t\t\treturn i\n\t\tend\n\t\ti += 1\n\tend\n\treturn nil\nend", "title": "" }, { "docid": "ba6fda468b68c038bb06fd5903b4a15b"...
66e21a458b23cce0f48c359b9d8b7d7d
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
[ { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.0", "text": "def context; end", "title": "" } ]
[ { "docid": "d1758edd04b6374162470ca44c3f1250", "score": "0.6871894", "text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n ...
caa4a747b575b3a1e0f6c8a9ab063f41
List certificates List all certificates.
[ { "docid": "eea347e5c5667de781ba2db397d106f8", "score": "0.57432425", "text": "def list_tls_bulk_certs(opts = {})\n data, _status_code, _headers = list_tls_bulk_certs_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "62a340fdc3132f490873da875da0a4da", "score": "0.8116797", "text": "def list\n cert_list(certstore_handler)\n end", "title": "" }, { "docid": "e33d77a7c82f926a92cdfff3a5d3dfe2", "score": "0.79025644", "text": "def list\n Puppet::SSL::Certificate.search(\"*\")...
fabf61253e7fc77324e19c9f0b5d11e1
Writes a normal message to STDOUT and logs to the file.
[ { "docid": "481699ecc0a5d65130e326f7bac176bf", "score": "0.721507", "text": "def write(message)\n log message\n STDOUT.puts message\n end", "title": "" } ]
[ { "docid": "527ef0e5ba3facb72b17cc7d648d246a", "score": "0.6854911", "text": "def logging msg\n File.open(@log_file, \"a\"){|f|\n f.puts \"[#{Time.now}] #{$0}: #{msg}\"\n }\n end", "title": "" }, { "docid": "b000b504cddb6778c75f56727db40b4e", "score": "0.6829888", "text":...
572116cf03e2d5f7ed5be1247ed00c2e
No floats or empty arrays will be passed. For example, when an array is passed like [19, 5, 42, 2, 77], the output should be 7. [10, 343445353, 3453445, 3453545353453] should return 3453455. Hint: Do not modify the original array.
[ { "docid": "07eacfaa26bee30074c8f20779170df2", "score": "0.0", "text": "def sum_two_smallest_numbers(numbers)\n smallest = nil\n second_smallest = nil\n numbers.each do |x|\n if second_smallest == nil || x < second_smallest\n if smallest == nil || x < smallest\n second_smallest = small...
[ { "docid": "d750be073ec66321c54f7e44a44f0a61", "score": "0.67883325", "text": "def sum_only_numbers(an_array)\n temp = an_array.map {|x| x.is_a?(Numeric) ? x : nil }.compact\n temp.inject(0) {|sum, i|sum + i}\nend", "title": "" }, { "docid": "fc3bf65e225e0bae07c596c5c86c95a6", "score": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "54c9fb81d9a357a832d26f331c793c1c", "score": "0.0", "text": "def student_params\n params.permit(:first_name, :last_name, :phone_number)\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...
557ec59127e5c4a4c9c17a991e96324f
GET /documents GET /documents.xml
[ { "docid": "606e8a2b5140b4fb2b5721b95f9e5a03", "score": "0.64463854", "text": "def index\n @documents = Document.find(:all).select{ |doc| current_user.can?(self, :show, doc) }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documents }\n end\n...
[ { "docid": "d2a99e8da401980123ae247607b6ca45", "score": "0.7474943", "text": "def documents(params={})\n server.get(\"#{name}/_all_docs\", params)\n end", "title": "" }, { "docid": "c474703b08fb92e1e7da383246cd53e9", "score": "0.71415854", "text": "def index\n @docs = Doc....
d8e0f93902e5c42589f4f3b7699d10ef
specific to each provider
[ { "docid": "923253a25abff15085fd56ae52a08f04", "score": "0.0", "text": "def lands_hash\n []\n end", "title": "" } ]
[ { "docid": "e21095589b2ef7011ea0624bbe61b7fb", "score": "0.7760506", "text": "def provider\n\tend", "title": "" }, { "docid": "8a77c1770835602bded28e5b727a44de", "score": "0.7637826", "text": "def provider; end", "title": "" }, { "docid": "28c9855c3a06f20fb8e9cd32ecb545d3...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a90fda2ff2c6350d8c70644572d08984", "score": "0.0", "text": "def set_lecture\n @lecture = Lecture.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...