query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d7415c8f0de3c12e55a60051a7b21b26
Never trust parameters from the scary internet, only allow the white list through. def staffhour_params params.require(:staffhour).permit(:week_end_date, :staff_id, :hours, :wk_accrued_hours, :accruel_rate_id, :accruel_rate_attributes => [:id, :rate, :effective_date]) end
[ { "docid": "d727d48501bff52f63d97d1d304b5e34", "score": "0.0", "text": "def get_tronc_start\n Tronc.where(status: \"Current\").first.start_date\n end", "title": "" } ]
[ { "docid": "43504143b9a29fab269d750071b6e0c7", "score": "0.7992867", "text": "def employee_workinghour_params\n params.require(:employee_workinghour).permit(:employee_id, :working_hour_id)\n end", "title": "" }, { "docid": "9477773657d844263c058bb00435b96e", "score": "0.7889158",...
26d7266f97293bd9ffbcaf2f9ab6d012
All Text search configuration, used by main search pulldown.
[ { "docid": "d0b7603e574e0bafad202c22dadb0cff", "score": "0.62702626", "text": "def configure_keyword_search_field(config, opts = {})\n field_name = ActiveFedora::SolrService.solr_name('all_text', :searchable, type: :text)\n return false if config.search_fields[field_name]\n config.add_search_fi...
[ { "docid": "587e714fe14228c382a24f2a59d1a657", "score": "0.6871805", "text": "def config_text\n owner.search_attrs\n end", "title": "" }, { "docid": "c4837c5864507c06198914639dcf0502", "score": "0.6785894", "text": "def search_cfg\n @search_cfg ||= begin\n communi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "da2caf1525f43ae90c8e4c56e488a1b7", "score": "0.0", "text": "def set_artwork\n @artwork = Artwork.friendly.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...
f0ef998d9c9f680aff5c6d37098298bc
Confirms a loggedin user.
[ { "docid": "a23291d46f1642138405bc6af66dfea9", "score": "0.0", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Identificate HUMANO.\"\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "71b4815350ad43bbdc0f6266ba0d6a96", "score": "0.6876832", "text": "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere ...
5dc6061e9b21a7da1808d8016e6d3b35
Gets the field property value. Computes aggregation on the field while the field exists in current entity type. Required.
[ { "docid": "2985b0eac1e3120cd4181fd1c14b5cd1", "score": "0.61103565", "text": "def field\n return @field\n end", "title": "" } ]
[ { "docid": "a31182a070ca1eb3839b6c349369234c", "score": "0.67967033", "text": "def get_value(field)\n field = item_type.find_field(field) unless field.is_a? Field\n field.value_for_item(self)\n end", "title": "" }, { "docid": "13e68cbb745b2b004081bd54962bdd4d", "score": "0.6744517...
be57eff65310d8c5b3b7e0cc52c0308c
Author:: Jon Tirsen, 2006 Modified by:: Unforgiven.pl
[ { "docid": "0fe952c06672744668474b01c2c90aae", "score": "0.0", "text": "def map(record)\n result=hydrate(factory.get_or_allocate(self, record), record)\n # setting tainted values to none on automatic read\n result.instance_variable_set(:@tainted_values,[])\n result\n end", "ti...
[ { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.6237956", "text": "def anchored; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.611734", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
8a8c2a892ada4dd99d55071fb70dad9c
POST /banks POST /banks.json
[ { "docid": "f2b6294708ac312b06ce404beb4ea332", "score": "0.6765818", "text": "def create\n @bank = Bank.new(bank_params)\n\n if @bank.save\n redirect_to banks_path\n else\n render :new, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "aa76f391b498653261cd636df0a920be", "score": "0.69902056", "text": "def create\n @bank = Bank.new(bank_params)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Tank was successfully created.' }\n format.json { render :show, status...
581fd6593887a2b52f93575b89d78126
POST /confidences POST /confidences.json
[ { "docid": "ed119617b8c6fe29e4dbfd09cdc982b8", "score": "0.7079212", "text": "def create\n @confidence = Confidence.new(confidence_params)\n respond_to do |format|\n if @confidence.save\n format.html { redirect_to url_for(@confidence.confidence_object.metamorphosize), notice: 'Confiden...
[ { "docid": "e66235b9583776b7500611ee24647cdb", "score": "0.649341", "text": "def create\n @confidence_level = ConfidenceLevel.new(params[:confidence_level])\n\n respond_to do |format|\n if @confidence_level.save\n format.html { redirect_to @confidence_level, notice: 'Confidence level w...
11def4470d7378a4c7afc4212dba34ff
This is where the dirty work of actually computing the length of this sequence is done.
[ { "docid": "6f572ad9de96643f03be2b9f79a2367a", "score": "0.0", "text": "def compute\n\t\twhile @current != 1\n\t\t\tif (@current % 2) == 0\n\t\t\t\t@current = @current / 2\n\t\t\telse\n\t\t\t\t@current = (3 * @current) + 1\n\t\t\tend\n\t\t\tif not $d_fast then @seq[@count] = @current end\n\t\t\t@count +...
[ { "docid": "60a1128e8885530edea488e2de1f1211", "score": "0.8069752", "text": "def length\n @seq.length\n end", "title": "" }, { "docid": "60a1128e8885530edea488e2de1f1211", "score": "0.8069752", "text": "def length\n @seq.length\n end", "title": "" }, { "docid": "...
21bbc2ee5edff89a5425cf1be7151dd1
PATCH/PUT /registro_cursos/1 PATCH/PUT /registro_cursos/1.json
[ { "docid": "d60a682b589f5dc5a4a64e51eaccc755", "score": "0.68921083", "text": "def update\n respond_to do |format|\n if @registro_curso.update(registro_curso_params)\n format.html { redirect_to @registro_curso, notice: 'El registro del curso fue actualizado correctamente.' }\n form...
[ { "docid": "17cb90ddf7ddccd97325ebe26aa5470e", "score": "0.66872424", "text": "def update\n respond_to do |format|\n if @curso.update(curso_params)\n format.json { render json: \"Curso Actualizado\", status: :ok, location: @curso }\n else\n format.json { render json: @curso.er...
5dafb4ae04deb73f04e698cfc9e5be37
Returns the revision number immediately following revision, if at all possible. A block should always be passed to this method, which accepts a command to invoke and returns the result, although a particular SCM's implementation is not required to invoke the block. By default, this method simply returns the revision it...
[ { "docid": "89b1cf9ec45d409240a5aad318f250b6", "score": "0.6389355", "text": "def next_revision(revision)\n revision\n end", "title": "" } ]
[ { "docid": "4e564c120514af98ccc6c39457734fe2", "score": "0.62762356", "text": "def revision\n changed? ? current_revision : revisions.last\n end", "title": "" }, { "docid": "4e564c120514af98ccc6c39457734fe2", "score": "0.62762356", "text": "def revision\n changed? ? current_re...
97932eae0d92b15dfaeef4862d22c4f1
def reset_subtree_ranges(requirement) kids = requirement.subtree_ids kids.delete(requirement.id) kids.each do |kid| req = Requirement.find(kid) req.update_attributes(minimum: 0, most_likely: 0, maximum: 0) end end
[ { "docid": "970b8a0e1c4f127e37eaf75760b5a339", "score": "0.9393768", "text": "def reset_subtree_ranges\n\t\tkids = self.subtree_ids\n\t\tkids.delete(self.id)\n\t\tkids.each do |kid| \n\t\t\treq = Requirement.find(kid)\n\t\t\treq.update_attributes(minimum: 0, most_likely: 0, maximum: 0)\n\t\tend\n\tend",...
[ { "docid": "4ce5d6c77d9b1cfe278bdb77ee509e77", "score": "0.72287184", "text": "def update_tree_range_after_edit(requirement_old)\n\t\tmin = self.minimum - requirement_old.minimum\n\t\tml = self.most_likely - requirement_old.most_likely\n\t\tmax = self.maximum - requirement_old.maximum\n\n\t\tif self.par...
84d1aa17754ff158e6af7b104ec51810
DELETE /users/1 Deleting user available in DB.
[ { "docid": "1462b81f2aa69dc5215a7800e78704c4", "score": "0.0", "text": "def destroy\n @user.destroy\n end", "title": "" } ]
[ { "docid": "41fe59531f079d8fbfff6b5373d13de8", "score": "0.81021804", "text": "def delete_users\n delete(users_path)\n end", "title": "" }, { "docid": "336a0487d3e9be05d1726b7c9c98bbad", "score": "0.79540646", "text": "def delete_user\n client.delete(user)\n ...
e9d39a6d43117921ab57bfa08f1a3af7
Virtual field getter: formats the value as text.
[ { "docid": "c916a39ab9d230934feccbf43768ddb7", "score": "0.0", "text": "def formatted_account_wage()\n Format.float_to_percent( self.account_wage )\n end", "title": "" } ]
[ { "docid": "d5e422bd356983eb9d6420d36f4cb54d", "score": "0.7564556", "text": "def formatted_value\n self.class.formatted_value(@value)\n end", "title": "" }, { "docid": "8efb02026737ee3337bc59830e774ce6", "score": "0.7372982", "text": "def value(instance, view_context)\n ...
3656d2fe138c941c6f95c5ac720b64e4
Get all user meta data.
[ { "docid": "d09522d9d48e4ebcbfcf4f603cb86650", "score": "0.0", "text": "def get_source_image_meta_user(organization, hash, opts = {})\n data, _status_code, _headers = get_source_image_meta_user_with_http_info(organization, hash, opts)\n return data\n end", "title": "" } ]
[ { "docid": "8b7513efdb6e960e2d7dab9a8c6cf7fa", "score": "0.7568133", "text": "def index\n @user_meta = UserMetum.all\n end", "title": "" }, { "docid": "ec64c4351be8cb640bfaa0fcd91d7550", "score": "0.729138", "text": "def index\n @usermeta = Usermetum.all\n end", "title": ...
66b4e25a5010d23735995fa726b19b69
Register a new trusted device This API allows to register a new trusted device. If the device is already present, it returns the current associated Token and updates the name.
[ { "docid": "b3fd02503a7abac73c4d1aabc366c896", "score": "0.0", "text": "def device_authorization_post(inline_object7, opts = {})\n data, _status_code, _headers = device_authorization_post_with_http_info(inline_object7, opts)\n data\n end", "title": "" } ]
[ { "docid": "e9bdf9fa88566740d4be0818537c98f2", "score": "0.63465416", "text": "def register_device_token(device_token, payload = {})\n uri = device_token_uri(device_token)\n\n if payload.empty?\n response = @connection.put(uri)\n else\n response = @connection.put(uri, payload, JSON_HE...
2ec5fe5fb971924cf97c2aeaeb135fa7
Used to populate rows of libraries/samples to be entered for singleplex libraries
[ { "docid": "c41d2c8d859397e73c044eefb59d011e", "score": "0.62222236", "text": "def populate_libs\n @new_lib = []\n @lib_samples = []\n params[:nr_libs] ||= 4\n\n @lib_default = SeqLib.new(params[:lib_default])\n @sample_default = LibSample.new(:source_DNA => params[:sample_default][:sourc...
[ { "docid": "f6fc47a662f5653ba95f7734151ae927", "score": "0.59454507", "text": "def prepare_samples(test_suite = self.lot.item_master.test_suite)\n test_suite.test_standards.each do |ts|\n last_sample = self.lot.last_sample(ts.standard_id)\n if last_sample\n self.samples.build(last_sa...
9823c241a87414aa67d47871aa6df748
Initializes a new Client object
[ { "docid": "9d87a7bef8d71c1d9a329dd245997e42", "score": "0.0", "text": "def initialize(options = {})\n options.each do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end", "title": "" } ]
[ { "docid": "2a85311fa73007513487fd774e93893c", "score": "0.82632476", "text": "def initialize(options = {})\n @client = Client.new(options)\n end", "title": "" }, { "docid": "2a85311fa73007513487fd774e93893c", "score": "0.82632476", "text": "def initialize(options = {})\n @cli...
d7672bf4a91417156f1e1468a732f2be
Update Institution Account Update Institution Account
[ { "docid": "c1b915bb3e983aafec14d10ab27a9c83", "score": "0.0", "text": "def private_institution_accounts_update(account_id, account, opts = {})\n private_institution_accounts_update_with_http_info(account_id, account, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "812ce2c48111d67017f3fcdbd45efe17", "score": "0.7929174", "text": "def update\n @account = Account.by_user(current_user).find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Account was successfully updated.'\n ...
993d89090ae8b0fc75598ab683d41bae
Generates a chef standard download uri in the form of
[ { "docid": "b39f093e53514a0a1147d915f9a900bd", "score": "0.6744121", "text": "def generate_chef_standard_path(channel, platform, platform_version, filename)\n uri = []\n uri << endpoint.sub(/\\/$/, \"\")\n uri << channel\n uri << platform\n uri << platform_ve...
[ { "docid": "14d1e8efbfc4426556a1a2cd29d74314", "score": "0.7345854", "text": "def generate_download_uri(result)\n uri = []\n uri << endpoint.sub(/\\/$/, \"\")\n uri << result[\"repo\"]\n uri << result[\"path\"]\n uri << result[\"name\"]\n uri.join(\"...
bce5163bcc21c931a3a66ae76153c234
DELETE /organization_customers/1 DELETE /organization_customers/1.json
[ { "docid": "557405074b0394de5637e9f4c81ae7db", "score": "0.74484503", "text": "def destroy\n @organization_customer.destroy\n respond_to do |format|\n format.html { redirect_to organization_customers_url, notice: 'Organization customer was successfully destroyed.' }\n format.json { head ...
[ { "docid": "842a63ce1c9c6f4b776f49478eb940fe", "score": "0.7163376", "text": "def destroy\n @customer_detail.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "770cbbeb9ce5d628d10963346b33e41a", "score": "0.70786375...
202a428bd879a2f07b99a5d15760302a
Note: You will need to pass the school variable to each of these methods to include it in scope
[ { "docid": "e0663130f1ddafcb8fe839617fcf1889", "score": "0.0", "text": "def get_grade(school, name)\n\tschool[:students].each do |x|\n\t\tif x[:name] == name\n\t\t\treturn x[:grade]\n\t\tend\n\tend\nend", "title": "" } ]
[ { "docid": "cecca5f49437adaffe279c061b50e739", "score": "0.81759167", "text": "def school\n \n end", "title": "" }, { "docid": "3a9860b14563843b4e0805c65b924c74", "score": "0.7783287", "text": "def find_school ; end", "title": "" }, { "docid": "51c0f19a35afb77ae9a0e0...
79d8d76b1f92f936a93e148c23d963a4
Ensures that the triggers that maintain the current tables are instep with the table definition. The trigger created is intended to insert all new values into the current table. Originally this did a query back into the normal table, but that caused deadlocks, so here we automatically generate the column names. Because...
[ { "docid": "cd84fa99c70843706c2758a743ed5e79", "score": "0.6188205", "text": "def maintain_currency_triggers(table)\n current_table = \"current_#{table}\"\n columns = connection.columns(current_table).map(&:name)\n\n quoted_columns = columns.map { |n| quote_table_name(n) }.join(',')\n new_va...
[ { "docid": "0eb9b984e8268fed940457345cd7835a", "score": "0.6334933", "text": "def add_triggers_to_table(db_name, table)\n db = sql_connection.identifier(db_name)\n tbl_value = sql_connection.literal(table)\n tbl_identifier = sql_connection.identifier(table)\n track_tbl = sql_...
55ebf2fe407bf9ea0179c4fc6e7772ac
DELETE /constructions/1 DELETE /constructions/1.json
[ { "docid": "9c10bceea1e627f696cf659cf6844f39", "score": "0.79106337", "text": "def destroy\n @construction.destroy\n respond_to do |format|\n format.html { redirect_to constructions_url, notice: 'Construction was successfully destroyed.' }\n format.json { head :no_content }\n end\n e...
[ { "docid": "f10d0b82b8d54150064d5bb8acb28014", "score": "0.7784669", "text": "def destroy\n @construction = Construction.find(params[:id])\n @construction.destroy\n\n respond_to do |format|\n format.html { redirect_to(constructions_url) }\n format.xml { head :ok }\n end\n end", ...
cc89ac056b22829ceea092eb11074f9b
This script is used to check if the group is existing
[ { "docid": "95c0d12362c4ac20e2dc0a879b485972", "score": "0.66712314", "text": "def group_exists(element)\n name = element[\"group\"]\n auth = element[\"auth\"] \n body = {\n \"jsonrpc\" => \"2.0\",\n \"method\" => \"hostgroup.get\",\n \"params\" => {\n \"output\" => \"extend\",\n ...
[ { "docid": "23a8e3547fe112aa703422aab2685ab2", "score": "0.80163985", "text": "def has_group?(name)\n run(\"id -g #{name}\").success?\n end", "title": "" }, { "docid": "603d4408d30281d94a633d671fb3d495", "score": "0.7901532", "text": "def has_group?\n @group == ''\n e...
19a450293c766cb8eba306d7695474b5
GET /scores/new GET /scores/new.json
[ { "docid": "b322cc42c3bb46ebff67532ecfbc920b", "score": "0.7897887", "text": "def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @score }\n end\n end", "title": "" } ]
[ { "docid": "eb90ad09bb1ff26f87d40d2ac3fee446", "score": "0.7963461", "text": "def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @score }\n end\n end", "title": "" }, { "docid": "eb90ad09bb1ff26f87d40d2ac3fee4...
11589ffcf43144a6b0fc396ab7ca40ce
because random access is not supported, the only traversal supported considers each node in turn
[ { "docid": "f0f7850a28297baeed69627b50ed705b", "score": "0.0", "text": "def find(val)\n self.each {|n| return n if n.data == val }\n end", "title": "" } ]
[ { "docid": "59e3c7d64ea38cd40488707fa61c6ae9", "score": "0.70706993", "text": "def traverse; end", "title": "" }, { "docid": "c2244bafba633ec312dd40740c3b5189", "score": "0.65514994", "text": "def visit_node(n); end", "title": "" }, { "docid": "9d5d2fc42e869d66837aeba80e8...
3f819e0ad58b81e635b8e51a05070168
Formats a SELECT statement using the given options and the dataset options.
[ { "docid": "8bf40e000cb2e2eef8274b19c1d58968", "score": "0.6970375", "text": "def select_sql(opts = nil)\n opts = opts ? @opts.merge(opts) : @opts\n\n if sql = opts[:sql]\n return sql\n end\n\n columns = opts[:select]\n select_columns = columns ? column_list(c...
[ { "docid": "ed122a53e60ddf640cb2283f80e09198", "score": "0.694634", "text": "def select_sql(opts = nil)\n opts = opts ? @opts.merge(opts) : @opts\n \n if sql = opts[:sql]\n return sql\n end\n\n columns = opts[:select]\n select_columns = columns ? column_list(columns)...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c4eb023b58aa59bbba20c669eb26ca6a", "score": "0.0", "text": "def dish_menu_params\n params.require(:dish_menu).permit(:dish_id, :course)\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...
8f59738f1e1f2c0df95fde87cc680e4f
POST /contexts POST /contexts.json
[ { "docid": "22c4bafccb61838ac8a39f945cec42e9", "score": "0.6155182", "text": "def create\n @context = Context.new(params[:context])\n\n respond_to do |format|\n if @context.save\n #format.html { redirect_to @context, :notice => 'Context was successfully created.' }\n format.html...
[ { "docid": "c4f729469cea78637faca4fe7afd2f7f", "score": "0.65729547", "text": "def create\n @user = User.find(params[:user_id])\n @context = Context.new(params[:context])\n\n respond_to do |format|\n if @context.save\n format.html { redirect_to user_contexts_path(@user), notice: 'Li...
bf109db3a17350f6cde76305ff3a2de5
POST /question_templates POST /question_templates.json
[ { "docid": "d0de4e2b69fd636984ca15c8cee9d598", "score": "0.7033848", "text": "def create\n\n @question_template = QuestionTemplate.new(question_template_params)\n\n respond_to do |format|\n if @question_template.save\n format.html { redirect_to @question_template, notice: 'Question tem...
[ { "docid": "65c8c4a1b1f95f30dc42a992256623d1", "score": "0.7081798", "text": "def form_template_params\n params.permit(:name, questions: [:text, :type_id])\n end", "title": "" }, { "docid": "0b9891329e06a773fc9ebe97534d799b", "score": "0.6959694", "text": "def questionnaire_templ...
c0bbec4e5c6e5bfed0bb1f700efaa697
PUT /user_icons/1 PUT /user_icons/1.xml
[ { "docid": "90d417cd487b332fbabca18267979241", "score": "0.701396", "text": "def update\n @user_icon = UserIcon.find(params[:id])\n\n respond_to do |format|\n if @user_icon.update_attributes(params[:user_icon])\n flash[:notice] = 'UserIcon was successfully updated.'\n format.htm...
[ { "docid": "e5cfa46c86b79a63595f8a954991b73a", "score": "0.635812", "text": "def update\n @icon = MavenJnlp::Icon.find(params[:id])\n\n respond_to do |format|\n if @icon.update_attributes(params[:icon])\n flash[:notice] = 'MavenJnlp::Icon was successfully updated.'\n format.html...
6a0a1f45fe2ea2efa5a1d4357d3787eb
DELETE /registros/1 DELETE /registros/1.json
[ { "docid": "9597cde8fac8fd90896bf4c253ee7537", "score": "0.74318916", "text": "def destroy\n @registro = Registro.find(params[:id])\n @registro.destroy\n\n respond_to do |format|\n format.html { redirect_to registros_url }\n format.json { head :ok }\n end\n end", "title": "" ...
[ { "docid": "edaaf3d39655d6285f4b029b3b6aa34f", "score": "0.7486015", "text": "def destroy\n @regist_1.destroy\n respond_to do |format|\n format.html { redirect_to regist_1s_url, notice: 'Regist 1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
c956194f4749c26f10c400e2d68c9b92
Resume This method allows device to resume the call specified by the call_id.
[ { "docid": "f6c374e83e0f84be7364354e54b338df", "score": "0.0", "text": "def post_cti_mac_resume(mac, cti_mac_resume, opts = {})\n post_cti_mac_resume_with_http_info(mac, cti_mac_resume, opts)\n nil\n end", "title": "" } ]
[ { "docid": "0a7ae883c13c80c4c7b5ec085d0ea67a", "score": "0.74080634", "text": "def resume(aPhoneCall)\n if @ongoingCalls.include?(aPhoneCall) == nil\n raise 'Only ongoing calls can be resumed.'\n end\n self.activeCall= aPhoneCall\n end", "title": "" }, { "docid": "cf394e164c53...
528d0c170a6be6be5051cbbc8807208d
may not need this action below:
[ { "docid": "4472061160c42f3911da5c96b39a51db", "score": "0.0", "text": "def update\n @pref = Preference.find_by(id: params[:id])\n @pref.user_id = params[:user_id] || @pref.user_id\n @pref.category_id = params[:category_id] || @pref.category_id\n @pref.save\n render \"show.json.jbuilder\"...
[ { "docid": "468d85305e6de5748477545f889925a7", "score": "0.7030943", "text": "def inner_action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.69635224", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a24...
af363a13d6c6cc25671f232db5acdab7
Executes the loop that sends and receives the AGI messages to and from the AGI server
[ { "docid": "062c40bb21cd578d4a9531a124859786", "score": "0.69502693", "text": "def run\n if create_socket_connection\n while @current_call.isActive\n begin\n command = @agi_client.gets\n result = execute_command(command)\n response = @agi_client.write(result)\n ...
[ { "docid": "c2d9d843c454dc80b2639458513d5ac5", "score": "0.7175083", "text": "def main_loop\n # \n # Cycle through the buffer.\n #\n sz = Server.notification_buffer_size\n\n logger.info \"Sending #{sz} alerts\" if sz > 0\n\n #\n # Empty the buffer, one notification at ...
954a0a19c24a0850c7ffc4ae8ff9c3df
Add Name to this Name's Synonym, but don't transfer that Name's synonyms. Delete the other Name's old Synonym if there aren't any Name's in it anymore. Everything is saved. (NOTE: Creates a new Synonym for this Name if it doesn't already have one.) correct_name.transfer_synonym(incorrect_name)
[ { "docid": "914bf120d411fe765b234ee289102fa8", "score": "0.7604705", "text": "def transfer_synonym(name)\n # Make sure this name is attached to a synonym, creating one if necessary.\n unless synonym_id\n self.synonym = Synonym.create\n save\n end\n\n # Only transfer it over if it's...
[ { "docid": "2f437fff2ee1448c2935eb6f6bdad5cc", "score": "0.75829107", "text": "def transfer_synonym(name)\n return if self == name\n return if self.synonym && self.synonym == name.synonym\n\n name.clear_synonym\n self.merge_synonyms(name)\n end", "title": "" }, { "docid": "7e2ab...
66f3ea4091bae0bfae735759066503b9
Returns all external HTTP links found
[ { "docid": "da08885d5a74b01dd84b6304a7992525", "score": "0.668016", "text": "def external\n @external ||= http.select { |link| URL.new(link).host != host }\n end", "title": "" } ]
[ { "docid": "a7d1bd56a8b2ab493d89b59b94e32265", "score": "0.79861486", "text": "def external_links\n return [] if @links.empty?\n\n links = @links\n .reject { |link| link.relative_link?(host: @url.to_base) }\n .map(&:without_trailing_slash)\n\n Wgit::Utils.process...
a4014afcf688cb65f89cae59a2100d76
PATCH/PUT /image_series/1 PATCH/PUT /image_series/1.json
[ { "docid": "988851d9643192a3bcec7fc1b9a0b97d", "score": "0.75338197", "text": "def update\n respond_to do |format|\n if @image_series.update(image_series_params)\n format.html { redirect_to @image_series, notice: 'Image serie was successfully updated.' }\n format.json { render :sho...
[ { "docid": "eddef36464eeb1a6a948a643bad49d56", "score": "0.70146585", "text": "def update\n respond_to do |format|\n if @image_tag_series.update(image_tag_series_params)\n format.html { redirect_to @image_tag_series, notice: 'Image tag serie was successfully updated.' }\n format.js...
718fba82a02109a9e8da9674618abc62
Listens for a ticket number reference and provides the link to codebase.
[ { "docid": "759dc25dc6e9e50689e49ca2cfd2f8e5", "score": "0.530658", "text": "def listen(m)\n if /#([0-9]*)/.match(m.message)\n ticket = /#([0-9]*)/.match(m.message)[1]\n m.reply \"Did someone mention ticket ##{ticket}? Here's a link: \" + \"https://transmit.codebasehq.com/projects/br...
[ { "docid": "ec5e89a60b086638dc4f0841dbaaeeb4", "score": "0.58280396", "text": "def ticket number\n Geera::Ticket.new self, number\n end", "title": "" }, { "docid": "824f66921db5996d48fdb1488759a63e", "score": "0.5807928", "text": "def ticket\n end", "title": "" }, { ...
ecc3c5b37d2313ecb3935bfb887d3cbf
To require logins, use: before_filter :login_required restrict all actions before_filter :login_required, :only => [:edit, :update] only restrict these actions To skip this in a subclassed controller: skip_before_filter :login_required
[ { "docid": "295da19e48fe139f59748b8d1a1976e7", "score": "0.76452893", "text": "def login_required\n # skip login check if action is not protected\n return true unless protect?(action_name)\n\n # store current location so that we can \n # come back after the user logged in\n store_location...
[ { "docid": "0d8b082fb9826e1452608be841a34501", "score": "0.782892", "text": "def login_required\n access_denied unless logged_in?\n end", "title": "" }, { "docid": "0d8b082fb9826e1452608be841a34501", "score": "0.782892", "text": "def login_required\n access_denied unless logge...
58927f0316cab3190fa1bab3bfea51bc
generate a unique token id for new records
[ { "docid": "ede5c0ebaf3eb7fd1e9ead06a9876797", "score": "0.7505196", "text": "def generate_token\n\t\t\tself.id_token ||= SecureRandom.hex(8) \n\t\t\tif Professional.exists?(:id_token => id_token)\n\t\t\t\tself.id_token = nil\n\t\t\t\traise\n\t\t\tend\t\t\t\n\t\trescue Exception => e\n\t\t\t@token_attem...
[ { "docid": "b42ed6f27d7bb347f8c2d8e5cd07edc1", "score": "0.83967227", "text": "def generate_token\n if new_record?\n self.token = SecureRandom.uuid\n end\n end", "title": "" }, { "docid": "88db5bca0269ffc4fd6431eda6a4033c", "score": "0.8218787", "text": "def gener...
a0b95b100412afb399ea62f0bc71a57a
TODO: remove this once TerrainCollision makes it obsolete
[ { "docid": "9f420365afd0f15d67131f08bf70beab", "score": "0.5243665", "text": "def terrain_at(x_pos,y_pos)\n grid_x = x_pos / TileWidth\n grid_y = (y_pos - MapYOffset) / TileHeight\n @terrain[grid_x,grid_y]\n end", "title": "" } ]
[ { "docid": "14dba35aab41ba3e6fb3ab4f97e94b1d", "score": "0.67255557", "text": "def terrain_collision\n @terrain.each do |wall|\n draw_pos = wall.pos - @local_position + Vector.new(:x => 10, :y => 10)\n next if draw_pos.x.negative? ||\n draw_pos.y.negative? ||\n dra...
4736e80ef1c9c0b24d1af69738a97cc1
Matches based on type and the attribute "name"
[ { "docid": "96f12ef0687a74c8c561769f99bf3879", "score": "0.0", "text": "def has_entity? entity\n return true if (entities.select {|e| e.match? entity}).length > 0\n end", "title": "" } ]
[ { "docid": "3cd8fc4787d241c785112ade9145d98e", "score": "0.7315629", "text": "def match_names_of_attributes_with_their_types names_of_attributes, types_of_attributes\n for i in 0..(names_of_attributes.size - 1)\n @names_and_types_of_attributes[names_of_attributes[i]] = types_of_attributes[i]\n ...
a95c8d54d91ac83175b972036d083d04
rule('cond_clause' => 'LPAREN test ARROW recipient RPAREN').as 'cond_arrow_clause'
[ { "docid": "a9cbfd1f487bf143169d0937436240da", "score": "0.5516563", "text": "def reduce_cond_arrow_clause(_production, _range, _tokens, theChildren)\n [theChildren[1], theChildren[3]]\n end", "title": "" } ]
[ { "docid": "7176290f3c75bb7b9601a1c129f3d195", "score": "0.6344328", "text": "def test_cond(condition)\n test(b \"[[ #{condition} ]]\")\n end", "title": "" }, { "docid": "17cca22685f65c29f22b304124f6a29e", "score": "0.605664", "text": "def parse_condition; end", "titl...
50afdefa29606362b128462cf7d1098b
close the connection normally, stops the dispatch thread and closes the underlying connection cleanly
[ { "docid": "60b6d290f3a9fbcdf5bca0578139bfb2", "score": "0.0", "text": "def close\n sd_thread = nil\n\n @mutex.synchronize do\n return unless @czk\n inst, @czk = @czk, nil\n \n sd_thread = Thread.new(inst) do |_inst|\n stop_dispatch_thread!\n _inst.close\n end\...
[ { "docid": "f3112783ceba3c1b9970150944567865", "score": "0.79983974", "text": "def close()\n @connection.disconnect\n @connection = nil\n end", "title": "" }, { "docid": "3bf615e87daf34a06c72003d4d90dd00", "score": "0.79763544", "text": "def close()\n\t\t@connection.disc...
3078b94c10d08155894dd840fcbb84b9
total = gets.chomp puts "What is the percent of tax" percent = gets.chomp.to_f puts "How much money would you like to leave?" tip = gets.chomp.to_f
[ { "docid": "4924fbc20cedf059d20d58e0ba5d81ff", "score": "0.0", "text": "def get_response(query)\n puts query\n answer = gets.chomp.to_f\n return answer\nend", "title": "" } ]
[ { "docid": "fda6abadef9598313dd158c4e00d7470", "score": "0.8566402", "text": "def tip_calc\n puts \"What is the bill? \"\n bill = gets.to_f\n puts \"What is the tip percentage? \"\n tip_percent = gets.to_f / 100\n\n tip = tip_percent * bill\n total = bill + tip\n puts \"The total is $#{format('%....
8ab09514b8900a8cb6d2fc7ba8f6d4a8
PATCH/PUT /user_resumes/1 PATCH/PUT /user_resumes/1.json
[ { "docid": "07656be3517b2be8d003730561f3fd45", "score": "0.75555146", "text": "def update\n respond_to do |format|\n if @user_resume.update(user_resume_params)\n format.html { redirect_to @user_resume, notice: 'User resume was successfully updated.' }\n format.json { render :show, ...
[ { "docid": "9a9b22a546b25dd62f6ac0638772f826", "score": "0.7610799", "text": "def update\n authorize! :update, Resume, :message => 'Not authorized as an administrator.'\n @user = User.find(params[:user_id])\n @resume = @user.resumes.find(params[:id])\n\n respond_to do |format|\n if @res...
e8a4d6ab6b33c7e03e034723faf8e848
GET /lots GET /lots.json
[ { "docid": "e6f2f54ad5fcbe29527d45d9a311e242", "score": "0.0", "text": "def index\n # @lot_votes = Lot.find_with_reputation(:votes, :all, order: \"votes desc\")\n @all_lots = Lot.latest.sum('appraised_value') #all.sum(&:appraised_value)\n @commericial_appeal = Lot.latest.all_commericial_appeal....
[ { "docid": "50810dcc86037b63ec6bb938e9a4cfb8", "score": "0.68581796", "text": "def show\n @lot = Lot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lot }\n end\n end", "title": "" }, { "docid": "0bcb417ff81b2eb2...
0a7f64ea96bb1cb5bfe3e06ff67eb6b3
Submission hash describing how to submit this attribute
[ { "docid": "46976efd517d95bbc3faaedbd20d8f8d", "score": "0.0", "text": "def submit(*)\n { script: { queue_name: value } }\n end", "title": "" } ]
[ { "docid": "95ed967547f1ab19a41a714a9972a2c5", "score": "0.63399726", "text": "def hash\n strs = FIELDS.collect {|f| \"#{f}:#{send(f).inspect}\"}\n Digest::SHA256.hexdigest(strs.join(' '))\n end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "...
25e5e75aa4657ac61f5243b75e9c4c8a
attributes :id, :Name, :Beds
[ { "docid": "a88745ffcbd411f61c0adde075b79be1", "score": "0.6040655", "text": "def attributes *args\n data = super\n data[:hospital_id] = object.id\n data[:Name] = object.Name\n data[:Address] = object.Address\n data[:Beds] = object.Beds\n data\n end", "title": "" } ]
[ { "docid": "557b8106215ac907d12ab1efb2c67017", "score": "0.6744036", "text": "def rails_attributes\n [\"id\", \"name\", \"leagueId\", \"league\"]\n end", "title": "" }, { "docid": "84be1cc9b313923c52d189493762c143", "score": "0.62467915", "text": "def dog_type_attributes\n '\n ...
c40f6ce890f0799668cd2c4f987bd9aa
POST /budget_types POST /budget_types.json
[ { "docid": "ebc75f64e45a68d9f92775b325e0a819", "score": "0.71509635", "text": "def create\n @budget_type = BudgetType.new(params[:budget_type])\n\n respond_to do |format|\n if @budget_type.save\n format.html { redirect_to @budget_type, notice: 'Budget type was successfully created.' }\...
[ { "docid": "8016dc80662546ac4384a0c5fcbc3589", "score": "0.6912551", "text": "def create\n @budget_type = BudgetType.new(budget_type_params)\n\n respond_to do |format|\n if @budget_type.save\n format.html { redirect_to @budget_type, notice: t('controller.successfully_created', model: t...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "15bbd6148634eeae1703a9d0983f5a27", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8e69eb3ff3374e0db6fa9eb17958df65", "score": "0.78750724", "text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "6f74a32c6fdb67babd4a903e37b5baa4", "score": "0.77518034", "text":...
3234c0361d3c72c10e383e683c0ebe84
Returns the first child, unless node is a leaf
[ { "docid": "f982c1a87ea2f41ad31a1179007fb590", "score": "0.89664936", "text": "def first_child\n children.first unless is_leaf?\n end", "title": "" } ]
[ { "docid": "1feb3a2ec69887437551b8eaab870f6d", "score": "0.87615734", "text": "def get_first_child (node)\n if node[:__children__].length > 0\n return node[:__children__][0]\n else\n return nil\n end\n end", "title": "" }, { "docid": "8d80f5b4d7b90003d8f01372877eae3e", ...
39177a93babd37d0f4becd68b7b1e870
Return a patched version of a Jekyll instance
[ { "docid": "521d06e550675537062707734278fe93", "score": "0.5780461", "text": "def jekyll_new(config)\n site = Jekyll::Site.new(config)\n\n # Patched version of `write` that will push to Algolia instead of writing\n # on disk\n def site.write\n items = []\n is_verbose = ...
[ { "docid": "c8cd6450315f929a40adec852f90d725", "score": "0.6640158", "text": "def jekyll\n return unless env\n env&.jekyll\n end", "title": "" }, { "docid": "e1126f1125facbc74951e722ef7d5ea7", "score": "0.6134077", "text": "def get_site(config = {}, options = {})\n...
79fff0b7db490b82f7c381c80921d9a9
GET /locations/new GET /locations/new.xml
[ { "docid": "3c1672fa572615b15c5beead4f3d78e6", "score": "0.0", "text": "def new\n @pagetitle = \"Nuevo Local ..\"\n @location = Location.new\n @company = Company.find(params[:company_id])\n @location.company_id = @company.id\n @location[:website] = 'http://'\n puts @company.id\n \n ...
[ { "docid": "e079526edc36fbe4a6016190d3acb1a7", "score": "0.77003783", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2...
f0d5a416ab8053ea8e419a3a5b2884d1
create and set an instance variable and define an accessor method if it's not already there.
[ { "docid": "a9633716a2bae6da807909f083704963", "score": "0.0", "text": "def def_method(name, value)\n instance_variable_set(\"@#{name}\", value)\n # Don't overwrite existing methods unless it's id. id isnt fully\n # deprecatedin 1.8.7\n (return true) if respond_to?(name.to_sym) && n...
[ { "docid": "a781171d6f05a01eb019b89cb9e779fe", "score": "0.73499364", "text": "def add_instance_getters_and_setters(var)\n singleton = (class << self; self end)\n singleton.send :define_method, var.to_sym do\n instance_variable_get \"@#{var}\"\n end\n singleton.send :define_method, \"#{...
105e6e7592df604bfe26762fa84cd435
Parse the JSONObject into Generallog object. ==== Parameters jsonObject:: JSONObject contains the details of a general log. ==== Returns Generallog object.
[ { "docid": "9ed5f0b8b9f46130278786a9a21e7c57", "score": "0.82231164", "text": "def jsonToGenerallog(jsonObject)\r\n\t\t\t\tgenerallog = Generallog.new\r\n\t\t\t\t\r\n\t\t\t\tif jsonObject.has_key?(\"id\")\r\n\t\t\t\t\tgenerallog.setId(jsonObject[\"id\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(...
[ { "docid": "4dcde5b66ebd912e9c69d7d8d582ff82", "score": "0.686348", "text": "def jsonToBuglog(jsonObject)\r\n\t\t\t\tbuglog = Buglog.new\r\n\t\t\t\t\r\n\t\t\t\tif jsonObject.has_key?(\"id\")\r\n\t\t\t\t\tbuglog.setId(jsonObject[\"id\"])\r\n\t\t\t\tend\r\n\t\t\t\tif jsonObject.has_key?(\"notes\")\r\n\t\t...
58836cb76455ebc563084bc5c0b1dfd4
Configure backup Configure file server and timers for automated backup. If secret fields are omitted (password, passphrase) then use the previously set value.
[ { "docid": "eb53dc8c0f63cea6f38f1524d292d3ee", "score": "0.0", "text": "def configure_backup_config(backup_configuration, opts = {})\n data, _status_code, _headers = configure_backup_config_with_http_info(backup_configuration, opts)\n return data\n end", "title": "" } ]
[ { "docid": "edecc967994d5dfd0077e0770c9a6abe", "score": "0.6348037", "text": "def tcfg_secret_config_file(filename)\n confirm_config_file_existence filename\n tcfg_reset\n @tcfg_secret_config_filename = filename\n nil\n end", "title": "" }, { "docid": "6bc3f838011c0dfd...
564d88ee232beace2e6ed072f018f636
di = dental insurance
[ { "docid": "1f9976fb6b8b3450d115c69ba2a70021", "score": "0.0", "text": "def di_why_link()\n\t\treturn $test_driver.find_element(:id, \"new-patient-form\").find_element(:xpath => \"//div[@class='grid-whole no-title']/div[@class='grid-whole field-container']/div[@class='grid-half'][2]/div[@class='whydowea...
[ { "docid": "818c17e9ea0162b388ddeb3e90111f1d", "score": "0.66078115", "text": "def insurance\n end", "title": "" }, { "docid": "41b4712f81b9ac625f60249cba937f8e", "score": "0.6033069", "text": "def set_injury\n @injury = Injury.where(regular_inspection: @regular_inspection).find(...
d885d8eb710b660f4afe492ec42f54b9
Read the datetime cell and convert to, the datetime values for Roo
[ { "docid": "6726de6630d59d93c2bbbb7f74d4ec71", "score": "0.7122691", "text": "def read_cell_date_or_time(row, idx)\n cell = read_cell_content(row, idx)\n cell = cell.to_s.to_f\n if cell < 1.0\n value_type = :time\n f = cell * 24.0 * 60.0 * 60.0\n secs = f.round\n ...
[ { "docid": "dffe7d6b63255567f1cf9ca2983ab875", "score": "0.71300095", "text": "def read_cell_date_or_time(row, idx)\n cell = row.at(idx).to_s.to_f\n if cell < 1.0\n value_type = :time\n f = cell*24.0*60.0*60.0\n secs = f.round\n h = (secs / 3600.0).floor\n secs = secs - 36...
64c24ae6baee0d3583d12353cfc80450
define ListView_SetTextColor(hwnd, clrText) (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
[ { "docid": "233ce02fcfb4484dd9fa33dbd054f4cd", "score": "0.89955026", "text": "def ListView_SetTextColor(hwnd, clrText) send_listview_message(hwnd, :SETTEXTCOLOR, lparam: clrText) end", "title": "" } ]
[ { "docid": "6ca483b1e33cc203abae634c94d01580", "score": "0.87385917", "text": "def ListView_SetTextBkColor(hwnd, clrTextBk) send_listview_message(hwnd, :SETTEXTBKCOLOR, lparam: clrTextBk) end", "title": "" }, { "docid": "5c2b69e74f6f6644572d4a75af99f442", "score": "0.84536165", "text...
3c8b463fb01019f44b5f135313e0e1f2
.uniq removes any duplicate items and returns the new array
[ { "docid": "5491d11d30b7e6d9f8286c7c2fdc1414", "score": "0.0", "text": "def using_flatten(array)\n array.flatten\nend", "title": "" } ]
[ { "docid": "25dff2c8c59317f232c1138303c71a81", "score": "0.8096827", "text": "def using_uniq(array)\n array.uniq\n end", "title": "" }, { "docid": "96526b0048bae8dcfdfd7191435300a3", "score": "0.8051516", "text": "def my_uniq\n unique = []\n each_index { |i| unique << se...
7990f74aadd42cb147cce6c35c58deb3
Returns if the scenario should be uncoupled
[ { "docid": "f5abf3f6dd7cd51264a764e1f3749570", "score": "0.6769161", "text": "def uncouple?\n FALSEY_VALUES.include?(@data.fetch(:coupling, true))\n end", "title": "" } ]
[ { "docid": "f0d37ab90278f67ce19c9e4e3ed2cd72", "score": "0.68448156", "text": "def coupled?\n false\n end", "title": "" }, { "docid": "13c4319fc5a60aa479dc15322a2b223d", "score": "0.67640424", "text": "def unskipped?\n !skipped?\n end", "title": "" }, { "d...
fdd8e548fbbab2c15ecf33ec4d60c496
Set up the Class
[ { "docid": "7451c71590b15b5da28c9b04763309b7", "score": "0.0", "text": "def initialize( to = Passwords::MyName )\n \n # The SMTP server will not relay to external email addresses, so we use Outlook for external emailing\n # The user can specify a mailer using the attr_accessor if required\n if...
[ { "docid": "59d51aa4d0fadc523fe2174d6875ba70", "score": "0.81398857", "text": "def class_setup\n end", "title": "" }, { "docid": "f017a90cfa3958974983ca51efcf4c07", "score": "0.7641236", "text": "def initialize\n setup!\n end", "title": "" }, { "docid": "20...
38b5be720dc9362729fa00b90b668bd9
definning a new interventions
[ { "docid": "afb1afb4933c015b6275e260b134952c", "score": "0.6865066", "text": "def interventions\n @interventions = Intervention.new\n puts @interventions\n puts params\n \n \n end", "title": "" } ]
[ { "docid": "7e07553ea0f5a4145af486aa2a4e195f", "score": "0.62964386", "text": "def convention\n @convention ||= request.env['intercode.convention']\n end", "title": "" }, { "docid": "54dd2868222a8c7001ff7ade23bcdfc6", "score": "0.61190385", "text": "def invention; end", "titl...
7cf1818f1ee6eb84f0597ab454f7b122
Method for code fix logic
[ { "docid": "c1cc28aa6ffe5228cdb99c7eaa773fa9", "score": "0.5983384", "text": "def fix_code(code)\n return '8' if code.to_i >= 1_000_000 # condition for error code\n code.gsub(/[\\/|,]/, '').scan(REGEX).flatten.join(',')\n end", "title": "" } ]
[ { "docid": "7ebc1fa22470acdeb4d6ae27458f7025", "score": "0.7110406", "text": "def replace_this_with_appropriate_code(x) end", "title": "" }, { "docid": "a650bff5d95d968c1e4f9bb58ceae333", "score": "0.68709576", "text": "def revert_code()\n\t\t\n\tend", "title": "" }, { "d...
49f36eca2c2cc727a4a7023befb6648c
= DESCRIPTION Returns xrefs only for samples from a given dataset (ExpressionDB::Dataset object)
[ { "docid": "484d58e511075783bff675fdce948132", "score": "0.8010358", "text": "def xrefs_by_dataset(dataset)\n\t\t\treturn self.xref_samples.select{|x| x.sample.dataset == dataset }.sort_by{|x| x.sample.name}\n\t\tend", "title": "" } ]
[ { "docid": "4263c13e7f848177df2f4e260b8810fa", "score": "0.70270544", "text": "def xrefs_by_sample(sample)\n\t\t\treturn self.xref_samples.select{|x| x.sample == sample}\n\t\tend", "title": "" }, { "docid": "4263c13e7f848177df2f4e260b8810fa", "score": "0.70270544", "text": "def xrefs...
ef64790366e81ce87ee0f554cbb76492
Iteration over datasets containing values of all columns
[ { "docid": "645c97ba1c155e1e8c3d3564cb99f52d", "score": "0.0", "text": "def each(&block)\n objects = []\n (0...size).each {|i| objects << selectBy_index([i])}\n objects.each(&block)\n end", "title": "" } ]
[ { "docid": "1bf566e750349c39e9a9486db3aebd45", "score": "0.68737125", "text": "def each( &block )\n @cols.values.map { |col| col.values }.flatten.compact.each &block\n end", "title": "" }, { "docid": "1bf566e750349c39e9a9486db3aebd45", "score": "0.68737125", "text": "def each...
330a68655111968b0420a2963b48ab1c
GET /ads/1 GET /ads/1.json
[ { "docid": "889719448a109827d8a427f79b4390f1", "score": "0.0", "text": "def show\n @ad = Ad.find(params[:id])\n @user = @ad.user\n @current_user = current_user\n @json = User.comments_user(@ad).to_gmaps4rails\n session[:return_to] = request.fullpath\n respond_with @ad\n end", "tit...
[ { "docid": "397753e4473df4d73e604f5001dc8ac7", "score": "0.7767281", "text": "def index\n render json: @ads = Ad.all\n end", "title": "" }, { "docid": "be19c2173d10cd6028819c12f100d511", "score": "0.7702106", "text": "def show\n @ad = Ad.find(params[:id])\n\n render json: @...
2d7e263b948cf7745365b1a0ef4920f9
Get the top tags for this track on Last.fm, ordered by tag count. Supply either track & artist name or mbid. Options +track+:: The track name in question +artist+:: The artist name in question +mbid+:: The musicbrainz id for the track
[ { "docid": "9ab1c1632862da6e41e07ca1cc16deb1", "score": "0.67230064", "text": "def top_tags(options={})\n get(:standard, {:method => \"track.getTopTags\"}.merge(options))\n end", "title": "" } ]
[ { "docid": "d85c40a7a14e5b93eefc9f6ad6eba500", "score": "0.728175", "text": "def top_tags\n lfm_path = \"artist.getTopTags&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Tag.create_from_hash(Hash.from_xml(lfm_data)['lfm']['toptags']['tag']) \n end", "title": ...
e7bf5ad74b211f7e3c02c71957957187
POST /groups POST /groups.js
[ { "docid": "40afe9c7f919aee1815c392d3228dbad", "score": "0.0", "text": "def create\n g_params = group_params\n\n @template = @project.templates.find_by_id(params[:group][:template_id]) if @project && params[:group]\n\n if @template\n @group = @template.generate_stickies!(current_user, g_pa...
[ { "docid": "5cb4ab8a327fe1e230609263ea21fe93", "score": "0.7712713", "text": "def create\n @group_params = group_params.to_json\n @reponse = HTTParty.post(\"https://rails-api-ipo.herokuapp.com/api/v1/groups.json\",\n :body => @group_params,\n :headers => { 'Content-Type' => 'application/json...
4b81be03b3fded35aa73c7112bdc5d9f
Determines length of string and returns an all cap version of string if length > 10
[ { "docid": "8f73c783c74045ac4b22c42f591e4bdb", "score": "0.6731096", "text": "def all_caps(phrase)\n phrase_length = phrase.length\n if phrase_length > 10\n phrase.upcase\n end\nend", "title": "" } ]
[ { "docid": "97c196f3866a9e2540906581c312d65f", "score": "0.7859567", "text": "def string_cap(string)\n if string.length > 10\n return string.upcase\n else\n string\n end\nend", "title": "" }, { "docid": "d18a9658d02a7c445b4f493f78c3ef26", "score": "0.7787084", "text": "def c...
4ba3562c504eb6b801ef6aa7da63315e
Returns true if output was set to a value.
[ { "docid": "603971d80d3f1127c9f949041496e9e6", "score": "0.0", "text": "def value?\n @fields.nil?\n end", "title": "" } ]
[ { "docid": "7faf5a86306263367743dae627bd6fa4", "score": "0.7389779", "text": "def output?\n @output.nil? ? false : !!@output\n end", "title": "" }, { "docid": "a4ad135b451cb0925e4d17b9bdf088d4", "score": "0.7167784", "text": "def produces_value?\n outputs.edges.any...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9d5485a132722e9a5a5691efea62a10f", "score": "0.0", "text": "def set_booking\n @booking = Booking.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...
5b9f556d396dab5ea12d0f8e02aafa32
A radiolist box is similar to a menu box. The only difference is that you can indicate which entry is currently selected, by setting its status to true.
[ { "docid": "bffc8187a634dc75c28abdc481d4a070", "score": "0.55277747", "text": "def radiolist(text, items, height=0, width=0, listheight=0)\n\n tmp = Tempfile.new('tmp')\n\n itemlist = String.new\n\n for item in items\n if item[2]\n item[2] = \"on\"\n else\n item[2] = \"o...
[ { "docid": "d8cdb6adbd95a4429733acfbcd85ca08", "score": "0.6269661", "text": "def radio_button(*args)\n opts = args.last\n opts[:checked] = \"checked\" if opts.is_a?(Hash) && opts.delete(:checked)\n super\n end", "title": "" }, { "docid": "2995a0a08d25b6fadfb35ae928fffe92",...
f492eed339084013a649afe75724d15d
Get Holiday By Id
[ { "docid": "4330ce5415ae059dd6855898e0e8c465", "score": "0.56216556", "text": "def system_holiday_lists_id_holidays_holiday_id_get(id, holiday_id, opts = {})\n data, _status_code, _headers = system_holiday_lists_id_holidays_holiday_id_get_with_http_info(id, holiday_id, opts)\n return data\n ...
[ { "docid": "278da9fd56f053cbc6a886af7f7815c4", "score": "0.7673171", "text": "def holiday\n Holiday.find_by(holiday_date: self.scheduled_on)\n end", "title": "" }, { "docid": "634c5129dac53caff7143600735c7549", "score": "0.76086557", "text": "def set_holiday\n @holiday = Holid...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2aa3db6545d6ffeee2e68b4ca22e6242", "score": "0.0", "text": "def mymicropost_params\n params.require(:mymicropost).permit(:content, :user_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...
9ed56b0d3dab79445087364b5061588f
PATCH/PUT /triplaces/1 PATCH/PUT /triplaces/1.json
[ { "docid": "26262e9493d83c2340e09e10916f93fd", "score": "0.7102094", "text": "def update\n respond_to do |format|\n if @triplace.update(triplace_params)\n format.html { redirect_to @triplace, notice: 'Triplace was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "ace544e760996192072da81787dd771c", "score": "0.7095077", "text": "def update\n respond_to do |format|\n format.any(:trips_json, :json) do\n if @trip.update(trip_params)\n head :no_content\n else\n render json: @trip.errors, status: :unproce...
7b3c3b2d7998beb37c426bee8e10692d
Transform Mumuki Request into Docker file style
[ { "docid": "c817615df748cc8c8233eef876d10a7e", "score": "0.46133834", "text": "def compile_file_content(request)\n parse_tests request.test\n student_code = parse_student_code \"#{request.content&.strip}#{get_final_query}\"\n {\n init: \"#{request.extra&.strip}\",\n student: st...
[ { "docid": "003bc4559bd8c2f71725a54b8f401eb2", "score": "0.6106914", "text": "def dockerfile_data\n data = [\"FROM #{package}\"]\n data << 'COPY _switch /'\n data << 'COPY wheel /etc/sudoers.d/'\n data << \"RUN /_switch #{userargs} 2>&1\"\n data << 'ENV LC_ALL en_US.UTF-8'\n data << \"...
f1697c595fe226e135c8f5a090f6a460
Don't try to handle integer minus regexp could, but would be very hardtomaintain code. Should be O(n) with sane implementation of regex and scan. Might should precompile the regex but this is only called once per input string.
[ { "docid": "d1340f8efce3d9556e28d25348ae1238", "score": "0.0", "text": "def tokenize(string)\n string.scan(/[+*\\/()-]|\\d+/)\nend", "title": "" } ]
[ { "docid": "ab05924d0f45feafdda1ab78c5a27ef4", "score": "0.6527272", "text": "def integer_detector_regex\n /\\A-?([1-9]\\d*|0)\\z/\n end", "title": "" }, { "docid": "ecefb24c28fae58b64f0c452ad54c418", "score": "0.64601463", "text": "def get_number_from_string(s)\n s.gsub(/[^...
ef30104dab890f7489acd40c24485837
PATCH/PUT /conversations/1 PATCH/PUT /conversations/1.json
[ { "docid": "d9b245f06f1a11d13794aead1882baf0", "score": "0.65278566", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { render :sh...
[ { "docid": "3e54d05f63dfa852336c0059fb7719a7", "score": "0.7030763", "text": "def update_conversation(id, data)\n put(\"conversations/#{id}\", { body: data })\n end", "title": "" }, { "docid": "3e54d05f63dfa852336c0059fb7719a7", "score": "0.7030763", "text": "def update_conversat...
940a7a85cba963e4bdcb7a692806b34e
returns the index of the current host in th list of flume masters
[ { "docid": "f09981e55137fba8167bcceec495d907", "score": "0.740171", "text": "def flume_master_id\n flume_masters.find_index( ClusterChef::NodeUtils.private_ip_of( node ) )\n end", "title": "" } ]
[ { "docid": "9aec6d96e42fb18f4ec92616611f5806", "score": "0.6447658", "text": "def master\n # remote_instances_list.select {|a| a.master }.first\n @list = list_from_remote\n @list.reject {|a| a unless a.name =~ /master/ }.first if @list.class != String\n end", "title": "" ...
8d056ae95cc67592bfa1d312a9ef20d8
8. Write a function that takes in a string and returns the string repeated 5 times. Then run the function and print the result.
[ { "docid": "c3e29ea0f1c95486513441e9b166f207", "score": "0.79376036", "text": "def repeater(string)\n return string * 5\nend", "title": "" } ]
[ { "docid": "6cb312c9a7e8638e8bf3d1d87ba0735d", "score": "0.786219", "text": "def repeat_yourself(string,number)\n number.times { puts string }\nend", "title": "" }, { "docid": "b94d9bdb3af526aabe6bcffe18481f83", "score": "0.7782156", "text": "def repeat(string, num)\n num.times {pu...
1756830e240f774b803c0dd2cbf82680
If an invalid array is passed in (/0 for example), It will return an error code and nil
[ { "docid": "60b916f9c3bd540ed6ebd7e75e988d17", "score": "0.5426746", "text": "def test_invalid_eval_a\n assert_equal [5, nil], @eval.evaluate([8, 0, '/'])\n end", "title": "" } ]
[ { "docid": "47008f60f198788fe8bf6ccaff47a9b8", "score": "0.6278359", "text": "def checkValidOperation(array)\n if array.length < 2\n abort('Not enough arguments to perform an operation. Input string is invalid. Aborting')\n end\nend", "title": "" }, { "docid": "5c788b3d0c575479dcee76242...
d57ba44c136df8c6b7b66b325c461a52
strong params allowing title and content to come through
[ { "docid": "420ac3bd5e0fe3d3b4d83f6e4f1b9471", "score": "0.0", "text": "def post_params\n params.require(:post).permit(:title, :content)\n end", "title": "" } ]
[ { "docid": "6dfbb8e495b5d3b496ea2d14bcbac6a7", "score": "0.68357736", "text": "def title_params\r\n params.fetch(:title, {}).permit(:approved, :id, :archived, :chinese_title, :pinyin_title, :institution_one, :institution_two, :institution_three)\r\n end", "title": "" }, { "docid": "0...
dba1f8ccf0c8d11adeeadaf9f04b40d5
Returns the eigenvector matrix +V+
[ { "docid": "3fcc46f967218f7223ede219c79af581", "score": "0.8144349", "text": "def eigenvector_matrix\n Matrix.send(:new, build_eigenvectors.transpose)\n end", "title": "" } ]
[ { "docid": "f846cfd1a9c4900d0b3abc7693c85266", "score": "0.8465083", "text": "def eigenvector_matrix; end", "title": "" }, { "docid": "006c34158460ca1cb38a0760228a152b", "score": "0.81772774", "text": "def eigv(x)\n check_matrix_square(x)\n if x.symmetric?\n return Eigen.s...
fe676988fdef8af2bb5c1ebebedb1c77
Add a single choice
[ { "docid": "1779b5dec7a673d09b75fe4f487b722a", "score": "0.5799967", "text": "def choice(*value, &block)\n if block\n @choices << (value << block)\n else\n @choices << value\n end\n end", "title": "" } ]
[ { "docid": "520306426aa4d3dea015ca56588a28a3", "score": "0.7545239", "text": "def addChoice(choice_name = \"new choice\")\n choice = Embeddable::MultipleChoiceChoice.new(:choice => choice_name)\n self.choices << choice\n self.save\n choice\n end", "title": "" }, { "docid": "e801...
4247fa2f67f91fe458df4d37405ce858
PATCH/PUT /daw_relacions/1 PATCH/PUT /daw_relacions/1.json
[ { "docid": "7be1bffb298d96f594f36287e31cf369", "score": "0.5862801", "text": "def update\n respond_to do |format|\n if @daw_relacion.update(daw_relacion_params)\n format.html { redirect_to @daw_relacion, notice: 'Daw relacion was successfully updated.' }\n format.json { render :sho...
[ { "docid": "a8731ce98571af93626e9ecb5b35dfef", "score": "0.6418729", "text": "def update\n respond_to do |format|\n if @recepy.update(recepy_params)\n format.html { redirect_to @recepy, notice: 'Recepie was successfully updated.' }\n format.json { render :show, status: :ok, locatio...
f4501b546b210181b7c9bb2bb48ac851
Set the current run state.
[ { "docid": "9f3b3b04289147aadcbc1bac458bd319", "score": "0.0", "text": "def set_current(source)\n @current = new(source)\n debug { \"#{@current[:state].upcase} | source = #{source.inspect}\" }\n end", "title": "" } ]
[ { "docid": "7680d3bd1c50e31fe83a52e1dde1dfcf", "score": "0.69448185", "text": "def set_state(state)\n @current_state = state\n end", "title": "" }, { "docid": "fe9962331cb98700278b5ee3c8ecffb8", "score": "0.67946166", "text": "def set_current_state(state)\n @__current_stat...
411ebdf9c1bfa2931a246d12b786787d
This function can be used by library developer to prepare their modules for the New Architecture. It passes the Folly Flags to the module, it configures the search path and installs some New Architecture specific dependencies. Parameters: spec: The spec that has to be configured with the New Architecture code new_arch_...
[ { "docid": "2a5ae2001203f89187cb46562b65ef8c", "score": "0.7368366", "text": "def install_modules_dependencies(spec, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == \"1\")\n NewArchitectureHelper.install_modules_dependencies(spec, new_arch_enabled, $FOLLY_VERSION)\nend", "title": "" } ]
[ { "docid": "fa54f0b36df6e5283f60e3d219b532e8", "score": "0.59281707", "text": "def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPathsNorCompilerFlagsArePresent_itInstallDependencies\n # Arrange\n spec = SpecMock.new\n\n # Act\n NewArchitectureHelper...
2eb5194850f099a562d4c2c505346de1
This method will provide more indepth details about a selected job from the list after a search was done. It checks to make sure that the selection is actually a part of the list.
[ { "docid": "e21915bda4fe0f3b39877567fa24afbd", "score": "0.0", "text": "def job_expand(input)\n input = input.split('').first.to_i - 1\n job = []\n system \"clear\"\n if (0..Ironjobs::API.list.length).include?(input)\n job << Ironjobs::Jobs.create_job(Ironjobs::API...
[ { "docid": "5db838a9733e59d4a4d32efb79e51a69", "score": "0.6386565", "text": "def user_joblist\n if @active_user.list.length == 0\n system \"clear\n \"\n puts \"You have not saved any jobs to your profile yet!\n \n \".light_blue\n ...
b2fb31cd6fe1935df6b3764d3d32bad2
sort = recent or popular
[ { "docid": "513557844bce2d328a1d5883eb1d3b8e", "score": "0.0", "text": "def tips(venue_id, params={:sort => \"recent\"})\n perform_graph_request(\"venues/#{venue_id}/tips\", params)\n end", "title": "" } ]
[ { "docid": "efa05fe98f51acc1d01e56ff223f3306", "score": "0.6701394", "text": "def default_sort\n facet_tags? ? 'revised_at' : '_score'\n end", "title": "" }, { "docid": "77e5fad4c7deea43c1407bf3503d8489", "score": "0.6657787", "text": "def popularity_list\r\n\t\t@popular_list.sor...
5f36cafa444bb66c735b64dbee46c7fa
def authorize unless User.find_by(id: session[:user_id]) || User.count == 0 redirect_to login_url, notice: "Please log in" end end
[ { "docid": "aa1e9a5e9e973fc7444f09196f6aab7f", "score": "0.0", "text": "def authorize\n \t\t#teste http://localhost:3000/products/2/who_bought.atom\n \t\t#ou curl --silent --user dave:secret http://localhost:3000/products/2/who_bought.atom \n \t\treturn if User.count.zero?\n\n \t\tif request.format ...
[ { "docid": "d754ef23bb4267f2a4ade67b7e1f405e", "score": "0.92585355", "text": "def authorize\n unless User.find_by(id: session[:user_id])\n redirect_to login_url, notice: \"Please log in\"\n end\n end", "title": "" }, { "docid": "2520ec8b9e1e38a7b62a2c6b62d72655", "score": "0...
fbce2a63d2f5654fee66276e781319d0
compares an array of words to see if they are all palindromes this could have been written to test if all strings are palindromes of each other, but this is easier
[ { "docid": "6de78928c267e768811eeda4bde25f72", "score": "0.71257937", "text": "def are_palindromes?\n self.all? {|s| s == s.reverse }\n end", "title": "" } ]
[ { "docid": "e216bc212aeacf1a3e267afad8030004", "score": "0.7913382", "text": "def palindromes(words)\n words_array = words.split\n result = []\n words_array.each do |word|\n result << word.downcase if word.reverse == word\n end\n result.sort!{|a,b| a.downcase <=> b.downcase}\n res...
bb3f45ac0c7dee21d49063726679f6ea
GET /deployable_applications/1 GET /deployable_applications/1.json
[ { "docid": "f7ccee1c34616b0af582dd0fcc834f69", "score": "0.0", "text": "def show\n\tend", "title": "" } ]
[ { "docid": "346ae7b460d58be3a2f9f546e2435d07", "score": "0.73482114", "text": "def show\n @app_deployment = AppDeployment.find(params[:id])\n @application = @app_deployment.application\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_deploymen...
5b20b67e5de25de98367aecadbbc8180
DELETE /jobs/1 DELETE /jobs/1.json
[ { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7676213", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "66db0ef98d50e458b6aaead27c514ac5", "score": "0.79578227", "text": "def delete(args)\n options = { body: args, basic_auth: { username: @api_key } }\n Try { self.class.post(\"/api/jobs/delete.json\", options) }.to_either >-> response {\n if response.code == 200\n Righ...
efb3e92342f02d969a0ec6b64fd6c38f
DELETE /work/1 DELETE /work/1.json
[ { "docid": "8fbea507342da74ed21a8a1e597ca2fc", "score": "0.0", "text": "def destroy\n @work.destroy\n render_success_format('Entrada eliminada', @work, true)\n rescue Exception => e\n render_default_error e, 401\n end", "title": "" } ]
[ { "docid": "eebbccf91b7f14b21d85e720c4e64d07", "score": "0.75456613", "text": "def destroy\n @work = Work.find(params[:id])\n @work.destroy\n\n respond_to do |format|\n format.html { redirect_to works_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
04d3f8f50f2f6bf4db636053a9169fa5
New Quotation create full ajax
[ { "docid": "f8795dc2de9fa870a3f4b180dae82556", "score": "0.0", "text": "def new_create\n respond_to do |format|\n format.html\n end\n end", "title": "" } ]
[ { "docid": "00f0eb2345a046b285043af0fc71ece9", "score": "0.6553384", "text": "def new\n @quotation = Quotation.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quotation }\n end\n end", "title": "" }, { "docid": "fe0621462ca85fe3fb92...
eb61a93d33491de89f7f312b6bf1e9fc
Only relevant or matching templates will be listed
[ { "docid": "a03c62204df9ee06c0c90de17e77c1c4", "score": "0.0", "text": "def list_sizer_templates\n return if authorise_for_web('runs', 'production_run_setup') == false\n\n run = session[:current_production_run]\n commodity = run.production_schedule.rmt_setup.commodity_code\n variety = run.pr...
[ { "docid": "bf4d36fe1b073d2617f77c6eb643164e", "score": "0.6805402", "text": "def importable_wilds\n wilds.select {|w| Hash === w && w['IMPORT_TEMPLATE'] }\n end", "title": "" }, { "docid": "c8322097c3872489e7e0b1d83f78ed5b", "score": "0.6756833", "text": "def scan_...